diff options
Diffstat (limited to 'drivers/leds/leds-lp5521.c')
-rw-r--r-- | drivers/leds/leds-lp5521.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c index 59feecdfe3a8..9682ece16011 100644 --- a/drivers/leds/leds-lp5521.c +++ b/drivers/leds/leds-lp5521.c | |||
@@ -82,18 +82,6 @@ | |||
82 | #define LP5521_LOGARITHMIC_PWM 0x80 /* Logarithmic PWM adjustment */ | 82 | #define LP5521_LOGARITHMIC_PWM 0x80 /* Logarithmic PWM adjustment */ |
83 | #define LP5521_EXEC_RUN 0x2A | 83 | #define LP5521_EXEC_RUN 0x2A |
84 | 84 | ||
85 | /* Bits in CONFIG register */ | ||
86 | #define LP5521_PWM_HF 0x40 /* PWM: 0 = 256Hz, 1 = 558Hz */ | ||
87 | #define LP5521_PWRSAVE_EN 0x20 /* 1 = Power save mode */ | ||
88 | #define LP5521_CP_MODE_OFF 0 /* Charge pump (CP) off */ | ||
89 | #define LP5521_CP_MODE_BYPASS 8 /* CP forced to bypass mode */ | ||
90 | #define LP5521_CP_MODE_1X5 0x10 /* CP forced to 1.5x mode */ | ||
91 | #define LP5521_CP_MODE_AUTO 0x18 /* Automatic mode selection */ | ||
92 | #define LP5521_R_TO_BATT 4 /* R out: 0 = CP, 1 = Vbat */ | ||
93 | #define LP5521_CLK_SRC_EXT 0 /* Ext-clk source (CLK_32K) */ | ||
94 | #define LP5521_CLK_INT 1 /* Internal clock */ | ||
95 | #define LP5521_CLK_AUTO 2 /* Automatic clock selection */ | ||
96 | |||
97 | /* Status */ | 85 | /* Status */ |
98 | #define LP5521_EXT_CLK_USED 0x08 | 86 | #define LP5521_EXT_CLK_USED 0x08 |
99 | 87 | ||
@@ -241,15 +229,16 @@ static int lp5521_configure(struct i2c_client *client) | |||
241 | { | 229 | { |
242 | struct lp5521_chip *chip = i2c_get_clientdata(client); | 230 | struct lp5521_chip *chip = i2c_get_clientdata(client); |
243 | int ret; | 231 | int ret; |
232 | u8 cfg; | ||
244 | 233 | ||
245 | lp5521_init_engine(chip); | 234 | lp5521_init_engine(chip); |
246 | 235 | ||
247 | /* Set all PWMs to direct control mode */ | 236 | /* Set all PWMs to direct control mode */ |
248 | ret = lp5521_write(client, LP5521_REG_OP_MODE, 0x3F); | 237 | ret = lp5521_write(client, LP5521_REG_OP_MODE, 0x3F); |
249 | 238 | ||
250 | /* Enable auto-powersave, set charge pump to auto, red to battery */ | 239 | cfg = chip->pdata->update_config ? |
251 | ret |= lp5521_write(client, LP5521_REG_CONFIG, | 240 | : (LP5521_PWRSAVE_EN | LP5521_CP_MODE_AUTO | LP5521_R_TO_BATT); |
252 | LP5521_PWRSAVE_EN | LP5521_CP_MODE_AUTO | LP5521_R_TO_BATT); | 241 | ret |= lp5521_write(client, LP5521_REG_CONFIG, cfg); |
253 | 242 | ||
254 | /* Initialize all channels PWM to zero -> leds off */ | 243 | /* Initialize all channels PWM to zero -> leds off */ |
255 | ret |= lp5521_write(client, LP5521_REG_R_PWM, 0); | 244 | ret |= lp5521_write(client, LP5521_REG_R_PWM, 0); |