]> git.baikalelectronics.ru Git - kernel.git/commit
regulator: core: Provide standard enable operations for regmap users
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 15 Apr 2012 11:37:47 +0000 (12:37 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 16 Apr 2012 18:52:42 +0000 (19:52 +0100)
commitd33e066f419a9ded6b22e11c1f114357d156f7b3
tree1f9676804e187eb731e5008e0d2d9ca67bd1ef54
parent2a8731f8a74b3930d0b5e8c51c6e9219b7e5b2d3
regulator: core: Provide standard enable operations for regmap users

Since the enable(), disable() and is_enabled() operations for most regmap
based regulators come down to reading and updating a single register bit
we can factor out the code and allow these drivers to just define which
bit to update using the enable_reg and enable_mask fields in their desc
and then use operations provided by the core.

As well as the code saving this opens the door to future optimisation of
the bulk operations - if the core can realise that we are updating a
single register for multiple regulators then it should be able to combine
these updates into a single physical operation.

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