diff options
-rw-r--r-- | drivers/regulator/lp8788-buck.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/drivers/regulator/lp8788-buck.c b/drivers/regulator/lp8788-buck.c index 6356e821400f..0c93a6abe4e8 100644 --- a/drivers/regulator/lp8788-buck.c +++ b/drivers/regulator/lp8788-buck.c | |||
@@ -459,27 +459,6 @@ static struct regulator_desc lp8788_buck_desc[] = { | |||
459 | }, | 459 | }, |
460 | }; | 460 | }; |
461 | 461 | ||
462 | static int lp8788_set_default_dvs_ctrl_mode(struct lp8788 *lp, | ||
463 | enum lp8788_buck_id id) | ||
464 | { | ||
465 | u8 mask, val; | ||
466 | |||
467 | switch (id) { | ||
468 | case BUCK1: | ||
469 | mask = LP8788_BUCK1_DVS_SEL_M; | ||
470 | val = LP8788_BUCK1_DVS_I2C; | ||
471 | break; | ||
472 | case BUCK2: | ||
473 | mask = LP8788_BUCK2_DVS_SEL_M; | ||
474 | val = LP8788_BUCK2_DVS_I2C; | ||
475 | break; | ||
476 | default: | ||
477 | return 0; | ||
478 | } | ||
479 | |||
480 | return lp8788_update_bits(lp, LP8788_BUCK_DVS_SEL, mask, val); | ||
481 | } | ||
482 | |||
483 | static int _gpio_request(struct lp8788_buck *buck, int gpio, char *name) | 462 | static int _gpio_request(struct lp8788_buck *buck, int gpio, char *name) |
484 | { | 463 | { |
485 | struct device *dev = buck->lp->dev; | 464 | struct device *dev = buck->lp->dev; |
@@ -530,6 +509,7 @@ static int lp8788_init_dvs(struct lp8788_buck *buck, enum lp8788_buck_id id) | |||
530 | struct lp8788_platform_data *pdata = buck->lp->pdata; | 509 | struct lp8788_platform_data *pdata = buck->lp->pdata; |
531 | u8 mask[] = { LP8788_BUCK1_DVS_SEL_M, LP8788_BUCK2_DVS_SEL_M }; | 510 | u8 mask[] = { LP8788_BUCK1_DVS_SEL_M, LP8788_BUCK2_DVS_SEL_M }; |
532 | u8 val[] = { LP8788_BUCK1_DVS_PIN, LP8788_BUCK2_DVS_PIN }; | 511 | u8 val[] = { LP8788_BUCK1_DVS_PIN, LP8788_BUCK2_DVS_PIN }; |
512 | u8 default_dvs_mode[] = { LP8788_BUCK1_DVS_I2C, LP8788_BUCK2_DVS_I2C }; | ||
533 | 513 | ||
534 | /* no dvs for buck3, 4 */ | 514 | /* no dvs for buck3, 4 */ |
535 | if (id == BUCK3 || id == BUCK4) | 515 | if (id == BUCK3 || id == BUCK4) |
@@ -550,7 +530,8 @@ static int lp8788_init_dvs(struct lp8788_buck *buck, enum lp8788_buck_id id) | |||
550 | val[id]); | 530 | val[id]); |
551 | 531 | ||
552 | set_default_dvs_mode: | 532 | set_default_dvs_mode: |
553 | return lp8788_set_default_dvs_ctrl_mode(buck->lp, id); | 533 | return lp8788_update_bits(buck->lp, LP8788_BUCK_DVS_SEL, mask[id], |
534 | default_dvs_mode[id]); | ||
554 | } | 535 | } |
555 | 536 | ||
556 | static __devinit int lp8788_buck_probe(struct platform_device *pdev) | 537 | static __devinit int lp8788_buck_probe(struct platform_device *pdev) |