diff mbox series

[1/2] mbox: qcom: add APCS child device for QCS404

Message ID 20190826164625.6744-1-jorge.ramirez-ortiz@linaro.org (mailing list archive)
State New, archived
Headers show
Series [1/2] mbox: qcom: add APCS child device for QCS404 | expand

Commit Message

Jorge Ramirez-Ortiz Aug. 26, 2019, 4:46 p.m. UTC
There is clock controller functionality in the APCS hardware block of
qcs404 devices similar to msm8916.

Co-developed-by: Niklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
 drivers/mailbox/qcom-apcs-ipc-mailbox.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Stephen Boyd Aug. 28, 2019, 10:31 p.m. UTC | #1
Quoting Jorge Ramirez-Ortiz (2019-08-26 09:46:24)
> There is clock controller functionality in the APCS hardware block of
> qcs404 devices similar to msm8916.
> 
> Co-developed-by: Niklas Cassel <niklas.cassel@linaro.org>
> Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
>  drivers/mailbox/qcom-apcs-ipc-mailbox.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mailbox/qcom-apcs-ipc-mailbox.c b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
> index 705e17a5479c..76e1ad433b3f 100644
> --- a/drivers/mailbox/qcom-apcs-ipc-mailbox.c
> +++ b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
> @@ -89,7 +89,11 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev)
>                 return ret;
>         }
>  
> -       if (of_device_is_compatible(np, "qcom,msm8916-apcs-kpss-global")) {
> +       platform_set_drvdata(pdev, apcs);

Why did this move? It's required in the child driver or something now?
Is it a Fixes sort of change?

> +
> +       if (of_device_is_compatible(np, "qcom,msm8916-apcs-kpss-global") ||
> +           of_device_is_compatible(np, "qcom,qcs404-apcs-apps-global")) {

Maybe this should be a compatible list instead of two calls to
of_device_is_compatible().

> +
>                 apcs->clk = platform_device_register_data(&pdev->dev,
>                                                           "qcom-apcs-msm8916-clk",
>                                                           -1, NULL, 0);
> @@ -97,8 +101,6 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev)
>                         dev_err(&pdev->dev, "failed to register APCS clk\n");
>         }
>  
> -       platform_set_drvdata(pdev, apcs);
> -
>         return 0;
>  }
>
Jorge Ramirez-Ortiz Aug. 29, 2019, 8:28 a.m. UTC | #2
On 8/29/19 00:31, Stephen Boyd wrote:
> Quoting Jorge Ramirez-Ortiz (2019-08-26 09:46:24)
>> There is clock controller functionality in the APCS hardware block of
>> qcs404 devices similar to msm8916.
>>
>> Co-developed-by: Niklas Cassel <niklas.cassel@linaro.org>
>> Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
>> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
>> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
>> ---
>>  drivers/mailbox/qcom-apcs-ipc-mailbox.c | 8 +++++---
>>  1 file changed, 5 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/mailbox/qcom-apcs-ipc-mailbox.c b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
>> index 705e17a5479c..76e1ad433b3f 100644
>> --- a/drivers/mailbox/qcom-apcs-ipc-mailbox.c
>> +++ b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
>> @@ -89,7 +89,11 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev)
>>                 return ret;
>>         }
>>  
>> -       if (of_device_is_compatible(np, "qcom,msm8916-apcs-kpss-global")) {
>> +       platform_set_drvdata(pdev, apcs);
> 
> Why did this move? It's required in the child driver or something now?
> Is it a Fixes sort of change?
> 
>> +
>> +       if (of_device_is_compatible(np, "qcom,msm8916-apcs-kpss-global") ||
>> +           of_device_is_compatible(np, "qcom,qcs404-apcs-apps-global")) {
> 
> Maybe this should be a compatible list instead of two calls to
> of_device_is_compatible().
> 
>> +
>>                 apcs->clk = platform_device_register_data(&pdev->dev,
>>                                                           "qcom-apcs-msm8916-clk",
>>                                                           -1, NULL, 0);
>> @@ -97,8 +101,6 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev)
>>                         dev_err(&pdev->dev, "failed to register APCS clk\n");
>>         }
>>  
>> -       platform_set_drvdata(pdev, apcs);
>> -
>>         return 0;
>>  }
>>  
> 

thanks stephen. posted v2
diff mbox series

Patch

diff --git a/drivers/mailbox/qcom-apcs-ipc-mailbox.c b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
index 705e17a5479c..76e1ad433b3f 100644
--- a/drivers/mailbox/qcom-apcs-ipc-mailbox.c
+++ b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
@@ -89,7 +89,11 @@  static int qcom_apcs_ipc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	if (of_device_is_compatible(np, "qcom,msm8916-apcs-kpss-global")) {
+	platform_set_drvdata(pdev, apcs);
+
+	if (of_device_is_compatible(np, "qcom,msm8916-apcs-kpss-global") ||
+	    of_device_is_compatible(np, "qcom,qcs404-apcs-apps-global")) {
+
 		apcs->clk = platform_device_register_data(&pdev->dev,
 							  "qcom-apcs-msm8916-clk",
 							  -1, NULL, 0);
@@ -97,8 +101,6 @@  static int qcom_apcs_ipc_probe(struct platform_device *pdev)
 			dev_err(&pdev->dev, "failed to register APCS clk\n");
 	}
 
-	platform_set_drvdata(pdev, apcs);
-
 	return 0;
 }