Thread (19 messages) 19 messages, 4 authors, 2018-01-30

Re: [PATCH 1/4] dmaengine: qcom: bam_dma: make bam clk optional

From: Srinivas Kandagatla <hidden>
Date: 2018-01-17 09:46:44
Also in: dmaengine, linux-arm-msm, lkml


On 16/01/18 19:38, Sagar Dharia wrote:
On 1/16/2018 12:02 PM, srinivas.kandagatla@linaro.org wrote:
quoted
From: Srinivas Kandagatla <redacted>

When BAM is remotely controlled it does not sound correct to control
its clk on Linux side. Make it optional, so that its not madatory
for remote controlled BAM instances.

Signed-off-by: Srinivas Kandagatla <redacted>
---
  drivers/dma/qcom/bam_dma.c | 15 ++++++++-------
  1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c
index 03c4eb3fd314..78e488e8f96d 100644
--- a/drivers/dma/qcom/bam_dma.c
+++ b/drivers/dma/qcom/bam_dma.c
@@ -1180,13 +1180,14 @@ static int bam_dma_probe(struct 
platform_device *pdev)
                          "qcom,controlled-remotely");
      bdev->bamclk = devm_clk_get(bdev->dev, "bam_clk");
-    if (IS_ERR(bdev->bamclk))
-        return PTR_ERR(bdev->bamclk);
-
-    ret = clk_prepare_enable(bdev->bamclk);
-    if (ret) {
-        dev_err(bdev->dev, "failed to prepare/enable clock\n");
-        return ret;
+    if (IS_ERR(bdev->bamclk)) {
+        bdev->bamclk = NULL;
+    } else {
+        ret = clk_prepare_enable(bdev->bamclk);
+        if (ret) {
+            dev_err(bdev->dev, "failed to prepare/enable clock\n");
+            return ret;
+        }
I believe you can also keep pm_runtime disabled if BAM is remotely 
controlled.
Yes, that's another topic which should be fixed too. I will add that 
patch in next version.

thanks,
srini
Thanks
Sagar
quoted
      }
      ret = bam_init(bdev);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help