From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Sivaprakash Murugesan <sivaprak@codeaurora.org>
Cc: agross@kernel.org, robh+dt@kernel.org, jassisinghbrar@gmail.com,
linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] mailbox: qcom: Add ipq6018 apcs compatible
Date: Thu, 28 May 2020 20:11:33 -0700 [thread overview]
Message-ID: <20200529031133.GZ279327@builder.lan> (raw)
In-Reply-To: <1590583092-24290-4-git-send-email-sivaprak@codeaurora.org>
On Wed 27 May 05:38 PDT 2020, Sivaprakash Murugesan wrote:
> The Qualcomm ipq6018 has apcs block, add compatible for the same.
> Also, the apcs provides a clock controller functionality similar
> to msm8916 but the clock driver is different.
>
> Create a child platform device based on the apcs compatible for the
> clock controller functionality.
>
> Signed-off-by: Sivaprakash Murugesan <sivaprak@codeaurora.org>
> ---
> drivers/mailbox/qcom-apcs-ipc-mailbox.c | 23 ++++++++++++++---------
> 1 file changed, 14 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/mailbox/qcom-apcs-ipc-mailbox.c b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
> index eeebafd..db3f9518 100644
> --- a/drivers/mailbox/qcom-apcs-ipc-mailbox.c
> +++ b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
> @@ -45,6 +45,13 @@ static const struct mbox_chan_ops qcom_apcs_ipc_ops = {
> .send_data = qcom_apcs_ipc_send_data,
> };
>
> +static const struct of_device_id apcs_clk_match_table[] = {
> + { .compatible = "qcom,ipq6018-apcs-apps-global", .data = "qcom,apss-ipq6018-clk", },
> + { .compatible = "qcom,msm8916-apcs-kpss-global", .data = "qcom-apcs-msm8916-clk", },
> + { .compatible = "qcom,qcs404-apcs-apps-global", .data = "qcom-apcs-msm8916-clk", },
> + {}
> +};
> +
> static int qcom_apcs_ipc_probe(struct platform_device *pdev)
> {
> struct qcom_apcs_ipc *apcs;
> @@ -54,11 +61,7 @@ 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", },
> - {}
> - };
> + const struct of_device_id *clk_device;
>
> apcs = devm_kzalloc(&pdev->dev, sizeof(*apcs), GFP_KERNEL);
> if (!apcs)
> @@ -93,11 +96,12 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev)
> return ret;
> }
>
> - if (of_match_device(apcs_clk_match_table, &pdev->dev)) {
> + clk_device = of_match_device(apcs_clk_match_table, &pdev->dev);
I think you should replace the direct integer in qcom_apcs_ipc_of_match
with a small struct containing offset and the clock device's name -
allowing the latter to be omitted.
That avoids the apcs_clk_match_table being unreferenced when this is
compiled without CONFIG_OF and it removes the need for two of_device_id
arrays.
Regards,
Bjorn
> + if (clk_device) {
> apcs->clk = platform_device_register_data(&pdev->dev,
> - "qcom-apcs-msm8916-clk",
> - PLATFORM_DEVID_NONE,
> - NULL, 0);
> + clk_device->data,
> + PLATFORM_DEVID_NONE,
> + NULL, 0);
> if (IS_ERR(apcs->clk))
> dev_err(&pdev->dev, "failed to register APCS clk\n");
> }
> @@ -126,6 +130,7 @@ static const struct of_device_id qcom_apcs_ipc_of_match[] = {
> { .compatible = "qcom,sc7180-apss-shared", .data = (void *)12 },
> { .compatible = "qcom,sdm845-apss-shared", .data = (void *)12 },
> { .compatible = "qcom,sm8150-apss-shared", .data = (void *)12 },
> + { .compatible = "qcom,ipq6018-apcs-apps-global", .data = (void *)8 },
> { .compatible = "qcom,ipq8074-apcs-apps-global", .data = (void *)8 },
> {}
> };
> --
> 2.7.4
>
next prev parent reply other threads:[~2020-05-29 3:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-27 12:38 [PATCH 0/4] Add ipq6018 apcs mailbox driver Sivaprakash Murugesan
2020-05-27 12:38 ` [PATCH 1/4] dt-bindings: mailbox: Add YAML schemas for QCOM APCS global block Sivaprakash Murugesan
2020-05-27 12:38 ` [PATCH 2/4] dt-bindings: mailbox: Add dt-bindings for ipq6018 apcs " Sivaprakash Murugesan
2020-05-27 12:38 ` [PATCH 3/4] mailbox: qcom: Add ipq6018 apcs compatible Sivaprakash Murugesan
2020-05-29 2:41 ` kbuild test robot
2020-05-29 2:41 ` kbuild test robot
2020-05-29 3:11 ` Bjorn Andersson [this message]
2020-05-27 12:38 ` [PATCH 4/4] arm64: dts: ipq6018: Add support for apcs clk Sivaprakash Murugesan
2020-06-04 0:19 ` kernel test robot
2020-06-04 0:19 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200529031133.GZ279327@builder.lan \
--to=bjorn.andersson@linaro.org \
--cc=agross@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jassisinghbrar@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=sivaprak@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.