Skip to content

Commit

Permalink
regulator: lp872x: initialize the DVS mode
Browse files Browse the repository at this point in the history
 The platform specific configuration(general_config) is optional.
 However, the DVS settings should be configured explicitly while
 loading the driver.
 This patch enables configuring the default DVS mode even though
 the platform data is not defined.

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Kim, Milo authored and Mark Brown committed Sep 5, 2012
1 parent b158fba commit 86b3fef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/regulator/lp872x.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,13 +796,14 @@ static int lp872x_config(struct lp872x *lp)
struct lp872x_platform_data *pdata = lp->pdata;
int ret;

if (!pdata->update_config)
return 0;
if (!pdata || !pdata->update_config)
goto init_dvs;

ret = lp872x_write_byte(lp, LP872X_GENERAL_CFG, pdata->general_config);
if (ret)
return ret;

init_dvs:
return lp872x_init_dvs(lp);
}

Expand Down

0 comments on commit 86b3fef

Please sign in to comment.