diff options
author | Peter Chen <peter.chen@freescale.com> | 2012-03-06 10:10:22 +0800 |
---|---|---|
committer | Jason Liu <r64343@freescale.com> | 2012-07-20 13:23:48 +0800 |
commit | d24899091ff14ae100315744b703ab3340beafdf (patch) | |
tree | 807563597e66a3f0e4ff9b8929c476c94fb19b27 /arch/arm/mach-mx5 | |
parent | 416ef3cc9f84e20218a228f801aa45e9a2617cfc (diff) |
ENGR00176147-2: usb: pass the wakeup event to pdata
The host driver needs to differentiate wakeup event.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Diffstat (limited to 'arch/arm/mach-mx5')
-rwxr-xr-x | arch/arm/mach-mx5/usb_dr.c | 22 | ||||
-rwxr-xr-x | arch/arm/mach-mx5/usb_h1.c | 5 | ||||
-rwxr-xr-x | arch/arm/mach-mx5/usb_h2.c | 5 |
3 files changed, 17 insertions, 15 deletions
diff --git a/arch/arm/mach-mx5/usb_dr.c b/arch/arm/mach-mx5/usb_dr.c index 36e9eac07624..7f0d9026e260 100755 --- a/arch/arm/mach-mx5/usb_dr.c +++ b/arch/arm/mach-mx5/usb_dr.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2011 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright (C) 2005-2012 Freescale Semiconductor, Inc. All Rights Reserved. */ /* @@ -225,7 +225,6 @@ static void host_wakeup_handler(struct fsl_usb2_platform_data *pdata) { _host_wakeup_enable(pdata, false); _host_phy_lowpower_suspend(pdata, false); - pdata->wakeup_event = 1; } /* End of host related operation for DR port */ #endif /* CONFIG_USB_EHCI_ARC_OTG */ @@ -262,22 +261,27 @@ static enum usb_wakeup_event _is_device_wakeup(struct fsl_usb2_platform_data *pd pr_debug("the otgsc is 0x%x, usbsts is 0x%x, portsc is 0x%x, wakeup_irq is 0x%x\n", UOG_OTGSC, UOG_USBSTS, UOG_PORTSC1, wakeup_req); /* 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; + return WAKEUP_EVENT_DPDM; + } + 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 WAKEUP_EVENT_DPDM; } 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"); - return true; + return WAKEUP_EVENT_VBUS; } if (wakeup_req && (UOG_OTGSC & OTGSC_STS_USB_ID) && !(UOG_OTGSC & OTGSC_STS_A_VBUS_VALID)) { printk(KERN_INFO "otg udc vbus falling wakeup\n"); - return true; + return WAKEUP_EVENT_VBUS; } return WAKEUP_EVENT_INVALID; diff --git a/arch/arm/mach-mx5/usb_h1.c b/arch/arm/mach-mx5/usb_h1.c index 3d692e90df00..e291fb7b5708 100755 --- a/arch/arm/mach-mx5/usb_h1.c +++ b/arch/arm/mach-mx5/usb_h1.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2011 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright (C) 2005-2012 Freescale Semiconductor, Inc. All Rights Reserved. */ /* @@ -124,7 +124,7 @@ static enum usb_wakeup_event _is_usbh1_wakeup(struct fsl_usb2_platform_data *pda int wakeup_req = USBCTRL & UCTRL_H1WIR; if (wakeup_req) - return !WAKEUP_EVENT_INVALID; + return WAKEUP_EVENT_DPDM; return WAKEUP_EVENT_INVALID; } @@ -133,7 +133,6 @@ static void h1_wakeup_handler(struct fsl_usb2_platform_data *pdata) { _wake_up_enable(pdata, false); _phy_lowpower_suspend(pdata, false); - pdata->wakeup_event = 1; } static void usbh1_wakeup_event_clear(void) diff --git a/arch/arm/mach-mx5/usb_h2.c b/arch/arm/mach-mx5/usb_h2.c index 37e847640a7b..1f7d0a707e7c 100755 --- a/arch/arm/mach-mx5/usb_h2.c +++ b/arch/arm/mach-mx5/usb_h2.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2011 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright (C) 2005-2012 Freescale Semiconductor, Inc. All Rights Reserved. */ /* @@ -104,7 +104,7 @@ static enum usb_wakeup_event _is_usbh2_wakeup(struct fsl_usb2_platform_data *pda int wakeup_req = USBCTRL & UCTRL_H2WIR; if (wakeup_req) - return !WAKEUP_EVENT_INVALID; + return WAKEUP_EVENT_DPDM; return WAKEUP_EVENT_INVALID; } @@ -113,7 +113,6 @@ static void h2_wakeup_handler(struct fsl_usb2_platform_data *pdata) { _wake_up_enable(pdata, false); _phy_lowpower_suspend(pdata, false); - pdata->wakeup_event = 1; } static void usbh2_wakeup_event_clear(void) |