aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-12-09 22:42:57 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-12-09 22:42:57 -0500
commita8bfb69e77591c4811acbf30618cc07db9c001fc (patch)
tree1c7526e62c0ff9097bf4c056547fdd9c2af343fa /drivers/regulator
parentbdb7e45507893f4c509c539d442ed4962ac6fa0f (diff)
parent131a5b9d82f802e8e0320e81abf38ed2781bb35a (diff)
Merge remote-tracking branch 'regulator/topic/lp8788' into regulator-next
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/lp8788-buck.c18
-rw-r--r--drivers/regulator/lp8788-ldo.c13
2 files changed, 6 insertions, 25 deletions
diff --git a/drivers/regulator/lp8788-buck.c b/drivers/regulator/lp8788-buck.c
index 6cc02c35ddb5..aef3f2b0c5ea 100644
--- a/drivers/regulator/lp8788-buck.c
+++ b/drivers/regulator/lp8788-buck.c
@@ -429,18 +429,6 @@ static struct regulator_desc lp8788_buck_desc[] = {
429 }, 429 },
430}; 430};
431 431
432static int _gpio_request(struct lp8788_buck *buck, int gpio, char *name)
433{
434 struct device *dev = buck->lp->dev;
435
436 if (!gpio_is_valid(gpio)) {
437 dev_err(dev, "invalid gpio: %d\n", gpio);
438 return -EINVAL;
439 }
440
441 return devm_gpio_request_one(dev, gpio, DVS_LOW, name);
442}
443
444static int lp8788_dvs_gpio_request(struct lp8788_buck *buck, 432static int lp8788_dvs_gpio_request(struct lp8788_buck *buck,
445 enum lp8788_buck_id id) 433 enum lp8788_buck_id id)
446{ 434{
@@ -452,7 +440,8 @@ static int lp8788_dvs_gpio_request(struct lp8788_buck *buck,
452 switch (id) { 440 switch (id) {
453 case BUCK1: 441 case BUCK1:
454 gpio = pdata->buck1_dvs->gpio; 442 gpio = pdata->buck1_dvs->gpio;
455 ret = _gpio_request(buck, gpio, b1_name); 443 ret = devm_gpio_request_one(buck->lp->dev, gpio, DVS_LOW,
444 b1_name);
456 if (ret) 445 if (ret)
457 return ret; 446 return ret;
458 447
@@ -461,7 +450,8 @@ static int lp8788_dvs_gpio_request(struct lp8788_buck *buck,
461 case BUCK2: 450 case BUCK2:
462 for (i = 0 ; i < LP8788_NUM_BUCK2_DVS ; i++) { 451 for (i = 0 ; i < LP8788_NUM_BUCK2_DVS ; i++) {
463 gpio = pdata->buck2_dvs->gpio[i]; 452 gpio = pdata->buck2_dvs->gpio[i];
464 ret = _gpio_request(buck, gpio, b2_name[i]); 453 ret = devm_gpio_request_one(buck->lp->dev, gpio,
454 DVS_LOW, b2_name[i]);
465 if (ret) 455 if (ret)
466 return ret; 456 return ret;
467 } 457 }
diff --git a/drivers/regulator/lp8788-ldo.c b/drivers/regulator/lp8788-ldo.c
index 26753a013789..3792741708ce 100644
--- a/drivers/regulator/lp8788-ldo.c
+++ b/drivers/regulator/lp8788-ldo.c
@@ -126,7 +126,7 @@ struct lp8788_ldo {
126}; 126};
127 127
128/* DLDO 1, 2, 3, 9 voltage table */ 128/* DLDO 1, 2, 3, 9 voltage table */
129const int lp8788_dldo1239_vtbl[] = { 129static const int lp8788_dldo1239_vtbl[] = {
130 1800000, 1900000, 2000000, 2100000, 2200000, 2300000, 2400000, 2500000, 130 1800000, 1900000, 2000000, 2100000, 2200000, 2300000, 2400000, 2500000,
131 2600000, 2700000, 2800000, 2900000, 3000000, 2850000, 2850000, 2850000, 131 2600000, 2700000, 2800000, 2900000, 3000000, 2850000, 2850000, 2850000,
132 2850000, 2850000, 2850000, 2850000, 2850000, 2850000, 2850000, 2850000, 132 2850000, 2850000, 2850000, 2850000, 2850000, 2850000, 2850000, 2850000,
@@ -662,14 +662,6 @@ static int lp8788_config_ldo_enable_mode(struct lp8788_ldo *ldo,
662 [EN_DLDO7] = LP8788_EN_SEL_DLDO7_M, 662 [EN_DLDO7] = LP8788_EN_SEL_DLDO7_M,
663 [EN_DLDO911] = LP8788_EN_SEL_DLDO911_M, 663 [EN_DLDO911] = LP8788_EN_SEL_DLDO911_M,
664 }; 664 };
665 u8 val[] = {
666 [EN_ALDO1] = 0 << 5,
667 [EN_ALDO234] = 0 << 4,
668 [EN_ALDO5] = 0 << 3,
669 [EN_ALDO7] = 0 << 2,
670 [EN_DLDO7] = 0 << 1,
671 [EN_DLDO911] = 0 << 0,
672 };
673 665
674 switch (id) { 666 switch (id) {
675 case DLDO7: 667 case DLDO7:
@@ -708,8 +700,7 @@ static int lp8788_config_ldo_enable_mode(struct lp8788_ldo *ldo,
708 return ret; 700 return ret;
709 701
710set_default_ldo_enable_mode: 702set_default_ldo_enable_mode:
711 return lp8788_update_bits(lp, LP8788_EN_SEL, en_mask[enable_id], 703 return lp8788_update_bits(lp, LP8788_EN_SEL, en_mask[enable_id], 0);
712 val[enable_id]);
713} 704}
714 705
715static int lp8788_dldo_probe(struct platform_device *pdev) 706static int lp8788_dldo_probe(struct platform_device *pdev)