diff mbox series

[v2,2/8] clk: qcom: lpassaudiocc-sc7280: Add support for LPASS resets for QCM6490

Message ID 20240318053555.20405-3-quic_tdas@quicinc.com (mailing list archive)
State Superseded
Headers show
Series Add updates for clock controllers to support QCM6490 | expand

Commit Message

Taniya Das March 18, 2024, 5:35 a.m. UTC
On the QCM6490 boards the LPASS firmware controls the complete clock
controller functionalities. But the LPASS resets are required to be from
the high level OS for the LPASS SW driver could assert/deassert the
audio resets.

Fixes: a9dd26639d05 ("clk: qcom: lpass: Add support for LPASS clock controller for SC7280")
Signed-off-by: Taniya Das <quic_tdas@quicinc.com>
---
 drivers/clk/qcom/lpassaudiocc-sc7280.c | 9 +++++++++
 1 file changed, 9 insertions(+)

--
2.17.1

Comments

Krzysztof Kozlowski March 18, 2024, 7:50 a.m. UTC | #1
On 18/03/2024 06:35, Taniya Das wrote:
> On the QCM6490 boards the LPASS firmware controls the complete clock
> controller functionalities. But the LPASS resets are required to be from
> the high level OS for the LPASS SW driver could assert/deassert the
> audio resets.
> 
> Fixes: a9dd26639d05 ("clk: qcom: lpass: Add support for LPASS clock controller for SC7280")
> Signed-off-by: Taniya Das <quic_tdas@quicinc.com>
> ---
>  drivers/clk/qcom/lpassaudiocc-sc7280.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/clk/qcom/lpassaudiocc-sc7280.c b/drivers/clk/qcom/lpassaudiocc-sc7280.c
> index c43d0b1af7f7..d68139762a80 100644
> --- a/drivers/clk/qcom/lpassaudiocc-sc7280.c
> +++ b/drivers/clk/qcom/lpassaudiocc-sc7280.c
> @@ -1,6 +1,7 @@
>  // SPDX-License-Identifier: GPL-2.0-only
>  /*
>   * Copyright (c) 2021, The Linux Foundation. All rights reserved.
> + * Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
>   */
> 
>  #include <linux/clk-provider.h>
> @@ -721,6 +722,7 @@ static const struct qcom_cc_desc lpass_audio_cc_reset_sc7280_desc = {
> 
>  static const struct of_device_id lpass_audio_cc_sc7280_match_table[] = {
>  	{ .compatible = "qcom,sc7280-lpassaudiocc" },
> +	{ .compatible = "qcom,qcm6490-lpassaudiocc" },

Why q is after s? Really, keep the order.

>  	{ }
>  };
>  MODULE_DEVICE_TABLE(of, lpass_audio_cc_sc7280_match_table);
> @@ -752,6 +754,13 @@ static int lpass_audio_cc_sc7280_probe(struct platform_device *pdev)
>  	struct regmap *regmap;
>  	int ret;
> 
> +	if (of_device_is_compatible(pdev->dev.of_node, "qcom,qcm6490-lpassaudiocc")) {

This does not scale. Use match data.

> +		ret = qcom_cc_probe_by_index(pdev, 1, &lpass_audio_cc_reset_sc7280_desc);

No, qcm6490 does not have two IO maps, according to your binding.

Best regards,
Krzysztof
Krzysztof Kozlowski March 18, 2024, 7:51 a.m. UTC | #2
On 18/03/2024 06:35, Taniya Das wrote:
> On the QCM6490 boards the LPASS firmware controls the complete clock
> controller functionalities. But the LPASS resets are required to be from
> the high level OS for the LPASS SW driver could assert/deassert the
> audio resets.
> 
> Fixes: a9dd26639d05 ("clk: qcom: lpass: Add support for LPASS clock controller for SC7280")

NAK, that's not a fix. Please explain what is the bug being fixed.

Best regards,
Krzysztof
Taniya Das May 31, 2024, 9:28 a.m. UTC | #3
On 3/18/2024 1:20 PM, Krzysztof Kozlowski wrote:
> On 18/03/2024 06:35, Taniya Das wrote:
>> On the QCM6490 boards the LPASS firmware controls the complete clock
>> controller functionalities. But the LPASS resets are required to be from
>> the high level OS for the LPASS SW driver could assert/deassert the
>> audio resets.
>>
>> Fixes: a9dd26639d05 ("clk: qcom: lpass: Add support for LPASS clock controller for SC7280")
>> Signed-off-by: Taniya Das <quic_tdas@quicinc.com>
>> ---
>>   drivers/clk/qcom/lpassaudiocc-sc7280.c | 9 +++++++++
>>   1 file changed, 9 insertions(+)
>>
>> diff --git a/drivers/clk/qcom/lpassaudiocc-sc7280.c b/drivers/clk/qcom/lpassaudiocc-sc7280.c
>> index c43d0b1af7f7..d68139762a80 100644
>> --- a/drivers/clk/qcom/lpassaudiocc-sc7280.c
>> +++ b/drivers/clk/qcom/lpassaudiocc-sc7280.c
>> @@ -1,6 +1,7 @@
>>   // SPDX-License-Identifier: GPL-2.0-only
>>   /*
>>    * Copyright (c) 2021, The Linux Foundation. All rights reserved.
>> + * Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
>>    */
>>
>>   #include <linux/clk-provider.h>
>> @@ -721,6 +722,7 @@ static const struct qcom_cc_desc lpass_audio_cc_reset_sc7280_desc = {
>>
>>   static const struct of_device_id lpass_audio_cc_sc7280_match_table[] = {
>>   	{ .compatible = "qcom,sc7280-lpassaudiocc" },
>> +	{ .compatible = "qcom,qcm6490-lpassaudiocc" },
> 
> Why q is after s? Really, keep the order.
> 
>>   	{ }
>>   };
>>   MODULE_DEVICE_TABLE(of, lpass_audio_cc_sc7280_match_table);
>> @@ -752,6 +754,13 @@ static int lpass_audio_cc_sc7280_probe(struct platform_device *pdev)
>>   	struct regmap *regmap;
>>   	int ret;
>>
>> +	if (of_device_is_compatible(pdev->dev.of_node, "qcom,qcm6490-lpassaudiocc")) {
> 
> This does not scale. Use match data.
> 
>> +		ret = qcom_cc_probe_by_index(pdev, 1, &lpass_audio_cc_reset_sc7280_desc);
> 
> No, qcm6490 does not have two IO maps, according to your binding.
>

In the next patch I am separating out the reset functionality from the 
rest of the code.

Hope that will simplify the board requirement.


> Best regards,
> Krzysztof
> 
>
diff mbox series

Patch

diff --git a/drivers/clk/qcom/lpassaudiocc-sc7280.c b/drivers/clk/qcom/lpassaudiocc-sc7280.c
index c43d0b1af7f7..d68139762a80 100644
--- a/drivers/clk/qcom/lpassaudiocc-sc7280.c
+++ b/drivers/clk/qcom/lpassaudiocc-sc7280.c
@@ -1,6 +1,7 @@ 
 // SPDX-License-Identifier: GPL-2.0-only
 /*
  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
  */

 #include <linux/clk-provider.h>
@@ -721,6 +722,7 @@  static const struct qcom_cc_desc lpass_audio_cc_reset_sc7280_desc = {

 static const struct of_device_id lpass_audio_cc_sc7280_match_table[] = {
 	{ .compatible = "qcom,sc7280-lpassaudiocc" },
+	{ .compatible = "qcom,qcm6490-lpassaudiocc" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, lpass_audio_cc_sc7280_match_table);
@@ -752,6 +754,13 @@  static int lpass_audio_cc_sc7280_probe(struct platform_device *pdev)
 	struct regmap *regmap;
 	int ret;

+	if (of_device_is_compatible(pdev->dev.of_node, "qcom,qcm6490-lpassaudiocc")) {
+		ret = qcom_cc_probe_by_index(pdev, 1, &lpass_audio_cc_reset_sc7280_desc);
+		if (ret)
+			dev_err(&pdev->dev, "Failed to register LPASS AUDIO CC Resets\n");
+		return ret;
+	}
+
 	ret = lpass_audio_setup_runtime_pm(pdev);
 	if (ret)
 		return ret;