Re: [PATCH] regulator: core: Fix enable GPIO reference counting

From: Mark Brown
Date: Wed Mar 04 2015 - 06:27:38 EST


On Tue, Mar 03, 2015 at 03:21:21PM -0800, Doug Anderson wrote:

> It looks as if "ena_gpio_state" is not quite what I thought it was and
> I think is not actually consistent in the regulator framework itself.
> In _regulator_do_enable() and _regulator_do_disable() is clear that
> ena_gpio_state is 1 when an "rdev" is enabled and 0 when the "rdev" is
> disabled. That was my assumption. It's also clear in
> _regulator_is_enabled().

> ...but then I looked in regulator_register(). There you can see that
> ena_gpio_state could be set to 1 if you've got an active low GPIO that
> is disabled at boot. That totally throws my logic for a loop. Also
> with my patch the reference counting will be all messed up for active
> high / boot on regulators. :(

Isn't that just a bug in the registration code? I'd not be entirely
surprised if that were the case.

Attachment: signature.asc
Description: Digital signature