提交 dc8fca6c 编写于 作者: B Bin Liu 提交者: Greg Kroah-Hartman

usb: musb: remove duplicated quirks flag

Both musb_io and musb_platform_ops in struct musb define a quirks flag
for the same purpose.  Let's remove the one in struct musb_io, and use
that in struct musb_platform_ops instead.
Signed-off-by: NBin Liu <b-liu@ti.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 113ad151
...@@ -1493,7 +1493,7 @@ static int musb_core_init(u16 musb_type, struct musb *musb) ...@@ -1493,7 +1493,7 @@ static int musb_core_init(u16 musb_type, struct musb *musb)
hw_ep->fifo = musb->io.fifo_offset(i) + mbase; hw_ep->fifo = musb->io.fifo_offset(i) + mbase;
#if IS_ENABLED(CONFIG_USB_MUSB_TUSB6010) #if IS_ENABLED(CONFIG_USB_MUSB_TUSB6010)
if (musb->io.quirks & MUSB_IN_TUSB) { if (musb->ops->quirks & MUSB_IN_TUSB) {
hw_ep->fifo_async = musb->async + 0x400 + hw_ep->fifo_async = musb->async + 0x400 +
musb->io.fifo_offset(i); musb->io.fifo_offset(i);
hw_ep->fifo_sync = musb->sync + 0x400 + hw_ep->fifo_sync = musb->sync + 0x400 +
...@@ -2176,11 +2176,9 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) ...@@ -2176,11 +2176,9 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
goto fail2; goto fail2;
} }
if (musb->ops->quirks)
musb->io.quirks = musb->ops->quirks;
/* Most devices use indexed offset or flat offset */ /* Most devices use indexed offset or flat offset */
if (musb->io.quirks & MUSB_INDEXED_EP) { if (musb->ops->quirks & MUSB_INDEXED_EP) {
musb->io.ep_offset = musb_indexed_ep_offset; musb->io.ep_offset = musb_indexed_ep_offset;
musb->io.ep_select = musb_indexed_ep_select; musb->io.ep_select = musb_indexed_ep_select;
} else { } else {
...@@ -2188,7 +2186,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) ...@@ -2188,7 +2186,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
musb->io.ep_select = musb_flat_ep_select; musb->io.ep_select = musb_flat_ep_select;
} }
if (musb->io.quirks & MUSB_G_NO_SKB_RESERVE) if (musb->ops->quirks & MUSB_G_NO_SKB_RESERVE)
musb->g.quirk_avoids_skb_reserve = 1; musb->g.quirk_avoids_skb_reserve = 1;
/* At least tusb6010 has its own offsets */ /* At least tusb6010 has its own offsets */
...@@ -2647,7 +2645,7 @@ static int musb_suspend(struct device *dev) ...@@ -2647,7 +2645,7 @@ static int musb_suspend(struct device *dev)
; ;
musb->flush_irq_work = false; musb->flush_irq_work = false;
if (!(musb->io.quirks & MUSB_PRESERVE_SESSION)) if (!(musb->ops->quirks & MUSB_PRESERVE_SESSION))
musb_writeb(musb->mregs, MUSB_DEVCTL, 0); musb_writeb(musb->mregs, MUSB_DEVCTL, 0);
WARN_ON(!list_empty(&musb->pending_list)); WARN_ON(!list_empty(&musb->pending_list));
......
...@@ -614,7 +614,7 @@ static int cppi41_dma_channel_abort(struct dma_channel *channel) ...@@ -614,7 +614,7 @@ static int cppi41_dma_channel_abort(struct dma_channel *channel)
} }
/* DA8xx Advisory 2.3.27: wait 250 ms before to start the teardown */ /* DA8xx Advisory 2.3.27: wait 250 ms before to start the teardown */
if (musb->io.quirks & MUSB_DA8XX) if (musb->ops->quirks & MUSB_DA8XX)
mdelay(250); mdelay(250);
tdbit = 1 << cppi41_channel->port_num; tdbit = 1 << cppi41_channel->port_num;
...@@ -773,7 +773,7 @@ cppi41_dma_controller_create(struct musb *musb, void __iomem *base) ...@@ -773,7 +773,7 @@ cppi41_dma_controller_create(struct musb *musb, void __iomem *base)
controller->controller.is_compatible = cppi41_is_compatible; controller->controller.is_compatible = cppi41_is_compatible;
controller->controller.musb = musb; controller->controller.musb = musb;
if (musb->io.quirks & MUSB_DA8XX) { if (musb->ops->quirks & MUSB_DA8XX) {
controller->tdown_reg = DA8XX_USB_TEARDOWN; controller->tdown_reg = DA8XX_USB_TEARDOWN;
controller->autoreq_reg = DA8XX_USB_AUTOREQ; controller->autoreq_reg = DA8XX_USB_AUTOREQ;
controller->set_dma_mode = da8xx_set_dma_mode; controller->set_dma_mode = da8xx_set_dma_mode;
......
...@@ -44,31 +44,31 @@ struct musb_hw_ep; ...@@ -44,31 +44,31 @@ struct musb_hw_ep;
#endif #endif
#ifdef CONFIG_USB_UX500_DMA #ifdef CONFIG_USB_UX500_DMA
#define musb_dma_ux500(musb) (musb->io.quirks & MUSB_DMA_UX500) #define musb_dma_ux500(musb) (musb->ops->quirks & MUSB_DMA_UX500)
#else #else
#define musb_dma_ux500(musb) 0 #define musb_dma_ux500(musb) 0
#endif #endif
#ifdef CONFIG_USB_TI_CPPI41_DMA #ifdef CONFIG_USB_TI_CPPI41_DMA
#define musb_dma_cppi41(musb) (musb->io.quirks & MUSB_DMA_CPPI41) #define musb_dma_cppi41(musb) (musb->ops->quirks & MUSB_DMA_CPPI41)
#else #else
#define musb_dma_cppi41(musb) 0 #define musb_dma_cppi41(musb) 0
#endif #endif
#ifdef CONFIG_USB_TI_CPPI_DMA #ifdef CONFIG_USB_TI_CPPI_DMA
#define musb_dma_cppi(musb) (musb->io.quirks & MUSB_DMA_CPPI) #define musb_dma_cppi(musb) (musb->ops->quirks & MUSB_DMA_CPPI)
#else #else
#define musb_dma_cppi(musb) 0 #define musb_dma_cppi(musb) 0
#endif #endif
#ifdef CONFIG_USB_TUSB_OMAP_DMA #ifdef CONFIG_USB_TUSB_OMAP_DMA
#define tusb_dma_omap(musb) (musb->io.quirks & MUSB_DMA_TUSB_OMAP) #define tusb_dma_omap(musb) (musb->ops->quirks & MUSB_DMA_TUSB_OMAP)
#else #else
#define tusb_dma_omap(musb) 0 #define tusb_dma_omap(musb) 0
#endif #endif
#ifdef CONFIG_USB_INVENTRA_DMA #ifdef CONFIG_USB_INVENTRA_DMA
#define musb_dma_inventra(musb) (musb->io.quirks & MUSB_DMA_INVENTRA) #define musb_dma_inventra(musb) (musb->ops->quirks & MUSB_DMA_INVENTRA)
#else #else
#define musb_dma_inventra(musb) 0 #define musb_dma_inventra(musb) 0
#endif #endif
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
/** /**
* struct musb_io - IO functions for MUSB * struct musb_io - IO functions for MUSB
* @quirks: platform specific flags
* @ep_offset: platform specific function to get end point offset * @ep_offset: platform specific function to get end point offset
* @ep_select: platform specific function to select end point * @ep_select: platform specific function to select end point
* @fifo_offset: platform specific function to get fifo offset * @fifo_offset: platform specific function to get fifo offset
...@@ -25,7 +24,6 @@ ...@@ -25,7 +24,6 @@
* @busctl_offset: platform specific function to get busctl offset * @busctl_offset: platform specific function to get busctl offset
*/ */
struct musb_io { struct musb_io {
u32 quirks;
u32 (*ep_offset)(u8 epnum, u16 offset); u32 (*ep_offset)(u8 epnum, u16 offset);
void (*ep_select)(void __iomem *mbase, u8 epnum); void (*ep_select)(void __iomem *mbase, u8 epnum);
u32 (*fifo_offset)(u8 epnum); u32 (*fifo_offset)(u8 epnum);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册