diff mbox series

[v2,3/3] dt-bindings: display: convert panel-dpi to DT schema

Message ID 20200125203454.7450-4-sam@ravnborg.org
State Changes Requested, archived
Headers show
Series dt-bindings: convert timing + panel-dpi to DT schema | expand

Checks

Context Check Description
robh/checkpatch warning "total: 0 errors, 2 warnings, 71 lines checked"
robh/dt-meta-schema success

Commit Message

Sam Ravnborg Jan. 25, 2020, 8:34 p.m. UTC
With panel-timing converted, now convert the single
remaining .txt user in panel/ of panel-timing to DT schema.

v2:
  - Drop Thierry as maintainer, as this is not a general panel binding
    and I have no acks.
  - Drop requirement for a panel- specific binding - "panel-dpi" is enough
  - Updated example

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Maxime Ripard <mripard@kernel.org>
---
 .../bindings/display/panel/panel-dpi.txt      | 50 -------------
 .../bindings/display/panel/panel-dpi.yaml     | 71 +++++++++++++++++++
 2 files changed, 71 insertions(+), 50 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/display/panel/panel-dpi.txt
 create mode 100644 Documentation/devicetree/bindings/display/panel/panel-dpi.yaml

Comments

Rob Herring Jan. 31, 2020, 5:40 p.m. UTC | #1
On Sat, Jan 25, 2020 at 2:35 PM Sam Ravnborg <sam@ravnborg.org> wrote:
>
> With panel-timing converted, now convert the single
> remaining .txt user in panel/ of panel-timing to DT schema.
>
> v2:
>   - Drop Thierry as maintainer, as this is not a general panel binding
>     and I have no acks.
>   - Drop requirement for a panel- specific binding - "panel-dpi" is enough
>   - Updated example
>
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Rob Herring <robh@kernel.org>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> ---
>  .../bindings/display/panel/panel-dpi.txt      | 50 -------------
>  .../bindings/display/panel/panel-dpi.yaml     | 71 +++++++++++++++++++
>  2 files changed, 71 insertions(+), 50 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/display/panel/panel-dpi.txt
>  create mode 100644 Documentation/devicetree/bindings/display/panel/panel-dpi.yaml
>
> diff --git a/Documentation/devicetree/bindings/display/panel/panel-dpi.txt b/Documentation/devicetree/bindings/display/panel/panel-dpi.txt
> deleted file mode 100644
> index 6b203bc4d932..000000000000
> --- a/Documentation/devicetree/bindings/display/panel/panel-dpi.txt
> +++ /dev/null
> @@ -1,50 +0,0 @@
> -Generic MIPI DPI Panel
> -======================
> -
> -Required properties:
> -- compatible: "panel-dpi"
> -
> -Optional properties:
> -- label: a symbolic name for the panel
> -- enable-gpios: panel enable gpio
> -- reset-gpios: GPIO to control the RESET pin
> -- vcc-supply: phandle of regulator that will be used to enable power to the display
> -- backlight: phandle of the backlight device
> -
> -Required nodes:
> -- "panel-timing" containing video timings
> -  (Documentation/devicetree/bindings/display/panel/display-timing.txt)
> -- Video port for DPI input
> -
> -Example
> --------
> -
> -lcd0: display@0 {
> -        compatible = "samsung,lte430wq-f0c", "panel-dpi";
> -        label = "lcd";
> -
> -        backlight = <&backlight>;
> -
> -        port {
> -            lcd_in: endpoint {
> -                    remote-endpoint = <&dpi_out>;
> -            };
> -        };
> -
> -        panel-timing {
> -                clock-frequency = <9200000>;
> -                hactive = <480>;
> -                vactive = <272>;
> -                hfront-porch = <8>;
> -                hback-porch = <4>;
> -                hsync-len = <41>;
> -                vback-porch = <2>;
> -                vfront-porch = <4>;
> -                vsync-len = <10>;
> -
> -                hsync-active = <0>;
> -                vsync-active = <0>;
> -                de-active = <1>;
> -                pixelclk-active = <1>;
> -        };
> -};
> diff --git a/Documentation/devicetree/bindings/display/panel/panel-dpi.yaml b/Documentation/devicetree/bindings/display/panel/panel-dpi.yaml
> new file mode 100644
> index 000000000000..a8e37318ec05
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/panel/panel-dpi.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/panel/panel-dpi.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Generic MIPI DPI Panel
> +
> +maintainers:
> +  - Sam Ravnborg <sam@ravnborg.org>
> +
> +allOf:
> +  - $ref: panel-common.yaml#
> +
> +properties:
> +  compatible:
> +    contains:
> +      const: panel-dpi
> +    description:
> +      Shall contain "panel-dpi" in addition to an optional panel-specific
> +      compatible string defined in individual panel bindings.
> +      "panel-dpi" can be used alone, thus no dedicated binding file
> +      is required for each and every panel.

While this has occurred, I don't think the schema should allow it. I
think a 'minItems: 2' should be added here.

AFAIK, MIPI DPI just defines a spec for what already existed. Maybe it
constrains things somewhat, but to the extent why we require a panel
specific compatible in the first place? Doubtful...

Rob

> +  port: true
> +
> +required:
> +  - panel-timing
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    panel@0 {
> +      compatible = "panel-dpi";
> +      label = "lcd";
> +      vcc-supply = <&vcc_supply>;
> +
> +      backlight = <&backlight>;
> +
> +      port {
> +        lcd_in: endpoint {
> +          remote-endpoint = <&dpi_out>;
> +        };
> +      };
> +      panel-timing {
> +        clock-frequency = <9200000>;
> +        hactive = <800>;
> +        vactive = <480>;
> +        hfront-porch = <8>;
> +        hback-porch = <4>;
> +        hsync-len = <41>;
> +        vback-porch = <2>;
> +        vfront-porch = <4>;
> +        vsync-len = <10>;
> +
> +        hsync-active = <0>;
> +        vsync-active = <0>;
> +        de-active = <1>;
> +        pixelclk-active = <1>;
> +      };
> +    };
> --
> 2.20.1
>
Sam Ravnborg Jan. 31, 2020, 7:41 p.m. UTC | #2
Hi Rob.

> > +
> > +properties:
> > +  compatible:
> > +    contains:
> > +      const: panel-dpi
> > +    description:
> > +      Shall contain "panel-dpi" in addition to an optional panel-specific
> > +      compatible string defined in individual panel bindings.
> > +      "panel-dpi" can be used alone, thus no dedicated binding file
> > +      is required for each and every panel.
> 
> While this has occurred, I don't think the schema should allow it. I
> think a 'minItems: 2' should be added here.
> 
> AFAIK, MIPI DPI just defines a spec for what already existed. Maybe it
> constrains things somewhat, but to the extent why we require a panel
> specific compatible in the first place? Doubtful...

You triggered me to re-read some old thread about this.
And I think I got it now.

Based on a proposal you made some weeks ago I did it like this:
properties:
  compatible:
    description:
      Shall contain a panel specific compatible and "panel-dpi"
      in that order.
    items:
      - {}
      - const: panel-dpi

So no constraints on the panel specific compatible, expect that it is present.
And panel-dpi must be listed as the second compatible.

Updated the example too.
Will post a v3.

Thanks!

	Sam
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/display/panel/panel-dpi.txt b/Documentation/devicetree/bindings/display/panel/panel-dpi.txt
deleted file mode 100644
index 6b203bc4d932..000000000000
--- a/Documentation/devicetree/bindings/display/panel/panel-dpi.txt
+++ /dev/null
@@ -1,50 +0,0 @@ 
-Generic MIPI DPI Panel
-======================
-
-Required properties:
-- compatible: "panel-dpi"
-
-Optional properties:
-- label: a symbolic name for the panel
-- enable-gpios: panel enable gpio
-- reset-gpios: GPIO to control the RESET pin
-- vcc-supply: phandle of regulator that will be used to enable power to the display
-- backlight: phandle of the backlight device
-
-Required nodes:
-- "panel-timing" containing video timings
-  (Documentation/devicetree/bindings/display/panel/display-timing.txt)
-- Video port for DPI input
-
-Example
--------
-
-lcd0: display@0 {
-        compatible = "samsung,lte430wq-f0c", "panel-dpi";
-        label = "lcd";
-
-        backlight = <&backlight>;
-
-        port {
-            lcd_in: endpoint {
-                    remote-endpoint = <&dpi_out>;
-            };
-        };
-
-        panel-timing {
-                clock-frequency = <9200000>;
-                hactive = <480>;
-                vactive = <272>;
-                hfront-porch = <8>;
-                hback-porch = <4>;
-                hsync-len = <41>;
-                vback-porch = <2>;
-                vfront-porch = <4>;
-                vsync-len = <10>;
-
-                hsync-active = <0>;
-                vsync-active = <0>;
-                de-active = <1>;
-                pixelclk-active = <1>;
-        };
-};
diff --git a/Documentation/devicetree/bindings/display/panel/panel-dpi.yaml b/Documentation/devicetree/bindings/display/panel/panel-dpi.yaml
new file mode 100644
index 000000000000..a8e37318ec05
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/panel-dpi.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/panel/panel-dpi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Generic MIPI DPI Panel
+
+maintainers:
+  - Sam Ravnborg <sam@ravnborg.org>
+
+allOf:
+  - $ref: panel-common.yaml#
+
+properties:
+  compatible:
+    contains:
+      const: panel-dpi
+    description:
+      Shall contain "panel-dpi" in addition to an optional panel-specific
+      compatible string defined in individual panel bindings.
+      "panel-dpi" can be used alone, thus no dedicated binding file
+      is required for each and every panel.
+
+  vcc-supply:
+    description: |
+      Regulator that will be used to enable power to the display
+
+  label: true
+  enable-gpios: true
+  reset-gpios: true
+  backlight: true
+  panel-timing: true
+  port: true
+
+required:
+  - panel-timing
+
+additionalProperties: false
+
+examples:
+  - |
+    panel@0 {
+      compatible = "panel-dpi";
+      label = "lcd";
+      vcc-supply = <&vcc_supply>;
+
+      backlight = <&backlight>;
+
+      port {
+        lcd_in: endpoint {
+          remote-endpoint = <&dpi_out>;
+        };
+      };
+      panel-timing {
+        clock-frequency = <9200000>;
+        hactive = <800>;
+        vactive = <480>;
+        hfront-porch = <8>;
+        hback-porch = <4>;
+        hsync-len = <41>;
+        vback-porch = <2>;
+        vfront-porch = <4>;
+        vsync-len = <10>;
+
+        hsync-active = <0>;
+        vsync-active = <0>;
+        de-active = <1>;
+        pixelclk-active = <1>;
+      };
+    };