lkml.org 
[lkml]   [2015]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] regulator: core: Fix enable GPIO reference counting
From
Mark,

On Wed, Mar 4, 2015 at 3:27 AM, Mark Brown <broonie@kernel.org> wrote:
> 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.

Yes, I'm pretty sure that's the case too and that's what I've assumed
in V2 of the patch that I sent up yesterday. In my testing is caused
no problems, but of course my testing of my previous version also
showed no problems on my particular boards until I found the right
place to put printouts to show that the internal state was a bit
confused...

-Doug


\
 
 \ /
  Last update: 2015-03-04 18:41    [W:0.070 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site