Commit 41294342 authored by RD Babiera's avatar RD Babiera Committed by Greg Kroah-Hartman
Browse files

usb: typec: altmodes/displayport: do not enter mode if port is the UFP



Nothing currently stops the DisplayPort Alt Mode driver from sending
Enter Mode if the port is the Data Device. Utilize
typec_altmode_get_data_role to prevent mode entry.

Signed-off-by: default avatarRD Babiera <rdbabiera@google.com>
Reviewed-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20250923181606.1583584-6-rdbabiera@google.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ed4a5c5d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -758,7 +758,9 @@ int dp_altmode_probe(struct typec_altmode *alt)
	struct fwnode_handle *fwnode;
	struct dp_altmode *dp;

	/* FIXME: Port can only be DFP_U. */
	/* Port can only be DFP_U. */
	if (typec_altmode_get_data_role(alt) != TYPEC_HOST)
		return -EPROTO;

	/* Make sure we have compatible pin configurations */
	if (!(DP_CAP_PIN_ASSIGN_DFP_D(port->vdo) &