summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-21 08:18:38 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-21 08:18:38 -0700
commit045aaedab67bc3f2f01fe46917e0e17a6b5a7d5d (patch)
tree48c18f788c81d84c895318c82cb35e8d19d23efa /include
parent5b9c8972527fdb52d5cd7dadc9853c57430e0ff5 (diff)
parenta4c84e6aafda0ddd8cb004c464cd11e47e211049 (diff)
downloadlinux-045aaedab67bc3f2f01fe46917e0e17a6b5a7d5d.tar.gz
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds
Pull LED update from Bryan Wu:
 "Basically we have some bug fixing and clean up and one big thing is we
  start to merge patch to add support LED Flash class"

* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds:
  leds: gpio: cleanup the leds-gpio driver
  led: gpio: Fix possible ZERO_SIZE_PTR pointer dereferencing error.
  led: gpio: Sort include headers alphabetically
  leds: Improve and export led_update_brightness
  leds: trigger: gpio: fix warning in gpio trigger for gpios whose accessor function may sleep
  leds: lp3944: fix sparse warning
  leds: avoid using DEVICE_ATTR macro for max_brightness attribute
  leds: make brightness type consistent across whole subsystem
  leds: Reorder include directives
Diffstat (limited to 'include')
-rw-r--r--include/linux/leds.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/linux/leds.h b/include/linux/leds.h
index e43686472197..a57611d0c94e 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -13,8 +13,8 @@
 #define __LINUX_LEDS_H_INCLUDED
 
 #include <linux/list.h>
-#include <linux/spinlock.h>
 #include <linux/rwsem.h>
+#include <linux/spinlock.h>
 #include <linux/timer.h>
 #include <linux/workqueue.h>
 
@@ -31,8 +31,8 @@ enum led_brightness {
 
 struct led_classdev {
 	const char		*name;
-	int			 brightness;
-	int			 max_brightness;
+	enum led_brightness	 brightness;
+	enum led_brightness	 max_brightness;
 	int			 flags;
 
 	/* Lower 16 bits reflect status */
@@ -140,6 +140,16 @@ extern void led_blink_set_oneshot(struct led_classdev *led_cdev,
  */
 extern void led_set_brightness(struct led_classdev *led_cdev,
 			       enum led_brightness brightness);
+/**
+ * led_update_brightness - update LED brightness
+ * @led_cdev: the LED to query
+ *
+ * Get an LED's current brightness and update led_cdev->brightness
+ * member with the obtained value.
+ *
+ * Returns: 0 on success or negative error value on failure
+ */
+extern int led_update_brightness(struct led_classdev *led_cdev);
 
 /*
  * LED Triggers