[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240528131622.4b4f8d03@aktux>
Date: Tue, 28 May 2024 13:16:22 +0200
From: Andreas Kemnade <andreas@...nade.info>
To: Krzysztof Kozlowski <krzk@...nel.org>
Cc: lee@...nel.org, robh@...nel.org, krzk+dt@...nel.org,
conor+dt@...nel.org, lgirdwood@...il.com, broonie@...nel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-omap@...r.kernel.org
Subject: Re: [RFC PATCH] dt-bindings: regulator: twl-regulator: convert to
yaml
On Tue, 28 May 2024 12:04:22 +0200
Krzysztof Kozlowski <krzk@...nel.org> wrote:
> On 28/05/2024 08:57, Andreas Kemnade wrote:
> > Convert the regulator bindings to yaml files. To allow only the regulator
> > compatible corresponding to the toplevel mfd compatible, split the file
> > into one per device.
> >
> > To not need to allow any subnode name, specify clearly node names
> > for all the regulators.
> >
> > Drop one twl5030 compatible due to no documentation on mfd side and no
> > users of the twl5030.
> >
> > Signed-off-by: Andreas Kemnade <andreas@...nade.info>
> > ---
> > Reason for being RFC:
> > the integration into ti,twl.yaml seems not to work as expected
> > make dt_binding_check crashes without any clear error message
> > if used on the ti,twl.yaml
> >
> > .../devicetree/bindings/mfd/ti,twl.yaml | 4 +-
> > .../regulator/ti,twl4030-regulator.yaml | 402 ++++++++++++++++++
> > .../regulator/ti,twl6030-regulator.yaml | 292 +++++++++++++
> > .../regulator/ti,twl6032-regulator.yaml | 238 +++++++++++
> > .../bindings/regulator/twl-regulator.txt | 80 ----
> > 5 files changed, 935 insertions(+), 81 deletions(-)
> > create mode 100644 Documentation/devicetree/bindings/regulator/ti,twl4030-regulator.yaml
> > create mode 100644 Documentation/devicetree/bindings/regulator/ti,twl6030-regulator.yaml
> > create mode 100644 Documentation/devicetree/bindings/regulator/ti,twl6032-regulator.yaml
> > delete mode 100644 Documentation/devicetree/bindings/regulator/twl-regulator.txt
> >
> > diff --git a/Documentation/devicetree/bindings/mfd/ti,twl.yaml b/Documentation/devicetree/bindings/mfd/ti,twl.yaml
> > index c2357fecb56cc..4ced6e471d338 100644
> > --- a/Documentation/devicetree/bindings/mfd/ti,twl.yaml
> > +++ b/Documentation/devicetree/bindings/mfd/ti,twl.yaml
> > @@ -50,7 +50,7 @@ allOf:
> > properties:
> > compatible:
> > const: ti,twl4030-wdt
> > -
> > + $ref: /schemas/regulator/ti,twl4030-regulator.yaml
>
> That's not needed, just like othehr refs below.
>
but how to prevent error messages like this:
arch/arm/boot/dts/ti/omap/omap2430-sdp.dtb: twl@48: Unevaluated properties are not allowed ('gpio', 'keypad', 'pwm', 'pwmled', 'regulator-vaux1', 'regulator-vaux2', 'regulator-vaux3', 'regulator-vaux4', 'regulator-vdac', 'regulator-vdd1', 'regulator-vintana1', 'regulator-vintana2', 'regulator-vintdig', 'regulator-vio', 'regulator-vmmc1', 'regulator-vmmc2', 'regulator-vpll1', 'regulator-vpll2', 'regulator-vsim', 'regulator-vusb1v5', 'regulator-vusb1v8', 'regulator-vusb3v1
esp. the regulator parts without adding stuff to ti,twl.yaml?
> > - if:
> > properties:
> > compatible:
> > @@ -63,6 +63,7 @@ allOf:
> > properties:
> > compatible:
> > const: ti,twl6030-gpadc
> > + $ref: /schemas/regulator/ti,twl6030-regulator.yaml
> > - if:
> > properties:
> > compatible:
> > @@ -75,6 +76,7 @@ allOf:
> > properties:
> > compatible:
> > const: ti,twl6032-gpadc
> > + $ref: /schemas/regulator/ti,twl6032-regulator.yaml
> >
>
> > properties:
> > compatible:
> > diff --git a/Documentation/devicetree/bindings/regulator/ti,twl4030-regulator.yaml b/Documentation/devicetree/bindings/regulator/ti,twl4030-regulator.yaml
> > new file mode 100644
> > index 0000000000000..9623c110605ef
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/regulator/ti,twl4030-regulator.yaml
> > @@ -0,0 +1,402 @@
> > +# SPDX-License-Identifier: (GPL-2.0)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/regulator/ti,twl4030-regulator.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Regulators in the TWL4030 PMIC
> > +
> > +maintainers:
> > + - Andreas Kemnade <andreas@...nade.info>
> > +
> > +properties:
> > + regulator-vaux1:
> > + type: object
> > + $ref: regulator.yaml#
> > + unevaluatedProperties: false
> > + properties:
> > + compatible:
> > + const: "ti,twl4030-vaux1"
>
> No quotes
>
Ack.
> > +
> > + regulator-initial-mode:
> > + items:
> > + - items:
> > + enum:
> > + - 0x08 # Sleep mode, the nominal output voltage is maintained
> > + # with low power consumption with low load current capability
> > + - 0x0e # Active mode, the regulator can deliver its nominal output
> > + # voltage with full-load current capability
> > +
> > + required:
> > + - compatible
> > +
> > + regulator-vaux2:
> > + type: object
> > + $ref: regulator.yaml#
> > + unevaluatedProperties: false
> > + properties:
> > + compatible:
> > + const: "ti,twl4030-vaux2"
> > +
> > + regulator-initial-mode:
> > + items:
> > + - items:
> > + enum:
> > + - 0x08 # Sleep mode, the nominal output voltage is maintained
> > + # with low power consumption with low load current capability
> > + - 0x0e # Active mode, the regulator can deliver its nominal output
> > + # voltage with full-load current capability
>
> These entries are the same. Just use patternProperties and enum for
> compatible.
>
hmm, if I am using that, how do I prevent e.g. constructions like this to be
valid?
regulator-vaux2 {
compatible = "ti,twl4030-vaux1";
};
Regards,
Andreas
Powered by blists - more mailing lists