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

usb: typec: tcpm: PD3.0 sinks can send Discover Identity even in device mode

>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 <heikki.krogerus@linux.intel.com>
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Link: https://lore.kernel.org/r/20210318065604.3757307-1-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Badhri Jagan Sridharan and committed by
Greg Kroah-Hartman
e00943e9 18106234

+2 -2
+2 -2
drivers/usb/typec/tcpm/tcpm.c
··· 3653 3653 3654 3654 static void tcpm_check_send_discover(struct tcpm_port *port) 3655 3655 { 3656 - if (port->data_role == TYPEC_HOST && port->send_discover && 3657 - port->pd_capable) 3656 + if ((port->data_role == TYPEC_HOST || port->negotiated_rev > PD_REV20) && 3657 + port->send_discover && port->pd_capable) 3658 3658 tcpm_send_vdm(port, USB_SID_PD, CMD_DISCOVER_IDENT, NULL, 0); 3659 3659 port->send_discover = false; 3660 3660 }