usb: dwc3: gadget: save state of pullups
authorFelipe Balbi <balbi@ti.com>
Fri, 8 Feb 2013 15:55:58 +0000 (17:55 +0200)
committerFelipe Balbi <balbi@ti.com>
Mon, 18 Mar 2013 09:17:00 +0000 (11:17 +0200)
This will be used during resume to verify
if we should reconnect our pullups or not.

Tested-by: Vivek Gautam <gautam.vivek@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc3/core.h
drivers/usb/dwc3/gadget.c

index b4175066023590e9697c216c145c6f4a9b667b0c..35e4d3c01ed0328dc380ed41df07d5b555e2b072 100644 (file)
@@ -704,6 +704,7 @@ struct dwc3 {
        unsigned                delayed_status:1;
        unsigned                needs_fifo_resize:1;
        unsigned                resize_fifos:1;
+       unsigned                pullups_connected:1;
 
        enum dwc3_ep0_next      ep0_next_event;
        enum dwc3_ep0_state     ep0state;
index db2031725abcae94cd0d6a98dc69edf64e7ec5a7..04e4812fe2f9faf3d1328450af26eb694bc5b381 100644 (file)
@@ -1425,8 +1425,10 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on)
                if (dwc->revision >= DWC3_REVISION_194A)
                        reg &= ~DWC3_DCTL_KEEP_CONNECT;
                reg |= DWC3_DCTL_RUN_STOP;
+               dwc->pullups_connected = true;
        } else {
                reg &= ~DWC3_DCTL_RUN_STOP;
+               dwc->pullups_connected = false;
        }
 
        dwc3_writel(dwc->regs, DWC3_DCTL, reg);