[PATCH v3 1/2] dt-bindings: media: i2c: Add ov2735 sensor

Hardevsinh Palaniya posted 2 patches 2 months, 4 weeks ago
There is a newer version of this series
[PATCH v3 1/2] dt-bindings: media: i2c: Add ov2735 sensor
Posted by Hardevsinh Palaniya 2 months, 4 weeks ago
From: Himanshu Bhavani <himanshu.bhavani@siliconsignals.io>

Add bindings for Omnivision OV2735 sensor.

Signed-off-by: Himanshu Bhavani <himanshu.bhavani@siliconsignals.io>
Signed-off-by: Hardevsinh Palaniya <hardevsinh.palaniya@siliconsignals.io>
---
 .../bindings/media/i2c/ovti,ov2735.yaml       | 115 ++++++++++++++++++
 1 file changed, 115 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ovti,ov2735.yaml

diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ov2735.yaml b/Documentation/devicetree/bindings/media/i2c/ovti,ov2735.yaml
new file mode 100644
index 000000000000..d9d01db88844
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov2735.yaml
@@ -0,0 +1,115 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/i2c/ovti,ov2735.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: OmniVision OV2735 Image Sensor
+
+maintainers:
+  - Himanshu Bhavani <himanshu.bhavani@siliconsignals.io>
+
+description: |
+  The OmniVision OV2735 is a 2MP (1920x1080) color CMOS image sensor controlled
+  through an I2C-compatible SCCB bus. it outputs RAW10 format and uses a 1/2.7"
+  optical format.
+
+properties:
+  compatible:
+    const: ovti,ov2735
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: XVCLK clock
+
+  clock-names:
+    items:
+      - const: xvclk
+
+  avdd-supply:
+    description: Analog Domain Power Supply
+
+  dovdd-supply:
+    description: I/O Domain Power Supply
+
+  dvdd-supply:
+    description: Digital Domain Power Supply
+
+  reset-gpios:
+    maxItems: 1
+    description: Reset Pin GPIO Control (active low)
+
+  enable-gpios:
+    maxItems: 1
+    description: |
+      Active-low enable pin. Labeled as 'PWDN' in the datasheet, but acts as
+      an enable signal. During power rail ramp-up, the device remains powered
+      down. Once power rails are stable, pulling this pin low powers on the
+      device.
+
+  port:
+    description: MIPI CSI-2 transmitter port
+    $ref: /schemas/graph.yaml#/$defs/port-base
+    additionalProperties: false
+
+    properties:
+      endpoint:
+        $ref: /schemas/media/video-interfaces.yaml#
+        unevaluatedProperties: false
+
+        properties:
+          data-lanes:
+            items:
+              - const: 1
+              - const: 2
+
+        required:
+          - data-lanes
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - avdd-supply
+  - dovdd-supply
+  - dvdd-supply
+  - port
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/rk3399-cru.h>
+    #include <dt-bindings/gpio/gpio.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        camera-sensor@3c {
+            compatible = "ovti,ov2735";
+            reg = <0x3c>;
+            clocks = <&ov2735_clk>;
+
+            assigned-clocks = <&ov2735_clk>;
+            assigned-clock-parents = <&ov2735_clk_parent>;
+            assigned-clock-rates = <24000000>;
+
+            avdd-supply = <&ov2735_avdd>;
+            dovdd-supply = <&ov2735_dovdd>;
+            dvdd-supply = <&ov2735_dvdd>;
+
+            reset-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
+            enable-gpios = <&gpio2 11 GPIO_ACTIVE_LOW>;
+
+            port {
+                cam_out: endpoint {
+                    remote-endpoint = <&mipi_in_cam>;
+                    data-lanes = <1 2>;
+                };
+            };
+        };
+    };
-- 
2.34.1
Re: [PATCH v3 1/2] dt-bindings: media: i2c: Add ov2735 sensor
Posted by Rob Herring 2 months, 4 weeks ago
On Thu, Jul 10, 2025 at 06:40:58PM +0530, Hardevsinh Palaniya wrote:
> From: Himanshu Bhavani <himanshu.bhavani@siliconsignals.io>
> 
> Add bindings for Omnivision OV2735 sensor.
> 
> Signed-off-by: Himanshu Bhavani <himanshu.bhavani@siliconsignals.io>
> Signed-off-by: Hardevsinh Palaniya <hardevsinh.palaniya@siliconsignals.io>
> ---
>  .../bindings/media/i2c/ovti,ov2735.yaml       | 115 ++++++++++++++++++
>  1 file changed, 115 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/media/i2c/ovti,ov2735.yaml
> 
> diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ov2735.yaml b/Documentation/devicetree/bindings/media/i2c/ovti,ov2735.yaml
> new file mode 100644
> index 000000000000..d9d01db88844
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov2735.yaml
> @@ -0,0 +1,115 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/media/i2c/ovti,ov2735.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: OmniVision OV2735 Image Sensor
> +
> +maintainers:
> +  - Himanshu Bhavani <himanshu.bhavani@siliconsignals.io>
> +
> +description: |

Don't need '|' if no formatting to preserve.

> +  The OmniVision OV2735 is a 2MP (1920x1080) color CMOS image sensor controlled
> +  through an I2C-compatible SCCB bus. it outputs RAW10 format and uses a 1/2.7"
> +  optical format.
> +
> +properties:
> +  compatible:
> +    const: ovti,ov2735
> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    items:
> +      - description: XVCLK clock
> +
> +  clock-names:
> +    items:
> +      - const: xvclk
> +
> +  avdd-supply:
> +    description: Analog Domain Power Supply
> +
> +  dovdd-supply:
> +    description: I/O Domain Power Supply
> +
> +  dvdd-supply:
> +    description: Digital Domain Power Supply
> +
> +  reset-gpios:
> +    maxItems: 1
> +    description: Reset Pin GPIO Control (active low)
> +
> +  enable-gpios:
> +    maxItems: 1
> +    description: |

Same here.

> +      Active-low enable pin. Labeled as 'PWDN' in the datasheet, but acts as
> +      an enable signal. During power rail ramp-up, the device remains powered
> +      down. Once power rails are stable, pulling this pin low powers on the
> +      device.
> +
> +  port:
> +    description: MIPI CSI-2 transmitter port
> +    $ref: /schemas/graph.yaml#/$defs/port-base
> +    additionalProperties: false
> +
> +    properties:
> +      endpoint:
> +        $ref: /schemas/media/video-interfaces.yaml#
> +        unevaluatedProperties: false
> +
> +        properties:
> +          data-lanes:
> +            items:
> +              - const: 1
> +              - const: 2
> +
> +        required:
> +          - data-lanes
> +
> +required:
> +  - compatible
> +  - reg
> +  - clocks
> +  - avdd-supply
> +  - dovdd-supply
> +  - dvdd-supply
> +  - port
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/rk3399-cru.h>
> +    #include <dt-bindings/gpio/gpio.h>
> +
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        camera-sensor@3c {
> +            compatible = "ovti,ov2735";
> +            reg = <0x3c>;
> +            clocks = <&ov2735_clk>;
> +
> +            assigned-clocks = <&ov2735_clk>;
> +            assigned-clock-parents = <&ov2735_clk_parent>;
> +            assigned-clock-rates = <24000000>;
> +
> +            avdd-supply = <&ov2735_avdd>;
> +            dovdd-supply = <&ov2735_dovdd>;
> +            dvdd-supply = <&ov2735_dvdd>;
> +
> +            reset-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
> +            enable-gpios = <&gpio2 11 GPIO_ACTIVE_LOW>;
> +
> +            port {
> +                cam_out: endpoint {
> +                    remote-endpoint = <&mipi_in_cam>;
> +                    data-lanes = <1 2>;
> +                };
> +            };
> +        };
> +    };
> -- 
> 2.34.1
>
Re: [PATCH v3 1/2] dt-bindings: media: i2c: Add ov2735 sensor
Posted by Laurent Pinchart 2 months, 4 weeks ago
On Thu, Jul 10, 2025 at 01:33:56PM -0500, Rob Herring wrote:
> On Thu, Jul 10, 2025 at 06:40:58PM +0530, Hardevsinh Palaniya wrote:
> > From: Himanshu Bhavani <himanshu.bhavani@siliconsignals.io>
> > 
> > Add bindings for Omnivision OV2735 sensor.
> > 
> > Signed-off-by: Himanshu Bhavani <himanshu.bhavani@siliconsignals.io>
> > Signed-off-by: Hardevsinh Palaniya <hardevsinh.palaniya@siliconsignals.io>
> > ---
> >  .../bindings/media/i2c/ovti,ov2735.yaml       | 115 ++++++++++++++++++
> >  1 file changed, 115 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/media/i2c/ovti,ov2735.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ov2735.yaml b/Documentation/devicetree/bindings/media/i2c/ovti,ov2735.yaml
> > new file mode 100644
> > index 000000000000..d9d01db88844
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov2735.yaml
> > @@ -0,0 +1,115 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/media/i2c/ovti,ov2735.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: OmniVision OV2735 Image Sensor
> > +
> > +maintainers:
> > +  - Himanshu Bhavani <himanshu.bhavani@siliconsignals.io>
> > +
> > +description: |
> 
> Don't need '|' if no formatting to preserve.
> 
> > +  The OmniVision OV2735 is a 2MP (1920x1080) color CMOS image sensor controlled
> > +  through an I2C-compatible SCCB bus. it outputs RAW10 format and uses a 1/2.7"
> > +  optical format.
> > +
> > +properties:
> > +  compatible:
> > +    const: ovti,ov2735
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  clocks:
> > +    items:
> > +      - description: XVCLK clock
> > +
> > +  clock-names:
> > +    items:
> > +      - const: xvclk
> > +
> > +  avdd-supply:
> > +    description: Analog Domain Power Supply
> > +
> > +  dovdd-supply:
> > +    description: I/O Domain Power Supply
> > +
> > +  dvdd-supply:
> > +    description: Digital Domain Power Supply
> > +
> > +  reset-gpios:
> > +    maxItems: 1
> > +    description: Reset Pin GPIO Control (active low)
> > +
> > +  enable-gpios:
> > +    maxItems: 1
> > +    description: |
> 
> Same here.
> 
> > +      Active-low enable pin. Labeled as 'PWDN' in the datasheet, but acts as
> > +      an enable signal. During power rail ramp-up, the device remains powered
> > +      down. Once power rails are stable, pulling this pin low powers on the
> > +      device.
> > +
> > +  port:
> > +    description: MIPI CSI-2 transmitter port
> > +    $ref: /schemas/graph.yaml#/$defs/port-base
> > +    additionalProperties: false
> > +
> > +    properties:
> > +      endpoint:
> > +        $ref: /schemas/media/video-interfaces.yaml#
> > +        unevaluatedProperties: false
> > +
> > +        properties:
> > +          data-lanes:
> > +            items:
> > +              - const: 1
> > +              - const: 2
> > +
> > +        required:
> > +          - data-lanes
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - clocks
> > +  - avdd-supply
> > +  - dovdd-supply
> > +  - dvdd-supply
> > +  - port
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/clock/rk3399-cru.h>

Unused.

> > +    #include <dt-bindings/gpio/gpio.h>
> > +
> > +    i2c {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        camera-sensor@3c {
> > +            compatible = "ovti,ov2735";
> > +            reg = <0x3c>;
> > +            clocks = <&ov2735_clk>;
> > +
> > +            assigned-clocks = <&ov2735_clk>;
> > +            assigned-clock-parents = <&ov2735_clk_parent>;
> > +            assigned-clock-rates = <24000000>;

I think you can drop those three properties from the example, they don't
add much value. Or you could switch to a clock generated by the SoC
(an RK3399 based on the #include above), in which case assigning the
rate makes sense.

> > +
> > +            avdd-supply = <&ov2735_avdd>;
> > +            dovdd-supply = <&ov2735_dovdd>;
> > +            dvdd-supply = <&ov2735_dvdd>;
> > +
> > +            reset-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
> > +            enable-gpios = <&gpio2 11 GPIO_ACTIVE_LOW>;
> > +
> > +            port {
> > +                cam_out: endpoint {
> > +                    remote-endpoint = <&mipi_in_cam>;
> > +                    data-lanes = <1 2>;
> > +                };
> > +            };
> > +        };
> > +    };

-- 
Regards,

Laurent Pinchart
Re: [PATCH v3 1/2] dt-bindings: media: i2c: Add ov2735 sensor
Posted by Krzysztof Kozlowski 2 months, 4 weeks ago
On 10/07/2025 15:10, Hardevsinh Palaniya wrote:
> +
> +required:
> +  - compatible
> +  - reg
> +  - clocks
> +  - avdd-supply
> +  - dovdd-supply
> +  - dvdd-supply
> +  - port

Now  I looked at your driver and the code clearly says that GPIOs are
not optional.

You really need to sync the binding in the driver. They cannot define
completely different ABI.

Best regards,
Krzysztof
Re: [PATCH v3 1/2] dt-bindings: media: i2c: Add ov2735 sensor
Posted by Laurent Pinchart 2 months, 4 weeks ago
On Thu, Jul 10, 2025 at 03:35:51PM +0200, Krzysztof Kozlowski wrote:
> On 10/07/2025 15:10, Hardevsinh Palaniya wrote:
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - clocks
> > +  - avdd-supply
> > +  - dovdd-supply
> > +  - dvdd-supply
> > +  - port
> 
> Now  I looked at your driver and the code clearly says that GPIOs are
> not optional.
> 
> You really need to sync the binding in the driver. They cannot define
> completely different ABI.

I couldn't have said it in a clearer way.

For the GPIOs, I recommend making them optional in the driver, as GPIOs
are not always connected in all designs (unless of course we're dealing
with a GPIO whose control from the SoC is absolutely mandatory to make
the device work at all, but that doesn't seem to be the case here).

-- 
Regards,

Laurent Pinchart
Re: [PATCH v3 1/2] dt-bindings: media: i2c: Add ov2735 sensor
Posted by Krzysztof Kozlowski 2 months, 4 weeks ago
On 10/07/2025 15:10, Hardevsinh Palaniya wrote:
> +
> +  clocks:
> +    items:
> +      - description: XVCLK clock
> +
> +  clock-names:
> +    items:
> +      - const: xvclk

You don't use clock names here and example, so just drop the property.

With this fixed:


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


---

<form letter>
This is an automated instruction, just in case, because many review tags
are being ignored. If you know the process, you can skip it (please do
not feel offended by me posting it here - no bad intentions intended).
If you do not know the process, here is a short explanation:

Please add Acked-by/Reviewed-by/Tested-by tags when posting new versions
of patchset, under or above your Signed-off-by tag, unless patch changed
significantly (e.g. new properties added to the DT bindings). Tag is
"received", when provided in a message replied to you on the mailing
list. Tools like b4 can help here. However, there's no need to repost
patches *only* to add the tags. The upstream maintainer will do that for
tags received on the version they apply.

Full context and explanation:
https://elixir.bootlin.com/linux/v6.12-rc3/source/Documentation/process/submitting-patches.rst#L577
</form letter>


Best regards,
Krzysztof