@@ -157,6 +157,8 @@ struct led_classdev {
/* Unique trigger name supported by LED set in hw control mode */
const char *hw_control_trigger;
+ /* Mask of the different supported trigger mode in hw control mode */
+ unsigned long trigger_supported_flags_mask;
/*
* Activate hardware control, LED driver will use the provided flags
* from the supported trigger and setup the LED to be driven by hardware
@@ -174,6 +176,12 @@ struct led_classdev {
*/
int (*hw_control_get)(struct led_classdev *led_cdev,
unsigned long *flags);
+ /*
+ * Check if the LED driver supports the requested mode provided by the
+ * defined supported trigger to setup the LED to hw control mode.
+ */
+ int (*hw_control_is_supported)(struct led_classdev *led_cdev,
+ unsigned long flags);
#endif
#ifdef CONFIG_LEDS_BRIGHTNESS_HW_CHANGED
Add 2 binding to facilitate checking support for LED hw control. Add a mask for the LED driver to declare support for specific modes of the defined hw control trigger. 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. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> --- include/linux/leds.h | 8 ++++++++ 1 file changed, 8 insertions(+)