From: RD Babiera Date: Tue, 23 Sep 2025 18:16:08 +0000 (+0000) Subject: usb: typec: altmodes/displayport: do not enter mode if port is the UFP X-Git-Tag: v6.19-rc1~63^2~105 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41294342fad7d7fe907d8707a4efcafdb66b7940;p=thirdparty%2Flinux.git 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: RD Babiera Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20250923181606.1583584-6-rdbabiera@google.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c index 1dcb77faf85d4..8d111ad3b71b8 100644 --- a/drivers/usb/typec/altmodes/displayport.c +++ b/drivers/usb/typec/altmodes/displayport.c @@ -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) &