]> git.openfabrics.org - ~emulex/infiniband.git/commit
regulator: core: Add core support for GPIO controlled enable lines
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 27 Jun 2012 13:14:38 +0000 (14:14 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 3 Jul 2012 19:29:27 +0000 (20:29 +0100)
commit65f735082de35aa4d44e8d0afe862798d0e09e29
tree9ffdc83c3a0971fb853685503243cdd4dfd752a7
parent5c5659d0a22ec4f947ef4faa3055767572f15e74
regulator: core: Add core support for GPIO controlled enable lines

It is very common for regulators to support having their enable signal
controlled by a GPIO. Since there are a bunch of fiddly things to get
right like handling the operations when the enable signal is tied to
a rail and it's just replicated code add support for this to the core.

Drivers should set ena_gpio in their config if they have a GPIO control,
using ena_gpio_flags to specify any flags (including GPIOF_OUT_INIT_ for
the initial state) and ena_gpio_invert if the GPIO is active low. The
core will then override any enable and disable operations the driver has
and instead control the specified GPIO.

This will in the future also allow us to further extend the core by
identifying when several enable signals have been tied together and
handling this properly.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/core.c
include/linux/regulator/driver.h