Merge tag 'drm-intel-fixes-2014-10-30' of git://anongit.freedesktop.org/drm-intel...
[firefly-linux-kernel-4.4.55.git] / include / linux / leds.h
index e436864721971c81383a323bf3951e19632475a0..a57611d0c94e147433336fa5277aa755d07076d6 100644 (file)
@@ -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