|
@@ -82,18 +82,6 @@
|
|
|
#define LP5521_LOGARITHMIC_PWM 0x80 /* Logarithmic PWM adjustment */
|
|
|
#define LP5521_EXEC_RUN 0x2A
|
|
|
|
|
|
-/* Bits in CONFIG register */
|
|
|
-#define LP5521_PWM_HF 0x40 /* PWM: 0 = 256Hz, 1 = 558Hz */
|
|
|
-#define LP5521_PWRSAVE_EN 0x20 /* 1 = Power save mode */
|
|
|
-#define LP5521_CP_MODE_OFF 0 /* Charge pump (CP) off */
|
|
|
-#define LP5521_CP_MODE_BYPASS 8 /* CP forced to bypass mode */
|
|
|
-#define LP5521_CP_MODE_1X5 0x10 /* CP forced to 1.5x mode */
|
|
|
-#define LP5521_CP_MODE_AUTO 0x18 /* Automatic mode selection */
|
|
|
-#define LP5521_R_TO_BATT 4 /* R out: 0 = CP, 1 = Vbat */
|
|
|
-#define LP5521_CLK_SRC_EXT 0 /* Ext-clk source (CLK_32K) */
|
|
|
-#define LP5521_CLK_INT 1 /* Internal clock */
|
|
|
-#define LP5521_CLK_AUTO 2 /* Automatic clock selection */
|
|
|
-
|
|
|
/* Status */
|
|
|
#define LP5521_EXT_CLK_USED 0x08
|
|
|
|
|
@@ -241,15 +229,16 @@ static int lp5521_configure(struct i2c_client *client)
|
|
|
{
|
|
|
struct lp5521_chip *chip = i2c_get_clientdata(client);
|
|
|
int ret;
|
|
|
+ u8 cfg;
|
|
|
|
|
|
lp5521_init_engine(chip);
|
|
|
|
|
|
/* Set all PWMs to direct control mode */
|
|
|
ret = lp5521_write(client, LP5521_REG_OP_MODE, 0x3F);
|
|
|
|
|
|
- /* Enable auto-powersave, set charge pump to auto, red to battery */
|
|
|
- ret |= lp5521_write(client, LP5521_REG_CONFIG,
|
|
|
- LP5521_PWRSAVE_EN | LP5521_CP_MODE_AUTO | LP5521_R_TO_BATT);
|
|
|
+ cfg = chip->pdata->update_config ?
|
|
|
+ : (LP5521_PWRSAVE_EN | LP5521_CP_MODE_AUTO | LP5521_R_TO_BATT);
|
|
|
+ ret |= lp5521_write(client, LP5521_REG_CONFIG, cfg);
|
|
|
|
|
|
/* Initialize all channels PWM to zero -> leds off */
|
|
|
ret |= lp5521_write(client, LP5521_REG_R_PWM, 0);
|