diff mbox series

[3/3] dt-bindings: media: ov772x: Document endpoint props

Message ID 20200818122012.37956-4-jacopo+renesas@jmondi.org (mailing list archive)
State New
Delegated to: Kieran Bingham
Headers show
Series dt-bindings: media: ov772x: Convert to json-schama | expand

Commit Message

Jacopo Mondi Aug. 18, 2020, 12:20 p.m. UTC
Document endpoint properties for the parallel bus type and
add them to the example.

Specify a few constraints:
- If the bus type is BT.656 no hsync or vsycn polarities can be
  specified.
- If the bus width is 10 bits, not data-shift can be applied.

Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
---
 .../devicetree/bindings/media/i2c/ov772x.yaml | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)

--
2.27.0

Comments

Laurent Pinchart Aug. 19, 2020, 1:54 p.m. UTC | #1
Hi Jacopo,

Thank you for the patch.

On Tue, Aug 18, 2020 at 02:20:12PM +0200, Jacopo Mondi wrote:
> Document endpoint properties for the parallel bus type and
> add them to the example.
> 
> Specify a few constraints:
> - If the bus type is BT.656 no hsync or vsycn polarities can be
>   specified.
> - If the bus width is 10 bits, not data-shift can be applied.
> 
> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> ---
>  .../devicetree/bindings/media/i2c/ov772x.yaml | 43 +++++++++++++++++++
>  1 file changed, 43 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/media/i2c/ov772x.yaml b/Documentation/devicetree/bindings/media/i2c/ov772x.yaml
> index 75dad40f70cc..3fad5dffd19a 100644
> --- a/Documentation/devicetree/bindings/media/i2c/ov772x.yaml
> +++ b/Documentation/devicetree/bindings/media/i2c/ov772x.yaml
> @@ -50,9 +50,47 @@ properties:
>            bus-type:
>              enum: [5, 6]
> 
> +          bus-width:
> +            enum: [8, 10]
> +            default: 10
> +
> +          data-shift:
> +            enum: [0, 2]
> +            default: 0
> +
> +          hsync-active:
> +            enum: [0, 1]
> +            default: 1
> +
> +          vsync-active:
> +            enum: [0, 1]
> +            default: 1
> +
> +          pclk-sample:
> +            enum: [0, 1]
> +            default: 1
> +
>            remote-endpoint:
>              description: A phandle to the bus receiver's endpoint node.
> 
> +        allOf:
> +          - if:
> +              properties:
> +                bus-type:
> +                  const: 6
> +            then:
> +                properties:
> +                  hsync-active: false
> +                  vsync-active: false
> +
> +          - if:
> +              properties:
> +                bus-width:
> +                  const: 10
> +            then:
> +                properties:
> +                  data-shift:
> +                    const: 0

I'd add a blank line here.

>          required:
>            - bus-type

Should some of the properties be required ? Possibly conditioned on
bus-type ?

> 
> @@ -82,6 +120,11 @@ examples:
>              port {
>                  ov772x_0: endpoint {
>                      bus-type = <5>;
> +                    vsync-active = <0>;
> +                    hsync-active = <0>;
> +                    pclk-sample = <0>;
> +                    bus-width = <8>;
> +                    data-shift = <0>;
>                      remote-endpoint = <&vcap1_in0>;
>                  };
>              };
Lad, Prabhakar Aug. 21, 2020, 11:37 a.m. UTC | #2
Hi Laurent and Jacopo

On Wed, Aug 19, 2020 at 2:54 PM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hi Jacopo,
>
> Thank you for the patch.
>
> On Tue, Aug 18, 2020 at 02:20:12PM +0200, Jacopo Mondi wrote:
> > Document endpoint properties for the parallel bus type and
> > add them to the example.
> >
> > Specify a few constraints:
> > - If the bus type is BT.656 no hsync or vsycn polarities can be
> >   specified.
> > - If the bus width is 10 bits, not data-shift can be applied.
> >
> > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> > ---
> >  .../devicetree/bindings/media/i2c/ov772x.yaml | 43 +++++++++++++++++++
> >  1 file changed, 43 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/media/i2c/ov772x.yaml b/Documentation/devicetree/bindings/media/i2c/ov772x.yaml
> > index 75dad40f70cc..3fad5dffd19a 100644
> > --- a/Documentation/devicetree/bindings/media/i2c/ov772x.yaml
> > +++ b/Documentation/devicetree/bindings/media/i2c/ov772x.yaml
> > @@ -50,9 +50,47 @@ properties:
> >            bus-type:
> >              enum: [5, 6]
> >
> > +          bus-width:
> > +            enum: [8, 10]
> > +            default: 10
> > +
> > +          data-shift:
> > +            enum: [0, 2]
> > +            default: 0
> > +
> > +          hsync-active:
> > +            enum: [0, 1]
> > +            default: 1
> > +
> > +          vsync-active:
> > +            enum: [0, 1]
> > +            default: 1
> > +
> > +          pclk-sample:
> > +            enum: [0, 1]
> > +            default: 1
> > +
> >            remote-endpoint:
> >              description: A phandle to the bus receiver's endpoint node.
> >
> > +        allOf:
> > +          - if:
> > +              properties:
> > +                bus-type:
> > +                  const: 6
> > +            then:
> > +                properties:
> > +                  hsync-active: false
> > +                  vsync-active: false
> > +
> > +          - if:
> > +              properties:
> > +                bus-width:
> > +                  const: 10
> > +            then:
> > +                properties:
> > +                  data-shift:
> > +                    const: 0
>
> I'd add a blank line here.
>
> >          required:
> >            - bus-type
>
> Should some of the properties be required ? Possibly conditioned on
> bus-type ?
>
Agreed, would be interesting to know how this can be handled (split
out bus-type and add required properties for each) ?

Cheers,
Prabhakar

> >
> > @@ -82,6 +120,11 @@ examples:
> >              port {
> >                  ov772x_0: endpoint {
> >                      bus-type = <5>;
> > +                    vsync-active = <0>;
> > +                    hsync-active = <0>;
> > +                    pclk-sample = <0>;
> > +                    bus-width = <8>;
> > +                    data-shift = <0>;
> >                      remote-endpoint = <&vcap1_in0>;
> >                  };
> >              };
>
> --
> Regards,
>
> Laurent Pinchart
Laurent Pinchart Aug. 22, 2020, 1:35 a.m. UTC | #3
Hi Prabhakar,

On Fri, Aug 21, 2020 at 12:37:35PM +0100, Lad, Prabhakar wrote:
> On Wed, Aug 19, 2020 at 2:54 PM Laurent Pinchart wrote:
> > On Tue, Aug 18, 2020 at 02:20:12PM +0200, Jacopo Mondi wrote:
> > > Document endpoint properties for the parallel bus type and
> > > add them to the example.
> > >
> > > Specify a few constraints:
> > > - If the bus type is BT.656 no hsync or vsycn polarities can be
> > >   specified.
> > > - If the bus width is 10 bits, not data-shift can be applied.
> > >
> > > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> > > ---
> > >  .../devicetree/bindings/media/i2c/ov772x.yaml | 43 +++++++++++++++++++
> > >  1 file changed, 43 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/media/i2c/ov772x.yaml b/Documentation/devicetree/bindings/media/i2c/ov772x.yaml
> > > index 75dad40f70cc..3fad5dffd19a 100644
> > > --- a/Documentation/devicetree/bindings/media/i2c/ov772x.yaml
> > > +++ b/Documentation/devicetree/bindings/media/i2c/ov772x.yaml
> > > @@ -50,9 +50,47 @@ properties:
> > >            bus-type:
> > >              enum: [5, 6]
> > >
> > > +          bus-width:
> > > +            enum: [8, 10]
> > > +            default: 10
> > > +
> > > +          data-shift:
> > > +            enum: [0, 2]
> > > +            default: 0
> > > +
> > > +          hsync-active:
> > > +            enum: [0, 1]
> > > +            default: 1
> > > +
> > > +          vsync-active:
> > > +            enum: [0, 1]
> > > +            default: 1
> > > +
> > > +          pclk-sample:
> > > +            enum: [0, 1]
> > > +            default: 1
> > > +
> > >            remote-endpoint:
> > >              description: A phandle to the bus receiver's endpoint node.
> > >
> > > +        allOf:
> > > +          - if:
> > > +              properties:
> > > +                bus-type:
> > > +                  const: 6
> > > +            then:
> > > +                properties:
> > > +                  hsync-active: false
> > > +                  vsync-active: false
> > > +
> > > +          - if:
> > > +              properties:
> > > +                bus-width:
> > > +                  const: 10
> > > +            then:
> > > +                properties:
> > > +                  data-shift:
> > > +                    const: 0
> >
> > I'd add a blank line here.
> >
> > >          required:
> > >            - bus-type
> >
> > Should some of the properties be required ? Possibly conditioned on
> > bus-type ?
>
> Agreed, would be interesting to know how this can be handled (split
> out bus-type and add required properties for each) ?

We can add required: statements to the above if/then/else.

> > > @@ -82,6 +120,11 @@ examples:
> > >              port {
> > >                  ov772x_0: endpoint {
> > >                      bus-type = <5>;
> > > +                    vsync-active = <0>;
> > > +                    hsync-active = <0>;
> > > +                    pclk-sample = <0>;
> > > +                    bus-width = <8>;
> > > +                    data-shift = <0>;
> > >                      remote-endpoint = <&vcap1_in0>;
> > >                  };
> > >              };
Jacopo Mondi Aug. 24, 2020, 8:35 a.m. UTC | #4
Hi Laurent, Prabhakar,

On Fri, Aug 21, 2020 at 12:37:35PM +0100, Lad, Prabhakar wrote:
> Hi Laurent and Jacopo
>
> On Wed, Aug 19, 2020 at 2:54 PM Laurent Pinchart
> <laurent.pinchart@ideasonboard.com> wrote:
> >
> > Hi Jacopo,
> >
> > Thank you for the patch.
> >
> > On Tue, Aug 18, 2020 at 02:20:12PM +0200, Jacopo Mondi wrote:
> > > Document endpoint properties for the parallel bus type and
> > > add them to the example.
> > >
> > > Specify a few constraints:
> > > - If the bus type is BT.656 no hsync or vsycn polarities can be
> > >   specified.
> > > - If the bus width is 10 bits, not data-shift can be applied.
> > >
> > > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> > > ---
> > >  .../devicetree/bindings/media/i2c/ov772x.yaml | 43 +++++++++++++++++++
> > >  1 file changed, 43 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/media/i2c/ov772x.yaml b/Documentation/devicetree/bindings/media/i2c/ov772x.yaml
> > > index 75dad40f70cc..3fad5dffd19a 100644
> > > --- a/Documentation/devicetree/bindings/media/i2c/ov772x.yaml
> > > +++ b/Documentation/devicetree/bindings/media/i2c/ov772x.yaml
> > > @@ -50,9 +50,47 @@ properties:
> > >            bus-type:
> > >              enum: [5, 6]
> > >
> > > +          bus-width:
> > > +            enum: [8, 10]
> > > +            default: 10
> > > +
> > > +          data-shift:
> > > +            enum: [0, 2]
> > > +            default: 0
> > > +
> > > +          hsync-active:
> > > +            enum: [0, 1]
> > > +            default: 1
> > > +
> > > +          vsync-active:
> > > +            enum: [0, 1]
> > > +            default: 1
> > > +
> > > +          pclk-sample:
> > > +            enum: [0, 1]
> > > +            default: 1
> > > +
> > >            remote-endpoint:
> > >              description: A phandle to the bus receiver's endpoint node.
> > >
> > > +        allOf:
> > > +          - if:
> > > +              properties:
> > > +                bus-type:
> > > +                  const: 6
> > > +            then:
> > > +                properties:
> > > +                  hsync-active: false
> > > +                  vsync-active: false
> > > +
> > > +          - if:
> > > +              properties:
> > > +                bus-width:
> > > +                  const: 10
> > > +            then:
> > > +                properties:
> > > +                  data-shift:
> > > +                    const: 0
> >
> > I'd add a blank line here.
> >
> > >          required:
> > >            - bus-type
> >
> > Should some of the properties be required ? Possibly conditioned on
> > bus-type ?
> >

I am not sure. They all have defaults, as reported here and as
supported by the driver. There's nothing -strictly- required, as long
as the here reported defaults are correct.

> Agreed, would be interesting to know how this can be handled (split
> out bus-type and add required properties for each) ?
>

That already happens with

+          - if:
+              properties:
+                bus-type:
+                  const: 6
+            then:
+                properties:
+                  hsync-active: false
+                  vsync-active: false

And could be expanded, if we want any of these to be required.

Thanks
  j

> Cheers,
> Prabhakar
>
> > >
> > > @@ -82,6 +120,11 @@ examples:
> > >              port {
> > >                  ov772x_0: endpoint {
> > >                      bus-type = <5>;
> > > +                    vsync-active = <0>;
> > > +                    hsync-active = <0>;
> > > +                    pclk-sample = <0>;
> > > +                    bus-width = <8>;
> > > +                    data-shift = <0>;
> > >                      remote-endpoint = <&vcap1_in0>;
> > >                  };
> > >              };
> >
> > --
> > Regards,
> >
> > Laurent Pinchart
Lad, Prabhakar Aug. 26, 2020, 8:42 a.m. UTC | #5
Hi Laurent,

On Sat, Aug 22, 2020 at 2:36 AM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hi Prabhakar,
>
> On Fri, Aug 21, 2020 at 12:37:35PM +0100, Lad, Prabhakar wrote:
> > On Wed, Aug 19, 2020 at 2:54 PM Laurent Pinchart wrote:
> > > On Tue, Aug 18, 2020 at 02:20:12PM +0200, Jacopo Mondi wrote:
> > > > Document endpoint properties for the parallel bus type and
> > > > add them to the example.
> > > >
> > > > Specify a few constraints:
> > > > - If the bus type is BT.656 no hsync or vsycn polarities can be
> > > >   specified.
> > > > - If the bus width is 10 bits, not data-shift can be applied.
> > > >
> > > > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> > > > ---
> > > >  .../devicetree/bindings/media/i2c/ov772x.yaml | 43 +++++++++++++++++++
> > > >  1 file changed, 43 insertions(+)
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/media/i2c/ov772x.yaml b/Documentation/devicetree/bindings/media/i2c/ov772x.yaml
> > > > index 75dad40f70cc..3fad5dffd19a 100644
> > > > --- a/Documentation/devicetree/bindings/media/i2c/ov772x.yaml
> > > > +++ b/Documentation/devicetree/bindings/media/i2c/ov772x.yaml
> > > > @@ -50,9 +50,47 @@ properties:
> > > >            bus-type:
> > > >              enum: [5, 6]
> > > >
> > > > +          bus-width:
> > > > +            enum: [8, 10]
> > > > +            default: 10
> > > > +
> > > > +          data-shift:
> > > > +            enum: [0, 2]
> > > > +            default: 0
> > > > +
> > > > +          hsync-active:
> > > > +            enum: [0, 1]
> > > > +            default: 1
> > > > +
> > > > +          vsync-active:
> > > > +            enum: [0, 1]
> > > > +            default: 1
> > > > +
> > > > +          pclk-sample:
> > > > +            enum: [0, 1]
> > > > +            default: 1
> > > > +
> > > >            remote-endpoint:
> > > >              description: A phandle to the bus receiver's endpoint node.
> > > >
> > > > +        allOf:
> > > > +          - if:
> > > > +              properties:
> > > > +                bus-type:
> > > > +                  const: 6
> > > > +            then:
> > > > +                properties:
> > > > +                  hsync-active: false
> > > > +                  vsync-active: false
> > > > +
> > > > +          - if:
> > > > +              properties:
> > > > +                bus-width:
> > > > +                  const: 10
> > > > +            then:
> > > > +                properties:
> > > > +                  data-shift:
> > > > +                    const: 0
> > >
> > > I'd add a blank line here.
> > >
> > > >          required:
> > > >            - bus-type
> > >
> > > Should some of the properties be required ? Possibly conditioned on
> > > bus-type ?
> >
> > Agreed, would be interesting to know how this can be handled (split
> > out bus-type and add required properties for each) ?
>
> We can add required: statements to the above if/then/else.
>
Aha thanks for pointing out. (I hadn't come across such cases)

Cheers,
Prabhakar
Lad, Prabhakar Aug. 26, 2020, 8:47 a.m. UTC | #6
Hi Jacopo

On Mon, Aug 24, 2020 at 9:32 AM Jacopo Mondi <jacopo@jmondi.org> wrote:
>
> Hi Laurent, Prabhakar,
>
> On Fri, Aug 21, 2020 at 12:37:35PM +0100, Lad, Prabhakar wrote:
> > Hi Laurent and Jacopo
> >
> > On Wed, Aug 19, 2020 at 2:54 PM Laurent Pinchart
> > <laurent.pinchart@ideasonboard.com> wrote:
> > >
> > > Hi Jacopo,
> > >
> > > Thank you for the patch.
> > >
> > > On Tue, Aug 18, 2020 at 02:20:12PM +0200, Jacopo Mondi wrote:
> > > > Document endpoint properties for the parallel bus type and
> > > > add them to the example.
> > > >
> > > > Specify a few constraints:
> > > > - If the bus type is BT.656 no hsync or vsycn polarities can be
> > > >   specified.
> > > > - If the bus width is 10 bits, not data-shift can be applied.
> > > >
> > > > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> > > > ---
> > > >  .../devicetree/bindings/media/i2c/ov772x.yaml | 43 +++++++++++++++++++
> > > >  1 file changed, 43 insertions(+)
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/media/i2c/ov772x.yaml b/Documentation/devicetree/bindings/media/i2c/ov772x.yaml
> > > > index 75dad40f70cc..3fad5dffd19a 100644
> > > > --- a/Documentation/devicetree/bindings/media/i2c/ov772x.yaml
> > > > +++ b/Documentation/devicetree/bindings/media/i2c/ov772x.yaml
> > > > @@ -50,9 +50,47 @@ properties:
> > > >            bus-type:
> > > >              enum: [5, 6]
> > > >
> > > > +          bus-width:
> > > > +            enum: [8, 10]
> > > > +            default: 10
> > > > +
> > > > +          data-shift:
> > > > +            enum: [0, 2]
> > > > +            default: 0
> > > > +
> > > > +          hsync-active:
> > > > +            enum: [0, 1]
> > > > +            default: 1
> > > > +
> > > > +          vsync-active:
> > > > +            enum: [0, 1]
> > > > +            default: 1
> > > > +
> > > > +          pclk-sample:
> > > > +            enum: [0, 1]
> > > > +            default: 1
> > > > +
> > > >            remote-endpoint:
> > > >              description: A phandle to the bus receiver's endpoint node.
> > > >
> > > > +        allOf:
> > > > +          - if:
> > > > +              properties:
> > > > +                bus-type:
> > > > +                  const: 6
> > > > +            then:
> > > > +                properties:
> > > > +                  hsync-active: false
> > > > +                  vsync-active: false
> > > > +
> > > > +          - if:
> > > > +              properties:
> > > > +                bus-width:
> > > > +                  const: 10
> > > > +            then:
> > > > +                properties:
> > > > +                  data-shift:
> > > > +                    const: 0
> > >
> > > I'd add a blank line here.
> > >
> > > >          required:
> > > >            - bus-type
> > >
> > > Should some of the properties be required ? Possibly conditioned on
> > > bus-type ?
> > >
>
> I am not sure. They all have defaults, as reported here and as
> supported by the driver. There's nothing -strictly- required, as long
> as the here reported defaults are correct.
>
Agreed, ran dt_binding_check and looks good so,

Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Cheers,
Prabhakar

> > Agreed, would be interesting to know how this can be handled (split
> > out bus-type and add required properties for each) ?
> >
>
> That already happens with
>
> +          - if:
> +              properties:
> +                bus-type:
> +                  const: 6
> +            then:
> +                properties:
> +                  hsync-active: false
> +                  vsync-active: false
>
> And could be expanded, if we want any of these to be required.
>
> Thanks
>   j
>
> > Cheers,
> > Prabhakar
> >
> > > >
> > > > @@ -82,6 +120,11 @@ examples:
> > > >              port {
> > > >                  ov772x_0: endpoint {
> > > >                      bus-type = <5>;
> > > > +                    vsync-active = <0>;
> > > > +                    hsync-active = <0>;
> > > > +                    pclk-sample = <0>;
> > > > +                    bus-width = <8>;
> > > > +                    data-shift = <0>;
> > > >                      remote-endpoint = <&vcap1_in0>;
> > > >                  };
> > > >              };
> > >
> > > --
> > > Regards,
> > >
> > > Laurent Pinchart
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/media/i2c/ov772x.yaml b/Documentation/devicetree/bindings/media/i2c/ov772x.yaml
index 75dad40f70cc..3fad5dffd19a 100644
--- a/Documentation/devicetree/bindings/media/i2c/ov772x.yaml
+++ b/Documentation/devicetree/bindings/media/i2c/ov772x.yaml
@@ -50,9 +50,47 @@  properties:
           bus-type:
             enum: [5, 6]

+          bus-width:
+            enum: [8, 10]
+            default: 10
+
+          data-shift:
+            enum: [0, 2]
+            default: 0
+
+          hsync-active:
+            enum: [0, 1]
+            default: 1
+
+          vsync-active:
+            enum: [0, 1]
+            default: 1
+
+          pclk-sample:
+            enum: [0, 1]
+            default: 1
+
           remote-endpoint:
             description: A phandle to the bus receiver's endpoint node.

+        allOf:
+          - if:
+              properties:
+                bus-type:
+                  const: 6
+            then:
+                properties:
+                  hsync-active: false
+                  vsync-active: false
+
+          - if:
+              properties:
+                bus-width:
+                  const: 10
+            then:
+                properties:
+                  data-shift:
+                    const: 0
         required:
           - bus-type

@@ -82,6 +120,11 @@  examples:
             port {
                 ov772x_0: endpoint {
                     bus-type = <5>;
+                    vsync-active = <0>;
+                    hsync-active = <0>;
+                    pclk-sample = <0>;
+                    bus-width = <8>;
+                    data-shift = <0>;
                     remote-endpoint = <&vcap1_in0>;
                 };
             };