mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 15:27:29 +00:00
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>
This commit is contained in:
parent
acd899e4f3
commit
4d71a4a12b
10 changed files with 62 additions and 26 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue