Re: [PATCH 4/6] regulator: core: Add external-output support

From: Mark Brown
Date: Wed May 04 2022 - 09:06:54 EST


On Tue, May 03, 2022 at 11:52:50PM -0700, Zev Weiss wrote:
> Regulators feeding external outputs (i.e. supplying devices we don't
> control) can be switched on and off by userspace via the 'state' sysfs
> attribute, which is now (conditionally) writable. They are also not
> automatically disabled in regulator_late_cleanup(), since we have no
> way of knowing that they're not actually in use.

No, this is an abstraction failure. Enabling and disabling a regulator
is something that should be handled in consumer drivers, just as with
every other use case there's no reason why the regulator should be
offering direct control to userspace. Putting this directly in the
regulator will cause problems as soon as you for example have multiple
outputs supplied from a single regulator and can't be integrated with
any other control mechanisms.

Attachment: signature.asc
Description: PGP signature