Re: [PATCH v7 01/11] leds: add support for hardware driven LEDs

From: Bagas Sanjaya
Date: Tue Jan 03 2023 - 00:40:52 EST


On Thu, Dec 15, 2022 at 12:54:28AM +0100, Christian Marangi wrote:
> The LED must implement 3 main API:
> - hw_control_status(): This asks the LED driver if hardware mode is
> enabled or not.
> Triggers will check if the offload mode is supported and will be
> activated accordingly. If the trigger can't run in software mode,
> return -EOPNOTSUPP as the blinking can't be simulated by software.
> - hw_control_start(): This will simply enable the hardware mode for
> the LED.
> With this not declared and hw_control_status() returning true,
> it's assumed that the LED is always in hardware mode.
> - hw_control_stop(): This will simply disable the hardware mode for
> the LED.
> With this not declared and hw_control_status() returning true,
> it's assumed that the LED is always in hardware mode.
> It's advised to the driver to put the LED in the old state but this
> is not enforcerd and putting the LED off is also accepted.
>

Building htmldocs with Sphinx, I got:

Documentation/leds/leds-class.rst:190: WARNING: Unexpected indentation.
Documentation/leds/leds-class.rst:192: WARNING: Block quote ends without a blank line; unexpected unindent.

I have applied the fixup on the API bullet list above:

---- >8 ----

diff --git a/Documentation/leds/leds-class.rst b/Documentation/leds/leds-class.rst
index efd2f68c46a7f9..fc16b503747800 100644
--- a/Documentation/leds/leds-class.rst
+++ b/Documentation/leds/leds-class.rst
@@ -186,13 +186,15 @@ supported. By default if a LED driver doesn't declare blink_mode, SOFTWARE_CONTR
is assumed.

The LED must implement 3 main API:
+
- hw_control_status(): This asks the LED driver if hardware mode is enabled
- or not. Triggers will check if the hardware mode is active and will try
- to offload their triggers if supported by the driver.
+ or not. Triggers will check if the hardware mode is active and will try
+ to offload their triggers if supported by the driver.
- hw_control_start(): This will simply enable the hardware mode for the LED.
+
- hw_control_stop(): This will simply disable the hardware mode for the LED.
- It's advised to the driver to put the LED in the old state but this is not
- enforcerd and putting the LED off is also accepted.
+ It's advised to the driver to put the LED in the old state but this is not
+ enforcerd and putting the LED off is also accepted.

With HARDWARE_CONTROLLED blink_mode hw_control_status/start/stop is optional
and any software only trigger will reject activation as the LED supports only

Thanks.

--
An old man doll... just what I always wanted! - Clara

Attachment: signature.asc
Description: PGP signature