new file mode 100644
@@ -0,0 +1,164 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/max5970.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Regulator driver for MAX5970 smart switch from Maxim Integrated.
+
+maintainers:
+ - Patrick Rudolph <patrick.rudolph@9elements.com>
+
+description: |
+ The smart switch provides no output regulation, but independent fault protection
+ and voltage and current sensing.
+ Programming is done through I2C bus.
+
+ Datasheets:
+ https://datasheets.maximintegrated.com/en/ds/MAX5970.pdf
+ https://datasheets.maximintegrated.com/en/ds/MAX5978.pdf
+
+properties:
+ compatible:
+ enum:
+ - maxim,max5970
+ - maxim,max5978
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ leds:
+ type: object
+ description:
+ Properties for single channel.
+
+ patternProperties:
+ "^led@[0-3]$":
+ $ref: /schemas/leds/common.yaml#
+ type: object
+
+ additionalProperties: true
+
+ vss1-supply:
+ description: Supply of the first channel.
+
+ "#io-channel-cells":
+ const: 1
+
+ regulators:
+ type: object
+ description:
+ Properties for single channel.
+
+ patternProperties:
+ "^(sw[0-1])$":
+ $ref: /schemas/regulator/regulator.yaml#
+ type: object
+
+ shunt-resistor-micro-ohms:
+ description: |
+ The value of curent sense resistor in microohms.
+ Must be specified for each channel.
+
+ additionalProperties: true
+
+required:
+ - compatible
+ - reg
+ - regulators
+ - vss1-supply
+
+allOf:
+ - $ref: /schemas/regulator/regulator.yaml#
+ - if:
+ properties:
+ compatible:
+ enum:
+ - maxim,max5970
+ then:
+ properties:
+ vss2-supply:
+ description: Supply of the second channel.
+
+ io-channels:
+ items:
+ - description: voltage first channel
+ - description: current first channel
+ - description: voltage second channel
+ - description: current second channel
+ description: |
+ Voltage and current for first and second channel.
+ required:
+ - vss2-supply
+
+ else:
+ properties:
+ io-channels:
+ items:
+ - description: voltage first channel
+ - description: current first channel
+ description: |
+ Voltage and current for first channel.
+
+additionalProperties: false
+
+examples:
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ leds {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ led@0 {
+ reg = <0>;
+ label = "led0";
+ default-state = "on";
+ };
+ led@1 {
+ reg = <1>;
+ label = "led1";
+ default-state = "on";
+ };
+ };
+ regulator@3a {
+ reg = <0x3a>;
+ vss1-supply = <&p3v3>;
+ compatible = "maxim,max5978";
+
+ regulators {
+ sw0_ref_0: SW0 {
+ regulator-compatible = "SW0";
+ shunt-resistor-micro-ohms = <12000>;
+ };
+ };
+ };
+ };
+
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ regulator@3a {
+ reg = <0x3a>;
+ vss1-supply = <&p3v3>;
+ vss2-supply = <&p5v>;
+ compatible = "maxim,max5970";
+
+ regulators {
+ sw0_ref_1: SW0 {
+ regulator-compatible = "SW0";
+ shunt-resistor-micro-ohms = <12000>;
+ };
+ sw1_ref_1: SW1 {
+ regulator-compatible = "SW1";
+ shunt-resistor-micro-ohms = <10000>;
+ };
+ };
+ };
+ };
+...