Re: Regulator enable called without increasing the use_count

From: Mark Brown
Date: Mon Jun 22 2009 - 08:26:59 EST


On Mon, Jun 22, 2009 at 05:06:36PM +0530, Aggarwal, Anuj wrote:

> Why is it designed like that? Should I enable it again and then call the
> disable()?

It's like that because regulators can be shared between mulitple
consumers. In order for that to work consumers can't disable regulators
they didn't enable themselves (since otherwise they could be breaking
another consumer) and so the can't increase the reference count.

If your driver explicitly needs the regulator to be off at startup it
should do an enable then a disable. Otherwise it should just leave the
regulator alone. Machines can call regulator_has_full_constraints() to
tell the core that any regulators which have not been explicitly enabled
by consumers can be powered off at the end of init - at some point in
the future this will become the default.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/