leds: add APIs for LEDs hw control
authorChristian Marangi <ansuelsmth@gmail.com>
Mon, 29 May 2023 16:32:31 +0000 (18:32 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 31 May 2023 08:42:08 +0000 (09:42 +0100)
commited554d3f945179c5b159bddfad7be34b403fe11a
tree32bf1254dc39a2280933cd506a813b7dc854b88c
parent6cd8ec58c1bf65adcdf346fe241ba69e0b56e6bd
leds: add APIs for LEDs hw control

Add an option to permit LED driver to declare support for a specific
trigger to use hw control and setup the LED to blink based on specific
provided modes.

Add APIs for LEDs hw control. These functions will be used to activate
hardware control where a LED will use the provided flags, from an
unique defined supported trigger, to setup the LED to be driven by
hardware.

Add hw_control_is_supported() to ask the LED driver if the requested
mode by the trigger are supported and the LED can be setup to follow
the requested modes.

Deactivate hardware blink control by setting brightness to LED_OFF via
the brightness_set() callback.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/leds.h