usb: gadget: atmel_usba_udc: Fixed vbus_prev initial state
authorSylvain Rochet <sylvain.rochet@finsecur.com>
Thu, 12 Feb 2015 17:54:04 +0000 (18:54 +0100)
committerFelipe Balbi <balbi@ti.com>
Wed, 11 Mar 2015 15:19:36 +0000 (10:19 -0500)
If vbus gpio is high at init, we should set vbus_prev to true
accordingly to the current vbus state. Without that, we skip the first
vbus interrupt because the saved vbus state is not consistent.

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>
drivers/usb/gadget/udc/atmel_usba_udc.c

index d79cb35dbf8a2099dab062473ed9e70a21feca2d..e63c6fc8173be3db31d0fb3a73393919301bb59d 100644 (file)
@@ -1811,6 +1811,8 @@ static int atmel_usba_start(struct usb_gadget *gadget,
                toggle_bias(udc, 1);
                usba_writel(udc, CTRL, USBA_ENABLE_MASK);
                usba_int_enb_set(udc, USBA_END_OF_RESET);
+
+               udc->vbus_prev = 1;
        }
        spin_unlock_irqrestore(&udc->lock, flags);