summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVenkat Moganty <vmoganty@nvidia.com>2010-05-05 22:18:11 +0530
committerGary King <gking@nvidia.com>2010-05-07 08:57:52 -0700
commita8d0003fdd82dedd80e724b33605121672f5f988 (patch)
tree0f1135437e7d38afec2e4798375e52781d8c255d
parentbd84f32885d1d24edb30013763626c37c124ecdd (diff)
fsl udc: Fix cable connect/disconnect checkingtegra-9.12.11
On VBUS interrupt irq acknowledges the VBUS interrupt and schedules the work thread for powering/up down the USB phy and clocks based on the VBUS status. But, in the work thread instead of checking the VBUS status directly, rechecking the interrupt status which is already disabled. This is fixed by checking the vbus status only in the work thread for controlling the power up/down sequence. Due to the disconnect problem power numbers increased when there is no USB cable connected to the system. Bug 682756 Bug 682727 Change-Id: Id1c5b3cd1f2f195c4dfadf397e1f8650bf9da12b Reviewed-on: http://git-master/r/1300 Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
-rwxr-xr-xdrivers/usb/gadget/fsl_udc_core.c44
1 files changed, 21 insertions, 23 deletions
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
index cbf6313585c3..7f4149747b1a 100755
--- a/drivers/usb/gadget/fsl_udc_core.c
+++ b/drivers/usb/gadget/fsl_udc_core.c
@@ -1883,30 +1883,28 @@ static void fsl_udc_irq_work(struct work_struct* irq_work)
* mark the vbus active shadow.
*/
temp = fsl_readl(&usb_sys_regs->vbus_wakeup);
- if (temp & USB_SYS_VBUS_WAKEUP_INT_STATUS) {
- if (temp & USB_SYS_VBUS_STATUS) {
- udc->vbus_active = 1;
- platform_udc_clk_resume();
- /* Schedule work to wait for 100msec and check for
- * charger if setup packet is not received */
- schedule_delayed_work(&udc->work,
- USB_CHARGER_DETECTION_WAIT_TIME_MS);
- /* printk("USB cable connected\n"); */
- } else {
- /* If cable disconnected, cancel any delayed work */
- cancel_delayed_work(&udc->work);
- spin_lock(&udc->lock);
- reset_queues(udc);
- spin_unlock(&udc->lock);
- udc->vbus_active = 0;
- udc->usb_state = USB_STATE_DEFAULT;
- platform_udc_clk_suspend();
- if (udc->vbus_regulator) {
- /* set the current limit to 0mA */
- regulator_set_current_limit(udc->vbus_regulator, 0, 0);
- }
- /* printk("USB cable dis-connected\n"); */
+ if (temp & USB_SYS_VBUS_STATUS) {
+ udc->vbus_active = 1;
+ platform_udc_clk_resume();
+ /* Schedule work to wait for 100msec and check for
+ * charger if setup packet is not received */
+ schedule_delayed_work(&udc->work,
+ USB_CHARGER_DETECTION_WAIT_TIME_MS);
+ /* printk("USB cable connected\n"); */
+ } else {
+ /* If cable disconnected, cancel any delayed work */
+ cancel_delayed_work(&udc->work);
+ spin_lock(&udc->lock);
+ reset_queues(udc);
+ spin_unlock(&udc->lock);
+ udc->vbus_active = 0;
+ udc->usb_state = USB_STATE_DEFAULT;
+ platform_udc_clk_suspend();
+ if (udc->vbus_regulator) {
+ /* set the current limit to 0mA */
+ regulator_set_current_limit(udc->vbus_regulator, 0, 0);
}
+ /* printk("USB cable dis-connected\n"); */
}
}
}