mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
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> |
||
|---|---|---|
| .. | ||
| index.rst | ||
| leds-blinkm.rst | ||
| leds-cht-wcove.rst | ||
| leds-class-flash.rst | ||
| leds-class-multicolor.rst | ||
| leds-class.rst | ||
| leds-el15203000.rst | ||
| leds-lm3556.rst | ||
| leds-lp55xx.rst | ||
| leds-lp3944.rst | ||
| leds-lp5521.rst | ||
| leds-lp5523.rst | ||
| leds-lp5562.rst | ||
| leds-lp5812.rst | ||
| leds-mlxcpld.rst | ||
| leds-mt6370-rgb.rst | ||
| leds-qcom-lpg.rst | ||
| leds-s2m-rgb.rst | ||
| leds-sc27xx.rst | ||
| leds-st1202.rst | ||
| ledtrig-oneshot.rst | ||
| ledtrig-transient.rst | ||
| ledtrig-usbport.rst | ||
| uleds.rst | ||
| well-known-leds.txt | ||