[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZldP4zODYZzCoHW3@hovoldconsulting.com>
Date: Wed, 29 May 2024 17:55:15 +0200
From: Johan Hovold <johan@...nel.org>
To: Stephen Boyd <swboyd@...omium.org>
Cc: Bjorn Andersson <andersson@...nel.org>,
Johan Hovold <johan+linaro@...nel.org>, Lee Jones <lee@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Mark Brown <broonie@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Liam Girdwood <lgirdwood@...il.com>,
Das Srinagesh <quic_gurus@...cinc.com>,
Satya Priya <quic_c_skakit@...cinc.com>,
linux-arm-msm@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org
Subject: Re: [PATCH 12/13] regulator: add pm8008 pmic regulator driver
On Thu, May 09, 2024 at 11:10:41AM +0200, Johan Hovold wrote:
> On Wed, May 08, 2024 at 10:37:50PM +0000, Stephen Boyd wrote:
> > Quoting Johan Hovold (2024-05-06 08:08:29)
> > > +struct pm8008_regulator {
> > > + struct regmap *regmap;
> > > + struct regulator_desc rdesc;
> > > + u16 base;
> > > + int step_rate;
> >
> > Is struct regulator_desc::vsel_step usable for this? If not, can it be
> > unsigned?
>
> Not sure, I'll take a look when respinning.
No, vsel_step is unrelated to this, which is really a slew rate.
I've reworked the driver and dropped this field in favour of
regulator_desc::ramp_delay.
> > > +};
> > > +static int pm8008_regulator_get_voltage(struct regulator_dev *rdev)
> > > +{
> > > + struct pm8008_regulator *pm8008_reg = rdev_get_drvdata(rdev);
> > > + __le16 mV;
> > > + int uV;
> > > +
> > > + regmap_bulk_read(pm8008_reg->regmap,
> > > + LDO_VSET_LB_REG(pm8008_reg->base), (void *)&mV, 2);
> >
> > Is struct regulator_desc::vsel_reg usable for this?
>
> Will look into that.
I don't think vsel_reg can be used here as the voltage is set using two
registers (LSB and MSB).
> > > +
> > > + uV = le16_to_cpu(mV) * 1000;
> > > + return (uV - pm8008_reg->rdesc.min_uV) / pm8008_reg->rdesc.uV_step;
> > > +}
Johan
Powered by blists - more mailing lists