Lines Matching refs:t

182 static u8 time_to_val(unsigned *t, unsigned t_min, unsigned t_step,  in time_to_val()  argument
187 val = (*t + t_step / 2 - t_min) / t_step + v_min; in time_to_val()
189 *t = t_step * (val - v_min) + t_min; in time_to_val()
209 unsigned t; in lm3533_led_get_hw_delay() local
212 t = *delay * 1000; in lm3533_led_get_hw_delay()
214 if (t >= (LM3533_LED_DELAY2_TMAX + LM3533_LED_DELAY3_TMIN) / 2) { in lm3533_led_get_hw_delay()
215 t = clamp(t, LM3533_LED_DELAY3_TMIN, LM3533_LED_DELAY3_TMAX); in lm3533_led_get_hw_delay()
216 val = time_to_val(&t, LM3533_LED_DELAY3_TMIN, in lm3533_led_get_hw_delay()
220 } else if (t >= (LM3533_LED_DELAY1_TMAX + LM3533_LED_DELAY2_TMIN) / 2) { in lm3533_led_get_hw_delay()
221 t = clamp(t, LM3533_LED_DELAY2_TMIN, LM3533_LED_DELAY2_TMAX); in lm3533_led_get_hw_delay()
222 val = time_to_val(&t, LM3533_LED_DELAY2_TMIN, in lm3533_led_get_hw_delay()
227 t = clamp(t, LM3533_LED_DELAY1_TMIN, LM3533_LED_DELAY1_TMAX); in lm3533_led_get_hw_delay()
228 val = time_to_val(&t, LM3533_LED_DELAY1_TMIN, in lm3533_led_get_hw_delay()
234 *delay = (t + 500) / 1000; in lm3533_led_get_hw_delay()
246 unsigned t; in lm3533_led_delay_set() local
251 t = (unsigned)*delay; in lm3533_led_delay_set()
255 t = min(t, LM3533_LED_DELAY2_TMAX / 1000); in lm3533_led_delay_set()
257 val = lm3533_led_get_hw_delay(&t); in lm3533_led_delay_set()
260 *delay, t, val); in lm3533_led_delay_set()
266 *delay = t; in lm3533_led_delay_set()
271 static int lm3533_led_delay_on_set(struct lm3533_led *led, unsigned long *t) in lm3533_led_delay_on_set() argument
273 return lm3533_led_delay_set(led, LM3533_REG_PATTERN_HIGH_TIME_BASE, t); in lm3533_led_delay_on_set()
276 static int lm3533_led_delay_off_set(struct lm3533_led *led, unsigned long *t) in lm3533_led_delay_off_set() argument
278 return lm3533_led_delay_set(led, LM3533_REG_PATTERN_LOW_TIME_BASE, t); in lm3533_led_delay_off_set()