aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-02-19 07:42:29 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-02-19 07:42:29 -0500
commitfc221525bd63887f74c18708ee1d654d019fa8c3 (patch)
treebcb2eb985fcc152ab4441cc82690930c2bce39a3 /drivers/regulator/core.c
parent0dbf165ec43dd7f61fc0d596083c136fde01530f (diff)
parentc6f0a0efb163b7d2e879f92197ab5e674868358e (diff)
Merge remote-tracking branch 'regulator/topic/apply' into regulator-next
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r--drivers/regulator/core.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 278584302f2d..de47880db203 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2080,10 +2080,20 @@ EXPORT_SYMBOL_GPL(regulator_get_voltage_sel_regmap);
2080 */ 2080 */
2081int regulator_set_voltage_sel_regmap(struct regulator_dev *rdev, unsigned sel) 2081int regulator_set_voltage_sel_regmap(struct regulator_dev *rdev, unsigned sel)
2082{ 2082{
2083 int ret;
2084
2083 sel <<= ffs(rdev->desc->vsel_mask) - 1; 2085 sel <<= ffs(rdev->desc->vsel_mask) - 1;
2084 2086
2085 return regmap_update_bits(rdev->regmap, rdev->desc->vsel_reg, 2087 ret = regmap_update_bits(rdev->regmap, rdev->desc->vsel_reg,
2086 rdev->desc->vsel_mask, sel); 2088 rdev->desc->vsel_mask, sel);
2089 if (ret)
2090 return ret;
2091
2092 if (rdev->desc->apply_bit)
2093 ret = regmap_update_bits(rdev->regmap, rdev->desc->apply_reg,
2094 rdev->desc->apply_bit,
2095 rdev->desc->apply_bit);
2096 return ret;
2087} 2097}
2088EXPORT_SYMBOL_GPL(regulator_set_voltage_sel_regmap); 2098EXPORT_SYMBOL_GPL(regulator_set_voltage_sel_regmap);
2089 2099