diff mbox series

[v2] usb: musb: Fix use without CPPI 4.1 DMA controller on DA8xx

Message ID e7e8c70295733c8cbc016943b8e42f450079cd4a.1598966671.git.esben@geanix.com
State New
Headers show
Series [v2] usb: musb: Fix use without CPPI 4.1 DMA controller on DA8xx | expand

Commit Message

Esben Haabendal Sept. 1, 2020, 1:29 p.m. UTC
In commit d6299b6efbf6 ("usb: musb: Add support of CPPI 4.1 DMA controller
to DA8xx") use of musb on da8xx without CPPI 4.1 DMA was broken.

Fixes: d6299b6efbf6 ("usb: musb: Add support of CPPI 4.1 DMA controller to DA8xx")
Signed-off-by: Esben Haabendal <esben@geanix.com>
---
 drivers/usb/musb/da8xx.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index 1c023c0091c4..4bdf704d078e 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -467,7 +467,10 @@  da8xx_dma_controller_create(struct musb *musb, void __iomem *base)
 
 static const struct musb_platform_ops da8xx_ops = {
 	.quirks		= MUSB_INDEXED_EP | MUSB_PRESERVE_SESSION |
-			  MUSB_DMA_CPPI41 | MUSB_DA8XX,
+#ifdef CONFIG_USB_TI_CPPI41_DMA
+			  MUSB_DMA_CPPI41 |
+#endif
+			  MUSB_DA8XX,
 	.init		= da8xx_musb_init,
 	.exit		= da8xx_musb_exit,
 
@@ -553,10 +556,12 @@  static int da8xx_probe(struct platform_device *pdev)
 	}
 	platform_set_drvdata(pdev, glue);
 
-	ret = of_platform_populate(pdev->dev.of_node, NULL,
-				   da8xx_auxdata_lookup, &pdev->dev);
-	if (ret)
-		return ret;
+	if (IS_ENABLED(CONFIG_USB_TI_CPPI41_DMA)) {
+		ret = of_platform_populate(pdev->dev.of_node, NULL,
+					   da8xx_auxdata_lookup, &pdev->dev);
+		if (ret)
+			return ret;
+	}
 
 	memset(musb_resources, 0x00, sizeof(*musb_resources) *
 			ARRAY_SIZE(musb_resources));