Linux LED subsystem development
 help / color / mirror / Atom feed
From: Alistair Bell <dev@alistairbell.org>
To: linux-leds@vger.kernel.org
Cc: lee@kernel.org, pavel@kernel.org, Alistair Bell <dev@alistairbell.org>
Subject: [PATCH 2/2] dt-bindings: leds: Add binding for ti,lp5816
Date: Sun, 12 Jul 2026 19:43:18 +0100	[thread overview]
Message-ID: <20260712184318.78852-3-dev@alistairbell.org> (raw)
In-Reply-To: <20260712184318.78852-1-dev@alistairbell.org>

Add devicetree binding for Texas Instruments LP5816
4-channel I2C LED device.

Signed-off-by: Alistair Bell <dev@alistairbell.org>
---
 .../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: <dev@alistairbell.org>
+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: <dev@alistairbell.org>
+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 <dev@alistairbell.org>
+
+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 <dev@alistairbell.org>
 L:	linux-leds@vger.kernel.org
 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


  parent reply	other threads:[~2026-07-12 18:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-12 18:43 [PATCH 0/2] leds: Introduce Texas Instruments LP5816 LED driver Alistair Bell
2026-07-12 18:43 ` [PATCH 1/2] leds: Texas Instruments LP5816 driver Alistair Bell
2026-07-12 18:59   ` sashiko-bot
2026-07-12 22:16   ` Uwe Kleine-König
2026-07-13  6:05   ` Krzysztof Kozlowski
2026-07-12 18:43 ` Alistair Bell [this message]
2026-07-12 18:59   ` [PATCH 2/2] dt-bindings: leds: Add binding for ti,lp5816 sashiko-bot
2026-07-13  6:01   ` Krzysztof Kozlowski

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=20260712184318.78852-3-dev@alistairbell.org \
    --to=dev@alistairbell.org \
    --cc=lee@kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox