summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/ricoh583-regulator.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/regulator/ricoh583-regulator.c b/drivers/regulator/ricoh583-regulator.c
index 2f3ef87ecda7..867ffe629ed2 100644
--- a/drivers/regulator/ricoh583-regulator.c
+++ b/drivers/regulator/ricoh583-regulator.c
@@ -148,7 +148,8 @@ static int __ricoh583_set_ds_voltage(struct device *parent,
}
static int __ricoh583_set_voltage(struct device *parent,
- struct ricoh583_regulator *ri, int min_uV, int max_uV)
+ struct ricoh583_regulator *ri, int min_uV, int max_uV,
+ unsigned *selector)
{
int vsel;
int ret;
@@ -161,6 +162,9 @@ static int __ricoh583_set_voltage(struct device *parent,
if (vsel > ri->nsteps)
return -EDOM;
+ if (selector)
+ *selector = vsel;
+
vout_val = (ri->vout_reg_cache & ~ri->vout_mask) |
(vsel & ri->vout_mask);
ret = ricoh583_write(parent, ri->vout_reg, vout_val);
@@ -173,12 +177,12 @@ static int __ricoh583_set_voltage(struct device *parent,
}
static int ricoh583_set_voltage(struct regulator_dev *rdev,
- int min_uV, int max_uV)
+ int min_uV, int max_uV, unsigned *selector)
{
struct ricoh583_regulator *ri = rdev_get_drvdata(rdev);
struct device *parent = to_ricoh583_dev(rdev);
- return __ricoh583_set_voltage(parent, ri, min_uV, max_uV);
+ return __ricoh583_set_voltage(parent, ri, min_uV, max_uV, selector);
}
static int ricoh583_get_voltage(struct regulator_dev *rdev)
@@ -303,7 +307,7 @@ static int ricoh583_regulator_preinit(struct device *parent,
if (ricoh583_pdata->init_uV >= 0) {
ret = __ricoh583_set_voltage(parent, ri,
ricoh583_pdata->init_uV,
- ricoh583_pdata->init_uV);
+ ricoh583_pdata->init_uV, 0);
if (ret < 0) {
dev_err(ri->dev, "Not able to initialize voltage %d "
"for rail %d err %d\n", ricoh583_pdata->init_uV,