dt-bindings: display: atmel,lcdc: convert to dtschema
PATCH v3 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 namelylcdc.yaml
- Holds the frame buffer propertieslcdc-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 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 | 97 ++++++++++++++++++++++ .../devicetree/bindings/display/atmel,lcdc.txt | 87 ------------------- .../devicetree/bindings/display/atmel,lcdc.yaml | 70 ++++++++++++++++ 3 files changed, 167 insertions(+), 87 deletions(-)
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml new file +97 -0
@@ -0,0 +1,97 @@ +# 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) + + bits-per-pixel: + $ref: /schemas/types.yaml#/definitions/uint32 + description: lcd panel bit-depth. + + 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/non-unique-string-array + description: lcd wiring mode "RGB" or "BRG" + + atmel,power-control-gpio: + description: gpio to power on or off the LCD (as many as needed) + + 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 = <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.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: 90d35da658da8cff0d4ecbb5113f5fac9d00eb72
change-id: 20240223-lcdc-fb-b8d2e2f3c914
Best regards,
Signature · 1 line
Dharma Balasubiramani <[email protected]>
Rob Herring
maintainerQuoted 68 lines · Dharma Balasubiramani
Convert the atmel,lcdc bindings to DT schema.
Changes during conversion: add missing clocks and clock-names properties.Signed-off-by Dharma Balasubiramani <[email protected]>---
This patch converts the existing lcdc display text binding to JSON schema. The binding is split into two namelylcdc.yaml
- Holds the frame buffer propertieslcdc-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=-mdt_binding_check'
---
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, namelylcdc.yamlandlcdc-display.yaml.
- Link to v1: https://lore.kernel.org/r/[email protected]--- .../bindings/display/atmel,lcdc-display.yaml | 97 ++++++++++++++++++++++ .../devicetree/bindings/display/atmel,lcdc.txt | 87 ------------------- .../devicetree/bindings/display/atmel,lcdc.yaml | 70 ++++++++++++++++ 3 files changed, 167 insertions(+), 87 deletions(-)Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml new file +31
-0@@ -0,0 +1,97 @@ +# 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:
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml line 41
Quoted 10 lines
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml new file +10
-0+ $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)
Is there a maximum?
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml line 45
Quoted 4 lines
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml new file +4
-0+ + bits-per-pixel: + $ref: /schemas/types.yaml#/definitions/uint32 + description: lcd panel bit-depth.
Constraints?
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml line 56
Quoted 11 lines
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml new file +11
-0+ + 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/non-unique-string-array
Isn't this just a single string rather than an array?
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml line 57
Quoted 1 line
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml new file +1
-0+ description: lcd wiring mode "RGB" or "BRG"
enum:
- RGB
- BRG
No BGR?
But wait, the example shows the value is '1'. That should fail testing. It didn't, but I've now fixed that.
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml line 60
Quoted 3 lines
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml new file +3
-0+ + atmel,power-control-gpio: + description: gpio to power on or off the LCD (as many as needed)
maxItems: 1
Quoted 37 lines
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml new file +37
-0+ + 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 = <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>; + }; + }; + };
Quoted 75 lines · Rob Herring
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
Quoted 72 lines · Dharma Balasubiramani
Convert the atmel,lcdc bindings to DT schema.
Changes during conversion: add missing clocks and clock-names properties.Signed-off-by Dharma Balasubiramani <[email protected]>---
This patch converts the existing lcdc display text binding to JSON schema. The binding is split into two namelylcdc.yaml
- Holds the frame buffer propertieslcdc-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=-mdt_binding_check'
---
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, namelylcdc.yamlandlcdc-display.yaml.
- Link to v1: https://lore.kernel.org/r/[email protected]--- .../bindings/display/atmel,lcdc-display.yaml | 97 ++++++++++++++++++++++ .../devicetree/bindings/display/atmel,lcdc.txt | 87 ------------------- .../devicetree/bindings/display/atmel,lcdc.yaml | 70 ++++++++++++++++ 3 files changed, 167 insertions(+), 87 deletions(-)Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml new file +35
-0@@ -0,0 +1,97 @@ +# 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:
Quoted 8 lines
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml line 41
Quoted 6 lines
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml new file +6
-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)Is there a maximum?
The datasheet (https://www.keil.com/dd/chip/4210.htm) for both AT91SAM9261 and AT91SAM9263 specifies the GUARD_TIME field within the PWRCON register. This field is 7 bits wide (bits 1-7) and acts as a mask to define the guard time delay.
Hence the maximum value for the guard time for both AT91SAM9261 and AT91SAM9263 SoCs is 127 when using the GUARD_TIME field in the PWRCON register.
The datasheet doesn't specify the duration of each "frame period." So, this value only represents the maximum number of frame periods that can be set for the guard time, not the actual time delay in seconds or milliseconds.
Quoted 7 lines
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml line 45
Quoted 5 lines
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml new file +4
-0+ + bits-per-pixel: + $ref: /schemas/types.yaml#/definitions/uint32 + description: lcd panel bit-depth.Constraints?
The bits-per-pixel value can be 1, 2, 4, 8, 16 or 24.
Quoted 15 lines
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml line 56
Quoted 12 lines
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml new file +11
-0+ + 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/non-unique-string-arrayIsn't this just a single string rather than an array?
Quoted 7 lines
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml line 57
Quoted 1 line
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml new file +1
-0+ description: lcd wiring mode "RGB" or "BRG"enum:
- RGB
- BRGNo BGR?
In the current driver implementation, we have interpreted the wiring mode represented by ATMEL_LCDC_WIRING_BGR as 'BRG' in the array atmel_lcdfb_wiring_modes. Considering conventional color representation, would it be appropriate to consider modifying the existing driver to use the 'BGR' string instead of 'BRG' for better alignment with standard naming conventions?
static const char *atmel_lcdfb_wiring_modes[] = {
[ATMEL_LCDC_WIRING_BGR] = "BRG",
[ATMEL_LCDC_WIRING_RGB] = "RGB",
};Quoted 3 lines
But wait, the example shows the value is '1'. That should fail testing. It didn't, but I've now fixed that.
It seems correctly configured in our dts files but didn't noticed the same in the bindings example, thanks for letting me know, I will correct it in the next revision.
Quoted 6 lines
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml line 60
Quoted 4 lines
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml new file +3
-0+ + atmel,power-control-gpio: + description: gpio to power on or off the LCD (as many as needed)maxItems: 1
Thanks, I will add it.
Quoted 38 lines
Quoted 38 lines
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml new file +37
-0+ + 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 = <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>; + }; + }; + };
Signature · 2 lines
With Best Regards, Dharma B.
Nicolas Ferre
maintainerDharma, all,
Quoted 37 lines · On 06/03/2024 at 15:35, Dharma B - I70843 wrote:
Quoted 35 lines · Rob Herring
Quoted 34 lines · Dharma Balasubiramani
Convert the atmel,lcdc bindings to DT schema.
Changes during conversion: add missing clocks and clock-names properties.Signed-off-by Dharma Balasubiramani <[email protected]>---
This patch converts the existing lcdc display text binding to JSON schema. The binding is split into two namelylcdc.yaml
- Holds the frame buffer propertieslcdc-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=-mdt_binding_check'
---
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, namelylcdc.yamlandlcdc-display.yaml.
- Link to v1: https://lore.kernel.org/r/[email protected]--- .../bindings/display/atmel,lcdc-display.yaml | 97 ++++++++++++++++++++++ .../devicetree/bindings/display/atmel,lcdc.txt | 87 ------------------- .../devicetree/bindings/display/atmel,lcdc.yaml | 70 ++++++++++++++++ 3 files changed, 167 insertions(+), 87 deletions(-)Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml new file +0
-0
[..]
Quoted 11 lines
Quoted 11 lines
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml line 56
Quoted 2 lines
Documentation/devicetree/bindings/display/atmel,lcdc-display.yaml new file +2
-0+ atmel,lcd-wiring-mode: + $ref: /schemas/types.yaml#/definitions/non-unique-string-arrayIsn't this just a single string rather than an array?
Quoted 1 line
+ description: lcd wiring mode "RGB" or "BRG"
enum:
- RGB
- BRG
Quoted 8 lines
Quoted 1 line
No BGR?
In the current driver implementation, we have interpreted the wiring mode represented by
ATMEL_LCDC_WIRING_BGRas 'BRG' in the arrayatmel_lcdfb_wiring_modes. Considering conventional color representation, would it be appropriate to consider modifying the existing driver to use the 'BGR' string instead of 'BRG' for better alignment with standard naming conventions?
This "BRG" thing is definitively a typo. We never had such thing as a BRG color wiring but did have BGR wiring mode.
Quoted 3 lines
static const char *atmel_lcdfb_wiring_modes[] = {
[ATMEL_LCDC_WIRING_BGR] = "BRG",
[ATMEL_LCDC_WIRING_RGB] = "RGB",The thing is that we have one DT using that:arch/arm/boot/dts/at91sam9261ek.dts
So, either I would leave it like that: it's only old product using it.
Or just focus on first character in the string so that it works for both "BRG" or "BGR", and maintains the backward compatibility.
Regards,
Nicolas
Quoted 10 lines
};
Quoted 3 lines
But wait, the example shows the value is '1'. That should fail testing. It didn't, but I've now fixed that.
It seems correctly configured in our dts files but didn't noticed the same in the bindings example, thanks for letting me know, I will correct it in the next revision.
Quoted 75 lines · On 06/03/24 10:16 pm, Nicolas Ferre - M43238 wrote:
Dharma, all,
Quoted 46 lines · On 06/03/2024 at 15:35, Dharma B - I70843 wrote:
Quoted 44 lines · Rob Herring
Quoted 43 lines · Dharma Balasubiramani
Convert the atmel,lcdc bindings to DT schema. Changes during conversion: add missing clocks and clock-names properties.
Signed-off-by Dharma Balasubiramani <[email protected]>---
This patch converts the existing lcdc display text binding to JSON schema.
The binding is split into two namelylcdc.yaml
- Holds the frame buffer propertieslcdc-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 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, namelylcdc.yamlandlcdc-display.yaml.
- Link to v1:
https://lore.kernel.org/r/[email protected]
---
.../bindings/display/atmel,lcdc-display.yaml | 97
++++++++++++++++++++++
.../devicetree/bindings/display/atmel,lcdc.txt | 87
-------------------
.../devicetree/bindings/display/atmel,lcdc.yaml | 70
++++++++++++++++3 files changed, 167 insertions(+), 87 deletions(-)(quoted diff) +0
-0
a/Documentation/devicetree/bindings/display/atmel,lcdc-display.yamlb/Documentation/devicetree/bindings/display/atmel,lcdc-display.yamlnew file mode 100644
index 000000000000..5e0b706d695d[..]
Quoted 11 lines
Quoted 11 lines
Quoted 2 lines
+ atmel,lcd-wiring-mode:
+ $ref: /schemas/types.yaml#/definitions/non-unique-string-arrayIsn't this just a single string rather than an array?
Quoted 1 line
+ description: lcd wiring mode "RGB" or "BRG"
enum:
- RGB
- BRGQuoted 8 lines
Quoted 1 line
No BGR?
In the current driver implementation, we have interpreted the wiring mode represented by
ATMEL_LCDC_WIRING_BGRas 'BRG' in the arrayatmel_lcdfb_wiring_modes. Considering conventional color representation, would it be appropriate to consider modifying the existing driver to use the 'BGR' string instead of 'BRG' for better alignment with standard naming conventions?This "BRG" thing is definitively a typo. We never had such thing as a BRG color wiring but did have BGR wiring mode.
Quoted 8 lines
Quoted 3 lines
static const char *atmel_lcdfb_wiring_modes[] = {
[ATMEL_LCDC_WIRING_BGR] = "BRG",
[ATMEL_LCDC_WIRING_RGB] = "RGB",The thing is that we have one DT using that:
arch/arm/boot/dts/at91sam9261ek.dtsSo, either I would leave it like that: it's only old product using it.
Thank you for your input, Nicolas. If Rob is in agreement with this proposal as well, I plan to proceed and submit v4, incorporating adjustments based on other review comments.
Quoted 18 lines
Or just focus on first character in the string so that it works for both "BRG" or "BGR", and maintains the backward compatibility.
Regards,
NicolasQuoted 10 lines
};
Quoted 3 lines
But wait, the example shows the value is '1'. That should fail testing. It didn't, but I've now fixed that.
It seems correctly configured in our dts files but didn't noticed the same in the bindings example, thanks for letting me know, I will correct it in the next revision.
Signature · 2 lines
With Best Regards, Dharma B.