Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 295197
b: refs/heads/master
c: cea694c
h: refs/heads/master
i:
  295195: 683787b
v: v3
  • Loading branch information
Axel Lin authored and Linus Torvalds committed Mar 23, 2012
1 parent 8e836de commit 56c3326
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 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: 1a1278da5ccef255075c03dccc567d46e162c674
refs/heads/master: cea694ca3d0894ee97482be1f22b822dc948c66f
18 changes: 10 additions & 8 deletions trunk/drivers/leds/leds-lm3530.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,16 @@ static int lm3530_init_registers(struct lm3530_data *drvdata)
gen_config = (pdata->brt_ramp_law << LM3530_RAMP_LAW_SHIFT) |
((pdata->max_current & 7) << LM3530_MAX_CURR_SHIFT);

if (drvdata->mode == LM3530_BL_MODE_MANUAL ||
drvdata->mode == LM3530_BL_MODE_ALS)
gen_config |= (LM3530_ENABLE_I2C);
switch (drvdata->mode) {
case LM3530_BL_MODE_MANUAL:
case LM3530_BL_MODE_ALS:
gen_config |= LM3530_ENABLE_I2C;
break;
case LM3530_BL_MODE_PWM:
gen_config |= LM3530_ENABLE_PWM | LM3530_ENABLE_PWM_SIMPLE |
(pdata->pwm_pol_hi << LM3530_PWM_POL_SHIFT);
break;
}

if (drvdata->mode == LM3530_BL_MODE_ALS) {
if (pdata->als_vmax == 0) {
Expand Down Expand Up @@ -196,11 +203,6 @@ static int lm3530_init_registers(struct lm3530_data *drvdata)

}

if (drvdata->mode == LM3530_BL_MODE_PWM)
gen_config |= (LM3530_ENABLE_PWM) |
(pdata->pwm_pol_hi << LM3530_PWM_POL_SHIFT) |
(LM3530_ENABLE_PWM_SIMPLE);

brt_ramp = (pdata->brt_ramp_fall << LM3530_BRT_RAMP_FALL_SHIFT) |
(pdata->brt_ramp_rise << LM3530_BRT_RAMP_RISE_SHIFT);

Expand Down

0 comments on commit 56c3326

Please sign in to comment.