Skip to content

Commit 54e5c00

Browse files
Prashant Malanigregkh
authored andcommitted
usb: typec: altmodes/displayport: Fix probe pin assign check
While checking Pin Assignments of the port and partner during probe, we don't take into account whether the peripheral is a plug or receptacle. This manifests itself in a mode entry failure on certain docks and dongles with captive cables. For instance, the Startech.com Type-C to DP dongle (Model #CDP2DP) advertises its DP VDO as 0x405. This would fail the Pin Assignment compatibility check, despite it supporting Pin Assignment C as a UFP. Update the check to use the correct DP Pin Assign macros that take the peripheral's receptacle bit into account. Fixes: c1e5c2f ("usb: typec: altmodes/displayport: correct pin assignment for UFP receptacles") Cc: [email protected] Reported-by: Diana Zigterman <[email protected]> Signed-off-by: Prashant Malani <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent bb07bd6 commit 54e5c00

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/usb/typec/altmodes/displayport.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -535,10 +535,10 @@ int dp_altmode_probe(struct typec_altmode *alt)
535535
/* FIXME: Port can only be DFP_U. */
536536

537537
/* Make sure we have compatiple pin configurations */
538-
if (!(DP_CAP_DFP_D_PIN_ASSIGN(port->vdo) &
539-
DP_CAP_UFP_D_PIN_ASSIGN(alt->vdo)) &&
540-
!(DP_CAP_UFP_D_PIN_ASSIGN(port->vdo) &
541-
DP_CAP_DFP_D_PIN_ASSIGN(alt->vdo)))
538+
if (!(DP_CAP_PIN_ASSIGN_DFP_D(port->vdo) &
539+
DP_CAP_PIN_ASSIGN_UFP_D(alt->vdo)) &&
540+
!(DP_CAP_PIN_ASSIGN_UFP_D(port->vdo) &
541+
DP_CAP_PIN_ASSIGN_DFP_D(alt->vdo)))
542542
return -ENODEV;
543543

544544
ret = sysfs_create_group(&alt->dev.kobj, &dp_altmode_group);

0 commit comments

Comments
 (0)