Skip to content

Commit 0cb55e1

Browse files
glneolag-linaro
authored andcommitted
leds: lp8860: Remove default regs when not caching
If we are not using regmap caches, then the value will be read in every time, having a default value does not change anything in that case. Remove the unused defaults. Signed-off-by: Andrew Davis <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent 87a5954 commit 0cb55e1

File tree

1 file changed

+0
-52
lines changed

1 file changed

+0
-52
lines changed

drivers/leds/leds-lp8860.c

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -292,70 +292,18 @@ static int lp8860_init(struct lp8860_led *led)
292292
return ret;
293293
}
294294

295-
static const struct reg_default lp8860_reg_defs[] = {
296-
{ LP8860_DISP_CL1_BRT_MSB, 0x00},
297-
{ LP8860_DISP_CL1_BRT_LSB, 0x00},
298-
{ LP8860_DISP_CL1_CURR_MSB, 0x00},
299-
{ LP8860_DISP_CL1_CURR_LSB, 0x00},
300-
{ LP8860_CL2_BRT_MSB, 0x00},
301-
{ LP8860_CL2_BRT_LSB, 0x00},
302-
{ LP8860_CL2_CURRENT, 0x00},
303-
{ LP8860_CL3_BRT_MSB, 0x00},
304-
{ LP8860_CL3_BRT_LSB, 0x00},
305-
{ LP8860_CL3_CURRENT, 0x00},
306-
{ LP8860_CL4_BRT_MSB, 0x00},
307-
{ LP8860_CL4_BRT_LSB, 0x00},
308-
{ LP8860_CL4_CURRENT, 0x00},
309-
{ LP8860_CONFIG, 0x00},
310-
{ LP8860_FAULT_CLEAR, 0x00},
311-
{ LP8860_EEPROM_CNTRL, 0x80},
312-
{ LP8860_EEPROM_UNLOCK, 0x00},
313-
};
314-
315295
static const struct regmap_config lp8860_regmap_config = {
316296
.reg_bits = 8,
317297
.val_bits = 8,
318298

319299
.max_register = LP8860_EEPROM_UNLOCK,
320-
.reg_defaults = lp8860_reg_defs,
321-
.num_reg_defaults = ARRAY_SIZE(lp8860_reg_defs),
322-
};
323-
324-
static const struct reg_default lp8860_eeprom_defs[] = {
325-
{ LP8860_EEPROM_REG_0, 0x00 },
326-
{ LP8860_EEPROM_REG_1, 0x00 },
327-
{ LP8860_EEPROM_REG_2, 0x00 },
328-
{ LP8860_EEPROM_REG_3, 0x00 },
329-
{ LP8860_EEPROM_REG_4, 0x00 },
330-
{ LP8860_EEPROM_REG_5, 0x00 },
331-
{ LP8860_EEPROM_REG_6, 0x00 },
332-
{ LP8860_EEPROM_REG_7, 0x00 },
333-
{ LP8860_EEPROM_REG_8, 0x00 },
334-
{ LP8860_EEPROM_REG_9, 0x00 },
335-
{ LP8860_EEPROM_REG_10, 0x00 },
336-
{ LP8860_EEPROM_REG_11, 0x00 },
337-
{ LP8860_EEPROM_REG_12, 0x00 },
338-
{ LP8860_EEPROM_REG_13, 0x00 },
339-
{ LP8860_EEPROM_REG_14, 0x00 },
340-
{ LP8860_EEPROM_REG_15, 0x00 },
341-
{ LP8860_EEPROM_REG_16, 0x00 },
342-
{ LP8860_EEPROM_REG_17, 0x00 },
343-
{ LP8860_EEPROM_REG_18, 0x00 },
344-
{ LP8860_EEPROM_REG_19, 0x00 },
345-
{ LP8860_EEPROM_REG_20, 0x00 },
346-
{ LP8860_EEPROM_REG_21, 0x00 },
347-
{ LP8860_EEPROM_REG_22, 0x00 },
348-
{ LP8860_EEPROM_REG_23, 0x00 },
349-
{ LP8860_EEPROM_REG_24, 0x00 },
350300
};
351301

352302
static const struct regmap_config lp8860_eeprom_regmap_config = {
353303
.reg_bits = 8,
354304
.val_bits = 8,
355305

356306
.max_register = LP8860_EEPROM_REG_24,
357-
.reg_defaults = lp8860_eeprom_defs,
358-
.num_reg_defaults = ARRAY_SIZE(lp8860_eeprom_defs),
359307
};
360308

361309
static int lp8860_probe(struct i2c_client *client)

0 commit comments

Comments
 (0)