diff mbox series

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

Message ID 20220111174337.223320-4-krzysztof.kozlowski@canonical.com
State New
Headers show
Series mfd/power/regulators: dt-bindings: max14577: convert to dtschema | expand

Commit Message

Krzysztof Kozlowski Jan. 11, 2022, 5:43 p.m. UTC
Convert the regulator bindings of Maxim MAX14577/MAX77835 MUIC to DT
schema format.  The existing bindings were defined in
../bindings/mfd/max14577.txt.

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

Comments

Rob Herring (Arm) Jan. 11, 2022, 10:21 p.m. UTC | #1
On Tue, 11 Jan 2022 18:43:36 +0100, Krzysztof Kozlowski wrote:
> Convert the regulator bindings of Maxim MAX14577/MAX77835 MUIC to DT
> schema format.  The existing bindings were defined in
> ../bindings/mfd/max14577.txt.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> ---
>  .../bindings/regulator/maxim,max14577.yaml    | 92 +++++++++++++++++++
>  1 file changed, 92 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/regulator/maxim,max14577.yaml
> 

Reviewed-by: Rob Herring <robh@kernel.org>
Mark Brown Feb. 14, 2022, 4:43 p.m. UTC | #2
On Tue, Jan 11, 2022 at 06:43:36PM +0100, Krzysztof Kozlowski wrote:

> +    required:
> +      - regulator-name

Why is regulator-name required?  While it's a good idea for users to
document names for supplies on their boards it shouldn't be a
requirement or something that a driver would care about.
Krzysztof Kozlowski Feb. 14, 2022, 4:54 p.m. UTC | #3
On 14/02/2022 17:43, Mark Brown wrote:
> On Tue, Jan 11, 2022 at 06:43:36PM +0100, Krzysztof Kozlowski wrote:
> 
>> +    required:
>> +      - regulator-name
> 
> Why is regulator-name required?  While it's a good idea for users to
> document names for supplies on their boards it shouldn't be a
> requirement or something that a driver would care about.

Indeed, there is no need for requiring the name. I guess I copied it
from other schemas.

I think this was not applied yet, so I'll send a v3.

Best regards,
Krzysztof
Mark Brown Feb. 14, 2022, 4:59 p.m. UTC | #4
On Mon, Feb 14, 2022 at 05:54:01PM +0100, Krzysztof Kozlowski wrote:
> On 14/02/2022 17:43, Mark Brown wrote:

> >> +    required:
> >> +      - regulator-name

> > Why is regulator-name required?  While it's a good idea for users to
> > document names for supplies on their boards it shouldn't be a
> > requirement or something that a driver would care about.

> Indeed, there is no need for requiring the name. I guess I copied it
> from other schemas.

Those other schemas should be fixed as well, if this is required for
anything then there's a problem - this is purely diagnostic information
for users.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/regulator/maxim,max14577.yaml b/Documentation/devicetree/bindings/regulator/maxim,max14577.yaml
new file mode 100644
index 000000000000..4212f10644a1
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/maxim,max14577.yaml
@@ -0,0 +1,92 @@ 
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/maxim,max14577.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Maxim MAX14577/MAX77836 MicroUSB and Companion Power Management IC regulators
+
+maintainers:
+  - Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
+
+description: |
+  This is a part of device tree bindings for Maxim MAX14577/MAX77836 MicroUSB
+  Integrated Circuit (MUIC).
+
+  See also Documentation/devicetree/bindings/mfd/maxim,max14577.yaml for
+  additional information and example.
+
+properties:
+  compatible:
+    enum:
+      - maxim,max14577-regulator
+      - maxim,max77836-regulator
+
+  CHARGER:
+    type: object
+    $ref: regulator.yaml#
+    additionalProperties: false
+    description: |
+      Current regulator.
+
+    properties:
+      regulator-name: true
+      regulator-always-on: true
+      regulator-boot-on: true
+      regulator-min-microamp: true
+      regulator-max-microamp: true
+
+    required:
+      - regulator-name
+
+  SAFEOUT:
+    type: object
+    $ref: regulator.yaml#
+    additionalProperties: false
+    description: |
+      Safeout LDO regulator (fixed voltage).
+
+    properties:
+      regulator-name: true
+      regulator-always-on: true
+      regulator-boot-on: true
+      regulator-min-microvolt:
+        const: 4900000
+      regulator-max-microvolt:
+        const: 4900000
+
+    required:
+      - regulator-name
+
+patternProperties:
+  "^LDO[12]$":
+    type: object
+    $ref: regulator.yaml#
+    additionalProperties: false
+    description: |
+      Current regulator.
+
+    properties:
+      regulator-name: true
+      regulator-always-on: true
+      regulator-boot-on: true
+      regulator-min-microvolt:
+        minimum: 800000
+      regulator-max-microvolt:
+        maximum: 3950000
+
+    required:
+      - regulator-name
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: maxim,max14577-regulator
+    then:
+      properties:
+        LDO1: false
+        LDO2: false
+
+additionalProperties: false