leds: add new LED driver for TI LP5812
Subsystems (5)
Nam Tran
maintainerv5 cover leds: add new LED driver for TI LP5812
This patch series adds support for the TI/National Semiconductor LP5812 4x3 matrix RGB LED driver. The driver supports features such as autonomous animation and time-cross-multiplexing (TCM) for dynamic LED effects.
---
Changes in v5:
- Rebase on v6.15-rc2
- Removed unused functions (lp5812_dump_regs, lp5812_update_bit).
- Address Krzysztof's review comments
- Link to v4: https://lore.kernel.org/linux-leds/[email protected]/
---
Nam Tran (5):
dt-bindings: leds: add TI/National Semiconductor LP5812 LED Driver
leds: add TI/National Semiconductor LP5812 LED Driver
docs: ABI: Document LP5812 LED sysfs interfaces
docs: leds: Document TI LP5812 LED driver
arm64: dts: Add LP5812 LED node for Raspberry Pi 4 Model B
.../ABI/testing/sysfs-bus-i2c-devices-lp5812 | 144 + .../devicetree/bindings/leds/ti,lp5812.yaml | 119 + Documentation/leds/leds-lp5812.rst | 79 + MAINTAINERS | 12 + .../arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts | 60 + drivers/leds/Kconfig | 16 + drivers/leds/Makefile | 1 + drivers/leds/leds-lp5812.c | 2797 +++++++++++++++++ drivers/leds/leds-lp5812.h | 350 +++ 9 files changed, 3578 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-i2c-devices-lp5812 create mode 100644 Documentation/devicetree/bindings/leds/ti,lp5812.yaml create mode 100644 Documentation/leds/leds-lp5812.rst create mode 100644 drivers/leds/leds-lp5812.c create mode 100644 drivers/leds/leds-lp5812.h
base-commit: 8ffd015db85fea3e15a77027fda6c02ced4d2444
Signature · 1 line
2.25.1
Nam Tran
maintainerPATCH v5 1/5 dt-bindings: leds: add TI/National Semiconductor LP5812 LED Driver
The LP5812 is a 4×3 RGB LED driver with an autonomous animation engine and time-cross-multiplexing (TCM) support for up to 12 LEDs. It supports both analog (256 levels) and PWM (8-bit) dimming, including exponential PWM for smooth brightness control.
--- .../devicetree/bindings/leds/ti,lp5812.yaml | 119 ++++++++++++++++++ MAINTAINERS | 6 + 2 files changed, 125 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/ti,lp5812.yaml
Documentation/devicetree/bindings/leds/ti,lp5812.yaml new file +119 -0
@@ -0,0 +1,119 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/ti,lp5812.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: TI/National Semiconductor LP5812 LED Driver + +maintainers: + - Nam Tran <[email protected]> + +description: | + The LP5812 is an I2C LED Driver that can support LED matrix 4x3. + For more product information please see the link below: + https://www.ti.com/product/LP5812#tech-docs + +properties: + compatible: + const: ti,lp5812 + + reg: + maxItems: 1 + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + +patternProperties: + "^led@[0-9a-b]$": + type: object + $ref: common.yaml# + unevaluatedProperties: false + + properties: + reg: + minimum: 0 + maximum: 0xb + + chan-name: + $ref: /schemas/types.yaml#/definitions/string + description: LED channel name + + required: + - reg + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + #include <dt-bindings/leds/common.h> + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + led-controller@1b { + compatible = "ti,lp5812"; + reg = <0x1b>; + #address-cells = <1>; + #size-cells = <0>; + + led@0 { + reg = <0x0>; + chan-name = "a0"; + }; + led@1 { + reg = <0x1>; + chan-name = "a1"; + }; + led@2 { + reg = <0x2>; + chan-name = "a2"; + }; + led@3 { + reg = <0x3>; + chan-name = "b0"; + }; + led@4 { + reg = <0x4>; + chan-name = "b1"; + }; + led@5 { + reg = <0x5>; + chan-name = "b2"; + }; + led@6 { + reg = <0x6>; + chan-name = "c0"; + }; + led@7 { + reg = <0x7>; + chan-name = "c1"; + }; + led@8 { + reg = <0x8>; + chan-name = "c2"; + }; + led@9 { + reg = <0x9>; + chan-name = "d0"; + }; + led@a { + reg = <0xa>; + chan-name = "d1"; + }; + led@b { + reg = <0xb>; + chan-name = "d2"; + }; + }; + }; + +...
MAINTAINERS +6 -0
@@ -23934,6 +23934,12 @@ S: Supported F: Documentation/devicetree/bindings/iio/dac/ti,dac7612.yaml F: drivers/iio/dac/ti-dac7612.c +TEXAS INSTRUMENTS' LP5812 LED DRIVER +M: Nam Tran <[email protected]> +L: [email protected] +S: Maintained +F: Documentation/devicetree/bindings/leds/ti,lp5812.yaml + TEXAS INSTRUMENTS' LB8864 LED BACKLIGHT DRIVER M: Alexander Sverdlin <[email protected]> L: [email protected]
Signature · 1 line
2.25.1
Re: [PATCH v5 1/5] dt-bindings: leds: add TI/National Semiconductor LP5812 LED Driver
Quoted 8 lines · Nam Tran
Documentation/devicetree/bindings/leds/ti,lp5812.yaml new file +8
-0+ +description: | + The LP5812 is an I2C LED Driver that can support LED matrix 4x3. + For more product information please see the link below: + https://www.ti.com/product/LP5812#tech-docs + +properties: + compatible:
Documentation/devicetree/bindings/leds/ti,lp5812.yaml line 28
Quoted 10 lines
Documentation/devicetree/bindings/leds/ti,lp5812.yaml new file +10
-0+ const: ti,lp5812 + + reg: + maxItems: 1 + + "#address-cells": + const: 1 + + "#size-cells": + const: 0
No need for supply?
Quoted 5 lines
Documentation/devicetree/bindings/leds/ti,lp5812.yaml new file +5
-0+ +patternProperties: + "^led@[0-9a-b]$": + type: object + $ref: common.yaml#
Documentation/devicetree/bindings/leds/ti,lp5812.yaml line 43
Quoted 10 lines
Documentation/devicetree/bindings/leds/ti,lp5812.yaml new file +10
-0+ unevaluatedProperties: false + + properties: + reg: + minimum: 0 + maximum: 0xb + + chan-name: + $ref: /schemas/types.yaml#/definitions/string + description: LED channel name
My comment stay valid. I don't think LEDs have channels, datasheet also has nothing about channels, so again - use existing properties. Or better drop it - I don't see any point in the name. The reg already defines it.
However after dropping this, your example has nodes with only reg - what's the point of them? Why no properties from common.yaml are applicable? If they are not applicable, then the entire subnode should be dropped - you don't need them to describe the hardware.
Best regards,
Krzysztof
Nam Tran
maintainerRe: [PATCH v5 1/5] dt-bindings: leds: add TI/National Semiconductor LP5812 LED Driver
Quoted 13 lines · Krzysztof Kozlowski
Quoted 12 lines · Nam Tran
Documentation/devicetree/bindings/leds/ti,lp5812.yaml new file +12
-0+ +description: | + The LP5812 is an I2C LED Driver that can support LED matrix 4x3. + For more product information please see the link below: + https://www.ti.com/product/LP5812#tech-docs + +properties: + compatible: + const: ti,lp5812 + + reg: + maxItems: 1
Quoted 8 lines
Documentation/devicetree/bindings/leds/ti,lp5812.yaml line 28
Quoted 6 lines
Documentation/devicetree/bindings/leds/ti,lp5812.yaml new file +6
-0+ + "#address-cells": + const: 1 + + "#size-cells": + const: 0No need for supply?
Since the hardware uses an external power supply, we decide not to include the supply property in the binding.
Quoted 12 lines
Quoted 12 lines
Documentation/devicetree/bindings/leds/ti,lp5812.yaml new file +12
-0+ +patternProperties: + "^led@[0-9a-b]$": + type: object + $ref: common.yaml# + unevaluatedProperties: false + + properties: + reg: + minimum: 0 + maximum: 0xb +
Quoted 8 lines
Documentation/devicetree/bindings/leds/ti,lp5812.yaml line 43
Quoted 3 lines
Documentation/devicetree/bindings/leds/ti,lp5812.yaml new file +3
-0+ chan-name: + $ref: /schemas/types.yaml#/definitions/string + description: LED channel nameMy comment stay valid. I don't think LEDs have channels, datasheet also has nothing about channels, so again - use existing properties. Or better drop it - I don't see any point in the name. The reg already defines it.
The channel was named for the output channel to each LED, not the LED channels.
They are not required properties because we can control entirely the LEDs of LP5812 through the indexes (regs property), but the person who wants to develop LP5812's matrix-related features can use the "channels" for easy mapping.
Quoted 5 lines
However after dropping this, your example has nodes with only reg - what's the point of them? Why no properties from
common.yamlare applicable? If they are not applicable, then the entire subnode should be dropped - you don't need them to describe the hardware.
Actually, the "color" property can be applied, but the LP5812 is a matrix LED, so specifying a particular LED color is not necessary when developing LP5812 features.
Best regards,
Nam Tran
Re: [PATCH v5 1/5] dt-bindings: leds: add TI/National Semiconductor LP5812 LED Driver
Quoted 24 lines · Nam Tran
Quoted 13 lines · Krzysztof Kozlowski
Quoted 12 lines · Nam Tran
Documentation/devicetree/bindings/leds/ti,lp5812.yaml new file +12
-0+ +description: | + The LP5812 is an I2C LED Driver that can support LED matrix 4x3. + For more product information please see the link below: + https://www.ti.com/product/LP5812#tech-docs + +properties: + compatible: + const: ti,lp5812 + + reg: + maxItems: 1Quoted 8 lines
Documentation/devicetree/bindings/leds/ti,lp5812.yaml line 28
Quoted 6 lines
Documentation/devicetree/bindings/leds/ti,lp5812.yaml new file +6
-0+ + "#address-cells": + const: 1 + + "#size-cells": + const: 0No need for supply?
Quoted 2 lines
Since the hardware uses an external power supply, we decide not to include the supply property in the binding.
So there is power supply? If so, must be in the binding. Bindings describe given hardware (LP5812), not your particular board/setup.
Quoted 22 lines
Quoted 13 lines
Quoted 13 lines
Documentation/devicetree/bindings/leds/ti,lp5812.yaml new file +12
-0+ +patternProperties: + "^led@[0-9a-b]$": + type: object + $ref: common.yaml# + unevaluatedProperties: false + + properties: + reg: + minimum: 0 + maximum: 0xb +Quoted 8 lines
Documentation/devicetree/bindings/leds/ti,lp5812.yaml line 43
Quoted 3 lines
Documentation/devicetree/bindings/leds/ti,lp5812.yaml new file +3
-0+ chan-name: + $ref: /schemas/types.yaml#/definitions/string + description: LED channel nameMy comment stay valid. I don't think LEDs have channels, datasheet also has nothing about channels, so again - use existing properties. Or better drop it - I don't see any point in the name. The reg already defines it.
Quoted 1 line
The channel was named for the output channel to each LED, not the LED channels.
I don't understand what you want to say. Please explain why existing label property is not correct here.
Quoted 1 line
They are not required properties because we can control entirely the LEDs of LP5812 through the indexes (regs property),
I did not ask about this.
Quoted 1 line
but the person who wants to develop LP5812's matrix-related features can use the "channels" for easy mapping.
easy mapping of what? Please show me the usage.
Quoted 9 lines
Quoted 6 lines
However after dropping this, your example has nodes with only reg - what's the point of them? Why no properties from
common.yamlare applicable? If they are not applicable, then the entire subnode should be dropped - you don't need them to describe the hardware.Actually, the "color" property can be applied, but the LP5812 is a matrix LED, so specifying a particular LED color is not necessary when developing LP5812 features.
This does not help me much and based on this I see no points in describing individual LEDs, because the only missing information is number of them but even that is fixed for given device, isn't it?
Best regards,
Krzysztof
Nam Tran
maintainerRe: [PATCH v5 1/5] dt-bindings: leds: add TI/National Semiconductor LP5812 LED Driver
Quoted 25 lines · Krzysztof Kozlowski
Quoted 24 lines · Nam Tran
Quoted 21 lines · Krzysztof Kozlowski
Quoted 8 lines · Nam Tran
Documentation/devicetree/bindings/leds/ti,lp5812.yaml new file +8
-0+ +description: | + The LP5812 is an I2C LED Driver that can support LED matrix 4x3. + For more product information please see the link below: + https://www.ti.com/product/LP5812#tech-docs + +properties: + compatible:Documentation/devicetree/bindings/leds/ti,lp5812.yaml line 28
Quoted 10 lines
Documentation/devicetree/bindings/leds/ti,lp5812.yaml new file +10
-0+ const: ti,lp5812 + + reg: + maxItems: 1 + + "#address-cells": + const: 1 + + "#size-cells": + const: 0No need for supply?
Quoted 5 lines
Quoted 2 lines
Since the hardware uses an external power supply, we decide not to include the supply property in the binding.
So there is power supply? If so, must be in the binding. Bindings describe given hardware (LP5812), not your particular board/setup.
Thank you for the clarification.
The LP5812 is externally powered and has a dedicated VCC pin. I'll update the binding to include a vcc-supply property.
Quoted 22 lines
Quoted 22 lines
Quoted 21 lines
Quoted 6 lines
Documentation/devicetree/bindings/leds/ti,lp5812.yaml new file +5
-0+ +patternProperties: + "^led@[0-9a-b]$": + type: object + $ref: common.yaml#Documentation/devicetree/bindings/leds/ti,lp5812.yaml line 43
Quoted 10 lines
Documentation/devicetree/bindings/leds/ti,lp5812.yaml new file +10
-0+ unevaluatedProperties: false + + properties: + reg: + minimum: 0 + maximum: 0xb + + chan-name: + $ref: /schemas/types.yaml#/definitions/string + description: LED channel nameMy comment stay valid. I don't think LEDs have channels, datasheet also has nothing about channels, so again - use existing properties. Or better drop it - I don't see any point in the name. The reg already defines it.
Quoted 4 lines
Quoted 1 line
The channel was named for the output channel to each LED, not the LED channels.
I don't understand what you want to say. Please explain why existing label property is not correct here.
I understand that the label property is deprecated and that the preferred approach now is to use function and color instead. However, in the case of the LP5812, which is a matrix LED driver, these properties are not a good fit. The LP5812 does not associate each output with a specific function (like "status", "activity"),
and the LEDs driven by LP5812 are not fixed to a particular color.
Quoted 3 lines
Quoted 1 line
but the person who wants to develop LP5812's matrix-related features can use the "channels" for easy mapping.
easy mapping of what? Please show me the usage.
You're right — I cannot provide a meaningful usage example for chan-name.
The chan-name property was intended to give a more descriptive name for each LED channel, mainly for convenience in user space. But since this isn’t standard and you advised against introducing such a property, we’ve decided to drop it.
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
However after dropping this, your example has nodes with only reg - what's the point of them? Why no properties from
common.yamlare applicable? If they are not applicable, then the entire subnode should be dropped - you don't need them to describe the hardware.
Quoted 6 lines
Quoted 2 lines
Actually, the "color" property can be applied, but the LP5812 is a matrix LED, so specifying a particular LED color is not necessary when developing LP5812 features.
This does not help me much and based on this I see no points in describing individual LEDs, because the only missing information is number of them but even that is fixed for given device, isn't it?
Actually, the number of LED outputs on the LP5812 is not strictly fixed — it depends on the selected operating mode. This mode is configurable by the end user at runtime through sysfs interfaces provided by the driver.
I understand your point — if no additional properties from common.yaml are applicable, these subnodes may not be necessary. Therefore, we’ve decided to drop them.
Best regards,
Nam Tran
Re: [PATCH v5 1/5] dt-bindings: leds: add TI/National Semiconductor LP5812 LED Driver
Quoted 25 lines · Nam Tran
Quoted 25 lines
Quoted 24 lines
Quoted 14 lines
Quoted 14 lines
Documentation/devicetree/bindings/leds/ti,lp5812.yaml new file +12
-0+ +patternProperties: + "^led@[0-9a-b]$": + type: object + $ref: common.yaml# + unevaluatedProperties: false + + properties: + reg: + minimum: 0 + maximum: 0xb +Quoted 8 lines
Documentation/devicetree/bindings/leds/ti,lp5812.yaml line 43
Quoted 3 lines
Documentation/devicetree/bindings/leds/ti,lp5812.yaml new file +3
-0+ chan-name: + $ref: /schemas/types.yaml#/definitions/string + description: LED channel nameMy comment stay valid. I don't think LEDs have channels, datasheet also has nothing about channels, so again - use existing properties. Or better drop it - I don't see any point in the name. The reg already defines it.
The channel was named for the output channel to each LED, not the LED channels.
Quoted 7 lines
Quoted 2 lines
I don't understand what you want to say. Please explain why existing label property is not correct here.
I understand that the label property is deprecated and that the preferred approach now is to use function and color instead. However, in the case of the LP5812, which is a matrix LED driver, these properties are not a good fit. The LP5812 does not associate each output with a specific function (like "status", "activity"),
and the LEDs driven by LP5812 are not fixed to a particular color.
Then use label instead of creating another property. If label is deprecated, how creating another property which duplicates the label solves anything?
Best regards,
Krzysztof
Nam Tran
maintainerRe: [PATCH v5 1/5] dt-bindings: leds: add TI/National Semiconductor LP5812 LED Driver
Quoted 29 lines · Krzysztof Kozlowski
Quoted 28 lines · Nam Tran
Quoted 27 lines
Quoted 23 lines
Quoted 14 lines
Quoted 14 lines
Documentation/devicetree/bindings/leds/ti,lp5812.yaml new file +12
-0+ +patternProperties: + "^led@[0-9a-b]$": + type: object + $ref: common.yaml# + unevaluatedProperties: false + + properties: + reg: + minimum: 0 + maximum: 0xb +Quoted 8 lines
Documentation/devicetree/bindings/leds/ti,lp5812.yaml line 43
Quoted 3 lines
Documentation/devicetree/bindings/leds/ti,lp5812.yaml new file +3
-0+ chan-name: + $ref: /schemas/types.yaml#/definitions/string + description: LED channel nameMy comment stay valid. I don't think LEDs have channels, datasheet also has nothing about channels, so again - use existing properties. Or better drop it - I don't see any point in the name. The reg already defines it.
Quoted 1 line
The channel was named for the output channel to each LED, not the LED channels.
I don't understand what you want to say. Please explain why existing label property is not correct here.
Quoted 8 lines
Quoted 4 lines
I understand that the label property is deprecated and that the preferred approach now is to use function and color instead. However, in the case of the LP5812, which is a matrix LED driver, these properties are not a good fit. The LP5812 does not associate each output with a specific function (like "status", "activity"),
and the LEDs driven by LP5812 are not fixed to a particular color.Then use label instead of creating another property. If label is deprecated, how creating another property which duplicates the label solves anything?
You're right — creating a new property like chan-name does not help
if it duplicates the purpose of the deprecated label property.
I initially created the chan-name property after referring to the existing leds-lp55xx.yaml binding.
However, based on your recommendation, I’ve decided to drop chan-name and the entire subnode as well. Additionally, I will add the vcc-supply property as mentioned in the last email.
Would this be sufficient for me to submit a new patch?
Best regards,
Nam Tran
Nam Tran
maintainerPATCH v5 2/5 leds: add TI/National Semiconductor LP5812 LED Driver
In reply to Nam TranThe LP5812 is a 4×3 matrix RGB LED driver
with an autonomous animation engine
and time-cross-multiplexing (TCM) support for up to 12 LEDs. Each LED can be configured through the related registers to realize vivid and fancy lighting effects.
--- MAINTAINERS | 4 + drivers/leds/Kconfig | 16 + drivers/leds/Makefile | 1 + drivers/leds/leds-lp5812.c | 2797 ++++++++++++++++++++++++++++++++++++ drivers/leds/leds-lp5812.h | 350 +++++ 5 files changed, 3168 insertions(+) create mode 100644 drivers/leds/leds-lp5812.c create mode 100644 drivers/leds/leds-lp5812.h
MAINTAINERS +4 -0
@@ -23939,6 +23939,10 @@ M: Nam Tran <[email protected]> L: [email protected] S: Maintained F: Documentation/devicetree/bindings/leds/ti,lp5812.yaml +F: drivers/leds/Kconfig +F: drivers/leds/Makefile +F: drivers/leds/leds-lp5812.c +F: drivers/leds/leds-lp5812.h TEXAS INSTRUMENTS' LB8864 LED BACKLIGHT DRIVER M: Alexander Sverdlin <[email protected]>
drivers/leds/Kconfig +16 -0
@@ -483,6 +483,22 @@ config LEDS_LP5569 Driver provides direct control via LED class and interface for programming the engines. +config LEDS_LP5812 + tristate "Enable LP5812 support LED matrix 4x3" + depends on LEDS_CLASS && I2C + depends on LEDS_CLASS_MULTICOLOR + help + If you say Y here you get support for TI LP5812 LED driver. + + The LP5812 is an I2C-based RGB LED driver that supports a 4x3 LED matrix. + It provides independent brightness control and color mixing for each LED. + This driver integrates with the Linux LED framework and LED multicolor class. + + To compile this driver as a module, choose M here: the + module will be called leds-lp5812. + + If unsure, say N. + config LEDS_LP8501 tristate "LED Support for TI LP8501 LED driver chip" depends on LEDS_CLASS && I2C
drivers/leds/Makefile +1 -0
@@ -54,6 +54,7 @@ obj-$(CONFIG_LEDS_LP5523) += leds-lp5523.o obj-$(CONFIG_LEDS_LP5562) += leds-lp5562.o obj-$(CONFIG_LEDS_LP5569) += leds-lp5569.o obj-$(CONFIG_LEDS_LP55XX_COMMON) += leds-lp55xx-common.o +obj-$(CONFIG_LEDS_LP5812) += leds-lp5812.o obj-$(CONFIG_LEDS_LP8501) += leds-lp8501.o obj-$(CONFIG_LEDS_LP8788) += leds-lp8788.o obj-$(CONFIG_LEDS_LP8860) += leds-lp8860.o
drivers/leds/leds-lp5812.c new file +2797 -0
2,797 lines not on this page · raw message
drivers/leds/leds-lp5812.h new file +350 -0
164 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.25.1
Part of the diff is not shown here. View the raw message.
Nam Tran
maintainerPATCH v5 3/5 docs: ABI: Document LP5812 LED sysfs interfaces
In reply to Nam TranThe LP5812 is a 4 × 3 matrix RGB LED driver
with autonomous animation engine control.
The driver provides interfaces to configure
LED modes manual/autonomous, set PWM/DC values,
and manage autonomous animation engines.
--- .../ABI/testing/sysfs-bus-i2c-devices-lp5812 | 144 ++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 145 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-i2c-devices-lp5812
Documentation/ABI/testing/sysfs-bus-i2c-devices-lp5812 new file +144 -0
@@ -0,0 +1,144 @@ +What: /sys/bus/i2c/devices/.../lp5812_chip_setup/device_enable +Date: May 2025 +KernelVersion: 6.16 +Contact: Nam Tran <[email protected]> +Description: + Enables or disables the LP5812 device. (RW) + 0 - Disable + 1 - Enable + +What: /sys/bus/i2c/devices/.../lp5812_chip_setup/dev_config +Date: May 2025 +KernelVersion: 6.16 +Contact: Nam Tran <[email protected]> +Description: + Configures drive mode and scan order. (RW) + 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/device_command +Date: May 2025 +KernelVersion: 6.16 +Contact: Nam Tran <[email protected]> +Description: + Issues device-level commands. (WO) + Valid values: "update", "start", "stop", "pause", "continue" + +What: /sys/bus/i2c/devices/.../lp5812_chip_setup/sw_reset +Date: May 2025 +KernelVersion: 6.16 +Contact: Nam Tran <[email protected]> +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: May 2025 +KernelVersion: 6.16 +Contact: Nam Tran <[email protected]> +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: May 2025 +KernelVersion: 6.16 +Contact: Nam Tran <[email protected]> +Description: + Report the current thermal shutdown config status. (RO) + +What: /sys/bus/i2c/devices/.../led_<id>/activate +Date: May 2025 +KernelVersion: 6.16 +Contact: Nam Tran <[email protected]> +Description: + Activate or deactivate the specified LED channel. (RW) + 1 - Activate + 0 - Deactivate + +What: /sys/bus/i2c/devices/.../led_<id>/mode +Date: May 2025 +KernelVersion: 6.16 +Contact: Nam Tran <[email protected]> +Description: + Selects LED operation mode. (RW) + Valid values: "manual", "autonomous" + +What: /sys/bus/i2c/devices/.../led_<id>/manual_dc +Date: May 2025 +KernelVersion: 6.16 +Contact: Nam Tran <[email protected]> +Description: + DC current level in manual mode. (RW) + Valid values: 0 - 255 + +What: /sys/bus/i2c/devices/.../led_<id>/manual_pwm +Date: May 2025 +KernelVersion: 6.16 +Contact: Nam Tran <[email protected]> +Description: + PWM duty cycle in manual mode. (RW) + Valid values: 0 - 255 + +What: /sys/bus/i2c/devices/.../led_<id>/autonomous_dc +Date: May 2025 +KernelVersion: 6.16 +Contact: Nam Tran <[email protected]> +Description: + DC current level used in autonomous mode. (RW) + Valid values: 0 - 255 + +What: /sys/bus/i2c/devices/.../led_<id>/autonomous_dc +Date: May 2025 +KernelVersion: 6.16 +Contact: Nam Tran <[email protected]> +Description: + DC current level used in autonomous mode. (RW) + Valid values: 0 - 255 + +What: /sys/bus/i2c/devices/.../led_<id>/pwm_dimming_scale +Date: May 2025 +KernelVersion: 6.16 +Contact: Nam Tran <[email protected]> +Description: + PWM dimming scale type. (RW) + Valid values: "linear", "exponential" + +What: /sys/bus/i2c/devices/.../led_<id>/pwm_phase_align +Date: May 2025 +KernelVersion: 6.16 +Contact: Nam Tran <[email protected]> +Description: + Configures PWM phase alignment. (RW) + Valid values: "forward", "middle", "backward" + +What: /sys/bus/i2c/devices/.../led_<id>/autonomous_animation +Date: May 2025 +KernelVersion: 6.16 +Contact: Nam Tran <[email protected]> +Description: + Controls AEU configuration and playback. (RW) + Format: (aeu number):(start pause time):(stop pause time):(playback time) + with aeu number 1, 2, 3; playback time 0 - 15 + +What: /sys/bus/i2c/devices/.../led_<id>/aep_status +Date: May 2025 +KernelVersion: 6.16 +Contact: Nam Tran <[email protected]> +Description: + Shows current animation pattern status, value from 0 to 7. (RO) + +What: /sys/bus/i2c/devices/.../led_<id>/auto_pwm_val +Date: May 2025 +KernelVersion: 6.16 +Contact: Nam Tran <[email protected]> +Description: + Shows the pwm value in autonomous mode when pause the animation, value from 0 to 255. (RO) + +What: /sys/bus/i2c/devices/.../led_<id>/lod_lsd +Date: May 2025 +KernelVersion: 6.16 +Contact: Nam Tran <[email protected]> +Description: + 0 0 mean no lod and lsd fault detected, 1 1 mean lod and lsd fault detected (RO)
MAINTAINERS +1 -0
@@ -23938,6 +23938,7 @@ TEXAS INSTRUMENTS' LP5812 LED DRIVER M: Nam Tran <[email protected]> L: [email protected] S: Maintained +F: Documentation/ABI/testing/sysfs-bus-i2c-devices-lp5812 F: Documentation/devicetree/bindings/leds/ti,lp5812.yaml F: drivers/leds/Kconfig F: drivers/leds/Makefile
Signature · 1 line
2.25.1
Nam Tran
maintainerPATCH v5 4/5 docs: leds: Document TI LP5812 LED driver
In reply to Nam TranThe 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.
--- Documentation/leds/leds-lp5812.rst | 79 ++++++++++++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 80 insertions(+) create mode 100644 Documentation/leds/leds-lp5812.rst
Documentation/leds/leds-lp5812.rst new file +79 -0
@@ -0,0 +1,79 @@ +======================== +Kernel driver for lp5812 +======================== + +* TI/National Semiconductor LP5812 LED Driver +* Datasheet: https://www.ti.com/product/LP5812#tech-docs + +Authors: Jared Zhou <[email protected]> + +Description +=========== + +The LP5812 is a 4x3 maxtrix 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: + - device_enable: Enable/disable the device (RW) + - 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/bus/i2c/devices/<i2c-dev-addr>/led_<id>/ + +Each LED exposes the following attributes: + - activate: Activate or deactivate the LED (RW) + - mode: manual or autonomous mode (RW) + - manual_dc: DC current value (0–255) (RW) + - manual_pwm: PWM duty cycle (0–255) (RW) + - autonomous_dc: DC current in autonomous mode (RW) + - pwm_dimming_scale: linear or exponential (RW) + - pwm_phase_align: PWM alignment mode (RW) + - autonomous_animation: Config autonomous animation mode with aeu number, start pause time, stop pause time, playback time (RW) + - aep_status: autonomous engine pattern status (RO) + - auto_pwm_val: pwm value in autonomous mode when pause the animation (RO) + - lod_lsd: lod and lsd fault detected status (RO) + +Example Usage +============= + +To control led_A0 in manual mode:: + echo 1 > /sys/bus/i2c/drivers/lp5812/xxxx/lp5812_chip_setup/device_enable + echo 1 > /sys/bus/i2c/drivers/lp5812/xxxx/led_A0/activate + echo manual > /sys/bus/i2c/drivers/lp5812/xxxx/led_A0/mode + echo 100 > /sys/bus/i2c/drivers/lp5812/xxxx/led_A0/manual_dc + echo 100 > /sys/bus/i2c/drivers/lp5812/xxxx/led_A0/manual_pwm + +To control led_A0 in autonomous mode:: + echo 1 > /sys/bus/i2c/drivers/lp5812/xxxx/lp5812_chip_setup/device_enable + echo 1 > /sys/bus/i2c/drivers/lp5812/xxxx/led_A0/activate + echo autonomous > /sys/bus/i2c/drivers/lp5812/xxxx/led_A0/mode + echo 1:10:10:15 > /sys/bus/i2c/drivers/lp5812/xxxx/led_A0/autonomous_animation + echo 100 > /sys/bus/i2c/drivers/lp5812/xxxx/led_A0/AEU1/pwm1 + echo 100 > /sys/bus/i2c/drivers/lp5812/xxxx/led_A0/AEU1/pwm2 + echo 100 > /sys/bus/i2c/drivers/lp5812/xxxx/led_A0/AEU1/pwm3 + echo 100 > /sys/bus/i2c/drivers/lp5812/xxxx/led_A0/AEU1/pwm4 + echo 100 > /sys/bus/i2c/drivers/lp5812/xxxx/led_A0/AEU1/pwm5 + echo 5 > /sys/bus/i2c/drivers/lp5812/xxxx/led_A0/AEU1/slope_time_t1 + echo 5 > /sys/bus/i2c/drivers/lp5812/xxxx/led_A0/AEU1/slope_time_t2 + echo 5 > /sys/bus/i2c/drivers/lp5812/xxxx/led_A0/AEU1/slope_time_t3 + echo 5 > /sys/bus/i2c/drivers/lp5812/xxxx/led_A0/AEU1/slope_time_t4 + echo 1 > /sys/bus/i2c/drivers/lp5812/xxxx/led_A0/AEU1/playback_time + echo start > /sys/bus/i2c/drivers/lp5812/xxxx/lp5812_chip_setup/device_command
MAINTAINERS +1 -0
@@ -23940,6 +23940,7 @@ L: [email protected] S: Maintained F: Documentation/ABI/testing/sysfs-bus-i2c-devices-lp5812 F: Documentation/devicetree/bindings/leds/ti,lp5812.yaml +F: Documentation/leds/leds-lp5812.rst F: drivers/leds/Kconfig F: drivers/leds/Makefile F: drivers/leds/leds-lp5812.c
Signature · 1 line
2.25.1
Nam Tran
maintainerPATCH v5 5/5 arm64: dts: Add LP5812 LED node for Raspberry Pi 4 Model B
In reply to Nam TranAdd the LP5812 LED driver node to the Device Tree for Raspberry Pi 4 B. This enables the LED connected to the LP5812 to be controlled via I2C.
--- .../arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+)
arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts +60 -0
@@ -152,6 +152,66 @@ &hdmi1 { status = "okay"; }; +&i2c1 { + #address-cells = <1>; + #size-cells = <0>; + + led-controller@1b { + compatible = "ti,lp5812"; + reg = <0x1b>; + #address-cells = <1>; + #size-cells = <0>; + led@0 { + reg = <0x0>; + chan-name = "a0"; + }; + led@1 { + reg = <0x1>; + chan-name = "a1"; + }; + led@2 { + reg = <0x2>; + chan-name = "a2"; + }; + led@3 { + reg = <0x3>; + chan-name = "b0"; + }; + led@4 { + reg = <0x4>; + chan-name = "b1"; + }; + led@5 { + reg = <0x5>; + chan-name = "b2"; + }; + led@6 { + reg = <0x6>; + chan-name = "c0"; + }; + led@7 { + reg = <0x7>; + chan-name = "c1"; + }; + led@8 { + reg = <0x8>; + chan-name = "c2"; + }; + led@9 { + reg = <0x9>; + chan-name = "d0"; + }; + led@a { + reg = <0xa>; + chan-name = "d1"; + }; + led@b { + reg = <0xb>; + chan-name = "d2"; + }; + }; +}; + &led_act { gpios = <&gpio 42 GPIO_ACTIVE_HIGH>; };
Signature · 1 line
2.25.1
Re: [PATCH v5 5/5] arm64: dts: Add LP5812 LED node for Raspberry Pi 4 Model B
Quoted 13 lines · Nam Tran
Add the LP5812 LED driver node to the Device Tree for Raspberry Pi 4 B. This enables the LED connected to the LP5812 to be controlled via I2C.
Signed-off-by Nam Tran <[email protected]>--- .../arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+)arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts +0
-0
arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts &hdmi1 { · line 161
Quoted 10 lines
arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts +7
-0@@ -152,6 +152,66 @@ &hdmi1 { status = "okay"; }; +&i2c1 { + #address-cells = <1>; + #size-cells = <0>; + + led-controller@1b { + compatible = "ti,lp5812"; + reg = <0x1b>;
Messed indentation... You already got such comment about your DTS in the binding. :/
Best regards,
Krzysztof
Nam Tran
maintainerRe: [PATCH v5 5/5] arm64: dts: Add LP5812 LED node for Raspberry Pi 4 Model B
Quoted 17 lines · Krzysztof Kozlowski
Quoted 16 lines · Nam Tran
Add the LP5812 LED driver node to the Device Tree for Raspberry Pi 4 B. This enables the LED connected to the LP5812 to be controlled via I2C.
Signed-off-by Nam Tran <[email protected]>--- .../arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+)arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts +0
-0@@ -152,6 +152,66 @@ &hdmi1 { status = "okay"; };
Quoted 10 lines
arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts &hdmi1 { · line 161
Quoted 7 lines
arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts +7
-0+&i2c1 { + #address-cells = <1>; + #size-cells = <0>; + + led-controller@1b { + compatible = "ti,lp5812"; + reg = <0x1b>;Messed indentation... You already got such comment about your DTS in the binding. :/
Thank you for pointing it out. I fixed the indentation in the binding file but overlooked it here. I'll make sure it's corrected in the next version.
Best regards,
Nam Tran
Quoted 10 lines · Nam Tran
This patch series adds support for the TI/National Semiconductor LP5812 4x3 matrix RGB LED driver. The driver supports features such as autonomous animation and time-cross-multiplexing (TCM) for dynamic LED effects.
Signed-off-by Nam Tran <[email protected]>---
Changes in v5:
- Rebase on v6.15-rc2
- Removed unused functions (lp5812_dump_regs,lp5812_update_bit).
- Address Krzysztof's review comments
Which ones? What changed?
Best regards,
Krzysztof
Nam Tran
maintainerQuoted 5 lines · Krzysztof Kozlowski
Quoted 4 lines · Nam Tran
This patch series adds support for the TI/National Semiconductor LP5812 4x3 matrix RGB LED driver. The driver supports features such as autonomous animation and time-cross-multiplexing (TCM) for dynamic LED effects.
Quoted 7 lines
Quoted 6 lines
Signed-off-by Nam Tran <[email protected]>---
Changes in v5:
- Rebase on v6.15-rc2
- Removed unused functions (lp5812_dump_regs,lp5812_update_bit).
- Address Krzysztof's review commentsWhich ones? What changed?
Apologies for the delayed reply.
I’ve updated the ABI document based on your previous comments.
Regarding the binding, I’ve removed redundant descriptions and fixed the indentation as you pointed out.
I’ll make sure to describe the changes more clearly in the next patch submission.
Best regards,
Nam Tran