From 29d76dfa29fe22583aefddccda0bc56aa81035dc Mon Sep 17 00:00:00 2001 From: Henrique de Moraes Holschuh Date: Tue, 18 Mar 2008 09:47:48 +0000 Subject: leds: Add support to leds with readable status Some led hardware allows drivers to query the led state, and this patch adds a hook to let the led class take advantage of that information when available. Without this functionality, when access to the led hardware is not exclusive (i.e. firmware or hardware might change its state behind the kernel's back), reality goes out of sync with the led class' idea of what the led is doing, which is annoying at best. Behaviour for drivers that do not or cannot read the led status is unchanged. Signed-off-by: Henrique de Moraes Holschuh Signed-off-by: Richard Purdie --- include/linux/leds.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/leds.h b/include/linux/leds.h index c195a674b6c..ff1570f9704 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h @@ -37,6 +37,8 @@ struct led_classdev { /* Set LED brightness level */ void (*brightness_set)(struct led_classdev *led_cdev, enum led_brightness brightness); + /* Get LED brightness level */ + enum led_brightness (*brightness_get)(struct led_classdev *led_cdev); /* Activate hardware accelerated blink */ int (*blink_set)(struct led_classdev *led_cdev, -- cgit v1.2.3-70-g09d2