From 5ba644e8a0389b04069b894395c2c6d92fb1213c Mon Sep 17 00:00:00 2001 From: RD Babiera Date: Fri, 13 Oct 2023 21:31:01 +0000 Subject: [PATCH] BACKPORT: usb: typec: altmodes/displayport: Signal hpd low when exiting mode Upon receiving an ACK for a sent EXIT_MODE message, the DisplayPort driver currently resets the status and configuration of the port partner. The hpd signal is not updated despite being part of the status, so the Display stack can still transmit video despite typec_altmode_exit placing the lanes in a Safe State. Set hpd to low when a sent EXIT_MODE message is ACK'ed. Fixes: 0e3bb7d6894d ("usb: typec: Add driver for DisplayPort alternate mode") Cc: stable@vger.kernel.org Signed-off-by: RD Babiera Acked-by: Heikki Krogerus Link: https://lore.kernel.org/r/20231009210057.3773877-2-rdbabiera@google.com Signed-off-by: Greg Kroah-Hartman Bug: 297208252 Bug: 308184880 (cherry picked from commit 89434b069e460967624903b049e5cf5c9e6b99b9) [rd: removed unused call to drm_connector_oob_hotplug_event] Signed-off-by: RD Babiera (cherry picked from https://android-review.googlesource.com/q/commit:d7e80ace6b420b90b0fd2d442fef2e783bbe406d) Merged-In: Iad61fa4db6b126db7fc3bd717b60c2ca35da1311 Change-Id: Iad61fa4db6b126db7fc3bd717b60c2ca35da1311 --- drivers/usb/typec/altmodes/displayport.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c index ebcaf9bb7a5f..6dd86f2a679d 100644 --- a/drivers/usb/typec/altmodes/displayport.c +++ b/drivers/usb/typec/altmodes/displayport.c @@ -286,6 +286,10 @@ static int dp_altmode_vdm(struct typec_altmode *alt, case CMD_EXIT_MODE: dp->data.status = 0; dp->data.conf = 0; + if (dp->hpd) { + dp->hpd = false; + sysfs_notify(&dp->alt->dev.kobj, "displayport", "hpd"); + } break; case DP_CMD_STATUS_UPDATE: dp->data.status = *vdo;