devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: skakit@codeaurora.org
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Rajendra Nayak <rnayak@codeaurora.org>,
	"open list:DRM DRIVER FOR MSM ADRENO GPU" 
	<linux-arm-msm@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>,
	kgunda@codeaurora.org
Subject: Re: [PATCH 3/7] regulator: qcom-rpmh: Correct the pmic5_hfsmps515 buck
Date: Thu, 11 Mar 2021 09:45:41 +0530	[thread overview]
Message-ID: <189b9f1cac1b52241c199e541f0d14ba@codeaurora.org> (raw)
In-Reply-To: <CAA8EJprc24gTfLaffsrKeJ9MOv2m8B1L168VV4uNm=xsjnF5ZQ@mail.gmail.com>

On 2021-03-02 19:51, Dmitry Baryshkov wrote:
> Hello,
> 
> On Mon, 1 Mar 2021 at 13:37, <skakit@codeaurora.org> wrote:
>> 
>> On 2021-02-26 15:57, Dmitry Baryshkov wrote:
>> > On Fri, 26 Feb 2021 at 09:59, <skakit@codeaurora.org> wrote:
>> >>
>> >> Hi,
>> >>
>> >> On 2021-02-25 16:39, Dmitry Baryshkov wrote:
>> >> > On 24/02/2021 11:33, satya priya wrote:
>> >> >> Correct the REGULATOR_LINEAR_RANGE and n_voltges for
>> >> >> pmic5_hfsmps515 buck.
>> >> >>
>> >> >> Signed-off-by: satya priya <skakit@codeaurora.org>
>> >> >> ---
>> >> >>   drivers/regulator/qcom-rpmh-regulator.c | 4 ++--
>> >> >>   1 file changed, 2 insertions(+), 2 deletions(-)
>> >> >>
>> >> >> diff --git a/drivers/regulator/qcom-rpmh-regulator.c
>> >> >> b/drivers/regulator/qcom-rpmh-regulator.c
>> >> >> index 79a554f..36542c3 100644
>> >> >> --- a/drivers/regulator/qcom-rpmh-regulator.c
>> >> >> +++ b/drivers/regulator/qcom-rpmh-regulator.c
>> >> >> @@ -726,8 +726,8 @@ static const struct rpmh_vreg_hw_data
>> >> >> pmic5_ftsmps510 = {
>> >> >>   static const struct rpmh_vreg_hw_data pmic5_hfsmps515 = {
>> >> >>      .regulator_type = VRM,
>> >> >>      .ops = &rpmh_regulator_vrm_ops,
>> >> >> -    .voltage_range = REGULATOR_LINEAR_RANGE(2800000, 0, 4, 16000),
>> >> >> -    .n_voltages = 5,
>> >> >> +    .voltage_range = REGULATOR_LINEAR_RANGE(320000, 0, 235, 16000),
>> >> >> +    .n_voltages = 236,
>> >> >
>> >> > I've checked the docs for pm8009, the chip which also uses hfsmps515
>> >> > regulators. The pdf clearly states that the 'Output voltage operating
>> >> > range' is from 2.8 V to 2.85 V.
>> >> >
>> >> > So we'd probably need to define different versions of HFS515 regulator
>> >> > data (like I had to create for pm8009-1).
>> >> >
>> >> >
>> >>
>> >> The min-max voltages for S1C (PM8350c) regulator are 2190000-2210000uV
>> >> for sc7280(kodiak), so we had to modify this buck to support this
>> >> regulator.
>> >>
>> >> AFAIK, this struct defines the HW constraints of a regulator, but the
>> >> platform specific min-max values can be controlled from DT files. So,
>> >> can't we modify it like above instead of adding a new definition? the
>> >> new min_uV value (32000) is anyway not exceeding the old value
>> >> (2800000)
>> >> right? please correct me if wrong.
>> >
>> > As far as I understand for other regulators we put 'output voltage
>> > limitations' from the docs into the regulator definition and further
>> > constrain it by the platform device tree. Please correct me if I'm
>> > wrong.
>> 
>> I see that for most of the regulators, these specifications are 
>> specific
>> to regulator buck (like HFS515) but not chipset specific, we set the
>> chipset specific(like pm8009/pm8350c) requirements from DT files.
>> 
>> For example:
>> pmic5_nldo regulator spec mentions LLIMIT= 0.32V and ULIMIT =1.304V 
>> with
>> step 8mV
>> 
>> .voltage_range = REGULATOR_LINEAR_RANGE(320000, 0, 123, 8000),
>> max output voltage supported by this regulator is 123*8000 + 320000 =
>> 1304000mV which is same as mentioned in the regulator spec.
>> 
>> > For pm8009 the data from the datasheet matches the regulators defined
>> > in the source file. Unfortunately I don't have kodiak specs at hand.
>> 
>>  From the HFS515 spec I got below info
>> "HFS510 and lower max output voltage is limited to 2.04V max, and
>> Yoda(pm8009) requirement was 2.4V for IOT PA and 2.85V for camera
>> application.  Hence, HFS515 added a new register and corresponding HW
>> changes to support the higher voltage.  Table 5‑24 shows the new
>> FB_RANGE bit.  When configured to 0 the buck works as earlier where 
>> Vout
>> max = 2.04V in 8mV steps, but when configured to 1 the buck range
>> doubles and can now support a Vout max = 4.08V in 16mV steps."
>> 
>> As per above, the max output voltage supported by HFS515 buck is 4.08V
>> (which is kodiak pm8350c pmic's requirement).
>> So, we have modified the buck data to support pm8350c(palani) along 
>> with
>> pm8009(yoda).
> 
> I'd still prefer to have two different regulator types (as we did for
> pm8009 P=0 and P=1 variants). However it's probably up to the
> maintainers to decide.

As Mark already picked this, I think we can leave it this way.

Thanks,
Satya Priya

  reply	other threads:[~2021-03-11  4:16 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-24  8:33 [PATCH 0/7] Add PM7325/PM8350C/PMR735A regulator support satya priya
2021-02-24  8:33 ` [PATCH 1/7] dt-bindings: regulator: Convert regulator bindings to YAML format satya priya
2021-02-24 15:57   ` Mark Brown
2021-03-01 14:44   ` Rob Herring
2021-03-03 14:54     ` skakit
2021-03-01 19:18   ` Rob Herring
2021-03-03 14:53     ` skakit
2021-02-24  8:33 ` [PATCH 2/7] dt-bindings: regulator: Add compatibles for PM7325/PMR735A satya priya
2021-03-06 20:16   ` Rob Herring
2021-02-24  8:33 ` [PATCH 3/7] regulator: qcom-rpmh: Correct the pmic5_hfsmps515 buck satya priya
2021-02-25 11:09   ` Dmitry Baryshkov
2021-02-26  6:59     ` skakit
2021-02-26 10:27       ` Dmitry Baryshkov
2021-03-01 10:37         ` skakit
2021-03-02 14:21           ` Dmitry Baryshkov
2021-03-11  4:15             ` skakit [this message]
2021-03-11 18:32               ` Mark Brown
2021-02-24  8:33 ` [PATCH 4/7] regulator: qcom-rpmh: Add pmic5_ftsmps520 buck satya priya
2021-02-24  8:33 ` [PATCH 5/7] regulator: qcom-rpmh: Add PM7325/PMR735A regulator support satya priya
2021-02-24  8:33 ` [PATCH 6/7] regulator: qcom-rpmh: Use correct buck for S1C regulator satya priya
2021-02-24 16:31   ` Mark Brown
2021-02-26  4:05     ` skakit
2021-02-24  8:33 ` [PATCH 7/7] arm64: dts: qcom: sc7280: Add RPMh regulators for sc7280-idp satya priya
2021-02-24 19:17   ` Konrad Dybcio
2021-02-26  4:02     ` skakit
2021-02-24 16:58 ` (subset) [PATCH 0/7] Add PM7325/PM8350C/PMR735A regulator support Mark Brown

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=189b9f1cac1b52241c199e541f0d14ba@codeaurora.org \
    --to=skakit@codeaurora.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=kgunda@codeaurora.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rnayak@codeaurora.org \
    --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).