diff options
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/lp8788-buck.c | 18 | ||||
-rw-r--r-- | drivers/regulator/lp8788-ldo.c | 13 |
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 | ||
432 | static 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 | |||
444 | static int lp8788_dvs_gpio_request(struct lp8788_buck *buck, | 432 | static 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 */ |
129 | const int lp8788_dldo1239_vtbl[] = { | 129 | static 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 | ||
710 | set_default_ldo_enable_mode: | 702 | set_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 | ||
715 | static int lp8788_dldo_probe(struct platform_device *pdev) | 706 | static int lp8788_dldo_probe(struct platform_device *pdev) |