From: Nam Tran <trannamatk@gmail.com>
To: lee@kernel.org
Cc: pavel@kernel.org, krzk+dt@kernel.org, robh@kernel.org,
conor+dt@kernel.org, corbet@lwn.net, linux-leds@vger.kernel.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
linux-doc@vger.kernel.org, Nam Tran <trannamatk@gmail.com>
Subject: [PATCH v9 4/4] docs: leds: Document TI LP5812 LED driver
Date: Wed, 11 Jun 2025 00:43:19 +0700 [thread overview]
Message-ID: <20250610174319.183375-6-trannamatk@gmail.com> (raw)
In-Reply-To: <20250610174319.183375-1-trannamatk@gmail.com>
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@gmail.com>
---
Documentation/leds/index.rst | 1 +
Documentation/leds/leds-lp5812.rst | 84 ++++++++++++++++++++++++++++++
MAINTAINERS | 1 +
3 files changed, 86 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..4538cfdf415d
--- /dev/null
+++ b/Documentation/leds/leds-lp5812.rst
@@ -0,0 +1,84 @@
+========================
+Kernel driver for lp5812
+========================
+
+* TI/National Semiconductor LP5812 LED Driver
+* Datasheet: https://www.ti.com/product/LP5812#tech-docs
+
+Authors: Jared Zhou <jared-zhou@ti.com>
+
+Description
+===========
+
+The LP5812 is a 4x3 matrix LED driver with support for both manual and
+autonomous animation control. It provides features such as:
+
+- PWM dimming and DC current control
+- Slope time configuration
+- Autonomous Engine Unit (AEU) for LED animation playback
+- Flexible scan and drive mode configuration
+
+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)
+ - device_command: Issue device-wide commands (WO)
+ - 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)
+ - mode: manual or autonomous mode (WO)
+ - led_current: DC current value (0–255) (WO)
+ - max_current: maximum DC current bit setting (RO)
+ - pwm_dimming_scale: linear or exponential (WO)
+ - pwm_phase_align: PWM alignment mode (WO)
+ - auto_time_pause_at_start: config start pause time (WO)
+ - auto_time_pause_at_stop: config stop pause time (WO)
+ - auto_playback_eau_number: Activate AEU number (WO)
+ - auto_playback_time: Animation pattern playback times (WO)
+ - aeu_playback_time: playback times for the specific AEU (WO)
+ - aeu_pwm_<pwm_id>: PWM duty cycle setting for the specific AEU (WO)
+ - aeu_slop_time_<st_id>: slop time setting for the specific AEU (WO)
+ - lod_lsd: lod and lsd fault detected status (RO)
+
+Example Usage
+=============
+
+To control led_A in manual mode::
+ echo 1 1 1 > /sys/class/leds/LED_A/activate
+ echo manual manual manual > /sys/class/leds/LED_A/mode
+ echo 100 100 100 > /sys/class/leds/LED_A/led_current
+ echo 50 50 50 > /sys/class/leds/LED_A/multi-intensity
+
+To control led_A in autonomous mode::
+ echo 1 1 1 > /sys/bus/i2c/drivers/lp5812/xxxx/led_A/activate
+ echo autonomous autonomous autonomous > /sys/class/leds/LED_A/mode
+ echo linear exponential linear > /sys/class/leds/led_<id>/pwm_dimming_scale
+ echo forward forward backward > /sys/class/leds/led_<id>/pwm_phase_align
+ echo 0 0 0 > /sys/class/leds/led_A/auto_playback_eau_number # only use AEU1
+ echo 10 10 10 > /sys/class/leds/led_A/auto_time_pause_at_start
+ echo 10 10 10 > /sys/class/leds/led_A/auto_time_pause_at_stop
+ echo 15 15 15 > /sys/class/leds/led_A/auto_playback_time
+ echo aeu1:100 100 100 > /sys/class/leds/led_A/aeu_pwm1
+ echo aeu1:100 100 100 > /sys/class/leds/led_A/aeu_pwm2
+ echo aeu1:100 100 100 > /sys/class/leds/led_A/aeu_pwm3
+ echo aeu1:100 100 100 > /sys/class/leds/led_A/aeu_pwm4
+ echo aeu1:100 100 100 > /sys/class/leds/led_A/aeu_pwm5
+ echo aeu1:5 5 5 > /sys/class/leds/led_A/aeu_slop_time_t1
+ echo aeu1:5 5 5 > /sys/class/leds/led_A/aeu_slop_time_t2
+ echo aeu1:5 5 5 > /sys/class/leds/led_A/aeu_slop_time_t3
+ echo aeu1:5 5 5 > /sys/class/leds/led_A/aeu_slop_time_t4
+ echo aeu1:1 1 1 > /sys/class/leds/led_A/aeu_playback_time
+ echo start > /sys/bus/i2c/drivers/lp5812/xxxx/lp5812_chip_setup/device_command
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
next prev parent reply other threads:[~2025-06-10 17:43 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-10 17:43 [PATCH v9 0/4] leds: add new LED driver for TI LP5812 Nam Tran
2025-06-10 17:43 ` [PATCH v9 1/4] dt-bindings: leds: add TI/National Semiconductor LP5812 LED Driver Nam Tran
2025-06-11 8:24 ` Krzysztof Kozlowski
2025-06-17 16:29 ` Nam Tran
2025-06-10 17:43 ` [PATCH v5] test Nam Tran
2025-06-12 10:03 ` Lee Jones
2025-06-17 17:46 ` Nam Tran
2025-06-10 17:43 ` [PATCH v9 2/4] leds: add TI/National Semiconductor LP5812 LED Driver Nam Tran
2025-06-10 18:13 ` Randy Dunlap
2025-06-17 16:50 ` Nam Tran
2025-06-10 21:07 ` Christophe JAILLET
2025-06-17 17:30 ` Nam Tran
2025-06-16 18:37 ` kernel test robot
2025-06-10 17:43 ` [PATCH v9 3/4] docs: ABI: Document LP5812 LED sysfs interfaces Nam Tran
2025-06-10 17:43 ` Nam Tran [this message]
2025-06-10 17:55 ` [PATCH v9 0/4] leds: add new LED driver for TI LP5812 Nam Tran
2025-06-11 6:59 ` Krzysztof Kozlowski
2025-06-17 15:40 ` Nam Tran
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250610174319.183375-6-trannamatk@gmail.com \
--to=trannamatk@gmail.com \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@kernel.org \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.