]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
usb: musb: Add a quirk to preserve the session during suspend
authorAlexandre Bailon <abailon@baylibre.com>
Thu, 2 Feb 2017 03:30:19 +0000 (21:30 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Feb 2017 09:05:10 +0000 (10:05 +0100)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/musb/musb_core.c
drivers/usb/musb/musb_core.h

index b1f082f4211298b470046af034401c0010892596..27887189fd14692d8b563edeb23a189975c51859 100644 (file)
@@ -2659,7 +2659,8 @@ static int musb_suspend(struct device *dev)
 
        musb_platform_disable(musb);
        musb_disable_interrupts(musb);
-       musb_writeb(musb->mregs, MUSB_DEVCTL, 0);
+       if (!(musb->io.quirks & MUSB_PRESERVE_SESSION))
+               musb_writeb(musb->mregs, MUSB_DEVCTL, 0);
        WARN_ON(!list_empty(&musb->pending_list));
 
        spin_lock_irqsave(&musb->lock, flags);
index ade902ea1221e18543de05a5188c715d86af7398..ab0c858af9d3341dbf4673b1c8c2a9353188d2b2 100644 (file)
@@ -172,6 +172,7 @@ struct musb_io;
  */
 struct musb_platform_ops {
 
+#define MUSB_PRESERVE_SESSION  BIT(7)
 #define MUSB_DMA_UX500         BIT(6)
 #define MUSB_DMA_CPPI41                BIT(5)
 #define MUSB_DMA_CPPI          BIT(4)