Re: [PATCH v3 09/10] regulator: ab8500: Preserve OTP-enabled buck regulators

From: Mark Brown

Date: Mon Sep 14 2026 - 11:08:21 EST


On Mon, Sep 14, 2026 at 09:46:08AM +0200, Linus Walleij wrote:
> The SMPS enable fields are initialized from OTP and may leave a rail
> enabled for discrete consumers which cannot be described in the device
> tree. Such a rail currently looks unused to the regulator core and is
> disabled when constraints are completed.

> +static int ab8500_buck_init(struct regulator_dev *rdev,
> + struct regulator_config *config)
> +{

> + /*
> + * 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.

Attachment: signature.asc
Description: PGP signature