summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2015-08-05 10:16:19 +0800
committerPeter Chen <peter.chen@freescale.com>2015-08-14 09:13:13 +0800
commit11a27098e884b8eb797f1579ebc51cb0e0510cc3 (patch)
tree3835754e9a2d081f04e160d79e3e84eeb863aefd /drivers/usb
parentef12da914ed696745b495bea22aea137e88cffb6 (diff)
downloadlinux-11a27098e884b8eb797f1579ebc51cb0e0510cc3.tar.gz
linux-11a27098e884b8eb797f1579ebc51cb0e0510cc3.tar.bz2
linux-11a27098e884b8eb797f1579ebc51cb0e0510cc3.zip
usb: chipidea: host: override hcd reset API
The system configuration API should be called before the controller run, otherwise, undefined results may occur. So, we override hcd reset API, and add system configuration API after controller reset. Cc: Li Jun <peter.chen@freescale.com> Cc: Alan Stern <stern@rowland.harvard.edu> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Peter Chen <peter.chen@freescale.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/chipidea/host.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c
index ee38c5da211a..3d24304405b3 100644
--- a/drivers/usb/chipidea/host.c
+++ b/drivers/usb/chipidea/host.c
@@ -77,9 +77,25 @@ static int ehci_ci_portpower(struct usb_hcd *hcd, int portnum, bool enable)
return 0;
};
+static int ehci_ci_reset(struct usb_hcd *hcd)
+{
+ struct device *dev = hcd->self.controller;
+ struct ci_hdrc *ci = dev_get_drvdata(dev);
+ int ret;
+
+ ret = ehci_setup(hcd);
+ if (ret)
+ return ret;
+
+ ci_platform_configure(ci);
+
+ return ret;
+}
+
static const struct ehci_driver_overrides ehci_ci_overrides = {
.extra_priv_size = sizeof(struct ehci_ci_priv),
.port_power = ehci_ci_portpower,
+ .reset = ehci_ci_reset,
};
static irqreturn_t host_irq(struct ci_hdrc *ci)
@@ -151,8 +167,6 @@ static int host_start(struct ci_hdrc *ci)
}
}
- ci_platform_configure(ci);
-
return ret;
disable_reg: