Skip to content

Commit eddebe3

Browse files
RD Babieragregkh
authored andcommitted
usb: typec: altmodes/displayport: Fix configure initial pin assignment
While determining the initial pin assignment to be sent in the configure message, using the DP_PIN_ASSIGN_DP_ONLY_MASK mask causes the DFP_U to send both Pin Assignment C and E when both are supported by the DFP_U and UFP_U. The spec (Table 5-7 DFP_U Pin Assignment Selection Mandates, VESA DisplayPort Alt Mode Standard v2.0) indicates that the DFP_U never selects Pin Assignment E when Pin Assignment C is offered. Update the DP_PIN_ASSIGN_DP_ONLY_MASK conditional to intially select only Pin Assignment C if it is available. Fixes: 0e3bb7d ("usb: typec: Add driver for DisplayPort alternate mode") Cc: [email protected] Signed-off-by: RD Babiera <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ec799c8 commit eddebe3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/usb/typec/altmodes/displayport.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,12 @@ static int dp_altmode_configure(struct dp_altmode *dp, u8 con)
112112
if (dp->data.status & DP_STATUS_PREFER_MULTI_FUNC &&
113113
pin_assign & DP_PIN_ASSIGN_MULTI_FUNC_MASK)
114114
pin_assign &= DP_PIN_ASSIGN_MULTI_FUNC_MASK;
115-
else if (pin_assign & DP_PIN_ASSIGN_DP_ONLY_MASK)
115+
else if (pin_assign & DP_PIN_ASSIGN_DP_ONLY_MASK) {
116116
pin_assign &= DP_PIN_ASSIGN_DP_ONLY_MASK;
117+
/* Default to pin assign C if available */
118+
if (pin_assign & BIT(DP_PIN_ASSIGN_C))
119+
pin_assign = BIT(DP_PIN_ASSIGN_C);
120+
}
117121

118122
if (!pin_assign)
119123
return -EINVAL;

0 commit comments

Comments
 (0)