Lines Matching refs:desc

119 	struct sso_led_desc desc;  member
236 struct sso_led_desc *desc; in sso_led_brightness_set() local
242 desc = &led->desc; in sso_led_brightness_set()
244 desc->brightness = brightness; in sso_led_brightness_set()
245 regmap_write(priv->mmap, DUTY_CYCLE(desc->pin), brightness); in sso_led_brightness_set()
253 if (desc->hw_blink && !val && desc->blinking) { in sso_led_brightness_set()
254 desc->blinking = 0; in sso_led_brightness_set()
255 regmap_update_bits(priv->mmap, SSO_CON2, BIT(desc->pin), 0); in sso_led_brightness_set()
256 } else if (desc->hw_blink && val && !desc->blinking) { in sso_led_brightness_set()
257 desc->blinking = 1; in sso_led_brightness_set()
258 regmap_update_bits(priv->mmap, SSO_CON2, BIT(desc->pin), in sso_led_brightness_set()
259 1 << desc->pin); in sso_led_brightness_set()
262 if (!desc->hw_trig) in sso_led_brightness_set()
270 return (enum led_brightness)led->desc.brightness; in sso_led_brightness_get()
315 sso_led_freq_set(priv, led->desc.pin, freq_idx); in sso_led_blink_set()
316 regmap_update_bits(priv->mmap, SSO_CON2, BIT(led->desc.pin), in sso_led_blink_set()
317 1 << led->desc.pin); in sso_led_blink_set()
318 led->desc.freq_idx = freq_idx; in sso_led_blink_set()
319 led->desc.blink_rate = priv->freq[freq_idx]; in sso_led_blink_set()
320 led->desc.blinking = 1; in sso_led_blink_set()
327 struct sso_led_desc *desc = &led->desc; in sso_led_hw_cfg() local
330 if (desc->hw_blink) { in sso_led_hw_cfg()
331 sso_led_freq_set(priv, desc->pin, desc->freq_idx); in sso_led_hw_cfg()
332 regmap_update_bits(priv->mmap, SSO_CON2, BIT(desc->pin), in sso_led_hw_cfg()
333 1 << desc->pin); in sso_led_hw_cfg()
336 if (desc->hw_trig) in sso_led_hw_cfg()
337 regmap_update_bits(priv->mmap, SSO_CON3, BIT(desc->pin), in sso_led_hw_cfg()
338 1 << desc->pin); in sso_led_hw_cfg()
341 regmap_write(priv->mmap, DUTY_CYCLE(desc->pin), desc->brightness); in sso_led_hw_cfg()
344 if (!desc->hw_trig && desc->brightness) in sso_led_hw_cfg()
351 struct sso_led_desc *desc = &led->desc; in sso_create_led() local
359 led->cdev.default_trigger = desc->default_trigger; in sso_create_led()
362 led->cdev.brightness = desc->brightness; in sso_create_led()
365 if (desc->retain_state_shutdown) in sso_create_led()
367 if (desc->retain_state_suspended) in sso_create_led()
369 if (desc->panic_indicator) in sso_create_led()
372 if (desc->hw_blink) in sso_create_led()
610 if (led->desc.hw_trig) in sso_led_shutdown()
611 regmap_update_bits(priv->mmap, SSO_CON3, BIT(led->desc.pin), 0); in sso_led_shutdown()
621 struct sso_led_desc *desc; in __sso_led_dt_parse() local
636 desc = &led->desc; in __sso_led_dt_parse()
647 &desc->default_trigger); in __sso_led_dt_parse()
651 desc->retain_state_suspended = 1; in __sso_led_dt_parse()
655 desc->retain_state_shutdown = 1; in __sso_led_dt_parse()
658 desc->panic_indicator = 1; in __sso_led_dt_parse()
668 desc->pin = prop; in __sso_led_dt_parse()
671 desc->hw_blink = 1; in __sso_led_dt_parse()
673 desc->hw_trig = fwnode_property_read_bool(fwnode_child, in __sso_led_dt_parse()
675 if (desc->hw_trig) { in __sso_led_dt_parse()
676 desc->default_trigger = NULL; in __sso_led_dt_parse()
677 desc->retain_state_shutdown = 0; in __sso_led_dt_parse()
678 desc->retain_state_suspended = 0; in __sso_led_dt_parse()
679 desc->panic_indicator = 0; in __sso_led_dt_parse()
680 desc->hw_blink = 0; in __sso_led_dt_parse()
686 desc->freq_idx = 0; in __sso_led_dt_parse()
687 desc->blink_rate = priv->freq[desc->freq_idx]; in __sso_led_dt_parse()
689 desc->freq_idx = sso_get_blink_rate_idx(priv, prop); in __sso_led_dt_parse()
690 if (desc->freq_idx == -1) in __sso_led_dt_parse()
691 desc->freq_idx = MAX_FREQ_RANK - 1; in __sso_led_dt_parse()
693 desc->blink_rate = priv->freq[desc->freq_idx]; in __sso_led_dt_parse()
698 desc->brightness = LED_FULL; in __sso_led_dt_parse()