diff options
author | Rakesh Bodla <rbodla@nvidia.com> | 2011-03-16 11:05:36 +0530 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-03-18 14:55:58 -0800 |
commit | 1ae405ab138037ffa3f08b424d23797ce9bcdb0a (patch) | |
tree | 20b48e894acd09ef0a6779dde518d0fbb4858817 | |
parent | 36839168acf07709d0a6c9371b248518a3422b6f (diff) |
usb: gadget: update vbus status before clock is disabled
When the device cable is disconnected, vbus status
must be updated before disabling the clock.
Bug 796339 779952
Reviewed-on: http://git-master/r/21890
(cherry picked from commit 12969307ec39ddaf913b84628d1c192eb2e59dc8)
Change-Id: Idc98a816afd539acfd5add334535c1f298f58ff6
Reviewed-on: http://git-master/r/23127
Reviewed-by: Rakesh Bodla <rbodla@nvidia.com>
Tested-by: Rakesh Bodla <rbodla@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
-rw-r--r-- | drivers/usb/gadget/fsl_udc_core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c index b85ebe9f275e..ba634bf6d238 100644 --- a/drivers/usb/gadget/fsl_udc_core.c +++ b/drivers/usb/gadget/fsl_udc_core.c @@ -1213,10 +1213,10 @@ static int fsl_vbus_session(struct usb_gadget *gadget, int is_active) /* stop the controller and turn off the clocks */ dr_controller_stop(udc); dr_controller_reset(udc); - spin_unlock_irqrestore(&udc->lock, flags); - fsl_udc_clk_suspend(); udc->vbus_active = 0; udc->usb_state = USB_STATE_DEFAULT; + spin_unlock_irqrestore(&udc->lock, flags); + fsl_udc_clk_suspend(); } else if (!udc->vbus_active && is_active) { fsl_udc_clk_resume(); /* setup the controller in the device mode */ |