* [PATCH v1 0/3] Add eDP lane mapping support
@ 2026-05-14 7:01 Damon Ding
2026-05-14 7:01 ` [PATCH v1 1/3] dt-bindings: display: rockchip: analogix-dp: Expose inherited properties Damon Ding
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Damon Ding @ 2026-05-14 7:01 UTC (permalink / raw)
To: hjc, heiko, andy.yan, maarten.lankhorst, mripard, tzimmermann,
airlied, simona, robh, krzk+dt, conor+dt, andrzej.hajda,
neil.armstrong, rfoss
Cc: dmitry.baryshkov, devicetree, jonas, linux-kernel, dri-devel,
sebastian.reichel, jernej.skrabec, dianders, linux-rockchip,
Damon Ding, Laurent.pinchart, luca.ceresoli, nicolas.frattaroli,
linux-arm-kernel, m.szyprowski
This patch series is followed by:
https://lore.kernel.org/all/20260513074414.2053435-1-damon.ding@rock-chips.com/
This series adds configurable eDP/DP physical lane mapping support
via device tree data-lanes property.
Lane mapping is mainly used for below scenarios:
1. Correct PCB lane swap and differential line routing crossover
without hardware changes;
2. Adapt mismatched lane pin definitions between SoC and eDP panel;
3. Support multiple panel hardware variants on the same board
by configuring data-lanes in device tree only.
The series includes driver implementation and device tree binding
updates to support custom lane mapping configuration from endpoint
node, and keeps default linear lane order if no configuration is given.
Patch 1: Supplement inherited properties for rockchip,analogix-dp schema
Patch 2: Add endpoint data-lanes property to analogix-dp binding
Patch 3: Implement lane mapping in analogix_dp driver
Damon Ding (3):
dt-bindings: display: rockchip: analogix-dp: Expose inherited
properties
dt-bindings: display: bridge: analogix-dp: Add data-lanes support for
endpoint
drm/bridge: analogix_dp: Add support for optional data-lanes mapping
.../bindings/display/bridge/analogix,dp.yaml | 24 ++++++--
.../rockchip/rockchip,analogix-dp.yaml | 7 +++
.../drm/bridge/analogix/analogix_dp_core.c | 56 +++++++++++++++++++
.../drm/bridge/analogix/analogix_dp_core.h | 4 +-
.../gpu/drm/bridge/analogix/analogix_dp_reg.c | 15 +++--
.../gpu/drm/bridge/analogix/analogix_dp_reg.h | 4 ++
6 files changed, 97 insertions(+), 13 deletions(-)
--
2.34.1
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH v1 1/3] dt-bindings: display: rockchip: analogix-dp: Expose inherited properties 2026-05-14 7:01 [PATCH v1 0/3] Add eDP lane mapping support Damon Ding @ 2026-05-14 7:01 ` Damon Ding 2026-05-14 18:16 ` Conor Dooley 2026-05-14 7:01 ` [PATCH v1 2/3] dt-bindings: display: bridge: analogix-dp: Add data-lanes support for endpoint Damon Ding 2026-05-14 7:01 ` [PATCH v1 3/3] drm/bridge: analogix_dp: Add support for optional data-lanes mapping Damon Ding 2 siblings, 1 reply; 9+ messages in thread From: Damon Ding @ 2026-05-14 7:01 UTC (permalink / raw) To: hjc, heiko, andy.yan, maarten.lankhorst, mripard, tzimmermann, airlied, simona, robh, krzk+dt, conor+dt, andrzej.hajda, neil.armstrong, rfoss Cc: dmitry.baryshkov, devicetree, jonas, linux-kernel, dri-devel, sebastian.reichel, jernej.skrabec, dianders, linux-rockchip, Damon Ding, Laurent.pinchart, luca.ceresoli, nicolas.frattaroli, linux-arm-kernel, m.szyprowski Expose the inherited properties from the base analogix-dp schema to satisfy unevaluatedProperties constraints. Signed-off-by: Damon Ding <damon.ding@rock-chips.com> --- .../bindings/display/rockchip/rockchip,analogix-dp.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml b/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml index bb75d898a5c5..896ded87880f 100644 --- a/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml +++ b/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml @@ -50,6 +50,13 @@ properties: aux-bus: $ref: /schemas/display/dp-aux-bus.yaml# + reg: true + interrupts: true + phys: true + phy-names: true + force-hpd: true + ports: true + required: - compatible - clocks -- 2.34.1 _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v1 1/3] dt-bindings: display: rockchip: analogix-dp: Expose inherited properties 2026-05-14 7:01 ` [PATCH v1 1/3] dt-bindings: display: rockchip: analogix-dp: Expose inherited properties Damon Ding @ 2026-05-14 18:16 ` Conor Dooley 2026-05-15 3:57 ` Damon Ding 0 siblings, 1 reply; 9+ messages in thread From: Conor Dooley @ 2026-05-14 18:16 UTC (permalink / raw) To: Damon Ding Cc: heiko, dri-devel, dianders, Laurent.pinchart, andrzej.hajda, airlied, m.szyprowski, simona, robh, rfoss, sebastian.reichel, jernej.skrabec, linux-rockchip, luca.ceresoli, devicetree, conor+dt, jonas, maarten.lankhorst, mripard, linux-arm-kernel, dmitry.baryshkov, neil.armstrong, hjc, linux-kernel, tzimmermann, andy.yan, krzk+dt, nicolas.frattaroli [-- Attachment #1.1: Type: text/plain, Size: 1143 bytes --] On Thu, May 14, 2026 at 03:01:31PM +0800, Damon Ding wrote: > Expose the inherited properties from the base analogix-dp schema > to satisfy unevaluatedProperties constraints. > > Signed-off-by: Damon Ding <damon.ding@rock-chips.com> Given it's unevaluatedProperties, not addtionalProperties, this patch shouldn't be needed? > --- > .../bindings/display/rockchip/rockchip,analogix-dp.yaml | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml b/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml > index bb75d898a5c5..896ded87880f 100644 > --- a/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml > +++ b/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml > @@ -50,6 +50,13 @@ properties: > aux-bus: > $ref: /schemas/display/dp-aux-bus.yaml# > > + reg: true > + interrupts: true > + phys: true > + phy-names: true > + force-hpd: true > + ports: true > + > required: > - compatible > - clocks > -- > 2.34.1 > > [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 228 bytes --] [-- Attachment #2: Type: text/plain, Size: 170 bytes --] _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v1 1/3] dt-bindings: display: rockchip: analogix-dp: Expose inherited properties 2026-05-14 18:16 ` Conor Dooley @ 2026-05-15 3:57 ` Damon Ding 2026-05-15 9:04 ` Conor Dooley 0 siblings, 1 reply; 9+ messages in thread From: Damon Ding @ 2026-05-15 3:57 UTC (permalink / raw) To: Conor Dooley Cc: heiko, dri-devel, dianders, Laurent.pinchart, andrzej.hajda, airlied, m.szyprowski, simona, robh, rfoss, sebastian.reichel, jernej.skrabec, linux-rockchip, luca.ceresoli, devicetree, conor+dt, jonas, maarten.lankhorst, mripard, linux-arm-kernel, dmitry.baryshkov, neil.armstrong, hjc, linux-kernel, tzimmermann, andy.yan, krzk+dt, nicolas.frattaroli Hi Conor, On 5/15/2026 2:16 AM, Conor Dooley wrote: > On Thu, May 14, 2026 at 03:01:31PM +0800, Damon Ding wrote: >> Expose the inherited properties from the base analogix-dp schema >> to satisfy unevaluatedProperties constraints. >> >> Signed-off-by: Damon Ding <damon.ding@rock-chips.com> > > Given it's unevaluatedProperties, not addtionalProperties, this patch > shouldn't be needed? > When I remove both the top-level data-lanes property and those explicit "xxx: true" property entries and run the dtbs check with: make CHECK_DTBS=y CROSS_COMPILE=aarch64-linux-gnu- LT0=none LLVM=1 LLVM_IAS=1 ARCH=arm64 rockchip/rk3588-evb1-v10.dtb rockchip/rk3588s-evb1-v10.dtb rockchip/rk3399-sapphire-excavator.dtb rockchip/rk3576-evb1-v10.dtb -j4 It results in validation errors like these: /home/ding/drm-misc/arch/arm64/boot/dts/rockchip/rk3576-evb1-v10.dtb: edp@27dc0000: ports:port@1:endpoint: Unevaluated properties are not allowed ('data-lanes' was unexpected) from schema $id: http://devicetree.org/schemas/display/rockchip/rockchip,analogix-dp.yaml# /home/ding/drm-misc/arch/arm64/boot/dts/rockchip/rk3576-evb1-v10.dtb: edp@27dc0000: Unevaluated properties are not allowed ('force-hpd', 'interrupts', 'phy-names', 'phys', 'ports', 'reg' were unexpected) from schema $id: http://devicetree.org/schemas/display/rockchip/rockchip,analogix-dp.yaml# I suspect that the properties defined in the child binding are overriding/masking all the inherited properties from the parent Analogix DP schema. Is there a better way to fix this issue without explicitly listing all inherited properties as true? Best regards, Damon >> --- >> .../bindings/display/rockchip/rockchip,analogix-dp.yaml | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml b/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml >> index bb75d898a5c5..896ded87880f 100644 >> --- a/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml >> +++ b/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml >> @@ -50,6 +50,13 @@ properties: >> aux-bus: >> $ref: /schemas/display/dp-aux-bus.yaml# >> >> + reg: true >> + interrupts: true >> + phys: true >> + phy-names: true >> + force-hpd: true >> + ports: true >> + >> required: >> - compatible >> - clocks >> -- >> 2.34.1 >> >> _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v1 1/3] dt-bindings: display: rockchip: analogix-dp: Expose inherited properties 2026-05-15 3:57 ` Damon Ding @ 2026-05-15 9:04 ` Conor Dooley 0 siblings, 0 replies; 9+ messages in thread From: Conor Dooley @ 2026-05-15 9:04 UTC (permalink / raw) To: Damon Ding Cc: heiko, dri-devel, dianders, Laurent.pinchart, andrzej.hajda, airlied, m.szyprowski, simona, robh, rfoss, sebastian.reichel, jernej.skrabec, linux-rockchip, luca.ceresoli, devicetree, conor+dt, jonas, maarten.lankhorst, mripard, linux-arm-kernel, dmitry.baryshkov, neil.armstrong, hjc, Conor Dooley, linux-kernel, tzimmermann, andy.yan, krzk+dt, nicolas.frattaroli [-- Attachment #1.1: Type: text/plain, Size: 3781 bytes --] On Fri, May 15, 2026 at 11:57:58AM +0800, Damon Ding wrote: > Hi Conor, > > On 5/15/2026 2:16 AM, Conor Dooley wrote: > > On Thu, May 14, 2026 at 03:01:31PM +0800, Damon Ding wrote: > > > Expose the inherited properties from the base analogix-dp schema > > > to satisfy unevaluatedProperties constraints. > > > > > > Signed-off-by: Damon Ding <damon.ding@rock-chips.com> > > > > Given it's unevaluatedProperties, not addtionalProperties, this patch > > shouldn't be needed? > > > > When I remove both the top-level data-lanes property and those explicit > "xxx: true" property entries and run the dtbs check with: > > make CHECK_DTBS=y CROSS_COMPILE=aarch64-linux-gnu- LT0=none LLVM=1 > LLVM_IAS=1 ARCH=arm64 rockchip/rk3588-evb1-v10.dtb > rockchip/rk3588s-evb1-v10.dtb rockchip/rk3399-sapphire-excavator.dtb > rockchip/rk3576-evb1-v10.dtb -j4 > > It results in validation errors like these: > > /home/ding/drm-misc/arch/arm64/boot/dts/rockchip/rk3576-evb1-v10.dtb: > edp@27dc0000: ports:port@1:endpoint: Unevaluated properties are not allowed > ('data-lanes' was unexpected) > from schema $id: > http://devicetree.org/schemas/display/rockchip/rockchip,analogix-dp.yaml# > /home/ding/drm-misc/arch/arm64/boot/dts/rockchip/rk3576-evb1-v10.dtb: > edp@27dc0000: Unevaluated properties are not allowed ('force-hpd', > 'interrupts', 'phy-names', 'phys', 'ports', 'reg' were unexpected) > from schema $id: > http://devicetree.org/schemas/display/rockchip/rockchip,analogix-dp.yaml# > > I suspect that the properties defined in the child binding are > overriding/masking all the inherited properties from the parent Analogix DP > schema. > > Is there a better way to fix this issue without explicitly listing all > inherited properties as true? The example in this file uses most of the properties that you mention above: dp@ff970000 { compatible = "rockchip,rk3288-dp"; reg = <0xff970000 0x4000>; interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>; clocks = <&cru SCLK_EDP>, <&cru PCLK_EDP_CTRL>; clock-names = "dp", "pclk"; phys = <&dp_phy>; phy-names = "dp"; resets = <&cru 111>; reset-names = "dp"; rockchip,grf = <&grf>; pinctrl-0 = <&edp_hpd>; pinctrl-names = "default"; dt_binding_check reports no problems with this node, so I think the problem might lie elsewhere? There's no edp node in the dts you mention above, so this looks like an interaction with something that's not yet upstream. If this is required for the rk3576 edp, then you should include this patch in the rk3576 edp support series rather than this one anyway where it can actually be evaluated alongside the node it apparently causes problems with. pw-bot: changes-requested Thanks, Conor. > > Best regards, > Damon > > > > --- > > > .../bindings/display/rockchip/rockchip,analogix-dp.yaml | 7 +++++++ > > > 1 file changed, 7 insertions(+) > > > > > > diff --git a/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml b/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml > > > index bb75d898a5c5..896ded87880f 100644 > > > --- a/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml > > > +++ b/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml > > > @@ -50,6 +50,13 @@ properties: > > > aux-bus: > > > $ref: /schemas/display/dp-aux-bus.yaml# > > > + reg: true > > > + interrupts: true > > > + phys: true > > > + phy-names: true > > > + force-hpd: true > > > + ports: true > > > + > > > required: > > > - compatible > > > - clocks > > > -- > > > 2.34.1 > > > > > > > [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 228 bytes --] [-- Attachment #2: Type: text/plain, Size: 170 bytes --] _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v1 2/3] dt-bindings: display: bridge: analogix-dp: Add data-lanes support for endpoint 2026-05-14 7:01 [PATCH v1 0/3] Add eDP lane mapping support Damon Ding 2026-05-14 7:01 ` [PATCH v1 1/3] dt-bindings: display: rockchip: analogix-dp: Expose inherited properties Damon Ding @ 2026-05-14 7:01 ` Damon Ding 2026-05-14 18:19 ` Conor Dooley 2026-05-14 7:01 ` [PATCH v1 3/3] drm/bridge: analogix_dp: Add support for optional data-lanes mapping Damon Ding 2 siblings, 1 reply; 9+ messages in thread From: Damon Ding @ 2026-05-14 7:01 UTC (permalink / raw) To: hjc, heiko, andy.yan, maarten.lankhorst, mripard, tzimmermann, airlied, simona, robh, krzk+dt, conor+dt, andrzej.hajda, neil.armstrong, rfoss Cc: dmitry.baryshkov, devicetree, jonas, linux-kernel, dri-devel, sebastian.reichel, jernej.skrabec, dianders, linux-rockchip, Damon Ding, Laurent.pinchart, luca.ceresoli, nicolas.frattaroli, linux-arm-kernel, m.szyprowski Add data-lanes property support to the port@1 endpoint for physical lane mapping configuration. Signed-off-by: Damon Ding <damon.ding@rock-chips.com> --- .../bindings/display/bridge/analogix,dp.yaml | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml b/Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml index 62f0521b0924..a82f9b7776c0 100644 --- a/Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml +++ b/Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml @@ -36,19 +36,35 @@ properties: Hotplug detect GPIO. Indicates which GPIO should be used for hotplug detection + data-lanes: + $ref: /schemas/types.yaml#/definitions/uint32-array + deprecated: true + minItems: 1 + maxItems: 4 + items: + maximum: 3 + ports: $ref: /schemas/graph.yaml#/properties/ports properties: port@0: $ref: /schemas/graph.yaml#/properties/port - description: - Input node to receive pixel data. + description: Input node to receive pixel data. port@1: $ref: /schemas/graph.yaml#/properties/port - description: - Port node with one endpoint connected to a dp-connector node. + description: Port node with one endpoint connected to sink device node. + properties: + endpoint: + $ref: /schemas/media/video-interfaces.yaml# + unevaluatedProperties: false + properties: + data-lanes: + minItems: 1 + maxItems: 4 + items: + enum: [ 0, 1, 2, 3 ] required: - port@0 -- 2.34.1 _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v1 2/3] dt-bindings: display: bridge: analogix-dp: Add data-lanes support for endpoint 2026-05-14 7:01 ` [PATCH v1 2/3] dt-bindings: display: bridge: analogix-dp: Add data-lanes support for endpoint Damon Ding @ 2026-05-14 18:19 ` Conor Dooley 2026-05-15 2:53 ` Damon Ding 0 siblings, 1 reply; 9+ messages in thread From: Conor Dooley @ 2026-05-14 18:19 UTC (permalink / raw) To: Damon Ding Cc: heiko, dri-devel, dianders, Laurent.pinchart, andrzej.hajda, airlied, m.szyprowski, simona, robh, rfoss, sebastian.reichel, jernej.skrabec, linux-rockchip, luca.ceresoli, devicetree, conor+dt, jonas, maarten.lankhorst, mripard, linux-arm-kernel, dmitry.baryshkov, neil.armstrong, hjc, linux-kernel, tzimmermann, andy.yan, krzk+dt, nicolas.frattaroli [-- Attachment #1.1: Type: text/plain, Size: 2216 bytes --] On Thu, May 14, 2026 at 03:01:32PM +0800, Damon Ding wrote: > Add data-lanes property support to the port@1 endpoint for physical > lane mapping configuration. > > Signed-off-by: Damon Ding <damon.ding@rock-chips.com> > --- > .../bindings/display/bridge/analogix,dp.yaml | 24 +++++++++++++++---- > 1 file changed, 20 insertions(+), 4 deletions(-) > > diff --git a/Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml b/Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml > index 62f0521b0924..a82f9b7776c0 100644 > --- a/Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml > +++ b/Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml > @@ -36,19 +36,35 @@ properties: > Hotplug detect GPIO. > Indicates which GPIO should be used for hotplug detection > > + data-lanes: > + $ref: /schemas/types.yaml#/definitions/uint32-array > + deprecated: true Why are you adding a new property as deprecated? Why does this duplicate what you're adding to the port node? At the very least, your commit is lacking an explanation. pw-bot: changes-requested Cheers, Conor. > + minItems: 1 > + maxItems: 4 > + items: > + maximum: 3 > + > ports: > $ref: /schemas/graph.yaml#/properties/ports > > properties: > port@0: > $ref: /schemas/graph.yaml#/properties/port > - description: > - Input node to receive pixel data. > + description: Input node to receive pixel data. > > port@1: > $ref: /schemas/graph.yaml#/properties/port > - description: > - Port node with one endpoint connected to a dp-connector node. > + description: Port node with one endpoint connected to sink device node. > + properties: > + endpoint: > + $ref: /schemas/media/video-interfaces.yaml# > + unevaluatedProperties: false > + properties: > + data-lanes: > + minItems: 1 > + maxItems: 4 > + items: > + enum: [ 0, 1, 2, 3 ] > > required: > - port@0 > -- > 2.34.1 > [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 228 bytes --] [-- Attachment #2: Type: text/plain, Size: 170 bytes --] _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v1 2/3] dt-bindings: display: bridge: analogix-dp: Add data-lanes support for endpoint 2026-05-14 18:19 ` Conor Dooley @ 2026-05-15 2:53 ` Damon Ding 0 siblings, 0 replies; 9+ messages in thread From: Damon Ding @ 2026-05-15 2:53 UTC (permalink / raw) To: Conor Dooley Cc: heiko, dri-devel, dianders, Laurent.pinchart, andrzej.hajda, airlied, m.szyprowski, simona, robh, rfoss, sebastian.reichel, jernej.skrabec, linux-rockchip, luca.ceresoli, devicetree, conor+dt, jonas, maarten.lankhorst, mripard, linux-arm-kernel, dmitry.baryshkov, neil.armstrong, hjc, linux-kernel, tzimmermann, andy.yan, krzk+dt, nicolas.frattaroli Hi Conor, On 5/15/2026 2:19 AM, Conor Dooley wrote: > On Thu, May 14, 2026 at 03:01:32PM +0800, Damon Ding wrote: >> Add data-lanes property support to the port@1 endpoint for physical >> lane mapping configuration. >> >> Signed-off-by: Damon Ding <damon.ding@rock-chips.com> >> --- >> .../bindings/display/bridge/analogix,dp.yaml | 24 +++++++++++++++---- >> 1 file changed, 20 insertions(+), 4 deletions(-) >> >> diff --git a/Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml b/Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml >> index 62f0521b0924..a82f9b7776c0 100644 >> --- a/Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml >> +++ b/Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml >> @@ -36,19 +36,35 @@ properties: >> Hotplug detect GPIO. >> Indicates which GPIO should be used for hotplug detection >> >> + data-lanes: >> + $ref: /schemas/types.yaml#/definitions/uint32-array >> + deprecated: true > > Why are you adding a new property as deprecated? Why does this duplicate > what you're adding to the port node? At the very least, your commit is > lacking an explanation. > pw-bot: changes-requested > Thank you for the review. I referenced the implementation in Documentation/devicetree/bindings/display/msm/dp-controller.yaml. After evaluating QCOM DP driver and other drivers, I agree that implementing 'data-lanes' in the endpoint node is the preferred and common approach nowadays. The top-level `data-lanes` property together with the `deprecated` mark was leftover content from my early reference and arrangement, which I neglected to delete before submitting. It is redundant, unreasonable and should not have been added at all. I will fix it in the next version. Best regards, Damon > >> + minItems: 1 >> + maxItems: 4 >> + items: >> + maximum: 3 >> + >> ports: >> $ref: /schemas/graph.yaml#/properties/ports >> >> properties: >> port@0: >> $ref: /schemas/graph.yaml#/properties/port >> - description: >> - Input node to receive pixel data. >> + description: Input node to receive pixel data. >> >> port@1: >> $ref: /schemas/graph.yaml#/properties/port >> - description: >> - Port node with one endpoint connected to a dp-connector node. >> + description: Port node with one endpoint connected to sink device node. >> + properties: >> + endpoint: >> + $ref: /schemas/media/video-interfaces.yaml# >> + unevaluatedProperties: false >> + properties: >> + data-lanes: >> + minItems: 1 >> + maxItems: 4 >> + items: >> + enum: [ 0, 1, 2, 3 ] >> >> required: >> - port@0 >> -- >> 2.34.1 >> _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v1 3/3] drm/bridge: analogix_dp: Add support for optional data-lanes mapping 2026-05-14 7:01 [PATCH v1 0/3] Add eDP lane mapping support Damon Ding 2026-05-14 7:01 ` [PATCH v1 1/3] dt-bindings: display: rockchip: analogix-dp: Expose inherited properties Damon Ding 2026-05-14 7:01 ` [PATCH v1 2/3] dt-bindings: display: bridge: analogix-dp: Add data-lanes support for endpoint Damon Ding @ 2026-05-14 7:01 ` Damon Ding 2 siblings, 0 replies; 9+ messages in thread From: Damon Ding @ 2026-05-14 7:01 UTC (permalink / raw) To: hjc, heiko, andy.yan, maarten.lankhorst, mripard, tzimmermann, airlied, simona, robh, krzk+dt, conor+dt, andrzej.hajda, neil.armstrong, rfoss Cc: dmitry.baryshkov, devicetree, jonas, linux-kernel, dri-devel, sebastian.reichel, jernej.skrabec, dianders, linux-rockchip, Damon Ding, Laurent.pinchart, luca.ceresoli, nicolas.frattaroli, linux-arm-kernel, m.szyprowski Parse the optional 'data-lanes' device tree property to support custom physical lane mapping configuration. If no valid configuration is found, fall back to the default lane map (0, 1, 2, 3) automatically and keep the driver running. Signed-off-by: Damon Ding <damon.ding@rock-chips.com> --- .../drm/bridge/analogix/analogix_dp_core.c | 56 +++++++++++++++++++ .../drm/bridge/analogix/analogix_dp_core.h | 4 +- .../gpu/drm/bridge/analogix/analogix_dp_reg.c | 15 +++-- .../gpu/drm/bridge/analogix/analogix_dp_reg.h | 4 ++ 4 files changed, 70 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index c8eb3511f92a..a7d19c3be7e0 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -1234,6 +1234,59 @@ static const struct drm_bridge_funcs analogix_dp_bridge_funcs = { .detect = analogix_dp_bridge_detect, }; +static int analogix_dp_dt_parse_lanes_map(struct analogix_dp_device *dp) +{ + struct video_info *video_info = &dp->video_info; + struct device_node *endpoint; + u32 tmp[LANE_COUNT4]; + u32 map[LANE_COUNT4] = {0, 1, 2, 3}; + bool used[LANE_COUNT4] = {false}; + int num_lanes; + int ret, i; + + memcpy(video_info->lane_map, map, sizeof(map)); + + num_lanes = drm_of_get_data_lanes_count_ep(dp->dev->of_node, 1, 0, 1, + video_info->max_lane_count); + if (num_lanes < 0) + return -EINVAL; + + endpoint = of_graph_get_endpoint_by_regs(dp->dev->of_node, 1, -1); + if (!endpoint) + return -EINVAL; + + ret = of_property_read_u32_array(endpoint, "data-lanes", tmp, num_lanes); + of_node_put(endpoint); + if (ret) + return -EINVAL; + + for (i = 0; i < num_lanes; i++) { + if (tmp[i] >= LANE_COUNT4) { + dev_dbg(dp->dev, "data-lanes[%d] = %u is out of range\n", i, tmp[i]); + return -EINVAL; + } + + if (used[tmp[i]]) { + dev_dbg(dp->dev, "data-lanes[%d] = %u is duplicate\n", i, tmp[i]); + return -EINVAL; + } + + used[tmp[i]] = true; + map[i] = tmp[i]; + } + + for (i = 0; i < LANE_COUNT4 && num_lanes < LANE_COUNT4; i++) { + if (!used[i]) + map[num_lanes++] = i; + } + + dev_dbg(dp->dev, "Using parsed lane map: <%u %u %u %u>\n", map[0], map[1], map[2], map[3]); + + memcpy(video_info->lane_map, map, sizeof(map)); + + return 0; +} + static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp) { struct device_node *dp_node = dp->dev->of_node; @@ -1266,6 +1319,9 @@ static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp) break; } + if (analogix_dp_dt_parse_lanes_map(dp)) + dev_dbg(dp->dev, "No valid data-lanes found, using default lane map\n"); + return 0; } diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h index 17347448c6b0..634fad241e69 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h @@ -137,6 +137,8 @@ struct video_info { int max_link_rate; enum link_lane_count_type max_lane_count; + + u32 lane_map[LANE_COUNT4]; }; struct link_train { @@ -175,7 +177,7 @@ struct analogix_dp_device { /* analogix_dp_reg.c */ void analogix_dp_enable_video_mute(struct analogix_dp_device *dp, bool enable); void analogix_dp_stop_video(struct analogix_dp_device *dp); -void analogix_dp_lane_swap(struct analogix_dp_device *dp, bool enable); +void analogix_dp_lane_mapping(struct analogix_dp_device *dp); void analogix_dp_init_analog_param(struct analogix_dp_device *dp); void analogix_dp_init_interrupt(struct analogix_dp_device *dp); void analogix_dp_reset(struct analogix_dp_device *dp); diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c index 6207ded7ffd5..f5f55bd25062 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c @@ -48,16 +48,15 @@ void analogix_dp_stop_video(struct analogix_dp_device *dp) writel(reg, dp->reg_base + ANALOGIX_DP_VIDEO_CTL_1); } -void analogix_dp_lane_swap(struct analogix_dp_device *dp, bool enable) +void analogix_dp_lane_mapping(struct analogix_dp_device *dp) { + u32 *lane_map = dp->video_info.lane_map; u32 reg; - if (enable) - reg = LANE3_MAP_LOGIC_LANE_0 | LANE2_MAP_LOGIC_LANE_1 | - LANE1_MAP_LOGIC_LANE_2 | LANE0_MAP_LOGIC_LANE_3; - else - reg = LANE3_MAP_LOGIC_LANE_3 | LANE2_MAP_LOGIC_LANE_2 | - LANE1_MAP_LOGIC_LANE_1 | LANE0_MAP_LOGIC_LANE_0; + reg = lane_map[0] << LANE0_MAP_SHIFT; + reg |= lane_map[1] << LANE1_MAP_SHIFT; + reg |= lane_map[2] << LANE2_MAP_SHIFT; + reg |= lane_map[3] << LANE3_MAP_SHIFT; writel(reg, dp->reg_base + ANALOGIX_DP_LANE_MAP); } @@ -140,7 +139,7 @@ void analogix_dp_reset(struct analogix_dp_device *dp) usleep_range(20, 30); - analogix_dp_lane_swap(dp, 0); + analogix_dp_lane_mapping(dp); writel(0x0, dp->reg_base + ANALOGIX_DP_SYS_CTL_1); writel(0x40, dp->reg_base + ANALOGIX_DP_SYS_CTL_2); diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.h b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.h index 12735139046c..ac914e37089b 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.h +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.h @@ -209,6 +209,10 @@ #define LANE0_MAP_LOGIC_LANE_1 (0x1 << 0) #define LANE0_MAP_LOGIC_LANE_2 (0x2 << 0) #define LANE0_MAP_LOGIC_LANE_3 (0x3 << 0) +#define LANE3_MAP_SHIFT (6) +#define LANE2_MAP_SHIFT (4) +#define LANE1_MAP_SHIFT (2) +#define LANE0_MAP_SHIFT (0) /* ANALOGIX_DP_ANALOG_CTL_1 */ #define TX_TERMINAL_CTRL_50_OHM (0x1 << 4) -- 2.34.1 _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-05-15 9:05 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-05-14 7:01 [PATCH v1 0/3] Add eDP lane mapping support Damon Ding 2026-05-14 7:01 ` [PATCH v1 1/3] dt-bindings: display: rockchip: analogix-dp: Expose inherited properties Damon Ding 2026-05-14 18:16 ` Conor Dooley 2026-05-15 3:57 ` Damon Ding 2026-05-15 9:04 ` Conor Dooley 2026-05-14 7:01 ` [PATCH v1 2/3] dt-bindings: display: bridge: analogix-dp: Add data-lanes support for endpoint Damon Ding 2026-05-14 18:19 ` Conor Dooley 2026-05-15 2:53 ` Damon Ding 2026-05-14 7:01 ` [PATCH v1 3/3] drm/bridge: analogix_dp: Add support for optional data-lanes mapping Damon Ding
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox