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-05 13:28:00 -0700
commit0218442f458a15357202af01cf3f7b65430c0617 (patch)
tree70697930cff0ea560ff5c546e7d0de671a71af43
parent7871116830fe633b55d8104deddac603f003306a (diff)
fsl udc: Fix cable connect/disconnect checking
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"); */
}
}
}