All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] usb: chipidea: otg: handling vbus disconnect event occurred during system suspend
@ 2020-02-19  9:25 Peter Chen
  0 siblings, 0 replies; only message in thread
From: Peter Chen @ 2020-02-19  9:25 UTC (permalink / raw)
  To: linux-usb; +Cc: linux-imx, jun.li, Peter Chen

During system suspend, the role switch may occur, eg, from gadget->host.
In this case, the vbus disconnect event is lost, we add this handling
in role switch routine in this commit.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
---
 drivers/usb/chipidea/otg.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/usb/chipidea/otg.c b/drivers/usb/chipidea/otg.c
index fbfb02e05c97..be63924ea82e 100644
--- a/drivers/usb/chipidea/otg.c
+++ b/drivers/usb/chipidea/otg.c
@@ -170,6 +170,13 @@ static void ci_handle_id_switch(struct ci_hdrc *ci)
 		dev_dbg(ci->dev, "switching from %s to %s\n",
 			ci_role(ci)->name, ci->roles[role]->name);
 
+		if (ci->vbus_active && ci->role == CI_ROLE_GADGET)
+			/*
+			 * vbus disconnect event is lost due to role
+			 * switch occurs during system suspend.
+			 */
+			usb_gadget_vbus_disconnect(&ci->gadget);
+
 		ci_role_stop(ci);
 
 		if (role == CI_ROLE_GADGET &&
-- 
2.17.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-19  9:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-19  9:25 [PATCH 1/1] usb: chipidea: otg: handling vbus disconnect event occurred during system suspend Peter Chen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.