diff mbox series

[v5,1/2] media: dt-bindings: Add OmniVision OV64A40

Message ID 20231206155900.123904-2-jacopo.mondi@ideasonboard.com
State Superseded
Headers show
Series media: i2c: Add driver for OmniVision OV64A40 | expand

Commit Message

Jacopo Mondi Dec. 6, 2023, 3:58 p.m. UTC
Add bindings for OmniVision OV64A40.

Co-developed-by: Lee Jackson <lee.jackson@arducam.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
---
 .../bindings/media/i2c/ovti,ov64a40.yaml      | 97 +++++++++++++++++++
 1 file changed, 97 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml

--
2.41.0

Comments

Sakari Ailus Dec. 7, 2023, 9:57 a.m. UTC | #1
Hi Jacopo,

On Wed, Dec 06, 2023 at 04:58:59PM +0100, Jacopo Mondi wrote:
> Add bindings for OmniVision OV64A40.
> 
> Co-developed-by: Lee Jackson <lee.jackson@arducam.com>
> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> Acked-by: Conor Dooley <conor.dooley@microchip.com>
> ---
>  .../bindings/media/i2c/ovti,ov64a40.yaml      | 97 +++++++++++++++++++
>  1 file changed, 97 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml
> 
> diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml b/Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml
> new file mode 100644
> index 000000000000..e6c9d540a2dd
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml
> @@ -0,0 +1,97 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/media/i2c/ovti,ov64a40.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: OmniVision OV64A40 Image Sensor
> +
> +maintainers:
> +  - Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> +
> +allOf:
> +  - $ref: /schemas/media/video-interface-devices.yaml#
> +
> +properties:
> +  compatible:
> +    const: ovti,ov64a40
> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 1
> +
> +  avdd-supply:
> +    description: Analog voltage supply, 2.8 volts
> +
> +  dvdd-supply:
> +    description: Digital core voltage supply, 1.1 volts
> +
> +  dovdd-supply:
> +    description: Digital I/O voltage supply, 1.8 volts
> +
> +  powerdown-gpios:
> +    maxItems: 1
> +
> +  reset-gpios:
> +    maxItems: 1
> +
> +  port:
> +    $ref: /schemas/graph.yaml#/$defs/port-base
> +    additionalProperties: false
> +
> +    properties:
> +      endpoint:
> +        $ref: /schemas/media/video-interfaces.yaml#
> +        additionalProperties: false
> +
> +        properties:
> +          bus-type:
> +            enum:
> +              - 1 # MIPI CSI-2 C-PHY
> +              - 4 # MIPI CSI-2 D-PHY
> +          data-lanes: true
> +          link-frequencies: true
> +          clock-noncontinuous: true
> +          remote-endpoint: true
> +
> +required:
> +  - compatible
> +  - reg
> +  - clocks
> +  - port
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +      #include <dt-bindings/gpio/gpio.h>
> +
> +      i2c {
> +          #address-cells = <1>;
> +          #size-cells = <0>;
> +
> +          camera@36 {
> +              compatible = "ovti,ov64a40";
> +              reg = <0x36>;
> +              clocks = <&camera_clk>;
> +              dovdd-supply = <&vgen4_reg>;
> +              avdd-supply = <&vgen3_reg>;
> +              dvdd-supply = <&vgen2_reg>;
> +              powerdown-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
> +              reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
> +              rotation = <180>;
> +              orientation = <2>;
> +
> +              port {
> +                  endpoint {
> +                      remote-endpoint = <&mipi_csi2_in>;
> +                      bus-type = <4>;
> +                      data-lanes = <1 2 3 4>;

This is missing link-frequencies.

> +                  };
> +              };
> +          };
> +      };
> +
> +...
Jacopo Mondi Dec. 7, 2023, 10:13 a.m. UTC | #2
Hi Sakari

On Thu, Dec 07, 2023 at 09:57:06AM +0000, Sakari Ailus wrote:
> Hi Jacopo,
>
> On Wed, Dec 06, 2023 at 04:58:59PM +0100, Jacopo Mondi wrote:
> > Add bindings for OmniVision OV64A40.
> >
> > Co-developed-by: Lee Jackson <lee.jackson@arducam.com>
> > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > Acked-by: Conor Dooley <conor.dooley@microchip.com>
> > ---
> >  .../bindings/media/i2c/ovti,ov64a40.yaml      | 97 +++++++++++++++++++
> >  1 file changed, 97 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml b/Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml
> > new file mode 100644
> > index 000000000000..e6c9d540a2dd
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml
> > @@ -0,0 +1,97 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/media/i2c/ovti,ov64a40.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: OmniVision OV64A40 Image Sensor
> > +
> > +maintainers:
> > +  - Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > +
> > +allOf:
> > +  - $ref: /schemas/media/video-interface-devices.yaml#
> > +
> > +properties:
> > +  compatible:
> > +    const: ovti,ov64a40
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  clocks:
> > +    maxItems: 1
> > +
> > +  avdd-supply:
> > +    description: Analog voltage supply, 2.8 volts
> > +
> > +  dvdd-supply:
> > +    description: Digital core voltage supply, 1.1 volts
> > +
> > +  dovdd-supply:
> > +    description: Digital I/O voltage supply, 1.8 volts
> > +
> > +  powerdown-gpios:
> > +    maxItems: 1
> > +
> > +  reset-gpios:
> > +    maxItems: 1
> > +
> > +  port:
> > +    $ref: /schemas/graph.yaml#/$defs/port-base
> > +    additionalProperties: false
> > +
> > +    properties:
> > +      endpoint:
> > +        $ref: /schemas/media/video-interfaces.yaml#
> > +        additionalProperties: false
> > +
> > +        properties:
> > +          bus-type:
> > +            enum:
> > +              - 1 # MIPI CSI-2 C-PHY
> > +              - 4 # MIPI CSI-2 D-PHY
> > +          data-lanes: true
> > +          link-frequencies: true
> > +          clock-noncontinuous: true
> > +          remote-endpoint: true
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - clocks
> > +  - port
> > +
> > +unevaluatedProperties: false
> > +
> > +examples:
> > +  - |
> > +      #include <dt-bindings/gpio/gpio.h>
> > +
> > +      i2c {
> > +          #address-cells = <1>;
> > +          #size-cells = <0>;
> > +
> > +          camera@36 {
> > +              compatible = "ovti,ov64a40";
> > +              reg = <0x36>;
> > +              clocks = <&camera_clk>;
> > +              dovdd-supply = <&vgen4_reg>;
> > +              avdd-supply = <&vgen3_reg>;
> > +              dvdd-supply = <&vgen2_reg>;
> > +              powerdown-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
> > +              reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
> > +              rotation = <180>;
> > +              orientation = <2>;
> > +
> > +              port {
> > +                  endpoint {
> > +                      remote-endpoint = <&mipi_csi2_in>;
> > +                      bus-type = <4>;
> > +                      data-lanes = <1 2 3 4>;
>
> This is missing link-frequencies.
>

I was not sure about this, in facts.

Bindings are about HW while link-frequencies is only about restricting
how the driver configures the sensor. Thus, I've not listed it as
mandatory however the driver mandates its presence.

Should I make it mandatory in bindings ?

> > +                  };
> > +              };
> > +          };
> > +      };
> > +
> > +...
>
> --
> Regards,
>
> Sakari Ailus
Sakari Ailus Dec. 7, 2023, 10:35 a.m. UTC | #3
Hi Jacopo,

On Thu, Dec 07, 2023 at 11:13:21AM +0100, Jacopo Mondi wrote:
> Hi Sakari
> 
> On Thu, Dec 07, 2023 at 09:57:06AM +0000, Sakari Ailus wrote:
> > Hi Jacopo,
> >
> > On Wed, Dec 06, 2023 at 04:58:59PM +0100, Jacopo Mondi wrote:
> > > Add bindings for OmniVision OV64A40.
> > >
> > > Co-developed-by: Lee Jackson <lee.jackson@arducam.com>
> > > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > > Acked-by: Conor Dooley <conor.dooley@microchip.com>
> > > ---
> > >  .../bindings/media/i2c/ovti,ov64a40.yaml      | 97 +++++++++++++++++++
> > >  1 file changed, 97 insertions(+)
> > >  create mode 100644 Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml
> > >
> > > diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml b/Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml
> > > new file mode 100644
> > > index 000000000000..e6c9d540a2dd
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml
> > > @@ -0,0 +1,97 @@
> > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/media/i2c/ovti,ov64a40.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: OmniVision OV64A40 Image Sensor
> > > +
> > > +maintainers:
> > > +  - Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > > +
> > > +allOf:
> > > +  - $ref: /schemas/media/video-interface-devices.yaml#
> > > +
> > > +properties:
> > > +  compatible:
> > > +    const: ovti,ov64a40
> > > +
> > > +  reg:
> > > +    maxItems: 1
> > > +
> > > +  clocks:
> > > +    maxItems: 1
> > > +
> > > +  avdd-supply:
> > > +    description: Analog voltage supply, 2.8 volts
> > > +
> > > +  dvdd-supply:
> > > +    description: Digital core voltage supply, 1.1 volts
> > > +
> > > +  dovdd-supply:
> > > +    description: Digital I/O voltage supply, 1.8 volts
> > > +
> > > +  powerdown-gpios:
> > > +    maxItems: 1
> > > +
> > > +  reset-gpios:
> > > +    maxItems: 1
> > > +
> > > +  port:
> > > +    $ref: /schemas/graph.yaml#/$defs/port-base
> > > +    additionalProperties: false
> > > +
> > > +    properties:
> > > +      endpoint:
> > > +        $ref: /schemas/media/video-interfaces.yaml#
> > > +        additionalProperties: false
> > > +
> > > +        properties:
> > > +          bus-type:
> > > +            enum:
> > > +              - 1 # MIPI CSI-2 C-PHY
> > > +              - 4 # MIPI CSI-2 D-PHY
> > > +          data-lanes: true
> > > +          link-frequencies: true
> > > +          clock-noncontinuous: true
> > > +          remote-endpoint: true
> > > +
> > > +required:
> > > +  - compatible
> > > +  - reg
> > > +  - clocks
> > > +  - port
> > > +
> > > +unevaluatedProperties: false
> > > +
> > > +examples:
> > > +  - |
> > > +      #include <dt-bindings/gpio/gpio.h>
> > > +
> > > +      i2c {
> > > +          #address-cells = <1>;
> > > +          #size-cells = <0>;
> > > +
> > > +          camera@36 {
> > > +              compatible = "ovti,ov64a40";
> > > +              reg = <0x36>;
> > > +              clocks = <&camera_clk>;
> > > +              dovdd-supply = <&vgen4_reg>;
> > > +              avdd-supply = <&vgen3_reg>;
> > > +              dvdd-supply = <&vgen2_reg>;
> > > +              powerdown-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
> > > +              reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
> > > +              rotation = <180>;
> > > +              orientation = <2>;
> > > +
> > > +              port {
> > > +                  endpoint {
> > > +                      remote-endpoint = <&mipi_csi2_in>;
> > > +                      bus-type = <4>;
> > > +                      data-lanes = <1 2 3 4>;
> >
> > This is missing link-frequencies.
> >
> 
> I was not sure about this, in facts.
> 
> Bindings are about HW while link-frequencies is only about restricting
> how the driver configures the sensor. Thus, I've not listed it as
> mandatory however the driver mandates its presence.
> 
> Should I make it mandatory in bindings ?

See
<URL:https://hverkuil.home.xs4all.nl/spec/driver-api/camera-sensor.html#handling-clocks>.

IOW it's about the driver, too, but only secondarily.

> 
> > > +                  };
> > > +              };
> > > +          };
> > > +      };
> > > +
> > > +...
> >
Jacopo Mondi Dec. 7, 2023, 10:42 a.m. UTC | #4
Hi Sakari

On Thu, Dec 07, 2023 at 10:35:03AM +0000, Sakari Ailus wrote:
> Hi Jacopo,
>
> On Thu, Dec 07, 2023 at 11:13:21AM +0100, Jacopo Mondi wrote:
> > Hi Sakari
> >
> > On Thu, Dec 07, 2023 at 09:57:06AM +0000, Sakari Ailus wrote:
> > > Hi Jacopo,
> > >
> > > On Wed, Dec 06, 2023 at 04:58:59PM +0100, Jacopo Mondi wrote:
> > > > Add bindings for OmniVision OV64A40.
> > > >
> > > > Co-developed-by: Lee Jackson <lee.jackson@arducam.com>
> > > > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > > > Acked-by: Conor Dooley <conor.dooley@microchip.com>
> > > > ---
> > > >  .../bindings/media/i2c/ovti,ov64a40.yaml      | 97 +++++++++++++++++++
> > > >  1 file changed, 97 insertions(+)
> > > >  create mode 100644 Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml b/Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml
> > > > new file mode 100644
> > > > index 000000000000..e6c9d540a2dd
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml
> > > > @@ -0,0 +1,97 @@
> > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > > +%YAML 1.2
> > > > +---
> > > > +$id: http://devicetree.org/schemas/media/i2c/ovti,ov64a40.yaml#
> > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > > +
> > > > +title: OmniVision OV64A40 Image Sensor
> > > > +
> > > > +maintainers:
> > > > +  - Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > > > +
> > > > +allOf:
> > > > +  - $ref: /schemas/media/video-interface-devices.yaml#
> > > > +
> > > > +properties:
> > > > +  compatible:
> > > > +    const: ovti,ov64a40
> > > > +
> > > > +  reg:
> > > > +    maxItems: 1
> > > > +
> > > > +  clocks:
> > > > +    maxItems: 1
> > > > +
> > > > +  avdd-supply:
> > > > +    description: Analog voltage supply, 2.8 volts
> > > > +
> > > > +  dvdd-supply:
> > > > +    description: Digital core voltage supply, 1.1 volts
> > > > +
> > > > +  dovdd-supply:
> > > > +    description: Digital I/O voltage supply, 1.8 volts
> > > > +
> > > > +  powerdown-gpios:
> > > > +    maxItems: 1
> > > > +
> > > > +  reset-gpios:
> > > > +    maxItems: 1
> > > > +
> > > > +  port:
> > > > +    $ref: /schemas/graph.yaml#/$defs/port-base
> > > > +    additionalProperties: false
> > > > +
> > > > +    properties:
> > > > +      endpoint:
> > > > +        $ref: /schemas/media/video-interfaces.yaml#
> > > > +        additionalProperties: false
> > > > +
> > > > +        properties:
> > > > +          bus-type:
> > > > +            enum:
> > > > +              - 1 # MIPI CSI-2 C-PHY
> > > > +              - 4 # MIPI CSI-2 D-PHY
> > > > +          data-lanes: true
> > > > +          link-frequencies: true
> > > > +          clock-noncontinuous: true
> > > > +          remote-endpoint: true
> > > > +
> > > > +required:
> > > > +  - compatible
> > > > +  - reg
> > > > +  - clocks
> > > > +  - port
> > > > +
> > > > +unevaluatedProperties: false
> > > > +
> > > > +examples:
> > > > +  - |
> > > > +      #include <dt-bindings/gpio/gpio.h>
> > > > +
> > > > +      i2c {
> > > > +          #address-cells = <1>;
> > > > +          #size-cells = <0>;
> > > > +
> > > > +          camera@36 {
> > > > +              compatible = "ovti,ov64a40";
> > > > +              reg = <0x36>;
> > > > +              clocks = <&camera_clk>;
> > > > +              dovdd-supply = <&vgen4_reg>;
> > > > +              avdd-supply = <&vgen3_reg>;
> > > > +              dvdd-supply = <&vgen2_reg>;
> > > > +              powerdown-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
> > > > +              reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
> > > > +              rotation = <180>;
> > > > +              orientation = <2>;
> > > > +
> > > > +              port {
> > > > +                  endpoint {
> > > > +                      remote-endpoint = <&mipi_csi2_in>;
> > > > +                      bus-type = <4>;
> > > > +                      data-lanes = <1 2 3 4>;
> > >
> > > This is missing link-frequencies.
> > >
> >
> > I was not sure about this, in facts.
> >
> > Bindings are about HW while link-frequencies is only about restricting
> > how the driver configures the sensor. Thus, I've not listed it as
> > mandatory however the driver mandates its presence.
> >
> > Should I make it mandatory in bindings ?
>
> See
> <URL:https://hverkuil.home.xs4all.nl/spec/driver-api/camera-sensor.html#handling-clocks>.
>
> IOW it's about the driver, too, but only secondarily.
>

Should link-frequencies be made mandatory by video-interfaces.yaml if
the bus type is CSI-2 (D-PHY as well as C-PHY I presume ?)

> >
> > > > +                  };
> > > > +              };
> > > > +          };
> > > > +      };
> > > > +
> > > > +...
> > >
>
> --
> Regards,
>
> Sakari Ailus
Sakari Ailus Dec. 7, 2023, 10:58 a.m. UTC | #5
Hi Jacopo,

On Thu, Dec 07, 2023 at 11:42:35AM +0100, Jacopo Mondi wrote:
> Hi Sakari
> 
> On Thu, Dec 07, 2023 at 10:35:03AM +0000, Sakari Ailus wrote:
> > Hi Jacopo,
> >
> > On Thu, Dec 07, 2023 at 11:13:21AM +0100, Jacopo Mondi wrote:
> > > Hi Sakari
> > >
> > > On Thu, Dec 07, 2023 at 09:57:06AM +0000, Sakari Ailus wrote:
> > > > Hi Jacopo,
> > > >
> > > > On Wed, Dec 06, 2023 at 04:58:59PM +0100, Jacopo Mondi wrote:
> > > > > Add bindings for OmniVision OV64A40.
> > > > >
> > > > > Co-developed-by: Lee Jackson <lee.jackson@arducam.com>
> > > > > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > > > > Acked-by: Conor Dooley <conor.dooley@microchip.com>
> > > > > ---
> > > > >  .../bindings/media/i2c/ovti,ov64a40.yaml      | 97 +++++++++++++++++++
> > > > >  1 file changed, 97 insertions(+)
> > > > >  create mode 100644 Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml
> > > > >
> > > > > diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml b/Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml
> > > > > new file mode 100644
> > > > > index 000000000000..e6c9d540a2dd
> > > > > --- /dev/null
> > > > > +++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml
> > > > > @@ -0,0 +1,97 @@
> > > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > > > +%YAML 1.2
> > > > > +---
> > > > > +$id: http://devicetree.org/schemas/media/i2c/ovti,ov64a40.yaml#
> > > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > > > +
> > > > > +title: OmniVision OV64A40 Image Sensor
> > > > > +
> > > > > +maintainers:
> > > > > +  - Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > > > > +
> > > > > +allOf:
> > > > > +  - $ref: /schemas/media/video-interface-devices.yaml#
> > > > > +
> > > > > +properties:
> > > > > +  compatible:
> > > > > +    const: ovti,ov64a40
> > > > > +
> > > > > +  reg:
> > > > > +    maxItems: 1
> > > > > +
> > > > > +  clocks:
> > > > > +    maxItems: 1
> > > > > +
> > > > > +  avdd-supply:
> > > > > +    description: Analog voltage supply, 2.8 volts
> > > > > +
> > > > > +  dvdd-supply:
> > > > > +    description: Digital core voltage supply, 1.1 volts
> > > > > +
> > > > > +  dovdd-supply:
> > > > > +    description: Digital I/O voltage supply, 1.8 volts
> > > > > +
> > > > > +  powerdown-gpios:
> > > > > +    maxItems: 1
> > > > > +
> > > > > +  reset-gpios:
> > > > > +    maxItems: 1
> > > > > +
> > > > > +  port:
> > > > > +    $ref: /schemas/graph.yaml#/$defs/port-base
> > > > > +    additionalProperties: false
> > > > > +
> > > > > +    properties:
> > > > > +      endpoint:
> > > > > +        $ref: /schemas/media/video-interfaces.yaml#
> > > > > +        additionalProperties: false
> > > > > +
> > > > > +        properties:
> > > > > +          bus-type:
> > > > > +            enum:
> > > > > +              - 1 # MIPI CSI-2 C-PHY
> > > > > +              - 4 # MIPI CSI-2 D-PHY
> > > > > +          data-lanes: true
> > > > > +          link-frequencies: true
> > > > > +          clock-noncontinuous: true
> > > > > +          remote-endpoint: true
> > > > > +
> > > > > +required:
> > > > > +  - compatible
> > > > > +  - reg
> > > > > +  - clocks
> > > > > +  - port
> > > > > +
> > > > > +unevaluatedProperties: false
> > > > > +
> > > > > +examples:
> > > > > +  - |
> > > > > +      #include <dt-bindings/gpio/gpio.h>
> > > > > +
> > > > > +      i2c {
> > > > > +          #address-cells = <1>;
> > > > > +          #size-cells = <0>;
> > > > > +
> > > > > +          camera@36 {
> > > > > +              compatible = "ovti,ov64a40";
> > > > > +              reg = <0x36>;
> > > > > +              clocks = <&camera_clk>;
> > > > > +              dovdd-supply = <&vgen4_reg>;
> > > > > +              avdd-supply = <&vgen3_reg>;
> > > > > +              dvdd-supply = <&vgen2_reg>;
> > > > > +              powerdown-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
> > > > > +              reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
> > > > > +              rotation = <180>;
> > > > > +              orientation = <2>;
> > > > > +
> > > > > +              port {
> > > > > +                  endpoint {
> > > > > +                      remote-endpoint = <&mipi_csi2_in>;
> > > > > +                      bus-type = <4>;
> > > > > +                      data-lanes = <1 2 3 4>;
> > > >
> > > > This is missing link-frequencies.
> > > >
> > >
> > > I was not sure about this, in facts.
> > >
> > > Bindings are about HW while link-frequencies is only about restricting
> > > how the driver configures the sensor. Thus, I've not listed it as
> > > mandatory however the driver mandates its presence.
> > >
> > > Should I make it mandatory in bindings ?
> >
> > See
> > <URL:https://hverkuil.home.xs4all.nl/spec/driver-api/camera-sensor.html#handling-clocks>.
> >
> > IOW it's about the driver, too, but only secondarily.
> >
> 
> Should link-frequencies be made mandatory by video-interfaces.yaml if
> the bus type is CSI-2 (D-PHY as well as C-PHY I presume ?)

Works for me. There are certainly old bindings that don't have it at all so
there would be warnings. Some drivers support just a single frequency,
that's often the case with register list based drivers so things work just
fine until someone goes and adds another to support a different system.
Jacopo Mondi Dec. 7, 2023, 11:05 a.m. UTC | #6
On Thu, Dec 07, 2023 at 10:58:29AM +0000, Sakari Ailus wrote:
> Hi Jacopo,
>
> On Thu, Dec 07, 2023 at 11:42:35AM +0100, Jacopo Mondi wrote:
> > Hi Sakari
> >
> > On Thu, Dec 07, 2023 at 10:35:03AM +0000, Sakari Ailus wrote:
> > > Hi Jacopo,
> > >
> > > On Thu, Dec 07, 2023 at 11:13:21AM +0100, Jacopo Mondi wrote:
> > > > Hi Sakari
> > > >
> > > > On Thu, Dec 07, 2023 at 09:57:06AM +0000, Sakari Ailus wrote:
> > > > > Hi Jacopo,
> > > > >
> > > > > On Wed, Dec 06, 2023 at 04:58:59PM +0100, Jacopo Mondi wrote:
> > > > > > Add bindings for OmniVision OV64A40.
> > > > > >
> > > > > > Co-developed-by: Lee Jackson <lee.jackson@arducam.com>
> > > > > > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > > > > > Acked-by: Conor Dooley <conor.dooley@microchip.com>
> > > > > > ---
> > > > > >  .../bindings/media/i2c/ovti,ov64a40.yaml      | 97 +++++++++++++++++++
> > > > > >  1 file changed, 97 insertions(+)
> > > > > >  create mode 100644 Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml
> > > > > >
> > > > > > diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml b/Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml
> > > > > > new file mode 100644
> > > > > > index 000000000000..e6c9d540a2dd
> > > > > > --- /dev/null
> > > > > > +++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml
> > > > > > @@ -0,0 +1,97 @@
> > > > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > > > > +%YAML 1.2
> > > > > > +---
> > > > > > +$id: http://devicetree.org/schemas/media/i2c/ovti,ov64a40.yaml#
> > > > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > > > > +
> > > > > > +title: OmniVision OV64A40 Image Sensor
> > > > > > +
> > > > > > +maintainers:
> > > > > > +  - Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > > > > > +
> > > > > > +allOf:
> > > > > > +  - $ref: /schemas/media/video-interface-devices.yaml#
> > > > > > +
> > > > > > +properties:
> > > > > > +  compatible:
> > > > > > +    const: ovti,ov64a40
> > > > > > +
> > > > > > +  reg:
> > > > > > +    maxItems: 1
> > > > > > +
> > > > > > +  clocks:
> > > > > > +    maxItems: 1
> > > > > > +
> > > > > > +  avdd-supply:
> > > > > > +    description: Analog voltage supply, 2.8 volts
> > > > > > +
> > > > > > +  dvdd-supply:
> > > > > > +    description: Digital core voltage supply, 1.1 volts
> > > > > > +
> > > > > > +  dovdd-supply:
> > > > > > +    description: Digital I/O voltage supply, 1.8 volts
> > > > > > +
> > > > > > +  powerdown-gpios:
> > > > > > +    maxItems: 1
> > > > > > +
> > > > > > +  reset-gpios:
> > > > > > +    maxItems: 1
> > > > > > +
> > > > > > +  port:
> > > > > > +    $ref: /schemas/graph.yaml#/$defs/port-base
> > > > > > +    additionalProperties: false
> > > > > > +
> > > > > > +    properties:
> > > > > > +      endpoint:
> > > > > > +        $ref: /schemas/media/video-interfaces.yaml#
> > > > > > +        additionalProperties: false
> > > > > > +
> > > > > > +        properties:
> > > > > > +          bus-type:
> > > > > > +            enum:
> > > > > > +              - 1 # MIPI CSI-2 C-PHY
> > > > > > +              - 4 # MIPI CSI-2 D-PHY
> > > > > > +          data-lanes: true
> > > > > > +          link-frequencies: true
> > > > > > +          clock-noncontinuous: true
> > > > > > +          remote-endpoint: true
> > > > > > +
> > > > > > +required:
> > > > > > +  - compatible
> > > > > > +  - reg
> > > > > > +  - clocks
> > > > > > +  - port
> > > > > > +
> > > > > > +unevaluatedProperties: false
> > > > > > +
> > > > > > +examples:
> > > > > > +  - |
> > > > > > +      #include <dt-bindings/gpio/gpio.h>
> > > > > > +
> > > > > > +      i2c {
> > > > > > +          #address-cells = <1>;
> > > > > > +          #size-cells = <0>;
> > > > > > +
> > > > > > +          camera@36 {
> > > > > > +              compatible = "ovti,ov64a40";
> > > > > > +              reg = <0x36>;
> > > > > > +              clocks = <&camera_clk>;
> > > > > > +              dovdd-supply = <&vgen4_reg>;
> > > > > > +              avdd-supply = <&vgen3_reg>;
> > > > > > +              dvdd-supply = <&vgen2_reg>;
> > > > > > +              powerdown-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
> > > > > > +              reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
> > > > > > +              rotation = <180>;
> > > > > > +              orientation = <2>;
> > > > > > +
> > > > > > +              port {
> > > > > > +                  endpoint {
> > > > > > +                      remote-endpoint = <&mipi_csi2_in>;
> > > > > > +                      bus-type = <4>;
> > > > > > +                      data-lanes = <1 2 3 4>;
> > > > >
> > > > > This is missing link-frequencies.
> > > > >
> > > >
> > > > I was not sure about this, in facts.
> > > >
> > > > Bindings are about HW while link-frequencies is only about restricting
> > > > how the driver configures the sensor. Thus, I've not listed it as
> > > > mandatory however the driver mandates its presence.
> > > >
> > > > Should I make it mandatory in bindings ?
> > >
> > > See
> > > <URL:https://hverkuil.home.xs4all.nl/spec/driver-api/camera-sensor.html#handling-clocks>.
> > >
> > > IOW it's about the driver, too, but only secondarily.
> > >
> >
> > Should link-frequencies be made mandatory by video-interfaces.yaml if
> > the bus type is CSI-2 (D-PHY as well as C-PHY I presume ?)
>
> Works for me. There are certainly old bindings that don't have it at all so
> there would be warnings. Some drivers support just a single frequency,
> that's often the case with register list based drivers so things work just
> fine until someone goes and adds another to support a different system.
>

mmm, with a single link freq what the would be the point of specifying it
in dts ? Maybe making it mandatory for everyone is not the best idea..

> --
> Regards,
>
> Sakari Ailus
Sakari Ailus Dec. 7, 2023, 11:18 a.m. UTC | #7
On Thu, Dec 07, 2023 at 12:05:07PM +0100, Jacopo Mondi wrote:
> On Thu, Dec 07, 2023 at 10:58:29AM +0000, Sakari Ailus wrote:
> > Hi Jacopo,
> >
> > On Thu, Dec 07, 2023 at 11:42:35AM +0100, Jacopo Mondi wrote:
> > > Hi Sakari
> > >
> > > On Thu, Dec 07, 2023 at 10:35:03AM +0000, Sakari Ailus wrote:
> > > > Hi Jacopo,
> > > >
> > > > On Thu, Dec 07, 2023 at 11:13:21AM +0100, Jacopo Mondi wrote:
> > > > > Hi Sakari
> > > > >
> > > > > On Thu, Dec 07, 2023 at 09:57:06AM +0000, Sakari Ailus wrote:
> > > > > > Hi Jacopo,
> > > > > >
> > > > > > On Wed, Dec 06, 2023 at 04:58:59PM +0100, Jacopo Mondi wrote:
> > > > > > > Add bindings for OmniVision OV64A40.
> > > > > > >
> > > > > > > Co-developed-by: Lee Jackson <lee.jackson@arducam.com>
> > > > > > > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > > > > > > Acked-by: Conor Dooley <conor.dooley@microchip.com>
> > > > > > > ---
> > > > > > >  .../bindings/media/i2c/ovti,ov64a40.yaml      | 97 +++++++++++++++++++
> > > > > > >  1 file changed, 97 insertions(+)
> > > > > > >  create mode 100644 Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml
> > > > > > >
> > > > > > > diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml b/Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml
> > > > > > > new file mode 100644
> > > > > > > index 000000000000..e6c9d540a2dd
> > > > > > > --- /dev/null
> > > > > > > +++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml
> > > > > > > @@ -0,0 +1,97 @@
> > > > > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > > > > > +%YAML 1.2
> > > > > > > +---
> > > > > > > +$id: http://devicetree.org/schemas/media/i2c/ovti,ov64a40.yaml#
> > > > > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > > > > > +
> > > > > > > +title: OmniVision OV64A40 Image Sensor
> > > > > > > +
> > > > > > > +maintainers:
> > > > > > > +  - Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > > > > > > +
> > > > > > > +allOf:
> > > > > > > +  - $ref: /schemas/media/video-interface-devices.yaml#
> > > > > > > +
> > > > > > > +properties:
> > > > > > > +  compatible:
> > > > > > > +    const: ovti,ov64a40
> > > > > > > +
> > > > > > > +  reg:
> > > > > > > +    maxItems: 1
> > > > > > > +
> > > > > > > +  clocks:
> > > > > > > +    maxItems: 1
> > > > > > > +
> > > > > > > +  avdd-supply:
> > > > > > > +    description: Analog voltage supply, 2.8 volts
> > > > > > > +
> > > > > > > +  dvdd-supply:
> > > > > > > +    description: Digital core voltage supply, 1.1 volts
> > > > > > > +
> > > > > > > +  dovdd-supply:
> > > > > > > +    description: Digital I/O voltage supply, 1.8 volts
> > > > > > > +
> > > > > > > +  powerdown-gpios:
> > > > > > > +    maxItems: 1
> > > > > > > +
> > > > > > > +  reset-gpios:
> > > > > > > +    maxItems: 1
> > > > > > > +
> > > > > > > +  port:
> > > > > > > +    $ref: /schemas/graph.yaml#/$defs/port-base
> > > > > > > +    additionalProperties: false
> > > > > > > +
> > > > > > > +    properties:
> > > > > > > +      endpoint:
> > > > > > > +        $ref: /schemas/media/video-interfaces.yaml#
> > > > > > > +        additionalProperties: false
> > > > > > > +
> > > > > > > +        properties:
> > > > > > > +          bus-type:
> > > > > > > +            enum:
> > > > > > > +              - 1 # MIPI CSI-2 C-PHY
> > > > > > > +              - 4 # MIPI CSI-2 D-PHY
> > > > > > > +          data-lanes: true
> > > > > > > +          link-frequencies: true
> > > > > > > +          clock-noncontinuous: true
> > > > > > > +          remote-endpoint: true
> > > > > > > +
> > > > > > > +required:
> > > > > > > +  - compatible
> > > > > > > +  - reg
> > > > > > > +  - clocks
> > > > > > > +  - port
> > > > > > > +
> > > > > > > +unevaluatedProperties: false
> > > > > > > +
> > > > > > > +examples:
> > > > > > > +  - |
> > > > > > > +      #include <dt-bindings/gpio/gpio.h>
> > > > > > > +
> > > > > > > +      i2c {
> > > > > > > +          #address-cells = <1>;
> > > > > > > +          #size-cells = <0>;
> > > > > > > +
> > > > > > > +          camera@36 {
> > > > > > > +              compatible = "ovti,ov64a40";
> > > > > > > +              reg = <0x36>;
> > > > > > > +              clocks = <&camera_clk>;
> > > > > > > +              dovdd-supply = <&vgen4_reg>;
> > > > > > > +              avdd-supply = <&vgen3_reg>;
> > > > > > > +              dvdd-supply = <&vgen2_reg>;
> > > > > > > +              powerdown-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
> > > > > > > +              reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
> > > > > > > +              rotation = <180>;
> > > > > > > +              orientation = <2>;
> > > > > > > +
> > > > > > > +              port {
> > > > > > > +                  endpoint {
> > > > > > > +                      remote-endpoint = <&mipi_csi2_in>;
> > > > > > > +                      bus-type = <4>;
> > > > > > > +                      data-lanes = <1 2 3 4>;
> > > > > >
> > > > > > This is missing link-frequencies.
> > > > > >
> > > > >
> > > > > I was not sure about this, in facts.
> > > > >
> > > > > Bindings are about HW while link-frequencies is only about restricting
> > > > > how the driver configures the sensor. Thus, I've not listed it as
> > > > > mandatory however the driver mandates its presence.
> > > > >
> > > > > Should I make it mandatory in bindings ?
> > > >
> > > > See
> > > > <URL:https://hverkuil.home.xs4all.nl/spec/driver-api/camera-sensor.html#handling-clocks>.
> > > >
> > > > IOW it's about the driver, too, but only secondarily.
> > > >
> > >
> > > Should link-frequencies be made mandatory by video-interfaces.yaml if
> > > the bus type is CSI-2 (D-PHY as well as C-PHY I presume ?)
> >
> > Works for me. There are certainly old bindings that don't have it at all so
> > there would be warnings. Some drivers support just a single frequency,
> > that's often the case with register list based drivers so things work just
> > fine until someone goes and adds another to support a different system.
> >
> 
> mmm, with a single link freq what the would be the point of specifying it
> in dts ? Maybe making it mandatory for everyone is not the best idea..

Because DT describes devices, not drivers?
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml b/Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml
new file mode 100644
index 000000000000..e6c9d540a2dd
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov64a40.yaml
@@ -0,0 +1,97 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/i2c/ovti,ov64a40.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: OmniVision OV64A40 Image Sensor
+
+maintainers:
+  - Jacopo Mondi <jacopo.mondi@ideasonboard.com>
+
+allOf:
+  - $ref: /schemas/media/video-interface-devices.yaml#
+
+properties:
+  compatible:
+    const: ovti,ov64a40
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  avdd-supply:
+    description: Analog voltage supply, 2.8 volts
+
+  dvdd-supply:
+    description: Digital core voltage supply, 1.1 volts
+
+  dovdd-supply:
+    description: Digital I/O voltage supply, 1.8 volts
+
+  powerdown-gpios:
+    maxItems: 1
+
+  reset-gpios:
+    maxItems: 1
+
+  port:
+    $ref: /schemas/graph.yaml#/$defs/port-base
+    additionalProperties: false
+
+    properties:
+      endpoint:
+        $ref: /schemas/media/video-interfaces.yaml#
+        additionalProperties: false
+
+        properties:
+          bus-type:
+            enum:
+              - 1 # MIPI CSI-2 C-PHY
+              - 4 # MIPI CSI-2 D-PHY
+          data-lanes: true
+          link-frequencies: true
+          clock-noncontinuous: true
+          remote-endpoint: true
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - port
+
+unevaluatedProperties: false
+
+examples:
+  - |
+      #include <dt-bindings/gpio/gpio.h>
+
+      i2c {
+          #address-cells = <1>;
+          #size-cells = <0>;
+
+          camera@36 {
+              compatible = "ovti,ov64a40";
+              reg = <0x36>;
+              clocks = <&camera_clk>;
+              dovdd-supply = <&vgen4_reg>;
+              avdd-supply = <&vgen3_reg>;
+              dvdd-supply = <&vgen2_reg>;
+              powerdown-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
+              reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
+              rotation = <180>;
+              orientation = <2>;
+
+              port {
+                  endpoint {
+                      remote-endpoint = <&mipi_csi2_in>;
+                      bus-type = <4>;
+                      data-lanes = <1 2 3 4>;
+                  };
+              };
+          };
+      };
+
+...