Skip to content

Commit 75abb4f

Browse files
Gil Finewesteri
authored andcommitted
thunderbolt: Fix DisplayPort IN adapter capability length for USB4 v2 routers
For USB4 v2 routers, the DisplayPort IN adapter capability length is longer. Display the correct capability length in the debugfs register dump. Signed-off-by: Gil Fine <gil.fine@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
1 parent ee22d52 commit 75abb4f

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

drivers/thunderbolt/debugfs.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
#define PORT_CAP_POWER_LEN 2
1919
#define PORT_CAP_LANE_LEN 3
2020
#define PORT_CAP_USB3_LEN 5
21-
#define PORT_CAP_DP_LEN 8
21+
#define PORT_CAP_DP_V1_LEN 9
22+
#define PORT_CAP_DP_V2_LEN 14
2223
#define PORT_CAP_TMU_V1_LEN 8
2324
#define PORT_CAP_TMU_V2_LEN 10
2425
#define PORT_CAP_BASIC_LEN 9
@@ -1175,11 +1176,13 @@ static void port_cap_show(struct tb_port *port, struct seq_file *s,
11751176
case TB_PORT_CAP_ADAP:
11761177
if (tb_port_is_pcie_down(port) || tb_port_is_pcie_up(port)) {
11771178
length = PORT_CAP_PCIE_LEN;
1178-
} else if (tb_port_is_dpin(port) || tb_port_is_dpout(port)) {
1179-
if (usb4_dp_port_bw_mode_supported(port))
1180-
length = PORT_CAP_DP_LEN + 1;
1179+
} else if (tb_port_is_dpin(port)) {
1180+
if (usb4_switch_version(port->sw) < 2)
1181+
length = PORT_CAP_DP_V1_LEN;
11811182
else
1182-
length = PORT_CAP_DP_LEN;
1183+
length = PORT_CAP_DP_V2_LEN;
1184+
} else if (tb_port_is_dpout(port)) {
1185+
length = PORT_CAP_DP_V1_LEN;
11831186
} else if (tb_port_is_usb3_down(port) ||
11841187
tb_port_is_usb3_up(port)) {
11851188
length = PORT_CAP_USB3_LEN;

0 commit comments

Comments
 (0)