2020-10-02 13:38:45

by Togorean, Bogdan

[permalink] [raw]
Subject: [PATCH v2 2/2] media: dt-bindings: media: i2c: Add bindings for ADDI9036

Add YAML device tree bindings for Analog Devices Inc. ADDI9036 CCD TOF
front-end.

Signed-off-by: Bogdan Togorean <[email protected]>
---
v2: added reg property description
---
.../bindings/media/i2c/adi,addi9036.yaml | 76 +++++++++++++++++++
1 file changed, 76 insertions(+)
create mode 100644 Documentation/devicetree/bindings/media/i2c/adi,addi9036.yaml

diff --git a/Documentation/devicetree/bindings/media/i2c/adi,addi9036.yaml b/Documentation/devicetree/bindings/media/i2c/adi,addi9036.yaml
new file mode 100644
index 000000000000..7c4af704db98
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/adi,addi9036.yaml
@@ -0,0 +1,76 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/i2c/adi,addi9036.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices ADDI9036 VGA CCD Time of Flight Sensor
+
+maintainers:
+ - Bogdan Togorean <[email protected]>
+
+description: |-
+ The ADDI9036 is a complete, 45 MHz, front-end solution for charge coupled
+ device (CCD) time of flight (TOF) imaging applications. It is programmable
+ through I2C interface. Image data is sent through MIPI CSI-2 2 lanes and
+ can output two RAW12 packed data streams. One is IR and the other is Depth.
+ Each data stream is on a separate or same MIPI Virtual Channel, depending
+ on configuration and each have 640x480 resolution.
+
+properties:
+ compatible:
+ const: adi,addi9036
+
+ reg:
+ description: I2C device address
+ maxItems: 1
+
+ reset-gpios:
+ description: |-
+ Reference to the GPIO connected to the RST/SYNC pin, if any.
+ Must be released (set high) after all supplies are applied.
+
+ # See ../video-interfaces.txt for more details
+ port:
+ type: object
+ properties:
+ endpoint:
+ type: object
+ properties:
+ data-lanes:
+ description: |-
+ The sensor supports two-lane operation.
+ For two-lane operation the property must be set to <1 2>.
+ items:
+ - const: 1
+ - const: 2
+
+required:
+ - compatible
+ - reg
+ - port
+
+additionalProperties: false
+
+examples:
+ - |
+ i2c0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ addi9036: addi9036_tof@64 {
+ compatible = "adi,addi9036";
+ reg = <0x64>;
+
+ reset-gpios = <&gpio 41 1>;
+
+ port {
+ addi9036_ep: endpoint {
+ remote-endpoint = <&csi1_ep>;
+ data-lanes = <1 2>;
+ };
+ };
+ };
+ };
+
+...
--
2.28.0


2020-10-06 20:49:35

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] media: dt-bindings: media: i2c: Add bindings for ADDI9036

On Fri, Oct 02, 2020 at 04:35:17PM +0300, Bogdan Togorean wrote:
> Add YAML device tree bindings for Analog Devices Inc. ADDI9036 CCD TOF
> front-end.
>
> Signed-off-by: Bogdan Togorean <[email protected]>
> ---
> v2: added reg property description
> ---
> .../bindings/media/i2c/adi,addi9036.yaml | 76 +++++++++++++++++++
> 1 file changed, 76 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/media/i2c/adi,addi9036.yaml
>
> diff --git a/Documentation/devicetree/bindings/media/i2c/adi,addi9036.yaml b/Documentation/devicetree/bindings/media/i2c/adi,addi9036.yaml
> new file mode 100644
> index 000000000000..7c4af704db98
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/i2c/adi,addi9036.yaml
> @@ -0,0 +1,76 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/media/i2c/adi,addi9036.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Analog Devices ADDI9036 VGA CCD Time of Flight Sensor
> +
> +maintainers:
> + - Bogdan Togorean <[email protected]>
> +
> +description: |-
> + The ADDI9036 is a complete, 45 MHz, front-end solution for charge coupled
> + device (CCD) time of flight (TOF) imaging applications. It is programmable
> + through I2C interface. Image data is sent through MIPI CSI-2 2 lanes and
> + can output two RAW12 packed data streams. One is IR and the other is Depth.
> + Each data stream is on a separate or same MIPI Virtual Channel, depending
> + on configuration and each have 640x480 resolution.
> +
> +properties:
> + compatible:
> + const: adi,addi9036
> +
> + reg:
> + description: I2C device address

Can drop this.

> + maxItems: 1
> +
> + reset-gpios:

maxItems: 1

> + description: |-
> + Reference to the GPIO connected to the RST/SYNC pin, if any.
> + Must be released (set high) after all supplies are applied.
> +
> + # See ../video-interfaces.txt for more details
> + port:
> + type: object
> + properties:
> + endpoint:
> + type: object
> + properties:
> + data-lanes:
> + description: |-
> + The sensor supports two-lane operation.
> + For two-lane operation the property must be set to <1 2>.
> + items:
> + - const: 1
> + - const: 2

If this is the only possible setting, then why does it need to be in DT?

> +
> +required:
> + - compatible
> + - reg
> + - port
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + i2c0 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + addi9036: addi9036_tof@64 {
> + compatible = "adi,addi9036";
> + reg = <0x64>;
> +
> + reset-gpios = <&gpio 41 1>;
> +
> + port {
> + addi9036_ep: endpoint {
> + remote-endpoint = <&csi1_ep>;
> + data-lanes = <1 2>;
> + };
> + };
> + };
> + };
> +
> +...
> --
> 2.28.0
>

2020-10-08 06:26:58

by Togorean, Bogdan

[permalink] [raw]
Subject: RE: [PATCH v2 2/2] media: dt-bindings: media: i2c: Add bindings for ADDI9036

Thank you Rob for review
> On Fri, Oct 02, 2020 at 04:35:17PM +0300, Bogdan Togorean wrote:
> > Add YAML device tree bindings for Analog Devices Inc. ADDI9036 CCD TOF
> > front-end.
> >
> > Signed-off-by: Bogdan Togorean <[email protected]>
> > ---
> > v2: added reg property description
> > ---
> > .../bindings/media/i2c/adi,addi9036.yaml | 76 +++++++++++++++++++
> > 1 file changed, 76 insertions(+)
> > create mode 100644
> Documentation/devicetree/bindings/media/i2c/adi,addi9036.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/media/i2c/adi,addi9036.yaml
> b/Documentation/devicetree/bindings/media/i2c/adi,addi9036.yaml
> > new file mode 100644
> > index 000000000000..7c4af704db98
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/media/i2c/adi,addi9036.yaml
> > @@ -0,0 +1,76 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id:
> https://urldefense.com/v3/__http://devicetree.org/schemas/media/i2c/adi,add
> i9036.yaml*__;Iw!!A3Ni8CS0y2Y!vLJoRikiVhmxm8p3bhGjRkFIWgjXvVlcJ8ATa9okn
> JqDbtobtK46hHICblE2i2Yj2sZL$
> > +$schema: https://urldefense.com/v3/__http://devicetree.org/meta-
> schemas/core.yaml*__;Iw!!A3Ni8CS0y2Y!vLJoRikiVhmxm8p3bhGjRkFIWgjXvVlcJ
> 8ATa9oknJqDbtobtK46hHICblE2iz34fu4o$
> > +
> > +title: Analog Devices ADDI9036 VGA CCD Time of Flight Sensor
> > +
> > +maintainers:
> > + - Bogdan Togorean <[email protected]>
> > +
> > +description: |-
> > + The ADDI9036 is a complete, 45 MHz, front-end solution for charge coupled
> > + device (CCD) time of flight (TOF) imaging applications. It is programmable
> > + through I2C interface. Image data is sent through MIPI CSI-2 2 lanes and
> > + can output two RAW12 packed data streams. One is IR and the other is
> Depth.
> > + Each data stream is on a separate or same MIPI Virtual Channel, depending
> > + on configuration and each have 640x480 resolution.
> > +
> > +properties:
> > + compatible:
> > + const: adi,addi9036
> > +
> > + reg:
> > + description: I2C device address
>
> Can drop this.
ACK
>
> > + maxItems: 1
> > +
> > + reset-gpios:
>
> maxItems: 1
ACK
>
> > + description: |-
> > + Reference to the GPIO connected to the RST/SYNC pin, if any.
> > + Must be released (set high) after all supplies are applied.
> > +
> > + # See ../video-interfaces.txt for more details
> > + port:
> > + type: object
> > + properties:
> > + endpoint:
> > + type: object
> > + properties:
> > + data-lanes:
> > + description: |-
> > + The sensor supports two-lane operation.
> > + For two-lane operation the property must be set to <1 2>.
> > + items:
> > + - const: 1
> > + - const: 2
>
> If this is the only possible setting, then why does it need to be in DT?
If this is not set the bus_type will be not be correctly set after call of
v4l2_fwnode_endpoint_parse.
>
> > +
> > +required:
> > + - compatible
> > + - reg
> > + - port
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > + - |
> > + i2c0 {
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > +
> > + addi9036: addi9036_tof@64 {
> > + compatible = "adi,addi9036";
> > + reg = <0x64>;
> > +
> > + reset-gpios = <&gpio 41 1>;
> > +
> > + port {
> > + addi9036_ep: endpoint {
> > + remote-endpoint = <&csi1_ep>;
> > + data-lanes = <1 2>;
> > + };
> > + };
> > + };
> > + };
> > +
> > +...
> > --
> > 2.28.0
> >

Will send V3 with updates.

2020-10-08 06:46:01

by Togorean, Bogdan

[permalink] [raw]
Subject: RE: [PATCH v2 2/2] media: dt-bindings: media: i2c: Add bindings for ADDI9036

Hi Sakari,

> Hi Bogdan,
>
> On Thu, Oct 08, 2020 at 06:23:33AM +0000, Togorean, Bogdan wrote:
> > Thank you Rob for review
> > > On Fri, Oct 02, 2020 at 04:35:17PM +0300, Bogdan Togorean wrote:
> > > > Add YAML device tree bindings for Analog Devices Inc. ADDI9036 CCD TOF
> > > > front-end.
> > > >
> > > > Signed-off-by: Bogdan Togorean <[email protected]>
> > > > ---
> > > > v2: added reg property description
> > > > ---
> > > > .../bindings/media/i2c/adi,addi9036.yaml | 76 +++++++++++++++++++
> > > > 1 file changed, 76 insertions(+)
> > > > create mode 100644
> > > Documentation/devicetree/bindings/media/i2c/adi,addi9036.yaml
> > > >
> > > > diff --git
> a/Documentation/devicetree/bindings/media/i2c/adi,addi9036.yaml
> > > b/Documentation/devicetree/bindings/media/i2c/adi,addi9036.yaml
> > > > new file mode 100644
> > > > index 000000000000..7c4af704db98
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/media/i2c/adi,addi9036.yaml
> > > > @@ -0,0 +1,76 @@
> > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > > +%YAML 1.2
> > > > +---
> > > > +$id:
> > >
> https://urldefense.com/v3/__http://devicetree.org/schemas/media/i2c/adi,add
> > >
> i9036.yaml*__;Iw!!A3Ni8CS0y2Y!vLJoRikiVhmxm8p3bhGjRkFIWgjXvVlcJ8ATa9okn
> > > JqDbtobtK46hHICblE2i2Yj2sZL$
> > > > +$schema: https://urldefense.com/v3/__http://devicetree.org/meta-
> > >
> schemas/core.yaml*__;Iw!!A3Ni8CS0y2Y!vLJoRikiVhmxm8p3bhGjRkFIWgjXvVlcJ
> > > 8ATa9oknJqDbtobtK46hHICblE2iz34fu4o$
> > > > +
> > > > +title: Analog Devices ADDI9036 VGA CCD Time of Flight Sensor
> > > > +
> > > > +maintainers:
> > > > + - Bogdan Togorean <[email protected]>
> > > > +
> > > > +description: |-
> > > > + The ADDI9036 is a complete, 45 MHz, front-end solution for charge
> coupled
> > > > + device (CCD) time of flight (TOF) imaging applications. It is programmable
> > > > + through I2C interface. Image data is sent through MIPI CSI-2 2 lanes and
> > > > + can output two RAW12 packed data streams. One is IR and the other is
> > > Depth.
> > > > + Each data stream is on a separate or same MIPI Virtual Channel,
> depending
> > > > + on configuration and each have 640x480 resolution.
> > > > +
> > > > +properties:
> > > > + compatible:
> > > > + const: adi,addi9036
> > > > +
> > > > + reg:
> > > > + description: I2C device address
> > >
> > > Can drop this.
> > ACK
> > >
> > > > + maxItems: 1
> > > > +
> > > > + reset-gpios:
> > >
> > > maxItems: 1
> > ACK
> > >
> > > > + description: |-
> > > > + Reference to the GPIO connected to the RST/SYNC pin, if any.
> > > > + Must be released (set high) after all supplies are applied.
> > > > +
> > > > + # See ../video-interfaces.txt for more details
> > > > + port:
> > > > + type: object
> > > > + properties:
> > > > + endpoint:
> > > > + type: object
> > > > + properties:
> > > > + data-lanes:
> > > > + description: |-
> > > > + The sensor supports two-lane operation.
> > > > + For two-lane operation the property must be set to <1 2>.
> > > > + items:
> > > > + - const: 1
> > > > + - const: 2
> > >
> > > If this is the only possible setting, then why does it need to be in DT?
> > If this is not set the bus_type will be not be correctly set after call of
> > v4l2_fwnode_endpoint_parse.
>
> That's not a DT binding issue. The driver needs to set the field before
> calling v4l2_fwnode_endpoint_parse.
>
> Does the device not support one lane operation?
>
Now I was reading your response to driver review and understood the problem.
Sorry for this an I'll set the bus_type in driver before call of v4l2_fwnode_endpoint_parse.

And the camera does not support one lane.
> --
> Regards,
>
> Sakari Ailus

2020-10-08 08:25:30

by Sakari Ailus

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] media: dt-bindings: media: i2c: Add bindings for ADDI9036

Hi Bogdan,

On Thu, Oct 08, 2020 at 06:23:33AM +0000, Togorean, Bogdan wrote:
> Thank you Rob for review
> > On Fri, Oct 02, 2020 at 04:35:17PM +0300, Bogdan Togorean wrote:
> > > Add YAML device tree bindings for Analog Devices Inc. ADDI9036 CCD TOF
> > > front-end.
> > >
> > > Signed-off-by: Bogdan Togorean <[email protected]>
> > > ---
> > > v2: added reg property description
> > > ---
> > > .../bindings/media/i2c/adi,addi9036.yaml | 76 +++++++++++++++++++
> > > 1 file changed, 76 insertions(+)
> > > create mode 100644
> > Documentation/devicetree/bindings/media/i2c/adi,addi9036.yaml
> > >
> > > diff --git a/Documentation/devicetree/bindings/media/i2c/adi,addi9036.yaml
> > b/Documentation/devicetree/bindings/media/i2c/adi,addi9036.yaml
> > > new file mode 100644
> > > index 000000000000..7c4af704db98
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/media/i2c/adi,addi9036.yaml
> > > @@ -0,0 +1,76 @@
> > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id:
> > https://urldefense.com/v3/__http://devicetree.org/schemas/media/i2c/adi,add
> > i9036.yaml*__;Iw!!A3Ni8CS0y2Y!vLJoRikiVhmxm8p3bhGjRkFIWgjXvVlcJ8ATa9okn
> > JqDbtobtK46hHICblE2i2Yj2sZL$
> > > +$schema: https://urldefense.com/v3/__http://devicetree.org/meta-
> > schemas/core.yaml*__;Iw!!A3Ni8CS0y2Y!vLJoRikiVhmxm8p3bhGjRkFIWgjXvVlcJ
> > 8ATa9oknJqDbtobtK46hHICblE2iz34fu4o$
> > > +
> > > +title: Analog Devices ADDI9036 VGA CCD Time of Flight Sensor
> > > +
> > > +maintainers:
> > > + - Bogdan Togorean <[email protected]>
> > > +
> > > +description: |-
> > > + The ADDI9036 is a complete, 45 MHz, front-end solution for charge coupled
> > > + device (CCD) time of flight (TOF) imaging applications. It is programmable
> > > + through I2C interface. Image data is sent through MIPI CSI-2 2 lanes and
> > > + can output two RAW12 packed data streams. One is IR and the other is
> > Depth.
> > > + Each data stream is on a separate or same MIPI Virtual Channel, depending
> > > + on configuration and each have 640x480 resolution.
> > > +
> > > +properties:
> > > + compatible:
> > > + const: adi,addi9036
> > > +
> > > + reg:
> > > + description: I2C device address
> >
> > Can drop this.
> ACK
> >
> > > + maxItems: 1
> > > +
> > > + reset-gpios:
> >
> > maxItems: 1
> ACK
> >
> > > + description: |-
> > > + Reference to the GPIO connected to the RST/SYNC pin, if any.
> > > + Must be released (set high) after all supplies are applied.
> > > +
> > > + # See ../video-interfaces.txt for more details
> > > + port:
> > > + type: object
> > > + properties:
> > > + endpoint:
> > > + type: object
> > > + properties:
> > > + data-lanes:
> > > + description: |-
> > > + The sensor supports two-lane operation.
> > > + For two-lane operation the property must be set to <1 2>.
> > > + items:
> > > + - const: 1
> > > + - const: 2
> >
> > If this is the only possible setting, then why does it need to be in DT?
> If this is not set the bus_type will be not be correctly set after call of
> v4l2_fwnode_endpoint_parse.

That's not a DT binding issue. The driver needs to set the field before
calling v4l2_fwnode_endpoint_parse.

Does the device not support one lane operation?

--
Regards,

Sakari Ailus