[PATCH v1 21/27] 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 f118551..3600aea 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2035,6 +2035,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
@@ -2488,18 +2490,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 781e1ad..5b3557c 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -665,4 +665,20 @@ static inline u8 musb_platform_get_hw_revision(struct musb *musb)
 	return musb->ops->get_hw_revision(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