diff mbox series

[v14,3/4] dt-bindings: msm: dsi: add yaml schemas for DSI PHY bindings

Message ID 1616673661-20038-3-git-send-email-mkrishn@codeaurora.org
State Superseded
Headers show
Series [v14,1/4] dt-bindings: msm: disp: add yaml schemas for DPU bindings | expand

Commit Message

Krishna Manikandan March 25, 2021, 12:01 p.m. UTC
Add YAML schema for the device tree bindings for DSI PHY.

Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>

Changes in v1:
   - Merge dsi-phy.yaml and dsi-phy-10nm.yaml (Stephen Boyd)
   - Remove qcom,dsi-phy-regulator-ldo-mode (Stephen Boyd)
   - Add clock cells properly (Stephen Boyd)
   - Remove unnecessary decription from clock names (Stephen Boyd)
   - Add pin names for the supply entries for 10nm phy which is
     used in sc7180 and sdm845 (Stephen Boyd)
   - Remove unused header files from examples (Stephen Boyd)
   - Drop labels for display nodes and correct node name (Stephen Boyd)

Changes in v2:
   - Drop maxItems for clock (Stephen Boyd)
   - Add vdds supply pin information for sdm845 (Stephen Boyd)
   - Add examples for 14nm, 20nm and 28nm phy yaml files (Stephen Boyd)
   - Keep child nodes directly under soc node (Stephen Boyd)

Changes in v3:
   - Use a separate yaml file to describe the common properties
     for all the dsi phy versions (Stephen Boyd)
   - Remove soc from examples (Stephen Boyd)
   - Add description for register property

Changes in v4:
   - Modify the title for all the phy versions (Stephen Boyd)
   - Drop description for all the phy versions (Stephen Boyd)
   - Modify the description for register property (Stephen Boyd)
---
 .../bindings/display/msm/dsi-phy-10nm.yaml         | 68 +++++++++++++++++++++
 .../bindings/display/msm/dsi-phy-14nm.yaml         | 66 ++++++++++++++++++++
 .../bindings/display/msm/dsi-phy-20nm.yaml         | 71 ++++++++++++++++++++++
 .../bindings/display/msm/dsi-phy-28nm.yaml         | 68 +++++++++++++++++++++
 .../bindings/display/msm/dsi-phy-common.yaml       | 41 +++++++++++++
 5 files changed, 314 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml
 create mode 100644 Documentation/devicetree/bindings/display/msm/dsi-phy-14nm.yaml
 create mode 100644 Documentation/devicetree/bindings/display/msm/dsi-phy-20nm.yaml
 create mode 100644 Documentation/devicetree/bindings/display/msm/dsi-phy-28nm.yaml
 create mode 100644 Documentation/devicetree/bindings/display/msm/dsi-phy-common.yaml

Comments

Stephen Boyd March 25, 2021, 10:58 p.m. UTC | #1
Quoting Krishna Manikandan (2021-03-25 05:01:00)
> diff --git a/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml b/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml
> new file mode 100644
> index 0000000..4a26bef
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml
> @@ -0,0 +1,68 @@
> +# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/msm/dsi-phy-10nm.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Qualcomm Display DSI 10nm PHY
> +
> +maintainers:
> +  - Krishna Manikandan <mkrishn@codeaurora.org>
> +
> +allOf:
> +  - $ref: dsi-phy-common.yaml#
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - const: qcom,dsi-phy-10nm
> +      - const: qcom,dsi-phy-10nm-8998
> +
> +  reg:
> +    items:
> +      - description: dsi phy register set
> +      - description: dsi phy lane register set
> +      - description: dsi pll register set
> +
> +  reg-names:
> +    items:
> +      - const: dsi_phy
> +      - const: dsi_phy_lane
> +      - const: dsi_pll
> +
> +  vdds-supply:
> +    description: |
> +      Connected to DSI0_MIPI_DSI_PLL_VDDA0P9 pin for sc7180 target and
> +      connected to VDDA_MIPI_DSI_0_PLL_0P9 pin for sdm845 target
> +
> +required:
> +  - compatible
> +  - reg
> +  - reg-names
> +  - vdds-supply
> +
> +unevaluatedProperties: false

additionalProperties: false instead? This comment applies to the other
bindings in this patch.

> +
> +examples:
> +  - |
> +     #include <dt-bindings/clock/qcom,dispcc-sdm845.h>
> +     #include <dt-bindings/clock/qcom,rpmh.h>
> +
> +     dsi-phy@ae94400 {
> +         compatible = "qcom,dsi-phy-10nm";
> +         reg = <0x0ae94400 0x200>,
> +               <0x0ae94600 0x280>,
> +               <0x0ae94a00 0x1e0>;
> +         reg-names = "dsi_phy",
> +                     "dsi_phy_lane",
> +                     "dsi_pll";
> +
> +         #clock-cells = <1>;
> +         #phy-cells = <0>;
> +
> +         vdds-supply = <&vdda_mipi_dsi0_pll>;
> +         clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
> +                  <&rpmhcc RPMH_CXO_CLK>;
> +         clock-names = "iface", "ref";
> +     };
> +...
> diff --git a/Documentation/devicetree/bindings/display/msm/dsi-phy-14nm.yaml b/Documentation/devicetree/bindings/display/msm/dsi-phy-14nm.yaml
> new file mode 100644
> index 0000000..72a00cc
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/msm/dsi-phy-14nm.yaml
> @@ -0,0 +1,66 @@
> +# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/msm/dsi-phy-14nm.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Qualcomm Display DSI 14nm PHY
> +
> +maintainers:
> +  - Krishna Manikandan <mkrishn@codeaurora.org>
> +
> +allOf:
> +  - $ref: dsi-phy-common.yaml#
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - const: qcom,dsi-phy-14nm
> +      - const: qcom,dsi-phy-14nm-660
> +
> +  reg:
> +    items:
> +      - description: dsi phy register set
> +      - description: dsi phy lane register set
> +      - description: dsi pll register set
> +
> +  reg-names:
> +    items:
> +      - const: dsi_phy
> +      - const: dsi_phy_lane
> +      - const: dsi_pll
> +
> +  vcca-supply:
> +    description: Phandle to vcca regulator device node.
> +
> +required:
> +  - compatible
> +  - reg
> +  - reg-names
> +  - vcca-supply
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +     #include <dt-bindings/clock/qcom,dispcc-sdm845.h>
> +     #include <dt-bindings/clock/qcom,rpmh.h>
> +
> +     dsi-phy@ae94400 {
> +         compatible = "qcom,dsi-phy-14nm";
> +         reg = <0x0ae94400 0x200>,
> +               <0x0ae94600 0x280>,
> +               <0x0ae94a00 0x1e0>;
> +         reg-names = "dsi_phy",
> +                     "dsi_phy_lane",
> +                     "dsi_pll";
> +
> +         #clock-cells = <1>;
> +         #phy-cells = <0>;
> +
> +         vcca-supply = <&vcca_reg>;
> +         clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
> +                  <&rpmhcc RPMH_CXO_CLK>;
> +         clock-names = "iface", "ref";
> +     };
> +...
> diff --git a/Documentation/devicetree/bindings/display/msm/dsi-phy-20nm.yaml b/Documentation/devicetree/bindings/display/msm/dsi-phy-20nm.yaml
> new file mode 100644
> index 0000000..743806d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/msm/dsi-phy-20nm.yaml
> @@ -0,0 +1,71 @@
> +# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/msm/dsi-phy-20nm.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Qualcomm Display DSI 20nm PHY
> +
> +maintainers:
> +  - Krishna Manikandan <mkrishn@codeaurora.org>
> +
> +allOf:
> +  - $ref: dsi-phy-common.yaml#
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - const: qcom,dsi-phy-20nm
> +
> +  reg:
> +    items:
> +      - description: dsi pll register set
> +      - description: dsi phy register set
> +      - description: dsi phy regulator register set
> +
> +  reg-names:
> +    items:
> +      - const: dsi_pll
> +      - const: dsi_phy
> +      - const: dsi_phy_regulator
> +
> +  vcca-supply:
> +    description: Phandle to vcca regulator device node.
> +
> +  vddio-supply:
> +    description: Phandle to vdd-io regulator device node.
> +
> +required:
> +  - compatible
> +  - reg
> +  - reg-names
> +  - vddio-supply
> +  - vcca-supply
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +     #include <dt-bindings/clock/qcom,dispcc-sdm845.h>
> +     #include <dt-bindings/clock/qcom,rpmh.h>
> +
> +     dsi-phy@fd922a00 {
> +         compatible = "qcom,dsi-phy-20nm";
> +         reg = <0xfd922a00 0xd4>,
> +               <0xfd922b00 0x2b0>,
> +               <0xfd922d80 0x7b>;
> +         reg-names = "dsi_pll",
> +                     "dsi_phy",
> +                     "dsi_phy_regulator";
> +
> +         #clock-cells = <1>;
> +         #phy-cells = <0>;
> +
> +         vcca-supply = <&vcca_reg>;
> +         vddio-supply = <&vddio_reg>;
> +
> +         clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
> +                  <&rpmhcc RPMH_CXO_CLK>;
> +         clock-names = "iface", "ref";
> +     };
> +...
> diff --git a/Documentation/devicetree/bindings/display/msm/dsi-phy-28nm.yaml b/Documentation/devicetree/bindings/display/msm/dsi-phy-28nm.yaml
> new file mode 100644
> index 0000000..78f6b16
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/msm/dsi-phy-28nm.yaml
> @@ -0,0 +1,68 @@
> +# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/msm/dsi-phy-28nm.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Qualcomm Display DSI 28nm PHY
> +
> +maintainers:
> +  - Krishna Manikandan <mkrishn@codeaurora.org>
> +
> +allOf:
> +  - $ref: dsi-phy-common.yaml#
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - const: qcom,dsi-phy-28nm-hpm
> +      - const: qcom,dsi-phy-28nm-lp
> +      - const: qcom,dsi-phy-28nm-8960
> +
> +  reg:
> +    items:
> +      - description: dsi pll register set
> +      - description: dsi phy register set
> +      - description: dsi phy regulator register set
> +
> +  reg-names:
> +    items:
> +      - const: dsi_pll
> +      - const: dsi_phy
> +      - const: dsi_phy_regulator
> +
> +  vddio-supply:
> +    description: Phandle to vdd-io regulator device node.
> +
> +required:
> +  - compatible
> +  - reg
> +  - reg-names
> +  - vddio-supply
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +     #include <dt-bindings/clock/qcom,dispcc-sdm845.h>
> +     #include <dt-bindings/clock/qcom,rpmh.h>
> +
> +     dsi-phy@fd922a00 {
> +         compatible = "qcom,dsi-phy-28nm";
> +         reg = <0xfd922a00 0xd4>,
> +               <0xfd922b00 0x2b0>,
> +               <0xfd922d80 0x7b>;
> +         reg-names = "dsi_pll",
> +                     "dsi_phy",
> +                     "dsi_phy_regulator";
> +
> +         #clock-cells = <1>;
> +         #phy-cells = <0>;
> +
> +         vddio-supply = <&vddio_reg>;
> +
> +         clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
> +                  <&rpmhcc RPMH_CXO_CLK>;
> +         clock-names = "iface", "ref";
> +     };
> +...
> diff --git a/Documentation/devicetree/bindings/display/msm/dsi-phy-common.yaml b/Documentation/devicetree/bindings/display/msm/dsi-phy-common.yaml
> new file mode 100644
> index 0000000..c81399f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/msm/dsi-phy-common.yaml
> @@ -0,0 +1,41 @@
> +# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/msm/dsi-phy-common.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Description of Qualcomm Display DSI PHY common dt properties
> +
> +maintainers:
> +  - Krishna Manikandan <mkrishn@codeaurora.org>
> +
> +description: |
> +  This defines the DSI PHY dt properties which are common for all
> +  dsi phy versions.
> +
> +properties:
> +  "#clock-cells":
> +    const: 1
> +
> +  "#phy-cells":
> +    const: 0
> +
> +  power-domains:
> +    maxItems: 1
> +
> +  clocks:
> +    items:
> +      - description: Display AHB clock
> +      - description: Board XO source
> +
> +  clock-names:
> +    items:
> +      - const: iface
> +      - const: ref
> +
> +required:
> +  - clocks
> +  - clock-names

Why isn't #phy-cells and #clock-cells always required? I would guess
power-domains may also always be required.

> +
> +additionalProperties: true
> +...
Krishna Manikandan March 26, 2021, 10:36 a.m. UTC | #2
On 2021-03-26 04:28, Stephen Boyd wrote:
> Quoting Krishna Manikandan (2021-03-25 05:01:00)

>> diff --git 

>> a/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml 

>> b/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml

>> new file mode 100644

>> index 0000000..4a26bef

>> --- /dev/null

>> +++ b/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml

>> @@ -0,0 +1,68 @@

>> +# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause

>> +%YAML 1.2

>> +---

>> +$id: http://devicetree.org/schemas/display/msm/dsi-phy-10nm.yaml#

>> +$schema: http://devicetree.org/meta-schemas/core.yaml#

>> +

>> +title: Qualcomm Display DSI 10nm PHY

>> +

>> +maintainers:

>> +  - Krishna Manikandan <mkrishn@codeaurora.org>

>> +

>> +allOf:

>> +  - $ref: dsi-phy-common.yaml#

>> +

>> +properties:

>> +  compatible:

>> +    oneOf:

>> +      - const: qcom,dsi-phy-10nm

>> +      - const: qcom,dsi-phy-10nm-8998

>> +

>> +  reg:

>> +    items:

>> +      - description: dsi phy register set

>> +      - description: dsi phy lane register set

>> +      - description: dsi pll register set

>> +

>> +  reg-names:

>> +    items:

>> +      - const: dsi_phy

>> +      - const: dsi_phy_lane

>> +      - const: dsi_pll

>> +

>> +  vdds-supply:

>> +    description: |

>> +      Connected to DSI0_MIPI_DSI_PLL_VDDA0P9 pin for sc7180 target 

>> and

>> +      connected to VDDA_MIPI_DSI_0_PLL_0P9 pin for sdm845 target

>> +

>> +required:

>> +  - compatible

>> +  - reg

>> +  - reg-names

>> +  - vdds-supply

>> +

>> +unevaluatedProperties: false

> 

> additionalProperties: false instead? This comment applies to the other

> bindings in this patch.


Hi Stephen,
We are referencing dsi-phy-common.yaml in this file. Since the 
properties of dsi-phy-common.yaml are applicable to this file also, I 
added unevaluatedProperties: false. If we add additionalProperties: 
false instead, then the properties of dsi-phy-common.yaml will not be 
applicable here and this will throw an error if we add the properties 
from dsi-phy-common.yaml in the example.
I will address all other comments in the next patchset.

Thanks,
Krishna
> 

>> +

>> +examples:

>> +  - |

>> +     #include <dt-bindings/clock/qcom,dispcc-sdm845.h>

>> +     #include <dt-bindings/clock/qcom,rpmh.h>

>> +

>> +     dsi-phy@ae94400 {

>> +         compatible = "qcom,dsi-phy-10nm";

>> +         reg = <0x0ae94400 0x200>,

>> +               <0x0ae94600 0x280>,

>> +               <0x0ae94a00 0x1e0>;

>> +         reg-names = "dsi_phy",

>> +                     "dsi_phy_lane",

>> +                     "dsi_pll";

>> +

>> +         #clock-cells = <1>;

>> +         #phy-cells = <0>;

>> +

>> +         vdds-supply = <&vdda_mipi_dsi0_pll>;

>> +         clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,

>> +                  <&rpmhcc RPMH_CXO_CLK>;

>> +         clock-names = "iface", "ref";

>> +     };

>> +...

>> diff --git 

>> a/Documentation/devicetree/bindings/display/msm/dsi-phy-14nm.yaml 

>> b/Documentation/devicetree/bindings/display/msm/dsi-phy-14nm.yaml

>> new file mode 100644

>> index 0000000..72a00cc

>> --- /dev/null

>> +++ b/Documentation/devicetree/bindings/display/msm/dsi-phy-14nm.yaml

>> @@ -0,0 +1,66 @@

>> +# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause

>> +%YAML 1.2

>> +---

>> +$id: http://devicetree.org/schemas/display/msm/dsi-phy-14nm.yaml#

>> +$schema: http://devicetree.org/meta-schemas/core.yaml#

>> +

>> +title: Qualcomm Display DSI 14nm PHY

>> +

>> +maintainers:

>> +  - Krishna Manikandan <mkrishn@codeaurora.org>

>> +

>> +allOf:

>> +  - $ref: dsi-phy-common.yaml#

>> +

>> +properties:

>> +  compatible:

>> +    oneOf:

>> +      - const: qcom,dsi-phy-14nm

>> +      - const: qcom,dsi-phy-14nm-660

>> +

>> +  reg:

>> +    items:

>> +      - description: dsi phy register set

>> +      - description: dsi phy lane register set

>> +      - description: dsi pll register set

>> +

>> +  reg-names:

>> +    items:

>> +      - const: dsi_phy

>> +      - const: dsi_phy_lane

>> +      - const: dsi_pll

>> +

>> +  vcca-supply:

>> +    description: Phandle to vcca regulator device node.

>> +

>> +required:

>> +  - compatible

>> +  - reg

>> +  - reg-names

>> +  - vcca-supply

>> +

>> +unevaluatedProperties: false

>> +

>> +examples:

>> +  - |

>> +     #include <dt-bindings/clock/qcom,dispcc-sdm845.h>

>> +     #include <dt-bindings/clock/qcom,rpmh.h>

>> +

>> +     dsi-phy@ae94400 {

>> +         compatible = "qcom,dsi-phy-14nm";

>> +         reg = <0x0ae94400 0x200>,

>> +               <0x0ae94600 0x280>,

>> +               <0x0ae94a00 0x1e0>;

>> +         reg-names = "dsi_phy",

>> +                     "dsi_phy_lane",

>> +                     "dsi_pll";

>> +

>> +         #clock-cells = <1>;

>> +         #phy-cells = <0>;

>> +

>> +         vcca-supply = <&vcca_reg>;

>> +         clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,

>> +                  <&rpmhcc RPMH_CXO_CLK>;

>> +         clock-names = "iface", "ref";

>> +     };

>> +...

>> diff --git 

>> a/Documentation/devicetree/bindings/display/msm/dsi-phy-20nm.yaml 

>> b/Documentation/devicetree/bindings/display/msm/dsi-phy-20nm.yaml

>> new file mode 100644

>> index 0000000..743806d

>> --- /dev/null

>> +++ b/Documentation/devicetree/bindings/display/msm/dsi-phy-20nm.yaml

>> @@ -0,0 +1,71 @@

>> +# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause

>> +%YAML 1.2

>> +---

>> +$id: http://devicetree.org/schemas/display/msm/dsi-phy-20nm.yaml#

>> +$schema: http://devicetree.org/meta-schemas/core.yaml#

>> +

>> +title: Qualcomm Display DSI 20nm PHY

>> +

>> +maintainers:

>> +  - Krishna Manikandan <mkrishn@codeaurora.org>

>> +

>> +allOf:

>> +  - $ref: dsi-phy-common.yaml#

>> +

>> +properties:

>> +  compatible:

>> +    oneOf:

>> +      - const: qcom,dsi-phy-20nm

>> +

>> +  reg:

>> +    items:

>> +      - description: dsi pll register set

>> +      - description: dsi phy register set

>> +      - description: dsi phy regulator register set

>> +

>> +  reg-names:

>> +    items:

>> +      - const: dsi_pll

>> +      - const: dsi_phy

>> +      - const: dsi_phy_regulator

>> +

>> +  vcca-supply:

>> +    description: Phandle to vcca regulator device node.

>> +

>> +  vddio-supply:

>> +    description: Phandle to vdd-io regulator device node.

>> +

>> +required:

>> +  - compatible

>> +  - reg

>> +  - reg-names

>> +  - vddio-supply

>> +  - vcca-supply

>> +

>> +unevaluatedProperties: false

>> +

>> +examples:

>> +  - |

>> +     #include <dt-bindings/clock/qcom,dispcc-sdm845.h>

>> +     #include <dt-bindings/clock/qcom,rpmh.h>

>> +

>> +     dsi-phy@fd922a00 {

>> +         compatible = "qcom,dsi-phy-20nm";

>> +         reg = <0xfd922a00 0xd4>,

>> +               <0xfd922b00 0x2b0>,

>> +               <0xfd922d80 0x7b>;

>> +         reg-names = "dsi_pll",

>> +                     "dsi_phy",

>> +                     "dsi_phy_regulator";

>> +

>> +         #clock-cells = <1>;

>> +         #phy-cells = <0>;

>> +

>> +         vcca-supply = <&vcca_reg>;

>> +         vddio-supply = <&vddio_reg>;

>> +

>> +         clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,

>> +                  <&rpmhcc RPMH_CXO_CLK>;

>> +         clock-names = "iface", "ref";

>> +     };

>> +...

>> diff --git 

>> a/Documentation/devicetree/bindings/display/msm/dsi-phy-28nm.yaml 

>> b/Documentation/devicetree/bindings/display/msm/dsi-phy-28nm.yaml

>> new file mode 100644

>> index 0000000..78f6b16

>> --- /dev/null

>> +++ b/Documentation/devicetree/bindings/display/msm/dsi-phy-28nm.yaml

>> @@ -0,0 +1,68 @@

>> +# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause

>> +%YAML 1.2

>> +---

>> +$id: http://devicetree.org/schemas/display/msm/dsi-phy-28nm.yaml#

>> +$schema: http://devicetree.org/meta-schemas/core.yaml#

>> +

>> +title: Qualcomm Display DSI 28nm PHY

>> +

>> +maintainers:

>> +  - Krishna Manikandan <mkrishn@codeaurora.org>

>> +

>> +allOf:

>> +  - $ref: dsi-phy-common.yaml#

>> +

>> +properties:

>> +  compatible:

>> +    oneOf:

>> +      - const: qcom,dsi-phy-28nm-hpm

>> +      - const: qcom,dsi-phy-28nm-lp

>> +      - const: qcom,dsi-phy-28nm-8960

>> +

>> +  reg:

>> +    items:

>> +      - description: dsi pll register set

>> +      - description: dsi phy register set

>> +      - description: dsi phy regulator register set

>> +

>> +  reg-names:

>> +    items:

>> +      - const: dsi_pll

>> +      - const: dsi_phy

>> +      - const: dsi_phy_regulator

>> +

>> +  vddio-supply:

>> +    description: Phandle to vdd-io regulator device node.

>> +

>> +required:

>> +  - compatible

>> +  - reg

>> +  - reg-names

>> +  - vddio-supply

>> +

>> +unevaluatedProperties: false

>> +

>> +examples:

>> +  - |

>> +     #include <dt-bindings/clock/qcom,dispcc-sdm845.h>

>> +     #include <dt-bindings/clock/qcom,rpmh.h>

>> +

>> +     dsi-phy@fd922a00 {

>> +         compatible = "qcom,dsi-phy-28nm";

>> +         reg = <0xfd922a00 0xd4>,

>> +               <0xfd922b00 0x2b0>,

>> +               <0xfd922d80 0x7b>;

>> +         reg-names = "dsi_pll",

>> +                     "dsi_phy",

>> +                     "dsi_phy_regulator";

>> +

>> +         #clock-cells = <1>;

>> +         #phy-cells = <0>;

>> +

>> +         vddio-supply = <&vddio_reg>;

>> +

>> +         clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,

>> +                  <&rpmhcc RPMH_CXO_CLK>;

>> +         clock-names = "iface", "ref";

>> +     };

>> +...

>> diff --git 

>> a/Documentation/devicetree/bindings/display/msm/dsi-phy-common.yaml 

>> b/Documentation/devicetree/bindings/display/msm/dsi-phy-common.yaml

>> new file mode 100644

>> index 0000000..c81399f

>> --- /dev/null

>> +++ 

>> b/Documentation/devicetree/bindings/display/msm/dsi-phy-common.yaml

>> @@ -0,0 +1,41 @@

>> +# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause

>> +%YAML 1.2

>> +---

>> +$id: http://devicetree.org/schemas/display/msm/dsi-phy-common.yaml#

>> +$schema: http://devicetree.org/meta-schemas/core.yaml#

>> +

>> +title: Description of Qualcomm Display DSI PHY common dt properties

>> +

>> +maintainers:

>> +  - Krishna Manikandan <mkrishn@codeaurora.org>

>> +

>> +description: |

>> +  This defines the DSI PHY dt properties which are common for all

>> +  dsi phy versions.

>> +

>> +properties:

>> +  "#clock-cells":

>> +    const: 1

>> +

>> +  "#phy-cells":

>> +    const: 0

>> +

>> +  power-domains:

>> +    maxItems: 1

>> +

>> +  clocks:

>> +    items:

>> +      - description: Display AHB clock

>> +      - description: Board XO source

>> +

>> +  clock-names:

>> +    items:

>> +      - const: iface

>> +      - const: ref

>> +

>> +required:

>> +  - clocks

>> +  - clock-names

> 

> Why isn't #phy-cells and #clock-cells always required? I would guess

> power-domains may also always be required.

> 

>> +

>> +additionalProperties: true

>> +...
Stephen Boyd March 29, 2021, 3:19 a.m. UTC | #3
Quoting mkrishn@codeaurora.org (2021-03-26 03:36:30)
> On 2021-03-26 04:28, Stephen Boyd wrote:

> > Quoting Krishna Manikandan (2021-03-25 05:01:00)

> >> diff --git 

> >> a/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml 

> >> b/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml

> >> new file mode 100644

> >> index 0000000..4a26bef

> >> --- /dev/null

> >> +++ b/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml

> >> @@ -0,0 +1,68 @@

> >> +# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause

> >> +%YAML 1.2

> >> +---

> >> +$id: http://devicetree.org/schemas/display/msm/dsi-phy-10nm.yaml#

> >> +$schema: http://devicetree.org/meta-schemas/core.yaml#

> >> +

> >> +title: Qualcomm Display DSI 10nm PHY

> >> +

> >> +maintainers:

> >> +  - Krishna Manikandan <mkrishn@codeaurora.org>

> >> +

> >> +allOf:

> >> +  - $ref: dsi-phy-common.yaml#

> >> +

> >> +properties:

> >> +  compatible:

> >> +    oneOf:

[..]
> >> and

> >> +      connected to VDDA_MIPI_DSI_0_PLL_0P9 pin for sdm845 target

> >> +

> >> +required:

> >> +  - compatible

> >> +  - reg

> >> +  - reg-names

> >> +  - vdds-supply

> >> +

> >> +unevaluatedProperties: false

> > 

> > additionalProperties: false instead? This comment applies to the other

> > bindings in this patch.

> 

> Hi Stephen,

> We are referencing dsi-phy-common.yaml in this file. Since the 

> properties of dsi-phy-common.yaml are applicable to this file also, I 

> added unevaluatedProperties: false. If we add additionalProperties: 

> false instead, then the properties of dsi-phy-common.yaml will not be 

> applicable here and this will throw an error if we add the properties 

> from dsi-phy-common.yaml in the example.

> 


Does that matter? I was wondering about that and so I peeked at the
qcom pinctrl binding and it seems to follow a similar design but doesn't
have unevaluatedProperties: false. Instead it has additionalProperies:
false. See qcom,sc8180x-pinctrl.yaml for an example. So did you try it
or does something say you can't do this?
Krishna Manikandan March 30, 2021, 9:22 a.m. UTC | #4
On 2021-03-29 08:49, Stephen Boyd wrote:
> Quoting mkrishn@codeaurora.org (2021-03-26 03:36:30)

>> On 2021-03-26 04:28, Stephen Boyd wrote:

>> > Quoting Krishna Manikandan (2021-03-25 05:01:00)

>> >> diff --git

>> >> a/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml

>> >> b/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml

>> >> new file mode 100644

>> >> index 0000000..4a26bef

>> >> --- /dev/null

>> >> +++ b/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml

>> >> @@ -0,0 +1,68 @@

>> >> +# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause

>> >> +%YAML 1.2

>> >> +---

>> >> +$id: http://devicetree.org/schemas/display/msm/dsi-phy-10nm.yaml#

>> >> +$schema: http://devicetree.org/meta-schemas/core.yaml#

>> >> +

>> >> +title: Qualcomm Display DSI 10nm PHY

>> >> +

>> >> +maintainers:

>> >> +  - Krishna Manikandan <mkrishn@codeaurora.org>

>> >> +

>> >> +allOf:

>> >> +  - $ref: dsi-phy-common.yaml#

>> >> +

>> >> +properties:

>> >> +  compatible:

>> >> +    oneOf:

> [..]

>> >> and

>> >> +      connected to VDDA_MIPI_DSI_0_PLL_0P9 pin for sdm845 target

>> >> +

>> >> +required:

>> >> +  - compatible

>> >> +  - reg

>> >> +  - reg-names

>> >> +  - vdds-supply

>> >> +

>> >> +unevaluatedProperties: false

>> >

>> > additionalProperties: false instead? This comment applies to the other

>> > bindings in this patch.

>> 

>> Hi Stephen,

>> We are referencing dsi-phy-common.yaml in this file. Since the

>> properties of dsi-phy-common.yaml are applicable to this file also, I

>> added unevaluatedProperties: false. If we add additionalProperties:

>> false instead, then the properties of dsi-phy-common.yaml will not be

>> applicable here and this will throw an error if we add the properties

>> from dsi-phy-common.yaml in the example.

>> 

> 

> Does that matter? I was wondering about that and so I peeked at the

> qcom pinctrl binding and it seems to follow a similar design but 

> doesn't

> have unevaluatedProperties: false. Instead it has additionalProperies:

> false. See qcom,sc8180x-pinctrl.yaml for an example. So did you try it

> or does something say you can't do this?


Hi Stephen,
I had tried the same thing in one of my initial patches and I got a 
comment from Rob that we have to use unevaluatedProperties when we are 
referring another 
file(https://patchwork.kernel.org/project/linux-arm-msm/patch/1589868421-30062-1-git-send-email-mkrishn@codeaurora.org/)
In latest dt-schema tool, we will get error if we try to change it to 
additionalProperties: false.
For example, in this patch "#clock-cells' and '#phy-cells' are mentioned 
in dsi-phy-common.yaml and I am referring this file in 
dsi-phy-10nm.yaml. If I add
additionalProperties: false instead of unevaluatedProperties: false, I 
will get the error mentioned below.

I checked qcom,sc8180x-pinctrl.yaml that you had mentioned in the 
comment and this file is compiling without any issues even though it is 
using additionalProperties: false. But I see that the properties 
mentioned in the reference file (in this case, qcom,tlmm-common.yaml) 
are again declared in the main file qcom,sc8180x-pinctrl.yaml even 
though these are mentioned as required properties in the common yaml 
file. If I remove these properties from qcom,sc8180x-pinctrl.yaml, I can 
see the same error that I am getting for my file also if 
additionalProperties are used. If I follow the same approach , ie define 
the properties again in dsi-phy-10nm.yaml and add additionalProperties: 
false, I dont see any errors during check (working change mentioned 
below). Should I make this change for all the files?

Error logs:
mkrishn@mkrishn-linux:/local/mnt/workspace/linux-next-latest/linux-next$ 
  make dt_binding_check 
DT_SCHEMA_FILES=Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml
   CHKDT   
Documentation/devicetree/bindings/processed-schema-examples.json
   SCHEMA  
Documentation/devicetree/bindings/processed-schema-examples.json
   DTEX    
Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.example.dts
   DTC     
Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.example.dt.yaml
   CHECK   
Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.example.dt.yaml
/local/mnt/workspace/linux-next-latest/linux-next/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.example.dt.yaml: 
dsi-phy@ae94400: '#clock-cells', '#phy-cells', 'clock-names', 'clocks' 
do not match any of the regexes: 'pinctrl-[0-9]+'
         From schema: 
/local/mnt/workspace/linux-next-latest/linux-next/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml

Working Change:
--- a/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml
+++ b/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml
@@ -30,6 +30,11 @@ properties:
        - const: dsi_phy_lane
        - const: dsi_pll

+  '#clock-cells': true
+  '#phy-cells': true
+  clocks: true
+  clock-names: true
+
    vdds-supply:
      description: |
        Connected to DSI0_MIPI_DSI_PLL_VDDA0P9 pin for sc7180 target and
@@ -41,7 +46,7 @@ required:
    - reg-names
    - vdds-supply

-unevaluatedProperties: false
+additionalProperties: false

Thanks,
Krishna
Stephen Boyd March 30, 2021, 7:17 p.m. UTC | #5
Quoting mkrishn@codeaurora.org (2021-03-30 02:22:29)
> On 2021-03-29 08:49, Stephen Boyd wrote:

> > 

> > Does that matter? I was wondering about that and so I peeked at the

> > qcom pinctrl binding and it seems to follow a similar design but 

> > doesn't

> > have unevaluatedProperties: false. Instead it has additionalProperies:

> > false. See qcom,sc8180x-pinctrl.yaml for an example. So did you try it

> > or does something say you can't do this?

> 

> Hi Stephen,

> I had tried the same thing in one of my initial patches and I got a 

> comment from Rob that we have to use unevaluatedProperties when we are 

> referring another 

> file(https://patchwork.kernel.org/project/linux-arm-msm/patch/1589868421-30062-1-git-send-email-mkrishn@codeaurora.org/)

> In latest dt-schema tool, we will get error if we try to change it to 

> additionalProperties: false.

> For example, in this patch "#clock-cells' and '#phy-cells' are mentioned 

> in dsi-phy-common.yaml and I am referring this file in 

> dsi-phy-10nm.yaml. If I add

> additionalProperties: false instead of unevaluatedProperties: false, I 

> will get the error mentioned below.

> 

> I checked qcom,sc8180x-pinctrl.yaml that you had mentioned in the 

> comment and this file is compiling without any issues even though it is 

> using additionalProperties: false. But I see that the properties 

> mentioned in the reference file (in this case, qcom,tlmm-common.yaml) 

> are again declared in the main file qcom,sc8180x-pinctrl.yaml even 

> though these are mentioned as required properties in the common yaml 

> file. If I remove these properties from qcom,sc8180x-pinctrl.yaml, I can 

> see the same error that I am getting for my file also if 

> additionalProperties are used. If I follow the same approach , ie define 

> the properties again in dsi-phy-10nm.yaml and add additionalProperties: 

> false, I dont see any errors during check (working change mentioned 

> below). Should I make this change for all the files?


Honestly I don't know. Can you resend this series and Cc
<robh+dt@kernel.org> and <devicetree@vger.kernel.org>? You don't have to
change this part, but it would be good to call out that you decided to
stick with unevaluatedProperties vs. additionalProperties somewhere in
the changelog or commit text.
Rob Herring March 30, 2021, 7:42 p.m. UTC | #6
On Tue, Mar 30, 2021 at 02:52:29PM +0530, mkrishn@codeaurora.org wrote:
> On 2021-03-29 08:49, Stephen Boyd wrote:

> > Quoting mkrishn@codeaurora.org (2021-03-26 03:36:30)

> > > On 2021-03-26 04:28, Stephen Boyd wrote:

> > > > Quoting Krishna Manikandan (2021-03-25 05:01:00)

> > > >> diff --git

> > > >> a/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml

> > > >> b/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml

> > > >> new file mode 100644

> > > >> index 0000000..4a26bef

> > > >> --- /dev/null

> > > >> +++ b/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml

> > > >> @@ -0,0 +1,68 @@

> > > >> +# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause

> > > >> +%YAML 1.2

> > > >> +---

> > > >> +$id: http://devicetree.org/schemas/display/msm/dsi-phy-10nm.yaml#

> > > >> +$schema: http://devicetree.org/meta-schemas/core.yaml#

> > > >> +

> > > >> +title: Qualcomm Display DSI 10nm PHY

> > > >> +

> > > >> +maintainers:

> > > >> +  - Krishna Manikandan <mkrishn@codeaurora.org>

> > > >> +

> > > >> +allOf:

> > > >> +  - $ref: dsi-phy-common.yaml#

> > > >> +

> > > >> +properties:

> > > >> +  compatible:

> > > >> +    oneOf:

> > [..]

> > > >> and

> > > >> +      connected to VDDA_MIPI_DSI_0_PLL_0P9 pin for sdm845 target

> > > >> +

> > > >> +required:

> > > >> +  - compatible

> > > >> +  - reg

> > > >> +  - reg-names

> > > >> +  - vdds-supply

> > > >> +

> > > >> +unevaluatedProperties: false

> > > >

> > > > additionalProperties: false instead? This comment applies to the other

> > > > bindings in this patch.

> > > 

> > > Hi Stephen,

> > > We are referencing dsi-phy-common.yaml in this file. Since the

> > > properties of dsi-phy-common.yaml are applicable to this file also, I

> > > added unevaluatedProperties: false. If we add additionalProperties:

> > > false instead, then the properties of dsi-phy-common.yaml will not be

> > > applicable here and this will throw an error if we add the properties

> > > from dsi-phy-common.yaml in the example.

> > > 

> > 

> > Does that matter? I was wondering about that and so I peeked at the

> > qcom pinctrl binding and it seems to follow a similar design but doesn't

> > have unevaluatedProperties: false. Instead it has additionalProperies:

> > false. See qcom,sc8180x-pinctrl.yaml for an example. So did you try it

> > or does something say you can't do this?

> 

> Hi Stephen,

> I had tried the same thing in one of my initial patches and I got a comment

> from Rob that we have to use unevaluatedProperties when we are referring

> another file(https://patchwork.kernel.org/project/linux-arm-msm/patch/1589868421-30062-1-git-send-email-mkrishn@codeaurora.org/)


Maybe I had a wrong assumption that you needed the child nodes too?

> In latest dt-schema tool, we will get error if we try to change it to

> additionalProperties: false.

> For example, in this patch "#clock-cells' and '#phy-cells' are mentioned in

> dsi-phy-common.yaml and I am referring this file in dsi-phy-10nm.yaml. If I

> add

> additionalProperties: false instead of unevaluatedProperties: false, I will

> get the error mentioned below.

> 

> I checked qcom,sc8180x-pinctrl.yaml that you had mentioned in the comment

> and this file is compiling without any issues even though it is using

> additionalProperties: false. But I see that the properties mentioned in the

> reference file (in this case, qcom,tlmm-common.yaml) are again declared in

> the main file qcom,sc8180x-pinctrl.yaml even though these are mentioned as

> required properties in the common yaml file. If I remove these properties

> from qcom,sc8180x-pinctrl.yaml, I can see the same error that I am getting

> for my file also if additionalProperties are used. If I follow the same

> approach , ie define the properties again in dsi-phy-10nm.yaml and add

> additionalProperties: false, I dont see any errors during check (working

> change mentioned below). Should I make this change for all the files?

> 

> Error logs:

> mkrishn@mkrishn-linux:/local/mnt/workspace/linux-next-latest/linux-next$

> make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml

>   CHKDT   Documentation/devicetree/bindings/processed-schema-examples.json

>   SCHEMA  Documentation/devicetree/bindings/processed-schema-examples.json

>   DTEX

> Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.example.dts

>   DTC

> Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.example.dt.yaml

>   CHECK

> Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.example.dt.yaml

> /local/mnt/workspace/linux-next-latest/linux-next/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.example.dt.yaml:

> dsi-phy@ae94400: '#clock-cells', '#phy-cells', 'clock-names', 'clocks' do

> not match any of the regexes: 'pinctrl-[0-9]+'

>         From schema: /local/mnt/workspace/linux-next-latest/linux-next/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml

> 

> Working Change:

> --- a/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml

> +++ b/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml

> @@ -30,6 +30,11 @@ properties:

>        - const: dsi_phy_lane

>        - const: dsi_pll

> 

> +  '#clock-cells': true

> +  '#phy-cells': true

> +  clocks: true

> +  clock-names: true

> +

>    vdds-supply:

>      description: |

>        Connected to DSI0_MIPI_DSI_PLL_VDDA0P9 pin for sc7180 target and

> @@ -41,7 +46,7 @@ required:

>    - reg-names

>    - vdds-supply

> 

> -unevaluatedProperties: false

> +additionalProperties: false


This works if you want to use some, but not all properties in a 
referenced schema. If all apply or listing them all here is too much 
duplication (such as child nodes, but that's a judgement call), then use 
'unevaluatedProperties'.

unevaluatedProperties is also currently a nop because the underlying 
tools don't yet support it. So it won't catch any errors and those 
errors will all have to be fixed when the tools add support.

Rob
Krishna Manikandan March 31, 2021, 4:02 a.m. UTC | #7
On 2021-03-31 01:12, Rob Herring wrote:
> On Tue, Mar 30, 2021 at 02:52:29PM +0530, mkrishn@codeaurora.org wrote:

>> On 2021-03-29 08:49, Stephen Boyd wrote:

>> > Quoting mkrishn@codeaurora.org (2021-03-26 03:36:30)

>> > > On 2021-03-26 04:28, Stephen Boyd wrote:

>> > > > Quoting Krishna Manikandan (2021-03-25 05:01:00)

>> > > >> diff --git

>> > > >> a/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml

>> > > >> b/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml

>> > > >> new file mode 100644

>> > > >> index 0000000..4a26bef

>> > > >> --- /dev/null

>> > > >> +++ b/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml

>> > > >> @@ -0,0 +1,68 @@

>> > > >> +# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause

>> > > >> +%YAML 1.2

>> > > >> +---

>> > > >> +$id: http://devicetree.org/schemas/display/msm/dsi-phy-10nm.yaml#

>> > > >> +$schema: http://devicetree.org/meta-schemas/core.yaml#

>> > > >> +

>> > > >> +title: Qualcomm Display DSI 10nm PHY

>> > > >> +

>> > > >> +maintainers:

>> > > >> +  - Krishna Manikandan <mkrishn@codeaurora.org>

>> > > >> +

>> > > >> +allOf:

>> > > >> +  - $ref: dsi-phy-common.yaml#

>> > > >> +

>> > > >> +properties:

>> > > >> +  compatible:

>> > > >> +    oneOf:

>> > [..]

>> > > >> and

>> > > >> +      connected to VDDA_MIPI_DSI_0_PLL_0P9 pin for sdm845 target

>> > > >> +

>> > > >> +required:

>> > > >> +  - compatible

>> > > >> +  - reg

>> > > >> +  - reg-names

>> > > >> +  - vdds-supply

>> > > >> +

>> > > >> +unevaluatedProperties: false

>> > > >

>> > > > additionalProperties: false instead? This comment applies to the other

>> > > > bindings in this patch.

>> > >

>> > > Hi Stephen,

>> > > We are referencing dsi-phy-common.yaml in this file. Since the

>> > > properties of dsi-phy-common.yaml are applicable to this file also, I

>> > > added unevaluatedProperties: false. If we add additionalProperties:

>> > > false instead, then the properties of dsi-phy-common.yaml will not be

>> > > applicable here and this will throw an error if we add the properties

>> > > from dsi-phy-common.yaml in the example.

>> > >

>> >

>> > Does that matter? I was wondering about that and so I peeked at the

>> > qcom pinctrl binding and it seems to follow a similar design but doesn't

>> > have unevaluatedProperties: false. Instead it has additionalProperies:

>> > false. See qcom,sc8180x-pinctrl.yaml for an example. So did you try it

>> > or does something say you can't do this?

>> 

>> Hi Stephen,

>> I had tried the same thing in one of my initial patches and I got a 

>> comment

>> from Rob that we have to use unevaluatedProperties when we are 

>> referring

>> another 

>> file(https://patchwork.kernel.org/project/linux-arm-msm/patch/1589868421-30062-1-git-send-email-mkrishn@codeaurora.org/)

> 

> Maybe I had a wrong assumption that you needed the child nodes too?

> 

>> In latest dt-schema tool, we will get error if we try to change it to

>> additionalProperties: false.

>> For example, in this patch "#clock-cells' and '#phy-cells' are 

>> mentioned in

>> dsi-phy-common.yaml and I am referring this file in dsi-phy-10nm.yaml. 

>> If I

>> add

>> additionalProperties: false instead of unevaluatedProperties: false, I 

>> will

>> get the error mentioned below.

>> 

>> I checked qcom,sc8180x-pinctrl.yaml that you had mentioned in the 

>> comment

>> and this file is compiling without any issues even though it is using

>> additionalProperties: false. But I see that the properties mentioned 

>> in the

>> reference file (in this case, qcom,tlmm-common.yaml) are again 

>> declared in

>> the main file qcom,sc8180x-pinctrl.yaml even though these are 

>> mentioned as

>> required properties in the common yaml file. If I remove these 

>> properties

>> from qcom,sc8180x-pinctrl.yaml, I can see the same error that I am 

>> getting

>> for my file also if additionalProperties are used. If I follow the 

>> same

>> approach , ie define the properties again in dsi-phy-10nm.yaml and add

>> additionalProperties: false, I dont see any errors during check 

>> (working

>> change mentioned below). Should I make this change for all the files?

>> 

>> Error logs:

>> mkrishn@mkrishn-linux:/local/mnt/workspace/linux-next-latest/linux-next$

>> make dt_binding_check 

>> DT_SCHEMA_FILES=Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml

>>   CHKDT   

>> Documentation/devicetree/bindings/processed-schema-examples.json

>>   SCHEMA  

>> Documentation/devicetree/bindings/processed-schema-examples.json

>>   DTEX

>> Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.example.dts

>>   DTC

>> Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.example.dt.yaml

>>   CHECK

>> Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.example.dt.yaml

>> /local/mnt/workspace/linux-next-latest/linux-next/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.example.dt.yaml:

>> dsi-phy@ae94400: '#clock-cells', '#phy-cells', 'clock-names', 'clocks' 

>> do

>> not match any of the regexes: 'pinctrl-[0-9]+'

>>         From schema: 

>> /local/mnt/workspace/linux-next-latest/linux-next/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml

>> 

>> Working Change:

>> --- a/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml

>> +++ b/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml

>> @@ -30,6 +30,11 @@ properties:

>>        - const: dsi_phy_lane

>>        - const: dsi_pll

>> 

>> +  '#clock-cells': true

>> +  '#phy-cells': true

>> +  clocks: true

>> +  clock-names: true

>> +

>>    vdds-supply:

>>      description: |

>>        Connected to DSI0_MIPI_DSI_PLL_VDDA0P9 pin for sc7180 target 

>> and

>> @@ -41,7 +46,7 @@ required:

>>    - reg-names

>>    - vdds-supply

>> 

>> -unevaluatedProperties: false

>> +additionalProperties: false

> 

> This works if you want to use some, but not all properties in a

> referenced schema. If all apply or listing them all here is too much

> duplication (such as child nodes, but that's a judgement call), then 

> use

> 'unevaluatedProperties'.

> 

> unevaluatedProperties is also currently a nop because the underlying

> tools don't yet support it. So it won't catch any errors and those

> errors will all have to be fixed when the tools add support.

> 

> Rob


Thanks Rob for the clarification. I will make the changes accordingly.

Thanks,
Krishna
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml b/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml
new file mode 100644
index 0000000..4a26bef
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml
@@ -0,0 +1,68 @@ 
+# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/msm/dsi-phy-10nm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Display DSI 10nm PHY
+
+maintainers:
+  - Krishna Manikandan <mkrishn@codeaurora.org>
+
+allOf:
+  - $ref: dsi-phy-common.yaml#
+
+properties:
+  compatible:
+    oneOf:
+      - const: qcom,dsi-phy-10nm
+      - const: qcom,dsi-phy-10nm-8998
+
+  reg:
+    items:
+      - description: dsi phy register set
+      - description: dsi phy lane register set
+      - description: dsi pll register set
+
+  reg-names:
+    items:
+      - const: dsi_phy
+      - const: dsi_phy_lane
+      - const: dsi_pll
+
+  vdds-supply:
+    description: |
+      Connected to DSI0_MIPI_DSI_PLL_VDDA0P9 pin for sc7180 target and
+      connected to VDDA_MIPI_DSI_0_PLL_0P9 pin for sdm845 target
+
+required:
+  - compatible
+  - reg
+  - reg-names
+  - vdds-supply
+
+unevaluatedProperties: false
+
+examples:
+  - |
+     #include <dt-bindings/clock/qcom,dispcc-sdm845.h>
+     #include <dt-bindings/clock/qcom,rpmh.h>
+
+     dsi-phy@ae94400 {
+         compatible = "qcom,dsi-phy-10nm";
+         reg = <0x0ae94400 0x200>,
+               <0x0ae94600 0x280>,
+               <0x0ae94a00 0x1e0>;
+         reg-names = "dsi_phy",
+                     "dsi_phy_lane",
+                     "dsi_pll";
+
+         #clock-cells = <1>;
+         #phy-cells = <0>;
+
+         vdds-supply = <&vdda_mipi_dsi0_pll>;
+         clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
+                  <&rpmhcc RPMH_CXO_CLK>;
+         clock-names = "iface", "ref";
+     };
+...
diff --git a/Documentation/devicetree/bindings/display/msm/dsi-phy-14nm.yaml b/Documentation/devicetree/bindings/display/msm/dsi-phy-14nm.yaml
new file mode 100644
index 0000000..72a00cc
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/msm/dsi-phy-14nm.yaml
@@ -0,0 +1,66 @@ 
+# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/msm/dsi-phy-14nm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Display DSI 14nm PHY
+
+maintainers:
+  - Krishna Manikandan <mkrishn@codeaurora.org>
+
+allOf:
+  - $ref: dsi-phy-common.yaml#
+
+properties:
+  compatible:
+    oneOf:
+      - const: qcom,dsi-phy-14nm
+      - const: qcom,dsi-phy-14nm-660
+
+  reg:
+    items:
+      - description: dsi phy register set
+      - description: dsi phy lane register set
+      - description: dsi pll register set
+
+  reg-names:
+    items:
+      - const: dsi_phy
+      - const: dsi_phy_lane
+      - const: dsi_pll
+
+  vcca-supply:
+    description: Phandle to vcca regulator device node.
+
+required:
+  - compatible
+  - reg
+  - reg-names
+  - vcca-supply
+
+unevaluatedProperties: false
+
+examples:
+  - |
+     #include <dt-bindings/clock/qcom,dispcc-sdm845.h>
+     #include <dt-bindings/clock/qcom,rpmh.h>
+
+     dsi-phy@ae94400 {
+         compatible = "qcom,dsi-phy-14nm";
+         reg = <0x0ae94400 0x200>,
+               <0x0ae94600 0x280>,
+               <0x0ae94a00 0x1e0>;
+         reg-names = "dsi_phy",
+                     "dsi_phy_lane",
+                     "dsi_pll";
+
+         #clock-cells = <1>;
+         #phy-cells = <0>;
+
+         vcca-supply = <&vcca_reg>;
+         clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
+                  <&rpmhcc RPMH_CXO_CLK>;
+         clock-names = "iface", "ref";
+     };
+...
diff --git a/Documentation/devicetree/bindings/display/msm/dsi-phy-20nm.yaml b/Documentation/devicetree/bindings/display/msm/dsi-phy-20nm.yaml
new file mode 100644
index 0000000..743806d
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/msm/dsi-phy-20nm.yaml
@@ -0,0 +1,71 @@ 
+# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/msm/dsi-phy-20nm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Display DSI 20nm PHY
+
+maintainers:
+  - Krishna Manikandan <mkrishn@codeaurora.org>
+
+allOf:
+  - $ref: dsi-phy-common.yaml#
+
+properties:
+  compatible:
+    oneOf:
+      - const: qcom,dsi-phy-20nm
+
+  reg:
+    items:
+      - description: dsi pll register set
+      - description: dsi phy register set
+      - description: dsi phy regulator register set
+
+  reg-names:
+    items:
+      - const: dsi_pll
+      - const: dsi_phy
+      - const: dsi_phy_regulator
+
+  vcca-supply:
+    description: Phandle to vcca regulator device node.
+
+  vddio-supply:
+    description: Phandle to vdd-io regulator device node.
+
+required:
+  - compatible
+  - reg
+  - reg-names
+  - vddio-supply
+  - vcca-supply
+
+unevaluatedProperties: false
+
+examples:
+  - |
+     #include <dt-bindings/clock/qcom,dispcc-sdm845.h>
+     #include <dt-bindings/clock/qcom,rpmh.h>
+
+     dsi-phy@fd922a00 {
+         compatible = "qcom,dsi-phy-20nm";
+         reg = <0xfd922a00 0xd4>,
+               <0xfd922b00 0x2b0>,
+               <0xfd922d80 0x7b>;
+         reg-names = "dsi_pll",
+                     "dsi_phy",
+                     "dsi_phy_regulator";
+
+         #clock-cells = <1>;
+         #phy-cells = <0>;
+
+         vcca-supply = <&vcca_reg>;
+         vddio-supply = <&vddio_reg>;
+
+         clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
+                  <&rpmhcc RPMH_CXO_CLK>;
+         clock-names = "iface", "ref";
+     };
+...
diff --git a/Documentation/devicetree/bindings/display/msm/dsi-phy-28nm.yaml b/Documentation/devicetree/bindings/display/msm/dsi-phy-28nm.yaml
new file mode 100644
index 0000000..78f6b16
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/msm/dsi-phy-28nm.yaml
@@ -0,0 +1,68 @@ 
+# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/msm/dsi-phy-28nm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Display DSI 28nm PHY
+
+maintainers:
+  - Krishna Manikandan <mkrishn@codeaurora.org>
+
+allOf:
+  - $ref: dsi-phy-common.yaml#
+
+properties:
+  compatible:
+    oneOf:
+      - const: qcom,dsi-phy-28nm-hpm
+      - const: qcom,dsi-phy-28nm-lp
+      - const: qcom,dsi-phy-28nm-8960
+
+  reg:
+    items:
+      - description: dsi pll register set
+      - description: dsi phy register set
+      - description: dsi phy regulator register set
+
+  reg-names:
+    items:
+      - const: dsi_pll
+      - const: dsi_phy
+      - const: dsi_phy_regulator
+
+  vddio-supply:
+    description: Phandle to vdd-io regulator device node.
+
+required:
+  - compatible
+  - reg
+  - reg-names
+  - vddio-supply
+
+unevaluatedProperties: false
+
+examples:
+  - |
+     #include <dt-bindings/clock/qcom,dispcc-sdm845.h>
+     #include <dt-bindings/clock/qcom,rpmh.h>
+
+     dsi-phy@fd922a00 {
+         compatible = "qcom,dsi-phy-28nm";
+         reg = <0xfd922a00 0xd4>,
+               <0xfd922b00 0x2b0>,
+               <0xfd922d80 0x7b>;
+         reg-names = "dsi_pll",
+                     "dsi_phy",
+                     "dsi_phy_regulator";
+
+         #clock-cells = <1>;
+         #phy-cells = <0>;
+
+         vddio-supply = <&vddio_reg>;
+
+         clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
+                  <&rpmhcc RPMH_CXO_CLK>;
+         clock-names = "iface", "ref";
+     };
+...
diff --git a/Documentation/devicetree/bindings/display/msm/dsi-phy-common.yaml b/Documentation/devicetree/bindings/display/msm/dsi-phy-common.yaml
new file mode 100644
index 0000000..c81399f
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/msm/dsi-phy-common.yaml
@@ -0,0 +1,41 @@ 
+# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/msm/dsi-phy-common.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Description of Qualcomm Display DSI PHY common dt properties
+
+maintainers:
+  - Krishna Manikandan <mkrishn@codeaurora.org>
+
+description: |
+  This defines the DSI PHY dt properties which are common for all
+  dsi phy versions.
+
+properties:
+  "#clock-cells":
+    const: 1
+
+  "#phy-cells":
+    const: 0
+
+  power-domains:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: Display AHB clock
+      - description: Board XO source
+
+  clock-names:
+    items:
+      - const: iface
+      - const: ref
+
+required:
+  - clocks
+  - clock-names
+
+additionalProperties: true
+...