Re: [PATCH] usb: dwc2: resume root hub when device detect with suspend state

From: Sergei Shtylyov
Date: Mon Nov 17 2014 - 13:17:09 EST


Hello.

On 11/17/2014 04:14 PM, Kever Yang wrote:

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@xxxxxxxxxxxxxx>
Signed-off-by: Kever Yang <kever.yang@xxxxxxxxxxxxxx>
---

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

diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c
index 551ba87..c8299fd 100644
--- a/drivers/usb/dwc2/hcd_intr.c
+++ b/drivers/usb/dwc2/hcd_intr.c
@@ -355,6 +355,13 @@ static void dwc2_port_intr(struct dwc2_hsotg *hsotg)
hprt0_modify |= HPRT0_CONNDET;

/*
+ * Check if root hub is in suspend state
+ * if root hub in suspend, resume it.
+ */
+ if ((bus->root_hub) && (hcd->state == HC_STATE_SUSPENDED))

Inner parens are not needed, especially the first ones.

[...]

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/