[PATCH v1 27/27] usb: musb: implement runtime is_inventra_dma/is_cppi_enabled/tusb_dma_omap

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

 



From: Ming Lei <tom.leiming@xxxxxxxxx>

Now we can implement the three helpers below in runtime method:

	is_inventra_dma/is_cppi_enabled/tusb_dma_omap

so we can build all hw glue drivers, dma drivers and musb_hdrc into
one single binary image to support musb on mulitple machines.

Signed-off-by: Ming Lei <tom.leiming@xxxxxxxxx>
---
 drivers/usb/musb/musb_core.h |   19 +++++++++++++++++++
 drivers/usb/musb/musb_dma.h  |   18 ------------------
 2 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index 5b3557c..78725df 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -681,4 +681,23 @@ static inline const char *get_dma_name(struct musb *musb)
 #endif
 }
 
+#ifdef CONFIG_USB_INVENTRA_DMA
+#define	is_inventra_dma(musb)	(musb->ops->flags & MUSB_GLUE_DMA_INVENTRA)
+#else
+#define	is_inventra_dma(musb)	0
+#endif
+
+#ifdef CONFIG_USB_TI_CPPI_DMA
+#define	is_cppi_enabled(musb)	(musb->ops->flags & MUSB_GLUE_DMA_CPPI)
+
+#else
+#define	is_cppi_enabled(musb)	0
+#endif
+
+#ifdef CONFIG_USB_TUSB_OMAP_DMA
+#define tusb_dma_omap(musb)			(musb->ops->flags & MUSB_GLUE_DMA_TUSB)
+#else
+#define tusb_dma_omap(musb)			0
+#endif
+
 #endif	/* __MUSB_CORE_H__ */
diff --git a/drivers/usb/musb/musb_dma.h b/drivers/usb/musb/musb_dma.h
index dbc6d3d..df5a735 100644
--- a/drivers/usb/musb/musb_dma.h
+++ b/drivers/usb/musb/musb_dma.h
@@ -68,24 +68,6 @@ struct musb_hw_ep;
 #define	is_dma_capable()	(0)
 #endif
 
-#ifdef CONFIG_USB_INVENTRA_DMA
-#define	is_inventra_dma(musb)	1
-#else
-#define	is_inventra_dma(musb)	0
-#endif
-
-#ifdef CONFIG_USB_TI_CPPI_DMA
-#define	is_cppi_enabled(musb)	1
-#else
-#define	is_cppi_enabled(musb)	0
-#endif
-
-#ifdef CONFIG_USB_TUSB_OMAP_DMA
-#define tusb_dma_omap(musb)			1
-#else
-#define tusb_dma_omap(musb)			0
-#endif
-
 /* Anomaly 05000456 - USB Receive Interrupt Is Not Generated in DMA Mode 1
  *	Only allow DMA mode 1 to be used when the USB will actually generate the
  *	interrupts we expect.
-- 
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