Skip to contentSkip to conversation

dt-bindings: display: atmel,lcdc: convert to dtschema

PATCH Applied Dharma Balasubiramani 2 participants 2 messages Mar 18, 2024 – Mar 25, 2024

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

PATCH v4 1/1 dt-bindings: display: atmel,lcdc: convert to dtschema

Convert the atmel,lcdc bindings to DT schema.
Changes during conversion: add missing clocks and clock-names properties.

---
This patch converts the existing lcdc display text binding to JSON schema. The binding is split into two namely
lcdc.yaml
- Holds the frame buffer properties
lcdc-display.yaml
- Holds the display panel properties which is a phandle to the display property in lcdc fb node.

These bindings are tested using the following command.
'make DT_CHECKER_FLAGS=-m dt_binding_check'
---
Changes in v4:
- Add maximum for atmel,guard-time property.
- Add constraints for bits-per-pixel property.
- Update the atmel,lcd-wiring-mode property's ref to point single string rather than an array.
- Add constraints for atmel,lcd-wiring-mode property.
- Add maxItems to the atmel,power-control-gpio property.
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- Remove the generic property "bits-per-pixel"
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Run checkpatch and remove whitespace errors.
- Add the standard interrupt flags.
- Split the binding into two, namely lcdc.yaml and lcdc-display.yaml.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 .../bindings/display/atmel,lcdc-display.yaml       | 103 +++++++++++++++++++++
 .../devicetree/bindings/display/atmel,lcdc.txt     |  87 -----------------
 .../devicetree/bindings/display/atmel,lcdc.yaml    |  70 ++++++++++++++
 3 files changed, 173 insertions(+), 87 deletions(-)
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml new file +103 -0
new file mode 100644
index 000000000000..a5cf040ab4ea
@@ -0,0 +1,103 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/atmel,lcdc-display.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip's LCDC Display
+
+maintainers:
+  - Nicolas Ferre <[email protected]>
+  - Dharma Balasubiramani <[email protected]>
+
+description:
+  The LCD Controller (LCDC) consists of logic for transferring LCD image data
+  from an external display buffer to a TFT LCD panel. The LCDC has one display
+  input buffer per layer that fetches pixels through the single bus host
+  interface and a look-up table to allow palletized display configurations. The
+  LCDC is programmable on a per layer basis, and supports different LCD
+  resolutions, window sizes, image formats and pixel depths.
+
+# We need a select here since this schema is applicable only for nodes with the
+# following properties
+
+select:
+  anyOf:
+    - required: [ 'atmel,dmacon' ]
+    - required: [ 'atmel,lcdcon2' ]
+    - required: [ 'atmel,guard-time' ]
+
+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:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: lcd guard time (Delay in frame periods)
+    maximum: 127
+
+  bits-per-pixel:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: lcd panel bit-depth.
+    enum: [1, 2, 4, 8, 16, 24, 32]
+
+  atmel,lcdcon-backlight:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: enable backlight
+
+  atmel,lcdcon-backlight-inverted:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: invert backlight PWM polarity
+
+  atmel,lcd-wiring-mode:
+    $ref: /schemas/types.yaml#/definitions/string
+    description: lcd wiring mode "RGB" or "BRG"
+    enum:
+      - RGB
+      - BRG
+
+  atmel,power-control-gpio:
+    description: gpio to power on or off the LCD (as many as needed)
+    maxItems: 1
+
+  display-timings:
+    $ref: panel/display-timings.yaml#
+
+required:
+  - atmel,dmacon
+  - atmel,lcdcon2
+  - atmel,guard-time
+  - bits-per-pixel
+
+additionalProperties: false
+
+examples:
+  - |
+    display: panel {
+      bits-per-pixel = <32>;
+      atmel,lcdcon-backlight;
+      atmel,dmacon = <0x1>;
+      atmel,lcdcon2 = <0x80008002>;
+      atmel,guard-time = <9>;
+      atmel,lcd-wiring-mode = "RGB";
+
+      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.txt deleted +0 -87

87 lines not on this page · raw message

Documentation/devicetree/bindings/display/atmel,lcdc.yaml new file +70 -0

70 lines not on this page · raw message

---
base-commit: f6cef5f8c37f58a3bc95b3754c3ae98e086631ca
change-id: 20240223-lcdc-fb-b8d2e2f3c914

Best regards,

Signature · 1 line
Dharma Balasubiramani <[email protected]>
maintainer Applied
#1 lore raw
Quoted 34 lines · Dharma Balasubiramani

Convert the atmel,lcdc bindings to DT schema.
Changes during conversion: add missing clocks and clock-names properties.

---
This patch converts the existing lcdc display text binding to JSON schema. The binding is split into two namely
lcdc.yaml
- Holds the frame buffer properties
lcdc-display.yaml
- Holds the display panel properties which is a phandle to the display property in lcdc fb node.

These bindings are tested using the following command.
'make DT_CHECKER_FLAGS=-m dt_binding_check'
---
Changes in v4:
- Add maximum for atmel,guard-time property.
- Add constraints for bits-per-pixel property.
- Update the atmel,lcd-wiring-mode property's ref to point single string rather than an array.
- Add constraints for atmel,lcd-wiring-mode property.
- Add maxItems to the atmel,power-control-gpio property.
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- Remove the generic property "bits-per-pixel"
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Run checkpatch and remove whitespace errors.
- Add the standard interrupt flags.
- Split the binding into two, namely lcdc.yaml and lcdc-display.yaml.
- Link to v1: https://lore.kernel.org/r/[email protected]

Quoted 6 lines
---
 .../bindings/display/atmel,lcdc-display.yaml       | 103 +++++++++++++++++++++
 .../devicetree/bindings/display/atmel,lcdc.txt     |  87 -----------------
 .../devicetree/bindings/display/atmel,lcdc.yaml    |  70 ++++++++++++++
 3 files changed, 173 insertions(+), 87 deletions(-)

Applied, thanks!