mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
leds: gpio: Allow LED to retain state at shutdown
In some systems, such as Baseboard Management Controllers (BMCs), we want to retain the state of LEDs across a reboot of the BMC (whilst the host remains up). Implement support for the retain-state-shutdown devicetree property in leds-gpio. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Acked-by: Pavel Machek <pavel@ucw.cz> Tested-by: Brandon Wyman <bjwyman@gmail.com> Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
This commit is contained in:
parent
0f34f95876
commit
f5808ac158
2 changed files with 8 additions and 1 deletions
|
@ -49,6 +49,7 @@ struct led_classdev {
|
|||
#define LED_HW_PLUGGABLE (1 << 19)
|
||||
#define LED_PANIC_INDICATOR (1 << 20)
|
||||
#define LED_BRIGHT_HW_CHANGED (1 << 21)
|
||||
#define LED_RETAIN_AT_SHUTDOWN (1 << 22)
|
||||
|
||||
/* set_brightness_work / blink_timer flags, atomic, private. */
|
||||
unsigned long work_flags;
|
||||
|
@ -392,6 +393,7 @@ struct gpio_led {
|
|||
unsigned retain_state_suspended : 1;
|
||||
unsigned panic_indicator : 1;
|
||||
unsigned default_state : 2;
|
||||
unsigned retain_state_shutdown : 1;
|
||||
/* default_state should be one of LEDS_GPIO_DEFSTATE_(ON|OFF|KEEP) */
|
||||
struct gpio_desc *gpiod;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue