Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 333071
b: refs/heads/master
c: 6f6365f
h: refs/heads/master
i:
  333069: fc3a6c6
  333067: 378d199
  333063: b2b9e6f
  333055: ab37790
v: v3
  • Loading branch information
Kim, Milo authored and Bryan Wu committed Sep 11, 2012
1 parent 142d58a commit 8de708c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 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: a39b9854c79cc9ac7b7b6fed58cf07da23f1f41e
refs/heads/master: 6f6365fbac2d6bcf6867c633d3ec33af08b5b219
24 changes: 13 additions & 11 deletions trunk/drivers/leds/leds-lp5523.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ static inline struct lp5523_chip *led_to_lp5523(struct lp5523_led *led)
leds[led->id]);
}

static int lp5523_set_mode(struct lp5523_engine *engine, u8 mode);
static void lp5523_set_mode(struct lp5523_engine *engine, u8 mode);
static int lp5523_set_engine_mode(struct lp5523_engine *engine, u8 mode);
static int lp5523_load_program(struct lp5523_engine *engine, const u8 *pattern);

Expand Down Expand Up @@ -789,26 +789,28 @@ static void lp5523_unregister_sysfs(struct i2c_client *client)
/*--------------------------------------------------------------*/
/* Set chip operating mode */
/*--------------------------------------------------------------*/
static int lp5523_set_mode(struct lp5523_engine *engine, u8 mode)
static void lp5523_set_mode(struct lp5523_engine *engine, u8 mode)
{
int ret = 0;

/* if in that mode already do nothing, except for run */
if (mode == engine->mode && mode != LP5523_CMD_RUN)
return 0;
return;

if (mode == LP5523_CMD_RUN) {
ret = lp5523_run_program(engine);
} else if (mode == LP5523_CMD_LOAD) {
switch (mode) {
case LP5523_CMD_RUN:
lp5523_run_program(engine);
break;
case LP5523_CMD_LOAD:
lp5523_set_engine_mode(engine, LP5523_CMD_DISABLED);
lp5523_set_engine_mode(engine, LP5523_CMD_LOAD);
} else if (mode == LP5523_CMD_DISABLED) {
break;
case LP5523_CMD_DISABLED:
lp5523_set_engine_mode(engine, LP5523_CMD_DISABLED);
break;
default:
return;
}

engine->mode = mode;

return ret;
}

/*--------------------------------------------------------------*/
Expand Down

0 comments on commit 8de708c

Please sign in to comment.