[PATCH 21/28] usb: musb: print dma type in runtime way

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

 



From: Ming Lei <tom.leiming@xxxxxxxxx>

We will support multiple dma controller type in one single
musb core driver(binary), so print dma type by the
information from hw glue driver.

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

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 245bdc2..0a1ac52 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2045,6 +2045,8 @@ bad_config:
 		musb_writeb = __musb_writeb;
 	}
 
+	dev_info(dev, "dma type: %s\n", get_dma_name(musb));
+
 	/* The musb_platform_init() call:
 	 *   - adjusts musb->mregs and musb->isr if needed,
 	 *   - may initialize an integrated tranceiver
@@ -2503,18 +2505,6 @@ static int __init musb_init(void)
 #endif
 
 	pr_info("%s: version " MUSB_VERSION ", "
-#ifdef CONFIG_MUSB_PIO_ONLY
-		"pio"
-#elif defined(CONFIG_USB_TI_CPPI_DMA)
-		"cppi-dma"
-#elif defined(CONFIG_USB_INVENTRA_DMA)
-		"musb-dma"
-#elif defined(CONFIG_USB_TUSB_OMAP_DMA)
-		"tusb-omap-dma"
-#else
-		"?dma?"
-#endif
-		", "
 #ifdef CONFIG_USB_MUSB_OTG
 		"otg (peripheral+host)"
 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index 89d8de2..e42b20d 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -678,4 +678,20 @@ static inline int musb_platform_exit(struct musb *musb)
 	return musb->ops->exit(musb);
 }
 
+static inline const char *get_dma_name(struct musb *musb)
+{
+#ifdef CONFIG_MUSB_PIO_ONLY
+	return "pio";
+#else
+	if (musb->ops->flags & MUSB_GLUE_DMA_INVENTRA)
+		return "musb->dma";
+	else if (musb->ops->flags & MUSB_GLUE_DMA_CPPI)
+		return "cppi-dma";
+	else if (musb->ops->flags & MUSB_GLUE_DMA_TUSB)
+		return "tusb-omap-dma";
+	else
+		return "?dma?";
+#endif
+}
+
 #endif	/* __MUSB_CORE_H__ */
-- 
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