diff mbox series

[v10,2/3] clk: qcom: lpasscc-sc7280: Skip qdsp6ss clock registration

Message ID 20230331152805.3199968-3-quic_mohs@quicinc.com (mailing list archive)
State Superseded
Headers show
Series Add resets for ADSP based audio clock controller driver | expand

Commit Message

Mohammad Rafi Shaik March 31, 2023, 3:28 p.m. UTC
From: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>

The qdsp6ss memory region is being shared by ADSP remoteproc device and
lpasscc clock device, hence causing memory conflict.
To avoid this, when qdsp6ss clocks are being enabled in remoteproc driver,
skip qdsp6ss clock registration if "qcom,adsp-pil-mode" is enabled.

Fixes: 4ab43d171181 ("clk: qcom: Add lpass clock controller driver for SC7280")
Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
---
 drivers/clk/qcom/lpasscc-sc7280.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

Comments

Stephen Boyd March 31, 2023, 6:46 p.m. UTC | #1
Quoting Mohammad Rafi Shaik (2023-03-31 08:28:04)
> diff --git a/drivers/clk/qcom/lpasscc-sc7280.c b/drivers/clk/qcom/lpasscc-sc7280.c
> index 5c1e17bd0d76..24aeed6bcf0e 100644
> --- a/drivers/clk/qcom/lpasscc-sc7280.c
> +++ b/drivers/clk/qcom/lpasscc-sc7280.c
> @@ -17,6 +17,8 @@
>  #include "clk-branch.h"
>  #include "common.h"
>  
> +#define QDSP6SS_MAX_REGISTER           0x3f

You can drop the define and just put the raw number in the one place
this is used.

> +
>  static struct clk_branch lpass_top_cc_lpi_q6_axim_hs_clk = {
>         .halt_reg = 0x0,
>         .halt_check = BRANCH_HALT,
> @@ -118,12 +120,15 @@ static int lpass_cc_sc7280_probe(struct platform_device *pdev)
>                 goto destroy_pm_clk;
>         }
>  
> -       lpass_regmap_config.name = "qdsp6ss";
> -       desc = &lpass_qdsp6ss_sc7280_desc;
> +       if (!of_property_read_bool(pdev->dev.of_node, "qcom,adsp-pil-mode")) {
> +               lpass_regmap_config.name = "qdsp6ss";
> +               lpass_regmap_config.max_register = QDSP6SS_MAX_REGISTER;
> +               desc = &lpass_qdsp6ss_sc7280_desc;
>
Mohammad Rafi Shaik April 3, 2023, 6:39 a.m. UTC | #2
On 4/1/2023 12:16 AM, Stephen Boyd wrote:
> Quoting Mohammad Rafi Shaik (2023-03-31 08:28:04)
>> diff --git a/drivers/clk/qcom/lpasscc-sc7280.c b/drivers/clk/qcom/lpasscc-sc7280.c
>> index 5c1e17bd0d76..24aeed6bcf0e 100644
>> --- a/drivers/clk/qcom/lpasscc-sc7280.c
>> +++ b/drivers/clk/qcom/lpasscc-sc7280.c
>> @@ -17,6 +17,8 @@
>>   #include "clk-branch.h"
>>   #include "common.h"
>>   
>> +#define QDSP6SS_MAX_REGISTER           0x3f
> You can drop the define and just put the raw number in the one place
> this is used.
Thanks for comment,

okay, will drop the define.
>> +
>>   static struct clk_branch lpass_top_cc_lpi_q6_axim_hs_clk = {
>>          .halt_reg = 0x0,
>>          .halt_check = BRANCH_HALT,
>> @@ -118,12 +120,15 @@ static int lpass_cc_sc7280_probe(struct platform_device *pdev)
>>                  goto destroy_pm_clk;
>>          }
>>   
>> -       lpass_regmap_config.name = "qdsp6ss";
>> -       desc = &lpass_qdsp6ss_sc7280_desc;
>> +       if (!of_property_read_bool(pdev->dev.of_node, "qcom,adsp-pil-mode")) {
>> +               lpass_regmap_config.name = "qdsp6ss";
>> +               lpass_regmap_config.max_register = QDSP6SS_MAX_REGISTER;
>> +               desc = &lpass_qdsp6ss_sc7280_desc;
>>
diff mbox series

Patch

diff --git a/drivers/clk/qcom/lpasscc-sc7280.c b/drivers/clk/qcom/lpasscc-sc7280.c
index 5c1e17bd0d76..24aeed6bcf0e 100644
--- a/drivers/clk/qcom/lpasscc-sc7280.c
+++ b/drivers/clk/qcom/lpasscc-sc7280.c
@@ -17,6 +17,8 @@ 
 #include "clk-branch.h"
 #include "common.h"
 
+#define QDSP6SS_MAX_REGISTER		0x3f
+
 static struct clk_branch lpass_top_cc_lpi_q6_axim_hs_clk = {
 	.halt_reg = 0x0,
 	.halt_check = BRANCH_HALT,
@@ -118,12 +120,15 @@  static int lpass_cc_sc7280_probe(struct platform_device *pdev)
 		goto destroy_pm_clk;
 	}
 
-	lpass_regmap_config.name = "qdsp6ss";
-	desc = &lpass_qdsp6ss_sc7280_desc;
+	if (!of_property_read_bool(pdev->dev.of_node, "qcom,adsp-pil-mode")) {
+		lpass_regmap_config.name = "qdsp6ss";
+		lpass_regmap_config.max_register = QDSP6SS_MAX_REGISTER;
+		desc = &lpass_qdsp6ss_sc7280_desc;
 
-	ret = qcom_cc_probe_by_index(pdev, 0, desc);
-	if (ret)
-		goto destroy_pm_clk;
+		ret = qcom_cc_probe_by_index(pdev, 0, desc);
+		if (ret)
+			goto destroy_pm_clk;
+	}
 
 	lpass_regmap_config.name = "top_cc";
 	desc = &lpass_cc_top_sc7280_desc;