[08/17] usb: musb: Add a quirk to preserve the session during suspend

Message ID 1486006228-10062-9-git-send-email-b-liu@ti.com
State New
Headers show
  • [01/17] usb: musb: da8xx: Remove CPPI 3.0 quirk and methods
Related show

Commit Message

Bin Liu Feb. 2, 2017, 3:30 a.m.
From: Alexandre Bailon <abailon@baylibre.com>

On da8xx, VBUS is not maintained during suspend when musb is in host mode.
On resume, all the connected devices will be disconnected and then will
be enumerated again.
This happens because MUSB_DEVCTL is cleared during suspend.
Add a quirk to not clear MUSB_DEVCTL and then preserve the  session during
a suspend.

Signed-off-by: Alexandre Bailon <abailon@baylibre.com>

Signed-off-by: Bin Liu <b-liu@ti.com>

 drivers/usb/musb/musb_core.c | 3 ++-
 drivers/usb/musb/musb_core.h | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)


To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index b1f082f42112..27887189fd14 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2659,7 +2659,8 @@  static int musb_suspend(struct device *dev)
-	musb_writeb(musb->mregs, MUSB_DEVCTL, 0);
+	if (!(musb->io.quirks & MUSB_PRESERVE_SESSION))
+		musb_writeb(musb->mregs, MUSB_DEVCTL, 0);
 	spin_lock_irqsave(&musb->lock, flags);
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index ade902ea1221..ab0c858af9d3 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -172,6 +172,7 @@  enum musb_g_ep0_state {
 struct musb_platform_ops {
 #define MUSB_DMA_UX500		BIT(6)
 #define MUSB_DMA_CPPI41		BIT(5)
 #define MUSB_DMA_CPPI		BIT(4)