diff options
author | Peter Chen <peter.chen@freescale.com> | 2012-01-31 13:34:20 +0800 |
---|---|---|
committer | Peter Chen <peter.chen@freescale.com> | 2012-02-01 17:51:03 +0800 |
commit | 54401854d33c0150fef383b52b9ee8f86ee780b1 (patch) | |
tree | 34a335e05b66c5158dbb56d27013937143a7e98b | |
parent | 9f1d74d0bd0b2aeb4bd0710f1b8206e8fc0d14a8 (diff) |
ENGR00173378-1 usb: device: Change judgement condition for resume occurrence
At former code, it uses portsc.fpr to indicate if the host sends
resume signal to device, but it has some limitations that if the code
can't be executed before the resume signal finishes, the portsc.fpr
will be cleared automatically.
Now, it uses usbsts.pci to judge host resume signal, this bit
will not be cleared before the non-wakeup interrupt handler is called,
and the wakeup code is executed before non-wakeup interrupt handler.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
-rw-r--r-- | arch/arm/mach-mx6/usb_dr.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/arm/mach-mx6/usb_dr.c b/arch/arm/mach-mx6/usb_dr.c index fb241f517c39..4c7c21dd2f56 100644 --- a/arch/arm/mach-mx6/usb_dr.c +++ b/arch/arm/mach-mx6/usb_dr.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright (C) 2012 Freescale Semiconductor, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -423,14 +423,19 @@ static enum usb_wakeup_event _is_device_wakeup(struct fsl_usb2_platform_data *pd pr_debug("%s\n", __func__); /* if ID=1, it is a device wakeup event */ - if (wakeup_req && (UOG_OTGSC & OTGSC_STS_USB_ID) && (UOG_PORTSC1 & PORTSC_PORT_FORCE_RESUME)) { - printk(KERN_INFO "otg udc wakeup, host sends resume signal\n"); - return true; - } if (wakeup_req && (UOG_OTGSC & OTGSC_STS_USB_ID) && (UOG_USBSTS & USBSTS_URI)) { printk(KERN_INFO "otg udc wakeup, host sends reset signal\n"); return true; } + if (wakeup_req && (UOG_OTGSC & OTGSC_STS_USB_ID) && \ + ((UOG_USBSTS & USBSTS_PCI) || (UOG_PORTSC1 & PORTSC_PORT_FORCE_RESUME))) { + /* + * When the line state from J to K, the Port Change Detect bit + * in the USBSTS register is also set to '1'. + */ + printk(KERN_INFO "otg udc wakeup, host sends resume signal\n"); + return true; + } if (wakeup_req && (UOG_OTGSC & OTGSC_STS_USB_ID) && (UOG_OTGSC & OTGSC_STS_A_VBUS_VALID) \ && (UOG_OTGSC & OTGSC_IS_B_SESSION_VALID)) { printk(KERN_INFO "otg udc vbus rising wakeup\n"); |