[PATCH 2/2] dt-bindings: leds: Add binding for ti,lp5816
Alistair Bell <[email protected]> Sun, 12 Jul 2026 19:43:18 +0100
| Newsgroups | org.kernel.vger.linux-leds |
|---|---|
| Message-ID | <[email protected]> |
Add devicetree binding for Texas Instruments LP5816 4-channel I2C LED device. Signed-off-by: Alistair Bell <[email protected]> --- .../ABI/testing/sysfs-class-leds-lp5816 | 123 ++++++++++++++++++ .../devicetree/bindings/leds/ti,lp5816.yaml | 45 +++++++ MAINTAINERS | 2 + 3 files changed, 170 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-class-leds-lp5816 create mode 100644 Documentation/devicetree/bindings/leds/ti,lp5816.yaml diff --git a/Documentation/ABI/testing/sysfs-class-leds-lp5816 b/Documentation/ABI/testing/sysfs-class-leds-lp5816 new file mode 100644 index 000000000..2d1fd107a --- /dev/null +++ b/Documentation/ABI/testing/sysfs-class-leds-lp5816 @@ -0,0 +1,123 @@ +What: /sys/class/leds/<device>/fade +Date: July 2026 +KernelVersion: 7.2 +Contact: <[email protected]> +Description: + Enables/disables hardware fading of each individual LED and sets transition duration + between an old intensity and new intensity + + Format: <enable_red> <enable_green> <enable_blue> <enable_white> <duration> + + Possible values for <enable> are: + + == ======= + 0 disable + 1 enable + == ======= + + Disable: The LED intensity will change instantaneous + Enable: The LED intensity will transition between the old and new value either + linearly or exponentially based on their individual fade_mode over a period + specified by <duration> + + Possible values for <duration> are: + + == ===== + 0 0.00s + 1 0.05s + 2 0.10s + 3 0.15s + 4 0.20s + 5 0.25s + 6 0.30s + 7 0.35s + 8 0.40s + 9 0.45s + 10 0.50s + 12 2.00s + 13 4.00s + 14 6.00s + 15 8.00s + == ===== + + Reading this attribute returns the current fade configuration in the same + format as writing to it + + Example: + + $ echo 0 1 0 1 14 > /sys/class/leds/<device>/fade + + Enables fade for the green and white channels whilst disabling red and blue. + Sets the duration to 6.0s + + $ cat /sys/class/leds/<device>/fade + 0 1 0 1 14 + + $ echo 0 1 0 0 > /sys/class/leds/<device>/multi_intensity + If the green LED is not already at full intensity you should notice it slowly getting + brighter until reaching 100% brightness after 6.0 seconds + + Notes: + By default the driver initialises all fade modes to be disabled and a duration + of 0.0s + + +What: /sys/class/leds/<device>/fade_mode +Date: July 2026 +KernelVersion: 7.2 +Contact: <[email protected]> +Description: + Sets the fade transition of each individual LED to either linear or exponential + + Format: <mode_red> <mode_green> <mode_blue> <mode_white> + + Possible values for <mode_> are: + + == =========== + 0 linear + 1 exponential + == =========== + + Linear: + + 100% | x + 80% | x + 60% | x + 40% | x + 20% | x + 0% |_____________ Time + 0 1 2 3 ... D + + Constant increase/decrease in LED intensity between 0.0s and <duration> + + Exponential: + + 100% | + 80% | x + 60% | x + 40% | x + 20% | x x x + 0% |_____________ Time + 0 1 2 3 ... D + + Initially only a small visible change from the initial intensity then + will appear to quickly and smoothly transition to the brightness target + + Example: + $ cat /sys/class/leds/<device>/fade_mode + 0 0 0 0 + + Notice the default configuration is all LEDs in linear mode + + $ echo 1 1 0 0 > /sys/class/leds/<device>/fade_mode + + Sets red and green to use exponential mode and blue and white to linear + + $ cat /sys/class/leds/<device>/fade_mode + 1 1 0 0 + + Configuration stored and returned in the same format as was written to + + Note: + If /sys/class/leds/<device>/fade is disabled on a specific color this configuration will + be saved for when fading is enabled diff --git a/Documentation/devicetree/bindings/leds/ti,lp5816.yaml b/Documentation/devicetree/bindings/leds/ti,lp5816.yaml new file mode 100644 index 000000000..d33489c30 --- /dev/null +++ b/Documentation/devicetree/bindings/leds/ti,lp5816.yaml @@ -0,0 +1,45 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/ti,lp5816.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Texas Instruments LP5816 4-Channel I2C RGBW LED Driver + +maintainers: + - Alistair Bell <[email protected]> + +description: | + The LP5816 is a 4-channel I2C interface RGBW LED driver from Texas Instruments. + It supports independent control of red, green, blue, and white leds with + configurable fade effects and dimming. + +properties: + compatible: + const: ti,lp5816 + description: | + Specifies device as LP5816 and the uses that kernel driver + + + reg: + maxItems: 1 + description: I2C slave address + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + i2c { + compatible = "vendor,i2c-controller"; + #address-cells = <1>; + #size-cells = <0>; + + led-controller@2c { + compatible = "ti,lp5816"; + reg = <0x2c>; + }; + }; diff --git a/MAINTAINERS b/MAINTAINERS index b6a8c812a..5835f929d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -26765,6 +26765,8 @@ TEXAS INSTRUMENTS' LP5816 RGBW LED DRIVER M: Alistair Bell <[email protected]> L: [email protected] S: Maintained +F: Documentation/ABI/testing/sysfs-class-leds-lp5816 +F: Documentation/devicetree/bindings/leds/ti,lp5816.yaml F: drivers/leds/Kconfig F: drivers/leds/Makefile F: drivers/leds/leds-lp5816.c -- 2.54.0