blob: de2b7b560ec2cf8e6e82373147f06adcfb6fc58c [file] [log] [blame]
From 4fce77b656af07e5ff13a6352d89a90918d79d6b Mon Sep 17 00:00:00 2001
From: Heikki Krogerus <>
Date: Fri, 4 Oct 2019 13:02:19 +0300
Subject: [PATCH] usb: typec: ucsi: displayport: Fix for the mode entering
commit f2372b87c386871b16d7dbda680d98d4092ab708 upstream.
Making sure that ucsi_displayport_enter() function does not
return an error if the displayport alternate mode has
already been entered. It's normal that the firmware (or
controller) has already entered the alternate mode by the
time the operating system is notified about the device.
Fixes: af8622f6a585 ("usb: typec: ucsi: Support for DisplayPort alt mode")
Signed-off-by: Heikki Krogerus <>
Signed-off-by: Greg Kroah-Hartman <>
Signed-off-by: Paul Gortmaker <>
diff --git a/drivers/usb/typec/ucsi/displayport.c b/drivers/usb/typec/ucsi/displayport.c
index 6c103697c582..d99700cb4dca 100644
--- a/drivers/usb/typec/ucsi/displayport.c
+++ b/drivers/usb/typec/ucsi/displayport.c
@@ -75,6 +75,8 @@ static int ucsi_displayport_enter(struct typec_altmode *alt)
if (cur != 0xff) {
+ if (dp->con->port_altmode[cur] == alt)
+ return 0;
return -EBUSY;