diff options
author | Gregory Herrero <gregory.herrero@intel.com> | 2015-09-22 15:16:41 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-10-01 12:40:15 -0500 |
commit | 31927b6b68acd21258b1f4ef24464acae60cfd36 (patch) | |
tree | 1596bff073c6b2340babcf5458b5136e79989e05 /drivers/usb/dwc2/hcd.c | |
parent | a2a23d3f9e6f44f900e4c4b4cd58f22490c3c200 (diff) | |
download | linux-31927b6b68acd21258b1f4ef24464acae60cfd36.tar.gz linux-31927b6b68acd21258b1f4ef24464acae60cfd36.tar.bz2 linux-31927b6b68acd21258b1f4ef24464acae60cfd36.zip |
usb: dwc2: host: update hcd and lx_state during start/stop callbacks
During hcd initialization, hardware accessible flag and lx_state must
be reset to the working state since controller is powered at this stage.
Same logic applied for stop callback.
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/hcd.c')
-rw-r--r-- | drivers/usb/dwc2/hcd.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 459b441e4838..65ae0a390600 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -2318,8 +2318,9 @@ static int _dwc2_hcd_start(struct usb_hcd *hcd) dev_dbg(hsotg->dev, "DWC OTG HCD START\n"); spin_lock_irqsave(&hsotg->lock, flags); - + hsotg->lx_state = DWC2_L0; hcd->state = HC_STATE_RUNNING; + set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); if (dwc2_is_device_mode(hsotg)) { spin_unlock_irqrestore(&hsotg->lock, flags); @@ -2350,6 +2351,9 @@ static void _dwc2_hcd_stop(struct usb_hcd *hcd) spin_lock_irqsave(&hsotg->lock, flags); dwc2_hcd_stop(hsotg); + hsotg->lx_state = DWC2_L3; + hcd->state = HC_STATE_HALT; + clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); spin_unlock_irqrestore(&hsotg->lock, flags); usleep_range(1000, 3000); |