[PATCH v8 1/9] dt-bindings: display: fsl,ldb: Add i.MX94 LDB

Laurentiu Palcu posted 9 patches 4 weeks ago
[PATCH v8 1/9] dt-bindings: display: fsl,ldb: Add i.MX94 LDB
Posted by Laurentiu Palcu 4 weeks ago
i.MX94 has a single LVDS port and share similar LDB and LVDS control
registers as i.MX8MP and i.MX93.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml b/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml
index 7f380879fffdf..fb70409161fc0 100644
--- a/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml
+++ b/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml
@@ -20,6 +20,7 @@ properties:
       - fsl,imx6sx-ldb
       - fsl,imx8mp-ldb
       - fsl,imx93-ldb
+      - fsl,imx94-ldb
 
   clocks:
     maxItems: 1
@@ -78,6 +79,7 @@ allOf:
             enum:
               - fsl,imx6sx-ldb
               - fsl,imx93-ldb
+              - fsl,imx94-ldb
     then:
       properties:
         ports:

-- 
2.51.0
Re: [PATCH v8 1/9] dt-bindings: display: fsl,ldb: Add i.MX94 LDB
Posted by Liu Ying 3 weeks, 6 days ago
On Wed, Mar 04, 2026 at 11:34:10AM +0000, Laurentiu Palcu wrote:
> i.MX94 has a single LVDS port and share similar LDB and LVDS control
> registers as i.MX8MP and i.MX93.
> 
> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
> Reviewed-by: Frank Li <Frank.Li@nxp.com>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml b/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml
> index 7f380879fffdf..fb70409161fc0 100644
> --- a/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml
> +++ b/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml
> @@ -20,6 +20,7 @@ properties:
>        - fsl,imx6sx-ldb
>        - fsl,imx8mp-ldb
>        - fsl,imx93-ldb
> +      - fsl,imx94-ldb

Cc'ing Marco.

Recently, Marco said that LDB node should not have a reg property...

https://lore.kernel.org/all/4sofljffovrorpxe2os3jl745qfjoglvl54oqf3v7r5bk5f6aq@6y3jwn4abiqy/

>  
>    clocks:
>      maxItems: 1
> @@ -78,6 +79,7 @@ allOf:
>              enum:
>                - fsl,imx6sx-ldb
>                - fsl,imx93-ldb
> +              - fsl,imx94-ldb
>      then:
>        properties:
>          ports:
> 

-- 
Regards,
Liu Ying
Re: [PATCH v8 1/9] dt-bindings: display: fsl,ldb: Add i.MX94 LDB
Posted by Marco Felsch 3 weeks, 6 days ago
On 26-03-06, Liu Ying wrote:
> On Wed, Mar 04, 2026 at 11:34:10AM +0000, Laurentiu Palcu wrote:
> > i.MX94 has a single LVDS port and share similar LDB and LVDS control
> > registers as i.MX8MP and i.MX93.
> > 
> > Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
> > Reviewed-by: Frank Li <Frank.Li@nxp.com>
> > Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > ---
> >  Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml b/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml
> > index 7f380879fffdf..fb70409161fc0 100644
> > --- a/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml
> > +++ b/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml
> > @@ -20,6 +20,7 @@ properties:
> >        - fsl,imx6sx-ldb
> >        - fsl,imx8mp-ldb
> >        - fsl,imx93-ldb
> > +      - fsl,imx94-ldb
> 
> Cc'ing Marco.
> 
> Recently, Marco said that LDB node should not have a reg property...
> 
> https://lore.kernel.org/all/4sofljffovrorpxe2os3jl745qfjoglvl54oqf3v7r5bk5f6aq@6y3jwn4abiqy/

Yes, this has to be dropped. All variants of this specific "IP" use the
same approach. This "IP" is part of a general purpose register layout
with very loose reg-field definitions: e.g. resets and clk-gatting share
the same register. Or a mux reg-field shares the same register as a
MIPI-{C,D}SI configuration reg-field. Therefore this "IP" is part of a
syscon and should be abstracted as such within the DT.

Regards,
  Marco

> >    clocks:
> >      maxItems: 1
> > @@ -78,6 +79,7 @@ allOf:
> >              enum:
> >                - fsl,imx6sx-ldb
> >                - fsl,imx93-ldb
> > +              - fsl,imx94-ldb
> >      then:
> >        properties:
> >          ports:
> > 
> 
> -- 
> Regards,
> Liu Ying

-- 
#gernperDu 
#CallMeByMyFirstName

Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-9    |
Re: [PATCH v8 1/9] dt-bindings: display: fsl,ldb: Add i.MX94 LDB
Posted by Laurentiu Palcu 2 weeks ago
On Fri, Mar 06, 2026 at 09:46:57AM +0100, Marco Felsch wrote:
> On 26-03-06, Liu Ying wrote:
> > On Wed, Mar 04, 2026 at 11:34:10AM +0000, Laurentiu Palcu wrote:
> > > i.MX94 has a single LVDS port and share similar LDB and LVDS control
> > > registers as i.MX8MP and i.MX93.
> > > 
> > > Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
> > > Reviewed-by: Frank Li <Frank.Li@nxp.com>
> > > Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > > ---
> > >  Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml b/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml
> > > index 7f380879fffdf..fb70409161fc0 100644
> > > --- a/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml
> > > +++ b/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml
> > > @@ -20,6 +20,7 @@ properties:
> > >        - fsl,imx6sx-ldb
> > >        - fsl,imx8mp-ldb
> > >        - fsl,imx93-ldb
> > > +      - fsl,imx94-ldb
> > 
> > Cc'ing Marco.
> > 
> > Recently, Marco said that LDB node should not have a reg property...
> > 
> > https://lore.kernel.org/all/4sofljffovrorpxe2os3jl745qfjoglvl54oqf3v7r5bk5f6aq@6y3jwn4abiqy/
> 
> Yes, this has to be dropped. All variants of this specific "IP" use the
> same approach. This "IP" is part of a general purpose register layout
> with very loose reg-field definitions: e.g. resets and clk-gatting share
> the same register. Or a mux reg-field shares the same register as a
> MIPI-{C,D}SI configuration reg-field. Therefore this "IP" is part of a
> syscon and should be abstracted as such within the DT.

Even though I understand the logic behind why 'reg' should be dropped,
I'm not exactly sure how to proceed with this. It appears Marek made the
'reg' required in this commit (merely 2 months ago):

8aa2f0ac08d3b - dt-bindings: display: bridge: ldb: Add check for reg and reg-names

Should the above patch simply be reverted and have 'reg' as optional again?
Or should the 'reg' and 'reg-names' be removed completely from the
binding.

@Marek, any comments?

-- 
Thanks,
Laurentiu
Re: [PATCH v8 1/9] dt-bindings: display: fsl,ldb: Add i.MX94 LDB
Posted by Marek Vasut 1 week, 6 days ago
On 3/19/26 9:57 AM, Laurentiu Palcu wrote:
> On Fri, Mar 06, 2026 at 09:46:57AM +0100, Marco Felsch wrote:
>> On 26-03-06, Liu Ying wrote:
>>> On Wed, Mar 04, 2026 at 11:34:10AM +0000, Laurentiu Palcu wrote:
>>>> i.MX94 has a single LVDS port and share similar LDB and LVDS control
>>>> registers as i.MX8MP and i.MX93.
>>>>
>>>> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
>>>> Reviewed-by: Frank Li <Frank.Li@nxp.com>
>>>> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>> ---
>>>>   Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml | 2 ++
>>>>   1 file changed, 2 insertions(+)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml b/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml
>>>> index 7f380879fffdf..fb70409161fc0 100644
>>>> --- a/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml
>>>> +++ b/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml
>>>> @@ -20,6 +20,7 @@ properties:
>>>>         - fsl,imx6sx-ldb
>>>>         - fsl,imx8mp-ldb
>>>>         - fsl,imx93-ldb
>>>> +      - fsl,imx94-ldb
>>>
>>> Cc'ing Marco.
>>>
>>> Recently, Marco said that LDB node should not have a reg property...
>>>
>>> https://lore.kernel.org/all/4sofljffovrorpxe2os3jl745qfjoglvl54oqf3v7r5bk5f6aq@6y3jwn4abiqy/
>>
>> Yes, this has to be dropped. All variants of this specific "IP" use the
>> same approach. This "IP" is part of a general purpose register layout
>> with very loose reg-field definitions: e.g. resets and clk-gatting share
>> the same register. Or a mux reg-field shares the same register as a
>> MIPI-{C,D}SI configuration reg-field. Therefore this "IP" is part of a
>> syscon and should be abstracted as such within the DT.
> 
> Even though I understand the logic behind why 'reg' should be dropped,
> I'm not exactly sure how to proceed with this. It appears Marek made the
> 'reg' required in this commit (merely 2 months ago):
> 
> 8aa2f0ac08d3b - dt-bindings: display: bridge: ldb: Add check for reg and reg-names
> 
> Should the above patch simply be reverted and have 'reg' as optional again?
> Or should the 'reg' and 'reg-names' be removed completely from the
> binding.
> 
> @Marek, any comments?
The LDB driver was always written with parsing 'reg' out of the DT, so 
encoding the register offsets into the driver was a mistake. The LDB 
controls two registers, which can be comfortably described in DT.
Re: [PATCH v8 1/9] dt-bindings: display: fsl,ldb: Add i.MX94 LDB
Posted by Marco Felsch 1 week, 6 days ago
Hi Marek,

On 26-03-19, Marek Vasut wrote:
> On 3/19/26 9:57 AM, Laurentiu Palcu wrote:
> > On Fri, Mar 06, 2026 at 09:46:57AM +0100, Marco Felsch wrote:
> > > On 26-03-06, Liu Ying wrote:
> > > > On Wed, Mar 04, 2026 at 11:34:10AM +0000, Laurentiu Palcu wrote:
> > > > > i.MX94 has a single LVDS port and share similar LDB and LVDS control
> > > > > registers as i.MX8MP and i.MX93.
> > > > > 
> > > > > Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
> > > > > Reviewed-by: Frank Li <Frank.Li@nxp.com>
> > > > > Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > > > > ---
> > > > >   Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml | 2 ++
> > > > >   1 file changed, 2 insertions(+)
> > > > > 
> > > > > diff --git a/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml b/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml
> > > > > index 7f380879fffdf..fb70409161fc0 100644
> > > > > --- a/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml
> > > > > +++ b/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml
> > > > > @@ -20,6 +20,7 @@ properties:
> > > > >         - fsl,imx6sx-ldb
> > > > >         - fsl,imx8mp-ldb
> > > > >         - fsl,imx93-ldb
> > > > > +      - fsl,imx94-ldb
> > > > 
> > > > Cc'ing Marco.
> > > > 
> > > > Recently, Marco said that LDB node should not have a reg property...
> > > > 
> > > > https://lore.kernel.org/all/4sofljffovrorpxe2os3jl745qfjoglvl54oqf3v7r5bk5f6aq@6y3jwn4abiqy/
> > > 
> > > Yes, this has to be dropped. All variants of this specific "IP" use the
> > > same approach. This "IP" is part of a general purpose register layout
> > > with very loose reg-field definitions: e.g. resets and clk-gatting share
> > > the same register. Or a mux reg-field shares the same register as a
> > > MIPI-{C,D}SI configuration reg-field. Therefore this "IP" is part of a
> > > syscon and should be abstracted as such within the DT.
> > 
> > Even though I understand the logic behind why 'reg' should be dropped,
> > I'm not exactly sure how to proceed with this. It appears Marek made the
> > 'reg' required in this commit (merely 2 months ago):
> > 
> > 8aa2f0ac08d3b - dt-bindings: display: bridge: ldb: Add check for reg and reg-names
> > 
> > Should the above patch simply be reverted and have 'reg' as optional again?
> > Or should the 'reg' and 'reg-names' be removed completely from the
> > binding.
> > 
> > @Marek, any comments?
> The LDB driver was always written with parsing 'reg' out of the DT, so

Not sure what you mean by always. I re-checked the imx6qdl.dtsi which
uses the ipuv3/imx-ldb.c driver. These platforms don't use the 'reg'
property either.

> encoding the register offsets into the driver was a mistake. The LDB
> controls two registers, which can be comfortably described in DT.

Sorry but I have to disagree on this. It's no about if it's possible,
it's about if the abstraction is correct and IMHO the LDB is just one
subdevice of the syscon. For i.MX6SX the syscon is the iomuxc-gpr for
the i.MX8M and i.MX9 this is now a blkctrl.

So IMHO the dt-bindings patch should be reverted and the DTs need to be
adapted.

Regards,
  Marco

> 

-- 
#gernperDu 
#CallMeByMyFirstName

Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-9    |
Re: [PATCH v8 1/9] dt-bindings: display: fsl,ldb: Add i.MX94 LDB
Posted by Marek Vasut 1 week, 5 days ago
On 3/20/26 9:23 AM, Marco Felsch wrote:

Hello Marco,

>> The LDB driver was always written with parsing 'reg' out of the DT, so
> 
> Not sure what you mean by always.

By always, I mean since the very beginning.

> I re-checked the imx6qdl.dtsi which
> uses the ipuv3/imx-ldb.c driver. These platforms don't use the 'reg'
> property either.

Which is a different driver, although for a similar IP. We are however 
currently talking about drivers/gpu/drm/bridge/fsl-ldb.c , right ?

>> encoding the register offsets into the driver was a mistake. The LDB
>> controls two registers, which can be comfortably described in DT.
> 
> Sorry but I have to disagree on this. It's no about if it's possible,
> it's about if the abstraction is correct and IMHO the LDB is just one
> subdevice of the syscon. For i.MX6SX the syscon is the iomuxc-gpr for
> the i.MX8M and i.MX9 this is now a blkctrl.

Right, and the "reg" DT property specifies at which offsets are the LDB 
control registers from the start of that blkctrl. What is the problem 
with that ?

Look at e.g. imx8mp.dtsi as an example with blkctrl and LDB as a subnode 
with "reg" DT properties:

1938                         media_blk_ctrl: blk-ctrl@32ec0000 {
1939                                 compatible = 
"fsl,imx8mp-media-blk-ctrl",
1940                                              "syscon";
...
2003                                 lvds_bridge: bridge@5c {
2004                                         compatible = "fsl,imx8mp-ldb";
2005                                         reg = <0x5c 0x4>, <0x128 0x4>;
2006                                         reg-names = "ldb", "lvds";
Re: [PATCH v8 1/9] dt-bindings: display: fsl,ldb: Add i.MX94 LDB
Posted by Liu Ying 1 week, 3 days ago
On Sat, Mar 21, 2026 at 03:37:47AM +0100, Marek Vasut wrote:
> On 3/20/26 9:23 AM, Marco Felsch wrote:
> 
> Hello Marco,
> 
>>> The LDB driver was always written with parsing 'reg' out of the DT, so
>>
>> Not sure what you mean by always.
> 
> By always, I mean since the very beginning.

Marek, your below patch is not accepted(at least for now).  In that patch,
register offset(s) are directly parsed by calling of_property_read_reg().
Without that patch, register offset(s) are determined via device data in
driver according to compatible string.

[PATCH v3] drm/bridge: fsl-ldb: Parse register offsets from DT
https://lore.kernel.org/all/20260104213712.128982-1-marek.vasut@mailbox.org/

[...]

> 
>>> encoding the register offsets into the driver was a mistake. The LDB
>>> controls two registers, which can be comfortably described in DT.
>>
>> Sorry but I have to disagree on this. It's no about if it's possible,
>> it's about if the abstraction is correct and IMHO the LDB is just one
>> subdevice of the syscon. For i.MX6SX the syscon is the iomuxc-gpr for
>> the i.MX8M and i.MX9 this is now a blkctrl.
> 
> Right, and the "reg" DT property specifies at which offsets are the LDB
> control registers from the start of that blkctrl. What is the problem
> with that ?

The problem is that ...

> 
> Look at e.g. imx8mp.dtsi as an example with blkctrl and LDB as a subnode
> with "reg" DT properties:
> 
> 1938                         media_blk_ctrl: blk-ctrl@32ec0000 {
> 1939                                 compatible = "fsl,imx8mp-media-blk-ctrl",
> 1940                                              "syscon";
> ...
> 2003                                 lvds_bridge: bridge@5c {
> 2004                                         compatible = "fsl,imx8mp-ldb";
> 2005                                         reg = <0x5c 0x4>, <0x128 0x4>;
> 2006                                         reg-names = "ldb", "lvds";

... i.MX8MP LVDS bridge node is fine with the reg property, but the property
is not allowed for i.MX93 LVDS bridge node according to commit[1] while
commit[2] requires the property for all LVDS bridge nodes.  See the contradict
here?

[1] 3feaa4342637 dt-bindings: soc: imx93-media-blk-ctrl: Add PDFC subnode to schema and example
[2] 8aa2f0ac08d3 dt-bindings: display: bridge: ldb: Add check for reg and reg-names

To avoid the contradict, how about requiring the reg property only for i.MX6SX
and i.MX8MP LVDS bridge nodes and making it kind of optional for i.MX93 and
i.MX94 LVDS bridge nodes?  Overall, in terms of the reg property, I feel the
LVDS bridge nodes look similar to reg-mux/mmio-mux(See reg-mux.yaml) where
the property is optional.  BTW, there is a mux-controller node with 'mmio-mux'
compatible string in i.MX8mq syscon@30340000:

iomuxc_gpr: syscon@30340000 {
	compatible = "fsl,imx8mq-iomuxc-gpr", "syscon", "simple-mfd";
	reg = <0x30340000 0x10000>;

	mux: mux-controller {
		compatible = "mmio-mux";
		#mux-control-cells = <1>;
		mux-reg-masks = <0x34 0x00000004>; /* MIPI_MUX_SEL */
	};
};

We never know if HW designer would put a mux-controller next to a LVDS
bridge under a syscon device like gpr or blk-ctrl in future i.MX SoCs,
so the optional reg property would buy us some flexibility.

The below patch is what I propose together with a Fixes tag for commit[2].
Since commit[2] is not in v6.19 and v7.0-rc5 was just released, it seems
that we have time to land the proposal fix if it makes sense.  WDYT?

--- a/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml
+++ b/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml
@@ -28,6 +28,7 @@ properties:
     const: ldb
 
   reg:
+    minItems: 1
     maxItems: 2
 
   reg-names:
@@ -68,7 +69,6 @@ required:
   - compatible
   - clocks
   - ports
-  - reg
 
 allOf:
   - if:
@@ -83,12 +83,23 @@ allOf:
         ports:
           properties:
             port@2: false
+
   - if:
-      not:
-        properties:
-          compatible:
-            contains:
-              const: fsl,imx6sx-ldb
+      properties:
+        compatible:
+          contains:
+            enum:
+              - fsl,imx6sx-ldb
+              - fsl,imx8mp-ldb
+    then:
+      required:
+        - reg
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: fsl,imx8mp-ldb
     then:
       required:
         - reg-names

-- 
Regards,
Liu Ying
Re: [PATCH v8 1/9] dt-bindings: display: fsl,ldb: Add i.MX94 LDB
Posted by Marek Vasut 5 days, 11 hours ago
On 3/23/26 8:22 AM, Liu Ying wrote:

Hello Liu,

> ... i.MX8MP LVDS bridge node is fine with the reg property, but the property
> is not allowed for i.MX93 LVDS bridge node according to commit[1] while
> commit[2] requires the property for all LVDS bridge nodes.  See the contradict
> here?
> 
> [1] 3feaa4342637 dt-bindings: soc: imx93-media-blk-ctrl: Add PDFC subnode to schema and example
> [2] 8aa2f0ac08d3 dt-bindings: display: bridge: ldb: Add check for reg and reg-names
> 
> To avoid the contradict, how about requiring the reg property only for i.MX6SX
> and i.MX8MP LVDS bridge nodes and making it kind of optional for i.MX93 and
> i.MX94 LVDS bridge nodes?
I would be fine with that, thanks !
Re: [PATCH v8 1/9] dt-bindings: display: fsl,ldb: Add i.MX94 LDB
Posted by Laurentiu Palcu 1 week, 1 day ago
On Mon, Mar 23, 2026 at 03:22:35PM +0800, Liu Ying wrote:
> On Sat, Mar 21, 2026 at 03:37:47AM +0100, Marek Vasut wrote:
> > On 3/20/26 9:23 AM, Marco Felsch wrote:
> > 
> > Hello Marco,
> > 
> >>> The LDB driver was always written with parsing 'reg' out of the DT, so
> >>
> >> Not sure what you mean by always.
> > 
> > By always, I mean since the very beginning.
> 
> Marek, your below patch is not accepted(at least for now).  In that patch,
> register offset(s) are directly parsed by calling of_property_read_reg().
> Without that patch, register offset(s) are determined via device data in
> driver according to compatible string.
> 
> [PATCH v3] drm/bridge: fsl-ldb: Parse register offsets from DT
> https://lore.kernel.org/all/20260104213712.128982-1-marek.vasut@mailbox.org/
> 
> [...]
> 
> > 
> >>> encoding the register offsets into the driver was a mistake. The LDB
> >>> controls two registers, which can be comfortably described in DT.
> >>
> >> Sorry but I have to disagree on this. It's no about if it's possible,
> >> it's about if the abstraction is correct and IMHO the LDB is just one
> >> subdevice of the syscon. For i.MX6SX the syscon is the iomuxc-gpr for
> >> the i.MX8M and i.MX9 this is now a blkctrl.
> > 
> > Right, and the "reg" DT property specifies at which offsets are the LDB
> > control registers from the start of that blkctrl. What is the problem
> > with that ?
> 
> The problem is that ...
> 
> > 
> > Look at e.g. imx8mp.dtsi as an example with blkctrl and LDB as a subnode
> > with "reg" DT properties:
> > 
> > 1938                         media_blk_ctrl: blk-ctrl@32ec0000 {
> > 1939                                 compatible = "fsl,imx8mp-media-blk-ctrl",
> > 1940                                              "syscon";
> > ...
> > 2003                                 lvds_bridge: bridge@5c {
> > 2004                                         compatible = "fsl,imx8mp-ldb";
> > 2005                                         reg = <0x5c 0x4>, <0x128 0x4>;
> > 2006                                         reg-names = "ldb", "lvds";
> 
> ... i.MX8MP LVDS bridge node is fine with the reg property, but the property
> is not allowed for i.MX93 LVDS bridge node according to commit[1] while
> commit[2] requires the property for all LVDS bridge nodes.  See the contradict
> here?
> 
> [1] 3feaa4342637 dt-bindings: soc: imx93-media-blk-ctrl: Add PDFC subnode to schema and example
> [2] 8aa2f0ac08d3 dt-bindings: display: bridge: ldb: Add check for reg and reg-names
> 
> To avoid the contradict, how about requiring the reg property only for i.MX6SX
> and i.MX8MP LVDS bridge nodes and making it kind of optional for i.MX93 and
> i.MX94 LVDS bridge nodes?  Overall, in terms of the reg property, I feel the
> LVDS bridge nodes look similar to reg-mux/mmio-mux(See reg-mux.yaml) where
> the property is optional.  BTW, there is a mux-controller node with 'mmio-mux'
> compatible string in i.MX8mq syscon@30340000:
> 
> iomuxc_gpr: syscon@30340000 {
> 	compatible = "fsl,imx8mq-iomuxc-gpr", "syscon", "simple-mfd";
> 	reg = <0x30340000 0x10000>;
> 
> 	mux: mux-controller {
> 		compatible = "mmio-mux";
> 		#mux-control-cells = <1>;
> 		mux-reg-masks = <0x34 0x00000004>; /* MIPI_MUX_SEL */
> 	};
> };
> 
> We never know if HW designer would put a mux-controller next to a LVDS
> bridge under a syscon device like gpr or blk-ctrl in future i.MX SoCs,
> so the optional reg property would buy us some flexibility.
> 
> The below patch is what I propose together with a Fixes tag for commit[2].
> Since commit[2] is not in v6.19 and v7.0-rc5 was just released, it seems
> that we have time to land the proposal fix if it makes sense.  WDYT?

Marek, Marco,

Does Ying's proposed solution sound reasonable? Having the 'reg'
property optional for i.MX93 and i.MX94 platforms seems like  a good
compromise. Can we move forward with this?

> 
> --- a/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml
> +++ b/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml
> @@ -28,6 +28,7 @@ properties:
>      const: ldb
>  
>    reg:
> +    minItems: 1
>      maxItems: 2
>  
>    reg-names:
> @@ -68,7 +69,6 @@ required:
>    - compatible
>    - clocks
>    - ports
> -  - reg
>  
>  allOf:
>    - if:
> @@ -83,12 +83,23 @@ allOf:
>          ports:
>            properties:
>              port@2: false
> +
>    - if:
> -      not:
> -        properties:
> -          compatible:
> -            contains:
> -              const: fsl,imx6sx-ldb
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - fsl,imx6sx-ldb
> +              - fsl,imx8mp-ldb
> +    then:
> +      required:
> +        - reg
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: fsl,imx8mp-ldb
>      then:
>        required:
>          - reg-names
> 
> -- 
> Regards,
> Liu Ying

-- 
Thanks,
Laurentiu
Re: [PATCH v8 1/9] dt-bindings: display: fsl,ldb: Add i.MX94 LDB
Posted by Marek Vasut 1 week ago
On 3/25/26 9:02 AM, Laurentiu Palcu wrote:
> On Mon, Mar 23, 2026 at 03:22:35PM +0800, Liu Ying wrote:
>> On Sat, Mar 21, 2026 at 03:37:47AM +0100, Marek Vasut wrote:
>>> On 3/20/26 9:23 AM, Marco Felsch wrote:
>>>
>>> Hello Marco,
>>>
>>>>> The LDB driver was always written with parsing 'reg' out of the DT, so
>>>>
>>>> Not sure what you mean by always.
>>>
>>> By always, I mean since the very beginning.
>>
>> Marek, your below patch is not accepted(at least for now).  In that patch,
>> register offset(s) are directly parsed by calling of_property_read_reg().
>> Without that patch, register offset(s) are determined via device data in
>> driver according to compatible string.
>>
>> [PATCH v3] drm/bridge: fsl-ldb: Parse register offsets from DT
>> https://lore.kernel.org/all/20260104213712.128982-1-marek.vasut@mailbox.org/
>>
>> [...]
>>
>>>
>>>>> encoding the register offsets into the driver was a mistake. The LDB
>>>>> controls two registers, which can be comfortably described in DT.
>>>>
>>>> Sorry but I have to disagree on this. It's no about if it's possible,
>>>> it's about if the abstraction is correct and IMHO the LDB is just one
>>>> subdevice of the syscon. For i.MX6SX the syscon is the iomuxc-gpr for
>>>> the i.MX8M and i.MX9 this is now a blkctrl.
>>>
>>> Right, and the "reg" DT property specifies at which offsets are the LDB
>>> control registers from the start of that blkctrl. What is the problem
>>> with that ?
>>
>> The problem is that ...
>>
>>>
>>> Look at e.g. imx8mp.dtsi as an example with blkctrl and LDB as a subnode
>>> with "reg" DT properties:
>>>
>>> 1938                         media_blk_ctrl: blk-ctrl@32ec0000 {
>>> 1939                                 compatible = "fsl,imx8mp-media-blk-ctrl",
>>> 1940                                              "syscon";
>>> ...
>>> 2003                                 lvds_bridge: bridge@5c {
>>> 2004                                         compatible = "fsl,imx8mp-ldb";
>>> 2005                                         reg = <0x5c 0x4>, <0x128 0x4>;
>>> 2006                                         reg-names = "ldb", "lvds";
>>
>> ... i.MX8MP LVDS bridge node is fine with the reg property, but the property
>> is not allowed for i.MX93 LVDS bridge node according to commit[1] while
>> commit[2] requires the property for all LVDS bridge nodes.  See the contradict
>> here?
>>
>> [1] 3feaa4342637 dt-bindings: soc: imx93-media-blk-ctrl: Add PDFC subnode to schema and example
>> [2] 8aa2f0ac08d3 dt-bindings: display: bridge: ldb: Add check for reg and reg-names
>>
>> To avoid the contradict, how about requiring the reg property only for i.MX6SX
>> and i.MX8MP LVDS bridge nodes and making it kind of optional for i.MX93 and
>> i.MX94 LVDS bridge nodes?  Overall, in terms of the reg property, I feel the
>> LVDS bridge nodes look similar to reg-mux/mmio-mux(See reg-mux.yaml) where
>> the property is optional.  BTW, there is a mux-controller node with 'mmio-mux'
>> compatible string in i.MX8mq syscon@30340000:
>>
>> iomuxc_gpr: syscon@30340000 {
>> 	compatible = "fsl,imx8mq-iomuxc-gpr", "syscon", "simple-mfd";
>> 	reg = <0x30340000 0x10000>;
>>
>> 	mux: mux-controller {
>> 		compatible = "mmio-mux";
>> 		#mux-control-cells = <1>;
>> 		mux-reg-masks = <0x34 0x00000004>; /* MIPI_MUX_SEL */
>> 	};
>> };
>>
>> We never know if HW designer would put a mux-controller next to a LVDS
>> bridge under a syscon device like gpr or blk-ctrl in future i.MX SoCs,
>> so the optional reg property would buy us some flexibility.
>>
>> The below patch is what I propose together with a Fixes tag for commit[2].
>> Since commit[2] is not in v6.19 and v7.0-rc5 was just released, it seems
>> that we have time to land the proposal fix if it makes sense.  WDYT?
> 
> Marek, Marco,
> 
> Does Ying's proposed solution sound reasonable? Having the 'reg'
> property optional for i.MX93 and i.MX94 platforms seems like  a good
> compromise. Can we move forward with this?
I only skimmed through it thus far, I need to read through it again when 
time permits, after which I will reply to it.