Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323361
b: refs/heads/master
c: b158fba
h: refs/heads/master
i:
  323359: 490de95
v: v3
  • Loading branch information
Kim, Milo authored and Mark Brown committed Sep 5, 2012
1 parent c90a3eb commit f13b82b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9ffaa8689ea71ad74075dfd2a7520e6b48ecd910
refs/heads/master: b158fba605bf4f1c97af338dfab64c85c4937513
15 changes: 14 additions & 1 deletion trunk/drivers/regulator/lp872x.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
#define EXTERN_DVS_USED 0
#define MAX_DELAY 6

/* Default DVS Mode */
#define LP8720_DEFAULT_DVS 0
#define LP8725_DEFAULT_DVS BIT(2)

/* dump registers in regmap-debugfs */
#define MAX_REGISTERS 0x0F

Expand Down Expand Up @@ -750,8 +754,13 @@ static int lp872x_check_dvs_validity(struct lp872x *lp)
static int lp872x_init_dvs(struct lp872x *lp)
{
int ret, gpio;
struct lp872x_dvs *dvs = lp->pdata->dvs;
struct lp872x_dvs *dvs = lp->pdata ? lp->pdata->dvs : NULL;
enum lp872x_dvs_state pinstate;
u8 mask[] = { LP8720_EXT_DVS_M, LP8725_DVS1_M | LP8725_DVS2_M };
u8 default_dvs_mode[] = { LP8720_DEFAULT_DVS, LP8725_DEFAULT_DVS };

if (!dvs)
goto set_default_dvs_mode;

ret = lp872x_check_dvs_validity(lp);
if (ret) {
Expand All @@ -776,6 +785,10 @@ static int lp872x_init_dvs(struct lp872x *lp)
lp->dvs_gpio = gpio;

return 0;

set_default_dvs_mode:
return lp872x_update_bits(lp, LP872X_GENERAL_CFG, mask[lp->chipid],
default_dvs_mode[lp->chipid]);
}

static int lp872x_config(struct lp872x *lp)
Expand Down

0 comments on commit f13b82b

Please sign in to comment.