diff mbox series

[3/4] regulator: dt-bindings: maxim,max77693: convert to dtschema

Message ID 20211228163930.35524-4-krzysztof.kozlowski@canonical.com (mailing list archive)
State Handled Elsewhere, archived
Headers show
Series leds/power/regulator/mfd: dt-bindings: maxim,max77693: convert to dtschema | expand

Commit Message

Krzysztof Kozlowski Dec. 28, 2021, 4:39 p.m. UTC
Convert the regulator bindings of Maxim MAX77693 MUIC to DT schema format.
The existing bindings were defined in ../bindings/mfd/max77693.txt.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
---
 .../bindings/regulator/maxim,max77693.yaml    | 49 +++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/maxim,max77693.yaml

Comments

Rob Herring (Arm) Jan. 4, 2022, 3:29 p.m. UTC | #1
On Tue, Dec 28, 2021 at 05:39:29PM +0100, Krzysztof Kozlowski wrote:
> Convert the regulator bindings of Maxim MAX77693 MUIC to DT schema format.
> The existing bindings were defined in ../bindings/mfd/max77693.txt.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> ---
>  .../bindings/regulator/maxim,max77693.yaml    | 49 +++++++++++++++++++
>  1 file changed, 49 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/regulator/maxim,max77693.yaml
> 
> diff --git a/Documentation/devicetree/bindings/regulator/maxim,max77693.yaml b/Documentation/devicetree/bindings/regulator/maxim,max77693.yaml
> new file mode 100644
> index 000000000000..81242c8cd77c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/maxim,max77693.yaml
> @@ -0,0 +1,49 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/regulator/maxim,max77693.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Maxim MAX77693 MicroUSB and Companion Power Management IC regulators
> +
> +maintainers:
> +  - Chanwoo Choi <cw00.choi@samsung.com>
> +  - Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> +
> +description: |
> +  This is a part of device tree bindings for Maxim MAX77693 MicroUSB Integrated
> +  Circuit (MUIC).
> +
> +  See also Documentation/devicetree/bindings/mfd/maxim,max77693.yaml for
> +  additional information and example.
> +
> +patternProperties:
> +  "^ESAFEOUT[12]$":
> +    type: object
> +    $ref: regulator.yaml#
> +    unevaluatedProperties: false
> +    description: |
> +      Safeout LDO regulator.
> +
> +    properties:
> +      regulator-min-microvolt: true
> +      regulator-max-microvolt: true

If you want to define which properties are valid from regulator.yaml, 
then you need to define all of them (regulator-name is missing), and use 
'additionalProperties: false'. Or you can just drop these. 

> +
> +    required:
> +      - regulator-name
> +
> +  "^CHARGER$":

Fixed string, not a pattern. Place under 'properties'.

> +    type: object
> +    $ref: regulator.yaml#
> +    unevaluatedProperties: false
> +    description: |
> +      Current regulator.
> +
> +    properties:
> +      regulator-min-microamp: true
> +      regulator-max-microamp: true
> +
> +    required:
> +      - regulator-name
> +
> +additionalProperties: false
> -- 
> 2.32.0
> 
>
Krzysztof Kozlowski Jan. 11, 2022, 4:26 p.m. UTC | #2
On 04/01/2022 16:29, Rob Herring wrote:
> On Tue, Dec 28, 2021 at 05:39:29PM +0100, Krzysztof Kozlowski wrote:
>> Convert the regulator bindings of Maxim MAX77693 MUIC to DT schema format.
>> The existing bindings were defined in ../bindings/mfd/max77693.txt.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
>> ---
>>  .../bindings/regulator/maxim,max77693.yaml    | 49 +++++++++++++++++++
>>  1 file changed, 49 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/regulator/maxim,max77693.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/regulator/maxim,max77693.yaml b/Documentation/devicetree/bindings/regulator/maxim,max77693.yaml
>> new file mode 100644
>> index 000000000000..81242c8cd77c
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/regulator/maxim,max77693.yaml
>> @@ -0,0 +1,49 @@
>> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/regulator/maxim,max77693.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Maxim MAX77693 MicroUSB and Companion Power Management IC regulators
>> +
>> +maintainers:
>> +  - Chanwoo Choi <cw00.choi@samsung.com>
>> +  - Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
>> +
>> +description: |
>> +  This is a part of device tree bindings for Maxim MAX77693 MicroUSB Integrated
>> +  Circuit (MUIC).
>> +
>> +  See also Documentation/devicetree/bindings/mfd/maxim,max77693.yaml for
>> +  additional information and example.
>> +
>> +patternProperties:
>> +  "^ESAFEOUT[12]$":
>> +    type: object
>> +    $ref: regulator.yaml#
>> +    unevaluatedProperties: false
>> +    description: |
>> +      Safeout LDO regulator.
>> +
>> +    properties:
>> +      regulator-min-microvolt: true
>> +      regulator-max-microvolt: true
> 
> If you want to define which properties are valid from regulator.yaml, 
> then you need to define all of them (regulator-name is missing), and use 
> 'additionalProperties: false'. Or you can just drop these. 
> 
>> +
>> +    required:
>> +      - regulator-name
>> +
>> +  "^CHARGER$":
> 
> Fixed string, not a pattern. Place under 'properties'.
> 

Thanks, I'll fix both.


Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/regulator/maxim,max77693.yaml b/Documentation/devicetree/bindings/regulator/maxim,max77693.yaml
new file mode 100644
index 000000000000..81242c8cd77c
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/maxim,max77693.yaml
@@ -0,0 +1,49 @@ 
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/maxim,max77693.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Maxim MAX77693 MicroUSB and Companion Power Management IC regulators
+
+maintainers:
+  - Chanwoo Choi <cw00.choi@samsung.com>
+  - Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
+
+description: |
+  This is a part of device tree bindings for Maxim MAX77693 MicroUSB Integrated
+  Circuit (MUIC).
+
+  See also Documentation/devicetree/bindings/mfd/maxim,max77693.yaml for
+  additional information and example.
+
+patternProperties:
+  "^ESAFEOUT[12]$":
+    type: object
+    $ref: regulator.yaml#
+    unevaluatedProperties: false
+    description: |
+      Safeout LDO regulator.
+
+    properties:
+      regulator-min-microvolt: true
+      regulator-max-microvolt: true
+
+    required:
+      - regulator-name
+
+  "^CHARGER$":
+    type: object
+    $ref: regulator.yaml#
+    unevaluatedProperties: false
+    description: |
+      Current regulator.
+
+    properties:
+      regulator-min-microamp: true
+      regulator-max-microamp: true
+
+    required:
+      - regulator-name
+
+additionalProperties: false