linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Bjorn Andersson <bjorn.andersson@linaro.org>,
	Michael Turquette <mturquette@baylibre.com>
Cc: Andy Gross <agross@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Rob Clark <robdclark@gmail.com>
Subject: Re: [PATCH 1/4] clk: qcom: gdsc: Handle GDSC regulator supplies
Date: Fri, 20 Mar 2020 16:31:00 -0700	[thread overview]
Message-ID: <158474706060.125146.14080695452569921346@swboyd.mtv.corp.google.com> (raw)
In-Reply-To: <20200319053902.3415984-2-bjorn.andersson@linaro.org>

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@linaro.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])

  reply	other threads:[~2020-03-20 23:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-19  5:38 [PATCH 0/4] clk: qcom: gdsc: Handle supply regulators Bjorn Andersson
2020-03-19  5:38 ` [PATCH 1/4] clk: qcom: gdsc: Handle GDSC regulator supplies Bjorn Andersson
2020-03-20 23:31   ` Stephen Boyd [this message]
2020-03-31  5:35   ` Taniya Das
2020-03-31  6:08     ` Bjorn Andersson
2020-03-19  5:39 ` [PATCH 2/4] clk: qcom: mmcc-msm8996: Properly describe GPU_GX gdsc Bjorn Andersson
2020-03-20 23:31   ` Stephen Boyd
2020-03-21  5:16     ` Bjorn Andersson
2020-03-21 18:43       ` Stephen Boyd
2020-03-30 23:10         ` Rob Herring
2020-03-19  5:39 ` [PATCH 3/4] arm64: dts: qcom: db820c: Add s2 regulator in pmi8994 Bjorn Andersson
2020-03-20 23:33   ` Stephen Boyd
2020-03-21  5:19     ` Bjorn Andersson
2020-03-19  5:39 ` [PATCH 4/4] arm64: dts: qcom: msm8996: Make GPU node control GPU_GX GDSC Bjorn Andersson

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=158474706060.125146.14080695452569921346@swboyd.mtv.corp.google.com \
    --to=sboyd@kernel.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=robdclark@gmail.com \
    --cc=robh+dt@kernel.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).