diff options
| author | Rong Zhang <i@rong.moe> | 2026-09-21 03:40:19 +0800 |
|---|---|---|
| committer | Lee Jones <lee@kernel.org> | 2026-09-24 13:17:32 +0100 |
| commit | 8e04e5382aa989ae9a36dc0cb3f3c90347d5607f (patch) | |
| tree | 8fa3ae99bbfbd04d01be50e72b55b693c2b4f91d /tools/perf/scripts/python | |
| parent | 43b83e7462e8e9b96e14262c0b6aa739f01c38f7 (diff) | |
| download | linux-next-8e04e5382aa989ae9a36dc0cb3f3c90347d5607f.tar.gz linux-next-8e04e5382aa989ae9a36dc0cb3f3c90347d5607f.zip | |
leds: trigger: Add hw_offloaded() callback and provide trigger_may_offload_to_hw attribute
There are multiple triggers implementing hardware control. However, the
LED trigger core doesn't really know the hardware control (offloaded)
state since the coordination is done directly between the trigger and
the LED driver. It can only assume private triggers as offloaded and
generic ones as not offloaded.
Add an hw_offloaded() callback so that triggers can report their
offloaded states to the LED trigger core. When unimplemented, it
defaults to true for private triggers and false for generic ones to keep
the current behavior unchanged.
With that, provide a new attribute "trigger_may_offload_to_hw", so that
userspace can determine:
- if the LED device supports hardware control (supported => visible)
- which trigger is the hardware control trigger selected by the LED
device and offloaded to hardware ("[foo_trigger]")
Note: the documentation describes the attribute as "returning a list"
despite the LED core currently only supports one hardware control
trigger per LED device. This is intentional to make the attribute
extensible in the future without breaking userspace. IOW, userspace
should parse the new attribute in the same way as
/sys/class/leds/<led>/trigger.
Acked-by: Ike Panhc <ikepanhc@gmail.com>
Signed-off-by: Rong Zhang <i@rong.moe>
Link: https://patch.msgid.link/20260921-leds-trigger-hw-changed-v7-5-fe3cdb6dec51@rong.moe
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
