aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-04-04 13:09:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-04-04 13:09:30 -0400
commit4a1e8ebc5e5918079109cc1cd1c44c2f0fd0e11b (patch)
tree3fcdeb8579c47735d82f44306282d7af2140a102 /drivers/regulator
parent66cfb32772495068fbb5627b2dc88649ad66c3e5 (diff)
parentd49fe3c4cd22965de7422dd81d46110fc3d4deef (diff)
Merge tag 'regulator-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator fixes from Mark Brown: "A bunch of smallish fixes that came up during the merge window as things got more testing - even more fixes from Axel, a fix for error handling in more complex systems using -EPROBE_DEFER and a couple of small fixes for the new dummy regulators." * tag 'regulator-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: Remove non-existent parameter from fixed-helper.c kernel doc regulator: Fix setting new voltage in s5m8767_set_voltage regulator: fix sysfs name collision between dummy and fixed dummy regulator regulator: Fix deadlock on removal of regulators with supplies regulator: Fix comments in include/linux/regulator/machine.h regulator: Only update [LDOx|DCx]_HIB_MODE bits in wm8350_[ldo|dcdc]_set_suspend_disable regulator: Fix setting low power mode for wm831x aldo regulator: Return microamps in wm8350_isink_get_current regulator: wm8350: Fix the logic to choose best current limit setting regulator: wm831x-isink: Fix the logic to choose best current limit setting regulator: wm831x-dcdc: Fix the logic to choose best current limit setting regulator: anatop: patching to device-tree property "reg". regulator: Do proper shift to set correct bit for DC[2|5]_HIB_MODE setting regulator: Fix restoring pmic.dcdcx_hib_mode settings in wm8350_dcdc_set_suspend_enable regulator: Fix unbalanced lock/unlock in mc13892_regulator_probe error path regulator: Fix set and get current limit for wm831x_buckv regulator: tps6586x: Fix list minimal voltage setting for LDO0
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/anatop-regulator.c5
-rw-r--r--drivers/regulator/core.c4
-rw-r--r--drivers/regulator/fixed-helper.c3
-rw-r--r--drivers/regulator/mc13892-regulator.c10
-rw-r--r--drivers/regulator/s5m8767.c14
-rw-r--r--drivers/regulator/tps6586x-regulator.c5
-rw-r--r--drivers/regulator/wm831x-dcdc.c9
-rw-r--r--drivers/regulator/wm831x-isink.c2
-rw-r--r--drivers/regulator/wm831x-ldo.c7
-rw-r--r--drivers/regulator/wm8350-regulator.c34
10 files changed, 49 insertions, 44 deletions
diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c
index 17499a55113d..53969af17558 100644
--- a/drivers/regulator/anatop-regulator.c
+++ b/drivers/regulator/anatop-regulator.c
@@ -138,9 +138,10 @@ static int __devinit anatop_regulator_probe(struct platform_device *pdev)
138 rdesc->type = REGULATOR_VOLTAGE; 138 rdesc->type = REGULATOR_VOLTAGE;
139 rdesc->owner = THIS_MODULE; 139 rdesc->owner = THIS_MODULE;
140 sreg->mfd = anatopmfd; 140 sreg->mfd = anatopmfd;
141 ret = of_property_read_u32(np, "reg", &sreg->control_reg); 141 ret = of_property_read_u32(np, "anatop-reg-offset",
142 &sreg->control_reg);
142 if (ret) { 143 if (ret) {
143 dev_err(dev, "no reg property set\n"); 144 dev_err(dev, "no anatop-reg-offset property set\n");
144 goto anatop_probe_end; 145 goto anatop_probe_end;
145 } 146 }
146 ret = of_property_read_u32(np, "anatop-vol-bit-width", 147 ret = of_property_read_u32(np, "anatop-vol-bit-width",
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index c056abd7562a..e70dd382a009 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2992,14 +2992,14 @@ void regulator_unregister(struct regulator_dev *rdev)
2992 if (rdev == NULL) 2992 if (rdev == NULL)
2993 return; 2993 return;
2994 2994
2995 if (rdev->supply)
2996 regulator_put(rdev->supply);
2995 mutex_lock(&regulator_list_mutex); 2997 mutex_lock(&regulator_list_mutex);
2996 debugfs_remove_recursive(rdev->debugfs); 2998 debugfs_remove_recursive(rdev->debugfs);
2997 flush_work_sync(&rdev->disable_work.work); 2999 flush_work_sync(&rdev->disable_work.work);
2998 WARN_ON(rdev->open_count); 3000 WARN_ON(rdev->open_count);
2999 unset_regulator_supplies(rdev); 3001 unset_regulator_supplies(rdev);
3000 list_del(&rdev->list); 3002 list_del(&rdev->list);
3001 if (rdev->supply)
3002 regulator_put(rdev->supply);
3003 kfree(rdev->constraints); 3003 kfree(rdev->constraints);
3004 device_unregister(&rdev->dev); 3004 device_unregister(&rdev->dev);
3005 mutex_unlock(&regulator_list_mutex); 3005 mutex_unlock(&regulator_list_mutex);
diff --git a/drivers/regulator/fixed-helper.c b/drivers/regulator/fixed-helper.c
index 30d0a15b8949..cacd33c9d042 100644
--- a/drivers/regulator/fixed-helper.c
+++ b/drivers/regulator/fixed-helper.c
@@ -18,7 +18,6 @@ static void regulator_fixed_release(struct device *dev)
18 18
19/** 19/**
20 * regulator_register_fixed - register a no-op fixed regulator 20 * regulator_register_fixed - register a no-op fixed regulator
21 * @name: supply name
22 * @id: platform device id 21 * @id: platform device id
23 * @supplies: consumers for this regulator 22 * @supplies: consumers for this regulator
24 * @num_supplies: number of consumers 23 * @num_supplies: number of consumers
@@ -32,7 +31,7 @@ struct platform_device *regulator_register_fixed(int id,
32 if (!data) 31 if (!data)
33 return NULL; 32 return NULL;
34 33
35 data->cfg.supply_name = "dummy"; 34 data->cfg.supply_name = "fixed-dummy";
36 data->cfg.microvolts = 0; 35 data->cfg.microvolts = 0;
37 data->cfg.gpio = -EINVAL; 36 data->cfg.gpio = -EINVAL;
38 data->cfg.enabled_at_boot = 1; 37 data->cfg.enabled_at_boot = 1;
diff --git a/drivers/regulator/mc13892-regulator.c b/drivers/regulator/mc13892-regulator.c
index e8cfc99dd8f0..845aa2263b8a 100644
--- a/drivers/regulator/mc13892-regulator.c
+++ b/drivers/regulator/mc13892-regulator.c
@@ -552,7 +552,7 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev)
552 mc13xxx_lock(mc13892); 552 mc13xxx_lock(mc13892);
553 ret = mc13xxx_reg_read(mc13892, MC13892_REVISION, &val); 553 ret = mc13xxx_reg_read(mc13892, MC13892_REVISION, &val);
554 if (ret) 554 if (ret)
555 goto err_free; 555 goto err_unlock;
556 556
557 /* enable switch auto mode */ 557 /* enable switch auto mode */
558 if ((val & 0x0000FFFF) == 0x45d0) { 558 if ((val & 0x0000FFFF) == 0x45d0) {
@@ -562,7 +562,7 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev)
562 MC13892_SWITCHERS4_SW1MODE_AUTO | 562 MC13892_SWITCHERS4_SW1MODE_AUTO |
563 MC13892_SWITCHERS4_SW2MODE_AUTO); 563 MC13892_SWITCHERS4_SW2MODE_AUTO);
564 if (ret) 564 if (ret)
565 goto err_free; 565 goto err_unlock;
566 566
567 ret = mc13xxx_reg_rmw(mc13892, MC13892_SWITCHERS5, 567 ret = mc13xxx_reg_rmw(mc13892, MC13892_SWITCHERS5,
568 MC13892_SWITCHERS5_SW3MODE_M | 568 MC13892_SWITCHERS5_SW3MODE_M |
@@ -570,7 +570,7 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev)
570 MC13892_SWITCHERS5_SW3MODE_AUTO | 570 MC13892_SWITCHERS5_SW3MODE_AUTO |
571 MC13892_SWITCHERS5_SW4MODE_AUTO); 571 MC13892_SWITCHERS5_SW4MODE_AUTO);
572 if (ret) 572 if (ret)
573 goto err_free; 573 goto err_unlock;
574 } 574 }
575 mc13xxx_unlock(mc13892); 575 mc13xxx_unlock(mc13892);
576 576
@@ -612,10 +612,10 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev)
612err: 612err:
613 while (--i >= 0) 613 while (--i >= 0)
614 regulator_unregister(priv->regulators[i]); 614 regulator_unregister(priv->regulators[i]);
615 return ret;
615 616
616err_free: 617err_unlock:
617 mc13xxx_unlock(mc13892); 618 mc13xxx_unlock(mc13892);
618
619 return ret; 619 return ret;
620} 620}
621 621
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index 58447db15de1..4ca2db059004 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -311,8 +311,7 @@ static int s5m8767_set_voltage(struct regulator_dev *rdev,
311 struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev); 311 struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev);
312 const struct s5m_voltage_desc *desc; 312 const struct s5m_voltage_desc *desc;
313 int reg_id = rdev_get_id(rdev); 313 int reg_id = rdev_get_id(rdev);
314 int reg, mask, ret; 314 int sel, reg, mask, ret;
315 int i;
316 u8 val; 315 u8 val;
317 316
318 switch (reg_id) { 317 switch (reg_id) {
@@ -333,19 +332,20 @@ static int s5m8767_set_voltage(struct regulator_dev *rdev,
333 332
334 desc = reg_voltage_map[reg_id]; 333 desc = reg_voltage_map[reg_id];
335 334
336 i = s5m8767_convert_voltage_to_sel(desc, min_uV, max_uV); 335 sel = s5m8767_convert_voltage_to_sel(desc, min_uV, max_uV);
337 if (i < 0) 336 if (sel < 0)
338 return i; 337 return sel;
339 338
340 ret = s5m8767_get_voltage_register(rdev, &reg); 339 ret = s5m8767_get_voltage_register(rdev, &reg);
341 if (ret) 340 if (ret)
342 return ret; 341 return ret;
343 342
344 s5m_reg_read(s5m8767->iodev, reg, &val); 343 s5m_reg_read(s5m8767->iodev, reg, &val);
345 val = val & mask; 344 val &= ~mask;
345 val |= sel;
346 346
347 ret = s5m_reg_write(s5m8767->iodev, reg, val); 347 ret = s5m_reg_write(s5m8767->iodev, reg, val);
348 *selector = i; 348 *selector = sel;
349 349
350 return ret; 350 return ret;
351} 351}
diff --git a/drivers/regulator/tps6586x-regulator.c b/drivers/regulator/tps6586x-regulator.c
index 29b615ce3aff..cfc1f16f7771 100644
--- a/drivers/regulator/tps6586x-regulator.c
+++ b/drivers/regulator/tps6586x-regulator.c
@@ -79,6 +79,11 @@ static int tps6586x_ldo_list_voltage(struct regulator_dev *rdev,
79 unsigned selector) 79 unsigned selector)
80{ 80{
81 struct tps6586x_regulator *info = rdev_get_drvdata(rdev); 81 struct tps6586x_regulator *info = rdev_get_drvdata(rdev);
82 int rid = rdev_get_id(rdev);
83
84 /* LDO0 has minimal voltage 1.2V rather than 1.25V */
85 if ((rid == TPS6586X_ID_LDO_0) && (selector == 0))
86 return (info->voltages[0] - 50) * 1000;
82 87
83 return info->voltages[selector] * 1000; 88 return info->voltages[selector] * 1000;
84} 89}
diff --git a/drivers/regulator/wm831x-dcdc.c b/drivers/regulator/wm831x-dcdc.c
index 4904a40b0d46..ff810e787eac 100644
--- a/drivers/regulator/wm831x-dcdc.c
+++ b/drivers/regulator/wm831x-dcdc.c
@@ -380,13 +380,15 @@ static int wm831x_buckv_set_current_limit(struct regulator_dev *rdev,
380 int i; 380 int i;
381 381
382 for (i = 0; i < ARRAY_SIZE(wm831x_dcdc_ilim); i++) { 382 for (i = 0; i < ARRAY_SIZE(wm831x_dcdc_ilim); i++) {
383 if (max_uA <= wm831x_dcdc_ilim[i]) 383 if ((min_uA <= wm831x_dcdc_ilim[i]) &&
384 (wm831x_dcdc_ilim[i] <= max_uA))
384 break; 385 break;
385 } 386 }
386 if (i == ARRAY_SIZE(wm831x_dcdc_ilim)) 387 if (i == ARRAY_SIZE(wm831x_dcdc_ilim))
387 return -EINVAL; 388 return -EINVAL;
388 389
389 return wm831x_set_bits(wm831x, reg, WM831X_DC1_HC_THR_MASK, i); 390 return wm831x_set_bits(wm831x, reg, WM831X_DC1_HC_THR_MASK,
391 i << WM831X_DC1_HC_THR_SHIFT);
390} 392}
391 393
392static int wm831x_buckv_get_current_limit(struct regulator_dev *rdev) 394static int wm831x_buckv_get_current_limit(struct regulator_dev *rdev)
@@ -400,7 +402,8 @@ static int wm831x_buckv_get_current_limit(struct regulator_dev *rdev)
400 if (val < 0) 402 if (val < 0)
401 return val; 403 return val;
402 404
403 return wm831x_dcdc_ilim[val & WM831X_DC1_HC_THR_MASK]; 405 val = (val & WM831X_DC1_HC_THR_MASK) >> WM831X_DC1_HC_THR_SHIFT;
406 return wm831x_dcdc_ilim[val];
404} 407}
405 408
406static struct regulator_ops wm831x_buckv_ops = { 409static struct regulator_ops wm831x_buckv_ops = {
diff --git a/drivers/regulator/wm831x-isink.c b/drivers/regulator/wm831x-isink.c
index 634aac3f2d5f..b414e09c5620 100644
--- a/drivers/regulator/wm831x-isink.c
+++ b/drivers/regulator/wm831x-isink.c
@@ -101,7 +101,7 @@ static int wm831x_isink_set_current(struct regulator_dev *rdev,
101 101
102 for (i = 0; i < ARRAY_SIZE(wm831x_isinkv_values); i++) { 102 for (i = 0; i < ARRAY_SIZE(wm831x_isinkv_values); i++) {
103 int val = wm831x_isinkv_values[i]; 103 int val = wm831x_isinkv_values[i];
104 if (min_uA >= val && val <= max_uA) { 104 if (min_uA <= val && val <= max_uA) {
105 ret = wm831x_set_bits(wm831x, isink->reg, 105 ret = wm831x_set_bits(wm831x, isink->reg,
106 WM831X_CS1_ISEL_MASK, i); 106 WM831X_CS1_ISEL_MASK, i);
107 return ret; 107 return ret;
diff --git a/drivers/regulator/wm831x-ldo.c b/drivers/regulator/wm831x-ldo.c
index f1e4ab0f9fda..641e9f6499d1 100644
--- a/drivers/regulator/wm831x-ldo.c
+++ b/drivers/regulator/wm831x-ldo.c
@@ -506,22 +506,19 @@ static int wm831x_aldo_set_mode(struct regulator_dev *rdev,
506{ 506{
507 struct wm831x_ldo *ldo = rdev_get_drvdata(rdev); 507 struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
508 struct wm831x *wm831x = ldo->wm831x; 508 struct wm831x *wm831x = ldo->wm831x;
509 int ctrl_reg = ldo->base + WM831X_LDO_CONTROL;
510 int on_reg = ldo->base + WM831X_LDO_ON_CONTROL; 509 int on_reg = ldo->base + WM831X_LDO_ON_CONTROL;
511 int ret; 510 int ret;
512 511
513 512
514 switch (mode) { 513 switch (mode) {
515 case REGULATOR_MODE_NORMAL: 514 case REGULATOR_MODE_NORMAL:
516 ret = wm831x_set_bits(wm831x, on_reg, 515 ret = wm831x_set_bits(wm831x, on_reg, WM831X_LDO7_ON_MODE, 0);
517 WM831X_LDO7_ON_MODE, 0);
518 if (ret < 0) 516 if (ret < 0)
519 return ret; 517 return ret;
520 break; 518 break;
521 519
522 case REGULATOR_MODE_IDLE: 520 case REGULATOR_MODE_IDLE:
523 ret = wm831x_set_bits(wm831x, ctrl_reg, 521 ret = wm831x_set_bits(wm831x, on_reg, WM831X_LDO7_ON_MODE,
524 WM831X_LDO7_ON_MODE,
525 WM831X_LDO7_ON_MODE); 522 WM831X_LDO7_ON_MODE);
526 if (ret < 0) 523 if (ret < 0)
527 return ret; 524 return ret;
diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c
index ab1e183a74b5..05ecfb872319 100644
--- a/drivers/regulator/wm8350-regulator.c
+++ b/drivers/regulator/wm8350-regulator.c
@@ -99,7 +99,7 @@ static int get_isink_val(int min_uA, int max_uA, u16 *setting)
99{ 99{
100 int i; 100 int i;
101 101
102 for (i = ARRAY_SIZE(isink_cur) - 1; i >= 0; i--) { 102 for (i = 0; i < ARRAY_SIZE(isink_cur); i++) {
103 if (min_uA <= isink_cur[i] && max_uA >= isink_cur[i]) { 103 if (min_uA <= isink_cur[i] && max_uA >= isink_cur[i]) {
104 *setting = i; 104 *setting = i;
105 return 0; 105 return 0;
@@ -186,7 +186,7 @@ static int wm8350_isink_get_current(struct regulator_dev *rdev)
186 return 0; 186 return 0;
187 } 187 }
188 188
189 return DIV_ROUND_CLOSEST(isink_cur[val], 100); 189 return isink_cur[val];
190} 190}
191 191
192/* turn on ISINK followed by DCDC */ 192/* turn on ISINK followed by DCDC */
@@ -495,25 +495,25 @@ static int wm8350_dcdc_set_suspend_enable(struct regulator_dev *rdev)
495 val = wm8350_reg_read(wm8350, WM8350_DCDC1_LOW_POWER) 495 val = wm8350_reg_read(wm8350, WM8350_DCDC1_LOW_POWER)
496 & ~WM8350_DCDC_HIB_MODE_MASK; 496 & ~WM8350_DCDC_HIB_MODE_MASK;
497 wm8350_reg_write(wm8350, WM8350_DCDC1_LOW_POWER, 497 wm8350_reg_write(wm8350, WM8350_DCDC1_LOW_POWER,
498 wm8350->pmic.dcdc1_hib_mode); 498 val | wm8350->pmic.dcdc1_hib_mode);
499 break; 499 break;
500 case WM8350_DCDC_3: 500 case WM8350_DCDC_3:
501 val = wm8350_reg_read(wm8350, WM8350_DCDC3_LOW_POWER) 501 val = wm8350_reg_read(wm8350, WM8350_DCDC3_LOW_POWER)
502 & ~WM8350_DCDC_HIB_MODE_MASK; 502 & ~WM8350_DCDC_HIB_MODE_MASK;
503 wm8350_reg_write(wm8350, WM8350_DCDC3_LOW_POWER, 503 wm8350_reg_write(wm8350, WM8350_DCDC3_LOW_POWER,
504 wm8350->pmic.dcdc3_hib_mode); 504 val | wm8350->pmic.dcdc3_hib_mode);
505 break; 505 break;
506 case WM8350_DCDC_4: 506 case WM8350_DCDC_4:
507 val = wm8350_reg_read(wm8350, WM8350_DCDC4_LOW_POWER) 507 val = wm8350_reg_read(wm8350, WM8350_DCDC4_LOW_POWER)
508 & ~WM8350_DCDC_HIB_MODE_MASK; 508 & ~WM8350_DCDC_HIB_MODE_MASK;
509 wm8350_reg_write(wm8350, WM8350_DCDC4_LOW_POWER, 509 wm8350_reg_write(wm8350, WM8350_DCDC4_LOW_POWER,
510 wm8350->pmic.dcdc4_hib_mode); 510 val | wm8350->pmic.dcdc4_hib_mode);
511 break; 511 break;
512 case WM8350_DCDC_6: 512 case WM8350_DCDC_6:
513 val = wm8350_reg_read(wm8350, WM8350_DCDC6_LOW_POWER) 513 val = wm8350_reg_read(wm8350, WM8350_DCDC6_LOW_POWER)
514 & ~WM8350_DCDC_HIB_MODE_MASK; 514 & ~WM8350_DCDC_HIB_MODE_MASK;
515 wm8350_reg_write(wm8350, WM8350_DCDC6_LOW_POWER, 515 wm8350_reg_write(wm8350, WM8350_DCDC6_LOW_POWER,
516 wm8350->pmic.dcdc6_hib_mode); 516 val | wm8350->pmic.dcdc6_hib_mode);
517 break; 517 break;
518 case WM8350_DCDC_2: 518 case WM8350_DCDC_2:
519 case WM8350_DCDC_5: 519 case WM8350_DCDC_5:
@@ -535,25 +535,25 @@ static int wm8350_dcdc_set_suspend_disable(struct regulator_dev *rdev)
535 val = wm8350_reg_read(wm8350, WM8350_DCDC1_LOW_POWER); 535 val = wm8350_reg_read(wm8350, WM8350_DCDC1_LOW_POWER);
536 wm8350->pmic.dcdc1_hib_mode = val & WM8350_DCDC_HIB_MODE_MASK; 536 wm8350->pmic.dcdc1_hib_mode = val & WM8350_DCDC_HIB_MODE_MASK;
537 wm8350_reg_write(wm8350, WM8350_DCDC1_LOW_POWER, 537 wm8350_reg_write(wm8350, WM8350_DCDC1_LOW_POWER,
538 WM8350_DCDC_HIB_MODE_DIS); 538 val | WM8350_DCDC_HIB_MODE_DIS);
539 break; 539 break;
540 case WM8350_DCDC_3: 540 case WM8350_DCDC_3:
541 val = wm8350_reg_read(wm8350, WM8350_DCDC3_LOW_POWER); 541 val = wm8350_reg_read(wm8350, WM8350_DCDC3_LOW_POWER);
542 wm8350->pmic.dcdc3_hib_mode = val & WM8350_DCDC_HIB_MODE_MASK; 542 wm8350->pmic.dcdc3_hib_mode = val & WM8350_DCDC_HIB_MODE_MASK;
543 wm8350_reg_write(wm8350, WM8350_DCDC3_LOW_POWER, 543 wm8350_reg_write(wm8350, WM8350_DCDC3_LOW_POWER,
544 WM8350_DCDC_HIB_MODE_DIS); 544 val | WM8350_DCDC_HIB_MODE_DIS);
545 break; 545 break;
546 case WM8350_DCDC_4: 546 case WM8350_DCDC_4:
547 val = wm8350_reg_read(wm8350, WM8350_DCDC4_LOW_POWER); 547 val = wm8350_reg_read(wm8350, WM8350_DCDC4_LOW_POWER);
548 wm8350->pmic.dcdc4_hib_mode = val & WM8350_DCDC_HIB_MODE_MASK; 548 wm8350->pmic.dcdc4_hib_mode = val & WM8350_DCDC_HIB_MODE_MASK;
549 wm8350_reg_write(wm8350, WM8350_DCDC4_LOW_POWER, 549 wm8350_reg_write(wm8350, WM8350_DCDC4_LOW_POWER,
550 WM8350_DCDC_HIB_MODE_DIS); 550 val | WM8350_DCDC_HIB_MODE_DIS);
551 break; 551 break;
552 case WM8350_DCDC_6: 552 case WM8350_DCDC_6:
553 val = wm8350_reg_read(wm8350, WM8350_DCDC6_LOW_POWER); 553 val = wm8350_reg_read(wm8350, WM8350_DCDC6_LOW_POWER);
554 wm8350->pmic.dcdc6_hib_mode = val & WM8350_DCDC_HIB_MODE_MASK; 554 wm8350->pmic.dcdc6_hib_mode = val & WM8350_DCDC_HIB_MODE_MASK;
555 wm8350_reg_write(wm8350, WM8350_DCDC6_LOW_POWER, 555 wm8350_reg_write(wm8350, WM8350_DCDC6_LOW_POWER,
556 WM8350_DCDC_HIB_MODE_DIS); 556 val | WM8350_DCDC_HIB_MODE_DIS);
557 break; 557 break;
558 case WM8350_DCDC_2: 558 case WM8350_DCDC_2:
559 case WM8350_DCDC_5: 559 case WM8350_DCDC_5:
@@ -575,13 +575,13 @@ static int wm8350_dcdc25_set_suspend_enable(struct regulator_dev *rdev)
575 val = wm8350_reg_read(wm8350, WM8350_DCDC2_CONTROL) 575 val = wm8350_reg_read(wm8350, WM8350_DCDC2_CONTROL)
576 & ~WM8350_DC2_HIB_MODE_MASK; 576 & ~WM8350_DC2_HIB_MODE_MASK;
577 wm8350_reg_write(wm8350, WM8350_DCDC2_CONTROL, val | 577 wm8350_reg_write(wm8350, WM8350_DCDC2_CONTROL, val |
578 WM8350_DC2_HIB_MODE_ACTIVE); 578 (WM8350_DC2_HIB_MODE_ACTIVE << WM8350_DC2_HIB_MODE_SHIFT));
579 break; 579 break;
580 case WM8350_DCDC_5: 580 case WM8350_DCDC_5:
581 val = wm8350_reg_read(wm8350, WM8350_DCDC5_CONTROL) 581 val = wm8350_reg_read(wm8350, WM8350_DCDC5_CONTROL)
582 & ~WM8350_DC2_HIB_MODE_MASK; 582 & ~WM8350_DC5_HIB_MODE_MASK;
583 wm8350_reg_write(wm8350, WM8350_DCDC5_CONTROL, val | 583 wm8350_reg_write(wm8350, WM8350_DCDC5_CONTROL, val |
584 WM8350_DC5_HIB_MODE_ACTIVE); 584 (WM8350_DC5_HIB_MODE_ACTIVE << WM8350_DC5_HIB_MODE_SHIFT));
585 break; 585 break;
586 default: 586 default:
587 return -EINVAL; 587 return -EINVAL;
@@ -600,13 +600,13 @@ static int wm8350_dcdc25_set_suspend_disable(struct regulator_dev *rdev)
600 val = wm8350_reg_read(wm8350, WM8350_DCDC2_CONTROL) 600 val = wm8350_reg_read(wm8350, WM8350_DCDC2_CONTROL)
601 & ~WM8350_DC2_HIB_MODE_MASK; 601 & ~WM8350_DC2_HIB_MODE_MASK;
602 wm8350_reg_write(wm8350, WM8350_DCDC2_CONTROL, val | 602 wm8350_reg_write(wm8350, WM8350_DCDC2_CONTROL, val |
603 WM8350_DC2_HIB_MODE_DISABLE); 603 (WM8350_DC2_HIB_MODE_DISABLE << WM8350_DC2_HIB_MODE_SHIFT));
604 break; 604 break;
605 case WM8350_DCDC_5: 605 case WM8350_DCDC_5:
606 val = wm8350_reg_read(wm8350, WM8350_DCDC5_CONTROL) 606 val = wm8350_reg_read(wm8350, WM8350_DCDC5_CONTROL)
607 & ~WM8350_DC2_HIB_MODE_MASK; 607 & ~WM8350_DC5_HIB_MODE_MASK;
608 wm8350_reg_write(wm8350, WM8350_DCDC5_CONTROL, val | 608 wm8350_reg_write(wm8350, WM8350_DCDC5_CONTROL, val |
609 WM8350_DC2_HIB_MODE_DISABLE); 609 (WM8350_DC5_HIB_MODE_DISABLE << WM8350_DC5_HIB_MODE_SHIFT));
610 break; 610 break;
611 default: 611 default:
612 return -EINVAL; 612 return -EINVAL;
@@ -749,7 +749,7 @@ static int wm8350_ldo_set_suspend_disable(struct regulator_dev *rdev)
749 749
750 /* all LDOs have same mV bits */ 750 /* all LDOs have same mV bits */
751 val = wm8350_reg_read(wm8350, volt_reg) & ~WM8350_LDO1_HIB_MODE_MASK; 751 val = wm8350_reg_read(wm8350, volt_reg) & ~WM8350_LDO1_HIB_MODE_MASK;
752 wm8350_reg_write(wm8350, volt_reg, WM8350_LDO1_HIB_MODE_DIS); 752 wm8350_reg_write(wm8350, volt_reg, val | WM8350_LDO1_HIB_MODE_DIS);
753 return 0; 753 return 0;
754} 754}
755 755