summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJingchang Lu <b35083@freescale.com>2012-07-26 16:37:38 +0800
committerJason Jin <Jason.jin@freescale.com>2012-08-10 18:19:12 +0800
commit6490dbcc4505f910561170fcfc8e34cd627c962d (patch)
treee3f75bff0333622353ef9826d00cbf845456b4b7
parent64798c861c899136399dd5ce98061bf1368ca8c3 (diff)
ENGR00181396-2: high-speed USB device disconnection management
Detection of high-speed USB device disconnection should be enable on connection and disable on disconnection. Signed-off-by: Jingchang Lu <b35083@freescale.com>
-rw-r--r--drivers/usb/core/hub.c16
-rw-r--r--include/linux/fsl_devices.h4
2 files changed, 18 insertions, 2 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 4ef23fe6789d..6ce6dd7b944b 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -25,6 +25,8 @@
#include <linux/mutex.h>
#include <linux/freezer.h>
+#include <linux/fsl_devices.h>
+
#include <asm/uaccess.h>
#include <asm/byteorder.h>
@@ -37,6 +39,10 @@
extern void fsl_platform_set_usb_phy_dis(struct fsl_usb2_platform_data *pdata,
bool enable);
#endif
+#ifdef CONFIG_ARCH_MVF
+#define MVF_USB_HOST_HACK
+#include <linux/fsl_devices.h>
+#endif
/* if we are in debug mode, always announce new devices */
#ifdef DEBUG
#ifndef CONFIG_USB_ANNOUNCE_NEW_DEVICES
@@ -1661,7 +1667,10 @@ void usb_disconnect(struct usb_device **pdev)
usb_set_device_state(udev, USB_STATE_NOTATTACHED);
dev_info(&udev->dev, "USB disconnect, device number %d\n",
udev->devnum);
-
+#ifdef MVF_USB_HOST_HACK
+ if (udev->speed == USB_SPEED_HIGH)
+ fsl_platform_set_usb_phy_dis(NULL, 0);
+#endif
usb_lock_device(udev);
/* Free up all the children before we remove this device */
@@ -2906,7 +2915,10 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
udev->tt = &hub->tt;
udev->ttport = port1;
}
-
+#ifdef MVF_USB_HOST_HACK
+ if (udev->speed == USB_SPEED_HIGH)
+ fsl_platform_set_usb_phy_dis(NULL, 1);
+#endif
/* Why interleave GET_DESCRIPTOR and SET_ADDRESS this way?
* Because device hardware and firmware is sometimes buggy in
* this area, and this is how Linux has done it for ages.
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index 2567d84afb73..dd8e4cd3c15b 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -419,4 +419,8 @@ struct mxs_platform_perfmon_data {
void (*plt_exit) (void);
};
+#ifdef CONFIG_ARCH_MVF
+extern void fsl_platform_set_usb_phy_dis(struct fsl_usb2_platform_data *pdata,
+ bool enable);
+#endif
#endif /* _FSL_DEVICE_H_ */