diff mbox series

[2/5] dt-bindings: soc: imx93-media-blk-ctrl: Add LDB subnode into schema and example

Message ID 20231020130019.665853-3-alexander.stein@ew.tq-group.com (mailing list archive)
State Not Applicable, archived
Headers show
Series TQMa93xxLA/MBa93xxLA LVDS support | expand

Commit Message

Alexander Stein Oct. 20, 2023, 1 p.m. UTC
Document the LDB bridge subnode and add the subnode into the example.
For the subnode to work, the block control must scan its subnodes and
bind drivers to them, do not misuse either simple-bus or simple-mfd
here.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
 .../soc/imx/fsl,imx93-media-blk-ctrl.yaml     | 44 +++++++++++++++++++
 1 file changed, 44 insertions(+)

Comments

Conor Dooley Oct. 22, 2023, 5:39 p.m. UTC | #1
Yo,

On Fri, Oct 20, 2023 at 03:00:15PM +0200, Alexander Stein wrote:
> Document the LDB bridge subnode and add the subnode into the example.
> For the subnode to work, the block control must scan its subnodes and
> bind drivers to them, do not misuse either simple-bus or simple-mfd
> here.
> 
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> ---
>  .../soc/imx/fsl,imx93-media-blk-ctrl.yaml     | 44 +++++++++++++++++++
>  1 file changed, 44 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml b/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml
> index b3554e7f9e76..5ba66dfb0e05 100644
> --- a/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml
> +++ b/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml
> @@ -24,6 +24,12 @@ properties:
>    reg:
>      maxItems: 1
>  
> +  '#address-cells':
> +    const: 1
> +
> +  '#size-cells':
> +    const: 1
> +
>    '#power-domain-cells':
>      const: 1
>  
> @@ -46,9 +52,16 @@ properties:
>        - const: csi
>        - const: dsi
>  
> +  bridge@20:
> +    type: object
> +    $ref: /schemas/display/bridge/fsl,ldb.yaml#
> +    unevaluatedProperties: false
> +
>  required:
>    - compatible
>    - reg

> +  - '#address-cells'
> +  - '#size-cells'

It seems to make little sense to me that these would become required
when the bridge is optional. Is it valid to have one of these
media-blk-ctrls without the ldb subnode?

>    - power-domains
>    - clocks
>    - clock-names
> @@ -77,4 +90,35 @@ examples:
>                 clock-names = "apb", "axi", "nic", "disp", "cam",
>                               "pxp", "lcdif", "isi", "csi", "dsi";
>        #power-domain-cells = <1>;
> +      #address-cells = <1>;
> +      #size-cells = <1>;
> +
> +      bridge@20 {
> +          compatible = "fsl,imx93-ldb";
> +          reg = <0x20 0x4>, <0x24 0x4>;
> +          reg-names = "ldb", "lvds";
> +          clocks = <&clk IMX93_CLK_LVDS_GATE>;
> +          clock-names = "ldb";
> +
> +          ports {
> +              #address-cells = <1>;
> +              #size-cells = <0>;
> +
> +              port@0 {
> +                  reg = <0>;
> +
> +                  ldb_from_lcdif2: endpoint {
> +                      remote-endpoint = <&lcdif2_to_ldb>;
> +                  };
> +              };
> +
> +              port@1 {
> +                  reg = <1>;
> +
> +                  ldb_lvds: endpoint {
> +                      remote-endpoint = <&ldb_to_panel>;
> +                  };
> +              };
> +          };
> +        };
>      };
> -- 
> 2.34.1
>
Alexander Stein Oct. 23, 2023, 6:27 a.m. UTC | #2
Hi Conor,

Am Sonntag, 22. Oktober 2023, 19:39:12 CEST schrieb Conor Dooley:
> Yo,
> 
> On Fri, Oct 20, 2023 at 03:00:15PM +0200, Alexander Stein wrote:
> > Document the LDB bridge subnode and add the subnode into the example.
> > For the subnode to work, the block control must scan its subnodes and
> > bind drivers to them, do not misuse either simple-bus or simple-mfd
> > here.
> > 
> > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> > ---
> > 
> >  .../soc/imx/fsl,imx93-media-blk-ctrl.yaml     | 44 +++++++++++++++++++
> >  1 file changed, 44 insertions(+)
> > 
> > diff --git
> > a/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml
> > b/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml
> > index b3554e7f9e76..5ba66dfb0e05 100644
> > ---
> > a/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml
> > +++
> > b/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml> 
> > @@ -24,6 +24,12 @@ properties:
> >    reg:
> >      maxItems: 1
> > 
> > +  '#address-cells':
> > +    const: 1
> > +
> > +  '#size-cells':
> > +    const: 1
> > +
> > 
> >    '#power-domain-cells':
> >      const: 1
> > 
> > @@ -46,9 +52,16 @@ properties:
> >        - const: csi
> >        - const: dsi
> > 
> > +  bridge@20:
> > +    type: object
> > +    $ref: /schemas/display/bridge/fsl,ldb.yaml#
> > +    unevaluatedProperties: false
> > +
> > 
> >  required:
> >    - compatible
> >    - reg
> > 
> > +  - '#address-cells'
> > +  - '#size-cells'
> 
> It seems to make little sense to me that these would become required
> when the bridge is optional. Is it valid to have one of these
> media-blk-ctrls without the ldb subnode?

fsl,imx93-media-blk-ctrl privides several power-domains (DSI, CSI, ISI, PXP 
and LCDIF), currently unused. This series introduces the usage for LCDIF power 
domain. LDB is the LVDS display bridge. So there are several power domains 
which don't requires the usage of ldb.
On the other hand I prefer consistency, so I opted to keep things similar to 
commit 1cb0c87d27dc. If it shall not be added here, it should be removed in 
Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-media-blk-ctrl.yaml as 
well.

Best regards,
Alexander

> 
> >    - power-domains
> >    - clocks
> >    - clock-names
> > 
> > @@ -77,4 +90,35 @@ examples:
> >                 clock-names = "apb", "axi", "nic", "disp", "cam",
> >                 
> >                               "pxp", "lcdif", "isi", "csi", "dsi";
> >        
> >        #power-domain-cells = <1>;
> > 
> > +      #address-cells = <1>;
> > +      #size-cells = <1>;
> > +
> > +      bridge@20 {
> > +          compatible = "fsl,imx93-ldb";
> > +          reg = <0x20 0x4>, <0x24 0x4>;
> > +          reg-names = "ldb", "lvds";
> > +          clocks = <&clk IMX93_CLK_LVDS_GATE>;
> > +          clock-names = "ldb";
> > +
> > +          ports {
> > +              #address-cells = <1>;
> > +              #size-cells = <0>;
> > +
> > +              port@0 {
> > +                  reg = <0>;
> > +
> > +                  ldb_from_lcdif2: endpoint {
> > +                      remote-endpoint = <&lcdif2_to_ldb>;
> > +                  };
> > +              };
> > +
> > +              port@1 {
> > +                  reg = <1>;
> > +
> > +                  ldb_lvds: endpoint {
> > +                      remote-endpoint = <&ldb_to_panel>;
> > +                  };
> > +              };
> > +          };
> > +        };
> > 
> >      };
Conor Dooley Oct. 23, 2023, 4:37 p.m. UTC | #3
On Mon, Oct 23, 2023 at 08:27:20AM +0200, Alexander Stein wrote:
> Am Sonntag, 22. Oktober 2023, 19:39:12 CEST schrieb Conor Dooley:
> > On Fri, Oct 20, 2023 at 03:00:15PM +0200, Alexander Stein wrote:
> > > Document the LDB bridge subnode and add the subnode into the example.
> > > For the subnode to work, the block control must scan its subnodes and
> > > bind drivers to them, do not misuse either simple-bus or simple-mfd
> > > here.
> > > 
> > > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> > > ---
> > > 
> > >  .../soc/imx/fsl,imx93-media-blk-ctrl.yaml     | 44 +++++++++++++++++++
> > >  1 file changed, 44 insertions(+)
> > > 
> > > diff --git
> > > a/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml
> > > b/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml
> > > index b3554e7f9e76..5ba66dfb0e05 100644
> > > ---
> > > a/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml
> > > +++
> > > b/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml> 
> > > @@ -24,6 +24,12 @@ properties:
> > >    reg:
> > >      maxItems: 1
> > > 
> > > +  '#address-cells':
> > > +    const: 1
> > > +
> > > +  '#size-cells':
> > > +    const: 1
> > > +
> > > 
> > >    '#power-domain-cells':
> > >      const: 1
> > > 
> > > @@ -46,9 +52,16 @@ properties:
> > >        - const: csi
> > >        - const: dsi
> > > 
> > > +  bridge@20:
> > > +    type: object
> > > +    $ref: /schemas/display/bridge/fsl,ldb.yaml#
> > > +    unevaluatedProperties: false
> > > +
> > > 
> > >  required:
> > >    - compatible
> > >    - reg
> > > 
> > > +  - '#address-cells'
> > > +  - '#size-cells'
> > 
> > It seems to make little sense to me that these would become required
> > when the bridge is optional. Is it valid to have one of these
> > media-blk-ctrls without the ldb subnode?
> 
> fsl,imx93-media-blk-ctrl privides several power-domains (DSI, CSI, ISI, PXP 
> and LCDIF), currently unused. This series introduces the usage for LCDIF power 
> domain. LDB is the LVDS display bridge. So there are several power domains 
> which don't requires the usage of ldb.
> On the other hand I prefer consistency, so I opted to keep things similar to 
> commit 1cb0c87d27dc. If it shall not be added here, it should be removed in 
> Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-media-blk-ctrl.yaml as 
> well.

IIRC the tooling will complain if you have an enabled node containing
#address-cells and/or #size-cells but no child nodes, so making
#address-cells or #size-cells required will cause problems. Looks like
the only user has the child node, so it didn't crop up yet.
Alexander Stein Oct. 24, 2023, 6:30 a.m. UTC | #4
Am Montag, 23. Oktober 2023, 18:37:29 CEST schrieb Conor Dooley:
> On Mon, Oct 23, 2023 at 08:27:20AM +0200, Alexander Stein wrote:
> > Am Sonntag, 22. Oktober 2023, 19:39:12 CEST schrieb Conor Dooley:
> > > On Fri, Oct 20, 2023 at 03:00:15PM +0200, Alexander Stein wrote:
> > > > Document the LDB bridge subnode and add the subnode into the example.
> > > > For the subnode to work, the block control must scan its subnodes and
> > > > bind drivers to them, do not misuse either simple-bus or simple-mfd
> > > > here.
> > > > 
> > > > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> > > > ---
> > > > 
> > > >  .../soc/imx/fsl,imx93-media-blk-ctrl.yaml     | 44
> > > >  +++++++++++++++++++
> > > >  1 file changed, 44 insertions(+)
> > > > 
> > > > diff --git
> > > > a/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.y
> > > > aml
> > > > b/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.y
> > > > aml
> > > > index b3554e7f9e76..5ba66dfb0e05 100644
> > > > ---
> > > > a/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.y
> > > > aml
> > > > +++
> > > > b/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.y
> > > > aml>
> > > > 
> > > > @@ -24,6 +24,12 @@ properties:
> > > >    reg:
> > > >      maxItems: 1
> > > > 
> > > > +  '#address-cells':
> > > > +    const: 1
> > > > +
> > > > +  '#size-cells':
> > > > +    const: 1
> > > > +
> > > > 
> > > >    '#power-domain-cells':
> > > >      const: 1
> > > > 
> > > > @@ -46,9 +52,16 @@ properties:
> > > >        - const: csi
> > > >        - const: dsi
> > > > 
> > > > +  bridge@20:
> > > > +    type: object
> > > > +    $ref: /schemas/display/bridge/fsl,ldb.yaml#
> > > > +    unevaluatedProperties: false
> > > > +
> > > > 
> > > >  required:
> > > >    - compatible
> > > >    - reg
> > > > 
> > > > +  - '#address-cells'
> > > > +  - '#size-cells'
> > > 
> > > It seems to make little sense to me that these would become required
> > > when the bridge is optional. Is it valid to have one of these
> > > media-blk-ctrls without the ldb subnode?
> > 
> > fsl,imx93-media-blk-ctrl privides several power-domains (DSI, CSI, ISI,
> > PXP
> > and LCDIF), currently unused. This series introduces the usage for LCDIF
> > power domain. LDB is the LVDS display bridge. So there are several power
> > domains which don't requires the usage of ldb.
> > On the other hand I prefer consistency, so I opted to keep things similar
> > to commit 1cb0c87d27dc. If it shall not be added here, it should be
> > removed in
> > Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-media-blk-ctrl.yaml
> > as well.
> 
> IIRC the tooling will complain if you have an enabled node containing
> #address-cells and/or #size-cells but no child nodes, so making
> #address-cells or #size-cells required will cause problems. Looks like
> the only user has the child node, so it didn't crop up yet.

I was not able to raise a warning with enabled media_blk_ctrl having #address-
cells/#size-cells being set but no subnode.
I don't have a strong opinion on this, but I prefer having both bindings as 
similar as possible.

best regards,
Alexander
Conor Dooley Oct. 24, 2023, 9:08 a.m. UTC | #5
On Tue, Oct 24, 2023 at 08:30:16AM +0200, Alexander Stein wrote:
> Am Montag, 23. Oktober 2023, 18:37:29 CEST schrieb Conor Dooley:
> > On Mon, Oct 23, 2023 at 08:27:20AM +0200, Alexander Stein wrote:
> > > Am Sonntag, 22. Oktober 2023, 19:39:12 CEST schrieb Conor Dooley:
> > > > On Fri, Oct 20, 2023 at 03:00:15PM +0200, Alexander Stein wrote:
> > > > > Document the LDB bridge subnode and add the subnode into the example.
> > > > > For the subnode to work, the block control must scan its subnodes and
> > > > > bind drivers to them, do not misuse either simple-bus or simple-mfd
> > > > > here.
> > > > > 
> > > > > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> > > > > ---
> > > > > 
> > > > >  .../soc/imx/fsl,imx93-media-blk-ctrl.yaml     | 44
> > > > >  +++++++++++++++++++
> > > > >  1 file changed, 44 insertions(+)
> > > > > 
> > > > > diff --git
> > > > > a/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.y
> > > > > aml
> > > > > b/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.y
> > > > > aml
> > > > > index b3554e7f9e76..5ba66dfb0e05 100644
> > > > > ---
> > > > > a/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.y
> > > > > aml
> > > > > +++
> > > > > b/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.y
> > > > > aml>
> > > > > 
> > > > > @@ -24,6 +24,12 @@ properties:
> > > > >    reg:
> > > > >      maxItems: 1
> > > > > 
> > > > > +  '#address-cells':
> > > > > +    const: 1
> > > > > +
> > > > > +  '#size-cells':
> > > > > +    const: 1
> > > > > +
> > > > > 
> > > > >    '#power-domain-cells':
> > > > >      const: 1
> > > > > 
> > > > > @@ -46,9 +52,16 @@ properties:
> > > > >        - const: csi
> > > > >        - const: dsi
> > > > > 
> > > > > +  bridge@20:
> > > > > +    type: object
> > > > > +    $ref: /schemas/display/bridge/fsl,ldb.yaml#
> > > > > +    unevaluatedProperties: false
> > > > > +
> > > > > 
> > > > >  required:
> > > > >    - compatible
> > > > >    - reg
> > > > > 
> > > > > +  - '#address-cells'
> > > > > +  - '#size-cells'
> > > > 
> > > > It seems to make little sense to me that these would become required
> > > > when the bridge is optional. Is it valid to have one of these
> > > > media-blk-ctrls without the ldb subnode?
> > > 
> > > fsl,imx93-media-blk-ctrl privides several power-domains (DSI, CSI, ISI,
> > > PXP
> > > and LCDIF), currently unused. This series introduces the usage for LCDIF
> > > power domain. LDB is the LVDS display bridge. So there are several power
> > > domains which don't requires the usage of ldb.
> > > On the other hand I prefer consistency, so I opted to keep things similar
> > > to commit 1cb0c87d27dc. If it shall not be added here, it should be
> > > removed in
> > > Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-media-blk-ctrl.yaml
> > > as well.
> > 
> > IIRC the tooling will complain if you have an enabled node containing
> > #address-cells and/or #size-cells but no child nodes, so making
> > #address-cells or #size-cells required will cause problems. Looks like
> > the only user has the child node, so it didn't crop up yet.
> 
> I was not able to raise a warning with enabled media_blk_ctrl having #address-
> cells/#size-cells being set but no subnode.
> I don't have a strong opinion on this, but I prefer having both bindings as 
> similar as possible.

The complaint is from dtc, possibly only at W=1:
unnecessary #address-cells/#size-cells without "ranges" or child "reg" property
Rob Herring Oct. 24, 2023, 7:49 p.m. UTC | #6
On Fri, Oct 20, 2023 at 03:00:15PM +0200, Alexander Stein wrote:
> Document the LDB bridge subnode and add the subnode into the example.
> For the subnode to work, the block control must scan its subnodes and
> bind drivers to them, do not misuse either simple-bus or simple-mfd
> here.
> 
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> ---
>  .../soc/imx/fsl,imx93-media-blk-ctrl.yaml     | 44 +++++++++++++++++++
>  1 file changed, 44 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml b/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml
> index b3554e7f9e76..5ba66dfb0e05 100644
> --- a/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml
> +++ b/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml
> @@ -24,6 +24,12 @@ properties:
>    reg:
>      maxItems: 1
>  
> +  '#address-cells':
> +    const: 1
> +
> +  '#size-cells':
> +    const: 1
> +

Presumably the child nodes are MMIO? If so, missing 'ranges'.

>    '#power-domain-cells':
>      const: 1
>  
> @@ -46,9 +52,16 @@ properties:
>        - const: csi
>        - const: dsi
>  
> +  bridge@20:
> +    type: object
> +    $ref: /schemas/display/bridge/fsl,ldb.yaml#
> +    unevaluatedProperties: false

We do this style a lot, but another way to do child nodes is:

type: object
additionalProperties: true

properties:
  compatible:
    contains:
      const: fsl,imx93-ldb

This way avoids applying the fsl,ldb.yaml schema twice and ensures the 
right LDB compatible is used. 

Rob
Alexander Stein Jan. 11, 2024, 1:26 p.m. UTC | #7
Hi Conor,

Am Dienstag, 24. Oktober 2023, 11:08:56 CET schrieb Conor Dooley:
> On Tue, Oct 24, 2023 at 08:30:16AM +0200, Alexander Stein wrote:
> > Am Montag, 23. Oktober 2023, 18:37:29 CEST schrieb Conor Dooley:
> > > On Mon, Oct 23, 2023 at 08:27:20AM +0200, Alexander Stein wrote:
> > > > Am Sonntag, 22. Oktober 2023, 19:39:12 CEST schrieb Conor Dooley:
> > > > > On Fri, Oct 20, 2023 at 03:00:15PM +0200, Alexander Stein wrote:
> > > > > > Document the LDB bridge subnode and add the subnode into the
> > > > > > example.
> > > > > > For the subnode to work, the block control must scan its subnodes
> > > > > > and
> > > > > > bind drivers to them, do not misuse either simple-bus or
> > > > > > simple-mfd
> > > > > > here.
> > > > > > 
> > > > > > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> > > > > > ---
> > > > > > 
> > > > > >  .../soc/imx/fsl,imx93-media-blk-ctrl.yaml     | 44
> > > > > >  +++++++++++++++++++
> > > > > >  1 file changed, 44 insertions(+)
> > > > > > 
> > > > > > diff --git
> > > > > > a/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ct
> > > > > > rl.y
> > > > > > aml
> > > > > > b/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ct
> > > > > > rl.y
> > > > > > aml
> > > > > > index b3554e7f9e76..5ba66dfb0e05 100644
> > > > > > ---
> > > > > > a/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ct
> > > > > > rl.y
> > > > > > aml
> > > > > > +++
> > > > > > b/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ct
> > > > > > rl.y
> > > > > > aml>
> > > > > > 
> > > > > > @@ -24,6 +24,12 @@ properties:
> > > > > >    reg:
> > > > > >      maxItems: 1
> > > > > > 
> > > > > > +  '#address-cells':
> > > > > > +    const: 1
> > > > > > +
> > > > > > +  '#size-cells':
> > > > > > +    const: 1
> > > > > > +
> > > > > > 
> > > > > >    '#power-domain-cells':
> > > > > >      const: 1
> > > > > > 
> > > > > > @@ -46,9 +52,16 @@ properties:
> > > > > >        - const: csi
> > > > > >        - const: dsi
> > > > > > 
> > > > > > +  bridge@20:
> > > > > > +    type: object
> > > > > > +    $ref: /schemas/display/bridge/fsl,ldb.yaml#
> > > > > > +    unevaluatedProperties: false
> > > > > > +
> > > > > > 
> > > > > >  required:
> > > > > >    - compatible
> > > > > >    - reg
> > > > > > 
> > > > > > +  - '#address-cells'
> > > > > > +  - '#size-cells'
> > > > > 
> > > > > It seems to make little sense to me that these would become required
> > > > > when the bridge is optional. Is it valid to have one of these
> > > > > media-blk-ctrls without the ldb subnode?
> > > > 
> > > > fsl,imx93-media-blk-ctrl privides several power-domains (DSI, CSI,
> > > > ISI,
> > > > PXP
> > > > and LCDIF), currently unused. This series introduces the usage for
> > > > LCDIF
> > > > power domain. LDB is the LVDS display bridge. So there are several
> > > > power
> > > > domains which don't requires the usage of ldb.
> > > > On the other hand I prefer consistency, so I opted to keep things
> > > > similar
> > > > to commit 1cb0c87d27dc. If it shall not be added here, it should be
> > > > removed in
> > > > Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-media-blk-ctrl.ya
> > > > ml
> > > > as well.
> > > 
> > > IIRC the tooling will complain if you have an enabled node containing
> > > #address-cells and/or #size-cells but no child nodes, so making
> > > #address-cells or #size-cells required will cause problems. Looks like
> > > the only user has the child node, so it didn't crop up yet.
> > 
> > I was not able to raise a warning with enabled media_blk_ctrl having
> > #address- cells/#size-cells being set but no subnode.
> > I don't have a strong opinion on this, but I prefer having both bindings
> > as
> > similar as possible.
> 
> The complaint is from dtc, possibly only at W=1:
> unnecessary #address-cells/#size-cells without "ranges" or child "reg"
> property

I was still not able to trigger this. But anyway this binding is for i.MX93 
MEDIAMIX Block Control. There is exactly one of this instance in the SoC. So 
there is always the LVDS bridge included, thus the ldb subnode shall be added.
Given this IMHO #address-cells/#size-cells can be required.

Best regards,
Alexander
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml b/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml
index b3554e7f9e76..5ba66dfb0e05 100644
--- a/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml
+++ b/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml
@@ -24,6 +24,12 @@  properties:
   reg:
     maxItems: 1
 
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 1
+
   '#power-domain-cells':
     const: 1
 
@@ -46,9 +52,16 @@  properties:
       - const: csi
       - const: dsi
 
+  bridge@20:
+    type: object
+    $ref: /schemas/display/bridge/fsl,ldb.yaml#
+    unevaluatedProperties: false
+
 required:
   - compatible
   - reg
+  - '#address-cells'
+  - '#size-cells'
   - power-domains
   - clocks
   - clock-names
@@ -77,4 +90,35 @@  examples:
                clock-names = "apb", "axi", "nic", "disp", "cam",
                              "pxp", "lcdif", "isi", "csi", "dsi";
       #power-domain-cells = <1>;
+      #address-cells = <1>;
+      #size-cells = <1>;
+
+      bridge@20 {
+          compatible = "fsl,imx93-ldb";
+          reg = <0x20 0x4>, <0x24 0x4>;
+          reg-names = "ldb", "lvds";
+          clocks = <&clk IMX93_CLK_LVDS_GATE>;
+          clock-names = "ldb";
+
+          ports {
+              #address-cells = <1>;
+              #size-cells = <0>;
+
+              port@0 {
+                  reg = <0>;
+
+                  ldb_from_lcdif2: endpoint {
+                      remote-endpoint = <&lcdif2_to_ldb>;
+                  };
+              };
+
+              port@1 {
+                  reg = <1>;
+
+                  ldb_lvds: endpoint {
+                      remote-endpoint = <&ldb_to_panel>;
+                  };
+              };
+          };
+        };
     };