Skip to contentSkip to conversation

dt-bindings: leds: pca995x: Add binding document for PCA995X chips

PATCH Applied Marek Vasut 2 participants 3 messages Jul 13, 2023 – Jul 28, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v4 1/2 dt-bindings: leds: pca995x: Add binding document for PCA995X chips

The PCA995x chips are I2C controlled LED drivers. Each chip has up to 16 outputs, each one with an individual 8-bit resolution PWM for brightness control. Add binding document.

---
Cc: Conor Dooley <[email protected]>
Cc: Isai Gaspar <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Lee Jones <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Pavel Machek <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
V2: Fix the led@[0-9]+ match
V3: Unit addresses for leds@ are hex, add a-f into the glob
V4: Add RB from Rob

---
 .../devicetree/bindings/leds/nxp,pca995x.yaml | 81 +++++++++++++++++++
 1 file changed, 81 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/leds/nxp,pca995x.yaml
Documentation/devicetree/bindings/leds/nxp,pca995x.yaml new file +81 -0
new file mode 100644
index 0000000000000..654915c1f687f
@@ -0,0 +1,81 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/nxp,pca995x.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP PCA995x LED controllers
+
+maintainers:
+  - Isai Gaspar <[email protected]>
+  - Marek Vasut <[email protected]>
+
+description:
+  The NXP PCA9952/PCA9955B are programmable LED controllers connected via I2C
+  that can drive 16 separate lines. Each of them can be individually switched
+  on and off, and brightness can be controlled via individual PWM.
+
+  Datasheets are available at
+  https://www.nxp.com/docs/en/data-sheet/PCA9952_PCA9955.pdf
+  https://www.nxp.com/docs/en/data-sheet/PCA9955B.pdf
+
+properties:
+  compatible:
+    enum:
+      - nxp,pca9952
+      - nxp,pca9955b
+
+  reg:
+    maxItems: 1
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+patternProperties:
+  "^led@[0-9a-f]+$":
+    type: object
+    $ref: common.yaml#
+    unevaluatedProperties: false
+
+    properties:
+      reg:
+        minimum: 0
+        maximum: 15
+
+    required:
+      - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/leds/common.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        led-controller@1 {
+            compatible = "nxp,pca9955b";
+            reg = <0x01>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            led@0 {
+                reg = <0x0>;
+                color = <LED_COLOR_ID_RED>;
+                function = LED_FUNCTION_POWER;
+            };
+
+            led@2 {
+                reg = <0x2>;
+                color = <LED_COLOR_ID_WHITE>;
+                function = LED_FUNCTION_STATUS;
+            };
+        };
+    };
+
+...
Signature · 1 line
2.40.1
#1 lore raw

PATCH v4 2/2 leds: pca995x: Add support for PCA995X chips

From: Isai Gaspar <[email protected]>

The PCA995x chips are I2C controlled LED drivers. Each chip has up to 16 outputs, each one with an individual 8-bit resolution PWM for brightness control.

---
Cc: Conor Dooley <[email protected]>
Cc: Isai Gaspar <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Lee Jones <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Pavel Machek <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
V2: - Fix pca995x_probe() type
- Fix device_get_match_data() cast
V3: - Drop of_match_ptr()
V4: - Macro cleanup (Lee)

---
 drivers/leds/Kconfig        |   9 ++
 drivers/leds/Makefile       |   1 +
 drivers/leds/leds-pca995x.c | 204 ++++++++++++++++++++++++++++++++++++
 3 files changed, 214 insertions(+)
 create mode 100644 drivers/leds/leds-pca995x.c
drivers/leds/Kconfig +9 -0
index 6046dfeca16fc..b92208eccdea9 100644
@@ -521,6 +521,15 @@ config LEDS_PCA963X
 	  LED driver chip accessed via the I2C bus. Supported
 	  devices include PCA9633 and PCA9634
 
+config LEDS_PCA995X
+	tristate "LED Support for PCA995x I2C chips"
+	depends on LEDS_CLASS
+	depends on I2C
+	help
+	  This option enables support for LEDs connected to PCA995x
+	  LED driver chips accessed via the I2C bus. Supported
+	  devices include PCA9955BTW, PCA9952TW and PCA9955TW.
+
 config LEDS_WM831X_STATUS
 	tristate "LED support for status LEDs on WM831x PMICs"
 	depends on LEDS_CLASS
drivers/leds/Makefile +1 -0
index d71f1226540c2..d7348e8bc019a 100644
@@ -72,6 +72,7 @@ obj-$(CONFIG_LEDS_OT200)		+= leds-ot200.o
 obj-$(CONFIG_LEDS_PCA9532)		+= leds-pca9532.o
 obj-$(CONFIG_LEDS_PCA955X)		+= leds-pca955x.o
 obj-$(CONFIG_LEDS_PCA963X)		+= leds-pca963x.o
+obj-$(CONFIG_LEDS_PCA995X)		+= leds-pca995x.o
 obj-$(CONFIG_LEDS_PM8058)		+= leds-pm8058.o
 obj-$(CONFIG_LEDS_POWERNV)		+= leds-powernv.o
 obj-$(CONFIG_LEDS_PWM)			+= leds-pwm.o
drivers/leds/leds-pca995x.c new file +204 -0

204 lines not on this page · raw message

Signature · 1 line
2.40.1
maintainer Applied
#2 lore raw
In reply to Marek Vasut
Quoted 5 lines · Marek Vasut

The PCA995x chips are I2C controlled LED drivers. Each chip has up to 16 outputs, each one with an individual 8-bit resolution PWM for brightness control. Add binding document.

Applied, thanks!

[1/2] dt-bindings: leds: pca995x: Add binding document for PCA995X chips

      commit: b851af1c064e65b49283945937ece5d93fadbdfa
[2/2] leds: pca995x: Add support for PCA995X chips
      commit: 6863b75a930513af1854f378f0a6a3a6a60fe8f9

--
Lee Jones [李琼斯]