aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/leds.h
diff options
context:
space:
mode:
authorDenis Osterland-Heim <Denis.Osterland@diehl.com>2021-06-08 08:35:53 +0200
committerPavel Machek <pavel@ucw.cz>2021-08-18 08:27:30 +0200
commit791bc41163c51f870972d6c6b82d971ce951096c (patch)
tree3b6504b86874ba8c9e1ecf3949728400f4583559 /include/linux/leds.h
parentleds: flash: Remove redundant initialization of variable ret (diff)
downloadlinux-dev-791bc41163c51f870972d6c6b82d971ce951096c.tar.xz
linux-dev-791bc41163c51f870972d6c6b82d971ce951096c.zip
leds: move default_state read from fwnode to core
This patch introduces a new function to read initial default_state from fwnode. Suggested-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Denis Osterland-Heim <Denis.Osterland@diehl.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'include/linux/leds.h')
-rw-r--r--include/linux/leds.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/linux/leds.h b/include/linux/leds.h
index 329fd914cf24..a0b730be40ad 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -33,6 +33,12 @@ enum led_brightness {
LED_FULL = 255,
};
+enum led_default_state {
+ LEDS_DEFSTATE_OFF = 0,
+ LEDS_DEFSTATE_ON = 1,
+ LEDS_DEFSTATE_KEEP = 2,
+};
+
struct led_init_data {
/* device fwnode handle */
struct fwnode_handle *fwnode;
@@ -520,9 +526,9 @@ struct gpio_led {
/* default_state should be one of LEDS_GPIO_DEFSTATE_(ON|OFF|KEEP) */
struct gpio_desc *gpiod;
};
-#define LEDS_GPIO_DEFSTATE_OFF 0
-#define LEDS_GPIO_DEFSTATE_ON 1
-#define LEDS_GPIO_DEFSTATE_KEEP 2
+#define LEDS_GPIO_DEFSTATE_OFF LEDS_DEFSTATE_OFF
+#define LEDS_GPIO_DEFSTATE_ON LEDS_DEFSTATE_ON
+#define LEDS_GPIO_DEFSTATE_KEEP LEDS_DEFSTATE_KEEP
struct gpio_led_platform_data {
int num_leds;