Re: [PATCH v5 3/4] regulator: qcom-rpmh: readback voltage/bypass/mode/status set during bootup
From: Kamal Wadhwa
Date: Fri Jul 24 2026 - 06:51:07 EST
On Wed, Jul 22, 2026 at 05:46:37PM +0100, Mark Brown wrote:
> On Mon, Jul 20, 2026 at 09:06:40PM +0530, Kamal Wadhwa wrote:
>
> > Currently, during regulator registration, regulator framework sends an
> > unnecessary `min-microvolts` request for the rpmh-regulator device. This
> > happens because in current design, we do not have a way to readback the
> > voltage settings that was set during the bootloader stage.
>
> > +static int rpmh_regulator_vrm_get_status(struct regulator_dev *rdev)
> > +{
> > + struct rpmh_vreg *vreg = rdev_get_drvdata(rdev);
> > +
> > + return vreg->status;
> > +}
>
> A get_status() operation should be reading the actual hardware status
> right now, not driver state - this should be reading whatever the value
> is right now. If the hardware doesn't support this then just don't
> provide the operation.
Actually we are reading from HW what we voted in terms of ENABLE/BYPASS/MODE
and we are combing these in the `rpmh_regulator_determine_initial_status()`
to come up with the `vreg->status`at the time of probe.
but later for every disable/enable/mode write we keep updating the
`vreg->status` as an optimization.
So, shall I read the HW MODE/BYPSS/ENABLE value in every get_status() call?
OR
just remove the get_status() call and all the logic to calculate it based
MODE/ENABLE/BYPASS hw values in probe as well?
Regards,
Kamal