diff options
author | Sylvain Rochet <sylvain.rochet@finsecur.com> | 2015-02-12 18:54:06 +0100 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-03-11 10:19:37 -0500 |
commit | a64ef71ddc13fc76a6f4af8c61e0106a62004380 (patch) | |
tree | ba03e7ab4154e4a88fd4cd86623e97b05be403f6 /drivers/usb/gadget/udc/atmel_usba_udc.h | |
parent | bb0a203c3a4e37b4bbb1f8ef55a855618dbba265 (diff) | |
download | linux-a64ef71ddc13fc76a6f4af8c61e0106a62004380.tar.bz2 |
usb: gadget: atmel_usba_udc: condition clocks to vbus state
If USB PLL is not necessary for other USB drivers (e.g. OHCI and EHCI)
we will reduce power consumption by switching off the USB PLL if no USB
Host is currently connected to this USB Device.
We are using Vbus GPIO signal to detect Host presence. If Vbus signal is
not available then the device stays continuously clocked.
Signed-off-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/udc/atmel_usba_udc.h')
-rw-r--r-- | drivers/usb/gadget/udc/atmel_usba_udc.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.h b/drivers/usb/gadget/udc/atmel_usba_udc.h index 497cd18836f3..085749a649e1 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.h +++ b/drivers/usb/gadget/udc/atmel_usba_udc.h @@ -313,6 +313,9 @@ struct usba_udc { /* Protect hw registers from concurrent modifications */ spinlock_t lock; + /* Mutex to prevent concurrent start or stop */ + struct mutex vbus_mutex; + void __iomem *regs; void __iomem *fifo; @@ -328,6 +331,7 @@ struct usba_udc { struct clk *hclk; struct usba_ep *usba_ep; bool bias_pulse_needed; + bool clocked; u16 devstatus; |