* [PATCH 0/3] ucsi driver changes (for v5.7)
@ 2020-02-17 14:49 Heikki Krogerus
2020-02-17 14:49 ` [PATCH 1/3] usb: typec: ucsi: register DP only for NVIDIA DP VDO Heikki Krogerus
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Heikki Krogerus @ 2020-02-17 14:49 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Ajay Gupta, Colin Ian King, linux-usb
Hi Greg,
Here all the UCSI driver changes at this stage. I though the cleanup
patch from Colin would conflict with the patches from Ajay, but there
was no problem after all.
Let me know if you want anything to be changed.
thanks,
Ajay Gupta (2):
usb: typec: ucsi: register DP only for NVIDIA DP VDO
usb: ucsi: ccg: disable runtime pm during fw flashing
Colin Ian King (1):
usb: typec: ucsi: remove redundant assignment to variable num
drivers/usb/typec/ucsi/ucsi.c | 14 +++++++++++---
drivers/usb/typec/ucsi/ucsi.h | 7 +++++++
drivers/usb/typec/ucsi/ucsi_ccg.c | 2 ++
3 files changed, 20 insertions(+), 3 deletions(-)
--
2.25.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] usb: typec: ucsi: register DP only for NVIDIA DP VDO
2020-02-17 14:49 [PATCH 0/3] ucsi driver changes (for v5.7) Heikki Krogerus
@ 2020-02-17 14:49 ` Heikki Krogerus
2020-02-17 14:49 ` [PATCH 2/3] usb: ucsi: ccg: disable runtime pm during fw flashing Heikki Krogerus
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Heikki Krogerus @ 2020-02-17 14:49 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Ajay Gupta, Colin Ian King, linux-usb
From: Ajay Gupta <ajayg@nvidia.com>
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: Ajay Gupta <ajayg@nvidia.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
drivers/usb/typec/ucsi/ucsi.c | 12 ++++++++++--
drivers/usb/typec/ucsi/ucsi.h | 7 +++++++
2 files changed, 17 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/drivers/usb/typec/ucsi/ucsi.h b/drivers/usb/typec/ucsi/ucsi.h
index e434b9c9a9eb..a89112b69cd5 100644
--- a/drivers/usb/typec/ucsi/ucsi.h
+++ b/drivers/usb/typec/ucsi/ucsi.h
@@ -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 */
--
2.25.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] usb: ucsi: ccg: disable runtime pm during fw flashing
2020-02-17 14:49 [PATCH 0/3] ucsi driver changes (for v5.7) Heikki Krogerus
2020-02-17 14:49 ` [PATCH 1/3] usb: typec: ucsi: register DP only for NVIDIA DP VDO Heikki Krogerus
@ 2020-02-17 14:49 ` Heikki Krogerus
2020-02-17 14:49 ` [PATCH 3/3] usb: typec: ucsi: remove redundant assignment to variable num Heikki Krogerus
2020-02-17 15:54 ` [PATCH 0/3] ucsi driver changes (for v5.7) Greg Kroah-Hartman
3 siblings, 0 replies; 5+ messages in thread
From: Heikki Krogerus @ 2020-02-17 14:49 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Ajay Gupta, Colin Ian King, linux-usb
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>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.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.25.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] usb: typec: ucsi: remove redundant assignment to variable num
2020-02-17 14:49 [PATCH 0/3] ucsi driver changes (for v5.7) Heikki Krogerus
2020-02-17 14:49 ` [PATCH 1/3] usb: typec: ucsi: register DP only for NVIDIA DP VDO Heikki Krogerus
2020-02-17 14:49 ` [PATCH 2/3] usb: ucsi: ccg: disable runtime pm during fw flashing Heikki Krogerus
@ 2020-02-17 14:49 ` Heikki Krogerus
2020-02-17 15:54 ` [PATCH 0/3] ucsi driver changes (for v5.7) Greg Kroah-Hartman
3 siblings, 0 replies; 5+ messages in thread
From: Heikki Krogerus @ 2020-02-17 14:49 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Ajay Gupta, Colin Ian King, linux-usb
From: Colin Ian King <colin.king@canonical.com>
Variable num is being assigned with a value that is never read, it is
assigned a new value later in a for-loop. The assignment is redundant
and can be removed.
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
drivers/usb/typec/ucsi/ucsi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index eca9d598a42f..ddf2ad3752de 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -407,7 +407,7 @@ static int ucsi_register_altmodes(struct ucsi_connector *con, u8 recipient)
struct typec_altmode_desc desc;
struct ucsi_altmode alt[2];
u64 command;
- int num = 1;
+ int num;
int ret;
int len;
int j;
--
2.25.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] ucsi driver changes (for v5.7)
2020-02-17 14:49 [PATCH 0/3] ucsi driver changes (for v5.7) Heikki Krogerus
` (2 preceding siblings ...)
2020-02-17 14:49 ` [PATCH 3/3] usb: typec: ucsi: remove redundant assignment to variable num Heikki Krogerus
@ 2020-02-17 15:54 ` Greg Kroah-Hartman
3 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2020-02-17 15:54 UTC (permalink / raw)
To: Heikki Krogerus; +Cc: Ajay Gupta, Colin Ian King, linux-usb
On Mon, Feb 17, 2020 at 05:49:10PM +0300, Heikki Krogerus wrote:
> Hi Greg,
>
> Here all the UCSI driver changes at this stage. I though the cleanup
> patch from Colin would conflict with the patches from Ajay, but there
> was no problem after all.
>
> Let me know if you want anything to be changed.
All looks good, now applied. And note, I already had applied Colin's
patch :)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-02-17 15:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-17 14:49 [PATCH 0/3] ucsi driver changes (for v5.7) Heikki Krogerus
2020-02-17 14:49 ` [PATCH 1/3] usb: typec: ucsi: register DP only for NVIDIA DP VDO Heikki Krogerus
2020-02-17 14:49 ` [PATCH 2/3] usb: ucsi: ccg: disable runtime pm during fw flashing Heikki Krogerus
2020-02-17 14:49 ` [PATCH 3/3] usb: typec: ucsi: remove redundant assignment to variable num Heikki Krogerus
2020-02-17 15:54 ` [PATCH 0/3] ucsi driver changes (for v5.7) Greg Kroah-Hartman
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).