[v2,2/3] dt-bindings: display: simple: support non-default data-mapping

Message ID 20230523-simplepanel_support_nondefault_datamapping-v2-2-87196f0d0b64@pengutronix.de
State New
Headers
Series Support non-default LVDS data mapping for simple panel |

Commit Message

Johannes Zink May 23, 2023, 8:19 a.m. UTC
  Some Displays support more than just a single default lvds data mapping,
which can be used to run displays on only 3 LVDS lanes in the jeida-18
data-mapping mode.

Add an optional data-mapping property to allow overriding the default
data mapping. As it does not generally apply to any display and bus: use
it selectively on the innolux,g101ice-l01, which supports changing the
data mapping via a strapping pin.

Signed-off-by: Johannes Zink <j.zink@pengutronix.de>

---

Changes:

v1 -> v2: - worked in Rob's review findings (thanks for reviewing my
            work): use extracted common property instead of duplicating
	    the property
	  - refined commit message
	  - add an example dts for automated checking
---
 .../bindings/display/panel/panel-simple.yaml       | 26 +++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)
  

Comments

Conor Dooley May 23, 2023, 5:21 p.m. UTC | #1
On Tue, May 23, 2023 at 10:19:42AM +0200, Johannes Zink wrote:
> Some Displays support more than just a single default lvds data mapping,
> which can be used to run displays on only 3 LVDS lanes in the jeida-18
> data-mapping mode.
> 
> Add an optional data-mapping property to allow overriding the default
> data mapping. As it does not generally apply to any display and bus: use
> it selectively on the innolux,g101ice-l01, which supports changing the
> data mapping via a strapping pin.
> 
> Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
> 
> ---
> 
> Changes:
> 
> v1 -> v2: - worked in Rob's review findings (thanks for reviewing my
>             work): use extracted common property instead of duplicating
> 	    the property

That looks to be true (and Rob's AFK at the moment, hence unable to reply
to your ping) so,
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.

> 	  - refined commit message
> 	  - add an example dts for automated checking
> ---
>  .../bindings/display/panel/panel-simple.yaml       | 26 +++++++++++++++++++++-
>  1 file changed, 25 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
> index ec50dd268314..698301c8c920 100644
> --- a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
> +++ b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
> @@ -21,9 +21,9 @@ description: |
>  
>  allOf:
>    - $ref: panel-common.yaml#
> +  - $ref: ../lvds-data-mapping.yaml#
>  
>  properties:
> -
>    compatible:
>      enum:
>      # compatible must be listed in alphabetical order, ordered by compatible.
> @@ -353,6 +353,17 @@ properties:
>    power-supply: true
>    no-hpd: true
>    hpd-gpios: true
> +  data-mapping: true
> +
> +if:
> +  not:
> +    properties:
> +      compatible:
> +        contains:
> +          const: innolux,g101ice-l01
> +then:
> +  properties:
> +    data-mapping: false
>  
>  additionalProperties: false
>  
> @@ -372,3 +383,16 @@ examples:
>          };
>        };
>      };
> +  - |
> +    panel_lvds: panel-lvds {
> +      compatible = "innolux,g101ice-l01";
> +      power-supply = <&vcc_lcd_reg>;
> +
> +      data-mapping = "jeida-24";
> +
> +      port {
> +        panel_in_lvds: endpoint {
> +          remote-endpoint = <&ltdc_out_lvds>;
> +        };
> +      };
> +    };
> 
> -- 
> 2.39.2
>
  
Laurent Pinchart June 2, 2023, 3:35 p.m. UTC | #2
Hi Johannes,

Thank you for the patch.

On Tue, May 23, 2023 at 10:19:42AM +0200, Johannes Zink wrote:
> Some Displays support more than just a single default lvds data mapping,

s/lvds/LVDS/

> which can be used to run displays on only 3 LVDS lanes in the jeida-18
> data-mapping mode.
> 
> Add an optional data-mapping property to allow overriding the default
> data mapping. As it does not generally apply to any display and bus: use

s/bus:/bus,/

> it selectively on the innolux,g101ice-l01, which supports changing the
> data mapping via a strapping pin.
> 
> Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
> ---
> 
> Changes:
> 
> v1 -> v2: - worked in Rob's review findings (thanks for reviewing my
>             work): use extracted common property instead of duplicating
> 	    the property
> 	  - refined commit message
> 	  - add an example dts for automated checking
> ---
>  .../bindings/display/panel/panel-simple.yaml       | 26 +++++++++++++++++++++-
>  1 file changed, 25 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
> index ec50dd268314..698301c8c920 100644
> --- a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
> +++ b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
> @@ -21,9 +21,9 @@ description: |
>  
>  allOf:
>    - $ref: panel-common.yaml#
> +  - $ref: ../lvds-data-mapping.yaml#
>  
>  properties:
> -
>    compatible:
>      enum:
>      # compatible must be listed in alphabetical order, ordered by compatible.
> @@ -353,6 +353,17 @@ properties:
>    power-supply: true
>    no-hpd: true
>    hpd-gpios: true
> +  data-mapping: true

As the property is optional, don't you need a default value ?

> +
> +if:
> +  not:
> +    properties:
> +      compatible:
> +        contains:
> +          const: innolux,g101ice-l01
> +then:
> +  properties:
> +    data-mapping: false
>  
>  additionalProperties: false
>  
> @@ -372,3 +383,16 @@ examples:
>          };
>        };
>      };
> +  - |
> +    panel_lvds: panel-lvds {
> +      compatible = "innolux,g101ice-l01";
> +      power-supply = <&vcc_lcd_reg>;
> +
> +      data-mapping = "jeida-24";
> +
> +      port {
> +        panel_in_lvds: endpoint {
> +          remote-endpoint = <&ltdc_out_lvds>;
> +        };
> +      };
> +    };
>
  
Johannes Zink July 28, 2023, 8:36 a.m. UTC | #3
Hi Laurent,

thank you for your review.

On 6/2/23 17:35, Laurent Pinchart wrote:
> Hi Johannes,
> 
> Thank you for the patch.
> 
> On Tue, May 23, 2023 at 10:19:42AM +0200, Johannes Zink wrote:
>> Some Displays support more than just a single default lvds data mapping,
> 
> s/lvds/LVDS/

ack, gonna fix in V3

> 
>> which can be used to run displays on only 3 LVDS lanes in the jeida-18
>> data-mapping mode.
>>
>> Add an optional data-mapping property to allow overriding the default
>> data mapping. As it does not generally apply to any display and bus: use
> 
> s/bus:/bus,/

ack, gonna fix in V3

> 
>> it selectively on the innolux,g101ice-l01, which supports changing the
>> data mapping via a strapping pin.
>>
>> Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
>> ---
>>
>> Changes:
>>
>> v1 -> v2: - worked in Rob's review findings (thanks for reviewing my
>>              work): use extracted common property instead of duplicating
>> 	    the property
>> 	  - refined commit message
>> 	  - add an example dts for automated checking
>> ---
>>   .../bindings/display/panel/panel-simple.yaml       | 26 +++++++++++++++++++++-
>>   1 file changed, 25 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
>> index ec50dd268314..698301c8c920 100644
>> --- a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
>> +++ b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
>> @@ -21,9 +21,9 @@ description: |
>>   
>>   allOf:
>>     - $ref: panel-common.yaml#
>> +  - $ref: ../lvds-data-mapping.yaml#
>>   
>>   properties:
>> -
>>     compatible:
>>       enum:
>>       # compatible must be listed in alphabetical order, ordered by compatible.
>> @@ -353,6 +353,17 @@ properties:
>>     power-supply: true
>>     no-hpd: true
>>     hpd-gpios: true
>> +  data-mapping: true
> 
> As the property is optional, don't you need a default value ?

as the simple-bus implicitely assumes default data mappings for LVDS panels, I 
think this is not necessary. If the property is not used in a DT, the default 
data mapping is used.

Best regards
Johannes

> 
>> +
>> +if:
>> +  not:
>> +    properties:
>> +      compatible:
>> +        contains:
>> +          const: innolux,g101ice-l01
>> +then:
>> +  properties:
>> +    data-mapping: false
>>   
>>   additionalProperties: false
>>   
>> @@ -372,3 +383,16 @@ examples:
>>           };
>>         };
>>       };
>> +  - |
>> +    panel_lvds: panel-lvds {
>> +      compatible = "innolux,g101ice-l01";
>> +      power-supply = <&vcc_lcd_reg>;
>> +
>> +      data-mapping = "jeida-24";
>> +
>> +      port {
>> +        panel_in_lvds: endpoint {
>> +          remote-endpoint = <&ltdc_out_lvds>;
>> +        };
>> +      };
>> +    };
>>
>
  

Patch

diff --git a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
index ec50dd268314..698301c8c920 100644
--- a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
+++ b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
@@ -21,9 +21,9 @@  description: |
 
 allOf:
   - $ref: panel-common.yaml#
+  - $ref: ../lvds-data-mapping.yaml#
 
 properties:
-
   compatible:
     enum:
     # compatible must be listed in alphabetical order, ordered by compatible.
@@ -353,6 +353,17 @@  properties:
   power-supply: true
   no-hpd: true
   hpd-gpios: true
+  data-mapping: true
+
+if:
+  not:
+    properties:
+      compatible:
+        contains:
+          const: innolux,g101ice-l01
+then:
+  properties:
+    data-mapping: false
 
 additionalProperties: false
 
@@ -372,3 +383,16 @@  examples:
         };
       };
     };
+  - |
+    panel_lvds: panel-lvds {
+      compatible = "innolux,g101ice-l01";
+      power-supply = <&vcc_lcd_reg>;
+
+      data-mapping = "jeida-24";
+
+      port {
+        panel_in_lvds: endpoint {
+          remote-endpoint = <&ltdc_out_lvds>;
+        };
+      };
+    };