diff mbox series

[01/16] dt-bindings: mfd: rohm, bd71847-pmic: Correct clock properties requirements

Message ID 20200824190701.8447-1-krzk@kernel.org
State Not Applicable
Headers show
Series [01/16] dt-bindings: mfd: rohm, bd71847-pmic: Correct clock properties requirements | expand

Commit Message

Krzysztof Kozlowski Aug. 24, 2020, 7:06 p.m. UTC
The input clock and number of clock provider cells are not required for
the PMIC to operate.  They are needed only for the optional bd718x7
clock driver.

Add also clock-output-names as driver takes use of it.

This fixes dtbs_check warnings like:

    arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dt.yaml: pmic@4b: 'clocks' is a required property
    arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dt.yaml: pmic@4b: '#clock-cells' is a required property

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 .../devicetree/bindings/mfd/rohm,bd71847-pmic.yaml       | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Matti Vaittinen Aug. 25, 2020, 6:23 a.m. UTC | #1
Hello Krzysztof,

On Mon, 2020-08-24 at 21:06 +0200, Krzysztof Kozlowski wrote:
> The input clock and number of clock provider cells are not required
> for
> the PMIC to operate.  They are needed only for the optional bd718x7
> clock driver.

I have always found the DT bindings hard to do. I quite often end up
having a different view with Rob so I probably could just shut-up and
watch how this evolves :)

But as keeping my mouth is so difficult...

...All of the drivers are optional. The PMIC can power-on without any
drivers. Drivers are mostly used just for disabling the voltage from
graphics accelerator block when it is not needed (optional). Or some
DVS (optional). But yes, maybe the clk driver is "more optional" than
the rest. XD So, I am not against this.

> Add also clock-output-names as driver takes use of it.
> 
> This fixes dtbs_check warnings like:
> 
>     arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dt.yaml: pmic@4b:
> 'clocks' is a required property
>     arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dt.yaml: pmic@4b:
> '#clock-cells' is a required property
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  .../devicetree/bindings/mfd/rohm,bd71847-pmic.yaml       | 9
> +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/rohm,bd71847-
> pmic.yaml b/Documentation/devicetree/bindings/mfd/rohm,bd71847-
> pmic.yaml
> index 77bcca2d414f..5d531051a153 100644
> --- a/Documentation/devicetree/bindings/mfd/rohm,bd71847-pmic.yaml
> +++ b/Documentation/devicetree/bindings/mfd/rohm,bd71847-pmic.yaml
> @@ -38,6 +38,9 @@ properties:
>    "#clock-cells":
>      const: 0
>  
> +  clock-output-names:
> +    maxItems: 1

I had this in original binding (text) document patch series. For some
reason it was later dropped. Unfortunately I didn't easily find a
reason as to why. Adding it back now is absolutely fine for me though.

> +
>  # The BD71847 abd BD71850 support two different HW states as reset
> target
>  # states. States are called as SNVS and READY. At READY state all
> the PMIC
>  # power outputs go down and OTP is reload. At the SNVS state all
> other logic
> @@ -116,12 +119,14 @@ required:
>    - compatible
>    - reg
>    - interrupts
> -  - clocks
> -  - "#clock-cells"
>    - regulators
>  
>  additionalProperties: false
>  
> +dependencies:
> +  '#clock-cells': [clocks]
> +  clocks: ['#clock-cells']

This is new to me. Please educate me - does this simply mean that if
'#clock-cells' is given, then also the 'clocks' must be given - and the
other way around?

If so, then:
Acked-By: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>



--
Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland SWDC
K
iviharjunlenkki 1E
90220 OULU
FINLAND

~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~

Simon says - in Latin please.
"non cogito me" dixit Rene Descarte, deinde evanescavit

(Thanks for the translation Simon)
Krzysztof Kozlowski Aug. 25, 2020, 6:55 a.m. UTC | #2
On Tue, Aug 25, 2020 at 06:23:36AM +0000, Vaittinen, Matti wrote:
> 
> Hello Krzysztof,
> 
> On Mon, 2020-08-24 at 21:06 +0200, Krzysztof Kozlowski wrote:
> > The input clock and number of clock provider cells are not required
> > for
> > the PMIC to operate.  They are needed only for the optional bd718x7
> > clock driver.
> 
> I have always found the DT bindings hard to do. I quite often end up
> having a different view with Rob so I probably could just shut-up and
> watch how this evolves :)
> 
> But as keeping my mouth is so difficult...
> 
> ...All of the drivers are optional. The PMIC can power-on without any
> drivers. Drivers are mostly used just for disabling the voltage from
> graphics accelerator block when it is not needed (optional). Or some
> DVS (optional). But yes, maybe the clk driver is "more optional" than
> the rest. XD So, I am not against this.

Each regulator node is optional, it can be skipped. And device will
work and regulator driver will bind. The difference here is that without
clocks the clock driver won't even bind... but if we keep clocks as
required, then multiple DTSes do not pass the bindings check.

I don't have strong feelings about dropping requirement for clocks, just
this looks easier to implement and logical to me (this is a PMIC so
clock is a secondary feature).

> 
> > Add also clock-output-names as driver takes use of it.
> > 
> > This fixes dtbs_check warnings like:
> > 
> >     arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dt.yaml: pmic@4b:
> > 'clocks' is a required property
> >     arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dt.yaml: pmic@4b:
> > '#clock-cells' is a required property
> > 
> > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> > ---
> >  .../devicetree/bindings/mfd/rohm,bd71847-pmic.yaml       | 9
> > +++++++--
> >  1 file changed, 7 insertions(+), 2 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/mfd/rohm,bd71847-
> > pmic.yaml b/Documentation/devicetree/bindings/mfd/rohm,bd71847-
> > pmic.yaml
> > index 77bcca2d414f..5d531051a153 100644
> > --- a/Documentation/devicetree/bindings/mfd/rohm,bd71847-pmic.yaml
> > +++ b/Documentation/devicetree/bindings/mfd/rohm,bd71847-pmic.yaml
> > @@ -38,6 +38,9 @@ properties:
> >    "#clock-cells":
> >      const: 0
> >  
> > +  clock-output-names:
> > +    maxItems: 1
> 
> I had this in original binding (text) document patch series. For some
> reason it was later dropped. Unfortunately I didn't easily find a
> reason as to why. Adding it back now is absolutely fine for me though.
> 
> > +
> >  # The BD71847 abd BD71850 support two different HW states as reset
> > target
> >  # states. States are called as SNVS and READY. At READY state all
> > the PMIC
> >  # power outputs go down and OTP is reload. At the SNVS state all
> > other logic
> > @@ -116,12 +119,14 @@ required:
> >    - compatible
> >    - reg
> >    - interrupts
> > -  - clocks
> > -  - "#clock-cells"
> >    - regulators
> >  
> >  additionalProperties: false
> >  
> > +dependencies:
> > +  '#clock-cells': [clocks]
> > +  clocks: ['#clock-cells']
> 
> This is new to me. Please educate me - does this simply mean that if
> '#clock-cells' is given, then also the 'clocks' must be given - and the
> other way around?

Yes, because the clocks do not have sense without clock-cells and vice versa.

> 
> If so, then:
> Acked-By: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
> 

Thanks.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/mfd/rohm,bd71847-pmic.yaml b/Documentation/devicetree/bindings/mfd/rohm,bd71847-pmic.yaml
index 77bcca2d414f..5d531051a153 100644
--- a/Documentation/devicetree/bindings/mfd/rohm,bd71847-pmic.yaml
+++ b/Documentation/devicetree/bindings/mfd/rohm,bd71847-pmic.yaml
@@ -38,6 +38,9 @@  properties:
   "#clock-cells":
     const: 0
 
+  clock-output-names:
+    maxItems: 1
+
 # The BD71847 abd BD71850 support two different HW states as reset target
 # states. States are called as SNVS and READY. At READY state all the PMIC
 # power outputs go down and OTP is reload. At the SNVS state all other logic
@@ -116,12 +119,14 @@  required:
   - compatible
   - reg
   - interrupts
-  - clocks
-  - "#clock-cells"
   - regulators
 
 additionalProperties: false
 
+dependencies:
+  '#clock-cells': [clocks]
+  clocks: ['#clock-cells']
+
 examples:
   - |
     #include <dt-bindings/interrupt-controller/irq.h>