diff options
author | Peter Chen <peter.chen@freescale.com> | 2011-07-04 16:00:54 +0800 |
---|---|---|
committer | Jason Liu <r64343@freescale.com> | 2012-01-09 20:18:33 +0800 |
commit | 0d1df2c18713cc803adbf78edd79302a8b113bca (patch) | |
tree | fff96a3310ed7224c0fead431a9a783de4c5bddc /drivers/usb/core/hub.c | |
parent | 62c4eaf233b829d68d8a9bae3291a1898ab8cc38 (diff) |
ENGR00152493-2 mx6q: add usb function
The changes for driver part
- Merging some newest changes at 2.6.38
- Add high speed disconnect check at usb core
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r-- | drivers/usb/core/hub.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 210e3597091a..29914c4e3509 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -30,6 +30,13 @@ #include "usb.h" +#ifdef CONFIG_ARCH_MX6 +#define MX6_USB_HOST_HACK + +#include <linux/fsl_devices.h> +extern void fsl_platform_set_usb_phy_dis(struct fsl_usb2_platform_data *pdata, + bool enable); +#endif /* if we are in debug mode, always announce new devices */ #ifdef DEBUG #ifndef CONFIG_USB_ANNOUNCE_NEW_DEVICES @@ -3021,6 +3028,19 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, break; } } +#ifdef MX6_USB_HOST_HACK + { /*Must enable HOSTDISCONDETECT after second reset*/ + if (port1 == 1) { + if (udev->speed == USB_SPEED_HIGH) { + struct device *dev = hcd->self.controller; + struct fsl_usb2_platform_data *pdata; + pdata = (struct fsl_usb2_platform_data *) + dev->platform_data; + fsl_platform_set_usb_phy_dis(pdata, 1); + } + } + } +#endif if (retval) goto fail; @@ -3158,6 +3178,24 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1, hub->indicator[port1-1] = INDICATOR_AUTO; } +#ifdef MX6_USB_HOST_HACK + { + struct device *dev = hcd->self.controller; + struct fsl_usb2_platform_data *pdata; + + pdata = (struct fsl_usb2_platform_data *)dev->platform_data; + if (dev->parent && dev->type) { + if (port1 == 1 && pdata->init) + pdata->init(NULL); + } + if (port1 == 1) { + if (!(portstatus&USB_PORT_STAT_CONNECTION)) { + /* Must clear HOSTDISCONDETECT when disconnect*/ + fsl_platform_set_usb_phy_dis(pdata, 0); + } + } + } +#endif #ifdef CONFIG_USB_OTG /* during HNP, don't repeat the debounce */ if (hdev->bus->is_b_host) |