diff mbox series

[2/3] dt-bindings: vqmmc-ipq4019-regulator: add binding document

Message ID 20200112113003.11110-2-robert.marko@sartura.hr (mailing list archive)
State New, archived
Headers show
Series [1/3] regulator: add IPQ4019 SDHCI VQMMC LDO driver | expand

Commit Message

Robert Marko Jan. 12, 2020, 11:30 a.m. UTC
This patch adds bindings for the Qualcomm IPQ4019 VQMMC SD LDO driver.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
 .../regulator/vqmmc-ipq4019-regulator.yaml    | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/vqmmc-ipq4019-regulator.yaml

Comments

Mark Brown Jan. 13, 2020, 2:41 p.m. UTC | #1
On Sun, Jan 12, 2020 at 12:30:02PM +0100, Robert Marko wrote:

> +  regulator-min-microvolt:
> +    description: smallest voltage consumers may set
> +
> +  regulator-max-microvolt:
> +    description: largest voltage consumers may set

Why are these explicitly specified in this binding?

> +  regulator-always-on:
> +    description: boolean, regulator should never be disabled
> +    type: boolean

If it's not physically possible to disable the regulator then
specifying this property is redundant so...

> +required:
> +  - compatible
> +  - reg
> +  - regulator-name
> +  - regulator-min-microvolt
> +  - regulator-max-microvolt
> +  - regulator-always-on

...requiring it doesn't seem useful.  All the other
regulator-specific properties shouldn't be required either,
unless the user specifies a voltage range we won't allow changes
at all which should be safe and the name is purely cosmetic.
Robert Marko Jan. 21, 2020, 10:34 a.m. UTC | #2
On Mon, Jan 13, 2020 at 3:41 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Sun, Jan 12, 2020 at 12:30:02PM +0100, Robert Marko wrote:
>
> > +  regulator-min-microvolt:
> > +    description: smallest voltage consumers may set
> > +
> > +  regulator-max-microvolt:
> > +    description: largest voltage consumers may set
>
> Why are these explicitly specified in this binding?
You are right, I can simply include them from regulator.yaml
>
> > +  regulator-always-on:
> > +    description: boolean, regulator should never be disabled
> > +    type: boolean
>
> If it's not physically possible to disable the regulator then
> specifying this property is redundant so...
Yes, regulator cant be turned off.
>
> > +required:
> > +  - compatible
> > +  - reg
> > +  - regulator-name
> > +  - regulator-min-microvolt
> > +  - regulator-max-microvolt
> > +  - regulator-always-on
>
> ...requiring it doesn't seem useful.  All the other
> regulator-specific properties shouldn't be required either,
> unless the user specifies a voltage range we won't allow changes
> at all which should be safe and the name is purely cosmetic.
Are bindings even required at all here then?
Mark Brown Jan. 21, 2020, 4:27 p.m. UTC | #3
On Tue, Jan 21, 2020 at 11:33:12AM +0100, Robert Marko wrote:
> On Mon, Jan 13, 2020 at 3:41 PM Mark Brown <broonie@kernel.org> wrote:

> > ...requiring it doesn't seem useful.  All the other
> > regulator-specific properties shouldn't be required either,
> > unless the user specifies a voltage range we won't allow changes
> > at all which should be safe and the name is purely cosmetic.

> Are bindings even required at all here then?

Even if there's no specific properties you still need the compatible
string and documentation that it should use the generic regulator
binding.  This should be trivial but it means that we can do things like
validate system DTs.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/regulator/vqmmc-ipq4019-regulator.yaml b/Documentation/devicetree/bindings/regulator/vqmmc-ipq4019-regulator.yaml
new file mode 100644
index 000000000000..d4d9b618d351
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/vqmmc-ipq4019-regulator.yaml
@@ -0,0 +1,54 @@ 
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/vqmmc-ipq4019-regulator.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm IPQ4019 VQMMC SD LDO regulator
+
+maintainers:
+  - Robert Marko <robert.marko@sartura.hr>
+
+properties:
+  $nodename:
+    pattern: "regulator(@.*)?$"
+  compatible:
+    const: qcom,vqmmc-ipq4019-regulator
+
+  regulator-name: true
+
+  reg:
+    maxItems: 1
+
+  regulator-min-microvolt:
+    description: smallest voltage consumers may set
+
+  regulator-max-microvolt:
+    description: largest voltage consumers may set
+
+  regulator-always-on:
+    description: boolean, regulator should never be disabled
+    type: boolean
+
+  additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - regulator-name
+  - regulator-min-microvolt
+  - regulator-max-microvolt
+  - regulator-always-on
+
+examples:
+  - |
+    regulator@1948000 {
+      compatible = "qcom,vqmmc-ipq4019-regulator";
+      reg = <0x01948000 0x4>;
+      regulator-name = "vqmmc";
+      regulator-min-microvolt = <1500000>;
+      regulator-max-microvolt = <3000000>;
+      regulator-always-on;
+      status = "disabled";
+    };
+...