From: Shawn Guo <shawn.guo@linaro.org>
To: Stephen Boyd <sboyd@kernel.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
Sivaprakash Murugesan <sivaprak@codeaurora.org>,
Benjamin Li <benl@squareup.com>,
devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-clk@vger.kernel.org, Shawn Guo <shawn.guo@linaro.org>
Subject: [PATCH 4/5] clk: qcom: a53-pll: Pass freq_tbl via match data
Date: Tue, 4 May 2021 13:28:43 +0800 [thread overview]
Message-ID: <20210504052844.21096-5-shawn.guo@linaro.org> (raw)
In-Reply-To: <20210504052844.21096-1-shawn.guo@linaro.org>
The frequency table is SoC specific. Instead of hard coding, pass it
via match data, so that the driver can work for more than just MSM8916.
This is a preparation change for adding MSM8939 A53PLL support.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
drivers/clk/qcom/a53-pll.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/clk/qcom/a53-pll.c b/drivers/clk/qcom/a53-pll.c
index 964f5ab7d02f..bfa048dc01ec 100644
--- a/drivers/clk/qcom/a53-pll.c
+++ b/drivers/clk/qcom/a53-pll.c
@@ -15,7 +15,7 @@
#include "clk-pll.h"
#include "clk-regmap.h"
-static const struct pll_freq_tbl a53pll_freq[] = {
+static const struct pll_freq_tbl msm8916_freq[] = {
{ 998400000, 52, 0x0, 0x1, 0 },
{ 1094400000, 57, 0x0, 0x1, 0 },
{ 1152000000, 62, 0x0, 0x1, 0 },
@@ -43,8 +43,13 @@ static int qcom_a53pll_probe(struct platform_device *pdev)
void __iomem *base;
struct clk_init_data init = { };
const char *clk_name = NULL;
+ const struct pll_freq_tbl *freq_tbl;
int ret;
+ freq_tbl = device_get_match_data(&pdev->dev);
+ if (!freq_tbl)
+ return -ENODEV;
+
pll = devm_kzalloc(dev, sizeof(*pll), GFP_KERNEL);
if (!pll)
return -ENOMEM;
@@ -65,7 +70,7 @@ static int qcom_a53pll_probe(struct platform_device *pdev)
pll->mode_reg = 0x00;
pll->status_reg = 0x1c;
pll->status_bit = 16;
- pll->freq_tbl = a53pll_freq;
+ pll->freq_tbl = freq_tbl;
of_property_read_string(pdev->dev.of_node, "clock-output-names",
&clk_name);
@@ -92,7 +97,7 @@ static int qcom_a53pll_probe(struct platform_device *pdev)
}
static const struct of_device_id qcom_a53pll_match_table[] = {
- { .compatible = "qcom,msm8916-a53pll" },
+ { .compatible = "qcom,msm8916-a53pll", .data = msm8916_freq },
{ }
};
--
2.17.1
next prev parent reply other threads:[~2021-05-04 5:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-04 5:28 [PATCH 0/5] Add MSM8939 APCS/A53PLL clock support Shawn Guo
2021-05-04 5:28 ` [PATCH 1/5] clk: qcom: apcs-msm8916: Flag a53mux instead of a53pll as critical Shawn Guo
2021-06-28 0:27 ` Stephen Boyd
2021-06-29 2:37 ` Shawn Guo
2021-05-04 5:28 ` [PATCH 2/5] dt-bindings: clock: update qcom,a53pll bindings for MSM8939 support Shawn Guo
2021-05-06 20:27 ` Rob Herring
2021-05-07 0:18 ` Shawn Guo
2021-05-04 5:28 ` [PATCH 3/5] clk: qcom: apcs-msm8916: Retrieve clock name from DT Shawn Guo
2021-06-28 0:28 ` Stephen Boyd
2021-06-29 13:36 ` Shawn Guo
2021-06-29 15:57 ` Bjorn Andersson
2021-06-29 20:23 ` Stephen Boyd
2021-06-29 20:39 ` Bjorn Andersson
2021-05-04 5:28 ` Shawn Guo [this message]
2021-05-04 5:28 ` [PATCH 5/5] clk: qcom: a53-pll: Add MSM8939 a53pll clocks Shawn Guo
2021-06-28 0:24 ` Stephen Boyd
2021-06-21 6:37 ` [PATCH 0/5] Add MSM8939 APCS/A53PLL clock support Shawn Guo
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=20210504052844.21096-5-shawn.guo@linaro.org \
--to=shawn.guo@linaro.org \
--cc=benl@squareup.com \
--cc=bjorn.andersson@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=sboyd@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).