[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <158474706060.125146.14080695452569921346@swboyd.mtv.corp.google.com>
Date: Fri, 20 Mar 2020 16:31:00 -0700
From: Stephen Boyd <sboyd@...nel.org>
To: Bjorn Andersson <bjorn.andersson@...aro.org>,
Michael Turquette <mturquette@...libre.com>
Cc: Andy Gross <agross@...nel.org>, Rob Herring <robh+dt@...nel.org>,
linux-arm-msm@...r.kernel.org, linux-clk@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
Rob Clark <robdclark@...il.com>
Subject: Re: [PATCH 1/4] clk: qcom: gdsc: Handle GDSC regulator supplies
Quoting Bjorn Andersson (2020-03-18 22:38:59)
> Certain GDSCs, such as the GPU_GX on MSM8996, requires that the upstream
> regulator supply is powered in order to be turned on.
>
> It's not guaranteed that the bootloader will leave these supplies on and
> the driver core will attempt to enable any GDSCs before allowing the
> individual drivers to probe defer on the PMIC regulator driver not yet
> being present.
>
> So the gdsc driver needs to be made aware of supplying regulators and
> probe defer on their absence, and it needs to enable and disable the
> regulator accordingly.
>
> Voltage adjustments of the supplying regulator are deferred to the
> client drivers themselves.
>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@...aro.org>
> ---
Ok. Looks mostly fine to me.
> drivers/clk/qcom/gdsc.c | 24 ++++++++++++++++++++++++
> drivers/clk/qcom/gdsc.h | 4 ++++
> 2 files changed, 28 insertions(+)
>
> diff --git a/drivers/clk/qcom/gdsc.c b/drivers/clk/qcom/gdsc.c
> index a250f59708d8..3528789cc9d0 100644
> --- a/drivers/clk/qcom/gdsc.c
> +++ b/drivers/clk/qcom/gdsc.c
> @@ -13,6 +13,7 @@
> #include <linux/regmap.h>
> #include <linux/reset-controller.h>
> #include <linux/slab.h>
> +#include <linux/regulator/consumer.h>
Alphabetical?
> #include "gdsc.h"
>
> #define PWR_ON_MASK BIT(31)
> @@ -371,6 +385,16 @@ int gdsc_register(struct gdsc_desc *desc,
> if (!data->domains)
> return -ENOMEM;
>
> + /* Resolve any regulator supplies */
Drop the comment please, it's just saying what the code is doing.
> + for (i = 0; i < num; i++) {
> + if (!scs[i] || !scs[i]->supply)
> + continue;
> +
> + scs[i]->rsupply = devm_regulator_get(dev, scs[i]->supply);
> + if (IS_ERR(scs[i]->rsupply))
> + return PTR_ERR(scs[i]->rsupply);
> + }
> +
> data->num_domains = num;
> for (i = 0; i < num; i++) {
> if (!scs[i])
Powered by blists - more mailing lists