summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/udc/atmel_usba_udc.h
diff options
context:
space:
mode:
authorJonas Bonn <jonas@norrbonn.se>2019-02-20 13:20:00 +0100
committerFelipe Balbi <felipe.balbi@linux.intel.com>2019-05-03 09:13:49 +0300
commit70a7f8be85986a3c2ffc7274c41b89552dfe2ad0 (patch)
tree89b24f17ae5d68c4f7b3843b03f8475b1246cf0c /drivers/usb/gadget/udc/atmel_usba_udc.h
parent66b61e27a98c8d5772dae543ca3581da0c2137a1 (diff)
usb: gadget: atmel: support USB suspend
This patch adds support for USB suspend to the Atmel UDC. When suspended, the UDC clock can be stopped, resulting in some power savings. The "wake up" interrupt will fire irregardless of whether the clock is running or not, allowing the UDC clock to be restarted when the USB master wants to wake the device again. The IRQ state of this device is somewhat fiddly. The "wake up" IRQ seems to actually be a "bus activity" indicator; the IRQ is almost continuously asserted so enabling this IRQ should only be done after a suspend when the wake IRQ becomes relevant. Similarly, the "suspend" IRQ detects "bus inactivity" and may therefore fire together with a "wake" if the two types of activity coincide during the period between two IRQ handler invocations; therefore, it's important to ignore the "suspend" IRQ while waiting for a wake-up. This has been tested on a SAMA5D2 board. Signed-off-by: Jonas Bonn <jonas@norrbonn.se> CC: Cristian Birsan <cristian.birsan@microchip.com> CC: Felipe Balbi <balbi@kernel.org> CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org> CC: Nicolas Ferre <nicolas.ferre@microchip.com> CC: Alexandre Belloni <alexandre.belloni@bootlin.com> CC: Ludovic Desroches <ludovic.desroches@microchip.com> CC: linux-arm-kernel@lists.infradead.org CC: linux-usb@vger.kernel.org Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/gadget/udc/atmel_usba_udc.h')
-rw-r--r--drivers/usb/gadget/udc/atmel_usba_udc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.h b/drivers/usb/gadget/udc/atmel_usba_udc.h
index 030bf797cd25..a0225e4543d4 100644
--- a/drivers/usb/gadget/udc/atmel_usba_udc.h
+++ b/drivers/usb/gadget/udc/atmel_usba_udc.h
@@ -331,6 +331,7 @@ struct usba_udc {
struct usba_ep *usba_ep;
bool bias_pulse_needed;
bool clocked;
+ bool suspended;
u16 devstatus;