linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: dt-bindings: Convert Omnivision OV7251 to DT schema
@ 2023-07-07 21:06 Rob Herring
  2023-07-10 17:56 ` Conor Dooley
  2023-07-31 11:29 ` Sakari Ailus
  0 siblings, 2 replies; 6+ messages in thread
From: Rob Herring @ 2023-07-07 21:06 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Krzysztof Kozlowski, Conor Dooley, Todor Tomov
  Cc: linux-media, devicetree, linux-kernel

Convert the OmniVision OV7251 Image Sensor binding to DT schema format.

vddd-supply was listed as required, but the example and actual user
don't have it. Also, the data brief says it has an internal regulator,
so perhaps it is truly optional.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 .../devicetree/bindings/media/i2c/ov7251.txt  |  52 ---------
 .../bindings/media/i2c/ovti,ov7251.yaml       | 105 ++++++++++++++++++
 2 files changed, 105 insertions(+), 52 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/media/i2c/ov7251.txt
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ovti,ov7251.yaml

diff --git a/Documentation/devicetree/bindings/media/i2c/ov7251.txt b/Documentation/devicetree/bindings/media/i2c/ov7251.txt
deleted file mode 100644
index 8281151f7493..000000000000
--- a/Documentation/devicetree/bindings/media/i2c/ov7251.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-* Omnivision 1/7.5-Inch B&W VGA CMOS Digital Image Sensor
-
-The Omnivision OV7251 is a 1/7.5-Inch CMOS active pixel digital image sensor
-with an active array size of 640H x 480V. It is programmable through a serial
-I2C interface.
-
-Required Properties:
-- compatible: Value should be "ovti,ov7251".
-- clocks: Reference to the xclk clock.
-- clock-names: Should be "xclk".
-- clock-frequency: Frequency of the xclk clock.
-- enable-gpios: Chip enable GPIO. Polarity is GPIO_ACTIVE_HIGH. This corresponds
-  to the hardware pin XSHUTDOWN which is physically active low.
-- vdddo-supply: Chip digital IO regulator.
-- vdda-supply: Chip analog regulator.
-- vddd-supply: Chip digital core regulator.
-
-The device node shall contain one 'port' child node with a single 'endpoint'
-subnode for its digital output video port, in accordance with the video
-interface bindings defined in
-Documentation/devicetree/bindings/media/video-interfaces.txt.
-
-Example:
-
-	&i2c1 {
-		...
-
-		ov7251: camera-sensor@60 {
-			compatible = "ovti,ov7251";
-			reg = <0x60>;
-
-			enable-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
-			pinctrl-names = "default";
-			pinctrl-0 = <&camera_bw_default>;
-
-			clocks = <&clks 200>;
-			clock-names = "xclk";
-			clock-frequency = <24000000>;
-
-			vdddo-supply = <&camera_dovdd_1v8>;
-			vdda-supply = <&camera_avdd_2v8>;
-			vddd-supply = <&camera_dvdd_1v2>;
-
-			port {
-				ov7251_ep: endpoint {
-					clock-lanes = <1>;
-					data-lanes = <0>;
-					remote-endpoint = <&csi0_ep>;
-				};
-			};
-		};
-	};
diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ov7251.yaml b/Documentation/devicetree/bindings/media/i2c/ovti,ov7251.yaml
new file mode 100644
index 000000000000..8d939858d950
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov7251.yaml
@@ -0,0 +1,105 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/i2c/ovti,ov7251.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: OmniVision OV7251 Image Sensor
+
+description:
+  The Omnivision OV7251 is a 1/7.5-Inch CMOS active pixel digital image sensor
+  with an active array size of 640H x 480V. It is programmable through a serial
+  I2C interface.
+
+maintainers:
+  - Todor Tomov <todor.too@gmail.com>
+
+properties:
+  compatible:
+    const: ovti,ov7251
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    description: XCLK Input Clock
+
+  clock-names:
+    const: xclk
+
+  clock-frequency:
+    description: Frequency of the xclk clock in Hz.
+
+  vdda-supply:
+    description: Analog voltage supply, 2.8 volts
+
+  vddd-supply:
+    description: Digital core voltage supply, 1.2 volts
+
+  vdddo-supply:
+    description: Digital I/O voltage supply, 1.8 volts
+
+  enable-gpios:
+    maxItems: 1
+    description:
+      Reference to the GPIO connected to the XSHUTDOWN pin, if any. Polarity
+      is GPIO_ACTIVE_HIGH.
+
+  port:
+    description: Digital Output Port
+    $ref: /schemas/graph.yaml#/$defs/port-base
+    additionalProperties: false
+
+    properties:
+      endpoint:
+        $ref: /schemas/media/video-interfaces.yaml#
+        unevaluatedProperties: false
+
+        properties:
+          clock-lanes:
+            maximum: 1
+
+          data-lanes:
+            maxItems: 1
+
+        required:
+          - data-lanes
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - vdddo-supply
+  - vdda-supply
+  - port
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        camera@3c {
+            compatible = "ovti,ov7251";
+            reg = <0x3c>;
+            clocks = <&clks 1>;
+            clock-frequency = <24000000>;
+            vdddo-supply = <&ov7251_vdddo_1v8>;
+            vdda-supply = <&ov7251_vdda_2v8>;
+            vddd-supply = <&ov7251_vddd_1v5>;
+            enable-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>;
+
+            port {
+                ov7251_ep: endpoint {
+                    remote-endpoint = <&csi0_ep>;
+                    clock-lanes = <1>;
+                    data-lanes = <0>;
+                };
+            };
+        };
+    };
+...
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] media: dt-bindings: Convert Omnivision OV7251 to DT schema
  2023-07-07 21:06 [PATCH] media: dt-bindings: Convert Omnivision OV7251 to DT schema Rob Herring
@ 2023-07-10 17:56 ` Conor Dooley
  2023-07-10 18:03   ` Rob Herring
  2023-07-31 11:29 ` Sakari Ailus
  1 sibling, 1 reply; 6+ messages in thread
From: Conor Dooley @ 2023-07-10 17:56 UTC (permalink / raw)
  To: Rob Herring
  Cc: Mauro Carvalho Chehab, Krzysztof Kozlowski, Conor Dooley,
	Todor Tomov, linux-media, devicetree, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 6331 bytes --]

On Fri, Jul 07, 2023 at 03:06:46PM -0600, Rob Herring wrote:
> Convert the OmniVision OV7251 Image Sensor binding to DT schema format.
> 
> vddd-supply was listed as required, but the example and actual user
> don't have it. Also, the data brief says it has an internal regulator,
> so perhaps it is truly optional.

ov7251.c:
	ov7251->core_regulator = devm_regulator_get(dev, "vddd");
	if (IS_ERR(ov7251->core_regulator)) {
		dev_err(dev, "cannot get core regulator\n");
		return PTR_ERR(ov7251->core_regulator);
	}

Looks like the driver's probe function disagrees?
I was going to ask how it worked, but the one user has
status = "disabled"...

/shrug, what's here looks fine to me, whatever Qualcomm person cares
about the driver can make sure it works for them I guess.

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  .../devicetree/bindings/media/i2c/ov7251.txt  |  52 ---------
>  .../bindings/media/i2c/ovti,ov7251.yaml       | 105 ++++++++++++++++++
>  2 files changed, 105 insertions(+), 52 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/media/i2c/ov7251.txt
>  create mode 100644 Documentation/devicetree/bindings/media/i2c/ovti,ov7251.yaml
> 
> diff --git a/Documentation/devicetree/bindings/media/i2c/ov7251.txt b/Documentation/devicetree/bindings/media/i2c/ov7251.txt
> deleted file mode 100644
> index 8281151f7493..000000000000
> --- a/Documentation/devicetree/bindings/media/i2c/ov7251.txt
> +++ /dev/null
> @@ -1,52 +0,0 @@
> -* Omnivision 1/7.5-Inch B&W VGA CMOS Digital Image Sensor
> -
> -The Omnivision OV7251 is a 1/7.5-Inch CMOS active pixel digital image sensor
> -with an active array size of 640H x 480V. It is programmable through a serial
> -I2C interface.
> -
> -Required Properties:
> -- compatible: Value should be "ovti,ov7251".
> -- clocks: Reference to the xclk clock.
> -- clock-names: Should be "xclk".
> -- clock-frequency: Frequency of the xclk clock.
> -- enable-gpios: Chip enable GPIO. Polarity is GPIO_ACTIVE_HIGH. This corresponds
> -  to the hardware pin XSHUTDOWN which is physically active low.
> -- vdddo-supply: Chip digital IO regulator.
> -- vdda-supply: Chip analog regulator.
> -- vddd-supply: Chip digital core regulator.
> -
> -The device node shall contain one 'port' child node with a single 'endpoint'
> -subnode for its digital output video port, in accordance with the video
> -interface bindings defined in
> -Documentation/devicetree/bindings/media/video-interfaces.txt.
> -
> -Example:
> -
> -	&i2c1 {
> -		...
> -
> -		ov7251: camera-sensor@60 {
> -			compatible = "ovti,ov7251";
> -			reg = <0x60>;
> -
> -			enable-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
> -			pinctrl-names = "default";
> -			pinctrl-0 = <&camera_bw_default>;
> -
> -			clocks = <&clks 200>;
> -			clock-names = "xclk";
> -			clock-frequency = <24000000>;
> -
> -			vdddo-supply = <&camera_dovdd_1v8>;
> -			vdda-supply = <&camera_avdd_2v8>;
> -			vddd-supply = <&camera_dvdd_1v2>;
> -
> -			port {
> -				ov7251_ep: endpoint {
> -					clock-lanes = <1>;
> -					data-lanes = <0>;
> -					remote-endpoint = <&csi0_ep>;
> -				};
> -			};
> -		};
> -	};
> diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ov7251.yaml b/Documentation/devicetree/bindings/media/i2c/ovti,ov7251.yaml
> new file mode 100644
> index 000000000000..8d939858d950
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov7251.yaml
> @@ -0,0 +1,105 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/media/i2c/ovti,ov7251.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: OmniVision OV7251 Image Sensor
> +
> +description:
> +  The Omnivision OV7251 is a 1/7.5-Inch CMOS active pixel digital image sensor
> +  with an active array size of 640H x 480V. It is programmable through a serial
> +  I2C interface.
> +
> +maintainers:
> +  - Todor Tomov <todor.too@gmail.com>
> +
> +properties:
> +  compatible:
> +    const: ovti,ov7251
> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    description: XCLK Input Clock
> +
> +  clock-names:
> +    const: xclk
> +
> +  clock-frequency:
> +    description: Frequency of the xclk clock in Hz.
> +
> +  vdda-supply:
> +    description: Analog voltage supply, 2.8 volts
> +
> +  vddd-supply:
> +    description: Digital core voltage supply, 1.2 volts
> +
> +  vdddo-supply:
> +    description: Digital I/O voltage supply, 1.8 volts
> +
> +  enable-gpios:
> +    maxItems: 1
> +    description:
> +      Reference to the GPIO connected to the XSHUTDOWN pin, if any. Polarity
> +      is GPIO_ACTIVE_HIGH.
> +
> +  port:
> +    description: Digital Output Port
> +    $ref: /schemas/graph.yaml#/$defs/port-base
> +    additionalProperties: false
> +
> +    properties:
> +      endpoint:
> +        $ref: /schemas/media/video-interfaces.yaml#
> +        unevaluatedProperties: false
> +
> +        properties:
> +          clock-lanes:
> +            maximum: 1
> +
> +          data-lanes:
> +            maxItems: 1
> +
> +        required:
> +          - data-lanes
> +
> +required:
> +  - compatible
> +  - reg
> +  - clocks
> +  - vdddo-supply
> +  - vdda-supply
> +  - port
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        camera@3c {
> +            compatible = "ovti,ov7251";
> +            reg = <0x3c>;
> +            clocks = <&clks 1>;
> +            clock-frequency = <24000000>;
> +            vdddo-supply = <&ov7251_vdddo_1v8>;
> +            vdda-supply = <&ov7251_vdda_2v8>;
> +            vddd-supply = <&ov7251_vddd_1v5>;
> +            enable-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>;
> +
> +            port {
> +                ov7251_ep: endpoint {
> +                    remote-endpoint = <&csi0_ep>;
> +                    clock-lanes = <1>;
> +                    data-lanes = <0>;
> +                };
> +            };
> +        };
> +    };
> +...
> -- 
> 2.40.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] media: dt-bindings: Convert Omnivision OV7251 to DT schema
  2023-07-10 17:56 ` Conor Dooley
@ 2023-07-10 18:03   ` Rob Herring
  2023-07-10 18:20     ` Conor Dooley
  0 siblings, 1 reply; 6+ messages in thread
From: Rob Herring @ 2023-07-10 18:03 UTC (permalink / raw)
  To: Conor Dooley
  Cc: Mauro Carvalho Chehab, Krzysztof Kozlowski, Conor Dooley,
	Todor Tomov, linux-media, devicetree, linux-kernel

On Mon, Jul 10, 2023 at 11:57 AM Conor Dooley <conor@kernel.org> wrote:
>
> On Fri, Jul 07, 2023 at 03:06:46PM -0600, Rob Herring wrote:
> > Convert the OmniVision OV7251 Image Sensor binding to DT schema format.
> >
> > vddd-supply was listed as required, but the example and actual user
> > don't have it. Also, the data brief says it has an internal regulator,
> > so perhaps it is truly optional.
>
> ov7251.c:
>         ov7251->core_regulator = devm_regulator_get(dev, "vddd");
>         if (IS_ERR(ov7251->core_regulator)) {
>                 dev_err(dev, "cannot get core regulator\n");
>                 return PTR_ERR(ov7251->core_regulator);
>         }
>
> Looks like the driver's probe function disagrees?

Doesn't the regulator framework return a dummy regulator if missing?

> I was going to ask how it worked, but the one user has
> status = "disabled"...

Saw that too, but figured there's some other include with that
overridden. We should really add a built .dts output target to avoid
trying to manually walk includes.


> /shrug, what's here looks fine to me, whatever Qualcomm person cares
> about the driver can make sure it works for them I guess.
>
> Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Thanks.

Rob

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] media: dt-bindings: Convert Omnivision OV7251 to DT schema
  2023-07-10 18:03   ` Rob Herring
@ 2023-07-10 18:20     ` Conor Dooley
  2023-07-11 14:09       ` Rob Herring
  0 siblings, 1 reply; 6+ messages in thread
From: Conor Dooley @ 2023-07-10 18:20 UTC (permalink / raw)
  To: Rob Herring
  Cc: Mauro Carvalho Chehab, Krzysztof Kozlowski, Conor Dooley,
	Todor Tomov, linux-media, devicetree, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1428 bytes --]

On Mon, Jul 10, 2023 at 12:03:38PM -0600, Rob Herring wrote:
> On Mon, Jul 10, 2023 at 11:57 AM Conor Dooley <conor@kernel.org> wrote:
> >
> > On Fri, Jul 07, 2023 at 03:06:46PM -0600, Rob Herring wrote:
> > > Convert the OmniVision OV7251 Image Sensor binding to DT schema format.
> > >
> > > vddd-supply was listed as required, but the example and actual user
> > > don't have it. Also, the data brief says it has an internal regulator,
> > > so perhaps it is truly optional.
> >
> > ov7251.c:
> >         ov7251->core_regulator = devm_regulator_get(dev, "vddd");
> >         if (IS_ERR(ov7251->core_regulator)) {
> >                 dev_err(dev, "cannot get core regulator\n");
> >                 return PTR_ERR(ov7251->core_regulator);
> >         }
> >
> > Looks like the driver's probe function disagrees?
> 
> Doesn't the regulator framework return a dummy regulator if missing?

Huh, I think I misunderstood how _regulator_get() worked. Apologies for
the noise, I thought it was returning an error when it used a dummy.

> > I was going to ask how it worked, but the one user has
> > status = "disabled"...
> 
> Saw that too, but figured there's some other include with that
> overridden. We should really add a built .dts output target to avoid
> trying to manually walk includes.

Probably gonna sound like an eejit, but the user is in a dts - can an
include overwrite that status?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] media: dt-bindings: Convert Omnivision OV7251 to DT schema
  2023-07-10 18:20     ` Conor Dooley
@ 2023-07-11 14:09       ` Rob Herring
  0 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2023-07-11 14:09 UTC (permalink / raw)
  To: Conor Dooley
  Cc: Mauro Carvalho Chehab, Krzysztof Kozlowski, Conor Dooley,
	Todor Tomov, linux-media, devicetree, linux-kernel

On Mon, Jul 10, 2023 at 12:20 PM Conor Dooley <conor@kernel.org> wrote:
>
> On Mon, Jul 10, 2023 at 12:03:38PM -0600, Rob Herring wrote:
> > On Mon, Jul 10, 2023 at 11:57 AM Conor Dooley <conor@kernel.org> wrote:
> > >
> > > On Fri, Jul 07, 2023 at 03:06:46PM -0600, Rob Herring wrote:
> > > > Convert the OmniVision OV7251 Image Sensor binding to DT schema format.
> > > >
> > > > vddd-supply was listed as required, but the example and actual user
> > > > don't have it. Also, the data brief says it has an internal regulator,
> > > > so perhaps it is truly optional.
> > >
> > > ov7251.c:
> > >         ov7251->core_regulator = devm_regulator_get(dev, "vddd");
> > >         if (IS_ERR(ov7251->core_regulator)) {
> > >                 dev_err(dev, "cannot get core regulator\n");
> > >                 return PTR_ERR(ov7251->core_regulator);
> > >         }
> > >
> > > Looks like the driver's probe function disagrees?
> >
> > Doesn't the regulator framework return a dummy regulator if missing?
>
> Huh, I think I misunderstood how _regulator_get() worked. Apologies for
> the noise, I thought it was returning an error when it used a dummy.
>
> > > I was going to ask how it worked, but the one user has
> > > status = "disabled"...
> >
> > Saw that too, but figured there's some other include with that
> > overridden. We should really add a built .dts output target to avoid
> > trying to manually walk includes.
>
> Probably gonna sound like an eejit, but the user is in a dts - can an
> include overwrite that status?

Yes, sometimes .dts files are both built into a dtb and included. Say
you have a board with and without an optional camera sensor.

Rob

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] media: dt-bindings: Convert Omnivision OV7251 to DT schema
  2023-07-07 21:06 [PATCH] media: dt-bindings: Convert Omnivision OV7251 to DT schema Rob Herring
  2023-07-10 17:56 ` Conor Dooley
@ 2023-07-31 11:29 ` Sakari Ailus
  1 sibling, 0 replies; 6+ messages in thread
From: Sakari Ailus @ 2023-07-31 11:29 UTC (permalink / raw)
  To: Rob Herring
  Cc: Mauro Carvalho Chehab, Krzysztof Kozlowski, Conor Dooley,
	Todor Tomov, linux-media, devicetree, linux-kernel

Hi Rob,

On Fri, Jul 07, 2023 at 03:06:46PM -0600, Rob Herring wrote:
> Convert the OmniVision OV7251 Image Sensor binding to DT schema format.
> 
> vddd-supply was listed as required, but the example and actual user
> don't have it. Also, the data brief says it has an internal regulator,
> so perhaps it is truly optional.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>

Same comment on this than the ov5693/5 bindings: we should have
link-frequency here. Although I guess it could be added by a separate
patch (I can write one if you like).

The driver already checks for this.

> ---
>  .../devicetree/bindings/media/i2c/ov7251.txt  |  52 ---------
>  .../bindings/media/i2c/ovti,ov7251.yaml       | 105 ++++++++++++++++++
>  2 files changed, 105 insertions(+), 52 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/media/i2c/ov7251.txt
>  create mode 100644 Documentation/devicetree/bindings/media/i2c/ovti,ov7251.yaml
> 
> diff --git a/Documentation/devicetree/bindings/media/i2c/ov7251.txt b/Documentation/devicetree/bindings/media/i2c/ov7251.txt
> deleted file mode 100644
> index 8281151f7493..000000000000
> --- a/Documentation/devicetree/bindings/media/i2c/ov7251.txt
> +++ /dev/null
> @@ -1,52 +0,0 @@
> -* Omnivision 1/7.5-Inch B&W VGA CMOS Digital Image Sensor
> -
> -The Omnivision OV7251 is a 1/7.5-Inch CMOS active pixel digital image sensor
> -with an active array size of 640H x 480V. It is programmable through a serial
> -I2C interface.
> -
> -Required Properties:
> -- compatible: Value should be "ovti,ov7251".
> -- clocks: Reference to the xclk clock.
> -- clock-names: Should be "xclk".
> -- clock-frequency: Frequency of the xclk clock.
> -- enable-gpios: Chip enable GPIO. Polarity is GPIO_ACTIVE_HIGH. This corresponds
> -  to the hardware pin XSHUTDOWN which is physically active low.
> -- vdddo-supply: Chip digital IO regulator.
> -- vdda-supply: Chip analog regulator.
> -- vddd-supply: Chip digital core regulator.
> -
> -The device node shall contain one 'port' child node with a single 'endpoint'
> -subnode for its digital output video port, in accordance with the video
> -interface bindings defined in
> -Documentation/devicetree/bindings/media/video-interfaces.txt.
> -
> -Example:
> -
> -	&i2c1 {
> -		...
> -
> -		ov7251: camera-sensor@60 {
> -			compatible = "ovti,ov7251";
> -			reg = <0x60>;
> -
> -			enable-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
> -			pinctrl-names = "default";
> -			pinctrl-0 = <&camera_bw_default>;
> -
> -			clocks = <&clks 200>;
> -			clock-names = "xclk";
> -			clock-frequency = <24000000>;
> -
> -			vdddo-supply = <&camera_dovdd_1v8>;
> -			vdda-supply = <&camera_avdd_2v8>;
> -			vddd-supply = <&camera_dvdd_1v2>;
> -
> -			port {
> -				ov7251_ep: endpoint {
> -					clock-lanes = <1>;
> -					data-lanes = <0>;
> -					remote-endpoint = <&csi0_ep>;
> -				};
> -			};
> -		};
> -	};
> diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ov7251.yaml b/Documentation/devicetree/bindings/media/i2c/ovti,ov7251.yaml
> new file mode 100644
> index 000000000000..8d939858d950
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov7251.yaml
> @@ -0,0 +1,105 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/media/i2c/ovti,ov7251.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: OmniVision OV7251 Image Sensor
> +
> +description:
> +  The Omnivision OV7251 is a 1/7.5-Inch CMOS active pixel digital image sensor
> +  with an active array size of 640H x 480V. It is programmable through a serial
> +  I2C interface.
> +
> +maintainers:
> +  - Todor Tomov <todor.too@gmail.com>
> +
> +properties:
> +  compatible:
> +    const: ovti,ov7251
> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    description: XCLK Input Clock
> +
> +  clock-names:
> +    const: xclk
> +
> +  clock-frequency:
> +    description: Frequency of the xclk clock in Hz.
> +
> +  vdda-supply:
> +    description: Analog voltage supply, 2.8 volts
> +
> +  vddd-supply:
> +    description: Digital core voltage supply, 1.2 volts
> +
> +  vdddo-supply:
> +    description: Digital I/O voltage supply, 1.8 volts
> +
> +  enable-gpios:
> +    maxItems: 1
> +    description:
> +      Reference to the GPIO connected to the XSHUTDOWN pin, if any. Polarity
> +      is GPIO_ACTIVE_HIGH.
> +
> +  port:
> +    description: Digital Output Port
> +    $ref: /schemas/graph.yaml#/$defs/port-base
> +    additionalProperties: false
> +
> +    properties:
> +      endpoint:
> +        $ref: /schemas/media/video-interfaces.yaml#
> +        unevaluatedProperties: false
> +
> +        properties:
> +          clock-lanes:
> +            maximum: 1
> +
> +          data-lanes:
> +            maxItems: 1
> +
> +        required:
> +          - data-lanes
> +
> +required:
> +  - compatible
> +  - reg
> +  - clocks
> +  - vdddo-supply
> +  - vdda-supply
> +  - port
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        camera@3c {
> +            compatible = "ovti,ov7251";
> +            reg = <0x3c>;
> +            clocks = <&clks 1>;
> +            clock-frequency = <24000000>;
> +            vdddo-supply = <&ov7251_vdddo_1v8>;
> +            vdda-supply = <&ov7251_vdda_2v8>;
> +            vddd-supply = <&ov7251_vddd_1v5>;
> +            enable-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>;
> +
> +            port {
> +                ov7251_ep: endpoint {
> +                    remote-endpoint = <&csi0_ep>;
> +                    clock-lanes = <1>;
> +                    data-lanes = <0>;
> +                };
> +            };
> +        };
> +    };
> +...
> -- 
> 2.40.1
> 

-- 
Kind regards,

Sakari Ailus

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-07-31 11:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-07 21:06 [PATCH] media: dt-bindings: Convert Omnivision OV7251 to DT schema Rob Herring
2023-07-10 17:56 ` Conor Dooley
2023-07-10 18:03   ` Rob Herring
2023-07-10 18:20     ` Conor Dooley
2023-07-11 14:09       ` Rob Herring
2023-07-31 11:29 ` Sakari Ailus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).