[PATCH 17/27] usb: musb: define DMA controller related flags and callbacks in glue ops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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>
---
 drivers/usb/musb/musb_core.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index ae92e3c..89d8de2 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -261,6 +261,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
+
 
 /**
  * struct musb_platform_ops - Operations passed to musb_core by HW glue layer
@@ -275,6 +279,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;
@@ -294,6 +300,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 *);
 };
 
 /*
-- 
1.7.3

--
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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux