Messages in this thread | | | Subject | Re: [PATCH] PCAP regulator driver (for 2.6.32). | From | Daniel Ribeiro <> | Date | Fri, 26 Jun 2009 09:26:32 -0300 |
| |
Em Sex, 2009-06-26 às 11:55 +0100, Mark Brown escreveu: > On Fri, Jun 26, 2009 at 03:04:23AM -0300, Daniel Ribeiro wrote: > > So, the regulator is enabled at boot, but it can't be disabled because > > use_count is 0. This is the same issue as twl4030-mmc, but instead of a > > enable/disable pair on pxamci.c i opted to disable it at pcap's > > At the minute you need to use the enable/disable pair since (as we've > previously discussed) the API needs to support regulators which are > shared between multiple users (potentially including multiple users from > the same consumer).
> You need to either do that or add an API allowing consumers to claim a > regulator for exclusive use. If the regulator is claimed for exclusive > use then other consumers wouldn't be able to access it and there would > be no issue with interfering with other users.
I'm not proposing an API for exclusive use. Allowing the enable bit to be turn off case use_count is 0 shouldn't break regulator sharing for other consumers, as far as the regulator framework is concerned there are no other consumers.
What about increasing use_count at regulator_get() if the regulator is already on and use_count == 0? If a consumer requests a regulator that was previously ON, then there is no reason for it to enable/disable it. If it is requested, and its already ON, then the regulator framework can assume it is already being used.
If the above is not possible, then regulator_is_enabled() doesn't match regulator_enable()/regulator_disable() pair. Maybe the API should make this clear?
-- Daniel Ribeiro [unhandled content-type:application/pgp-signature] | |