From: Felipe Balbi Date: Fri, 8 Feb 2013 15:55:58 +0000 (+0200) Subject: usb: dwc3: gadget: save state of pullups X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9fcb3bd8d12db29c101d3722d37ddef9d1915317;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git usb: dwc3: gadget: save state of pullups This will be used during resume to verify if we should reconnect our pullups or not. Tested-by: Vivek Gautam Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index b41750660235..35e4d3c01ed0 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -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; diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index db2031725abc..04e4812fe2f9 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -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);