Hello. tom.leiming@xxxxxxxxx wrote:
From: Ming Lei <tom.leiming@xxxxxxxxx>
Each musb hw controller may use different DMA controller, so we introduce dma controller related flags and callbacks in glue ops. HW glue driver can provide its dma controller information to musb core with this flags and callbacks, so we can make musb core more generic and avoid to depend on the ugly macro below as far as possible:
CONFIG_USB_INVENTRA_DMA CONFIG_USB_TUSB_OMAP_DMA CONFIG_USB_TI_CPPI_DMA
Signed-off-by: Ming Lei <tom.leiming@xxxxxxxxx>
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index e0c3376..d328158 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h @@ -239,6 +239,10 @@ enum musb_g_ep0_state { #define MUSB_GLUE_TUSB_STYLE 0x0001 #define MUSB_GLUE_EP_ADDR_FLAT_MAPPING 0x0002 #define MUSB_GLUE_EP_ADDR_INDEXED_MAPPING 0x0004 +#define MUSB_GLUE_DMA_INVENTRA 0x0008 +#define MUSB_GLUE_DMA_CPPI 0x0010 +#define MUSB_GLUE_DMA_TUSB 0x0020 +
I've already asked you to properly align the macro values. :-/ Also please align the macro names too, preferrably using only one tab.
@@ -253,6 +257,8 @@ enum musb_g_ep0_state { * @set_vbus: forces vbus status * @read_fifo: read data from musb fifo in PIO * @write_fifo: write data into musb fifo in PIO + * @dma_controller_create: create dma controller for me + * @dma_controller_destroy: destroy dma controller */ struct musb_platform_ops { short fifo_mode; @@ -272,6 +278,9 @@ struct musb_platform_ops { void (*set_vbus)(struct musb *musb, int on); void (*read_fifo)(struct musb_hw_ep *hw_ep, u16 len, u8 *buf); void (*write_fifo)(struct musb_hw_ep *hw_ep, u16 len, const u8 *buf); + struct dma_controller* (*dma_controller_create)(struct musb *, + void __iomem *); + void (*dma_controller_destroy)(struct dma_controller *); };
I've also suggested shorter names? Are you not OK with those? WBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html