usb: typec: ucsi: register DP only for NVIDIA DP VDO
Subsystems (2)
PATCH 1/2 usb: typec: ucsi: register DP only for NVIDIA DP VDO
From: Ajay Gupta <[email protected]>
NVIDIA VirtualLink (svid 0x955) has two altmode with vdo values of vdo=0x1 for VirtualLink DP mode and vdo=0x3 for NVIDIA test mode. Register display altmode driver only for vdo=0x1
--- drivers/usb/typec/ucsi/ucsi.c | 12 ++++++++++-- include/linux/usb/typec_dp.h | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-)
drivers/usb/typec/ucsi/ucsi.c +10 -2
@@ -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); }
include/linux/usb/typec_dp.h +2 -0
@@ -10,6 +10,8 @@* IDs as the SVID. */ #define USB_TYPEC_NVIDIA_VLINK_SID 0x955/* NVIDIA VirtualLink */ +#define USB_TYPEC_NVIDIA_VLINK_DP_VDO 0x1 +#define USB_TYPEC_NVIDIA_VLINK_DBG_VDO 0x3#define USB_TYPEC_DP_MODE 1/*
Signature · 1 line
2.17.1
PATCH 2/2 usb: ucsi: ccg: disable runtime pm during fw flashing
From: Ajay Gupta <[email protected]>
Ucsi ppm is unregistered during fw flashing so disable runtime pm also and reenable after fw flashing is completed and ppm is re-registered.
--- drivers/usb/typec/ucsi/ucsi_ccg.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/typec/ucsi/ucsi_ccg.c +2 -0
@@ -1219,6 +1219,7 @@ static int ccg_restart(struct ucsi_ccg *uc)return status; } +pm_runtime_enable (uc->dev);return 0 ; }
@@ -1234,6 +1235,7 @@ static void ccg_update_firmware(struct work_struct *work)if (flash_mode !=FLASH_NOT_NEEDED ) {ucsi_unregister (uc->ucsi); +pm_runtime_disable (uc->dev);free_irq (uc->irq, uc);ccg_fw_update (uc, flash_mode);
Signature · 1 line
2.17.1
Heikki Krogerus
maintainerHi Ajay,
Quoted 49 lines · Ajay Gupta
From: Ajay Gupta <[email protected]>
NVIDIA VirtualLink (svid
0x955) has two altmode with vdo values of vdo=0x1 for VirtualLink DP mode and vdo=0x3 for NVIDIA test mode. Register display altmode driver only for vdo=0x1Signed-off-by Ajay Gupta <[email protected]>--- drivers/usb/typec/ucsi/ucsi.c | 12 ++++++++++-- include/linux/usb/typec_dp.h | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-)drivers/usb/typec/ucsi/ucsi.c +10
-2@@ -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); }include/linux/usb/typec_dp.h +0
-0
include/linux/usb/typec_dp.h line 14
Quoted 5 lines
include/linux/usb/typec_dp.h +2
-0@@ -10,6 +10,8 @@* IDs as the SVID. */ #define USB_TYPEC_NVIDIA_VLINK_SID 0x955/* NVIDIA VirtualLink */ +#define USB_TYPEC_NVIDIA_VLINK_DP_VDO 0x1 +#define USB_TYPEC_NVIDIA_VLINK_DBG_VDO 0x3
I think those should be defined in ucsi.c for now. We can move them to the header if there is another user.
thanks,
Signature · 1 line
heikki
Hi Heikki
Quoted 54 lines · Ajay Gupta
drivers/usb/typec/ucsi/ucsi.c static void ucsi_unregister_altmodes(struct
Quoted 37 lines
From: Ajay Gupta <[email protected]>
NVIDIA VirtualLink (svid
0x955) has two altmode with vdo values of vdo=0x1 for VirtualLink DP mode and vdo=0x3 for NVIDIA test mode. Register display altmode driver only for vdo=0x1Signed-off-by Ajay Gupta <[email protected]>--- drivers/usb/typec/ucsi/ucsi.c | 12 ++++++++++-- include/linux/usb/typec_dp.h | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/usb/typec/ucsi/ucsi.cindexd5a6aac86327..eca9d598a42f100644drivers/usb/typec/ucsi/ucsi.c +8
-1@@ -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;drivers/usb/typec/ucsi/ucsi.c +0
-0@@ -475,7 +482,8 @@ static void ucsi_unregister_altmodes(struct
ucsi_connector*con, u8 recipient)Quoted 15 lines
drivers/usb/typec/ucsi/ucsi.c +3
-1while (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); }(quoted diff) +0
-0
b/include/linux/usb/typec_dp.hindexfc4c7edb2e8a..848321c4498e100644include/linux/usb/typec_dp.h +0
-0@@ -10,6 +10,8 @@
Quoted 8 lines
include/linux/usb/typec_dp.h line 14
Quoted 5 lines
include/linux/usb/typec_dp.h +2
-0* IDs as the SVID. */ #define USB_TYPEC_NVIDIA_VLINK_SID 0x955/* NVIDIA VirtualLink */ +#define USB_TYPEC_NVIDIA_VLINK_DP_VDO 0x1 +#define USB_TYPEC_NVIDIA_VLINK_DBG_VDO 0x3I think those should be defined in
ucsi.cfor now. We can move them to the header if there is another user.
Sure, I will update the change.
Thanks
Quoted 5 lines
nvpublic
thanks,--
heikki