Re: [PATCH 4/4] USB: Remove omap2 support from omap_udc.c
On Mon, May 21, 2012 at 12:01:11PM -0700, Tony Lindgren wrote: There are no active users of this code for omap2 as the boards in use have either TUSB or MUSB controller. While at it, also fix warnings related to uninitialized dc_clk and hhc_clk. Cc: linux-...@vger.kernel.org Cc: Felipe Balbi ba...@ti.com Cc: Kyungmin Park kyungmin.p...@samsung.com Signed-off-by: Tony Lindgren t...@atomide.com This one doesn't depend on the rest of the series, I can take it myself to v3.6 or you can take it with your series: Acked-by: Felipe Balbi ba...@ti.com --- drivers/usb/gadget/omap_udc.c | 113 - 1 file changed, 23 insertions(+), 90 deletions(-) diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c index 2acf06c..913587f 100644 --- a/drivers/usb/gadget/omap_udc.c +++ b/drivers/usb/gadget/omap_udc.c @@ -62,9 +62,6 @@ #define DMA_ADDR_INVALID(~(dma_addr_t)0) -#define OMAP2_DMA_CH(ch) (((ch) - 1) 1) -#define OMAP24XX_DMA(name, ch) (OMAP24XX_DMA_##name + OMAP2_DMA_CH(ch)) - /* * The OMAP UDC needs _very_ early endpoint setup: before enabling the * D+ pullup to allow enumeration. That's too early for the gadget @@ -537,12 +534,8 @@ static void next_in_dma(struct omap_ep *ep, struct omap_req *req) : OMAP_DMA_SYNC_ELEMENT; int dma_trigger = 0; - if (cpu_is_omap24xx()) - dma_trigger = OMAP24XX_DMA(USB_W2FC_TX0, ep-dma_channel); - /* measure length in either bytes or packets */ if ((cpu_is_omap16xx() length = UDC_TXN_TSC) - || (cpu_is_omap24xx() length ep-maxpacket) || (cpu_is_omap15xx() length ep-maxpacket)) { txdma_ctrl = UDC_TXN_EOT | length; omap_set_dma_transfer_params(ep-lch, OMAP_DMA_DATA_TYPE_S8, @@ -601,28 +594,14 @@ static void next_out_dma(struct omap_ep *ep, struct omap_req *req) int dma_trigger = 0; u16 w; - if (cpu_is_omap24xx()) - dma_trigger = OMAP24XX_DMA(USB_W2FC_RX0, ep-dma_channel); - - /* NOTE: we filtered out short reads before, so we know - * the buffer has only whole numbers of packets. - * except MODE SELECT(6) sent the 24 bytes data in OMAP24XX DMA mode - */ - if (cpu_is_omap24xx() packets ep-maxpacket) { - omap_set_dma_transfer_params(ep-lch, OMAP_DMA_DATA_TYPE_S8, - packets, 1, OMAP_DMA_SYNC_ELEMENT, - dma_trigger, 0); - req-dma_bytes = packets; - } else { - /* set up this DMA transfer, enable the fifo, start */ - packets /= ep-ep.maxpacket; - packets = min(packets, (unsigned)UDC_RXN_TC + 1); - req-dma_bytes = packets * ep-ep.maxpacket; - omap_set_dma_transfer_params(ep-lch, OMAP_DMA_DATA_TYPE_S16, - ep-ep.maxpacket 1, packets, - OMAP_DMA_SYNC_ELEMENT, - dma_trigger, 0); - } + /* set up this DMA transfer, enable the fifo, start */ + packets /= ep-ep.maxpacket; + packets = min(packets, (unsigned)UDC_RXN_TC + 1); + req-dma_bytes = packets * ep-ep.maxpacket; + omap_set_dma_transfer_params(ep-lch, OMAP_DMA_DATA_TYPE_S16, + ep-ep.maxpacket 1, packets, + OMAP_DMA_SYNC_ELEMENT, + dma_trigger, 0); omap_set_dma_dest_params(ep-lch, OMAP_DMA_PORT_EMIFF, OMAP_DMA_AMODE_POST_INC, req-req.dma + req-req.actual, 0, 0); @@ -761,10 +740,7 @@ static void dma_channel_claim(struct omap_ep *ep, unsigned channel) ep-dma_channel = channel; if (is_in) { - if (cpu_is_omap24xx()) - dma_channel = OMAP24XX_DMA(USB_W2FC_TX0, channel); - else - dma_channel = OMAP_DMA_USB_W2FC_TX0 - 1 + channel; + dma_channel = OMAP_DMA_USB_W2FC_TX0 - 1 + channel; status = omap_request_dma(dma_channel, ep-ep.name, dma_error, ep, ep-lch); if (status == 0) { @@ -781,11 +757,7 @@ static void dma_channel_claim(struct omap_ep *ep, unsigned channel) 0, 0); } } else { - if (cpu_is_omap24xx()) - dma_channel = OMAP24XX_DMA(USB_W2FC_RX0, channel); - else - dma_channel = OMAP_DMA_USB_W2FC_RX0 - 1 + channel; - + dma_channel = OMAP_DMA_USB_W2FC_RX0 - 1 + channel; status = omap_request_dma(dma_channel, ep-ep.name, dma_error, ep, ep-lch); if (status == 0) { @@ -809,7 +781,7 @@ static void dma_channel_claim(struct omap_ep *ep, unsigned channel) omap_disable_dma_irq(ep-lch,
Re: [PATCH 4/4] USB: Remove omap2 support from omap_udc.c
* Felipe Balbi ba...@ti.com [120522 00:15]: On Mon, May 21, 2012 at 12:01:11PM -0700, Tony Lindgren wrote: There are no active users of this code for omap2 as the boards in use have either TUSB or MUSB controller. While at it, also fix warnings related to uninitialized dc_clk and hhc_clk. Cc: linux-...@vger.kernel.org Cc: Felipe Balbi ba...@ti.com Cc: Kyungmin Park kyungmin.p...@samsung.com Signed-off-by: Tony Lindgren t...@atomide.com This one doesn't depend on the rest of the series, I can take it myself to v3.6 or you can take it with your series: Yes you can take this one. Thanks, Tony -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 4/4] USB: Remove omap2 support from omap_udc.c
There are no active users of this code for omap2 as the boards in use have either TUSB or MUSB controller. While at it, also fix warnings related to uninitialized dc_clk and hhc_clk. Cc: linux-...@vger.kernel.org Cc: Felipe Balbi ba...@ti.com Cc: Kyungmin Park kyungmin.p...@samsung.com Signed-off-by: Tony Lindgren t...@atomide.com --- drivers/usb/gadget/omap_udc.c | 113 - 1 file changed, 23 insertions(+), 90 deletions(-) diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c index 2acf06c..913587f 100644 --- a/drivers/usb/gadget/omap_udc.c +++ b/drivers/usb/gadget/omap_udc.c @@ -62,9 +62,6 @@ #defineDMA_ADDR_INVALID(~(dma_addr_t)0) -#define OMAP2_DMA_CH(ch) (((ch) - 1) 1) -#define OMAP24XX_DMA(name, ch) (OMAP24XX_DMA_##name + OMAP2_DMA_CH(ch)) - /* * The OMAP UDC needs _very_ early endpoint setup: before enabling the * D+ pullup to allow enumeration. That's too early for the gadget @@ -537,12 +534,8 @@ static void next_in_dma(struct omap_ep *ep, struct omap_req *req) : OMAP_DMA_SYNC_ELEMENT; int dma_trigger = 0; - if (cpu_is_omap24xx()) - dma_trigger = OMAP24XX_DMA(USB_W2FC_TX0, ep-dma_channel); - /* measure length in either bytes or packets */ if ((cpu_is_omap16xx() length = UDC_TXN_TSC) - || (cpu_is_omap24xx() length ep-maxpacket) || (cpu_is_omap15xx() length ep-maxpacket)) { txdma_ctrl = UDC_TXN_EOT | length; omap_set_dma_transfer_params(ep-lch, OMAP_DMA_DATA_TYPE_S8, @@ -601,28 +594,14 @@ static void next_out_dma(struct omap_ep *ep, struct omap_req *req) int dma_trigger = 0; u16 w; - if (cpu_is_omap24xx()) - dma_trigger = OMAP24XX_DMA(USB_W2FC_RX0, ep-dma_channel); - - /* NOTE: we filtered out short reads before, so we know -* the buffer has only whole numbers of packets. -* except MODE SELECT(6) sent the 24 bytes data in OMAP24XX DMA mode -*/ - if (cpu_is_omap24xx() packets ep-maxpacket) { - omap_set_dma_transfer_params(ep-lch, OMAP_DMA_DATA_TYPE_S8, - packets, 1, OMAP_DMA_SYNC_ELEMENT, - dma_trigger, 0); - req-dma_bytes = packets; - } else { - /* set up this DMA transfer, enable the fifo, start */ - packets /= ep-ep.maxpacket; - packets = min(packets, (unsigned)UDC_RXN_TC + 1); - req-dma_bytes = packets * ep-ep.maxpacket; - omap_set_dma_transfer_params(ep-lch, OMAP_DMA_DATA_TYPE_S16, - ep-ep.maxpacket 1, packets, - OMAP_DMA_SYNC_ELEMENT, - dma_trigger, 0); - } + /* set up this DMA transfer, enable the fifo, start */ + packets /= ep-ep.maxpacket; + packets = min(packets, (unsigned)UDC_RXN_TC + 1); + req-dma_bytes = packets * ep-ep.maxpacket; + omap_set_dma_transfer_params(ep-lch, OMAP_DMA_DATA_TYPE_S16, + ep-ep.maxpacket 1, packets, + OMAP_DMA_SYNC_ELEMENT, + dma_trigger, 0); omap_set_dma_dest_params(ep-lch, OMAP_DMA_PORT_EMIFF, OMAP_DMA_AMODE_POST_INC, req-req.dma + req-req.actual, 0, 0); @@ -761,10 +740,7 @@ static void dma_channel_claim(struct omap_ep *ep, unsigned channel) ep-dma_channel = channel; if (is_in) { - if (cpu_is_omap24xx()) - dma_channel = OMAP24XX_DMA(USB_W2FC_TX0, channel); - else - dma_channel = OMAP_DMA_USB_W2FC_TX0 - 1 + channel; + dma_channel = OMAP_DMA_USB_W2FC_TX0 - 1 + channel; status = omap_request_dma(dma_channel, ep-ep.name, dma_error, ep, ep-lch); if (status == 0) { @@ -781,11 +757,7 @@ static void dma_channel_claim(struct omap_ep *ep, unsigned channel) 0, 0); } } else { - if (cpu_is_omap24xx()) - dma_channel = OMAP24XX_DMA(USB_W2FC_RX0, channel); - else - dma_channel = OMAP_DMA_USB_W2FC_RX0 - 1 + channel; - + dma_channel = OMAP_DMA_USB_W2FC_RX0 - 1 + channel; status = omap_request_dma(dma_channel, ep-ep.name, dma_error, ep, ep-lch); if (status == 0) { @@ -809,7 +781,7 @@ static void dma_channel_claim(struct omap_ep *ep, unsigned channel) omap_disable_dma_irq(ep-lch, OMAP_DMA_BLOCK_IRQ); /* channel type P: hw synch (fifo) */ - if (cpu_class_is_omap1() !cpu_is_omap15xx()) + if (!cpu_is_omap15xx())