aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-07-20 10:22:20 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-08-28 14:00:24 -0400
commitc42ea5cdfb14418a9d81e7192d65196b2785c3c2 (patch)
treee6f8d874b3b46439a7055c7d0c6e6237b631080c
parent74c8cfdaa6865a6d47018d2d0606a6fd0053812f (diff)
regulator: lp8788-buck: Remove lp8788_set_default_dvs_ctrl_mode function
We already know the mask in lp8788_init_dvs() function, and we can update the corresponding bit for default_dvs_mode in lp8788_init_dvs() function. This function looks not necessary to me. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Milo(Woogyom) Kim <milo.kim@ti.com> Tested-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--drivers/regulator/lp8788-buck.c25
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
462static 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
483static int _gpio_request(struct lp8788_buck *buck, int gpio, char *name) 462static 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
552set_default_dvs_mode: 532set_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
556static __devinit int lp8788_buck_probe(struct platform_device *pdev) 537static __devinit int lp8788_buck_probe(struct platform_device *pdev)