summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChaosheng Qu <quchaosheng000406@163.com>2026-09-30 10:39:23 +0800
committerLee Jones <lee@kernel.org>2026-10-02 11:08:51 +0100
commit88e0bfab55e131fb2179dc3eee5893e9f638926b (patch)
tree3266b3ab9dd829f2553a151d93da1bad2ffc17ff
parent1d53aa3f574b77525a39c5d9c5a32882c6f699e7 (diff)
dt-bindings: mfd: Convert lp3943 to DT schema
Convert the LP3943 MFD binding from free-form text to DT schema. The LP3943 is an I2C LED driver with two sub-devices, lp3943-gpio and lp3943-pwm. The GPIO sub-device is covered by trivial-gpio.yaml, so only the PWM sub-device gets a schema of its own. The PWM schema documents ti,pwm0 and ti,pwm1, which select the output pins of the two internal PWM channels and are read by pwm-lp3943.c with of_property_read_u32_array(). Assisted-by: LLM Signed-off-by: Chaosheng Qu <quchaosheng000406@163.com> Reviewed-by: Rob Herring (Arm) <robh@kernel.org> Acked-by: Uwe Kleine-König <ukleinek@kernel.org> Link: https://patch.msgid.link/20260930023923.49917-1-quchaosheng000406@163.com Signed-off-by: Lee Jones <lee@kernel.org>
-rw-r--r--Documentation/devicetree/bindings/mfd/lp3943.txt33
-rw-r--r--Documentation/devicetree/bindings/mfd/ti,lp3943.yaml64
-rw-r--r--Documentation/devicetree/bindings/pwm/pwm-lp3943.txt58
-rw-r--r--Documentation/devicetree/bindings/pwm/pwm-lp3943.yaml80
4 files changed, 144 insertions, 91 deletions
diff --git a/Documentation/devicetree/bindings/mfd/lp3943.txt b/Documentation/devicetree/bindings/mfd/lp3943.txt
deleted file mode 100644
index ca5324ed0df4..000000000000
--- a/Documentation/devicetree/bindings/mfd/lp3943.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-TI/National Semiconductor LP3943 MFD driver
-
-Required properties:
- - compatible: "ti,lp3943"
- - reg: I2C slave address. From 0x60 to 0x67.
-
-LP3943 consists of two sub-devices, lp3943-gpio and lp3943-pwm.
-
-For the LP3943 GPIO properties please refer to:
-Documentation/devicetree/bindings/gpio/trivial-gpio.yaml
-
-For the LP3943 PWM properties please refer to:
-Documentation/devicetree/bindings/pwm/pwm-lp3943.txt
-
-Example:
-
-lp3943@60 {
- compatible = "ti,lp3943";
- reg = <0x60>;
-
- gpioex: gpio {
- compatible = "ti,lp3943-gpio";
- gpio-controller;
- #gpio-cells = <2>;
- };
-
- pwm3943: pwm {
- compatible = "ti,lp3943-pwm";
- #pwm-cells = <2>;
- ti,pwm0 = <8 9 10>;
- ti,pwm1 = <15>;
- };
-};
diff --git a/Documentation/devicetree/bindings/mfd/ti,lp3943.yaml b/Documentation/devicetree/bindings/mfd/ti,lp3943.yaml
new file mode 100644
index 000000000000..eff32b05c21c
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/ti,lp3943.yaml
@@ -0,0 +1,64 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/ti,lp3943.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TI/National Semiconductor LP3943 MFD driver
+
+maintainers:
+ - Chaosheng Qu <quchaosheng000406@163.com>
+
+description:
+ LP3943 is an integrated device capable of driving LEDs. It contains two
+ sub-devices, lp3943-gpio and lp3943-pwm, which are instantiated by the MFD
+ core from the child nodes described below.
+
+properties:
+ compatible:
+ const: ti,lp3943
+
+ reg:
+ maxItems: 1
+ description: I2C slave address, from 0x60 to 0x67
+
+patternProperties:
+ "^gpio":
+ type: object
+ $ref: /schemas/gpio/trivial-gpio.yaml#
+
+ "^pwm":
+ type: object
+ $ref: /schemas/pwm/pwm-lp3943.yaml#
+
+required:
+ - compatible
+ - reg
+
+additionalProperties: false
+
+examples:
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ lp3943: gpio@60 {
+ compatible = "ti,lp3943";
+ reg = <0x60>;
+
+ gpio {
+ compatible = "ti,lp3943-gpio";
+ gpio-controller;
+ #gpio-cells = <2>;
+ };
+
+ pwm {
+ compatible = "ti,lp3943-pwm";
+ #pwm-cells = <2>;
+ ti,pwm0 = <8 9 10>;
+ ti,pwm1 = <15>;
+ };
+ };
+ };
+...
diff --git a/Documentation/devicetree/bindings/pwm/pwm-lp3943.txt b/Documentation/devicetree/bindings/pwm/pwm-lp3943.txt
deleted file mode 100644
index f214305a8f5e..000000000000
--- a/Documentation/devicetree/bindings/pwm/pwm-lp3943.txt
+++ /dev/null
@@ -1,58 +0,0 @@
-TI/National Semiconductor LP3943 PWM controller
-
-Required properties:
- - compatible: "ti,lp3943-pwm"
- - #pwm-cells: Should be 2. See pwm.yaml in this directory for a
- description of the cells format.
- Note that this hardware limits the period length to the
- range 6250~1600000.
- - ti,pwm0 or ti,pwm1: Output pin number(s) for PWM channel 0 or 1.
- 0 = output 0
- 1 = output 1
- .
- .
- 15 = output 15
-
-Example:
-PWM 0 is for RGB LED brightness control
-PWM 1 is for brightness control of LP8557 backlight device
-
-&i2c3 {
- lp3943@60 {
- compatible = "ti,lp3943";
- reg = <0x60>;
-
- /*
- * PWM 0 : output 8, 9 and 10
- * PWM 1 : output 15
- */
- pwm3943: pwm {
- compatible = "ti,lp3943-pwm";
- #pwm-cells = <2>;
- ti,pwm0 = <8 9 10>;
- ti,pwm1 = <15>;
- };
- };
-
-};
-
-/* LEDs control with PWM 0 of LP3943 */
-pwmleds {
- compatible = "pwm-leds";
- rgb {
- label = "indi::rgb";
- pwms = <&pwm3943 0 10000>;
- max-brightness = <255>;
- };
-};
-
-&i2c4 {
- /* Backlight control with PWM 1 of LP3943 */
- backlight@2c {
- compatible = "ti,lp8557";
- reg = <0x2c>;
-
- pwms = <&pwm3943 1 10000>;
- pwm-names = "lp8557";
- };
-};
diff --git a/Documentation/devicetree/bindings/pwm/pwm-lp3943.yaml b/Documentation/devicetree/bindings/pwm/pwm-lp3943.yaml
new file mode 100644
index 000000000000..3da5cd4b2ada
--- /dev/null
+++ b/Documentation/devicetree/bindings/pwm/pwm-lp3943.yaml
@@ -0,0 +1,80 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pwm/pwm-lp3943.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TI/National Semiconductor LP3943 PWM controller
+
+maintainers:
+ - Chaosheng Qu <quchaosheng000406@163.com>
+
+description:
+ LP3943 has two internal PWM channels. Each channel can be routed to one or
+ more of the 16 outputs of the device.
+
+ Note that the hardware limits the period length to the range 6250~1600000.
+
+allOf:
+ - $ref: pwm.yaml#
+
+properties:
+ compatible:
+ const: ti,lp3943-pwm
+
+ "#pwm-cells":
+ const: 2
+
+ ti,pwm0:
+ description: Output pin number(s) for PWM channel 0.
+ $ref: /schemas/types.yaml#/definitions/uint32-array
+ minItems: 1
+ maxItems: 16
+ items:
+ minimum: 0
+ maximum: 15
+
+ ti,pwm1:
+ description: Output pin number(s) for PWM channel 1.
+ $ref: /schemas/types.yaml#/definitions/uint32-array
+ minItems: 1
+ maxItems: 16
+ items:
+ minimum: 0
+ maximum: 15
+
+anyOf:
+ - required:
+ - ti,pwm0
+ - required:
+ - ti,pwm1
+
+required:
+ - compatible
+ - "#pwm-cells"
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ gpio@60 {
+ compatible = "ti,lp3943";
+ reg = <0x60>;
+
+ /*
+ * PWM 0 : output 8, 9 and 10
+ * PWM 1 : output 15
+ */
+ pwm {
+ compatible = "ti,lp3943-pwm";
+ #pwm-cells = <2>;
+ ti,pwm0 = <8 9 10>;
+ ti,pwm1 = <15>;
+ };
+ };
+ };
+...