diff options
| author | Richard Leitner <richard.leitner@linux.dev> | 2025-05-07 10:51:31 +0300 |
|---|---|---|
| committer | Lee Jones <lee@kernel.org> | 2025-05-14 11:25:09 +0300 |
| commit | 6a09ae8281986d5fb5ce0115135c05a5afb8718e (patch) | |
| tree | 422ea29ae967b3601ec35da7adb504e88e25b7eb /include/linux | |
| parent | f1c86ab98640e9288049673ca2e4517a9df7ed83 (diff) | |
| download | linux-6a09ae8281986d5fb5ce0115135c05a5afb8718e.tar.xz | |
leds: flash: Add support for flash/strobe duration
Add support for the new V4L2_CID_FLASH_DURATION control to the LEDs
driver.
Signed-off-by: Richard Leitner <richard.leitner@linux.dev>
Link: https://lore.kernel.org/r/20250507-ov9282-flash-strobe-v4-2-72b299c1b7c9@linux.dev
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/led-class-flash.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/led-class-flash.h b/include/linux/led-class-flash.h index 36df927ec4b7..21ec856c36bc 100644 --- a/include/linux/led-class-flash.h +++ b/include/linux/led-class-flash.h @@ -45,6 +45,8 @@ struct led_flash_ops { int (*timeout_set)(struct led_classdev_flash *fled_cdev, u32 timeout); /* get the flash LED fault */ int (*fault_get)(struct led_classdev_flash *fled_cdev, u32 *fault); + /* set flash duration */ + int (*duration_set)(struct led_classdev_flash *fled_cdev, u32 duration); }; /* @@ -75,6 +77,9 @@ struct led_classdev_flash { /* flash timeout value in microseconds along with its constraints */ struct led_flash_setting timeout; + /* flash timeout value in microseconds along with its constraints */ + struct led_flash_setting duration; + /* LED Flash class sysfs groups */ const struct attribute_group *sysfs_groups[LED_FLASH_SYSFS_GROUPS_SIZE]; }; @@ -209,4 +214,15 @@ int led_set_flash_timeout(struct led_classdev_flash *fled_cdev, u32 timeout); */ int led_get_flash_fault(struct led_classdev_flash *fled_cdev, u32 *fault); +/** + * led_set_flash_duration - set flash LED duration + * @fled_cdev: the flash LED to set + * @timeout: the flash duration to set it to + * + * Set the flash strobe duration. + * + * Returns: 0 on success or negative error value on failure + */ +int led_set_flash_duration(struct led_classdev_flash *fled_cdev, u32 duration); + #endif /* __LINUX_FLASH_LEDS_H_INCLUDED */ |
