public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] usb: dwc2: resume root hub when device detect with suspend state
@ 2014-11-18  1:21 Kever Yang
  2014-11-18  3:01 ` Doug Anderson
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Kever Yang @ 2014-11-18  1:21 UTC (permalink / raw)
  To: Paul Zimmerman, Felipe Balbi
  Cc: Dinh Nguyen, romain.perier, Heiko Stuebner, dianders, sonnyrao,
	addy.ke, cf, wulf, huangtao, linux-rockchip, Kever Yang, Roy Li,
	Greg Kroah-Hartman, linux-usb, linux-kernel

After we implement the bus_suspend/resume, auto suspend id enabled.
The root hub will be auto suspend if there is no device connected,
we need to resume the root hub when a device connect detect.

This patch tested on rk3288.

Signed-off-by: Roy Li <roy.li@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

Changes in v2:
- add definition for hcd structure
- remove check for bus->root_hub

 drivers/usb/dwc2/hcd_intr.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c
index 551ba87..680206f 100644
--- a/drivers/usb/dwc2/hcd_intr.c
+++ b/drivers/usb/dwc2/hcd_intr.c
@@ -329,6 +329,7 @@ static void dwc2_port_intr(struct dwc2_hsotg *hsotg)
 {
 	u32 hprt0;
 	u32 hprt0_modify;
+	struct usb_hcd *hcd = (struct usb_hcd *)hsotg->priv;
 
 	dev_vdbg(hsotg->dev, "--Port Interrupt--\n");
 
@@ -354,6 +355,10 @@ static void dwc2_port_intr(struct dwc2_hsotg *hsotg)
 		hsotg->flags.b.port_connect_status = 1;
 		hprt0_modify |= HPRT0_CONNDET;
 
+		/* resume root hub? */
+		if (hcd->state == HC_STATE_SUSPENDED)
+			usb_hcd_resume_root_hub(hcd);
+
 		/*
 		 * The Hub driver asserts a reset when it sees port connect
 		 * status change flag
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-11-19 19:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-18  1:21 [PATCH v2] usb: dwc2: resume root hub when device detect with suspend state Kever Yang
2014-11-18  3:01 ` Doug Anderson
2014-11-18  4:35 ` Felipe Balbi
2014-11-18 16:07 ` Alan Stern
2014-11-18 16:41   ` Felipe Balbi
2014-11-19  2:03     ` Julius Werner
2014-11-19 16:00       ` Alan Stern
     [not found]       ` <2014111916244796336915@rock-chips.com>
2014-11-19 19:27         ` Julius Werner
2014-11-19 16:06     ` Mathias Nyman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox