diff mbox series

[v2,1/3] dt-bindings: media: ov5647: Convert to json-schema

Message ID 20200714142856.58365-2-jacopo+renesas@jmondi.org (mailing list archive)
State Superseded
Headers show
Series dt-bidings: media: ov5647 bindings + small fix | expand

Commit Message

Jacopo Mondi July 14, 2020, 2:28 p.m. UTC
Convert the ov5647 image sensor bindings to DT schema and add
the file entry to MAINTAINERS.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 .../devicetree/bindings/media/i2c/ov5647.txt  | 35 --------
 .../devicetree/bindings/media/i2c/ov5647.yaml | 82 +++++++++++++++++++
 MAINTAINERS                                   |  1 +
 3 files changed, 83 insertions(+), 35 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/media/i2c/ov5647.txt
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ov5647.yaml

Comments

Laurent Pinchart July 14, 2020, 11:44 p.m. UTC | #1
Hi Jacopo,

Thank you for the patch.

On Tue, Jul 14, 2020 at 04:28:54PM +0200, Jacopo Mondi wrote:
> Convert the ov5647 image sensor bindings to DT schema and add
> the file entry to MAINTAINERS.
> 
> Reviewed-by: Rob Herring <robh@kernel.org>
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
> ---
>  .../devicetree/bindings/media/i2c/ov5647.txt  | 35 --------
>  .../devicetree/bindings/media/i2c/ov5647.yaml | 82 +++++++++++++++++++
>  MAINTAINERS                                   |  1 +
>  3 files changed, 83 insertions(+), 35 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/media/i2c/ov5647.txt
>  create mode 100644 Documentation/devicetree/bindings/media/i2c/ov5647.yaml
> 
> diff --git a/Documentation/devicetree/bindings/media/i2c/ov5647.txt b/Documentation/devicetree/bindings/media/i2c/ov5647.txt
> deleted file mode 100644
> index 22e44945b661..000000000000
> --- a/Documentation/devicetree/bindings/media/i2c/ov5647.txt
> +++ /dev/null
> @@ -1,35 +0,0 @@
> -Omnivision OV5647 raw image sensor
> ----------------------------------
> -
> -OV5647 is a raw image sensor with MIPI CSI-2 and CCP2 image data interfaces
> -and CCI (I2C compatible) control bus.
> -
> -Required properties:
> -
> -- compatible		: "ovti,ov5647".
> -- reg			: I2C slave address of the sensor.
> -- clocks		: Reference to the xclk clock.
> -
> -The common video interfaces bindings (see video-interfaces.txt) should be
> -used to specify link to the image data receiver. The OV5647 device
> -node should contain one 'port' child node with an 'endpoint' subnode.
> -
> -Endpoint node mandatory properties:
> -
> -- remote-endpoint: A phandle to the bus receiver's endpoint node.
> -
> -Example:
> -
> -	i2c@2000 {
> -		...
> -		ov: camera@36 {
> -			compatible = "ovti,ov5647";
> -			reg = <0x36>;
> -			clocks = <&camera_clk>;
> -			port {
> -				camera_1: endpoint {
> -					remote-endpoint = <&csi1_ep1>;
> -				};
> -			};
> -		};
> -	};
> diff --git a/Documentation/devicetree/bindings/media/i2c/ov5647.yaml b/Documentation/devicetree/bindings/media/i2c/ov5647.yaml
> new file mode 100644
> index 000000000000..067e222e0c7c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/i2c/ov5647.yaml
> @@ -0,0 +1,82 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/media/i2c/ov5647.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Omnivision OV5647 raw image sensor
> +
> +maintainers:
> +  - Dave Stevenson <dave.stevenson@raspberrypi.com>
> +
> +description: |-
> +  OV5647 is a raw image sensor with MIPI CSI-2 and CCP2 image data interfaces
> +  and CCI (I2C compatible) control bus.
> +
> +properties:
> +  compatible:
> +    const: ovti,ov5647
> +
> +  reg:
> +    description: I2C device address
> +    maxItems: 1
> +
> +  clocks:
> +    description: Reference to the xclk clock
> +    maxItems: 1
> +
> +  port:
> +    type: object
> +    description: |-
> +      Should contain one endpoint sub-node used to model connection to the
> +      video receiver according to the specification defined in
> +      Documentation/devicetree/bindings/media/video-interfaces.txt
> +
> +    properties:
> +      endpoint:
> +        type: object
> +
> +        properties:
> +          remote-endpoint:
> +            description: |-
> +              phandle to the video receiver input port
> +
> +        required:
> +          - remote-endpoint
> +
> +        additionalProperties: false
> +
> +    required:
> +      - endpoint

We usually make it valid for a port to contain no endpoint. This can be
used, for instance, to create a base DT that doesn't describe the
connections, where an overlay will then wire the components together.
I'd thus drop the required property here. Apart from that,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> +
> +    additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - clocks
> +  - port
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        ov5647: camera@36 {
> +            compatible = "ovti,ov5647";
> +            reg = <0x36>;
> +            clocks = <&camera_clk>;
> +
> +            port {
> +                camera_out: endpoint {
> +                    remote-endpoint = <&csi1_ep1>;
> +                };
> +            };
> +        };
> +    };
> +
> +...
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 2730af1265ea..1742fa1a88cd 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -12612,6 +12612,7 @@ L:	linux-media@vger.kernel.org
>  S:	Maintained
>  T:	git git://linuxtv.org/media_tree.git
>  F:	drivers/media/i2c/ov5647.c
> +F:	Documentation/devicetree/bindings/media/i2c/ov5647.yaml
>  
>  OMNIVISION OV5670 SENSOR DRIVER
>  M:	Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/media/i2c/ov5647.txt b/Documentation/devicetree/bindings/media/i2c/ov5647.txt
deleted file mode 100644
index 22e44945b661..000000000000
--- a/Documentation/devicetree/bindings/media/i2c/ov5647.txt
+++ /dev/null
@@ -1,35 +0,0 @@ 
-Omnivision OV5647 raw image sensor
----------------------------------
-
-OV5647 is a raw image sensor with MIPI CSI-2 and CCP2 image data interfaces
-and CCI (I2C compatible) control bus.
-
-Required properties:
-
-- compatible		: "ovti,ov5647".
-- reg			: I2C slave address of the sensor.
-- clocks		: Reference to the xclk clock.
-
-The common video interfaces bindings (see video-interfaces.txt) should be
-used to specify link to the image data receiver. The OV5647 device
-node should contain one 'port' child node with an 'endpoint' subnode.
-
-Endpoint node mandatory properties:
-
-- remote-endpoint: A phandle to the bus receiver's endpoint node.
-
-Example:
-
-	i2c@2000 {
-		...
-		ov: camera@36 {
-			compatible = "ovti,ov5647";
-			reg = <0x36>;
-			clocks = <&camera_clk>;
-			port {
-				camera_1: endpoint {
-					remote-endpoint = <&csi1_ep1>;
-				};
-			};
-		};
-	};
diff --git a/Documentation/devicetree/bindings/media/i2c/ov5647.yaml b/Documentation/devicetree/bindings/media/i2c/ov5647.yaml
new file mode 100644
index 000000000000..067e222e0c7c
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/ov5647.yaml
@@ -0,0 +1,82 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/i2c/ov5647.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Omnivision OV5647 raw image sensor
+
+maintainers:
+  - Dave Stevenson <dave.stevenson@raspberrypi.com>
+
+description: |-
+  OV5647 is a raw image sensor with MIPI CSI-2 and CCP2 image data interfaces
+  and CCI (I2C compatible) control bus.
+
+properties:
+  compatible:
+    const: ovti,ov5647
+
+  reg:
+    description: I2C device address
+    maxItems: 1
+
+  clocks:
+    description: Reference to the xclk clock
+    maxItems: 1
+
+  port:
+    type: object
+    description: |-
+      Should contain one endpoint sub-node used to model connection to the
+      video receiver according to the specification defined in
+      Documentation/devicetree/bindings/media/video-interfaces.txt
+
+    properties:
+      endpoint:
+        type: object
+
+        properties:
+          remote-endpoint:
+            description: |-
+              phandle to the video receiver input port
+
+        required:
+          - remote-endpoint
+
+        additionalProperties: false
+
+    required:
+      - endpoint
+
+    additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - port
+
+additionalProperties: false
+
+examples:
+  - |
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        ov5647: camera@36 {
+            compatible = "ovti,ov5647";
+            reg = <0x36>;
+            clocks = <&camera_clk>;
+
+            port {
+                camera_out: endpoint {
+                    remote-endpoint = <&csi1_ep1>;
+                };
+            };
+        };
+    };
+
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index 2730af1265ea..1742fa1a88cd 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -12612,6 +12612,7 @@  L:	linux-media@vger.kernel.org
 S:	Maintained
 T:	git git://linuxtv.org/media_tree.git
 F:	drivers/media/i2c/ov5647.c
+F:	Documentation/devicetree/bindings/media/i2c/ov5647.yaml
 
 OMNIVISION OV5670 SENSOR DRIVER
 M:	Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>