summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc2
diff options
context:
space:
mode:
authorGregory Herrero <gregory.herrero@intel.com>2015-09-29 10:08:20 (GMT)
committerFelipe Balbi <balbi@ti.com>2015-10-01 17:40:24 (GMT)
commitcd0e641c8da3c763f1f4b838a9bc30f1297f68d0 (patch)
tree57cae2ccfb5787a6f6d47c573b11926cfbca680d /drivers/usb/dwc2
parent77ba9119adc48a0bb890ca121f6b8f09162c9182 (diff)
downloadlinux-cd0e641c8da3c763f1f4b838a9bc30f1297f68d0.tar.xz
usb: dwc2: gadget: set op_state in vbus_session call
Some device may have external id pin control enabled, so op_state will not be set on id pin interrupt change. Thus, ensure op_state is set to peripheral during vbus detection. Signed-off-by: Gregory Herrero <gregory.herrero@intel.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Tested-by: Robert Baldyga <r.baldyga@samsung.com> Tested-by: Dinh Nguyen <dinguyen@opensource.altera.com> Tested-by: John Youn <johnyoun@synopsys.com> Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc2')
-rw-r--r--drivers/usb/dwc2/gadget.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 61d1021..1a216c5 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -3209,6 +3209,7 @@ static int dwc2_hsotg_vbus_session(struct usb_gadget *gadget, int is_active)
spin_lock_irqsave(&hsotg->lock, flags);
if (is_active) {
+ hsotg->op_state = OTG_STATE_B_PERIPHERAL;
/*
* If controller is hibernated, it must exit from hibernation
* before being initialized