diff mbox series

[v1,35/36] dt-bindings: display: convert lgphilips,lb035q02 to DT Schema

Message ID 20200315134416.16527-36-sam@ravnborg.org
State Changes Requested, archived
Headers show
Series dt-bindings: display: convert remaning panel bindings to DT Schema | expand

Checks

Context Check Description
robh/checkpatch warning "total: 0 errors, 3 warnings, 54 lines checked"
robh/dt-meta-schema fail build log

Commit Message

Sam Ravnborg March 15, 2020, 1:44 p.m. UTC
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 .../display/panel/lgphilips,lb035q02.txt      | 33 ------------
 .../display/panel/lgphilips,lb035q02.yaml     | 54 +++++++++++++++++++
 2 files changed, 54 insertions(+), 33 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/display/panel/lgphilips,lb035q02.txt
 create mode 100644 Documentation/devicetree/bindings/display/panel/lgphilips,lb035q02.yaml

Comments

Tomi Valkeinen March 16, 2020, 7:57 a.m. UTC | #1
Hi Sam,

On 15/03/2020 15:44, Sam Ravnborg wrote:
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> ---
>   .../display/panel/lgphilips,lb035q02.txt      | 33 ------------
>   .../display/panel/lgphilips,lb035q02.yaml     | 54 +++++++++++++++++++
>   2 files changed, 54 insertions(+), 33 deletions(-)
>   delete mode 100644 Documentation/devicetree/bindings/display/panel/lgphilips,lb035q02.txt
>   create mode 100644 Documentation/devicetree/bindings/display/panel/lgphilips,lb035q02.yaml
> 
> diff --git a/Documentation/devicetree/bindings/display/panel/lgphilips,lb035q02.txt b/Documentation/devicetree/bindings/display/panel/lgphilips,lb035q02.txt
> deleted file mode 100644
> index 1a1e653e5407..000000000000
> --- a/Documentation/devicetree/bindings/display/panel/lgphilips,lb035q02.txt
> +++ /dev/null
> @@ -1,33 +0,0 @@
> -LG.Philips LB035Q02 Panel
> -=========================
> -
> -Required properties:
> -- compatible: "lgphilips,lb035q02"
> -- enable-gpios: panel enable gpio
> -
> -Optional properties:
> -- label: a symbolic name for the panel
> -
> -Required nodes:
> -- Video port for DPI input

Isn't this also compatible with panel-simple bindings? 'label' is the only one not in panel-simple, 
but that's optional and has never been used by the panel driver.

  Tomi
Sam Ravnborg March 16, 2020, 8:26 a.m. UTC | #2
Hi Tomi.

Thanks for your feedback.

On Mon, Mar 16, 2020 at 09:57:57AM +0200, Tomi Valkeinen wrote:
> Hi Sam,
> 
> On 15/03/2020 15:44, Sam Ravnborg wrote:
> > Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> > Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> > Cc: Thierry Reding <thierry.reding@gmail.com>
> > Cc: Sam Ravnborg <sam@ravnborg.org>
> > ---
> >   .../display/panel/lgphilips,lb035q02.txt      | 33 ------------
> >   .../display/panel/lgphilips,lb035q02.yaml     | 54 +++++++++++++++++++
> >   2 files changed, 54 insertions(+), 33 deletions(-)
> >   delete mode 100644 Documentation/devicetree/bindings/display/panel/lgphilips,lb035q02.txt
> >   create mode 100644 Documentation/devicetree/bindings/display/panel/lgphilips,lb035q02.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/display/panel/lgphilips,lb035q02.txt b/Documentation/devicetree/bindings/display/panel/lgphilips,lb035q02.txt
> > deleted file mode 100644
> > index 1a1e653e5407..000000000000
> > --- a/Documentation/devicetree/bindings/display/panel/lgphilips,lb035q02.txt
> > +++ /dev/null
> > @@ -1,33 +0,0 @@
> > -LG.Philips LB035Q02 Panel
> > -=========================
> > -
> > -Required properties:
> > -- compatible: "lgphilips,lb035q02"
> > -- enable-gpios: panel enable gpio
> > -
> > -Optional properties:
> > -- label: a symbolic name for the panel
> > -
> > -Required nodes:
> > -- Video port for DPI input
> 
> Isn't this also compatible with panel-simple bindings? 'label' is the only
> one not in panel-simple, but that's optional and has never been used by the
> panel driver.
The panel is a SPI slave - which is not too obvious from the old
binding.

The new DT Schema includes spi/spi-slave.yaml to give the binding
proper access to the spi slave properties.

That would not be possible with panel-simple binding as no further
properties are allowed with the panel-simple binding.

I hope this explains why there is a dedicated binding for this panel.

	Sam
Tomi Valkeinen March 16, 2020, 8:42 a.m. UTC | #3
On 16/03/2020 10:26, Sam Ravnborg wrote:

>> Isn't this also compatible with panel-simple bindings? 'label' is the only
>> one not in panel-simple, but that's optional and has never been used by the
>> panel driver.
> The panel is a SPI slave - which is not too obvious from the old
> binding.
> 
> The new DT Schema includes spi/spi-slave.yaml to give the binding
> proper access to the spi slave properties.
> 
> That would not be possible with panel-simple binding as no further
> properties are allowed with the panel-simple binding.
> 
> I hope this explains why there is a dedicated binding for this panel.

Hmm, but how is this different than, say, DSI panels? There are DSI panels in panel-simple bindings, 
and those might require DSI bus parameters ('reg' in the minimum).

  Tomi
Sam Ravnborg March 16, 2020, 8:53 a.m. UTC | #4
Hi Tomi.

On Mon, Mar 16, 2020 at 10:42:45AM +0200, Tomi Valkeinen wrote:
> On 16/03/2020 10:26, Sam Ravnborg wrote:
> 
> > > Isn't this also compatible with panel-simple bindings? 'label' is the only
> > > one not in panel-simple, but that's optional and has never been used by the
> > > panel driver.
> > The panel is a SPI slave - which is not too obvious from the old
> > binding.
> > 
> > The new DT Schema includes spi/spi-slave.yaml to give the binding
> > proper access to the spi slave properties.
> > 
> > That would not be possible with panel-simple binding as no further
> > properties are allowed with the panel-simple binding.
> > 
> > I hope this explains why there is a dedicated binding for this panel.
> 
> Hmm, but how is this different than, say, DSI panels? There are DSI panels
> in panel-simple bindings, and those might require DSI bus parameters ('reg'
> in the minimum).


We have panel-simple-dsi for DSI simple based panels.
This binding includes the reg property.

If we have included DSI panels in panel-simple.yaml, and we likely have
by accident, then they should be moved to panel-simple-dsi.yaml.

If they requires anything else then they shall have their
own binding.

panel-simple.yaml and panel-simple.dsi.yaml are on purpose
only for the simple panels and they have:
"additionalProperties: false" to avoid that a lot
of extra sneaks in.

I actually considered shortly a panel-simple-spi.yaml,
but the few panels I looked at had different names
for the power-supply so that did not fly.
I did not check them all - we have today (with this patch-set)
9 bindings that references spi-slave.yaml.

	Sam
Tomi Valkeinen March 16, 2020, 9:11 a.m. UTC | #5
On 16/03/2020 10:53, Sam Ravnborg wrote:

> We have panel-simple-dsi for DSI simple based panels.
> This binding includes the reg property.
> 
> If we have included DSI panels in panel-simple.yaml, and we likely have
> by accident, then they should be moved to panel-simple-dsi.yaml.
> 
> If they requires anything else then they shall have their
> own binding.
> 
> panel-simple.yaml and panel-simple.dsi.yaml are on purpose
> only for the simple panels and they have:
> "additionalProperties: false" to avoid that a lot
> of extra sneaks in.
> 
> I actually considered shortly a panel-simple-spi.yaml,
> but the few panels I looked at had different names
> for the power-supply so that did not fly.
> I did not check them all - we have today (with this patch-set)
> 9 bindings that references spi-slave.yaml.

Okay, I understand now. Makes sense.

panel-simple.c has dsi_of_match, which lists DSI panels. I was looking at that when I said 
panel-simple binding has DSI panels. At least auo,b080uan01 and osddisplays,osd101t2045-53ts are 
there, and earlier in this series you moved osddisplays,osd101t2587-53ts to panel-simple bindings.

  Tomi
Sam Ravnborg March 17, 2020, 6:45 a.m. UTC | #6
Hi Tomi.

On Mon, Mar 16, 2020 at 11:11:15AM +0200, Tomi Valkeinen wrote:
> On 16/03/2020 10:53, Sam Ravnborg wrote:
> 
> > We have panel-simple-dsi for DSI simple based panels.
> > This binding includes the reg property.
> > 
> > If we have included DSI panels in panel-simple.yaml, and we likely have
> > by accident, then they should be moved to panel-simple-dsi.yaml.
> > 

> panel-simple.c has dsi_of_match, which lists DSI panels. I was looking at
> that when I said panel-simple binding has DSI panels. At least auo,b080uan01
> and osddisplays,osd101t2045-53ts are there, and earlier in this series you
> moved osddisplays,osd101t2587-53ts to panel-simple bindings.

I will clean this up as part of v2.
Thanks.

	Sam
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/display/panel/lgphilips,lb035q02.txt b/Documentation/devicetree/bindings/display/panel/lgphilips,lb035q02.txt
deleted file mode 100644
index 1a1e653e5407..000000000000
--- a/Documentation/devicetree/bindings/display/panel/lgphilips,lb035q02.txt
+++ /dev/null
@@ -1,33 +0,0 @@ 
-LG.Philips LB035Q02 Panel
-=========================
-
-Required properties:
-- compatible: "lgphilips,lb035q02"
-- enable-gpios: panel enable gpio
-
-Optional properties:
-- label: a symbolic name for the panel
-
-Required nodes:
-- Video port for DPI input
-
-Example
--------
-
-lcd-panel: panel@0 {
-	compatible = "lgphilips,lb035q02";
-	reg = <0>;
-	spi-max-frequency = <100000>;
-	spi-cpol;
-	spi-cpha;
-
-	label = "lcd";
-
-	enable-gpios = <&gpio7 7 0>;
-
-	port {
-		lcd_in: endpoint {
-			remote-endpoint = <&dpi_out>;
-		};
-	};
-};
diff --git a/Documentation/devicetree/bindings/display/panel/lgphilips,lb035q02.yaml b/Documentation/devicetree/bindings/display/panel/lgphilips,lb035q02.yaml
new file mode 100644
index 000000000000..09eba4090736
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/lgphilips,lb035q02.yaml
@@ -0,0 +1,54 @@ 
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/lgphilips,lb035q02.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: LG.Philips LB035Q02 Panel
+
+maintainers:
+  - Tomi Valkeinen <tomi.valkeinen@ti.com>
+
+allOf:
+  - $ref: panel-common.yaml#
+  - $ref: ../../spi/spi-slave.yaml#
+
+properties:
+  compatible:
+    const: lgphilips,lb035q02
+
+  label: true
+  enable-gpios: true
+  port: true
+
+required:
+  - compatible
+  - enable-gpios
+  - port
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        panel: panel@0 {
+            compatible = "lgphilips,lb035q02";
+            reg = <0>;
+            spi-max-frequency = <100000>;
+            spi-cpol;
+            spi-cpha;
+
+            label = "lcd";
+
+            enable-gpios = <&gpio7 7 0>;
+
+            port {
+                lcd_in: endpoint {
+                    remote-endpoint = <&dpi_out>;
+                };
+            };
+        };
+    };
+
+...