linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] k3dma: Upgrade k3dma drever to support hisi_asp_dma hardware
@ 2018-12-28  6:36 h00249924
  2018-12-28  6:36 ` [PATCH 2/3] dmaengine: Extend the k3dma driver binding h00249924
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: h00249924 @ 2018-12-28  6:36 UTC (permalink / raw)
  To: dmaengine, devicetree, linux-kernel, linux-arm-kernel
  Cc: Youlin Wang, hanxiaolong3, suzhuangluan, hantanglei, kongfei,
	ninggaoyu, Vinod Koul, liyuequan, Dan Williams, huangli295,
	wangyoulin1, cash.qianli

From: Youlin Wang <wwx575822@notesmail.huawei.com>

There is an new "hisi-pcm-asp-dma-1.0" device added in
"arch/arm64/boot/dts/hisilicon/hi3660.dtsi".
So we have to add a matching id in the driver file:
"{ .compatible = "hisilicon,hisi-pcm-asp-dma-1.0", }"

And also hisi-pcm-asp dma device needs no setting to the clock.
So we skip this by "if" sentence on id string matching:
"if (strcasecmp((of_id->compatible), (k3_pdma_dt_ids[0].compatible)) == 0)"

After above this driver will support both k3 and hisi_asp dma hardware.

Signed-off-by: Youlin Wang <wwx575822@notesmail.huawei.com>
Signed-off-by: Tanglei Han <hantanglei@huawei.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Vinod Koul <vkoul@kernel.org>
---
 drivers/dma/k3dma.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c
index fdec2b6..10eecc2 100644
--- a/drivers/dma/k3dma.c
+++ b/drivers/dma/k3dma.c
@@ -792,6 +792,7 @@ static int k3_dma_transfer_resume(struct dma_chan *chan)
 
 static const struct of_device_id k3_pdma_dt_ids[] = {
 	{ .compatible = "hisilicon,k3-dma-1.0", },
+	{ .compatible = "hisilicon,hisi-pcm-asp-dma-1.0", },
 	{}
 };
 MODULE_DEVICE_TABLE(of, k3_pdma_dt_ids);
@@ -835,10 +836,12 @@ static int k3_dma_probe(struct platform_device *op)
 				"dma-requests", &d->dma_requests);
 	}
 
-	d->clk = devm_clk_get(&op->dev, NULL);
-	if (IS_ERR(d->clk)) {
-		dev_err(&op->dev, "no dma clk\n");
-		return PTR_ERR(d->clk);
+	if (strcasecmp((of_id->compatible), (k3_pdma_dt_ids[0].compatible)) == 0) {
+		d->clk = devm_clk_get(&op->dev, NULL);
+		if (IS_ERR(d->clk)) {
+			dev_err(&op->dev, "no dma clk\n");
+			return PTR_ERR(d->clk);
+		}
 	}
 
 	irq = platform_get_irq(op, 0);
-- 
1.9.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-01-04 17:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-28  6:36 [PATCH 1/3] k3dma: Upgrade k3dma drever to support hisi_asp_dma hardware h00249924
2018-12-28  6:36 ` [PATCH 2/3] dmaengine: Extend the k3dma driver binding h00249924
2019-01-02 18:00   ` John Stultz
2019-01-03 23:21   ` Rob Herring
2018-12-28  6:36 ` [PATCH 3/3] arm64: dts: hi3660: Add hisi asp dma device h00249924
2019-01-04  2:44   ` Rob Herring
2019-01-04 17:24 ` [PATCH 1/3] k3dma: Upgrade k3dma drever to support hisi_asp_dma hardware Vinod Koul
2019-01-04 17:32   ` John Stultz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).