[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190625164733.11091-7-jorge.ramirez-ortiz@linaro.org>
Date: Tue, 25 Jun 2019 18:47:25 +0200
From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@...aro.org>
To: jorge.ramirez-ortiz@...aro.org, sboyd@...nel.org,
bjorn.andersson@...aro.org, david.brown@...aro.org,
jassisinghbrar@...il.com, mark.rutland@....com,
mturquette@...libre.com, robh+dt@...nel.org, will.deacon@....com,
arnd@...db.de, horms+renesas@...ge.net.au, heiko@...ech.de,
sibis@...eaurora.org, enric.balletbo@...labora.com,
jagan@...rulasolutions.com, olof@...om.net
Cc: vkoul@...nel.org, niklas.cassel@...aro.org,
georgi.djakov@...aro.org, amit.kucheria@...aro.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-clk@...r.kernel.org,
linux-arm-msm@...r.kernel.org, khasim.mohammed@...aro.org
Subject: [PATCH v3 06/14] clk: qcom: hfpll: get parent clock names from DT
Allow accessing the parent clock name required for the driver
operation using the device tree node.
This permits extending the driver to other platforms without having to
modify its source code.
For backwards compatibility leave the previous value as default.
Co-developed-by: Niklas Cassel <niklas.cassel@...aro.org>
Signed-off-by: Niklas Cassel <niklas.cassel@...aro.org>
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@...aro.org>
---
drivers/clk/qcom/hfpll.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/clk/qcom/hfpll.c b/drivers/clk/qcom/hfpll.c
index a6de7101430c..87b7f46d27e0 100644
--- a/drivers/clk/qcom/hfpll.c
+++ b/drivers/clk/qcom/hfpll.c
@@ -52,6 +52,7 @@ static int qcom_hfpll_probe(struct platform_device *pdev)
void __iomem *base;
struct regmap *regmap;
struct clk_hfpll *h;
+ struct clk *pclk;
struct clk_init_data init = {
.parent_names = (const char *[]){ "xo" },
.num_parents = 1,
@@ -75,6 +76,13 @@ static int qcom_hfpll_probe(struct platform_device *pdev)
0, &init.name))
return -ENODEV;
+ /* get parent clock from device tree (optional) */
+ pclk = devm_clk_get(dev, "xo");
+ if (!IS_ERR(pclk))
+ init.parent_names = (const char *[]){ __clk_get_name(pclk) };
+ else if (PTR_ERR(pclk) == -EPROBE_DEFER)
+ return -EPROBE_DEFER;
+
h->d = &hdata;
h->clkr.hw.init = &init;
spin_lock_init(&h->lock);
--
2.21.0
Powered by blists - more mailing lists