[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250728065814.120769-5-trannamatk@gmail.com>
Date: Mon, 28 Jul 2025 13:58:14 +0700
From: Nam Tran <trannamatk@...il.com>
To: lee@...nel.org
Cc: pavel@...nel.org,
rdunlap@...radead.org,
christophe.jaillet@...adoo.fr,
krzk+dt@...nel.org,
robh@...nel.org,
conor+dt@...nel.org,
corbet@....net,
linux-leds@...r.kernel.org,
linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org,
linux-doc@...r.kernel.org,
Nam Tran <trannamatk@...il.com>
Subject: [PATCH v12 4/4] docs: leds: Document TI LP5812 LED driver
The driver provides sysfs interfaces to control and configure the
LP5812 device and its LED channels.
The documetation describes the chip's capabilities, sysfs interface,
and usage examples.
Signed-off-by: Nam Tran <trannamatk@...il.com>
---
Documentation/leds/index.rst | 1 +
Documentation/leds/leds-lp5812.rst | 46 ++++++++++++++++++++++++++++++
MAINTAINERS | 1 +
3 files changed, 48 insertions(+)
create mode 100644 Documentation/leds/leds-lp5812.rst
diff --git a/Documentation/leds/index.rst b/Documentation/leds/index.rst
index 76fae171039c..bebf44004278 100644
--- a/Documentation/leds/index.rst
+++ b/Documentation/leds/index.rst
@@ -25,6 +25,7 @@ LEDs
leds-lp5523
leds-lp5562
leds-lp55xx
+ leds-lp5812
leds-mlxcpld
leds-mt6370-rgb
leds-sc27xx
diff --git a/Documentation/leds/leds-lp5812.rst b/Documentation/leds/leds-lp5812.rst
new file mode 100644
index 000000000000..7d464334557c
--- /dev/null
+++ b/Documentation/leds/leds-lp5812.rst
@@ -0,0 +1,46 @@
+========================
+Kernel driver for lp5812
+========================
+
+* TI/National Semiconductor LP5812 LED Driver
+* Datasheet: https://www.ti.com/product/LP5812#tech-docs
+
+Authors: Jared Zhou <jared-zhou@...com>
+
+Description
+===========
+
+The LP5812 is a 4x3 matrix LED driver with support for both manual and
+autonomous animation control. This driver provides sysfs interfaces to
+control and configure the LP5812 device and its LED channels.
+
+Sysfs Interface
+===============
+
+LP5812 device exposes a chip-level sysfs group:
+ /sys/bus/i2c/devices/<i2c-dev-addr>/lp5812_chip_setup/
+
+The following attributes are available at chip level:
+ - dev_config: Configure drive mode and scan order (RW)
+ - sw_reset: Reset the hardware (WO)
+ - fault_clear: Clear any device faults (WO)
+ - tsd_config_status: Read thermal shutdown config status (RO)
+
+Each LED channel is exposed as:
+ /sys/class/leds/led_<id>/
+
+Each LED exposes the following attributes:
+ - activate: Activate or deactivate the LED (WO)
+ - led_current: DC current value (0–255) (WO)
+ - max_current: maximum DC current bit setting (RO)
+ - lod_lsd: lod and lsd fault detected status (RO)
+
+Example Usage
+=============
+
+To control led_A in manual mode::
+ echo "tcmscan:4:0:1:2:3" > /sys/bus/i2c/devices/.../lp5812_chip_setup/dev_config
+ echo 1 1 1 > /sys/class/leds/LED_A/activate
+ echo 100 100 100 > /sys/class/leds/LED_A/led_current
+ echo 50 50 50 > /sys/class/leds/LED_A/multi_intensity
+ echo 255 > /sys/class/leds/LED_A/brightness
diff --git a/MAINTAINERS b/MAINTAINERS
index cdba86f1768b..4fefc7fb7a9a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -24568,6 +24568,7 @@ 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: Documentation/leds/leds-lp5812.rst
F: drivers/leds/rgb/Kconfig
F: drivers/leds/rgb/Makefile
F: drivers/leds/rgb/leds-lp5812.c
--
2.25.1
Powered by blists - more mailing lists