summaryrefslogtreecommitdiff
path: root/include/linux/leds.h
diff options
context:
space:
mode:
authorJacek Anaszewski <j.anaszewski@samsung.com>2014-11-14 02:50:18 -0800
committerBryan Wu <cooloney@gmail.com>2014-11-14 14:29:35 -0800
commit4d71a4a12b130ad033219e6f58c74a64059415eb (patch)
tree5b9560719835c5a204b92f4bb7e44aae6793281c /include/linux/leds.h
parentacd899e4f3066b6662f6047da5b795cc762093cb (diff)
leds: Add support for setting brightness in a synchronous way
There are use cases when setting a LED brightness has to have immediate effect (e.g. setting a torch LED brightness). This patch extends LED subsystem to support such operations. The LED subsystem internal API __led_set_brightness is changed to led_set_brightness_async and new led_set_brightness_sync API is added. 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.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/leds.h b/include/linux/leds.h
index 737f9b1051f2..dfe70e928eae 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -44,11 +44,19 @@ struct led_classdev {
#define LED_BLINK_ONESHOT_STOP (1 << 18)
#define LED_BLINK_INVERT (1 << 19)
#define LED_SYSFS_DISABLE (1 << 20)
+#define SET_BRIGHTNESS_ASYNC (1 << 21)
+#define SET_BRIGHTNESS_SYNC (1 << 22)
/* Set LED brightness level */
/* Must not sleep, use a workqueue if needed */
void (*brightness_set)(struct led_classdev *led_cdev,
enum led_brightness brightness);
+ /*
+ * Set LED brightness level immediately - it can block the caller for
+ * the time required for accessing a LED device register.
+ */
+ int (*brightness_set_sync)(struct led_classdev *led_cdev,
+ enum led_brightness brightness);
/* Get LED brightness level */
enum led_brightness (*brightness_get)(struct led_classdev *led_cdev);