regulator: helpers: Modify helpers enabling multi-bit control
authorCarlo Caione <carlo@caione.org>
Wed, 5 Mar 2014 21:11:29 +0000 (22:11 +0100)
committerMark Brown <broonie@linaro.org>
Thu, 6 Mar 2014 09:30:10 +0000 (17:30 +0800)
commitca5d1b3524b4d90a2e2f1f71583c1dca6b96fd92
treeacf10cbf9247ec8d7f8437faa9ba154a1fb8665e
parent38dbfb59d1175ef458d006556061adeaa8751b72
regulator: helpers: Modify helpers enabling multi-bit control

This patch extends the regulator helpers to account for device that use
multiple bits for control when using regmap enable/disable/bypass ops.

The actual regulator helpers wrongly assume that the regulator control
is always performed using single bits, using in the regulator_desc
struct only two parameters *_reg and *_mask defining register and mask
for control.

This patch extends this struct and introduces the helpers to take into
account devices where control is performed using multiple bits and
specific multi-bit values are used for enabling/disabling/bypassing the
regulator.

Signed-off-by: Carlo Caione <carlo@caione.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/regulator/helpers.c
include/linux/regulator/driver.h