diff options
| author | Marek Vasut <[email protected]> | 2022-04-04 01:23:27 +0200 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2022-04-14 15:39:15 -0400 |
| commit | 72675b063b6ede269a8edee29575ade02c21b58d (patch) | |
| tree | 44f0c4364eccfb6d6d3faf572de8712784a64b83 /include | |
| parent | 2d1deaf88edc1182372794c79f43c6aa6c163d8e (diff) | |
led: Configure LED default-state on boot
In case the DT LED subnode contains "default-state" property set to
either "on" or "off", probe the LED driver and configure the LED state
automatically.
Signed-off-by: Marek Vasut <[email protected]>
Cc: Alex Nemirovsky <[email protected]>
Cc: Patrick Delaunay <[email protected]>
Cc: Philippe Reynes <[email protected]>
Cc: Sean Anderson <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Steven Lawrance <[email protected]>
[trini: Update the relevant test now that we have support]
Signed-off-by: Tom Rini <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/led.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/include/led.h b/include/led.h index 8eeb5a7c6d3..43acca85719 100644 --- a/include/led.h +++ b/include/led.h @@ -9,13 +9,26 @@ struct udevice; +enum led_state_t { + LEDST_OFF = 0, + LEDST_ON = 1, + LEDST_TOGGLE, +#ifdef CONFIG_LED_BLINK + LEDST_BLINK, +#endif + + LEDST_COUNT, +}; + /** * struct led_uc_plat - Platform data the uclass stores about each device * * @label: LED label + * @default_state: LED default state */ struct led_uc_plat { const char *label; + enum led_state_t default_state; }; /** @@ -27,17 +40,6 @@ struct led_uc_priv { int period_ms; }; -enum led_state_t { - LEDST_OFF = 0, - LEDST_ON = 1, - LEDST_TOGGLE, -#ifdef CONFIG_LED_BLINK - LEDST_BLINK, -#endif - - LEDST_COUNT, -}; - struct led_ops { /** * set_state() - set the state of an LED |
