Skip to contentSkip to conversation

dt-bindings: DT Schema variants of atmel lcdc, hlcdc

PATCH In review Sam Ravnborg 3 participants 14 messages Apr 12, 2020 – Apr 16, 2020

Subsystems (8)
lore
Share & tools
lore
#0 lore raw

cover dt-bindings: DT Schema variants of atmel lcdc, hlcdc

The following four patches update the bindings for Atmel LCDC, HLCDC display controllers to DT Schema.

The bindings were re-written in DT Schema format,
and examples adjusted/updated to fit.

This patch-set introduces a new endpoint property in video-interfaces used to tell if red and blue wiring is reversed.
Red and blue wires are reversed as the LCDC IP natively supports BGR whereas most SW expects RGB. With the wires reversed the SW thinks the IP supports RGB.
See more details in the changelog of the patch.

The Atmel lcdc binding deprecate a lot of properties in other to update it to an up-to-date binding. There are no users of the updated binding, thats something I work on.

Note a big difference between LCDC and HLCDC.
LCDC has all in one binding (interrupts, pwm, display controller). HLCDC has individual sub-nodes for the PWM and the display contoller.

When posting an update on the old atmel,lcdc.txt file the feedback was back then that we did not want the split like done for hlcdc. And it makes for a simpler binding in this way - so feedback looks right.

Despite that Microchip has purchased Atmel, the atmel name is kept. Also the files are placed in a directory named atmel/.

Feedback welcome!

Sam

Sam Ravnborg (4):
dt-bindings: display: convert atmel-hlcdc to DT Schema
dt-bindings: display: convert atmel lcdc to DT Schema
dt-bindings: media: add wiring property to video-interfaces
dt-bindings: display: add port support to atmel lcdc

 .../devicetree/bindings/display/atmel,lcdc.txt     |  88 --------
 .../devicetree/bindings/display/atmel/hlcdc-dc.txt |  75 -------
 .../bindings/display/atmel/hlcdc-dc.yaml           | 102 +++++++++
 .../devicetree/bindings/display/atmel/lcdc.yaml    | 229 +++++++++++++++++++++
 .../devicetree/bindings/media/video-interfaces.txt |   3 +
 .../devicetree/bindings/mfd/atmel-hlcdc.txt        |  55 -----
 .../devicetree/bindings/mfd/atmel-hlcdc.yaml       |  78 +++++++
 .../devicetree/bindings/pwm/atmel-hlcdc-pwm.txt    |  29 ---
 .../devicetree/bindings/pwm/atmel-hlcdc-pwm.yaml   |  39 ++++
 9 files changed, 451 insertions(+), 247 deletions(-)

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw

PATCH 1/4 dt-bindings: display: convert atmel-hlcdc to DT Schema

atmel hlcdc is a MFD devide with two sub-devices:
- PWM
- Display controller

Add binding files for each device:

- mfd/atmel-hlcdc - this is overall device
- pwm/atmel-hlcdc-pwm - the pwm part, used for backlight
- display/atmel/hlcdc-dc - the display controller

The hlcdc IP is present in several different chips from microchip (former Atmel). The individual chips has independent compatibles in the mfd binding, to allow for chip specific configuration.

As the conversion is a full re-write there was no tie to the original license, and the standard license for bindings is used.

Cc Boris Brezillon <[email protected]>
---
 .../bindings/display/atmel/hlcdc-dc.txt       |  75 -------------
 .../bindings/display/atmel/hlcdc-dc.yaml      | 102 ++++++++++++++++++
 .../devicetree/bindings/mfd/atmel-hlcdc.txt   |  55 ----------
 .../devicetree/bindings/mfd/atmel-hlcdc.yaml  |  78 ++++++++++++++
 .../bindings/pwm/atmel-hlcdc-pwm.txt          |  29 -----
 .../bindings/pwm/atmel-hlcdc-pwm.yaml         |  39 +++++++
 6 files changed, 219 insertions(+), 159 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/display/atmel/hlcdc-dc.txt
 create mode 100644 Documentation/devicetree/bindings/display/atmel/hlcdc-dc.yaml
 delete mode 100644 Documentation/devicetree/bindings/mfd/atmel-hlcdc.txt
 create mode 100644 Documentation/devicetree/bindings/mfd/atmel-hlcdc.yaml
 delete mode 100644 Documentation/devicetree/bindings/pwm/atmel-hlcdc-pwm.txt
 create mode 100644 Documentation/devicetree/bindings/pwm/atmel-hlcdc-pwm.yaml
Documentation/devicetree/bindings/display/atmel/hlcdc-dc.txt deleted +0 -75
deleted file mode 100644
index 0398aec488ac..000000000000
@@ -1,75 +0,0 @@
-Device-Tree bindings for Atmel's HLCDC (High LCD Controller) DRM driver
-
-The Atmel HLCDC Display Controller is subdevice of the HLCDC MFD device.
-See ../../mfd/atmel-hlcdc.txt for more details.
-
-Required properties:
- - compatible: value should be "atmel,hlcdc-display-controller"
- - pinctrl-names: the pin control state names. Should contain "default".
- - pinctrl-0: should contain the default pinctrl states.
- - #address-cells: should be set to 1.
- - #size-cells: should be set to 0.
-
-Required children nodes:
- Children nodes are encoding available output ports and their connections
- to external devices using the OF graph reprensentation (see ../graph.txt).
- At least one port node is required.
-
-Optional properties in grandchild nodes:
- Any endpoint grandchild node may specify a desired video interface
- according to ../../media/video-interfaces.txt, specifically
- - bus-width: recognized values are <12>, <16>, <18> and <24>, and
-   override any output mode selection heuristic, forcing "rgb444",
-   "rgb565", "rgb666" and "rgb888" respectively.
-
-Example:
-
-	hlcdc: hlcdc@f0030000 {
-		compatible = "atmel,sama5d3-hlcdc";
-		reg = <0xf0030000 0x2000>;
-		interrupts = <36 IRQ_TYPE_LEVEL_HIGH 0>;
-		clocks = <&lcdc_clk>, <&lcdck>, <&clk32k>;
-		clock-names = "periph_clk","sys_clk", "slow_clk";
-
-		hlcdc-display-controller {
-			compatible = "atmel,hlcdc-display-controller";
-			pinctrl-names = "default";
-			pinctrl-0 = <&pinctrl_lcd_base &pinctrl_lcd_rgb888>;
-			#address-cells = <1>;
-			#size-cells = <0>;
-
-			port@0 {
-				#address-cells = <1>;
-				#size-cells = <0>;
-				reg = <0>;
-
-				hlcdc_panel_output: endpoint@0 {
-					reg = <0>;
-					remote-endpoint = <&panel_input>;
-				};
-			};
-		};
-
-		hlcdc_pwm: hlcdc-pwm {
-			compatible = "atmel,hlcdc-pwm";
-			pinctrl-names = "default";
-			pinctrl-0 = <&pinctrl_lcd_pwm>;
-			#pwm-cells = <3>;
-		};
-	};
-
-Example 2: With a video interface override to force rgb565; as above
-but with these changes/additions:
-
-	&hlcdc {
-		hlcdc-display-controller {
-			pinctrl-names = "default";
-			pinctrl-0 = <&pinctrl_lcd_base &pinctrl_lcd_rgb565>;
-
-			port@0 {
-				hlcdc_panel_output: endpoint@0 {
-					bus-width = <16>;
-				};
-			};
-		};
-	};
Documentation/devicetree/bindings/display/atmel/hlcdc-dc.yaml new file +102 -0

102 lines not on this page · raw message

Documentation/devicetree/bindings/mfd/atmel-hlcdc.txt deleted +0 -55

55 lines not on this page · raw message

Documentation/devicetree/bindings/mfd/atmel-hlcdc.yaml new file +78 -0

78 lines not on this page · raw message

Documentation/devicetree/bindings/pwm/atmel-hlcdc-pwm.txt deleted +0 -29
deleted file mode 100644
index afa501bf7f94..000000000000
@@ -1,29 +0,0 @@
-Device-Tree bindings for Atmel's HLCDC (High-end LCD Controller) PWM driver
-
-The Atmel HLCDC PWM is subdevice of the HLCDC MFD device.
-See ../mfd/atmel-hlcdc.txt for more details.
-
-Required properties:
- - compatible: value should be one of the following:
-   "atmel,hlcdc-pwm"
- - pinctr-names: the pin control state names. Should contain "default".
- - pinctrl-0: should contain the pinctrl states described by pinctrl
-   default.
- - #pwm-cells: should be set to 3. This PWM chip use the default 3 cells
-   bindings defined in pwm.yaml in this directory.
-
-Example:
-
-	hlcdc: hlcdc@f0030000 {
-		compatible = "atmel,sama5d3-hlcdc";
-		reg = <0xf0030000 0x2000>;
-		clocks = <&lcdc_clk>, <&lcdck>, <&clk32k>;
-		clock-names = "periph_clk","sys_clk", "slow_clk";
-
-		hlcdc_pwm: hlcdc-pwm {
-			compatible = "atmel,hlcdc-pwm";
-			pinctrl-names = "default";
-			pinctrl-0 = <&pinctrl_lcd_pwm>;
-			#pwm-cells = <3>;
-		};
-	};
Documentation/devicetree/bindings/pwm/atmel-hlcdc-pwm.yaml new file +39 -0
new file mode 100644
index 000000000000..70d063b48260
@@ -0,0 +1,39 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pwm/atmel-hlcdc-pwm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Device-Tree bindings for Atmel's HLCDC (High-end LCD Controller) PWM
+
+maintainers:
+  - Sam Ravnborg <[email protected]>
+  - Boris Brezillon <[email protected]>
+
+description: |
+  The Atmel HLCDC PWM is subdevice of the HLCDC MFD device.
+  See ../mfd/atmel-hlcdc.txt for more details.
+
+properties:
+  compatible:
+    const: atmel,hlcdc-pwm
+
+  "#pwm-cells":
+    const: 3
+    description:
+      This PWM chip use the default 3 cells bindings defined in pwm.yaml.
+
+required:
+  - compatible
+  - "#pwm-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    hlcdc_pwm {
+        compatible = "atmel,hlcdc-pwm";
+        #pwm-cells = <3>;
+    };
+
+...
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

Re: [PATCH v1 1/4] dt-bindings: display: convert atmel-hlcdc to DT Schema

Hi Sam,

Quoted 46 lines · Sam Ravnborg
Documentation/devicetree/bindings/display/atmel/hlcdc-dc.yaml new file +40 -0
new file mode 100644
index 000000000000..7eb6266a25a2
@@ -0,0 +1,102 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/atmel/hlcdc-dc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Atmel HLCDC (High LCD Controller) display controller
+
+maintainers:
+  - Sam Ravnborg <[email protected]>
+  - Boris Brezillon <[email protected]>
+
+description: |
+  The Atmel HLCDC Display Controller is subdevice of the HLCDC MFD device.
+  See ../../mfd/atmel-hlcdc.yaml for more details.
+
+properties:
+  compatible:
+    const: atmel,hlcdc-display-controller
+
+  "#address-cells":
+    const: 1
+  "#size-cells":
+    const: 0
+
+required:
+  - compatible
+  - "#address-cells"
+  - "#size-cells"
+
+patternProperties:
+  "^port@[0-9]$":
+    type: object
+    description: |
+      A port node with endpoint definitions as defined in
+      ../../media/video-interfaces.txt
+
+    properties:
+      "#address-cells":
+        const: 1

Documentation/devicetree/bindings/display/atmel/hlcdc-dc.yaml line 50

Quoted 10 lines
Documentation/devicetree/bindings/display/atmel/hlcdc-dc.yaml new file +10 -0
+
+      "#size-cells":
+        const: 0
+
+      reg:
+        maxItems: 1
+        description: The virtual number of the port
+
+    patternProperties:
+      "^endpoint(@[0-9])$":

I guess you meant ^endpoint(@[0-9])?$ instead?

Quoted 13 lines
Documentation/devicetree/bindings/display/atmel/hlcdc-dc.yaml new file +13 -0
+        type: object
+
+        properties:
+          reg:
+            maxItems: 1
+            description: The virtual number of the endpoint
+
+          bus-width:
+            enum: [12, 16, 18, 24]
+            description:
+              Any endpoint node may specify a desired video interface
+              according to ../../media/video-interfaces.txt, specifically
+              Recognized values are <12>, <16>, <18> and <24>, and

Documentation/devicetree/bindings/display/atmel/hlcdc-dc.yaml line 73

Quoted 10 lines
Documentation/devicetree/bindings/display/atmel/hlcdc-dc.yaml new file +10 -0
+              override any output mode selection heuristic, forcing
+              "rgb444", "rgb565", "rgb666" and "rgb888" respectively.
+
+          remote-endpoint:
+            $ref: /schemas/types.yaml#/definitions/phandle
+            description:
+              phandle to the panel node
+
+        required:
+          - reg

And if so, reg depends on whether the unit-address is set or not, so you can't really enforce that.

Quoted 23 lines
Documentation/devicetree/bindings/mfd/atmel-hlcdc.yaml new file +17 -0
new file mode 100644
index 000000000000..cad14fa173a1
@@ -0,0 +1,78 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/atmel-hlcdc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Device-Tree bindings for Atmel's HLCDC (High LCD Controller)
+
+maintainers:
+  - Sam Ravnborg <[email protected]>
+  - Boris Brezillon <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - atmel,at91sam9n12-hlcdc
+      - atmel,at91sam9x5-hlcdc

Documentation/devicetree/bindings/mfd/atmel-hlcdc.yaml line 27

Quoted 10 lines
Documentation/devicetree/bindings/mfd/atmel-hlcdc.yaml new file +10 -0
+      - atmel,sama5d2-hlcdc
+      - atmel,sama5d3-hlcdc
+      - atmel,sama5d4-hlcdc
+      - microchip,sam9x60-hlcdc
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 3

Having descirptions of what those clocks are would be nice.

Quoted 12 lines
Documentation/devicetree/bindings/mfd/atmel-hlcdc.yaml new file +12 -0
+  clock-names:
+    maxItems: 3
+    items:
+      - const: periph_clk
+      - const: sys_clk
+      - const: slow_clk
+
+  interrupts:
+    description: The HLCDC interrupt line
+    maxItems: 1
+
+  hlcdc_pwm:

Documentation/devicetree/bindings/mfd/atmel-hlcdc.yaml line 50

Quoted 10 lines
Documentation/devicetree/bindings/mfd/atmel-hlcdc.yaml new file +10 -0
+    type: object
+    description: |
+      PWM controller - used for backlight.
+      See ../pwm/atmel-hlcdc-pwm.yaml for details
+
+  hlcdc-display-controller:
+    type: object
+    description: |
+      LCD display controller
+      See ../display/atmel/hlcdc-dc.yaml for details

I guess you could include those two schemas to make sure that it's valid? Otherwise, if you have an hlcdc-display-controller (or pwm) node without a compatible, it will not be checked here, and will not be checked by the hlcdc-dc.yaml schemas either since it matches on the compatible.

Maxime

#3 lore raw

Re: [PATCH v1 1/4] dt-bindings: display: convert atmel-hlcdc to DT Schema

Hi Maxime.

Quoted 53 lines · Maxime Ripard

Hi Sam,

Quoted 50 lines · Sam Ravnborg
Documentation/devicetree/bindings/display/atmel/hlcdc-dc.yaml new file +44 -0
new file mode 100644
index 000000000000..7eb6266a25a2
@@ -0,0 +1,102 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/atmel/hlcdc-dc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Atmel HLCDC (High LCD Controller) display controller
+
+maintainers:
+  - Sam Ravnborg <[email protected]>
+  - Boris Brezillon <[email protected]>
+
+description: |
+  The Atmel HLCDC Display Controller is subdevice of the HLCDC MFD device.
+  See ../../mfd/atmel-hlcdc.yaml for more details.
+
+properties:
+  compatible:
+    const: atmel,hlcdc-display-controller
+
+  "#address-cells":
+    const: 1
+  "#size-cells":
+    const: 0
+
+required:
+  - compatible
+  - "#address-cells"
+  - "#size-cells"
+
+patternProperties:
+  "^port@[0-9]$":
+    type: object
+    description: |
+      A port node with endpoint definitions as defined in
+      ../../media/video-interfaces.txt
+
+    properties:
+      "#address-cells":
+        const: 1
+
+      "#size-cells":
+        const: 0
+
Quoted 8 lines

Documentation/devicetree/bindings/display/atmel/hlcdc-dc.yaml line 50

Quoted 6 lines
Documentation/devicetree/bindings/display/atmel/hlcdc-dc.yaml new file +6 -0
+      reg:
+        maxItems: 1
+        description: The virtual number of the port
+
+    patternProperties:
+      "^endpoint(@[0-9])$":

I guess you meant ^endpoint(@[0-9])?$ instead?

I think "^endpoint@[0-9]$" will do the trick.
No need for endpoints with numbers higher than 9.

Quoted 55 lines
Quoted 14 lines
Documentation/devicetree/bindings/display/atmel/hlcdc-dc.yaml new file +13 -0
+        type: object
+
+        properties:
+          reg:
+            maxItems: 1
+            description: The virtual number of the endpoint
+
+          bus-width:
+            enum: [12, 16, 18, 24]
+            description:
+              Any endpoint node may specify a desired video interface
+              according to ../../media/video-interfaces.txt, specifically
+              Recognized values are <12>, <16>, <18> and <24>, and

Documentation/devicetree/bindings/display/atmel/hlcdc-dc.yaml line 73

Quoted 10 lines
Documentation/devicetree/bindings/display/atmel/hlcdc-dc.yaml new file +10 -0
+              override any output mode selection heuristic, forcing
+              "rgb444", "rgb565", "rgb666" and "rgb888" respectively.
+
+          remote-endpoint:
+            $ref: /schemas/types.yaml#/definitions/phandle
+            description:
+              phandle to the panel node
+
+        required:
+          - reg

And if so, reg depends on whether the unit-address is set or not, so you can't really enforce that.

Quoted 27 lines
Documentation/devicetree/bindings/mfd/atmel-hlcdc.yaml new file +21 -0
new file mode 100644
index 000000000000..cad14fa173a1
@@ -0,0 +1,78 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/atmel-hlcdc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Device-Tree bindings for Atmel's HLCDC (High LCD Controller)
+
+maintainers:
+  - Sam Ravnborg <[email protected]>
+  - Boris Brezillon <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - atmel,at91sam9n12-hlcdc
+      - atmel,at91sam9x5-hlcdc
+      - atmel,sama5d2-hlcdc
+      - atmel,sama5d3-hlcdc
+      - atmel,sama5d4-hlcdc
+      - microchip,sam9x60-hlcdc
Quoted 8 lines

Documentation/devicetree/bindings/mfd/atmel-hlcdc.yaml line 27

Quoted 6 lines
Documentation/devicetree/bindings/mfd/atmel-hlcdc.yaml new file +6 -0
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 3

Having descirptions of what those clocks are would be nice.

OK, will dig them up from the data sheet

Quoted 21 lines
Quoted 21 lines
Documentation/devicetree/bindings/mfd/atmel-hlcdc.yaml new file +20 -0
+  clock-names:
+    maxItems: 3
+    items:
+      - const: periph_clk
+      - const: sys_clk
+      - const: slow_clk
+
+  interrupts:
+    description: The HLCDC interrupt line
+    maxItems: 1
+
+  hlcdc_pwm:
+    type: object
+    description: |
+      PWM controller - used for backlight.
+      See ../pwm/atmel-hlcdc-pwm.yaml for details
+
+  hlcdc-display-controller:
+    type: object
+    description: |
Quoted 8 lines

Documentation/devicetree/bindings/mfd/atmel-hlcdc.yaml line 50

Quoted 2 lines
Documentation/devicetree/bindings/mfd/atmel-hlcdc.yaml new file +2 -0
+      LCD display controller
+      See ../display/atmel/hlcdc-dc.yaml for details

I guess you could include those two schemas to make sure that it's valid? Otherwise, if you have an hlcdc-display-controller (or pwm) node without a compatible, it will not be checked here, and will not be checked by the hlcdc-dc.yaml schemas either since it matches on the compatible.

Good point - will fix in v2.
Thanks for the feedback.

Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw

Re: [PATCH v1 1/4] dt-bindings: display: convert atmel-hlcdc to DT Schema

Quoted 65 lines · Sam Ravnborg

Hi Maxime.

Quoted 53 lines · Maxime Ripard

Hi Sam,

Quoted 50 lines · Sam Ravnborg
Documentation/devicetree/bindings/display/atmel/hlcdc-dc.yaml new file +44 -0
new file mode 100644
index 000000000000..7eb6266a25a2
@@ -0,0 +1,102 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/atmel/hlcdc-dc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Atmel HLCDC (High LCD Controller) display controller
+
+maintainers:
+  - Sam Ravnborg <[email protected]>
+  - Boris Brezillon <[email protected]>
+
+description: |
+  The Atmel HLCDC Display Controller is subdevice of the HLCDC MFD device.
+  See ../../mfd/atmel-hlcdc.yaml for more details.
+
+properties:
+  compatible:
+    const: atmel,hlcdc-display-controller
+
+  "#address-cells":
+    const: 1
+  "#size-cells":
+    const: 0
+
+required:
+  - compatible
+  - "#address-cells"
+  - "#size-cells"
+
+patternProperties:
+  "^port@[0-9]$":
+    type: object
+    description: |
+      A port node with endpoint definitions as defined in
+      ../../media/video-interfaces.txt
+
+    properties:
+      "#address-cells":
+        const: 1
+
+      "#size-cells":
+        const: 0
+
Quoted 8 lines

Documentation/devicetree/bindings/display/atmel/hlcdc-dc.yaml line 50

Quoted 6 lines
Documentation/devicetree/bindings/display/atmel/hlcdc-dc.yaml new file +6 -0
+      reg:
+        maxItems: 1
+        description: The virtual number of the port
+
+    patternProperties:
+      "^endpoint(@[0-9])$":

I guess you meant ^endpoint(@[0-9])?$ instead?

Quoted 2 lines

I think "^endpoint@[0-9]$" will do the trick.
No need for endpoints with numbers higher than 9.

If you want to stick to pedantic DT, then if there's a single endpoint, you should avoid reg and the unit-address, and this is something that dtc will complain about (even though it's silenced in Linux), so yeah, ? seems the way to go.

Maxime

#5 lore raw

PATCH 2/4 dt-bindings: display: convert atmel lcdc to DT Schema

In reply to Sam Ravnborg

Add a new binding file to describe the bindings
for the Atmel LCDC IP.
This replaces the old txt based binding.

The binding file describes the current binding, including properties to specify register values etc. The binding will be updated in a follow-up patch, the current binding describes the actual situation.

This new binding file replaces the old .txt based
binding which is deleted.

---
 .../bindings/display/atmel,lcdc.txt           |  88 -----------
 .../bindings/display/atmel/lcdc.yaml          | 137 ++++++++++++++++++
 2 files changed, 137 insertions(+), 88 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/display/atmel,lcdc.txt
 create mode 100644 Documentation/devicetree/bindings/display/atmel/lcdc.yaml
Documentation/devicetree/bindings/display/atmel,lcdc.txt deleted +0 -88
deleted file mode 100644
index acb5a0132127..000000000000
@@ -1,88 +0,0 @@
-Atmel LCDC Framebuffer
------------------------------------------------------
-
-Required properties:
-- compatible :
-	"atmel,at91sam9261-lcdc" , 
-	"atmel,at91sam9263-lcdc" ,
-	"atmel,at91sam9g10-lcdc" ,
-	"atmel,at91sam9g45-lcdc" ,
-	"atmel,at91sam9g45es-lcdc" ,
-	"atmel,at91sam9rl-lcdc" ,
-	"atmel,at32ap-lcdc"
-- reg : Should contain 1 register ranges(address and length).
-	Can contain an additional register range(address and length)
-	for fixed framebuffer memory. Useful for dedicated memories.
-- interrupts : framebuffer controller interrupt
-- display: a phandle pointing to the display node
-
-Required nodes:
-- display: a display node is required to initialize the lcd panel
-	This should be in the board dts.
-- default-mode: a videomode within the display with timing parameters
-	as specified below.
-
-Optional properties:
-- lcd-supply: Regulator for LCD supply voltage.
-
-Example:
-
-	fb0: fb@00500000 {
-		compatible = "atmel,at91sam9g45-lcdc";
-		reg = <0x00500000 0x1000>;
-		interrupts = <23 3 0>;
-		pinctrl-names = "default";
-		pinctrl-0 = <&pinctrl_fb>;
-		display = <&display0>;
-		#address-cells = <1>;
-		#size-cells = <1>;
-
-	};
-
-Example for fixed framebuffer memory:
-
-	fb0: fb@00500000 {
-		compatible = "atmel,at91sam9263-lcdc";
-		reg = <0x00700000 0x1000 0x70000000 0x200000>;
-		[...]
-	};
-
-Atmel LCDC Display
------------------------------------------------------
-Required properties (as per of_videomode_helper):
-
- - atmel,dmacon: dma controller configuration
- - atmel,lcdcon2: lcd controller configuration
- - atmel,guard-time: lcd guard time (Delay in frame periods)
- - bits-per-pixel: lcd panel bit-depth.
-
-Optional properties (as per of_videomode_helper):
- - atmel,lcdcon-backlight: enable backlight
- - atmel,lcdcon-backlight-inverted: invert backlight PWM polarity
- - atmel,lcd-wiring-mode: lcd wiring mode "RGB" or "BRG"
- - atmel,power-control-gpio: gpio to power on or off the LCD (as many as needed)
-
-Example:
-	display0: display {
-		bits-per-pixel = <32>;
-		atmel,lcdcon-backlight;
-		atmel,dmacon = <0x1>;
-		atmel,lcdcon2 = <0x80008002>;
-		atmel,guard-time = <9>;
-		atmel,lcd-wiring-mode = <1>;
-
-		display-timings {
-			native-mode = <&timing0>;
-			timing0: timing0 {
-				clock-frequency = <9000000>;
-				hactive = <480>;
-				vactive = <272>;
-				hback-porch = <1>;
-				hfront-porch = <1>;
-				vback-porch = <40>;
-				vfront-porch = <1>;
-				hsync-len = <45>;
-				vsync-len = <1>;
-			};
-		};
-	};
Documentation/devicetree/bindings/display/atmel/lcdc.yaml new file +137 -0

137 lines not on this page · raw message

Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw

Re: [PATCH v1 2/4] dt-bindings: display: convert atmel lcdc to DT Schema

Quoted 148 lines · Sam Ravnborg

Add a new binding file to describe the bindings
for the Atmel LCDC IP.
This replaces the old txt based binding.

The binding file describes the current binding, including properties to specify register values etc. The binding will be updated in a follow-up patch, the current binding describes the actual situation.

This new binding file replaces the old .txt based
binding which is deleted.

---
 .../bindings/display/atmel,lcdc.txt           |  88 -----------
 .../bindings/display/atmel/lcdc.yaml          | 137 ++++++++++++++++++
 2 files changed, 137 insertions(+), 88 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/display/atmel,lcdc.txt
 create mode 100644 Documentation/devicetree/bindings/display/atmel/lcdc.yaml
Documentation/devicetree/bindings/display/atmel,lcdc.txt deleted +0 -88
deleted file mode 100644
index acb5a0132127..000000000000
@@ -1,88 +0,0 @@
-Atmel LCDC Framebuffer
------------------------------------------------------
-
-Required properties:
-- compatible :
-	"atmel,at91sam9261-lcdc" ,
-	"atmel,at91sam9263-lcdc" ,
-	"atmel,at91sam9g10-lcdc" ,
-	"atmel,at91sam9g45-lcdc" ,
-	"atmel,at91sam9g45es-lcdc" ,
-	"atmel,at91sam9rl-lcdc" ,
-	"atmel,at32ap-lcdc"
-- reg : Should contain 1 register ranges(address and length).
-	Can contain an additional register range(address and length)
-	for fixed framebuffer memory. Useful for dedicated memories.
-- interrupts : framebuffer controller interrupt
-- display: a phandle pointing to the display node
-
-Required nodes:
-- display: a display node is required to initialize the lcd panel
-	This should be in the board dts.
-- default-mode: a videomode within the display with timing parameters
-	as specified below.
-
-Optional properties:
-- lcd-supply: Regulator for LCD supply voltage.
-
-Example:
-
-	fb0: fb@00500000 {
-		compatible = "atmel,at91sam9g45-lcdc";
-		reg = <0x00500000 0x1000>;
-		interrupts = <23 3 0>;
-		pinctrl-names = "default";
-		pinctrl-0 = <&pinctrl_fb>;
-		display = <&display0>;
-		#address-cells = <1>;
-		#size-cells = <1>;
-
-	};
-
-Example for fixed framebuffer memory:
-
-	fb0: fb@00500000 {
-		compatible = "atmel,at91sam9263-lcdc";
-		reg = <0x00700000 0x1000 0x70000000 0x200000>;
-		[...]
-	};
-
-Atmel LCDC Display
------------------------------------------------------
-Required properties (as per of_videomode_helper):
-
- - atmel,dmacon: dma controller configuration
- - atmel,lcdcon2: lcd controller configuration
- - atmel,guard-time: lcd guard time (Delay in frame periods)
- - bits-per-pixel: lcd panel bit-depth.
-
-Optional properties (as per of_videomode_helper):
- - atmel,lcdcon-backlight: enable backlight
- - atmel,lcdcon-backlight-inverted: invert backlight PWM polarity
- - atmel,lcd-wiring-mode: lcd wiring mode "RGB" or "BRG"
- - atmel,power-control-gpio: gpio to power on or off the LCD (as many as needed)
-
-Example:
-	display0: display {
-		bits-per-pixel = <32>;
-		atmel,lcdcon-backlight;
-		atmel,dmacon = <0x1>;
-		atmel,lcdcon2 = <0x80008002>;
-		atmel,guard-time = <9>;
-		atmel,lcd-wiring-mode = <1>;
-
-		display-timings {
-			native-mode = <&timing0>;
-			timing0: timing0 {
-				clock-frequency = <9000000>;
-				hactive = <480>;
-				vactive = <272>;
-				hback-porch = <1>;
-				hfront-porch = <1>;
-				vback-porch = <40>;
-				vfront-porch = <1>;
-				hsync-len = <45>;
-				vsync-len = <1>;
-			};
-		};
-	};
Documentation/devicetree/bindings/display/atmel/lcdc.yaml new file +28 -0
new file mode 100644
index 000000000000..7dcb9a4d5902
@@ -0,0 +1,137 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/atmel/lcdc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Atmel LCDC (LCD Controller) display controller with PWM
+
+maintainers:
+  - Sam Ravnborg <[email protected]>
+
+description: |
+  The Atmel LCDC Display Controller is display controller that
+  includes a PWM for backlight/contrast.
+
+properties:
+  compatible:
+    enum:
+      - atmel,at91sam9261-lcdc
+      - atmel,at91sam9263-lcdc
+      - atmel,at91sam9g10-lcdc
+      - atmel,at91sam9g45-lcdc
+      - atmel,at91sam9g45es-lcdc
+      - atmel,at91sam9g46-lcdc
+      - atmel,at91sam9m10-lcdc
+      - atmel,at91sam9m11-lcdc
+      - atmel,at91sam9rl-lcdc
+

Documentation/devicetree/bindings/display/atmel/lcdc.yaml line 38

Quoted 10 lines
Documentation/devicetree/bindings/display/atmel/lcdc.yaml new file +10 -0
+  "#address-cells":
+    const: 1
+  "#size-cells":
+    const: 0
+
+  reg:
+    description: |
+      Contains 1 register range (address and length).
+      Can contain an additional register range (address and length)
+      for fixed framebuffer memory

So, minItems: 1 , maxItems: 2?

Quoted 24 lines
Documentation/devicetree/bindings/display/atmel/lcdc.yaml new file +24 -0
+  interrupts:
+    maxItems: 1
+
+  lcd-supply:
+    description: Regulator for LCD supply voltage.
+
+  display:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: phandle to display node
+
+patternProperties:
+  "^display[0-9]$":
+    type: object
+    description: |
+      Display node is required to initialize the lcd panel.
+      This should be in the board dts
+
+    properties:
+
+      atmel,dmacon:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description: DMA controller configuration
+
+      atmel,lcdcon2:

Documentation/devicetree/bindings/display/atmel/lcdc.yaml line 73

Quoted 10 lines
Documentation/devicetree/bindings/display/atmel/lcdc.yaml new file +10 -0
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description: LCD controller configuration
+
+      atmel,guard-time:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description: LCD guard time (Delay in frame periods)
+
+      bits-per-pixel:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description: LCD panel bit-depth.

Those properties aren't documented anywhere?

Maxime

#7 lore raw

Re: [PATCH v1 2/4] dt-bindings: display: convert atmel lcdc to DT Schema

Hi Maxime.

Quoted 153 lines · Maxime Ripard
Quoted 152 lines · Sam Ravnborg

Add a new binding file to describe the bindings
for the Atmel LCDC IP.
This replaces the old txt based binding.

The binding file describes the current binding, including properties to specify register values etc. The binding will be updated in a follow-up patch, the current binding describes the actual situation.

This new binding file replaces the old .txt based
binding which is deleted.

---
 .../bindings/display/atmel,lcdc.txt           |  88 -----------
 .../bindings/display/atmel/lcdc.yaml          | 137 ++++++++++++++++++
 2 files changed, 137 insertions(+), 88 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/display/atmel,lcdc.txt
 create mode 100644 Documentation/devicetree/bindings/display/atmel/lcdc.yaml
Documentation/devicetree/bindings/display/atmel,lcdc.txt deleted +0 -88
deleted file mode 100644
index acb5a0132127..000000000000
@@ -1,88 +0,0 @@
-Atmel LCDC Framebuffer
------------------------------------------------------
-
-Required properties:
-- compatible :
-	"atmel,at91sam9261-lcdc" ,
-	"atmel,at91sam9263-lcdc" ,
-	"atmel,at91sam9g10-lcdc" ,
-	"atmel,at91sam9g45-lcdc" ,
-	"atmel,at91sam9g45es-lcdc" ,
-	"atmel,at91sam9rl-lcdc" ,
-	"atmel,at32ap-lcdc"
-- reg : Should contain 1 register ranges(address and length).
-	Can contain an additional register range(address and length)
-	for fixed framebuffer memory. Useful for dedicated memories.
-- interrupts : framebuffer controller interrupt
-- display: a phandle pointing to the display node
-
-Required nodes:
-- display: a display node is required to initialize the lcd panel
-	This should be in the board dts.
-- default-mode: a videomode within the display with timing parameters
-	as specified below.
-
-Optional properties:
-- lcd-supply: Regulator for LCD supply voltage.
-
-Example:
-
-	fb0: fb@00500000 {
-		compatible = "atmel,at91sam9g45-lcdc";
-		reg = <0x00500000 0x1000>;
-		interrupts = <23 3 0>;
-		pinctrl-names = "default";
-		pinctrl-0 = <&pinctrl_fb>;
-		display = <&display0>;
-		#address-cells = <1>;
-		#size-cells = <1>;
-
-	};
-
-Example for fixed framebuffer memory:
-
-	fb0: fb@00500000 {
-		compatible = "atmel,at91sam9263-lcdc";
-		reg = <0x00700000 0x1000 0x70000000 0x200000>;
-		[...]
-	};
-
-Atmel LCDC Display
------------------------------------------------------
-Required properties (as per of_videomode_helper):
-
- - atmel,dmacon: dma controller configuration
- - atmel,lcdcon2: lcd controller configuration
- - atmel,guard-time: lcd guard time (Delay in frame periods)
- - bits-per-pixel: lcd panel bit-depth.
-
-Optional properties (as per of_videomode_helper):
- - atmel,lcdcon-backlight: enable backlight
- - atmel,lcdcon-backlight-inverted: invert backlight PWM polarity
- - atmel,lcd-wiring-mode: lcd wiring mode "RGB" or "BRG"
- - atmel,power-control-gpio: gpio to power on or off the LCD (as many as needed)
-
-Example:
-	display0: display {
-		bits-per-pixel = <32>;
-		atmel,lcdcon-backlight;
-		atmel,dmacon = <0x1>;
-		atmel,lcdcon2 = <0x80008002>;
-		atmel,guard-time = <9>;
-		atmel,lcd-wiring-mode = <1>;
-
-		display-timings {
-			native-mode = <&timing0>;
-			timing0: timing0 {
-				clock-frequency = <9000000>;
-				hactive = <480>;
-				vactive = <272>;
-				hback-porch = <1>;
-				hfront-porch = <1>;
-				vback-porch = <40>;
-				vfront-porch = <1>;
-				hsync-len = <45>;
-				vsync-len = <1>;
-			};
-		};
-	};
Documentation/devicetree/bindings/display/atmel/lcdc.yaml new file +32 -0
new file mode 100644
index 000000000000..7dcb9a4d5902
@@ -0,0 +1,137 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/atmel/lcdc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Atmel LCDC (LCD Controller) display controller with PWM
+
+maintainers:
+  - Sam Ravnborg <[email protected]>
+
+description: |
+  The Atmel LCDC Display Controller is display controller that
+  includes a PWM for backlight/contrast.
+
+properties:
+  compatible:
+    enum:
+      - atmel,at91sam9261-lcdc
+      - atmel,at91sam9263-lcdc
+      - atmel,at91sam9g10-lcdc
+      - atmel,at91sam9g45-lcdc
+      - atmel,at91sam9g45es-lcdc
+      - atmel,at91sam9g46-lcdc
+      - atmel,at91sam9m10-lcdc
+      - atmel,at91sam9m11-lcdc
+      - atmel,at91sam9rl-lcdc
+
+  "#address-cells":
+    const: 1
+  "#size-cells":
+    const: 0
Quoted 8 lines

Documentation/devicetree/bindings/display/atmel/lcdc.yaml line 38

Quoted 6 lines
Documentation/devicetree/bindings/display/atmel/lcdc.yaml new file +6 -0
+
+  reg:
+    description: |
+      Contains 1 register range (address and length).
+      Can contain an additional register range (address and length)
+      for fixed framebuffer memory

So, minItems: 1 , maxItems: 2?

The syntax is either:

    reg = <0x00700000 0x1000>;

or

    reg = <0x00700000 0x1000 0x70000000 0x200000>;

So always minItems: 1

Quoted 29 lines
Quoted 29 lines
Documentation/devicetree/bindings/display/atmel/lcdc.yaml new file +28 -0
+  interrupts:
+    maxItems: 1
+
+  lcd-supply:
+    description: Regulator for LCD supply voltage.
+
+  display:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: phandle to display node
+
+patternProperties:
+  "^display[0-9]$":
+    type: object
+    description: |
+      Display node is required to initialize the lcd panel.
+      This should be in the board dts
+
+    properties:
+
+      atmel,dmacon:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description: DMA controller configuration
+
+      atmel,lcdcon2:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description: LCD controller configuration
+
+      atmel,guard-time:
Quoted 8 lines

Documentation/devicetree/bindings/display/atmel/lcdc.yaml line 73

Quoted 6 lines
Documentation/devicetree/bindings/display/atmel/lcdc.yaml new file +6 -0
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description: LCD guard time (Delay in frame periods)
+
+      bits-per-pixel:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description: LCD panel bit-depth.

Those properties aren't documented anywhere?

Not more than this and then by their use in the driver(s).

In the current patchset the node is deprecated in next patch. I plan to do in two patches:
- delete properites which is not used in kernel, barebox, u-boot)
- Mark all the old properties deprecated

And for the soon-to-be deprecated properties we need no detailed description.

Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw

Re: [PATCH v1 2/4] dt-bindings: display: convert atmel lcdc to DT Schema

Quoted 166 lines · Sam Ravnborg

Hi Maxime.

Quoted 153 lines · Maxime Ripard
Quoted 152 lines · Sam Ravnborg

Add a new binding file to describe the bindings
for the Atmel LCDC IP.
This replaces the old txt based binding.

The binding file describes the current binding, including properties to specify register values etc. The binding will be updated in a follow-up patch, the current binding describes the actual situation.

This new binding file replaces the old .txt based
binding which is deleted.

---
 .../bindings/display/atmel,lcdc.txt           |  88 -----------
 .../bindings/display/atmel/lcdc.yaml          | 137 ++++++++++++++++++
 2 files changed, 137 insertions(+), 88 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/display/atmel,lcdc.txt
 create mode 100644 Documentation/devicetree/bindings/display/atmel/lcdc.yaml
Documentation/devicetree/bindings/display/atmel,lcdc.txt deleted +0 -88
deleted file mode 100644
index acb5a0132127..000000000000
@@ -1,88 +0,0 @@
-Atmel LCDC Framebuffer
------------------------------------------------------
-
-Required properties:
-- compatible :
-	"atmel,at91sam9261-lcdc" ,
-	"atmel,at91sam9263-lcdc" ,
-	"atmel,at91sam9g10-lcdc" ,
-	"atmel,at91sam9g45-lcdc" ,
-	"atmel,at91sam9g45es-lcdc" ,
-	"atmel,at91sam9rl-lcdc" ,
-	"atmel,at32ap-lcdc"
-- reg : Should contain 1 register ranges(address and length).
-	Can contain an additional register range(address and length)
-	for fixed framebuffer memory. Useful for dedicated memories.
-- interrupts : framebuffer controller interrupt
-- display: a phandle pointing to the display node
-
-Required nodes:
-- display: a display node is required to initialize the lcd panel
-	This should be in the board dts.
-- default-mode: a videomode within the display with timing parameters
-	as specified below.
-
-Optional properties:
-- lcd-supply: Regulator for LCD supply voltage.
-
-Example:
-
-	fb0: fb@00500000 {
-		compatible = "atmel,at91sam9g45-lcdc";
-		reg = <0x00500000 0x1000>;
-		interrupts = <23 3 0>;
-		pinctrl-names = "default";
-		pinctrl-0 = <&pinctrl_fb>;
-		display = <&display0>;
-		#address-cells = <1>;
-		#size-cells = <1>;
-
-	};
-
-Example for fixed framebuffer memory:
-
-	fb0: fb@00500000 {
-		compatible = "atmel,at91sam9263-lcdc";
-		reg = <0x00700000 0x1000 0x70000000 0x200000>;
-		[...]
-	};
-
-Atmel LCDC Display
------------------------------------------------------
-Required properties (as per of_videomode_helper):
-
- - atmel,dmacon: dma controller configuration
- - atmel,lcdcon2: lcd controller configuration
- - atmel,guard-time: lcd guard time (Delay in frame periods)
- - bits-per-pixel: lcd panel bit-depth.
-
-Optional properties (as per of_videomode_helper):
- - atmel,lcdcon-backlight: enable backlight
- - atmel,lcdcon-backlight-inverted: invert backlight PWM polarity
- - atmel,lcd-wiring-mode: lcd wiring mode "RGB" or "BRG"
- - atmel,power-control-gpio: gpio to power on or off the LCD (as many as needed)
-
-Example:
-	display0: display {
-		bits-per-pixel = <32>;
-		atmel,lcdcon-backlight;
-		atmel,dmacon = <0x1>;
-		atmel,lcdcon2 = <0x80008002>;
-		atmel,guard-time = <9>;
-		atmel,lcd-wiring-mode = <1>;
-
-		display-timings {
-			native-mode = <&timing0>;
-			timing0: timing0 {
-				clock-frequency = <9000000>;
-				hactive = <480>;
-				vactive = <272>;
-				hback-porch = <1>;
-				hfront-porch = <1>;
-				vback-porch = <40>;
-				vfront-porch = <1>;
-				hsync-len = <45>;
-				vsync-len = <1>;
-			};
-		};
-	};
Documentation/devicetree/bindings/display/atmel/lcdc.yaml new file +32 -0
new file mode 100644
index 000000000000..7dcb9a4d5902
@@ -0,0 +1,137 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/atmel/lcdc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Atmel LCDC (LCD Controller) display controller with PWM
+
+maintainers:
+  - Sam Ravnborg <[email protected]>
+
+description: |
+  The Atmel LCDC Display Controller is display controller that
+  includes a PWM for backlight/contrast.
+
+properties:
+  compatible:
+    enum:
+      - atmel,at91sam9261-lcdc
+      - atmel,at91sam9263-lcdc
+      - atmel,at91sam9g10-lcdc
+      - atmel,at91sam9g45-lcdc
+      - atmel,at91sam9g45es-lcdc
+      - atmel,at91sam9g46-lcdc
+      - atmel,at91sam9m10-lcdc
+      - atmel,at91sam9m11-lcdc
+      - atmel,at91sam9rl-lcdc
+
+  "#address-cells":
+    const: 1
+  "#size-cells":
+    const: 0
Quoted 8 lines

Documentation/devicetree/bindings/display/atmel/lcdc.yaml line 38

Quoted 6 lines
Documentation/devicetree/bindings/display/atmel/lcdc.yaml new file +6 -0
+
+  reg:
+    description: |
+      Contains 1 register range (address and length).
+      Can contain an additional register range (address and length)
+      for fixed framebuffer memory

So, minItems: 1 , maxItems: 2?

The syntax is either:

Quoted 7 lines
    reg = <0x00700000 0x1000>;

or

    reg = <0x00700000 0x1000 0x70000000 0x200000>;

So always minItems: 1

Yeah, but <0x00700000 0x1000 0x70000000 0x200000 0x70000000 0x200000>; would be invalid, right?

Quoted 40 lines
Quoted 29 lines
Quoted 29 lines
Documentation/devicetree/bindings/display/atmel/lcdc.yaml new file +28 -0
+  interrupts:
+    maxItems: 1
+
+  lcd-supply:
+    description: Regulator for LCD supply voltage.
+
+  display:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: phandle to display node
+
+patternProperties:
+  "^display[0-9]$":
+    type: object
+    description: |
+      Display node is required to initialize the lcd panel.
+      This should be in the board dts
+
+    properties:
+
+      atmel,dmacon:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description: DMA controller configuration
+
+      atmel,lcdcon2:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description: LCD controller configuration
+
+      atmel,guard-time:
Quoted 8 lines

Documentation/devicetree/bindings/display/atmel/lcdc.yaml line 73

Quoted 6 lines
Documentation/devicetree/bindings/display/atmel/lcdc.yaml new file +6 -0
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description: LCD guard time (Delay in frame periods)
+
+      bits-per-pixel:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description: LCD panel bit-depth.

Those properties aren't documented anywhere?

Not more than this and then by their use in the driver(s).

Quoted 7 lines

In the current patchset the node is deprecated in next patch. I plan to do in two patches:
- delete properites which is not used in kernel, barebox, u-boot)
- Mark all the old properties deprecated

And for the soon-to-be deprecated properties we need no detailed description.

Even if they are going to be deprecated, and it never was done, it seems to be a good occasion to document them properly.

Maxime

#9 lore raw

PATCH 3/4 dt-bindings: media: add wiring property to video-interfaces

In reply to Sam Ravnborg

The wiring property is used to describe the wiring between the connector and the panel. The property can be used when the wiring is used to change the mode from for example BGR to RGB. The first users are the at91sam9 family where such a wiring trick is sometimes used.
The possilbe values are so far limited to what is required by the at91sam9 family, but using "text" allows us to extend this in the future.

There exists similar properties today:
- display/tilcdc/tilcdc.txt: blue-and-red-wiring
- display/atmel,lcdc.txt: atmel,lcd-wiring-mode

Neither of the above are defined as endpoint properties.

The new property "wiring" has a more general name and is defined as an endpoint property.
It will replace atmel,lcd-wiring-mode and may replace blue-and-red-wiring.

Cc Mauro Carvalho Chehab <[email protected]>
Cc Rob Herring <[email protected]>
Cc Hans Verkuil <[email protected]>
---
 Documentation/devicetree/bindings/media/video-interfaces.txt | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/media/video-interfaces.txt +3 -0
index f884ada0bffc..c3bb87c5c9a9 100644
@@ -141,6 +141,9 @@ Optional endpoint properties
 - link-frequencies: Allowed data bus frequencies. For MIPI CSI-2, for
   instance, this is the actual frequency of the bus, not bits per clock per
   lane value. An array of 64-bit unsigned integers.
+- wiring: Wiring of data lines to display.
+  "straight" - normal wiring.
+  "red-blue-reversed" - red and blue lines reversed.
 - lane-polarities: an array of polarities of the lanes starting from the clock
   lane and followed by the data lanes in the same order as in data-lanes.
   Valid values are 0 (normal) and 1 (inverted). The length of the array
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer
#10 lore raw

Re: [PATCH v1 3/4] dt-bindings: media: add wiring property to video-interfaces

Quoted 34 lines · Sam Ravnborg

The wiring property is used to describe the wiring between the connector and the panel. The property can be used when the wiring is used to change the mode from for example BGR to RGB. The first users are the at91sam9 family where such a wiring trick is sometimes used.
The possilbe values are so far limited to what is required by the at91sam9 family, but using "text" allows us to extend this in the future.

There exists similar properties today:
- display/tilcdc/tilcdc.txt: blue-and-red-wiring
- display/atmel,lcdc.txt: atmel,lcd-wiring-mode

Neither of the above are defined as endpoint properties.

The new property "wiring" has a more general name and is defined as an endpoint property.
It will replace atmel,lcd-wiring-mode and may replace blue-and-red-wiring.

Cc Mauro Carvalho Chehab <[email protected]>
Cc Rob Herring <[email protected]>
Cc Hans Verkuil <[email protected]>
---
 Documentation/devicetree/bindings/media/video-interfaces.txt | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/media/video-interfaces.txt +0 -0
index f884ada0bffc..c3bb87c5c9a9 100644

Documentation/devicetree/bindings/media/video-interfaces.txt Optional endpoint properties · line 145

Quoted 5 lines
Documentation/devicetree/bindings/media/video-interfaces.txt +2 -0
@@ -141,6 +141,9 @@ Optional endpoint properties
 - link-frequencies: Allowed data bus frequencies. For MIPI CSI-2, for
   instance, this is the actual frequency of the bus, not bits per clock per
   lane value. An array of 64-bit unsigned integers.
+- wiring: Wiring of data lines to display.
+  "straight" - normal wiring.

Don't really need a property to express this...

Documentation/devicetree/bindings/media/video-interfaces.txt Optional endpoint properties · line 146

Quoted 1 line
Documentation/devicetree/bindings/media/video-interfaces.txt +1 -0
+  "red-blue-reversed" - red and blue lines reversed.

For a common property, I think this needs to be looked at in terms of formats and some of the format negotiation work Boris was doing.

Rob
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#11 lore raw

Re: [PATCH v1 3/4] dt-bindings: media: add wiring property to video-interfaces

Hi Rob.

Quoted 43 lines · Rob Herring
Quoted 34 lines · Sam Ravnborg

The wiring property is used to describe the wiring between the connector and the panel. The property can be used when the wiring is used to change the mode from for example BGR to RGB. The first users are the at91sam9 family where such a wiring trick is sometimes used.
The possilbe values are so far limited to what is required by the at91sam9 family, but using "text" allows us to extend this in the future.

There exists similar properties today:
- display/tilcdc/tilcdc.txt: blue-and-red-wiring
- display/atmel,lcdc.txt: atmel,lcd-wiring-mode

Neither of the above are defined as endpoint properties.

The new property "wiring" has a more general name and is defined as an endpoint property.
It will replace atmel,lcd-wiring-mode and may replace blue-and-red-wiring.

Cc Mauro Carvalho Chehab <[email protected]>
Cc Rob Herring <[email protected]>
Cc Hans Verkuil <[email protected]>
---
 Documentation/devicetree/bindings/media/video-interfaces.txt | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/media/video-interfaces.txt +0 -0
index f884ada0bffc..c3bb87c5c9a9 100644

Documentation/devicetree/bindings/media/video-interfaces.txt Optional endpoint properties · line 145

Quoted 5 lines
Documentation/devicetree/bindings/media/video-interfaces.txt +2 -0
@@ -141,6 +141,9 @@ Optional endpoint properties
 - link-frequencies: Allowed data bus frequencies. For MIPI CSI-2, for
   instance, this is the actual frequency of the bus, not bits per clock per
   lane value. An array of 64-bit unsigned integers.
+- wiring: Wiring of data lines to display.
+  "straight" - normal wiring.

Don't really need a property to express this...

Quoted 4 lines

Documentation/devicetree/bindings/media/video-interfaces.txt Optional endpoint properties · line 146

Quoted 1 line
Documentation/devicetree/bindings/media/video-interfaces.txt +1 -0
+  "red-blue-reversed" - red and blue lines reversed.

For a common property, I think this needs to be looked at in terms of formats and some of the format negotiation work Boris was doing.

OK, I will bite the bullet and try to understand this good enough to come up with a proposal.
I will delay the conversion a bit, but we are in no hurry.

Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#12 lore raw

PATCH 4/4 dt-bindings: display: add port support to atmel lcdc

In reply to Sam Ravnborg

Update the Atmel LCDC binding to include:
- pwm. Used for backlight
- endpoints using port node
Used for handle to panel
- Added wiring property that is used to describe
the wiring between the LCDC and the panel

Existing properties that should not be used in new bindings are deprecated.

Updated example to include the updated way to specify panel etc.

---
 .../bindings/display/atmel/lcdc.yaml          | 94 ++++++++++++++++++-
 1 file changed, 93 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/display/atmel/lcdc.yaml +93 -1
index 7dcb9a4d5902..b5c2628f7805 100644
@@ -28,6 +28,7 @@ properties:
 
   "#address-cells":
     const: 1
+
   "#size-cells":
     const: 0
 
@@ -43,13 +44,84 @@ properties:
   lcd-supply:
     description: Regulator for LCD supply voltage.
 
+  "#pwm-cells":
+    description:
+      This PWM chip use the default 3 cells bindings
+      defined in ../../pwm/pwm.yaml.
+    const: 3
+
+  clocks:
+    maxItems: 2
+
+  clock-names:
+    maxItems: 2
+    items:
+      - const: lcdc_clk
+      - const: hclk
+
+  port@0:
+    type: object
+    description: Endpoints of the display controller
+
+    properties:
+
+      reg:
+        const: 0
+
+      "#address-cells":
+        const: 1
+
+      "#size-cells":
+        const: 0
+
+      endpoint@0:
+        type: object
+        description: endpoint node that include phandle to panel
+
+        properties:
+
+          reg:
+            const: 0
+
+          wiring:
+            enum:
+              - straight
+              - red-blue-reversed
+            description: |
+              The LCDC is based on a blue-green-red configuration but to adapt
+              to SW only supporting red-green-blue the data lines for red and blue
+              may be reversed.
+              See details in: http://ww1.microchip.com/downloads/en/AppNotes/doc6300.pdf
+              "straight" - default value. Data lines are not reversed, uses BGR
+              "red-blue-reversed" - red and green are reversed, uses RGB
+
+          remote-endpoint:
+            $ref: /schemas/types.yaml#/definitions/phandle
+            description:
+              phandle to the panel node
+
+        required:
+          - reg
+          - remote-endpoint
+
+        additionalProperties: false
+
+    required:
+      - "#address-cells"
+      - "#size-cells"
+      - reg
+
+    additionalProperties: false
+
   display:
     $ref: /schemas/types.yaml#/definitions/phandle
+    deprecated: true
     description: phandle to display node
 
 patternProperties:
   "^display[0-9]$":
     type: object
+    deprecated: true
     description: |
       Display node is required to initialize the lcd panel.
       This should be in the board dts
@@ -107,12 +179,32 @@ required:
 
 examples:
   - |
+    #include <dt-bindings/clock/at91.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
     fb {
         compatible = "atmel,at91sam9263-lcdc";
         reg = <0x00700000 0x1000>;
-        interrupts = <23 3 0>;
+        interrupts = <26 IRQ_TYPE_LEVEL_HIGH 3>;
+        clocks = <&pmc PMC_TYPE_PERIPHERAL 26>, <&pmc PMC_TYPE_PERIPHERAL 26>;
+        clock-names = "lcdc_clk", "hclk";
+
+        /* pwm for backlight */
+        #pwm-cells = <3>;
+
         #address-cells = <1>;
         #size-cells = <0>;
+
+        port@0 {
+            reg = <0>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+            endpoint@0 {
+                reg = <0>;
+                wiring = "red-blue-reversed";
+                remote-endpoint = <&panel_input>;
+            };
+        };
     };
 
   - |
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer
#13 lore raw

Re: [PATCH v1 4/4] dt-bindings: display: add port support to atmel lcdc

Quoted 39 lines · Sam Ravnborg

Update the Atmel LCDC binding to include:
- pwm. Used for backlight
- endpoints using port node
Used for handle to panel
- Added wiring property that is used to describe
the wiring between the LCDC and the panel

Existing properties that should not be used in new bindings are deprecated.

Updated example to include the updated way to specify panel etc.

---
 .../bindings/display/atmel/lcdc.yaml          | 94 ++++++++++++++++++-
 1 file changed, 93 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/display/atmel/lcdc.yaml +7 -0
index 7dcb9a4d5902..b5c2628f7805 100644
@@ -28,6 +28,7 @@ properties:
 
   "#address-cells":
     const: 1
+
   "#size-cells":
     const: 0
 
@@ -43,13 +44,84 @@ properties:
   lcd-supply:
     description: Regulator for LCD supply voltage.
 
+  "#pwm-cells":
+    description:
+      This PWM chip use the default 3 cells bindings
+      defined in ../../pwm/pwm.yaml.
+    const: 3
+

Documentation/devicetree/bindings/display/atmel/lcdc.yaml properties: · line 62

Quoted 10 lines
Documentation/devicetree/bindings/display/atmel/lcdc.yaml +10 -0
+  clocks:
+    maxItems: 2
+
+  clock-names:
+    maxItems: 2
+    items:
+      - const: lcdc_clk
+      - const: hclk
+
+  port@0:

Just 'port' if there's only 1.

Quoted 5 lines
Documentation/devicetree/bindings/display/atmel/lcdc.yaml +5 -0
+    type: object
+    description: Endpoints of the display controller
+
+    properties:
+

Documentation/devicetree/bindings/display/atmel/lcdc.yaml properties: · line 77

Quoted 10 lines
Documentation/devicetree/bindings/display/atmel/lcdc.yaml +10 -0
+      reg:
+        const: 0
+
+      "#address-cells":
+        const: 1
+
+      "#size-cells":
+        const: 0
+
+      endpoint@0:

Just 'endpoint' if there's only 1.

Quoted 87 lines
Documentation/devicetree/bindings/display/atmel/lcdc.yaml +61 -1
+        type: object
+        description: endpoint node that include phandle to panel
+
+        properties:
+
+          reg:
+            const: 0
+
+          wiring:
+            enum:
+              - straight
+              - red-blue-reversed
+            description: |
+              The LCDC is based on a blue-green-red configuration but to adapt
+              to SW only supporting red-green-blue the data lines for red and blue
+              may be reversed.
+              See details in: http://ww1.microchip.com/downloads/en/AppNotes/doc6300.pdf
+              "straight" - default value. Data lines are not reversed, uses BGR
+              "red-blue-reversed" - red and green are reversed, uses RGB
+
+          remote-endpoint:
+            $ref: /schemas/types.yaml#/definitions/phandle
+            description:
+              phandle to the panel node
+
+        required:
+          - reg
+          - remote-endpoint
+
+        additionalProperties: false
+
+    required:
+      - "#address-cells"
+      - "#size-cells"
+      - reg
+
+    additionalProperties: false
+
   display:
     $ref: /schemas/types.yaml#/definitions/phandle
+    deprecated: true
     description: phandle to display node
 
 patternProperties:
   "^display[0-9]$":
     type: object
+    deprecated: true
     description: |
       Display node is required to initialize the lcd panel.
       This should be in the board dts
@@ -107,12 +179,32 @@ required:
 
 examples:
   - |
+    #include <dt-bindings/clock/at91.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
     fb {
         compatible = "atmel,at91sam9263-lcdc";
         reg = <0x00700000 0x1000>;
-        interrupts = <23 3 0>;
+        interrupts = <26 IRQ_TYPE_LEVEL_HIGH 3>;
+        clocks = <&pmc PMC_TYPE_PERIPHERAL 26>, <&pmc PMC_TYPE_PERIPHERAL 26>;
+        clock-names = "lcdc_clk", "hclk";
+
+        /* pwm for backlight */
+        #pwm-cells = <3>;
+
         #address-cells = <1>;
         #size-cells = <0>;
+
+        port@0 {
+            reg = <0>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+            endpoint@0 {
+                reg = <0>;
+                wiring = "red-blue-reversed";
+                remote-endpoint = <&panel_input>;
+            };
+        };
     };
 
   - |
Signature · 1 line
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel