Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 308966
b: refs/heads/master
c: 5bc9ad7
h: refs/heads/master
v: v3
  • Loading branch information
Dan Carpenter authored and Linus Torvalds committed May 29, 2012
1 parent 88aeae4 commit 282110b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 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: c8515294a31ec63536eb1a2ba7a38797435dda4f
refs/heads/master: 5bc9ad774c063f6b41965e7314f2c26aa5e465a0
12 changes: 8 additions & 4 deletions trunk/drivers/leds/leds-lp5521.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,14 @@ static int lp5521_load_program(struct lp5521_engine *eng, const u8 *pattern)

/* move current engine to direct mode and remember the state */
ret = lp5521_set_engine_mode(eng, LP5521_CMD_DIRECT);
if (ret)
return ret;

/* Mode change requires min 500 us delay. 1 - 2 ms with margin */
usleep_range(1000, 2000);
ret |= lp5521_read(client, LP5521_REG_OP_MODE, &mode);
ret = lp5521_read(client, LP5521_REG_OP_MODE, &mode);
if (ret)
return ret;

/* For loading, all the engines to load mode */
lp5521_write(client, LP5521_REG_OP_MODE, LP5521_CMD_DIRECT);
Expand All @@ -211,8 +216,7 @@ static int lp5521_load_program(struct lp5521_engine *eng, const u8 *pattern)
LP5521_PROG_MEM_SIZE,
pattern);

ret |= lp5521_write(client, LP5521_REG_OP_MODE, mode);
return ret;
return lp5521_write(client, LP5521_REG_OP_MODE, mode);
}

static int lp5521_set_led_current(struct lp5521_chip *chip, int led, u8 curr)
Expand Down Expand Up @@ -785,7 +789,7 @@ static int __devinit lp5521_probe(struct i2c_client *client,
* LP5521_REG_ENABLE register will not have any effect - strange!
*/
ret = lp5521_read(client, LP5521_REG_R_CURRENT, &buf);
if (buf != LP5521_REG_R_CURR_DEFAULT) {
if (ret || buf != LP5521_REG_R_CURR_DEFAULT) {
dev_err(&client->dev, "error in resetting chip\n");
goto fail2;
}
Expand Down

0 comments on commit 282110b

Please sign in to comment.