Skip to contentSkip to conversation

dt-bindings: regulator: convert ltc3589 to yaml format

PATCH In review Frank Li 3 participants 4 messages May 12 – Jul 14

Subsystems (3)
lore
Share & tools
lore

Frank Li

author maintainer
#0 lore raw

PATCH 1/1 dt-bindings: regulator: convert ltc3589 to yaml format

Convert the Linear Technology LTC3589/LTC3589-1/LTC3589-2 regulator binding from text to yaml format.

---
 .../bindings/regulator/lltc,ltc3589.yaml      | 147 ++++++++++++++++++
 .../devicetree/bindings/regulator/ltc3589.txt |  99 ------------
 2 files changed, 147 insertions(+), 99 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/regulator/lltc,ltc3589.yaml
 delete mode 100644 Documentation/devicetree/bindings/regulator/ltc3589.txt
Documentation/devicetree/bindings/regulator/lltc,ltc3589.yaml new file +147 -0
new file mode 100644
index 0000000000000..f406c2bd252d4
@@ -0,0 +1,147 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/lltc,ltc3589.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Linear Technology LTC3589, LTC3589-1, and LTC3589-2 8-output regulators
+
+maintainers:
+  - Frank Li <[email protected]>
+
+description:
+  Regulators sw1, sw2, sw3, and ldo2 can regulate the feedback reference from
+  0.3625 V to 0.75 V in 12.5 mV steps. The output voltage thus ranges between
+  0.3625 * (1 + R1/R2) V and 0.75 * (1 + R1/R2) V. Regulators bb-out and ldo1
+  have a fixed 0.8 V reference and thus output 0.8 * (1 + R1/R2) V. The ldo3
+  regulator is fixed to 1.8 V on LTC3589 and to 2.8 V on LTC3589-1,2. The ldo4
+  regulator can output between 1.8 V and 3.3 V on LTC3589 and between 1.2 V
+  and 3.2 V on LTC3589-1,2 in four steps. The ldo1 standby regulator can not
+  be disabled and thus should have the regulator-always-on property set.
+
+properties:
+  compatible:
+    enum:
+      - lltc,ltc3589
+      - lltc,ltc3589-1
+      - lltc,ltc3589-2
+
+  reg:
+    maxItems: 1
+
+  regulators:
+    type: object
+    description:
+      Contains eight regulator child nodes sw1, sw2, sw3, bb-out,
+      ldo1, ldo2, ldo3, and ldo4.
+
+    patternProperties:
+      "^(sw[1-3]|bb-out|ldo[1-2])$":
+        type: object
+        $ref: regulator.yaml#
+        unevaluatedProperties: false
+
+        properties:
+          lltc,fb-voltage-divider:
+            description:
+              An array of two integers containing the resistor values R1 and R2
+              of the feedback voltage divider in ohms.
+            $ref: /schemas/types.yaml#/definitions/uint32-array
+            items:
+              - description: R1 resistor value in ohms
+              - description: R2 resistor value in ohms
+
+        required:
+          - lltc,fb-voltage-divider
+
+      "^ldo[3-4]$":
+        type: object
+        $ref: regulator.yaml#
+        unevaluatedProperties: false
+
+    additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - regulators
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        pmic@34 {
+            compatible = "lltc,ltc3589-1";
+            reg = <0x34>;
+
+            regulators {
+                sw1 {
+                    regulator-min-microvolt = <591930>;
+                    regulator-max-microvolt = <1224671>;
+                    lltc,fb-voltage-divider = <100000 158000>;
+                    regulator-ramp-delay = <7000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+
+                sw2 {
+                    regulator-min-microvolt = <704123>;
+                    regulator-max-microvolt = <1456803>;
+                    lltc,fb-voltage-divider = <180000 191000>;
+                    regulator-ramp-delay = <7000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+
+                sw3 {
+                    regulator-min-microvolt = <1341250>;
+                    regulator-max-microvolt = <2775000>;
+                    lltc,fb-voltage-divider = <270000 100000>;
+                    regulator-ramp-delay = <7000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+
+                bb-out {
+                    regulator-min-microvolt = <3387341>;
+                    regulator-max-microvolt = <3387341>;
+                    lltc,fb-voltage-divider = <511000 158000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+
+                ldo1 {
+                    regulator-min-microvolt = <1306329>;
+                    regulator-max-microvolt = <1306329>;
+                    lltc,fb-voltage-divider = <100000 158000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+
+                ldo2 {
+                    regulator-min-microvolt = <704123>;
+                    regulator-max-microvolt = <1456806>;
+                    lltc,fb-voltage-divider = <180000 191000>;
+                    regulator-ramp-delay = <7000>;
+                    regulator-boot-on;
+                    regulator-always-on;
+                };
+
+                ldo3 {
+                    regulator-min-microvolt = <2800000>;
+                    regulator-max-microvolt = <2800000>;
+                    regulator-boot-on;
+                };
+
+                ldo4 {
+                    regulator-min-microvolt = <1200000>;
+                    regulator-max-microvolt = <3200000>;
+                };
+            };
+        };
+    };
+
Documentation/devicetree/bindings/regulator/ltc3589.txt deleted +0 -99

99 lines not on this page · raw message

Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 2 lines · Frank Li

Convert the Linear Technology LTC3589/LTC3589-1/LTC3589-2 regulator binding from text to yaml format.

Please submit patches using subject lines reflecting the style for the subsystem, this makes it easier for people to identify relevant patches. Look at what existing commits in the area you're changing are doing and make sure your subject lines visually resemble what they're doing. There's no need to resubmit to fix this alone.

#2 lore raw
In reply to Frank Li
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The YAML binding schema omits the `interrupts` property, which breaks schema validation for…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The YAML binding schema omits the interrupts property, which breaks schema validation for valid hardware configurations that use the PMIC's interrupt line. --

commit 6cc3d4149b88e8fe5fe483876ec1bdf0a91a59e7
Author: Frank Li <[email protected]>

dt-bindings: regulator: convert ltc3589 to yaml format

Convert the Linear Technology LTC3589/LTC3589-1/LTC3589-2 regulator binding from text to yaml format.

Quoted 4 lines
Documentation/devicetree/bindings/regulator/lltc,ltc3589.yaml new file +0 -0
new file mode 100644

[ ... ]

Quoted 11 lines
Documentation/devicetree/bindings/regulator/lltc,ltc3589.yaml new file +11 -0
+properties:
+  compatible:
+    enum:
+      - lltc,ltc3589
+      - lltc,ltc3589-1
+      - lltc,ltc3589-2
+
+  reg:
+    maxItems: 1
+
+  regulators:

[ ... ]

Documentation/devicetree/bindings/regulator/lltc,ltc3589.yaml line 69

Quoted 6 lines
Documentation/devicetree/bindings/regulator/lltc,ltc3589.yaml new file +6 -0
+required:
+  - compatible
+  - reg
+  - regulators
+
+additionalProperties: false

Does this conversion accidentally drop support for the interrupts property?

The LTC3589 driver in drivers/regulator/ltc3589.c checks for and requests an IRQ using client->irq to handle internal regulator events like thermal warnings and under-voltage.

Since the schema enforces additionalProperties: false at the top level, valid device tree configurations that define the physical interrupt connection for this PMIC will be rejected by dtbs_check.

Should interrupts (e.g. with maxItems: 1) be explicitly permitted in the properties list?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
maintainer
#3 lore raw
In reply to Frank Li
Quoted 1 line · Frank Li

dt-bindings: regulator: convert ltc3589 to yaml format

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-7.3

Thanks!

[1/1] dt-bindings: regulator: convert ltc3589 to yaml format

      https://git.kernel.org/broonie/regulator/c/c9b256e7900f

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark