aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2014-03-26 12:57:44 -0400
committerMark Brown <broonie@linaro.org>2014-03-26 12:57:44 -0400
commit29dbdcf3163bc05aad758e978abb66cf161e6d0e (patch)
tree9f017b0482de728a1b1b8205485b087b94a2b7f0
parentb098d6726bbfb94c06d6e1097466187afddae61f (diff)
parent8669544a788a2d9de14cdbb3069b71ddc326e66f (diff)
Merge remote-tracking branch 'regulator/topic/core' into regulator-next
-rw-r--r--drivers/regulator/core.c14
-rw-r--r--drivers/regulator/dummy.c6
-rw-r--r--drivers/regulator/pfuze100-regulator.c2
-rw-r--r--drivers/regulator/s2mps11.c4
4 files changed, 22 insertions, 4 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index afca1bc24f26..bac485acc7f3 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2399,6 +2399,7 @@ int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV)
2399 struct regulator_dev *rdev = regulator->rdev; 2399 struct regulator_dev *rdev = regulator->rdev;
2400 int ret = 0; 2400 int ret = 0;
2401 int old_min_uV, old_max_uV; 2401 int old_min_uV, old_max_uV;
2402 int current_uV;
2402 2403
2403 mutex_lock(&rdev->mutex); 2404 mutex_lock(&rdev->mutex);
2404 2405
@@ -2409,6 +2410,19 @@ int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV)
2409 if (regulator->min_uV == min_uV && regulator->max_uV == max_uV) 2410 if (regulator->min_uV == min_uV && regulator->max_uV == max_uV)
2410 goto out; 2411 goto out;
2411 2412
2413 /* If we're trying to set a range that overlaps the current voltage,
2414 * return succesfully even though the regulator does not support
2415 * changing the voltage.
2416 */
2417 if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE)) {
2418 current_uV = _regulator_get_voltage(rdev);
2419 if (min_uV <= current_uV && current_uV <= max_uV) {
2420 regulator->min_uV = min_uV;
2421 regulator->max_uV = max_uV;
2422 goto out;
2423 }
2424 }
2425
2412 /* sanity check */ 2426 /* sanity check */
2413 if (!rdev->desc->ops->set_voltage && 2427 if (!rdev->desc->ops->set_voltage &&
2414 !rdev->desc->ops->set_voltage_sel) { 2428 !rdev->desc->ops->set_voltage_sel) {
diff --git a/drivers/regulator/dummy.c b/drivers/regulator/dummy.c
index df9f42524abb..2436db9e2ca3 100644
--- a/drivers/regulator/dummy.c
+++ b/drivers/regulator/dummy.c
@@ -25,7 +25,11 @@
25 25
26struct regulator_dev *dummy_regulator_rdev; 26struct regulator_dev *dummy_regulator_rdev;
27 27
28static struct regulator_init_data dummy_initdata; 28static struct regulator_init_data dummy_initdata = {
29 .constraints = {
30 .always_on = 1,
31 },
32};
29 33
30static struct regulator_ops dummy_ops; 34static struct regulator_ops dummy_ops;
31 35
diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c
index ab174f20ca11..b699d4e7acc5 100644
--- a/drivers/regulator/pfuze100-regulator.c
+++ b/drivers/regulator/pfuze100-regulator.c
@@ -92,7 +92,7 @@ MODULE_DEVICE_TABLE(of, pfuze_dt_ids);
92static int pfuze100_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay) 92static int pfuze100_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
93{ 93{
94 struct pfuze_chip *pfuze100 = rdev_get_drvdata(rdev); 94 struct pfuze_chip *pfuze100 = rdev_get_drvdata(rdev);
95 int id = rdev->desc->id; 95 int id = rdev_get_id(rdev);
96 unsigned int ramp_bits; 96 unsigned int ramp_bits;
97 int ret; 97 int ret;
98 98
diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c
index cd0b9e35a56d..89966213315c 100644
--- a/drivers/regulator/s2mps11.c
+++ b/drivers/regulator/s2mps11.c
@@ -65,7 +65,7 @@ static int s2mps11_regulator_set_voltage_time_sel(struct regulator_dev *rdev,
65 unsigned int ramp_delay = 0; 65 unsigned int ramp_delay = 0;
66 int old_volt, new_volt; 66 int old_volt, new_volt;
67 67
68 switch (rdev->desc->id) { 68 switch (rdev_get_id(rdev)) {
69 case S2MPS11_BUCK2: 69 case S2MPS11_BUCK2:
70 ramp_delay = s2mps11->ramp_delay2; 70 ramp_delay = s2mps11->ramp_delay2;
71 break; 71 break;
@@ -105,7 +105,7 @@ static int s2mps11_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
105 unsigned int ramp_enable = 1, enable_shift = 0; 105 unsigned int ramp_enable = 1, enable_shift = 0;
106 int ret; 106 int ret;
107 107
108 switch (rdev->desc->id) { 108 switch (rdev_get_id(rdev)) {
109 case S2MPS11_BUCK1: 109 case S2MPS11_BUCK1:
110 if (ramp_delay > s2mps11->ramp_delay16) 110 if (ramp_delay > s2mps11->ramp_delay16)
111 s2mps11->ramp_delay16 = ramp_delay; 111 s2mps11->ramp_delay16 = ramp_delay;