[PATCH v2 1/2] led: lp5860: expose fault state via sysfs
From: Steffen Trumtrar
Date: Wed Mar 11 2026 - 08:27:46 EST
Return the fault state to the userspase via sysfs and allow to reset it.
The LP5860 has a global fault state, that just indicates that a short or
open fault was detected on any LED. This is exposed via 'fault_state'.
The 'fault_state_open' exposes the LED name and channel where an open
condition was detected.
The 'fault_state_short' exposes the LED name and channel where a short
condition was detected.
To: Mark Brown <broonie@xxxxxxxxxx>
Cc: linux-spi@xxxxxxxxxxxxxxx
Signed-off-by: Steffen Trumtrar <s.trumtrar@xxxxxxxxxxxxxx>
---
Documentation/ABI/testing/sysfs-class-spi-lp5860 | 49 ++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/Documentation/ABI/testing/sysfs-class-spi-lp5860 b/Documentation/ABI/testing/sysfs-class-spi-lp5860
new file mode 100644
index 0000000000000..31082bd78f51e
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-class-spi-lp5860
@@ -0,0 +1,49 @@
+What: /sys/class/spi_master/spi<bus>/spi<bus>.<dev>/fault_state
+Date: March 2026
+KernelVersion: 7.0
+Contact: Steffen Trumtrar <kernel@xxxxxxxxxxxxxx>
+Description:
+ Contains and sets the global fault state:
+
+ * 3: Open and short detected
+ * 2: Open detected
+ * 1: Short detected
+
+ Can be cleared by writing the corresponding value back to fault_state.
+
+ Example usage::
+
+ ## Read
+ # cat /sys/class/spi_master/spi<bus>/spi<bus>.<dev>/fault_state
+ 2
+
+ ## Write
+ # echo 2 > /sys/class/spi_master/spi<bus>/spi<bus>.<dev>/fault_state
+
+What: /sys/class/spi_master/spi<bus>/spi<bus>.<dev>/fault_state_open
+Date: March 2026
+KernelVersion: 7.0
+Contact: Steffen Trumtrar <kernel@xxxxxxxxxxxxxx>
+Description:
+ Contains all LEDs and channels where an open condition was detected.
+ The format is ledname:channel.
+
+ Example usage::
+
+ ## Read
+ # cat /sys/class/spi_master/spi<bus>/spi<bus>.<dev>/fault_state_open
+ rgb1:0 rgb2:4
+
+What: /sys/class/spi_master/spi<bus>/spi<bus>.<dev>/fault_state_short
+Date: March 2026
+KernelVersion: 7.0
+Contact: Steffen Trumtrar <kernel@xxxxxxxxxxxxxx>
+Description:
+ Contains all LEDs and channels where a short condition was detected.
+ The format is ledname:channel.
+
+ Example usage::
+
+ ## Read
+ # cat /sys/class/spi_master/spi<bus>/spi<bus>.<dev>/fault_state_short
+ rgb1:0 rgb2:4
--
2.51.0