Skip to contentSkip to conversation

usb: typec: altmodes/displayport: Fall back to multi-func pins

DISCUSSION Heikki Krogerus 1 participant 1 message Mar 15, 2019 USB

lore
Share & tools
lore

Heikki Krogerus

author Acked-by
#0 lore raw
Quoted 11 lines · Hans de Goede

If our port-partner supports both DP-only operation (pin-assignment C) and multi-func operation (pin-assignment D) and we only support pin-assignment D and the port-partner prefers DP-only mode, then before this commit we would and up masking out pin-assignment D from the available pin-assignments and fail to pick a pin-assignment.

Instead only mask out the multi-func pin-assignments if we support dp-only pin-assignments, so that we correctly fall-back to a multi-func pin-assignment in this case (by picking pin-assignment D).

Quoted 19 lines
---
 drivers/usb/typec/altmodes/displayport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/altmodes/displayport.c +1 -1
index 3f06e94771a7..35161594e368 100644
@@ -104,7 +104,7 @@ static int dp_altmode_configure(struct dp_altmode *dp, u8 con)
 		if (dp->data.status & DP_STATUS_PREFER_MULTI_FUNC &&
 		    pin_assign & DP_PIN_ASSIGN_MULTI_FUNC_MASK)
 			pin_assign &= DP_PIN_ASSIGN_MULTI_FUNC_MASK;
-		else
+		else if (pin_assign & DP_PIN_ASSIGN_DP_ONLY_MASK)
 			pin_assign &= DP_PIN_ASSIGN_DP_ONLY_MASK;
 
 		if (!pin_assign)
Signature · 1 line
2.20.1

thanks,