Skip to contentSkip to conversation

Add eDP lane mapping support

PATCH Superseded Damon Ding 5 participants 15 messages May 29 – Jun 1

Subsystems (6)

v4 of 8 Superseded Latest is v8 →

lore
Share & tools
lore

Damon Ding

author
#0 lore raw

v4 cover Add eDP lane mapping support

This series adds configurable eDP 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: Add endpoint data-lanes property to analogix-dp binding Patch 2: Add validation for samsung,lane-count property as preparation Patch 3: Implement lane mapping in analogix_dp driver

Damon Ding (3):
dt-bindings: display: bridge: analogix-dp: Add data-lanes support for
endpoint
drm/bridge: analogix_dp: Add validation for samsung,lane-count
property
drm/bridge: analogix_dp: Add support for optional data-lanes mapping

 .../bindings/display/bridge/analogix,dp.yaml  | 19 +++--
 .../rockchip/rockchip,analogix-dp.yaml        |  1 +
 .../drm/bridge/analogix/analogix_dp_core.c    | 69 ++++++++++++++++++-
 .../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, 96 insertions(+), 16 deletions(-)

---

Changes in v2:
- Add lane mapping application scenarios in commit message.
- Remove redundant deprecated property 'data-lanes' for eDP node.
- Update port@1 $ref to /schemas/graph.yaml#/$defs/port-base.

Changes in v3:
- Squash [PATCH v2 2/3] into [PATCH v2 1/3].
- Add unevaluatedProperties: false to both the port@1 and endpoint nodes.

Changes in v4:
- Add validation for samsung,lane-count property as preparation.

Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v4 1/3 dt-bindings: display: bridge: analogix-dp: Add data-lanes support for endpoint

Add data-lanes property support to the port@1 endpoint for physical lane mapping configuration.

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.

Additionally, add data-lanes setting in Rockchip eDP DT node example to show actual lane mapping usage.

---

Changes in v2:
- Add lane mapping application scenarios in commit message.
- Remove redundant deprecated property 'data-lanes' for eDP node.
- Update port@1 $ref to /schemas/graph.yaml#/$defs/port-base.

Changes in v3:
- Squash data-lanes adjustment of Rockchip eDP DT example into this commit.
- Add unevaluatedProperties: false to both the port@1 and endpoint nodes.

---
 .../bindings/display/bridge/analogix,dp.yaml  | 19 ++++++++++++++-----
 .../rockchip/rockchip,analogix-dp.yaml        |  1 +
 2 files changed, 15 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml +14 -5
index 62f0521b0924..ecf206871cdd 100644
@@ -42,13 +42,22 @@ properties:
     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.
+        $ref: /schemas/graph.yaml#/$defs/port-base
+        unevaluatedProperties: false
+        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
Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml +1 -0
index d99b23b88cc5..f690ee393fdb 100644
@@ -117,6 +117,7 @@ examples:
           reg = <1>;
 
           edp_out_panel: endpoint {
+            data-lanes = <0 1>;
             remote-endpoint = <&panel_in_edp>;
           };
         };
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH v4 1/3] dt-bindings: display: bridge: analogix-dp: Add data-lanes support for endpoint

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] Device Tree Schema Validation Bypass for data-lanes property --

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Device Tree Schema Validation Bypass for data-lanes property
--

commit cd3810bac14e15433ba605ad5fc1eeb8345f5c17
Author: Damon Ding <[email protected]>

dt-bindings: display: bridge: analogix-dp: Add data-lanes support for endpoint

This commit adds support for the data-lanes property to the port@1 endpoint in the analogix-dp binding. It allows configuration of physical lane mappings to handle scenarios like PCB lane swaps or mismatched pin definitions. The patch also updates the rockchip eDP DT node example to demonstrate this usage.

Quoted 4 lines
Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml +0 -0
index 62f0521b09245..ecf206871cdde 100644

[ ... ]

Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml properties: · line 52

Quoted 9 lines
       port@1:
Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml +5 -3
-        $ref: /schemas/graph.yaml#/properties/port
-        description:
-          Port node with one endpoint connected to a dp-connector node.
+        $ref: /schemas/graph.yaml#/$defs/port-base
+        unevaluatedProperties: false
+        description: Port node with one endpoint connected to sink device node.
+        properties:
+          endpoint:

[Severity: Low]
Will this literal "endpoint" property match nodes in existing device trees?

It looks like multiple existing device trees, such as rk3399-evb.dts and rk3288-evb.dtsi, define the endpoint with a unit address as "endpoint@0".

Because these nodes do not perfectly match the literal name "endpoint", wouldn't they bypass this constraint block entirely, meaning any data-lanes configuration inside them will not be validated against the specified enum or maxItems limits?

Quoted 8 lines
Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml +8 -0
+            $ref: /schemas/media/video-interfaces.yaml#
+            unevaluatedProperties: false
+            properties:
+              data-lanes:
+                minItems: 1
+                maxItems: 4
+                items:
+                  enum: [ 0, 1, 2, 3 ]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Acked-by on v4 1/3
#3 lore raw

Re: [PATCH v4 1/3] dt-bindings: display: bridge: analogix-dp: Add data-lanes support for endpoint

In reply to Damon Ding
Quoted 10 lines · Damon Ding

Add data-lanes property support to the port@1 endpoint for physical lane mapping configuration.

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.

Quoted 4 lines

Additionally, add data-lanes setting in Rockchip eDP DT node example to show actual lane mapping usage.

Not entirely sure if this is correct, but I'll leave that decision up to the display folks who know the hardware.
pw-bot: not-applicable

Cheers,
Conor.

Quoted 66 lines

---

Changes in v2:
- Add lane mapping application scenarios in commit message.
- Remove redundant deprecated property 'data-lanes' for eDP node.
- Update port@1 $ref to /schemas/graph.yaml#/$defs/port-base.

Changes in v3:
- Squash data-lanes adjustment of Rockchip eDP DT example into this commit.
- Add unevaluatedProperties: false to both the port@1 and endpoint nodes.

---
 .../bindings/display/bridge/analogix,dp.yaml  | 19 ++++++++++++++-----
 .../rockchip/rockchip,analogix-dp.yaml        |  1 +
 2 files changed, 15 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml +14 -5
index 62f0521b0924..ecf206871cdd 100644
@@ -42,13 +42,22 @@ properties:
     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.
+        $ref: /schemas/graph.yaml#/$defs/port-base
+        unevaluatedProperties: false
+        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
Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml +1 -0
index d99b23b88cc5..f690ee393fdb 100644
@@ -117,6 +117,7 @@ examples:
           reg = <1>;
 
           edp_out_panel: endpoint {
+            data-lanes = <0 1>;
             remote-endpoint = <&panel_in_edp>;
           };
         };
Signature · 1 line
2.34.1
Reviewed-by on v4 1/3
#4 lore raw

Re: [PATCH v4 1/3] dt-bindings: display: bridge: analogix-dp: Add data-lanes support for endpoint

In reply to Damon Ding

Hi,

Quoted 10 lines · Damon Ding

Add data-lanes property support to the port@1 endpoint for physical lane mapping configuration.

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.

Quoted 6 lines

Additionally, add data-lanes setting in Rockchip eDP DT node example to show actual lane mapping usage.

---

Greetings,

-- Sebastian

Quoted 62 lines

Changes in v2:
- Add lane mapping application scenarios in commit message.
- Remove redundant deprecated property 'data-lanes' for eDP node.
- Update port@1 $ref to /schemas/graph.yaml#/$defs/port-base.

Changes in v3:
- Squash data-lanes adjustment of Rockchip eDP DT example into this commit.
- Add unevaluatedProperties: false to both the port@1 and endpoint nodes.

---
 .../bindings/display/bridge/analogix,dp.yaml  | 19 ++++++++++++++-----
 .../rockchip/rockchip,analogix-dp.yaml        |  1 +
 2 files changed, 15 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml +14 -5
index 62f0521b0924..ecf206871cdd 100644
@@ -42,13 +42,22 @@ properties:
     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.
+        $ref: /schemas/graph.yaml#/$defs/port-base
+        unevaluatedProperties: false
+        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
Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml +1 -0
index d99b23b88cc5..f690ee393fdb 100644
@@ -117,6 +117,7 @@ examples:
           reg = <1>;
 
           edp_out_panel: endpoint {
+            data-lanes = <0 1>;
             remote-endpoint = <&panel_in_edp>;
           };
         };
Signature · 1 line
2.34.1
author
#5 lore raw

PATCH v4 2/3 drm/bridge: analogix_dp: Add validation for samsung,lane-count property

In reply to Damon Ding

Add range check for samsung,lane-count to avoid invalid values. Validation is only applied when the property exists to maintain backward compatibility.

---
 drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +11 -2
index 8cf6b73bceac..699a7f380c56 100644
@@ -1238,6 +1238,7 @@ static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp)
 {
 	struct device_node *dp_node = dp->dev->of_node;
 	struct video_info *video_info = &dp->video_info;
+	int ret;
 
 	switch (dp->plat_data->dev_type) {
 	case RK3288_DP:
@@ -1260,8 +1261,16 @@ static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp)
 		 */
 		of_property_read_u32(dp_node, "samsung,link-rate",
 				     &video_info->max_link_rate);
-		of_property_read_u32(dp_node, "samsung,lane-count",
-				     &video_info->max_lane_count);
+		ret = of_property_read_u32(dp_node, "samsung,lane-count",
+					   &video_info->max_lane_count);
+		if (!ret) {
+			if (video_info->max_lane_count == 0 ||
+			    video_info->max_lane_count > LANE_COUNT4) {
+				dev_err(dp->dev, "samsung,lane-count = %d is out of range\n",
+					video_info->max_lane_count);
+				return -EINVAL;
+			}
+		}
 		break;
 	}
 
Signature · 1 line
2.34.1
#6 lore raw

Re: [PATCH v4 2/3] drm/bridge: analogix_dp: Add validation for samsung,lane-count property

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] The bounds check for samsung,lane-count incorrectly accepts invalid lane counts (like 3) and can be entirely bypassed with large values due to signed comparison, leaving a heap overflow vulnerability unfixed. --

commit f84cb246760d7a4c631b55b3c7a41c458926dcf4
Author: Damon Ding <[email protected]>

drm/bridge: analogix_dp: Add validation for samsung,lane-count property

This patch adds a range check for the samsung,lane-count device tree property to avoid invalid values. The validation is only applied when the property exists to maintain backward compatibility.

Quoted 3 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +0 -0

[ ... ]

drivers/gpu/drm/bridge/analogix/analogix_dp_core.c static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp) · line 1268

Quoted 11 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +5 -2
@@ -1260,8 +1261,16 @@ static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp)
 		 */
 		of_property_read_u32(dp_node, "samsung,link-rate",
 				     &video_info->max_link_rate);
-		of_property_read_u32(dp_node, "samsung,lane-count",
-				     &video_info->max_lane_count);
+		ret = of_property_read_u32(dp_node, "samsung,lane-count",
+					   &video_info->max_lane_count);
+		if (!ret) {
+			if (video_info->max_lane_count == 0 ||
+			    video_info->max_lane_count > LANE_COUNT4) {

[Severity: High]
This is a pre-existing issue, but does this bounds check effectively prevent all invalid lane counts?

Since max_lane_count is defined as an enum link_lane_count_type, on ARM architectures (following AAPCS) enums without negative values that fit in a signed int are represented as signed int. If of_property_read_u32 writes a large unsigned value like 0xFFFFFFFF into this enum, it is interpreted as -1. The signed comparison -1 > 4 evaluates to false, which bypasses the validation.

When this large value is cast back to u32 later in the driver, it could allow dp->link_train.lane_count to remain at a malicious value read from the sink's DPCD, eventually leading to a heap buffer overflow when initializing the cr_loop array which is sized for only 4 elements.

Additionally, does this check inadvertently allow 3, which is an invalid DisplayPort lane count?

Would it be safer to read the property into a local u32 variable, validate it strictly, and only then assign it to video_info->max_lane_count?

Quoted 8 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +5 -0
+				dev_err(dp->dev, "samsung,lane-count = %d is out of range\n",
+					video_info->max_lane_count);
+				return -EINVAL;
+			}
+		}
 		break;
 	}
 
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
reviewer
#7 lore raw

Re: [PATCH v4 2/3] drm/bridge: analogix_dp: Add validation for samsung,lane-count property

In reply to Damon Ding

On Fri, 29 May 2026 12:05:29 +0800, Damon Ding <[email protected]> wrote:

Hello Damon,

Quoted 6 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +0 -0
index 8cf6b73bceac..699a7f380c56 100644

drivers/gpu/drm/bridge/analogix/analogix_dp_core.c static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp) · line 1268

Quoted 10 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +5 -2
@@ -1260,8 +1261,16 @@ static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp)
 		 */
 		of_property_read_u32(dp_node, "samsung,link-rate",
 				     &video_info->max_link_rate);
-		of_property_read_u32(dp_node, "samsung,lane-count",
-				     &video_info->max_lane_count);
+		ret = of_property_read_u32(dp_node, "samsung,lane-count",
+					   &video_info->max_lane_count);
+		if (!ret) {
+			if (video_info->max_lane_count == 0 ||
+			    video_info->max_lane_count > LANE_COUNT4) {

This sashiko report seems to me valid.

But I'n no DP expert, I have no idea whether this ther one is valid.

drivers/gpu/drm/bridge/analogix/analogix_dp_core.c static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp) · line 1273

Quoted 5 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +5 -0
+				dev_err(dp->dev, "samsung,lane-count = %d is out of range\n",
+					video_info->max_lane_count);
+				return -EINVAL;
+			}
+		}

As reported by sashiko, 'count == 0' should be 'count <= 0', being an enum.

Additionally I'd avoid the nested if, and I think using dev_err_probe() is correct here (we are only called by probe functions), so it all could become:

   if (ret || count <= 0 || count > LANE_COUNT0)
        return dev_err_probe(...);

There are other sashiko reports to patch 3, and at least one seems valid to me. Can you either fix them in the next iteration or elaborate on why the code is correct there?

Thanks!

Signature · 3 lines
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
reviewer
#8 lore raw

Re: [PATCH v4 2/3] drm/bridge: analogix_dp: Add validation for samsung,lane-count property

Quoted 14 lines · Luca Ceresoli

On Fri, 29 May 2026 12:05:29 +0800, Damon Ding <[email protected]> wrote:

Hello Damon,

Quoted 10 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +0 -1
index 8cf6b73bceac..699a7f380c56 100644
@@ -1260,8 +1261,16 @@ static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp)
 		 */
 		of_property_read_u32(dp_node, "samsung,link-rate",
 				     &video_info->max_link_rate);
-		of_property_read_u32(dp_node, "samsung,lane-count",
Quoted 8 lines

drivers/gpu/drm/bridge/analogix/analogix_dp_core.c static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp) · line 1268

Quoted 6 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +5 -1
-				     &video_info->max_lane_count);
+		ret = of_property_read_u32(dp_node, "samsung,lane-count",
+					   &video_info->max_lane_count);
+		if (!ret) {
+			if (video_info->max_lane_count == 0 ||
+			    video_info->max_lane_count > LANE_COUNT4) {

This sashiko report seems to me valid.

Meh, messed up with 'b4 review' :-/ Apologies

"This sashiko report" [0] was about an enum being signed, so '== 0' could miss negative numbers coming from bogus DT values higher than 1^31.

Quoted 2 lines

But I'n no DP expert, I have no idea whether this ther one is valid.

And this was about "Additionally, does this check inadvertently allow 3, which is an invalid DisplayPort lane count?"

Quoted 12 lines

drivers/gpu/drm/bridge/analogix/analogix_dp_core.c static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp) · line 1273

Quoted 5 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +5 -0
+				dev_err(dp->dev, "samsung,lane-count = %d is out of range\n",
+					video_info->max_lane_count);
+				return -EINVAL;
+			}
+		}

As reported by sashiko, 'count == 0' should be 'count <= 0', being an enum.

Additionally I'd avoid the nested if, and I think using dev_err_probe() is correct here (we are only called by probe functions), so it all could become:

Quoted 8 lines
   if (ret || count <= 0 || count > LANE_COUNT0)
        return dev_err_probe(...);

There are other sashiko reports to patch 3, and at least one seems valid to me. Can you either fix them in the next iteration or elaborate on why the code is correct there?

Thanks!

[0] https://sashiko.dev/#/patchset/20260529040530.741336-1-damon.ding%40rock-chips.com

Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

author
#9 lore raw

Re: [PATCH v4 2/3] drm/bridge: analogix_dp: Add validation for samsung,lane-count property

Hi Luca,

Quoted 24 lines · Luca Ceresoli
Quoted 14 lines · Luca Ceresoli

On Fri, 29 May 2026 12:05:29 +0800, Damon Ding <[email protected]> wrote:

Hello Damon,

Quoted 10 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +0 -1
index 8cf6b73bceac..699a7f380c56 100644
@@ -1260,8 +1261,16 @@ static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp)
  		 */
  		of_property_read_u32(dp_node, "samsung,link-rate",
  				     &video_info->max_link_rate);
-		of_property_read_u32(dp_node, "samsung,lane-count",
Quoted 8 lines

drivers/gpu/drm/bridge/analogix/analogix_dp_core.c static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp) · line 1268

Quoted 6 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +5 -1
-				     &video_info->max_lane_count);
+		ret = of_property_read_u32(dp_node, "samsung,lane-count",
+					   &video_info->max_lane_count);
+		if (!ret) {
+			if (video_info->max_lane_count == 0 ||
+			    video_info->max_lane_count > LANE_COUNT4) {

This sashiko report seems to me valid.

Quoted 5 lines

Meh, messed up with 'b4 review' :-/ Apologies

"This sashiko report" [0] was about an enum being signed, so '== 0' could miss negative numbers coming from bogus DT values higher than 1^31.

Ah, I agree. It would be better to add a new inline function to validate that the lane count passed from DT is exactly 1, 2, or 4, just as Sashiko suggested.

Quoted 6 lines
Quoted 2 lines

But I'n no DP expert, I have no idea whether this ther one is valid.

And this was about "Additionally, does this check inadvertently allow 3, which is an invalid DisplayPort lane count?"

Yes, the DisplayPort specification only allows lane counts of 1, 2, or 4. I did miss the check for the invalid value 3 in the current code.

(BTW: I did not find a common helper function in drm_dp_helper.h to validate valid DP lane counts (1, 2, 4). I'm not sure if it would be better to add a generic lane count validation function to the DP helper library instead, to avoid duplicating the same functionality across individual DP drivers. Perhaps other DP experts could provide some advice on this.)

Quoted 12 lines
Quoted 12 lines

drivers/gpu/drm/bridge/analogix/analogix_dp_core.c static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp) · line 1273

Quoted 5 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +5 -0
+				dev_err(dp->dev, "samsung,lane-count = %d is out of range\n",
+					video_info->max_lane_count);
+				return -EINVAL;
+			}
+		}

As reported by sashiko, 'count == 0' should be 'count <= 0', being an enum.

Additionally I'd avoid the nested if, and I think using dev_err_probe() is correct here (we are only called by probe functions), so it all could become:

Quoted 6 lines
Quoted 6 lines
    if (ret || count <= 0 || count > LANE_COUNT0)
         return dev_err_probe(...);

There are other sashiko reports to patch 3, and at least one seems valid to me. Can you either fix them in the next iteration or elaborate on why the code is correct there?

Yes, I will add a helper function to validate the valid lane counts (1, 2, 4) and use dev_err_probe() instead in next version.

Quoted 4 lines

[0] https://sashiko.dev/#/patchset/20260529040530.741336-1-damon.ding%40rock-chips.com

Best regards,
Damon

reviewer
#10 lore raw

Re: [PATCH v4 2/3] drm/bridge: analogix_dp: Add validation for samsung,lane-count property

Hello Damon,

Quoted 23 lines · Damon Ding

Hi Luca,

Quoted 6 lines · Luca Ceresoli

On Sat May 30, 2026 at 3:33 PM CEST, Luca Ceresoli wrote:

Meh, messed up with 'b4 review' :-/ Apologies

"This sashiko report" [0] was about an enum being signed, so '== 0' could miss negative numbers coming from bogus DT values higher than 1^31.

Ah, I agree. It would be better to add a new inline function to validate that the lane count passed from DT is exactly 1, 2, or 4, just as Sashiko suggested.

Quoted 4 lines
Quoted 1 line

And this was about "Additionally, does this check inadvertently allow 3, which is an invalid DisplayPort lane count?"

Yes, the DisplayPort specification only allows lane counts of 1, 2, or
4. I did miss the check for the invalid value 3 in the current code.

Quoted 6 lines

(BTW: I did not find a common helper function in drm_dp_helper.h to validate valid DP lane counts (1, 2, 4). I'm not sure if it would be better to add a generic lane count validation function to the DP helper library instead, to avoid duplicating the same functionality across individual DP drivers. Perhaps other DP experts could provide some advice on this.)

A bool function in common code, to be reused by all DP drivers, would be good.

author
#11 lore raw

Re: [PATCH v4 2/3] drm/bridge: analogix_dp: Add validation for samsung,lane-count property

Quoted 33 lines · Luca Ceresoli

Hello Damon,

Quoted 23 lines · Damon Ding

Hi Luca,

Quoted 6 lines · Luca Ceresoli

On Sat May 30, 2026 at 3:33 PM CEST, Luca Ceresoli wrote:

Meh, messed up with 'b4 review' :-/ Apologies

"This sashiko report" [0] was about an enum being signed, so '== 0' could miss negative numbers coming from bogus DT values higher than 1^31.

Ah, I agree. It would be better to add a new inline function to validate that the lane count passed from DT is exactly 1, 2, or 4, just as Sashiko suggested.

Quoted 4 lines
Quoted 1 line

And this was about "Additionally, does this check inadvertently allow 3, which is an invalid DisplayPort lane count?"

Yes, the DisplayPort specification only allows lane counts of 1, 2, or
4. I did miss the check for the invalid value 3 in the current code.

Quoted 6 lines

(BTW: I did not find a common helper function in drm_dp_helper.h to validate valid DP lane counts (1, 2, 4). I'm not sure if it would be better to add a generic lane count validation function to the DP helper library instead, to avoid duplicating the same functionality across individual DP drivers. Perhaps other DP experts could provide some advice on this.)

Quoted 5 lines

A bool function in common code, to be reused by all DP drivers, would be good.

Yes, will do in v5.

Best regards,
Damon

author
#12 lore raw

PATCH v4 3/3 drm/bridge: analogix_dp: Add support for optional data-lanes mapping

In reply to Damon Ding

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.

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.

---

Changes in v2:
- Add lane mapping application scenarios in commit message.

---
 .../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(-)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +56 -0
index 699a7f380c56..b2e729850391 100644
@@ -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;
@@ -1274,6 +1327,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;
 }
 
drivers/gpu/drm/bridge/analogix/analogix_dp_core.h +3 -1
index 17347448c6b0..634fad241e69 100644
@@ -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);
drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c +7 -8
index 38fd8d5014d2..45c7652645a1 100644
@@ -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);
drivers/gpu/drm/bridge/analogix/analogix_dp_reg.h +4 -0
index 12735139046c..ac914e37089b 100644
@@ -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)
Signature · 1 line
2.34.1
#13 lore raw

Re: [PATCH v4 3/3] drm/bridge: analogix_dp: Add support for optional data-lanes mapping

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] Incorrect physical-to-logical lane mapping programmed into hardware register. - [Medium]…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Incorrect physical-to-logical lane mapping programmed into hardware register.
- [Medium] Inconsistent endpoint resolution when validating and parsing the 'data-lanes' property. --

commit b0396fb13d86cb1835c8181f73f2c91f756c7665
Author: Damon Ding <[email protected]> drm/bridge: analogix_dp: Add support for optional data-lanes mapping

This commit parses the optional 'data-lanes' device tree property to support custom physical lane mapping configurations. If no valid configuration is found, it falls back to the default lane map automatically.

Quoted 4 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +0 -0
index 699a7f380c56c..b2e729850391b 100644

[ ... ]

Quoted 1 line
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +0 -0
@@ -1234,6 +1234,59 @@ static const struct drm_bridge_funcs analogix_dp_bridge_funcs = {

[ ... ]

Quoted 2 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +2 -0
+static int analogix_dp_dt_parse_lanes_map(struct analogix_dp_device *dp)
+{

[ ... ]

drivers/gpu/drm/bridge/analogix/analogix_dp_core.c static const struct drm_bridge_funcs analogix_dp_bridge_funcs = { · line 1254

Quoted 6 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +6 -0
+	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);

[Severity: Medium]
Is there a risk of inconsistent endpoint resolution here?

The call to drm_of_get_data_lanes_count_ep() strictly searches for the endpoint with reg = 0 under port 1. However, of_graph_get_endpoint_by_regs(..., 1, -1) matches the first available endpoint regardless of its reg value.

If a device tree defines multiple endpoints under port 1, could these calls resolve to different endpoints? This might cause the driver to validate the lane count against one endpoint but parse the mapping from another.

Quoted 2 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +2 -0
+	if (!endpoint)
+		return -EINVAL;

[ ... ]

Quoted 4 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c +0 -0
index 38fd8d5014d29..45c7652645a13 100644

[ ... ]

Quoted 1 line
drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c +0 -0
@@ -48,16 +48,15 @@ void analogix_dp_stop_video(struct analogix_dp_device *dp)

[ ... ]

Quoted 6 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c +2 -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;
 

drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c void analogix_dp_stop_video(struct analogix_dp_device *dp) · line 59

Quoted 10 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c +4 -6
-	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;

[Severity: High]
Does this code program the hardware register with the correct mapping?

The data-lanes device tree property defines the physical lane for each logical lane, meaning lane_map[i] holds the physical lane assigned to logical lane i.

However, the hardware register ANALOGIX_DP_LANE_MAP appears to expect the reverse mapping, where it is divided into bit fields per physical lane that must be programmed with the desired logical lane.

Writing lane_map[0] << LANE0_MAP_SHIFT assigns the physical lane index into the configuration field for Physical Lane 0. While this might work for self-inverse mappings, could it produce a scrambled configuration for non-symmetric mappings?

Quoted 3 lines

writel(reg, dp->reg_base + ANALOGIX_DP_LANE_MAP);
}

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
Reviewed-by on v4 3/3
#14 lore raw

Re: [PATCH v4 3/3] drm/bridge: analogix_dp: Add support for optional data-lanes mapping

In reply to Damon Ding

Hi,

Quoted 13 lines · Damon Ding

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.

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.

Quoted 3 lines

---

Greetings,

-- Sebastian

Quoted 160 lines

Changes in v2:
- Add lane mapping application scenarios in commit message.

---
 .../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(-)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +56 -0
index 699a7f380c56..b2e729850391 100644
@@ -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;
@@ -1274,6 +1327,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;
 }
 
drivers/gpu/drm/bridge/analogix/analogix_dp_core.h +3 -1
index 17347448c6b0..634fad241e69 100644
@@ -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);
drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c +7 -8
index 38fd8d5014d2..45c7652645a1 100644
@@ -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);
drivers/gpu/drm/bridge/analogix/analogix_dp_reg.h +4 -0
index 12735139046c..ac914e37089b 100644
@@ -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)
Signature · 1 line
2.34.1