aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/leds-lp5523.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c
index 72c10e2d4b02..b50948060a02 100644
--- a/drivers/leds/leds-lp5523.c
+++ b/drivers/leds/leds-lp5523.c
@@ -152,15 +152,21 @@ static void lp5523_load_engine(struct lp55xx_chip *chip)
152 [LP55XX_ENGINE_3] = LP5523_LOAD_ENG3, 152 [LP55XX_ENGINE_3] = LP5523_LOAD_ENG3,
153 }; 153 };
154 154
155 lp55xx_update_bits(chip, LP5523_REG_OP_MODE, mask[idx], val[idx]);
156
157 lp5523_wait_opmode_done();
158}
159
160static void lp5523_load_engine_and_select_page(struct lp55xx_chip *chip)
161{
162 enum lp55xx_engine_index idx = chip->engine_idx;
155 u8 page_sel[] = { 163 u8 page_sel[] = {
156 [LP55XX_ENGINE_1] = LP5523_PAGE_ENG1, 164 [LP55XX_ENGINE_1] = LP5523_PAGE_ENG1,
157 [LP55XX_ENGINE_2] = LP5523_PAGE_ENG2, 165 [LP55XX_ENGINE_2] = LP5523_PAGE_ENG2,
158 [LP55XX_ENGINE_3] = LP5523_PAGE_ENG3, 166 [LP55XX_ENGINE_3] = LP5523_PAGE_ENG3,
159 }; 167 };
160 168
161 lp55xx_update_bits(chip, LP5523_REG_OP_MODE, mask[idx], val[idx]); 169 lp5523_load_engine(chip);
162
163 lp5523_wait_opmode_done();
164 170
165 lp55xx_write(chip, LP5523_REG_PROG_PAGE_SEL, page_sel[idx]); 171 lp55xx_write(chip, LP5523_REG_PROG_PAGE_SEL, page_sel[idx]);
166} 172}
@@ -290,7 +296,7 @@ static void lp5523_firmware_loaded(struct lp55xx_chip *chip)
290 * 2) write firmware data into program memory 296 * 2) write firmware data into program memory
291 */ 297 */
292 298
293 lp5523_load_engine(chip); 299 lp5523_load_engine_and_select_page(chip);
294 lp5523_update_program_memory(chip, fw->data, fw->size); 300 lp5523_update_program_memory(chip, fw->data, fw->size);
295} 301}
296 302