diff options
| author | Rong Zhang <i@rong.moe> | 2026-09-21 03:40:24 +0800 |
|---|---|---|
| committer | Lee Jones <lee@kernel.org> | 2026-09-24 13:17:32 +0100 |
| commit | 05b4738b0078f7d6f154f68068a11c8a0635e9df (patch) | |
| tree | 980e32116718c5539e8348c0b1d86ec2cca5d4b1 /tools/perf/scripts/python/stackcollapse.py | |
| parent | 7b9a609575615a3ba18a31a95282e756e34bd506 (diff) | |
| download | linux-next-05b4738b0078f7d6f154f68068a11c8a0635e9df.tar.gz linux-next-05b4738b0078f7d6f154f68068a11c8a0635e9df.zip | |
leds: trigger: Add led_trigger_notify_hw_control_changed() interface
Some hardware can autonomously activate/deactivate hardware control.
After that, the LED hardware notifies the LED driver. Currently, there
is no mechanism for LED drivers to notify the LED core about such events
and initiate a trigger transition to reflect the hardware state.
Add a new interface called led_trigger_notify_hw_control_changed(), so
that LED drivers can call it to notify the LED core about the
transition.
The interface only allows two transitions:
1. "none" => private trigger
2. private trigger => "none"
If the current trigger is neither the private trigger nor "none", no
transition will be made. This protects the currently selected software
trigger.
Note that LED_OFF won't be emitted during the #2 transition, as some
hardware may have selected a new brightness level during its hardware
state transition (e.g., laptop keyboards with a shortcut cycling through
different backlight brightnesses and auto mode).
The interface is designed as a void function as any failure should be
non-fatal and the result of transition should not have any impact on the
LED drivers' event handling procedures.
To use the interface, the config LEDS_TRIGGERS_HW_CHANGED must be
enabled, and the LED driver must set the LED_TRIG_HW_CHANGED flag for
the classdev.
By default, the config is enabled when LEDS_BRIGHTNESS_HW_CHANGED is
enabled.
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-10-fe3cdb6dec51@rong.moe
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
