summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2011-01-08 17:13:19 +0800
committerPeter Chen <peter.chen@freescale.com>2011-01-08 17:24:06 +0800
commitaa13a6a2a6c6c539e2ceccada135ca23f1f303f0 (patch)
tree156f066c9855b9f387dd3dfcc9cf1237f54df8ea /arch
parentcd99afc6bfaa55778408c78f90b544d64ff75139 (diff)
ENGR00137762-1 usb: debounce vbus and id value for all usb mode
The old code only debounce vbus and id value for OTG mode, these value should be debounce for all usb mode, including usb device only mode, usb host only mode, and usb otg mode. Besides, It also changes the debounce function name from usb_debounce_id_pin to usb_debounce_id_vbus, it will be more clear for reader. Signed-off-by: Peter Chen <peter.chen@freescale.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/plat-mxc/usb_common.c18
-rw-r--r--arch/arm/plat-mxc/usb_wakeup.c9
-rw-r--r--arch/arm/plat-mxs/usb_common.c15
-rw-r--r--arch/arm/plat-mxs/usb_wakeup.c9
4 files changed, 24 insertions, 27 deletions
diff --git a/arch/arm/plat-mxc/usb_common.c b/arch/arm/plat-mxc/usb_common.c
index 8cf601fe2328..69cbcfc01d6f 100644
--- a/arch/arm/plat-mxc/usb_common.c
+++ b/arch/arm/plat-mxc/usb_common.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2004-2011 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
@@ -872,18 +872,16 @@ void usbotg_uninit(struct fsl_usb2_platform_data *pdata)
}
EXPORT_SYMBOL(usbotg_uninit);
-/* the debounce function is only used when OTG is enabled,
- * if otg disabled, the ID pin is not used */
-void usb_debounce_id_pin(void)
+/*
+ * This function is used to debounce the reading value for id/vbus at
+ * the register of otgsc
+ */
+void usb_debounce_id_vbus(void)
{
-#ifdef CONFIG_USB_OTG
- /* Because the IC design needs to remove the glitch on ID so the otgsc bit 8 will
- * be delayed max 2 ms to show the real ID pin value
- */
mdelay(3);
-#endif
}
-EXPORT_SYMBOL(usb_debounce_id_pin);
+EXPORT_SYMBOL(usb_debounce_id_vbus);
+
int usb_host_wakeup_irq(struct device *wkup_dev)
{
int wakeup_req = 0;
diff --git a/arch/arm/plat-mxc/usb_wakeup.c b/arch/arm/plat-mxc/usb_wakeup.c
index 69354ebeaf01..24300fb4012d 100644
--- a/arch/arm/plat-mxc/usb_wakeup.c
+++ b/arch/arm/plat-mxc/usb_wakeup.c
@@ -32,7 +32,7 @@ struct wakeup_ctrl {
static struct wakeup_ctrl *g_ctrl;
extern int usb_event_is_otg_wakeup(void);
-extern void usb_debounce_id_pin(void);
+extern void usb_debounce_id_vbus(void);
static void wakeup_clk_gate(struct fsl_usb2_wakeup_platform_data *pdata, bool on)
{
@@ -97,11 +97,10 @@ static void wakeup_event_handler(struct wakeup_ctrl *ctrl)
int i;
wakeup_clk_gate(ctrl->pdata, true);
- /* if this is an wakeup event, we should debounce ID pin
- * so we can get the correct ID value(ID status) here
- * */
+
+ /* In order to get the real id/vbus value */
if (usb_event_is_otg_wakeup())
- usb_debounce_id_pin();
+ usb_debounce_id_vbus();
for (i = 0; i < 3; i++) {
struct fsl_usb2_platform_data *usb_pdata = pdata->usb_pdata[i];
diff --git a/arch/arm/plat-mxs/usb_common.c b/arch/arm/plat-mxs/usb_common.c
index a3b18beb1be5..16ef4736b4d0 100644
--- a/arch/arm/plat-mxs/usb_common.c
+++ b/arch/arm/plat-mxs/usb_common.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2009-2011 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
@@ -370,15 +370,16 @@ void fsl_usb_host_uninit(struct fsl_usb2_platform_data *pdata)
}
EXPORT_SYMBOL(fsl_usb_host_uninit);
-void usb_debounce_id_pin(void)
+/*
+ * This function is used to debounce the reading value for id/vbus at
+ * the register of otgsc
+ */
+void usb_debounce_id_vbus(void)
{
-
- /* Because the IC design needs to remove the glitch on ID so the otgsc bit 8 will
- * be delayed max 2 ms to show the real ID pin value
- */
mdelay(3);
}
-EXPORT_SYMBOL(usb_debounce_id_pin);
+EXPORT_SYMBOL(usb_debounce_id_vbus);
+
int usb_host_wakeup_irq(struct device *wkup_dev)
{
return 0;
diff --git a/arch/arm/plat-mxs/usb_wakeup.c b/arch/arm/plat-mxs/usb_wakeup.c
index 74223a88bbe4..ecefaeed519c 100644
--- a/arch/arm/plat-mxs/usb_wakeup.c
+++ b/arch/arm/plat-mxs/usb_wakeup.c
@@ -34,7 +34,7 @@ struct wakeup_ctrl {
static struct wakeup_ctrl *g_ctrl;
extern int usb_event_is_otg_wakeup(void);
-extern void usb_debounce_id_pin(void);
+extern void usb_debounce_id_vbus(void);
static void wakeup_clk_gate(struct fsl_usb2_wakeup_platform_data *pdata, bool on)
{
@@ -94,11 +94,10 @@ static void wakeup_event_handler(struct wakeup_ctrl *ctrl)
int i;
wakeup_clk_gate(ctrl->pdata, true);
- /* if this is an wakeup event, we should debounce ID pin
- * so we can get the correct ID value(ID status) here
- * */
+
+ /* In order to get the real id/vbus value */
if (usb_event_is_otg_wakeup())
- usb_debounce_id_pin();
+ usb_debounce_id_vbus();
for (i = 0; i < 3; i++) {
struct fsl_usb2_platform_data *usb_pdata = pdata->usb_pdata[i];