Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
- index 128a804..368235b 100644
- --- a/drivers/usb/core/hub.c
- +++ b/drivers/usb/core/hub.c
- @@ -30,6 +30,19 @@
- #include <asm/uaccess.h>
- #include <asm/byteorder.h>
- +#ifdef CONFIG_USB_MXS_PHY
- +#include <linux/io.h>
- +#include <linux/of_platform.h>
- +
- +#define USB_MXS_PHY_HACK
- +
- +#define HW_USBPHY_CTRL 0x30
- +#define HW_USBPHY_CTRL_SET 0x34
- +#define HW_USBPHY_CTRL_CLR 0x38
- +
- +#define BM_USBPHY_CTRL_ENHOSTDISCONDETECT BIT(1)
- +#endif
- +
- #include "usb.h"
- /* if we are in debug mode, always announce new devices */
- @@ -3894,6 +3907,15 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
- break;
- }
- }
- +
- +#ifdef USB_MXS_PHY_HACK
- + /* Enable HOSTDISCONDETECT after second reset. */
- + if (of_machine_is_compatible("fsl,imx23"))
- + if ((port1 == 1) && (udev->speed == USB_SPEED_HIGH))
- + writel_relaxed(BM_USBPHY_CTRL_ENHOSTDISCONDETECT,
- + hcd->phy->io_priv + HW_USBPHY_CTRL_SET);
- +#endif
- +
- if (retval)
- goto fail;
- @@ -4050,6 +4072,14 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
- "port %d, status %04x, change %04x, %s\n",
- port1, portstatus, portchange, portspeed(hub, portstatus));
- +#ifdef USB_MXS_PHY_HACK
- + /* Clear HOSTDISCONDETECT if not a connection. */
- + if (of_machine_is_compatible("fsl,imx23"))
- + if ((port1 == 1) && !(portstatus & USB_PORT_STAT_CONNECTION))
- + writel_relaxed(BM_USBPHY_CTRL_ENHOSTDISCONDETECT,
- + hcd->phy->io_priv + HW_USBPHY_CTRL_CLR);
- +#endif
- +
- if (hub->has_indicators) {
- set_port_led(hub, port1, HUB_LED_AUTO);
- hub->indicator[port1-1] = INDICATOR_AUTO;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement