mbox series

[v4,0/3] dt-bindings: media: ov772x: Convert to json-schema

Message ID 20200903131029.18334-1-jacopo+renesas@jmondi.org
Headers show
Series dt-bindings: media: ov772x: Convert to json-schema | expand

Message

Jacopo Mondi Sept. 3, 2020, 1:10 p.m. UTC
Convert the ov722x bindings to json-schema and add endpoint properties and
bus-type.

Compared to v3 in 1/3 I have not documented 'endpoint'
Then 2/3 introduces the 'bus-type' endpoint properties, so I had to document
'endpoint' and list 'remote-endpoint' as required (which makes me think I
could have kept it in 1/3, but for sake of consistency...)
3/3 adds endpoint properties, whose presence is conditional to the specified
bus-type.

Thanks
  j

Jacopo Mondi (3):
  dt-bindings: media: ov772x: Convert to json-schema
  dt-bindings: media: ov772x: Make bus-type mandatory
  dt-bindings: media: ov772x: Document endpoint props

 .../devicetree/bindings/media/i2c/ov772x.txt  |  40 -----
 .../bindings/media/i2c/ovti,ov772x.yaml       | 138 ++++++++++++++++++
 MAINTAINERS                                   |   2 +-
 3 files changed, 139 insertions(+), 41 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/media/i2c/ov772x.txt
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ovti,ov772x.yaml

--
2.28.0

Comments

Jacopo Mondi Sept. 4, 2020, 8:05 a.m. UTC | #1
Hi Laurent,

On Thu, Sep 03, 2020 at 03:10:28PM +0200, Jacopo Mondi wrote:
> In order to establish required properties based on the selected
> bus type, make the 'bus-type' property mandatory. As this change
> documents an endpoint property, also document the 'remote-endpoint'
> one now that the 'endpoint' schema has been expanded.
>
> Binary compatibility with existing DTB is kept as the driver does not
> enforce the property to be present, and shall fall-back to default
> parallel bus configuration, which was the only supported bus type, if
> the property is not specified.
>
> Reviewed-by: Rob Herring <robh@kernel.org>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> ---
>  .../bindings/media/i2c/ovti,ov772x.yaml       | 20 +++++++++++++++++++
>  1 file changed, 20 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ov772x.yaml b/Documentation/devicetree/bindings/media/i2c/ovti,ov772x.yaml
> index e7e2d31fcc23..406e9cd463a2 100644
> --- a/Documentation/devicetree/bindings/media/i2c/ovti,ov772x.yaml
> +++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov772x.yaml
> @@ -41,6 +41,25 @@ properties:
>      description: |
>        Video output port. See ../video-interfaces.txt.
>
> +    properties:
> +      endpoint:
> +        type: object
> +
> +        properties:
> +          remote-endpoint:
> +            description: See ../video-interfaces.txt

So I guess the same as you suggested for imx214 applies here (drop
remote-endpoint)

> +
> +          bus-type:
> +            enum: [5, 6]
> +
> +        required:
> +          - remote-endpoint
> +          - bus-type
> +
> +        additionalProperties: false
> +
> +    additionalProperties: false
> +
>  required:
>    - compatible
>    - reg
> @@ -65,6 +84,7 @@ examples:
>
>              port {
>                  ov772x_0: endpoint {
> +                    bus-type = <5>;
>                      remote-endpoint = <&vcap1_in0>;
>                  };
>              };
> --
> 2.28.0
>
Laurent Pinchart Sept. 4, 2020, 3:06 p.m. UTC | #2
Hi Jacopo,

On Fri, Sep 04, 2020 at 10:05:35AM +0200, Jacopo Mondi wrote:
> On Thu, Sep 03, 2020 at 03:10:28PM +0200, Jacopo Mondi wrote:
> > In order to establish required properties based on the selected
> > bus type, make the 'bus-type' property mandatory. As this change
> > documents an endpoint property, also document the 'remote-endpoint'
> > one now that the 'endpoint' schema has been expanded.
> >
> > Binary compatibility with existing DTB is kept as the driver does not
> > enforce the property to be present, and shall fall-back to default
> > parallel bus configuration, which was the only supported bus type, if
> > the property is not specified.
> >
> > Reviewed-by: Rob Herring <robh@kernel.org>
> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> > ---
> >  .../bindings/media/i2c/ovti,ov772x.yaml       | 20 +++++++++++++++++++
> >  1 file changed, 20 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ov772x.yaml b/Documentation/devicetree/bindings/media/i2c/ovti,ov772x.yaml
> > index e7e2d31fcc23..406e9cd463a2 100644
> > --- a/Documentation/devicetree/bindings/media/i2c/ovti,ov772x.yaml
> > +++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov772x.yaml
> > @@ -41,6 +41,25 @@ properties:
> >      description: |
> >        Video output port. See ../video-interfaces.txt.
> >
> > +    properties:
> > +      endpoint:
> > +        type: object
> > +
> > +        properties:
> > +          remote-endpoint:
> > +            description: See ../video-interfaces.txt
> 
> So I guess the same as you suggested for imx214 applies here (drop
> remote-endpoint)

Correct. And you should then replace additionalProperties: false with
unevaluatedProperties: false.

> > +
> > +          bus-type:
> > +            enum: [5, 6]
> > +
> > +        required:
> > +          - remote-endpoint
> > +          - bus-type
> > +
> > +        additionalProperties: false
> > +
> > +    additionalProperties: false
> > +
> >  required:
> >    - compatible
> >    - reg
> > @@ -65,6 +84,7 @@ examples:
> >
> >              port {
> >                  ov772x_0: endpoint {
> > +                    bus-type = <5>;
> >                      remote-endpoint = <&vcap1_in0>;
> >                  };
> >              };