Skip to contentSkip to conversation

media: dt-bindings: ovti,ov2680: Document clock/data-lanes

PATCH In review Fabio Estevam 3 participants 8 messages Mar 26, 2024 – Apr 3, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: dt-bindings: ovti,ov2680: Document clock/data-lanes

From: Fabio Estevam <[email protected]>

OV2680 has a single data lane MIPI interface.

Document the clock-lanes and data-lanes properties to avoid the following dt-schema warning:

imx7s-warp.dtb: camera@36: port:endpoint: Unevaluated properties are not allowed ('clock-lanes', 'data-lanes' were unexpected)
from schema $id: http://devicetree.org/schemas/media/i2c/ovti,ov2680.yaml#

---
 .../bindings/media/i2c/ovti,ov2680.yaml       | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/media/i2c/ovti,ov2680.yaml +17 -2
index cf456f8d9ddc..ae104da067e9 100644
@@ -50,9 +50,22 @@ properties:
       Definition of the regulator used as digital power supply.
 
   port:
-    $ref: /schemas/graph.yaml#/properties/port
     description:
       A node containing an output port node.
+    $ref: /schemas/graph.yaml#/$defs/port-base
+    additionalProperties: false
+
+    properties:
+      endpoint:
+        $ref: /schemas/media/video-interfaces.yaml#
+        unevaluatedProperties: false
+
+        properties:
+          clock-lanes:
+            const: 0
+
+          data-lanes:
+            const: 1
 
 required:
   - compatible
@@ -65,7 +78,7 @@ required:
   - reset-gpios
   - port
 
-additionalProperties: false
+unevaluatedProperties: false
 
 examples:
   - |
@@ -89,6 +102,8 @@ examples:
                 port {
                         ov2680_to_mipi: endpoint {
                                 remote-endpoint = <&mipi_from_sensor>;
+                                clock-lanes = <0>;
+                                data-lanes = <1>;
                         };
                 };
         };
Signature · 1 line
2.34.1
#1 lore raw
Quoted 15 lines · Fabio Estevam
Documentation/devicetree/bindings/media/i2c/ovti,ov2680.yaml +11 -0
+    properties:
+      endpoint:
+        $ref: /schemas/media/video-interfaces.yaml#
+        unevaluatedProperties: false
+
+        properties:
+          clock-lanes:
+            const: 0
+
+          data-lanes:
+            const: 1
 
 required:
   - compatible

Documentation/devicetree/bindings/media/i2c/ovti,ov2680.yaml required: · line 81

Quoted 5 lines
Documentation/devicetree/bindings/media/i2c/ovti,ov2680.yaml +1 -1
@@ -65,7 +78,7 @@ required:
   - reset-gpios
   - port
 
-additionalProperties: false
+unevaluatedProperties: false

This looks like unrelated change and it needs its own explanation.

Best regards,
Krzysztof

#2 lore raw
In reply to Fabio Estevam

Hi Fabio,

Quoted 30 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

OV2680 has a single data lane MIPI interface.

Document the clock-lanes and data-lanes properties to avoid the following dt-schema warning:

imx7s-warp.dtb: camera@36: port:endpoint: Unevaluated properties are not allowed ('clock-lanes', 'data-lanes' were unexpected)
from schema $id: http://devicetree.org/schemas/media/i2c/ovti,ov2680.yaml#

---
 .../bindings/media/i2c/ovti,ov2680.yaml       | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/media/i2c/ovti,ov2680.yaml +4 -1
index cf456f8d9ddc..ae104da067e9 100644
@@ -50,9 +50,22 @@ properties:
       Definition of the regulator used as digital power supply.
 
   port:
-    $ref: /schemas/graph.yaml#/properties/port
     description:
       A node containing an output port node.
+    $ref: /schemas/graph.yaml#/$defs/port-base
+    additionalProperties: false
+
+    properties:

Documentation/devicetree/bindings/media/i2c/ovti,ov2680.yaml properties: · line 68

Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/ovti,ov2680.yaml +10 -0
+      endpoint:
+        $ref: /schemas/media/video-interfaces.yaml#
+        unevaluatedProperties: false
+
+        properties:
+          clock-lanes:
+            const: 0
+
+          data-lanes:
+            const: 1

If there's a single possible configuration only, is this needed? There's no information here which the driver would need.

Quoted 21 lines
Documentation/devicetree/bindings/media/i2c/ovti,ov2680.yaml +3 -1
 required:
   - compatible
@@ -65,7 +78,7 @@ required:
   - reset-gpios
   - port
 
-additionalProperties: false
+unevaluatedProperties: false
 
 examples:
   - |
@@ -89,6 +102,8 @@ examples:
                 port {
                         ov2680_to_mipi: endpoint {
                                 remote-endpoint = <&mipi_from_sensor>;
+                                clock-lanes = <0>;
+                                data-lanes = <1>;
                         };
                 };
         };
Signature · 3 lines
Regards,

Sakari Ailus
#3 lore raw

Hi Sakari,

Quoted 2 lines · Sakari Ailus

If there's a single possible configuration only, is this needed? There's no information here which the driver would need.

Good point.

In this case, the correct fix would be to remove 'clock-lanes' and 'data-lanes' from imx7s-warp.dts.

#4 lore raw
Quoted 5 lines · Fabio Estevam

Hi Sakari,

On Wed, Mar 27, 2024 at 6:58 AM Sakari Ailus
<[email protected]> wrote:

Quoted 7 lines
Quoted 2 lines

If there's a single possible configuration only, is this needed? There's no information here which the driver would need.

Good point.

In this case, the correct fix would be to remove 'clock-lanes' and 'data-lanes' from imx7s-warp.dts.

Agreed.

Signature · 1 line
Sakari Ailus
#5 lore raw

Hi Sakari,

Quoted 4 lines · Sakari Ailus
Quoted 2 lines

In this case, the correct fix would be to remove 'clock-lanes' and 'data-lanes' from imx7s-warp.dts.

Agreed.

I tried removing 'clock-lanes' and 'data-lanes', but it did not work:

ov2680 1-0036: error -EINVAL: only a 1-lane CSI2 config is supported ov2680 1-0036: probe with driver ov2680 failed with error -22

I will send a v2 that documents 'clock-lanes', 'data-lanes', and 'link-frequencies'.

#6 lore raw

Hi Fabio,

Quoted 8 lines · Fabio Estevam

Hi Sakari,

Quoted 3 lines · Sakari Ailus
Quoted 2 lines

In this case, the correct fix would be to remove 'clock-lanes' and 'data-lanes' from imx7s-warp.dts.

Quoted 6 lines
Quoted 1 line

Agreed.

I tried removing 'clock-lanes' and 'data-lanes', but it did not work:

ov2680 1-0036: error -EINVAL: only a 1-lane CSI2 config is supported ov2680 1-0036: probe with driver ov2680 failed with error -22

If it's a problem with the driver, you should fix the driver instead of working around it in DT. Just remove the check.

Quoted 3 lines

I will send a v2 that documents 'clock-lanes', 'data-lanes', and 'link-frequencies'.

Signature · 3 lines
Regards,

Sakari Ailus
#7 lore raw

Hi Sakari,

Quoted 2 lines · Sakari Ailus

If it's a problem with the driver, you should fix the driver instead of working around it in DT. Just remove the check.

Makes sense. I will send a driver patch to remove the check.

I will wait for my ov2680 patches to be applied first and then I will submit an additional one.

Thanks