[v10,1/2] dt-bindings: mfd: Add MAX5970 and MAX5978

Message ID 20221115110932.637091-2-Naresh.Solanki@9elements.com
State New
Headers
Series mfd: max597x: Add support for max597x |

Commit Message

Naresh Solanki Nov. 15, 2022, 11:09 a.m. UTC
  From: Marcello Sylvester Bauer <sylv@sylv.io>

The MAX597x is a hot swap controller with configurable fault protection.
It also has 10bit ADC for current & voltage measurements.

Signed-off-by: Marcello Sylvester Bauer <sylv@sylv.io>
Co-developed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Co-developed-by: Naresh Solanki <Naresh.Solanki@9elements.com>
Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com>
---
 .../bindings/mfd/maxim,max5970.yaml           | 154 ++++++++++++++++++
 1 file changed, 154 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/maxim,max5970.yaml
  

Comments

Krzysztof Kozlowski Nov. 15, 2022, 2:04 p.m. UTC | #1
On 15/11/2022 12:09, Naresh Solanki wrote:
> From: Marcello Sylvester Bauer <sylv@sylv.io>
> 
> The MAX597x is a hot swap controller with configurable fault protection.
> It also has 10bit ADC for current & voltage measurements.
> 
> Signed-off-by: Marcello Sylvester Bauer <sylv@sylv.io>
> Co-developed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
> Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
> Co-developed-by: Naresh Solanki <Naresh.Solanki@9elements.com>
> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com>
> ---
>  .../bindings/mfd/maxim,max5970.yaml           | 154 ++++++++++++++++++
>  1 file changed, 154 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mfd/maxim,max5970.yaml
> 
> diff --git a/Documentation/devicetree/bindings/mfd/maxim,max5970.yaml b/Documentation/devicetree/bindings/mfd/maxim,max5970.yaml
> new file mode 100644
> index 000000000000..edf0c23db4ca
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/maxim,max5970.yaml
> @@ -0,0 +1,154 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mfd/maxim,max5970.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Regulator 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 four LEDS.
> +
> +    properties:
> +      "#address-cells":
> +        const: 1
> +
> +      "#size-cells":
> +        const: 0
> +
> +    patternProperties:
> +      "^led@[0-3]$":
> +        $ref: /schemas/leds/common.yaml#
> +        type: object
> +
> +    additionalProperties: false
> +
> +  vss1-supply:
> +    description: Supply of the first channel.
> +
> +  vss2-supply:
> +    description: Supply of the second channel.
> +
> +  regulators:
> +    type: object
> +    description:
> +      Properties for both regulators. Also set value for shunt resistor used.

You should explain not the syntax,  but what part of hardware this nodes
represents. Therefore "Also set value" does not fit at all. Hardware
sets value?

I looked at datasheets to figure it out but they do not refer to any
configurable regulator, LDO nor "sw0/sw1/sw2". Therefore I have no clue
what to expect here...

> +
> +    patternProperties:
> +      "^sw[0-1]$":
> +        $ref: /schemas/regulator/regulator.yaml#
> +        type: object
> +        properties:
> +          shunt-resistor-micro-ohms:
> +            description: |
> +              The value of current sense resistor in microohms.
> +
> +        required:
> +          - shunt-resistor-micro-ohms
> +
> +      unevaluatedProperties: false

I don't think it has proper indentation. Did you test the binding?

> +
> +    additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - regulators
> +  - vss1-supply
> +
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          enum:
> +            - maxim,max5970
> +    then:
> +      required:
> +        - vss2-supply
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        regulator@3a {
> +            compatible = "maxim,max5978";
> +            reg = <0x3a>;
> +            vss1-supply = <&p3v3>;
> +
> +            regulators {
> +                sw0_ref_0: sw0 {
> +                    regulator-compatible = "SW0";
> +                    shunt-resistor-micro-ohms = <12000>;
> +                };
> +            };
> +
> +            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";
> +                };
> +            };
> +        };
> +    };
> +
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        regulator@3a {
> +            compatible = "maxim,max5970";
> +            reg = <0x3a>;
> +            vss1-supply = <&p3v3>;
> +            vss2-supply = <&p5v>;
> +
> +            regulators {
> +                sw0_ref_1: sw0 {
> +                    regulator-compatible = "SW0";

This property is deprecated, isn't it? Again - did you test this?

Best regards,
Krzysztof
  
Naresh Solanki Nov. 15, 2022, 8:30 p.m. UTC | #2
Hi Krzysztof,

On 15-11-2022 07:34 pm, Krzysztof Kozlowski wrote:
> On 15/11/2022 12:09, Naresh Solanki wrote:
>> From: Marcello Sylvester Bauer <sylv@sylv.io>
>>
>> The MAX597x is a hot swap controller with configurable fault protection.
>> It also has 10bit ADC for current & voltage measurements.
>>
>> Signed-off-by: Marcello Sylvester Bauer <sylv@sylv.io>
>> Co-developed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
>> Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
>> Co-developed-by: Naresh Solanki <Naresh.Solanki@9elements.com>
>> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com>
>> ---
>>   .../bindings/mfd/maxim,max5970.yaml           | 154 ++++++++++++++++++
>>   1 file changed, 154 insertions(+)
>>   create mode 100644 Documentation/devicetree/bindings/mfd/maxim,max5970.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/mfd/maxim,max5970.yaml b/Documentation/devicetree/bindings/mfd/maxim,max5970.yaml
>> new file mode 100644
>> index 000000000000..edf0c23db4ca
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/mfd/maxim,max5970.yaml
>> @@ -0,0 +1,154 @@
>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/mfd/maxim,max5970.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Regulator 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 four LEDS.
>> +
>> +    properties:
>> +      "#address-cells":
>> +        const: 1
>> +
>> +      "#size-cells":
>> +        const: 0
>> +
>> +    patternProperties:
>> +      "^led@[0-3]$":
>> +        $ref: /schemas/leds/common.yaml#
>> +        type: object
>> +
>> +    additionalProperties: false
>> +
>> +  vss1-supply:
>> +    description: Supply of the first channel.
>> +
>> +  vss2-supply:
>> +    description: Supply of the second channel.
>> +
>> +  regulators:
>> +    type: object
>> +    description:
>> +      Properties for both regulators. Also set value for shunt resistor used.
> 
> You should explain not the syntax,  but what part of hardware this nodes
> represents. Therefore "Also set value" does not fit at all. Hardware
> sets value?
You mean something like: Properties for power switch
> 
> I looked at datasheets to figure it out but they do not refer to any
> configurable regulator, LDO nor "sw0/sw1/sw2". Therefore I have no clue
> what to expect here...
Yes this is for power switch part of max5970/8
> 
>> +
>> +    patternProperties:
>> +      "^sw[0-1]$":
>> +        $ref: /schemas/regulator/regulator.yaml#
>> +        type: object
>> +        properties:
>> +          shunt-resistor-micro-ohms:
>> +            description: |
>> +              The value of current sense resistor in microohms.
>> +
>> +        required:
>> +          - shunt-resistor-micro-ohms
>> +
>> +      unevaluatedProperties: false
> 
> I don't think it has proper indentation. Did you test the binding?
Definitely tested the bindings before I push the patch.
> 
>> +
>> +    additionalProperties: false
>> +
>> +required:
>> +  - compatible
>> +  - reg
>> +  - regulators
>> +  - vss1-supply
>> +
>> +allOf:
>> +  - if:
>> +      properties:
>> +        compatible:
>> +          enum:
>> +            - maxim,max5970
>> +    then:
>> +      required:
>> +        - vss2-supply
>> +
>> +additionalProperties: false
>> +
>> +examples:
>> +  - |
>> +    i2c {
>> +        #address-cells = <1>;
>> +        #size-cells = <0>;
>> +        regulator@3a {
>> +            compatible = "maxim,max5978";
>> +            reg = <0x3a>;
>> +            vss1-supply = <&p3v3>;
>> +
>> +            regulators {
>> +                sw0_ref_0: sw0 {
>> +                    regulator-compatible = "SW0";
>> +                    shunt-resistor-micro-ohms = <12000>;
>> +                };
>> +            };
>> +
>> +            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";
>> +                };
>> +            };
>> +        };
>> +    };
>> +
>> +  - |
>> +    i2c {
>> +        #address-cells = <1>;
>> +        #size-cells = <0>;
>> +
>> +        regulator@3a {
>> +            compatible = "maxim,max5970";
>> +            reg = <0x3a>;
>> +            vss1-supply = <&p3v3>;
>> +            vss2-supply = <&p5v>;
>> +
>> +            regulators {
>> +                sw0_ref_1: sw0 {
>> +                    regulator-compatible = "SW0";
> 
> This property is deprecated, isn't it? Again - did you test this?
Yes tested.
> 
> Best regards,
> Krzysztof
> 

Regards,
Naresh
  
Krzysztof Kozlowski Nov. 16, 2022, 7:54 a.m. UTC | #3
On 15/11/2022 21:30, Naresh Solanki wrote:
> Hi Krzysztof,
> 
> On 15-11-2022 07:34 pm, Krzysztof Kozlowski wrote:
>> On 15/11/2022 12:09, Naresh Solanki wrote:
>>> From: Marcello Sylvester Bauer <sylv@sylv.io>
>>>
>>> The MAX597x is a hot swap controller with configurable fault protection.
>>> It also has 10bit ADC for current & voltage measurements.
>>>
>>> Signed-off-by: Marcello Sylvester Bauer <sylv@sylv.io>
>>> Co-developed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
>>> Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
>>> Co-developed-by: Naresh Solanki <Naresh.Solanki@9elements.com>
>>> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com>
>>> ---
>>>   .../bindings/mfd/maxim,max5970.yaml           | 154 ++++++++++++++++++
>>>   1 file changed, 154 insertions(+)
>>>   create mode 100644 Documentation/devicetree/bindings/mfd/maxim,max5970.yaml
>>>
>>> diff --git a/Documentation/devicetree/bindings/mfd/maxim,max5970.yaml b/Documentation/devicetree/bindings/mfd/maxim,max5970.yaml
>>> new file mode 100644
>>> index 000000000000..edf0c23db4ca
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/mfd/maxim,max5970.yaml
>>> @@ -0,0 +1,154 @@
>>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/mfd/maxim,max5970.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: Regulator 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 four LEDS.
>>> +
>>> +    properties:
>>> +      "#address-cells":
>>> +        const: 1
>>> +
>>> +      "#size-cells":
>>> +        const: 0
>>> +
>>> +    patternProperties:
>>> +      "^led@[0-3]$":
>>> +        $ref: /schemas/leds/common.yaml#
>>> +        type: object
>>> +
>>> +    additionalProperties: false
>>> +
>>> +  vss1-supply:
>>> +    description: Supply of the first channel.
>>> +
>>> +  vss2-supply:
>>> +    description: Supply of the second channel.
>>> +
>>> +  regulators:
>>> +    type: object
>>> +    description:
>>> +      Properties for both regulators. Also set value for shunt resistor used.
>>
>> You should explain not the syntax,  but what part of hardware this nodes
>> represents. Therefore "Also set value" does not fit at all. Hardware
>> sets value?
> You mean something like: Properties for power switch
>>
>> I looked at datasheets to figure it out but they do not refer to any
>> configurable regulator, LDO nor "sw0/sw1/sw2". Therefore I have no clue
>> what to expect here...
> Yes this is for power switch part of max5970/8

Nothing in max5970 datasheet about "power switch". "switch" fives two
results, not really related/explaining.

Bindings, your naming and explanation use terms not existing in
datasheet, so it does not look like you are describing hardware.

>>
>>> +
>>> +    patternProperties:
>>> +      "^sw[0-1]$":
>>> +        $ref: /schemas/regulator/regulator.yaml#
>>> +        type: object
>>> +        properties:
>>> +          shunt-resistor-micro-ohms:
>>> +            description: |
>>> +              The value of current sense resistor in microohms.
>>> +
>>> +        required:
>>> +          - shunt-resistor-micro-ohms
>>> +
>>> +      unevaluatedProperties: false
>>
>> I don't think it has proper indentation. Did you test the binding?
> Definitely tested the bindings before I push the patch.

Anyway it is wrong. It must be on the level of properties.


Best regards,
Krzysztof
  
Naresh Solanki Nov. 16, 2022, 7:39 p.m. UTC | #4
Hi Krzystof,

On 16-11-2022 01:24 pm, Krzysztof Kozlowski wrote:
> On 15/11/2022 21:30, Naresh Solanki wrote:
>> Hi Krzysztof,
>>
>> On 15-11-2022 07:34 pm, Krzysztof Kozlowski wrote:
>>> On 15/11/2022 12:09, Naresh Solanki wrote:
>>>> From: Marcello Sylvester Bauer <sylv@sylv.io>
>>>>
>>>> The MAX597x is a hot swap controller with configurable fault protection.
>>>> It also has 10bit ADC for current & voltage measurements.
>>>>
>>>> Signed-off-by: Marcello Sylvester Bauer <sylv@sylv.io>
>>>> Co-developed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
>>>> Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
>>>> Co-developed-by: Naresh Solanki <Naresh.Solanki@9elements.com>
>>>> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com>
>>>> ---
>>>>    .../bindings/mfd/maxim,max5970.yaml           | 154 ++++++++++++++++++
>>>>    1 file changed, 154 insertions(+)
>>>>    create mode 100644 Documentation/devicetree/bindings/mfd/maxim,max5970.yaml
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/mfd/maxim,max5970.yaml b/Documentation/devicetree/bindings/mfd/maxim,max5970.yaml
>>>> new file mode 100644
>>>> index 000000000000..edf0c23db4ca
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/mfd/maxim,max5970.yaml
>>>> @@ -0,0 +1,154 @@
>>>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>>>> +%YAML 1.2
>>>> +---
>>>> +$id: http://devicetree.org/schemas/mfd/maxim,max5970.yaml#
>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>>> +
>>>> +title: Regulator 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 four LEDS.
>>>> +
>>>> +    properties:
>>>> +      "#address-cells":
>>>> +        const: 1
>>>> +
>>>> +      "#size-cells":
>>>> +        const: 0
>>>> +
>>>> +    patternProperties:
>>>> +      "^led@[0-3]$":
>>>> +        $ref: /schemas/leds/common.yaml#
>>>> +        type: object
>>>> +
>>>> +    additionalProperties: false
>>>> +
>>>> +  vss1-supply:
>>>> +    description: Supply of the first channel.
>>>> +
>>>> +  vss2-supply:
>>>> +    description: Supply of the second channel.
>>>> +
>>>> +  regulators:
>>>> +    type: object
>>>> +    description:
>>>> +      Properties for both regulators. Also set value for shunt resistor used.
>>>
>>> You should explain not the syntax,  but what part of hardware this nodes
>>> represents. Therefore "Also set value" does not fit at all. Hardware
>>> sets value?
>> You mean something like: Properties for power switch
>>>
>>> I looked at datasheets to figure it out but they do not refer to any
>>> configurable regulator, LDO nor "sw0/sw1/sw2". Therefore I have no clue
>>> what to expect here...
>> Yes this is for power switch part of max5970/8
> 
> Nothing in max5970 datasheet about "power switch". "switch" fives two
> results, not really related/explaining.
In datasheet the term used is hot swap controller & uses external fet.
Although it gives output 1:1 i.e., doesnt steps up/down the input supply.
i.e., regulator driver is used here.
> 
> Bindings, your naming and explanation use terms not existing in
> datasheet, so it does not look like you are describing hardware.
> 
>>>
>>>> +
>>>> +    patternProperties:
>>>> +      "^sw[0-1]$":
>>>> +        $ref: /schemas/regulator/regulator.yaml#
>>>> +        type: object
>>>> +        properties:
>>>> +          shunt-resistor-micro-ohms:
>>>> +            description: |
>>>> +              The value of current sense resistor in microohms.
>>>> +
>>>> +        required:
>>>> +          - shunt-resistor-micro-ohms
>>>> +
>>>> +      unevaluatedProperties: false
>>>
>>> I don't think it has proper indentation. Did you test the binding?
>> Definitely tested the bindings before I push the patch.
> 
> Anyway it is wrong. It must be on the level of properties.
Will update in next version.
> 
> 
> Best regards,
> Krzysztof
> 

Regards,
Naresh
  
Rob Herring Nov. 16, 2022, 9:34 p.m. UTC | #5
On Wed, Nov 16, 2022 at 02:00:44AM +0530, Naresh Solanki wrote:
> Hi Krzysztof,
> 
> On 15-11-2022 07:34 pm, Krzysztof Kozlowski wrote:
> > On 15/11/2022 12:09, Naresh Solanki wrote:
> > > From: Marcello Sylvester Bauer <sylv@sylv.io>
> > > 
> > > The MAX597x is a hot swap controller with configurable fault protection.
> > > It also has 10bit ADC for current & voltage measurements.
> > > 
> > > Signed-off-by: Marcello Sylvester Bauer <sylv@sylv.io>
> > > Co-developed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
> > > Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
> > > Co-developed-by: Naresh Solanki <Naresh.Solanki@9elements.com>
> > > Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com>
> > > ---
> > >   .../bindings/mfd/maxim,max5970.yaml           | 154 ++++++++++++++++++
> > >   1 file changed, 154 insertions(+)
> > >   create mode 100644 Documentation/devicetree/bindings/mfd/maxim,max5970.yaml
> > > 
> > > diff --git a/Documentation/devicetree/bindings/mfd/maxim,max5970.yaml b/Documentation/devicetree/bindings/mfd/maxim,max5970.yaml
> > > new file mode 100644
> > > index 000000000000..edf0c23db4ca
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/mfd/maxim,max5970.yaml
> > > @@ -0,0 +1,154 @@
> > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/mfd/maxim,max5970.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: Regulator 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 four LEDS.
> > > +
> > > +    properties:
> > > +      "#address-cells":
> > > +        const: 1
> > > +
> > > +      "#size-cells":
> > > +        const: 0
> > > +
> > > +    patternProperties:
> > > +      "^led@[0-3]$":
> > > +        $ref: /schemas/leds/common.yaml#
> > > +        type: object
> > > +
> > > +    additionalProperties: false
> > > +
> > > +  vss1-supply:
> > > +    description: Supply of the first channel.
> > > +
> > > +  vss2-supply:
> > > +    description: Supply of the second channel.
> > > +
> > > +  regulators:
> > > +    type: object
> > > +    description:
> > > +      Properties for both regulators. Also set value for shunt resistor used.
> > 
> > You should explain not the syntax,  but what part of hardware this nodes
> > represents. Therefore "Also set value" does not fit at all. Hardware
> > sets value?
> You mean something like: Properties for power switch
> > 
> > I looked at datasheets to figure it out but they do not refer to any
> > configurable regulator, LDO nor "sw0/sw1/sw2". Therefore I have no clue
> > what to expect here...
> Yes this is for power switch part of max5970/8
> > 
> > > +
> > > +    patternProperties:
> > > +      "^sw[0-1]$":
> > > +        $ref: /schemas/regulator/regulator.yaml#
> > > +        type: object
> > > +        properties:
> > > +          shunt-resistor-micro-ohms:
> > > +            description: |
> > > +              The value of current sense resistor in microohms.
> > > +
> > > +        required:
> > > +          - shunt-resistor-micro-ohms
> > > +
> > > +      unevaluatedProperties: false
> > 
> > I don't think it has proper indentation. Did you test the binding?
> Definitely tested the bindings before I push the patch.

This kind of error was checked for 'properties', but not 
'patternProperties'. Now fixed.

Rob
  

Patch

diff --git a/Documentation/devicetree/bindings/mfd/maxim,max5970.yaml b/Documentation/devicetree/bindings/mfd/maxim,max5970.yaml
new file mode 100644
index 000000000000..edf0c23db4ca
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/maxim,max5970.yaml
@@ -0,0 +1,154 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/maxim,max5970.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Regulator 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 four LEDS.
+
+    properties:
+      "#address-cells":
+        const: 1
+
+      "#size-cells":
+        const: 0
+
+    patternProperties:
+      "^led@[0-3]$":
+        $ref: /schemas/leds/common.yaml#
+        type: object
+
+    additionalProperties: false
+
+  vss1-supply:
+    description: Supply of the first channel.
+
+  vss2-supply:
+    description: Supply of the second channel.
+
+  regulators:
+    type: object
+    description:
+      Properties for both regulators. Also set value for shunt resistor used.
+
+    patternProperties:
+      "^sw[0-1]$":
+        $ref: /schemas/regulator/regulator.yaml#
+        type: object
+        properties:
+          shunt-resistor-micro-ohms:
+            description: |
+              The value of current sense resistor in microohms.
+
+        required:
+          - shunt-resistor-micro-ohms
+
+      unevaluatedProperties: false
+
+    additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - regulators
+  - vss1-supply
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          enum:
+            - maxim,max5970
+    then:
+      required:
+        - vss2-supply
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        regulator@3a {
+            compatible = "maxim,max5978";
+            reg = <0x3a>;
+            vss1-supply = <&p3v3>;
+
+            regulators {
+                sw0_ref_0: sw0 {
+                    regulator-compatible = "SW0";
+                    shunt-resistor-micro-ohms = <12000>;
+                };
+            };
+
+            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";
+                };
+            };
+        };
+    };
+
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        regulator@3a {
+            compatible = "maxim,max5970";
+            reg = <0x3a>;
+            vss1-supply = <&p3v3>;
+            vss2-supply = <&p5v>;
+
+            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>;
+                };
+            };
+        };
+    };
+...