aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/leds.h
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2017-08-28 09:47:11 +0930
committerJacek Anaszewski <jacek.anaszewski@gmail.com>2017-08-29 21:10:40 +0200
commitf5808ac158f2b16b686a3d3c0879c5d6048aba14 (patch)
treee223e075b1e3b1877d644c2104effb193077c4eb /include/linux/leds.h
parentdt-bindings: leds: gpio: Add optional retain-state-shutdown property (diff)
downloadlinux-dev-f5808ac158f2b16b686a3d3c0879c5d6048aba14.tar.xz
linux-dev-f5808ac158f2b16b686a3d3c0879c5d6048aba14.zip
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>
Diffstat (limited to 'include/linux/leds.h')
-rw-r--r--include/linux/leds.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/leds.h b/include/linux/leds.h
index 64c56d454f7d..bf6db4fe895b 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -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;
};