linux/Documentation/leds
Rong Zhang 05b4738b00 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>
2026-09-24 13:17:32 +01:00
..
index.rst Documentation: leds: Document pattern behavior of Samsung S2M series PMIC RGB LEDs 2026-06-17 11:29:34 +01:00
leds-blinkm.rst leds: Add multicolor support to BlinkM LED driver 2024-08-01 13:40:02 +01:00
leds-cht-wcove.rst
leds-class-flash.rst
leds-class-multicolor.rst leds: Introduce the multi_max_intensity sysfs attribute 2026-06-17 11:28:52 +01:00
leds-class.rst leds: trigger: Add led_trigger_notify_hw_control_changed() interface 2026-09-24 13:17:32 +01:00
leds-el15203000.rst
leds-lm3556.rst
leds-lp55xx.rst docs: fix typo in leds-lp55xx.rst 2026-05-25 14:20:02 -06:00
leds-lp3944.rst
leds-lp5521.rst leds: lp55xx_common: Enable use without FW_LOADER_USER_HELPER 2025-10-21 10:46:30 +01:00
leds-lp5523.rst leds: lp55xx_common: Enable use without FW_LOADER_USER_HELPER 2025-10-21 10:46:30 +01:00
leds-lp5562.rst
leds-lp5812.rst docs: leds: Fix sysfs ABI reference in lp5812.rst 2026-06-17 11:28:14 +01:00
leds-mlxcpld.rst docs: leds: fix typo in Documentation/leds/leds-mlxcpld.rst 2024-08-26 15:07:59 -06:00
leds-mt6370-rgb.rst
leds-qcom-lpg.rst
leds-s2m-rgb.rst Documentation: leds: Document pattern behavior of Samsung S2M series PMIC RGB LEDs 2026-06-17 11:29:34 +01:00
leds-sc27xx.rst
leds-st1202.rst leds: st1202: Scale pattern brightness to the 12-bit PWM range 2026-09-22 14:26:03 +01:00
ledtrig-oneshot.rst
ledtrig-transient.rst
ledtrig-usbport.rst
uleds.rst
well-known-leds.txt leds: Add multicolor support to BlinkM LED driver 2024-08-01 13:40:02 +01:00