[v2,1/2] dt-bindings: display: imx: Describe drm binding for fsl,imx-lcdc

Message ID 20221214115921.1845994-2-u.kleine-koenig@pengutronix.de
State New
Headers
Series drm/imx/lcdc: Implement DRM driver for imx21 |

Commit Message

Uwe Kleine-König Dec. 14, 2022, 11:59 a.m. UTC
  Modify the existing (fb-like) binding to support the drm-like binding in
parallel.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 .../bindings/display/imx/fsl,imx-lcdc.yaml    | 45 ++++++++++++++++++-
 1 file changed, 44 insertions(+), 1 deletion(-)
  

Comments

Krzysztof Kozlowski Dec. 16, 2022, 10:41 a.m. UTC | #1
On 14/12/2022 12:59, Uwe Kleine-König wrote:
> Modify the existing (fb-like) binding to support the drm-like binding in
> parallel.

Aren't you now adding two compatibles to the same hardware, just for two
Linux drivers? One hardware should have one compatible, regardless of
Linux display implementation.

> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  .../bindings/display/imx/fsl,imx-lcdc.yaml    | 45 ++++++++++++++++++-
>  1 file changed, 44 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/display/imx/fsl,imx-lcdc.yaml b/Documentation/devicetree/bindings/display/imx/fsl,imx-lcdc.yaml
> index 35a8fff036ca..2a8225b10890 100644
> --- a/Documentation/devicetree/bindings/display/imx/fsl,imx-lcdc.yaml
> +++ b/Documentation/devicetree/bindings/display/imx/fsl,imx-lcdc.yaml
> @@ -21,6 +21,9 @@ properties:
>                - fsl,imx25-fb
>                - fsl,imx27-fb
>            - const: fsl,imx21-fb
> +      - items:
> +          - const: fsl,imx25-lcdc
> +          - const: fsl,imx21-lcdc
>  
>    clocks:
>      maxItems: 3
> @@ -31,6 +34,9 @@ properties:
>        - const: ahb
>        - const: per
>  
> +  port:
> +    $ref: /schemas/graph.yaml#/properties/port
> +
>    display:
>      $ref: /schemas/types.yaml#/definitions/phandle
>  
> @@ -59,17 +65,54 @@ properties:
>      description:
>        LCDC Sharp Configuration Register value.
>  
> +if:

Put it under allOf. It grows pretty often so this would avoid future
re-indents.

> +  properties:
> +    compatible:
> +      contains:
> +        enum:
> +          - fsl,imx1-lcdc
> +          - fsl,imx21-lcdc
> +then:
> +  properties:
> +    display: false
> +    fsl,dmacr: false
> +    fsl,lpccr: false
> +    fsl,lscr1: false
> +
> +  required:
> +    - port
> +
> +else:
> +  properties:
> +    port: false
> +
> +  required:
> +    - display
> +
>  required:
>    - compatible
>    - clocks
>    - clock-names
> -  - display
>    - interrupts
>    - reg
>  
>  additionalProperties: false
>  
>  examples:
> +  - |
> +    lcdc@53fbc000 {
> +        compatible = "fsl,imx25-lcdc", "fsl,imx21-lcdc";
> +        reg = <0x53fbc000 0x4000>;
> +        interrupts = <39>;
> +        clocks = <&clks 103>, <&clks 66>, <&clks 49>;
> +        clock-names = "ipg", "ahb", "per";
> +
> +        port {
> +            parallel_out: endpoint {
> +              remote-endpoint = <&panel_in>;
> +            };
> +        };
> +    };
>    - |
>      imxfb: fb@10021000 {
>          compatible = "fsl,imx21-fb";

Best regards,
Krzysztof
  
Uwe Kleine-König Dec. 16, 2022, 11:38 a.m. UTC | #2
On Fri, Dec 16, 2022 at 11:41:30AM +0100, Krzysztof Kozlowski wrote:
> On 14/12/2022 12:59, Uwe Kleine-König wrote:
> > Modify the existing (fb-like) binding to support the drm-like binding in
> > parallel.
> 
> Aren't you now adding two compatibles to the same hardware, just for two
> Linux drivers? One hardware should have one compatible, regardless of
> Linux display implementation.

The (up to now unopposed) idea was to use the opportunity to pick a
better name for the compatible. The hardware component is called LCDC
and I guess fsl,imx21-fb was only picked because the linux driver is
called imxfb. Unless I understood Rob wrong, he insisted to describe
both variants in a single binding document only.

> > +if:
> 
> Put it under allOf. It grows pretty often so this would avoid future
> re-indents.

ok.

Best regards
Uwe
  
Krzysztof Kozlowski Dec. 16, 2022, 11:41 a.m. UTC | #3
On 16/12/2022 12:38, Uwe Kleine-König wrote:
> On Fri, Dec 16, 2022 at 11:41:30AM +0100, Krzysztof Kozlowski wrote:
>> On 14/12/2022 12:59, Uwe Kleine-König wrote:
>>> Modify the existing (fb-like) binding to support the drm-like binding in
>>> parallel.
>>
>> Aren't you now adding two compatibles to the same hardware, just for two
>> Linux drivers? One hardware should have one compatible, regardless of
>> Linux display implementation.
> 
> The (up to now unopposed) idea was to use the opportunity to pick a
> better name for the compatible. The hardware component is called LCDC
> and I guess fsl,imx21-fb was only picked because the linux driver is
> called imxfb. Unless I understood Rob wrong, he insisted to describe
> both variants in a single binding document only.

OK, I'll leave it then to Rob.

Best regards,
Krzysztof
  

Patch

diff --git a/Documentation/devicetree/bindings/display/imx/fsl,imx-lcdc.yaml b/Documentation/devicetree/bindings/display/imx/fsl,imx-lcdc.yaml
index 35a8fff036ca..2a8225b10890 100644
--- a/Documentation/devicetree/bindings/display/imx/fsl,imx-lcdc.yaml
+++ b/Documentation/devicetree/bindings/display/imx/fsl,imx-lcdc.yaml
@@ -21,6 +21,9 @@  properties:
               - fsl,imx25-fb
               - fsl,imx27-fb
           - const: fsl,imx21-fb
+      - items:
+          - const: fsl,imx25-lcdc
+          - const: fsl,imx21-lcdc
 
   clocks:
     maxItems: 3
@@ -31,6 +34,9 @@  properties:
       - const: ahb
       - const: per
 
+  port:
+    $ref: /schemas/graph.yaml#/properties/port
+
   display:
     $ref: /schemas/types.yaml#/definitions/phandle
 
@@ -59,17 +65,54 @@  properties:
     description:
       LCDC Sharp Configuration Register value.
 
+if:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - fsl,imx1-lcdc
+          - fsl,imx21-lcdc
+then:
+  properties:
+    display: false
+    fsl,dmacr: false
+    fsl,lpccr: false
+    fsl,lscr1: false
+
+  required:
+    - port
+
+else:
+  properties:
+    port: false
+
+  required:
+    - display
+
 required:
   - compatible
   - clocks
   - clock-names
-  - display
   - interrupts
   - reg
 
 additionalProperties: false
 
 examples:
+  - |
+    lcdc@53fbc000 {
+        compatible = "fsl,imx25-lcdc", "fsl,imx21-lcdc";
+        reg = <0x53fbc000 0x4000>;
+        interrupts = <39>;
+        clocks = <&clks 103>, <&clks 66>, <&clks 49>;
+        clock-names = "ipg", "ahb", "per";
+
+        port {
+            parallel_out: endpoint {
+              remote-endpoint = <&panel_in>;
+            };
+        };
+    };
   - |
     imxfb: fb@10021000 {
         compatible = "fsl,imx21-fb";