usb: dwc3: gadget: set state to NOT_ATTACHED on disconnect_irq
authorFelipe Balbi <balbi@ti.com>
Fri, 10 Oct 2014 20:24:00 +0000 (15:24 -0500)
committerFelipe Balbi <balbi@ti.com>
Mon, 3 Nov 2014 16:01:00 +0000 (10:01 -0600)
whenever we get a Disconnect Interrupt, we should
make sure to update out udc state to NOT_ATTACHED,
otherwise sysfs will show wrong values.

Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc3/gadget.c

index 748b87b3f98ad662874ad3a7df5e7666e3818587..12f42842da10230d6fda43a8a62c863fd6f23711 100644 (file)
@@ -2140,6 +2140,7 @@ static void dwc3_gadget_disconnect_interrupt(struct dwc3 *dwc)
 
        dwc->gadget.speed = USB_SPEED_UNKNOWN;
        dwc->setup_packet_pending = false;
+       usb_gadget_set_state(&dwc->gadget, USB_STATE_NOTATTACHED);
 }
 
 static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc)