2019-08-29 08:29:18

by Jorge Ramirez-Ortiz

[permalink] [raw]
Subject: [PATCH v2 1/2] mbox: qcom: add APCS child device for QCS404

There is clock controller functionality in the APCS hardware block of
qcs404 devices similar to msm8916.

Co-developed-by: Niklas Cassel <[email protected]>
Signed-off-by: Niklas Cassel <[email protected]>
Signed-off-by: Jorge Ramirez-Ortiz <[email protected]>
---
drivers/mailbox/qcom-apcs-ipc-mailbox.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mailbox/qcom-apcs-ipc-mailbox.c b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
index 705e17a5479c..d3676fd3cf94 100644
--- a/drivers/mailbox/qcom-apcs-ipc-mailbox.c
+++ b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
@@ -47,7 +47,6 @@ static const struct mbox_chan_ops qcom_apcs_ipc_ops = {

static int qcom_apcs_ipc_probe(struct platform_device *pdev)
{
- struct device_node *np = pdev->dev.of_node;
struct qcom_apcs_ipc *apcs;
struct regmap *regmap;
struct resource *res;
@@ -55,6 +54,11 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev)
void __iomem *base;
unsigned long i;
int ret;
+ const struct of_device_id apcs_clk_match_table[] = {
+ { .compatible = "qcom,msm8916-apcs-kpss-global", },
+ { .compatible = "qcom,qcs404-apcs-apps-global", },
+ {}
+ };

apcs = devm_kzalloc(&pdev->dev, sizeof(*apcs), GFP_KERNEL);
if (!apcs)
@@ -89,7 +93,7 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev)
return ret;
}

- if (of_device_is_compatible(np, "qcom,msm8916-apcs-kpss-global")) {
+ if (of_match_device(apcs_clk_match_table, &pdev->dev)) {
apcs->clk = platform_device_register_data(&pdev->dev,
"qcom-apcs-msm8916-clk",
-1, NULL, 0);
--
2.22.0


2019-08-29 14:00:59

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] mbox: qcom: add APCS child device for QCS404

On Thu 29 Aug 01:27 PDT 2019, Jorge Ramirez-Ortiz wrote:

> There is clock controller functionality in the APCS hardware block of
> qcs404 devices similar to msm8916.
>
> Co-developed-by: Niklas Cassel <[email protected]>
> Signed-off-by: Niklas Cassel <[email protected]>
> Signed-off-by: Jorge Ramirez-Ortiz <[email protected]>

Nice, I like this version.

Reviewed-by: Bjorn Andersson <[email protected]>

> ---
> drivers/mailbox/qcom-apcs-ipc-mailbox.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mailbox/qcom-apcs-ipc-mailbox.c b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
> index 705e17a5479c..d3676fd3cf94 100644
> --- a/drivers/mailbox/qcom-apcs-ipc-mailbox.c
> +++ b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
> @@ -47,7 +47,6 @@ static const struct mbox_chan_ops qcom_apcs_ipc_ops = {
>
> static int qcom_apcs_ipc_probe(struct platform_device *pdev)
> {
> - struct device_node *np = pdev->dev.of_node;
> struct qcom_apcs_ipc *apcs;
> struct regmap *regmap;
> struct resource *res;
> @@ -55,6 +54,11 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev)
> void __iomem *base;
> unsigned long i;
> int ret;
> + const struct of_device_id apcs_clk_match_table[] = {
> + { .compatible = "qcom,msm8916-apcs-kpss-global", },
> + { .compatible = "qcom,qcs404-apcs-apps-global", },
> + {}
> + };
>
> apcs = devm_kzalloc(&pdev->dev, sizeof(*apcs), GFP_KERNEL);
> if (!apcs)
> @@ -89,7 +93,7 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev)
> return ret;
> }
>
> - if (of_device_is_compatible(np, "qcom,msm8916-apcs-kpss-global")) {
> + if (of_match_device(apcs_clk_match_table, &pdev->dev)) {
> apcs->clk = platform_device_register_data(&pdev->dev,
> "qcom-apcs-msm8916-clk",
> -1, NULL, 0);
> --
> 2.22.0
>

2019-08-29 14:57:46

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] mbox: qcom: add APCS child device for QCS404

Quoting Jorge Ramirez-Ortiz (2019-08-29 01:27:58)
> There is clock controller functionality in the APCS hardware block of
> qcs404 devices similar to msm8916.
>
> Co-developed-by: Niklas Cassel <[email protected]>
> Signed-off-by: Niklas Cassel <[email protected]>
> Signed-off-by: Jorge Ramirez-Ortiz <[email protected]>
> ---

Reviewed-by: Stephen Boyd <[email protected]>