[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 09 Sep 2019 03:22:14 -0700
From: Stephen Boyd <sboyd@...nel.org>
To: agross@...nel.org, jorge.ramirez-ortiz@...aro.org,
mturquette@...libre.com
Cc: bjorn.andersson@...aro.org, niklas.cassel@...aro.org,
linux-arm-msm@...r.kernel.org, linux-clk@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/5] clk: qcom: hfpll: get parent clock names from DT
Quoting Jorge Ramirez-Ortiz (2019-08-26 09:45:08)
> 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;
> +
Can this use the "new" way of specifying parents of clks? That would be
better than calling clk_get() on the XO clk to handle this.
> h->d = &hdata;
> h->clkr.hw.init = &init;
> spin_lock_init(&h->lock);
Powered by blists - more mailing lists