Commit c2ae4928 authored by Ajay Gupta's avatar Ajay Gupta Committed by Greg Kroah-Hartman

usb: typec: ucsi: register DP only for NVIDIA DP VDO

NVIDIA VirtualLink (svid 0x955) has two altmode, vdo=0x1 for
VirtualLink DP mode and vdo=0x3 for NVIDIA test mode.
Register display altmode driver only for vdo=0x1
Signed-off-by: default avatarAjay Gupta <ajayg@nvidia.com>
Signed-off-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20200217144913.55330-2-heikki.krogerus@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 055b185a
......@@ -270,9 +270,16 @@ static int ucsi_register_altmode(struct ucsi_connector *con,
switch (desc->svid) {
case USB_TYPEC_DP_SID:
case USB_TYPEC_NVIDIA_VLINK_SID:
alt = ucsi_register_displayport(con, override, i, desc);
break;
case USB_TYPEC_NVIDIA_VLINK_SID:
if (desc->vdo == USB_TYPEC_NVIDIA_VLINK_DBG_VDO)
alt = typec_port_register_altmode(con->port,
desc);
else
alt = ucsi_register_displayport(con, override,
i, desc);
break;
default:
alt = typec_port_register_altmode(con->port, desc);
break;
......@@ -475,7 +482,8 @@ static void ucsi_unregister_altmodes(struct ucsi_connector *con, u8 recipient)
while (adev[i]) {
if (recipient == UCSI_RECIPIENT_SOP &&
(adev[i]->svid == USB_TYPEC_DP_SID ||
adev[i]->svid == USB_TYPEC_NVIDIA_VLINK_SID)) {
(adev[i]->svid == USB_TYPEC_NVIDIA_VLINK_SID &&
adev[i]->vdo != USB_TYPEC_NVIDIA_VLINK_DBG_VDO))) {
pdev = typec_altmode_get_partner(adev[i]);
ucsi_displayport_remove_partner((void *)pdev);
}
......
......@@ -340,4 +340,11 @@ static inline void
ucsi_displayport_remove_partner(struct typec_altmode *adev) { }
#endif /* CONFIG_TYPEC_DP_ALTMODE */
/*
* NVIDIA VirtualLink (svid 0x955) has two altmode. VirtualLink
* DP mode with vdo=0x1 and NVIDIA test mode with vdo=0x3
*/
#define USB_TYPEC_NVIDIA_VLINK_DP_VDO 0x1
#define USB_TYPEC_NVIDIA_VLINK_DBG_VDO 0x3
#endif /* __DRIVER_USB_TYPEC_UCSI_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment