regulator: Add regulator_get_exclusive() API
commit5ffbd136e6c51c8d1eec7a4a0c5d2180c81aea30
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 21 Jul 2009 15:00:23 +0000 (21 16:00 +0100)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Tue, 22 Sep 2009 12:32:38 +0000 (22 13:32 +0100)
tree1281ca42478aea061ba5de5be045e2361cd282d5
parentc1b60873ca2078bfca94b73bc88ef1c5adcc928b
regulator: Add regulator_get_exclusive() API

Some consumers require complete control of the regulator and can't
tolerate sharing it with other consumers, most commonly because they need
to have the regulator actually disabled so can't have other consumers
forcing it on. This new regulator_get_exclusive() API call allows these
consumers to explicitly request this, documenting the assumptions that
they are making.

In order to simplify coding of such consumers the use count for regulators
they request is forced to match the enabled state of the regulator when
it is requested. This is not possible for consumers which can share
regulators due to the need to keep track of the ownership of use counts.

A new API call is used rather than an additional argument to the existing
regulator_get() in order to avoid merge headaches with driver code in
other trees.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
drivers/regulator/core.c
include/linux/regulator/consumer.h
include/linux/regulator/driver.h