diff options
author | Jonas Bonn <jonas@norrbonn.se> | 2019-02-20 13:20:00 +0100 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2019-05-03 08:13:49 +0200 |
commit | 70a7f8be85986a3c2ffc7274c41b89552dfe2ad0 (patch) | |
tree | 89b24f17ae5d68c4f7b3843b03f8475b1246cf0c /drivers/usb/gadget/udc/atmel_usba_udc.h | |
parent | usb: gadget: atmel_usba_udc: simplify setting of interrupt-enabled mask (diff) | |
download | linux-70a7f8be85986a3c2ffc7274c41b89552dfe2ad0.tar.xz linux-70a7f8be85986a3c2ffc7274c41b89552dfe2ad0.zip |
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.h | 1 |
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; |