Lines Matching +full:startup +full:- +full:time +full:- +full:ms

1 // SPDX-License-Identifier: GPL-2.0-only
3 * lp5523.c - LP5523, LP55231 LED Driver
20 #include <linux/platform_data/leds-lp55xx.h>
23 #include "leds-lp55xx-common.h"
88 /* Chip startup time is 500 us, 1 - 2 ms gives some margin */ in lp5523_post_init_device()
92 val |= (chip->pdata->charge_pump_mode << LP5523_CP_MODE_SHIFT) & LP5523_CP_MODE_MASK; in lp5523_post_init_device()
150 chip->engine_idx = i; in lp5523_init_program_engine()
155 pattern[i - 1][j]); in lp5523_init_program_engine()
163 /* Let the programs run for couple of ms and check the engine status */ in lp5523_init_program_engine()
171 dev_err(&chip->cl->dev, in lp5523_init_program_engine()
174 ret = -1; in lp5523_init_program_engine()
187 struct lp55xx_chip *chip = led->chip; in lp5523_selftest()
188 struct lp55xx_platform_data *pdata = chip->pdata; in lp5523_selftest()
192 guard(mutex)(&chip->lock); in lp5523_selftest()
199 if (pdata->clock_mode == LP55XX_CLOCK_EXT) { in lp5523_selftest()
206 usleep_range(3000, 6000); /* ADC conversion time is typically 2.7 ms */ in lp5523_selftest()
218 vdd--; /* There may be some fluctuation in measurement */ in lp5523_selftest()
220 for (i = 0; i < pdata->num_channels; i++) { in lp5523_selftest()
222 if (pdata->led_config[i].led_current == 0) in lp5523_selftest()
226 lp55xx_write(chip, LP5523_REG_LED_CURRENT_BASE + led->chan_nr, in lp5523_selftest()
227 pdata->led_config[i].led_current); in lp5523_selftest()
229 lp55xx_write(chip, LP5523_REG_LED_PWM_BASE + led->chan_nr, in lp5523_selftest()
231 /* let current stabilize 2 - 4ms before measurements start */ in lp5523_selftest()
234 LP5523_EN_LEDTEST | led->chan_nr); in lp5523_selftest()
235 /* ADC conversion time is 2.7 ms typically */ in lp5523_selftest()
250 led->chan_nr); in lp5523_selftest()
252 lp55xx_write(chip, LP5523_REG_LED_PWM_BASE + led->chan_nr, in lp5523_selftest()
256 lp55xx_write(chip, LP5523_REG_LED_CURRENT_BASE + led->chan_nr, in lp5523_selftest()
257 led->led_current); in lp5523_selftest()