diff options
author | Jacek Anaszewski <j.anaszewski@samsung.com> | 2014-08-20 09:41:55 -0400 |
---|---|---|
committer | Bryan Wu <cooloney@gmail.com> | 2014-09-12 17:01:54 -0400 |
commit | 3ef7de5304edf60d0b8674dd7cdacc104e15a93c (patch) | |
tree | 2af483fbfc67853ce5c8b3772fadb93c872b0d35 /include/linux/leds.h | |
parent | 914ae25a62e77ebbfa0ce7cbc60edd01cc4d1d31 (diff) |
leds: Improve and export led_update_brightness
led_update_brightness helper function used to be exploited only locally
in the led-class.c module, where its result was being passed to the
brightness_show sysfs callback. With the introduction of v4l2-flash
subdevice the same functionality becomes required for reading current
brightness from a LED device. This patch adds checking of return value
of the brightness_get callback and moves the led_update_brightness()
function to the LED subsystem public API.
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'include/linux/leds.h')
-rw-r--r-- | include/linux/leds.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/leds.h b/include/linux/leds.h index f2e1cbc25705..a57611d0c94e 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
@@ -140,6 +140,16 @@ extern void led_blink_set_oneshot(struct led_classdev *led_cdev, | |||
140 | */ | 140 | */ |
141 | extern void led_set_brightness(struct led_classdev *led_cdev, | 141 | extern void led_set_brightness(struct led_classdev *led_cdev, |
142 | enum led_brightness brightness); | 142 | enum led_brightness brightness); |
143 | /** | ||
144 | * led_update_brightness - update LED brightness | ||
145 | * @led_cdev: the LED to query | ||
146 | * | ||
147 | * Get an LED's current brightness and update led_cdev->brightness | ||
148 | * member with the obtained value. | ||
149 | * | ||
150 | * Returns: 0 on success or negative error value on failure | ||
151 | */ | ||
152 | extern int led_update_brightness(struct led_classdev *led_cdev); | ||
143 | 153 | ||
144 | /* | 154 | /* |
145 | * LED Triggers | 155 | * LED Triggers |