[PATCH v13 RESEND 3/4] docs: ABI: Document LP5812 LED sysfs interfaces

Nam Tran posted 4 patches 1 month, 2 weeks ago
There is a newer version of this series
[PATCH v13 RESEND 3/4] docs: ABI: Document LP5812 LED sysfs interfaces
Posted by Nam Tran 1 month, 2 weeks ago
The LP5812 is a 4x3 matrix RGB LED driver with autonomous animation
engine control.

This patch documents the basic sysfs interfaces provided by the driver,
including LED activation, current control, fault status, and simple
chip-level operations such as software reset and fault clearing.

Signed-off-by: Nam Tran <trannamatk@gmail.com>
---
 .../ABI/testing/sysfs-bus-i2c-devices-lp5812  | 32 +++++++++++++++++++
 .../ABI/testing/sysfs-class-led-lp5812        | 32 +++++++++++++++++++
 MAINTAINERS                                   |  2 ++
 3 files changed, 66 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-i2c-devices-lp5812
 create mode 100644 Documentation/ABI/testing/sysfs-class-led-lp5812

diff --git a/Documentation/ABI/testing/sysfs-bus-i2c-devices-lp5812 b/Documentation/ABI/testing/sysfs-bus-i2c-devices-lp5812
new file mode 100644
index 000000000000..d0d622753be8
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-i2c-devices-lp5812
@@ -0,0 +1,32 @@
+What:		/sys/bus/i2c/devices/.../lp5812_chip_setup/dev_config
+Date:		July 2025
+KernelVersion:	6.17
+Contact:	Nam Tran <trannamatk@gmail.com>
+Description:
+		Configures drive mode and scan order. (WO)
+		Some valid values: tcmscan:4:0:1:2:3 (default), tcmscan:3:0:1:2, mixscan:2:2:0:3, mixscan:3:0:1:2:3
+
+What:		/sys/bus/i2c/devices/.../lp5812_chip_setup/sw_reset
+Date:		July 2025
+KernelVersion:	6.17
+Contact:	Nam Tran <trannamatk@gmail.com>
+Description:
+		Triggers a software reset of the device. (WO)
+		1 - resets device
+		0 - does not reset device
+
+What:		/sys/bus/i2c/devices/.../lp5812_chip_setup/fault_clear
+Date:		July 2025
+KernelVersion:	6.17
+Contact:	Nam Tran <trannamatk@gmail.com>
+Description:
+		Clears fault status. (WO)
+		1 - clears fault status
+		0 - does not clear fault status
+
+What:		/sys/bus/i2c/devices/.../lp5812_chip_setup/tsd_config_status
+Date:		July 2025
+KernelVersion:	6.17
+Contact:	Nam Tran <trannamatk@gmail.com>
+Description:
+		Report the current thermal shutdown config status. (RO)
diff --git a/Documentation/ABI/testing/sysfs-class-led-lp5812 b/Documentation/ABI/testing/sysfs-class-led-lp5812
new file mode 100644
index 000000000000..93eeecc60864
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-class-led-lp5812
@@ -0,0 +1,32 @@
+What:		/sys/class/leds/led_<id>/activate
+Date:		July 2025
+KernelVersion:	6.17
+Contact:	Nam Tran <trannamatk@gmail.com>
+Description:
+		Activate or deactivate the specified LED channel. (WO)
+		1 - Activate
+		0 - Deactivate
+
+What:		/sys/class/leds/led_<id>/led_current
+Date:		July 2025
+KernelVersion:	6.17
+Contact:	Nam Tran <trannamatk@gmail.com>
+Description:
+		DC current level. (WO)
+		Valid values: 0 - 255
+
+What:		/sys/class/leds/led_<id>/max_current
+Date:		July 2025
+KernelVersion:	6.17
+Contact:	Nam Tran <trannamatk@gmail.com>
+Description:
+		Shows maximum DC current bit setting. (RO)
+		0 (default) means the LED maximum current is set to 25.5 mA.
+		1 means the LED maximum current is set to 51 mA.
+
+What:		/sys/class/leds/led_<id>/lod_lsd
+Date:		July 2025
+KernelVersion:	6.17
+Contact:	Nam Tran <trannamatk@gmail.com>
+Description:
+		0 0 mean no lod and lsd fault detected, 1 1 mean lod and lsd fault detected (RO)
diff --git a/MAINTAINERS b/MAINTAINERS
index c2e1c02e206d..608a7f3feb07 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -24827,6 +24827,8 @@ TEXAS INSTRUMENTS' LP5812 RGB LED DRIVER
 M:	Nam Tran <trannamatk@gmail.com>
 L:	linux-leds@vger.kernel.org
 S:	Maintained
+F:	Documentation/ABI/testing/sysfs-bus-i2c-devices-lp5812
+F:	Documentation/ABI/testing/sysfs-class-led-lp5812
 F:	Documentation/devicetree/bindings/leds/ti,lp5812.yaml
 F:	drivers/leds/rgb/Kconfig
 F:	drivers/leds/rgb/Makefile
-- 
2.25.1
Re: [PATCH v13 RESEND 3/4] docs: ABI: Document LP5812 LED sysfs interfaces
Posted by Randy Dunlap 1 month, 2 weeks ago
Hi--

On 8/17/25 6:26 PM, Nam Tran wrote:
> The LP5812 is a 4x3 matrix RGB LED driver with autonomous animation
> engine control.
> 
> This patch documents the basic sysfs interfaces provided by the driver,
> including LED activation, current control, fault status, and simple
> chip-level operations such as software reset and fault clearing.
> 
> Signed-off-by: Nam Tran <trannamatk@gmail.com>
> ---
>  .../ABI/testing/sysfs-bus-i2c-devices-lp5812  | 32 +++++++++++++++++++
>  .../ABI/testing/sysfs-class-led-lp5812        | 32 +++++++++++++++++++
>  MAINTAINERS                                   |  2 ++
>  3 files changed, 66 insertions(+)
>  create mode 100644 Documentation/ABI/testing/sysfs-bus-i2c-devices-lp5812
>  create mode 100644 Documentation/ABI/testing/sysfs-class-led-lp5812
> 


> diff --git a/Documentation/ABI/testing/sysfs-class-led-lp5812 b/Documentation/ABI/testing/sysfs-class-led-lp5812
> new file mode 100644
> index 000000000000..93eeecc60864
> --- /dev/null
> +++ b/Documentation/ABI/testing/sysfs-class-led-lp5812
> @@ -0,0 +1,32 @@
> +What:		/sys/class/leds/led_<id>/activate
> +Date:		July 2025
> +KernelVersion:	6.17
> +Contact:	Nam Tran <trannamatk@gmail.com>
> +Description:
> +		Activate or deactivate the specified LED channel. (WO)
> +		1 - Activate
> +		0 - Deactivate
> +
> +What:		/sys/class/leds/led_<id>/led_current
> +Date:		July 2025
> +KernelVersion:	6.17
> +Contact:	Nam Tran <trannamatk@gmail.com>
> +Description:
> +		DC current level. (WO)
> +		Valid values: 0 - 255
> +
> +What:		/sys/class/leds/led_<id>/max_current
> +Date:		July 2025
> +KernelVersion:	6.17
> +Contact:	Nam Tran <trannamatk@gmail.com>
> +Description:
> +		Shows maximum DC current bit setting. (RO)
> +		0 (default) means the LED maximum current is set to 25.5 mA.
> +		1 means the LED maximum current is set to 51 mA.
> +
> +What:		/sys/class/leds/led_<id>/lod_lsd
> +Date:		July 2025
> +KernelVersion:	6.17
> +Contact:	Nam Tran <trannamatk@gmail.com>
> +Description:
> +		0 0 mean no lod and lsd fault detected, 1 1 mean lod and lsd fault detected (RO)

At first the "0 0" and "1 1" confused me (thought it was a typo),
but I think what you are showing here is a sysfs file with 2 values, right?
That used to be discouraged (or even nacked), although I don't know the
current policy on that.

@Greg, any comment?


-- 
~Randy
Re: [PATCH v13 RESEND 3/4] docs: ABI: Document LP5812 LED sysfs interfaces
Posted by Nam Tran 1 month, 2 weeks ago
On Sun, 17 Aug 2025, Randy Dunlap wrote:

> > +What:		/sys/class/leds/led_<id>/lod_lsd
> > +Date:		July 2025
> > +KernelVersion:	6.17
> > +Contact:	Nam Tran <trannamatk@gmail.com>
> > +Description:
> > +		0 0 mean no lod and lsd fault detected, 1 1 mean lod and lsd fault detected (RO)
> 
> At first the "0 0" and "1 1" confused me (thought it was a typo),
> but I think what you are showing here is a sysfs file with 2 values, right?
> That used to be discouraged (or even nacked), although I don't know the
> current policy on that.

The lod_lsd sysfs file currently reports two values: the first value is the LOD
(LED open detection) fault status, the first value is the LOD (LED open detection)
fault status.

I followed this approach to keep the two related fault bits in a single file, but
I'm open to splitting them into separate sysfs entries if that is preferred.

Best regards,
Nam Tran