From 36547f2f6d8d93dcd69c5609f296983ba593612e Mon Sep 17 00:00:00 2001 From: Badhri Jagan Sridharan Date: Wed, 17 Mar 2021 23:56:04 -0700 Subject: [PATCH] FROMGIT: usb: typec: tcpm: PD3.0 sinks can send Discover Identity even in device mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit >From 6.4.4.2 Structured VDM: • Either Port May be an Initiator of Structured VDMs except for the Enter Mode and Exit Mode Commands which Shall only be initiated by the DFP." The above implies that when PD3.0 link is established PD3.0 sinks can send out discover identity command/AMS once PD negotiation is done. This allows discovering identity for PD3.0 UFP ports as well. Acked-by: Heikki Krogerus Signed-off-by: Badhri Jagan Sridharan Link: https://lore.kernel.org/r/20210318065604.3757307-1-badhri@google.com Signed-off-by: Greg Kroah-Hartman (cherry picked from commit e00943e916782ae17ca05d654779a84f09481ab8 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next) Signed-off-by: Greg Kroah-Hartman Change-Id: I432847037c8e89cbacc7ca402b23568aa02ef42d --- drivers/usb/typec/tcpm/tcpm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index 63077baf84e7..17f68af470ea 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -3689,8 +3689,8 @@ EXPORT_SYMBOL_GPL(tcpm_is_toggling); static void tcpm_check_send_discover(struct tcpm_port *port) { - if (port->data_role == TYPEC_HOST && port->send_discover && - port->pd_capable) + if ((port->data_role == TYPEC_HOST || port->negotiated_rev > PD_REV20) && + port->send_discover && port->pd_capable) tcpm_send_vdm(port, USB_SID_PD, CMD_DISCOVER_IDENT, NULL, 0); port->send_discover = false; }