Re: [PATCH 1/2] regulator: pwm-regulator: Revert "Calculate the output voltage for disabled PWMs"
From: Martin Blumenstingl
Date: Tue Nov 24 2026 - 16:33:56 EST
On Mon, Nov 9, 2026 at 10:30 PM Martin Blumenstingl
<martin.blumenstingl@xxxxxxxxxxxxxx> wrote:
[...]
> > What happens in my case:
> >
> > - This function returns 0% because the PWM is still disabled
> >
> > - Core wants it to be 50%, so it calls set_voltage() which sets the PWM
> > but doesn't enable it yet
> >
> > - Core calls this function again and (still) gets 0% as being the setting.
> >
> > - This goes on until the supply (and hence the PWM) is enabled.
> >
> >
> > What the callers expect is that this function returns the value that
> > would be set if the PWM were enabled.
> I think this is a good description and something we can improve upon.
> I attached a patch - please try it. If it's not enough: please apply
> your patch 2/2 on top.
> The goal of that patch is:
> - keep duty cycle around once it has been set
> - only reset to duty cycle 0 at initialization and only if the
> regulator has been described with regulator-boot-on
> - (it achieves this by keeping a copy of struct pwm_state around)
>
> I'd like to hear about your testing results and initial code-review feedback.
> +Cc Uwe - happy to take your feedback as well.
Thanks Uwe for your feedback.
Mike, did you find the time to test my patch?