diff mbox series

[v2,2/2] dt-bindings: drm/bridge: ti-sn65dsi86: Improve the yaml validation

Message ID 20200506140208.v2.2.I0a2bca02b09c1fcb6b09479b489736d600b3e57f@changeid (mailing list archive)
State New, archived
Headers show
Series [v2,1/2] drm/bridge: ti-sn65dsi86: Implement lane reordering + polarity | expand

Commit Message

Doug Anderson May 6, 2020, 9:02 p.m. UTC
This patch adds the following checks to the yaml:
- Remapping of the eDP output lanes is now limited to the subset of
  remappings that the hardware supports.
- No more additional properties can be added under 'ports'.

This patch fixes the following bugs in the original yaml conversion:
- Fixed dependency between 'data-lanes' and 'lane-polarities', which
  was backwards.  Now you can only specify 'lane-polarities' if you
  specified 'data-lanes'.  I could have sworn I tried this before.
- We can't remap input lanes in this hardware.

This patch doesn't do, but if someone knew how I'd love to:
- Make sure if we have both 'lane-polarities' and 'data-lanes' that
  they have the same number of elements.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
This patch could be squashed atop the patch adding the yaml [1].  I'm
sending separately for now to avoid churning the series another time.

[1] https://lore.kernel.org/r/20200430124442.v4.4.Ifcdc4ecb12742a27862744ee1e8753cb95a38a7f@changeid

Changes in v2:
- ("... Improve the yaml validation") new for v2.

 .../bindings/display/bridge/ti,sn65dsi86.yaml | 74 ++++++++++---------
 1 file changed, 40 insertions(+), 34 deletions(-)

Comments

Doug Anderson May 7, 2020, 9:39 p.m. UTC | #1
Hi,

On Wed, May 6, 2020 at 2:03 PM Douglas Anderson <dianders@chromium.org> wrote:
>
> This patch adds the following checks to the yaml:
> - Remapping of the eDP output lanes is now limited to the subset of
>   remappings that the hardware supports.
> - No more additional properties can be added under 'ports'.
>
> This patch fixes the following bugs in the original yaml conversion:
> - Fixed dependency between 'data-lanes' and 'lane-polarities', which
>   was backwards.  Now you can only specify 'lane-polarities' if you
>   specified 'data-lanes'.  I could have sworn I tried this before.
> - We can't remap input lanes in this hardware.
>
> This patch doesn't do, but if someone knew how I'd love to:
> - Make sure if we have both 'lane-polarities' and 'data-lanes' that
>   they have the same number of elements.
>
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
> This patch could be squashed atop the patch adding the yaml [1].  I'm
> sending separately for now to avoid churning the series another time.
>
> [1] https://lore.kernel.org/r/20200430124442.v4.4.Ifcdc4ecb12742a27862744ee1e8753cb95a38a7f@changeid
>
> Changes in v2:
> - ("... Improve the yaml validation") new for v2.
>
>  .../bindings/display/bridge/ti,sn65dsi86.yaml | 74 ++++++++++---------
>  1 file changed, 40 insertions(+), 34 deletions(-)

Please consider this patch abandoned.  Since I had other reasons to
send out a v5 of the original series this is now squashed in.  See:

https://lore.kernel.org/r/20200507143354.v5.4.Ifcdc4ecb12742a27862744ee1e8753cb95a38a7f@changeid

NOTE that patch #1 in this series, AKA ("drm/bridge: ti-sn65dsi86:
Implement lane reordering + polarity") is still sane/valid and still
applies just fine atop my v5 series.

-Doug
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.yaml b/Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.yaml
index 75c4e8b8e4b7..be10e8cf31e1 100644
--- a/Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.yaml
+++ b/Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.yaml
@@ -72,6 +72,7 @@  properties:
 
   ports:
     type: object
+    additionalProperties: false
 
     properties:
       "#address-cells":
@@ -94,33 +95,9 @@  properties:
           endpoint:
             type: object
             additionalProperties: false
-
             properties:
               remote-endpoint: true
 
-              data-lanes:
-                minItems: 1
-                maxItems: 4
-                items:
-                  enum:
-                    - 0
-                    - 1
-                    - 2
-                    - 3
-                description: See ../../media/video-interface.txt
-
-              lane-polarities:
-                minItems: 1
-                maxItems: 4
-                items:
-                  enum:
-                    - 0
-                    - 1
-                description: See ../../media/video-interface.txt
-
-            dependencies:
-              data-lanes: [lane-polarities]
-
         required:
           - reg
 
@@ -143,15 +120,44 @@  properties:
               remote-endpoint: true
 
               data-lanes:
-                minItems: 1
-                maxItems: 4
-                items:
-                  enum:
-                    - 0
-                    - 1
-                    - 2
-                    - 3
-                description: See ../../media/video-interface.txt
+                oneOf:
+                  - minItems: 1
+                    maxItems: 1
+                    uniqueItems: true
+                    items:
+                      enum:
+                        - 0
+                        - 1
+                    description:
+                      If you have 1 logical lane the bridge supports routing
+                      to either port 0 or port 1.  Port 0 is suggested.
+                      See ../../media/video-interface.txt for details.
+
+                  - minItems: 2
+                    maxItems: 2
+                    uniqueItems: true
+                    items:
+                      enum:
+                        - 0
+                        - 1
+                    description:
+                      If you have 2 logical lanes the bridge supports
+                      reordering but only on physical ports 0 and 1.
+                      See ../../media/video-interface.txt for details.
+
+                  - minItems: 4
+                    maxItems: 4
+                    uniqueItems: true
+                    items:
+                      enum:
+                        - 0
+                        - 1
+                        - 2
+                        - 3
+                    description:
+                      If you have 4 logical lanes the bridge supports
+                      reordering in any way.
+                      See ../../media/video-interface.txt for details.
 
               lane-polarities:
                 minItems: 1
@@ -163,7 +169,7 @@  properties:
                 description: See ../../media/video-interface.txt
 
             dependencies:
-              data-lanes: [lane-polarities]
+              lane-polarities: [data-lanes]
 
         required:
           - reg