diff mbox series

[v3,1/4] dt-bindings: phy: qcom,qmp: Mark '#clock-cells' as a 'optional' property

Message ID 20220418205509.1102109-2-bhupesh.sharma@linaro.org
State Superseded
Headers show
Series Fix dtbs_check warning(s) for Qualcomm QMP PHY | expand

Commit Message

Bhupesh Sharma April 18, 2022, 8:55 p.m. UTC
'#clock-cells' is not a required property for qmp-phy(s) in the
'/' node, but it should be is used in 'phy@' subnode (where it is
actually a 'required' property). Fix the same.

This also fixes the following 'make dtbs_check' warning(s):

sm8350-microsoft-surface-duo2.dt.yaml: phy@1d87000:
  '#clock-cells' is a required property

Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Vinod Koul <vkoul@kernel.org>
Cc: Rob Herring <robh+dt@kernel.org>
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
---
 Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Bjorn Andersson April 23, 2022, 3:46 p.m. UTC | #1
On Mon 18 Apr 13:55 PDT 2022, Bhupesh Sharma wrote:

> '#clock-cells' is not a required property for qmp-phy(s) in the
> '/' node, but it should be is used in 'phy@' subnode (where it is
> actually a 'required' property). Fix the same.
> 

It's not that #clock-cells is "not a required property", it's that the
clock comes out of the phy (the child node), so there is no clocks
provided by the parent device.


Please rewrite the commit message.

> This also fixes the following 'make dtbs_check' warning(s):
> 
> sm8350-microsoft-surface-duo2.dt.yaml: phy@1d87000:
>   '#clock-cells' is a required property
> 
> Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
> Cc: Vinod Koul <vkoul@kernel.org>
> Cc: Rob Herring <robh+dt@kernel.org>
> Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
> ---
>  Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml
> index 8b850c5ab116..c39ead81ecd7 100644
> --- a/Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml
> +++ b/Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml
> @@ -66,9 +66,6 @@ properties:
>        - description: Address and length of PHY's common serdes block.
>        - description: Address and length of PHY's DP_COM control block.
>  
> -  "#clock-cells":
> -    enum: [ 1, 2 ]
> -
>    "#address-cells":
>      enum: [ 1, 2 ]
>  
> @@ -112,11 +109,13 @@ patternProperties:
>      description:
>        Each device node of QMP phy is required to have as many child nodes as
>        the number of lanes the PHY has.
> +    properties:
> +      "#clock-cells":
> +        enum: [ 0, 1, 2 ]

The commit message doesn't mention the fact that 0 is also a valid
value. Perhaps just keep it [1, 2] in this patch?

Regards,
Bjorn

>  
>  required:
>    - compatible
>    - reg
> -  - "#clock-cells"
>    - "#address-cells"
>    - "#size-cells"
>    - ranges
> @@ -468,7 +467,6 @@ examples:
>      usb_2_qmpphy: phy-wrapper@88eb000 {
>          compatible = "qcom,sdm845-qmp-usb3-uni-phy";
>          reg = <0x088eb000 0x18c>;
> -        #clock-cells = <1>;
>          #address-cells = <1>;
>          #size-cells = <1>;
>          ranges = <0x0 0x088eb000 0x2000>;
> -- 
> 2.35.1
>
Bhupesh Sharma May 15, 2022, 6:36 a.m. UTC | #2
Hi Bjorn,

On Sat, 23 Apr 2022 at 21:14, Bjorn Andersson
<bjorn.andersson@linaro.org> wrote:
>
> On Mon 18 Apr 13:55 PDT 2022, Bhupesh Sharma wrote:
>
> > '#clock-cells' is not a required property for qmp-phy(s) in the
> > '/' node, but it should be is used in 'phy@' subnode (where it is
> > actually a 'required' property). Fix the same.
> >
>
> It's not that #clock-cells is "not a required property", it's that the
> clock comes out of the phy (the child node), so there is no clocks
> provided by the parent device.
>
>
> Please rewrite the commit message.

Ok.

> > This also fixes the following 'make dtbs_check' warning(s):
> >
> > sm8350-microsoft-surface-duo2.dt.yaml: phy@1d87000:
> >   '#clock-cells' is a required property
> >
> > Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
> > Cc: Vinod Koul <vkoul@kernel.org>
> > Cc: Rob Herring <robh+dt@kernel.org>
> > Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
> > ---
> >  Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml | 8 +++-----
> >  1 file changed, 3 insertions(+), 5 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml
> > index 8b850c5ab116..c39ead81ecd7 100644
> > --- a/Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml
> > +++ b/Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml
> > @@ -66,9 +66,6 @@ properties:
> >        - description: Address and length of PHY's common serdes block.
> >        - description: Address and length of PHY's DP_COM control block.
> >
> > -  "#clock-cells":
> > -    enum: [ 1, 2 ]
> > -
> >    "#address-cells":
> >      enum: [ 1, 2 ]
> >
> > @@ -112,11 +109,13 @@ patternProperties:
> >      description:
> >        Each device node of QMP phy is required to have as many child nodes as
> >        the number of lanes the PHY has.
> > +    properties:
> > +      "#clock-cells":
> > +        enum: [ 0, 1, 2 ]
>
> The commit message doesn't mention the fact that 0 is also a valid
> value. Perhaps just keep it [1, 2] in this patch?

0 is a valid value as mentioned in the example inside the dt-binding
example itself.
For e.g. see the 'sdm845-qmp-pcie-phy' node:

    pcie0_phy: phy@1c06000 {
            compatible = "qcom,sdm845-qmp-pcie-phy";
            <..snip..>

            pcie0_lane: phy@1c06200 {
                    <..snip..>

                #clock-cells = <0>;

So, without [ 0, 1, 2 ] in the yaml bindings we get the following
error while running '$ make dt_binding_check' :
qcom,qmp-phy.example.dtb: phy-wrapper@88eb000:
phy@200:#clock-cells:0:0: 0 is not one of [1, 2]

Thanks,
Bhupesh

> >
> >  required:
> >    - compatible
> >    - reg
> > -  - "#clock-cells"
> >    - "#address-cells"
> >    - "#size-cells"
> >    - ranges
> > @@ -468,7 +467,6 @@ examples:
> >      usb_2_qmpphy: phy-wrapper@88eb000 {
> >          compatible = "qcom,sdm845-qmp-usb3-uni-phy";
> >          reg = <0x088eb000 0x18c>;
> > -        #clock-cells = <1>;
> >          #address-cells = <1>;
> >          #size-cells = <1>;
> >          ranges = <0x0 0x088eb000 0x2000>;
> > --
> > 2.35.1
> >
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml
index 8b850c5ab116..c39ead81ecd7 100644
--- a/Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml
@@ -66,9 +66,6 @@  properties:
       - description: Address and length of PHY's common serdes block.
       - description: Address and length of PHY's DP_COM control block.
 
-  "#clock-cells":
-    enum: [ 1, 2 ]
-
   "#address-cells":
     enum: [ 1, 2 ]
 
@@ -112,11 +109,13 @@  patternProperties:
     description:
       Each device node of QMP phy is required to have as many child nodes as
       the number of lanes the PHY has.
+    properties:
+      "#clock-cells":
+        enum: [ 0, 1, 2 ]
 
 required:
   - compatible
   - reg
-  - "#clock-cells"
   - "#address-cells"
   - "#size-cells"
   - ranges
@@ -468,7 +467,6 @@  examples:
     usb_2_qmpphy: phy-wrapper@88eb000 {
         compatible = "qcom,sdm845-qmp-usb3-uni-phy";
         reg = <0x088eb000 0x18c>;
-        #clock-cells = <1>;
         #address-cells = <1>;
         #size-cells = <1>;
         ranges = <0x0 0x088eb000 0x2000>;