diff options
author | Martin Kurbanov <mmkurbanov@salutedevices.com> | 2024-04-16 23:18:05 +0300 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2024-05-02 17:32:01 +0100 |
commit | aa172ba73948e2152e258ead7e9ddbd806e809b0 (patch) | |
tree | bf60ae36c4cf5bf247eefffa24a117ca9a09ec30 /Documentation/ABI | |
parent | fd05e3698649f253db5476929675a8cd954cb2b8 (diff) |
leds: trigger: pattern: Add support for hrtimer
Currently, led pattern trigger uses timer_list to schedule brightness
changing. As we know from timer_list API [1], it's not accurate to
milliseconds and depends on HZ granularity.
Example:
"0 10 0 0 50 10 50 0 100 10 100 0 150 10 150 0 200 10 200 0 250 10 250 0",
we expect it to be 60ms long, but it can actually be up to ~120ms
(add ~10ms for each pattern when HZ == 100).
But sometimes, userspace needs time accurate led patterns to make sure
that pattern will be executed during expected time slot.
To achieve this goal the patch introduces optional hrtimer usage for
led trigger pattern, because hrtimer is microseconds accurate timer.
[1]: kernel/time/timer.c#L104
Signed-off-by: Martin Kurbanov <mmkurbanov@salutedevices.com>
Link: https://lore.kernel.org/r/20240416201847.357099-1-mmkurbanov@salutedevices.com
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'Documentation/ABI')
-rw-r--r-- | Documentation/ABI/testing/sysfs-class-led-trigger-pattern | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Documentation/ABI/testing/sysfs-class-led-trigger-pattern b/Documentation/ABI/testing/sysfs-class-led-trigger-pattern index 8c57d2780554..22f28f2e9ac4 100644 --- a/Documentation/ABI/testing/sysfs-class-led-trigger-pattern +++ b/Documentation/ABI/testing/sysfs-class-led-trigger-pattern @@ -12,6 +12,16 @@ Description: The exact format is described in: Documentation/devicetree/bindings/leds/leds-trigger-pattern.txt +What: /sys/class/leds/<led>/hr_pattern +Date: April 2024 +Description: + Specify a software pattern for the LED, that supports altering + the brightness for the specified duration with one software + timer. It can do gradual dimming and step change of brightness. + + Unlike the /sys/class/leds/<led>/pattern, this attribute runs + a pattern on high-resolution timer (hrtimer). + What: /sys/class/leds/<led>/hw_pattern Date: September 2018 KernelVersion: 4.20 |