* [PATCH 1/2] usb: typec: ucsi: register DP only for NVIDIA DP VDO
@ 2020-01-16 1:32 Ajay Gupta
2020-01-16 1:32 ` [PATCH 2/2] usb: ucsi: ccg: disable runtime pm during fw flashing Ajay Gupta
2020-01-23 9:24 ` [PATCH 1/2] usb: typec: ucsi: register DP only for NVIDIA DP VDO Heikki Krogerus
0 siblings, 2 replies; 4+ messages in thread
From: Ajay Gupta @ 2020-01-16 1:32 UTC (permalink / raw)
To: heikki.krogerus; +Cc: linux-usb, Ajay Gupta
From: Ajay Gupta <ajayg@nvidia.com>
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
Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
---
drivers/usb/typec/ucsi/ucsi.c | 12 ++++++++++--
include/linux/usb/typec_dp.h | 2 ++
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index d5a6aac86327..eca9d598a42f 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -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);
}
diff --git a/include/linux/usb/typec_dp.h b/include/linux/usb/typec_dp.h
index fc4c7edb2e8a..848321c4498e 100644
--- a/include/linux/usb/typec_dp.h
+++ b/include/linux/usb/typec_dp.h
@@ -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
/*
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] usb: ucsi: ccg: disable runtime pm during fw flashing
2020-01-16 1:32 [PATCH 1/2] usb: typec: ucsi: register DP only for NVIDIA DP VDO Ajay Gupta
@ 2020-01-16 1:32 ` Ajay Gupta
2020-01-23 9:24 ` [PATCH 1/2] usb: typec: ucsi: register DP only for NVIDIA DP VDO Heikki Krogerus
1 sibling, 0 replies; 4+ messages in thread
From: Ajay Gupta @ 2020-01-16 1:32 UTC (permalink / raw)
To: heikki.krogerus; +Cc: linux-usb, Ajay Gupta
From: Ajay Gupta <ajayg@nvidia.com>
Ucsi ppm is unregistered during fw flashing so disable
runtime pm also and reenable after fw flashing is completed
and ppm is re-registered.
Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
---
drivers/usb/typec/ucsi/ucsi_ccg.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
index a5b8530490db..2658cda5da11 100644
--- a/drivers/usb/typec/ucsi/ucsi_ccg.c
+++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
@@ -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);
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] usb: typec: ucsi: register DP only for NVIDIA DP VDO
2020-01-16 1:32 [PATCH 1/2] usb: typec: ucsi: register DP only for NVIDIA DP VDO Ajay Gupta
2020-01-16 1:32 ` [PATCH 2/2] usb: ucsi: ccg: disable runtime pm during fw flashing Ajay Gupta
@ 2020-01-23 9:24 ` Heikki Krogerus
2020-01-23 18:24 ` Ajay Gupta
1 sibling, 1 reply; 4+ messages in thread
From: Heikki Krogerus @ 2020-01-23 9:24 UTC (permalink / raw)
To: Ajay Gupta; +Cc: linux-usb, Ajay Gupta
Hi Ajay,
On Wed, Jan 15, 2020 at 05:32:46PM -0800, Ajay Gupta wrote:
> From: Ajay Gupta <ajayg@nvidia.com>
>
> 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
>
> Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
> ---
> drivers/usb/typec/ucsi/ucsi.c | 12 ++++++++++--
> include/linux/usb/typec_dp.h | 2 ++
> 2 files changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> index d5a6aac86327..eca9d598a42f 100644
> --- a/drivers/usb/typec/ucsi/ucsi.c
> +++ b/drivers/usb/typec/ucsi/ucsi.c
> @@ -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);
> }
> diff --git a/include/linux/usb/typec_dp.h b/include/linux/usb/typec_dp.h
> index fc4c7edb2e8a..848321c4498e 100644
> --- a/include/linux/usb/typec_dp.h
> +++ b/include/linux/usb/typec_dp.h
> @@ -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,
--
heikki
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH 1/2] usb: typec: ucsi: register DP only for NVIDIA DP VDO
2020-01-23 9:24 ` [PATCH 1/2] usb: typec: ucsi: register DP only for NVIDIA DP VDO Heikki Krogerus
@ 2020-01-23 18:24 ` Ajay Gupta
0 siblings, 0 replies; 4+ messages in thread
From: Ajay Gupta @ 2020-01-23 18:24 UTC (permalink / raw)
To: Heikki Krogerus, Ajay Gupta; +Cc: linux-usb
Hi Heikki
> On Wed, Jan 15, 2020 at 05:32:46PM -0800, Ajay Gupta wrote:
> > From: Ajay Gupta <ajayg@nvidia.com>
> >
> > 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
> >
> > Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
> > ---
> > drivers/usb/typec/ucsi/ucsi.c | 12 ++++++++++--
> > include/linux/usb/typec_dp.h | 2 ++
> > 2 files changed, 12 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/usb/typec/ucsi/ucsi.c
> > b/drivers/usb/typec/ucsi/ucsi.c index d5a6aac86327..eca9d598a42f
> > 100644
> > --- a/drivers/usb/typec/ucsi/ucsi.c
> > +++ b/drivers/usb/typec/ucsi/ucsi.c
> > @@ -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);
> > }
> > diff --git a/include/linux/usb/typec_dp.h
> > b/include/linux/usb/typec_dp.h index fc4c7edb2e8a..848321c4498e 100644
> > --- a/include/linux/usb/typec_dp.h
> > +++ b/include/linux/usb/typec_dp.h
> > @@ -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.
Sure, I will update the change.
Thanks
> nvpublic
> thanks,
>
> --
> heikki
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-01-23 18:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-16 1:32 [PATCH 1/2] usb: typec: ucsi: register DP only for NVIDIA DP VDO Ajay Gupta
2020-01-16 1:32 ` [PATCH 2/2] usb: ucsi: ccg: disable runtime pm during fw flashing Ajay Gupta
2020-01-23 9:24 ` [PATCH 1/2] usb: typec: ucsi: register DP only for NVIDIA DP VDO Heikki Krogerus
2020-01-23 18:24 ` Ajay Gupta
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).