diff mbox series

[v2] dt-bindings: display: st, stm32-ltdc: Document stm32mp25 compatible

Message ID 20240809151314.221746-1-yannick.fertre@foss.st.com (mailing list archive)
State New, archived
Headers show
Series [v2] dt-bindings: display: st, stm32-ltdc: Document stm32mp25 compatible | expand

Commit Message

Yannick Fertre Aug. 9, 2024, 3:13 p.m. UTC
Add "st,stm32mp25-ltdc" compatible for SOC MP25. This new SOC introduce
new clocks (bus, ref & lvds). Bus clock was separated from lcd clock.
New sources are possible for lcd clock (lvds / ref).

Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
---
Changes in v2: Rework clock property.
 .../bindings/display/st,stm32-ltdc.yaml       | 51 +++++++++++++++----
 1 file changed, 41 insertions(+), 10 deletions(-)

Comments

Rob Herring Aug. 9, 2024, 4:18 p.m. UTC | #1
On Fri, 09 Aug 2024 17:13:14 +0200, Yannick Fertre wrote:
> Add "st,stm32mp25-ltdc" compatible for SOC MP25. This new SOC introduce
> new clocks (bus, ref & lvds). Bus clock was separated from lcd clock.
> New sources are possible for lcd clock (lvds / ref).
> 
> Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
> ---
> Changes in v2: Rework clock property.
>  .../bindings/display/st,stm32-ltdc.yaml       | 51 +++++++++++++++----
>  1 file changed, 41 insertions(+), 10 deletions(-)
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml: allOf:0:else:properties:clocks: {'maxItems': 1, 'items': [{'description': 'Lcd Clock'}]} should not be valid under {'required': ['maxItems']}
	hint: "maxItems" is not needed with an "items" list
	from schema $id: http://devicetree.org/meta-schemas/items.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml: allOf:0:then:properties:clocks: {'maxItems': 4, 'items': [{'description': 'Lcd Clock'}, {'description': 'Bus Clock'}, {'description': 'Reference Clock'}, {'description': 'Lvds Clock'}]} should not be valid under {'required': ['maxItems']}
	hint: "maxItems" is not needed with an "items" list
	from schema $id: http://devicetree.org/meta-schemas/items.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/display/st,stm32-ltdc.example.dtb: display-controller@40016800: 'clock-names', 'clocks' do not match any of the regexes: 'pinctrl-[0-9]+'
	from schema $id: http://devicetree.org/schemas/display/st,stm32-ltdc.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20240809151314.221746-1-yannick.fertre@foss.st.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
Rob Herring Aug. 9, 2024, 5:58 p.m. UTC | #2
On Fri, Aug 09, 2024 at 05:13:14PM +0200, Yannick Fertre wrote:
> Add "st,stm32mp25-ltdc" compatible for SOC MP25. This new SOC introduce
> new clocks (bus, ref & lvds). Bus clock was separated from lcd clock.
> New sources are possible for lcd clock (lvds / ref).
> 
> Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
> ---
> Changes in v2: Rework clock property.
>  .../bindings/display/st,stm32-ltdc.yaml       | 51 +++++++++++++++----
>  1 file changed, 41 insertions(+), 10 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml b/Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml
> index d6ea4d62a2cf..cc578ad9f040 100644
> --- a/Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml
> +++ b/Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml
> @@ -12,7 +12,9 @@ maintainers:
>  
>  properties:
>    compatible:
> -    const: st,stm32-ltdc
> +    enum:
> +      - st,stm32-ltdc
> +      - st,stm32mp25-ltdc
>  
>    reg:
>      maxItems: 1
> @@ -23,13 +25,6 @@ properties:
>        - description: errors interrupt line.
>      minItems: 1
>  
> -  clocks:
> -    maxItems: 1
> -
> -  clock-names:
> -    items:
> -      - const: lcd

No, keep these at the top-level. Add to the list and add 'minItems: 1'. 
Then in the if/then schema, just use minItems/maxItems to limit the 
number of entries.

> -
>    resets:
>      maxItems: 1
>  
> @@ -46,11 +41,47 @@ required:
>    - compatible
>    - reg
>    - interrupts
> -  - clocks
> -  - clock-names
>    - resets
>    - port
>  
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - st,stm32mp25-ltdc
> +    then:
> +      properties:
> +        clocks:
> +          maxItems: 4
> +          items:
> +            - description: Lcd Clock
> +            - description: Bus Clock
> +            - description: Reference Clock
> +            - description: Lvds Clock
> +        clock-names:
> +          items:
> +            - const: lcd
> +            - const: bus
> +            - const: ref
> +            - const: lvds
> +      required:
> +        - clocks
> +        - clock-names
> +    else:
> +      properties:
> +        clocks:
> +          maxItems: 1
> +          items:
> +            - description: Lcd Clock
> +        clock-names:
> +          items:
> +            - const: lcd
> +      required:
> +        - clocks
> +        - clock-names
> +
>  additionalProperties: false
>  
>  examples:
> -- 
> 2.34.1
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml b/Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml
index d6ea4d62a2cf..cc578ad9f040 100644
--- a/Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml
+++ b/Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml
@@ -12,7 +12,9 @@  maintainers:
 
 properties:
   compatible:
-    const: st,stm32-ltdc
+    enum:
+      - st,stm32-ltdc
+      - st,stm32mp25-ltdc
 
   reg:
     maxItems: 1
@@ -23,13 +25,6 @@  properties:
       - description: errors interrupt line.
     minItems: 1
 
-  clocks:
-    maxItems: 1
-
-  clock-names:
-    items:
-      - const: lcd
-
   resets:
     maxItems: 1
 
@@ -46,11 +41,47 @@  required:
   - compatible
   - reg
   - interrupts
-  - clocks
-  - clock-names
   - resets
   - port
 
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - st,stm32mp25-ltdc
+    then:
+      properties:
+        clocks:
+          maxItems: 4
+          items:
+            - description: Lcd Clock
+            - description: Bus Clock
+            - description: Reference Clock
+            - description: Lvds Clock
+        clock-names:
+          items:
+            - const: lcd
+            - const: bus
+            - const: ref
+            - const: lvds
+      required:
+        - clocks
+        - clock-names
+    else:
+      properties:
+        clocks:
+          maxItems: 1
+          items:
+            - description: Lcd Clock
+        clock-names:
+          items:
+            - const: lcd
+      required:
+        - clocks
+        - clock-names
+
 additionalProperties: false
 
 examples: