@@ -103,12 +103,7 @@ struct lp8860_led {
103
103
struct regulator * regulator ;
104
104
};
105
105
106
- struct lp8860_eeprom_reg {
107
- uint8_t reg ;
108
- uint8_t value ;
109
- };
110
-
111
- static struct lp8860_eeprom_reg lp8860_eeprom_disp_regs [] = {
106
+ static const struct reg_sequence lp8860_eeprom_disp_regs [] = {
112
107
{ LP8860_EEPROM_REG_0 , 0xed },
113
108
{ LP8860_EEPROM_REG_1 , 0xdf },
114
109
{ LP8860_EEPROM_REG_2 , 0xdc },
@@ -238,7 +233,7 @@ static int lp8860_brightness_set(struct led_classdev *led_cdev,
238
233
static int lp8860_init (struct lp8860_led * led )
239
234
{
240
235
unsigned int read_buf ;
241
- int ret , i , reg_count ;
236
+ int ret , reg_count ;
242
237
243
238
if (led -> regulator ) {
244
239
ret = regulator_enable (led -> regulator );
@@ -266,14 +261,10 @@ static int lp8860_init(struct lp8860_led *led)
266
261
}
267
262
268
263
reg_count = ARRAY_SIZE (lp8860_eeprom_disp_regs );
269
- for (i = 0 ; i < reg_count ; i ++ ) {
270
- ret = regmap_write (led -> eeprom_regmap ,
271
- lp8860_eeprom_disp_regs [i ].reg ,
272
- lp8860_eeprom_disp_regs [i ].value );
273
- if (ret ) {
274
- dev_err (& led -> client -> dev , "Failed writing EEPROM\n" );
275
- goto out ;
276
- }
264
+ ret = regmap_multi_reg_write (led -> eeprom_regmap , lp8860_eeprom_disp_regs , reg_count );
265
+ if (ret ) {
266
+ dev_err (& led -> client -> dev , "Failed writing EEPROM\n" );
267
+ goto out ;
277
268
}
278
269
279
270
ret = lp8860_unlock_eeprom (led , LP8860_LOCK_EEPROM );
0 commit comments