diff options
author | Jacek Anaszewski <j.anaszewski@samsung.com> | 2015-01-09 10:22:51 -0500 |
---|---|---|
committer | Bryan Wu <cooloney@gmail.com> | 2015-01-26 17:59:08 -0500 |
commit | 7aea8389a77abf9fde254aca2434a605c7704f58 (patch) | |
tree | 580f35fdeca75a9533329d85822ab32f89fce64a /include/linux/leds.h | |
parent | 452bc149947bb31775f0dc6a637fcf792af88e60 (diff) |
leds: Add LED Flash class extension to the LED subsystem
Some LED devices support two operation modes - torch and flash.
This patch provides support for flash LED devices in the LED subsystem
by introducing new sysfs attributes and kernel internal interface.
The attributes being introduced are: flash_brightness, flash_strobe,
flash_timeout, max_flash_timeout, max_flash_brightness, flash_fault,
flash_sync_strobe and available_sync_leds. All the flash related
features are placed in a separate module.
The modifications aim to be compatible with V4L2 framework requirements
related to the flash devices management. The design assumes that V4L2
sub-device can take of the LED class device control and communicate
with it through the kernel internal interface. When V4L2 Flash sub-device
file is opened, the LED class device sysfs interface is made
unavailable.
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'include/linux/leds.h')
-rw-r--r-- | include/linux/leds.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/leds.h b/include/linux/leds.h index cfceef32c9b3..f70f84f35674 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
@@ -46,6 +46,8 @@ struct led_classdev { | |||
46 | #define LED_SYSFS_DISABLE (1 << 20) | 46 | #define LED_SYSFS_DISABLE (1 << 20) |
47 | #define SET_BRIGHTNESS_ASYNC (1 << 21) | 47 | #define SET_BRIGHTNESS_ASYNC (1 << 21) |
48 | #define SET_BRIGHTNESS_SYNC (1 << 22) | 48 | #define SET_BRIGHTNESS_SYNC (1 << 22) |
49 | #define LED_DEV_CAP_FLASH (1 << 23) | ||
50 | #define LED_DEV_CAP_SYNC_STROBE (1 << 24) | ||
49 | 51 | ||
50 | /* Set LED brightness level */ | 52 | /* Set LED brightness level */ |
51 | /* Must not sleep, use a workqueue if needed */ | 53 | /* Must not sleep, use a workqueue if needed */ |
@@ -81,6 +83,7 @@ struct led_classdev { | |||
81 | unsigned long blink_delay_on, blink_delay_off; | 83 | unsigned long blink_delay_on, blink_delay_off; |
82 | struct timer_list blink_timer; | 84 | struct timer_list blink_timer; |
83 | int blink_brightness; | 85 | int blink_brightness; |
86 | void (*flash_resume)(struct led_classdev *led_cdev); | ||
84 | 87 | ||
85 | struct work_struct set_brightness_work; | 88 | struct work_struct set_brightness_work; |
86 | int delayed_set_value; | 89 | int delayed_set_value; |