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 6a599dce7f9d4678e4f6f7f082514308f0636942..a57611d0c94e147433336fa5277aa755d07076d6 100644 (file)
@@ -13,8 +13,9 @@
 #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>
 
 struct device;
@@ -30,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 */
@@ -68,7 +69,7 @@ struct led_classdev {
        const char              *default_trigger;       /* Trigger to use */
 
        unsigned long            blink_delay_on, blink_delay_off;
-       struct delayed_work      blink_work;
+       struct timer_list        blink_timer;
        int                      blink_brightness;
 
        struct work_struct      set_brightness_work;
@@ -139,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