Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: typec: ucsi: displayport: Fix for the mode entering routine

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")
Cc: stable@vger.kernel.org
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20191004100219.71152-3-heikki.krogerus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Heikki Krogerus and committed by
Greg Kroah-Hartman
f2372b87 8530e4e2

+2
+2
drivers/usb/typec/ucsi/displayport.c
··· 75 75 76 76 if (cur != 0xff) { 77 77 mutex_unlock(&dp->con->lock); 78 + if (dp->con->port_altmode[cur] == alt) 79 + return 0; 78 80 return -EBUSY; 79 81 } 80 82