Re: [PATCH v3 09/10] regulator: ab8500: Preserve OTP-enabled buck regulators
From: Linus Walleij
Date: Mon Sep 14 2026 - 16:51:18 EST
On Mon, Sep 14, 2026 at 3:15 PM Mark Brown <broonie@xxxxxxxxxx> wrote:
> > + /*
> > + * The SMPS enable state is selected by OTP. An enabled rail may
> > + * supply discrete board components which are not represented as
> > + * regulator consumers, so keep it out of the unused-regulator sweep.
> > + */
> > + rdev->constraints->boot_on = true;
> > + rdev->constraints->always_on = true;
> > + rdev->constraints->valid_ops_mask &= ~REGULATOR_CHANGE_STATUS;
>
> This unconditionally overrides machine constraints, the general idea is
> that we should always trust machine constraints. For this particular
> driver it probably doesn't matter so much but it's a bad example and we
> really should update the DT too, and if we're going to enforce in kernel
> then warn about doing so.
I was actually a bit back and forth about that in my head.
My thinking was along the lines that DT is hardware description
but the OTP settings is also a kind of hardware description
so which one should win.
I'll probably just put the expected state into the DT and
add some warning print if this differs from the OTP,
should be sufficient, there may be cases where people
want to force things off in the DT for example.
Yours,
Linus Walleij