diff options
author | Jacek Anaszewski <j.anaszewski@samsung.com> | 2015-10-07 12:10:41 +0300 |
---|---|---|
committer | Jacek Anaszewski <j.anaszewski@samsung.com> | 2016-01-04 11:57:30 +0300 |
commit | 81fe8e5b73e3f4de578ac7f53c1d956d4f58b8d4 (patch) | |
tree | ff084840f52a554f7a902c7e1ffe54416e4c452f /drivers/leds/trigger/ledtrig-gpio.c | |
parent | 437a4240f26461610cc0d90950b1c88348d9babe (diff) | |
download | linux-81fe8e5b73e3f4de578ac7f53c1d956d4f58b8d4.tar.xz |
leds: core: Add led_set_brightness_nosleep{nopm} functions
This patch adds led_set_brightness_nosleep() and led_set_brightness_nopm()
functions, that guarantee setting LED brightness in a non-blocking way.
The latter is used from pm_ops context and doesn't modify the brightness
cached in the struct led_classdev. Its execution always ends up with
a call to brightness setting op - either directly or through
a set_brightness_work, regardless of LED_SUSPENDED flag state.
The patch also replaces led_set_brightness_async() with
led_set_brightness_nosleep() in all places where the most vital was setting
brightness in a non sleeping way but not necessarily asynchronously, which
is not needed for non-blocking drivers.
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Diffstat (limited to 'drivers/leds/trigger/ledtrig-gpio.c')
-rw-r--r-- | drivers/leds/trigger/ledtrig-gpio.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/leds/trigger/ledtrig-gpio.c b/drivers/leds/trigger/ledtrig-gpio.c index 4cc7040746c6..51288a45fbcb 100644 --- a/drivers/leds/trigger/ledtrig-gpio.c +++ b/drivers/leds/trigger/ledtrig-gpio.c @@ -54,12 +54,12 @@ static void gpio_trig_work(struct work_struct *work) if (tmp) { if (gpio_data->desired_brightness) - led_set_brightness_async(gpio_data->led, + led_set_brightness_nosleep(gpio_data->led, gpio_data->desired_brightness); else - led_set_brightness_async(gpio_data->led, LED_FULL); + led_set_brightness_nosleep(gpio_data->led, LED_FULL); } else { - led_set_brightness_async(gpio_data->led, LED_OFF); + led_set_brightness_nosleep(gpio_data->led, LED_OFF); } } |