summaryrefslogtreecommitdiff
path: root/drivers/usb/host/ehci-mv.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2012-07-09 23:55:14 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-10 00:35:05 +0400
commit1a49e2ac9651df7349867a5cf44e2c83de1046af (patch)
treeb4ba01d645073947dcf8bbe1972b7af740031b5b /drivers/usb/host/ehci-mv.c
parent1530280084c3905be6fce802cbfa83fb3bbb8839 (diff)
downloadlinux-1a49e2ac9651df7349867a5cf44e2c83de1046af.tar.xz
EHCI: centralize controller initialization
This patch (as1564c) converts the EHCI platform drivers to use the central ehci_setup() routine for generic controller initialization rather than each having its own idiosyncratic approach. The major point of difficulty lies in ehci-pci's many vendor- and device-specific workarounds. Some of them have to be applied before calling ehci_setup() and some after, which necessitates a fair amount of code motion. The other platform drivers require much smaller changes. One point not addressed by the patch is whether ports should be powered on or off following initialization. The different drivers appear to handle this pretty much at random. In fact it shouldn't matter, because the hub driver turns on power to all ports when it binds to the root hub. Straightening that out will be left for another day. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci-mv.c')
-rw-r--r--drivers/usb/host/ehci-mv.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c
index 0e8c168ca24c..f6df1ccc9617 100644
--- a/drivers/usb/host/ehci-mv.c
+++ b/drivers/usb/host/ehci-mv.c
@@ -77,7 +77,6 @@ static void mv_ehci_disable(struct ehci_hcd_mv *ehci_mv)
static int mv_ehci_reset(struct usb_hcd *hcd)
{
- struct ehci_hcd *ehci = hcd_to_ehci(hcd);
struct device *dev = hcd->self.controller;
struct ehci_hcd_mv *ehci_mv = dev_get_drvdata(dev);
int retval;
@@ -87,25 +86,13 @@ static int mv_ehci_reset(struct usb_hcd *hcd)
return -ENODEV;
}
- /*
- * data structure init
- */
- retval = ehci_init(hcd);
- if (retval) {
- dev_err(dev, "ehci_init failed %d\n", retval);
- return retval;
- }
-
hcd->has_tt = 1;
- ehci->sbrn = 0x20;
- retval = ehci_reset(ehci);
- if (retval) {
- dev_err(dev, "ehci_reset failed %d\n", retval);
- return retval;
- }
+ retval = ehci_setup(hcd);
+ if (retval)
+ dev_err(dev, "ehci_setup failed %d\n", retval);
- return 0;
+ return retval;
}
static const struct hc_driver mv_ehci_hc_driver = {
@@ -248,8 +235,6 @@ static int mv_ehci_probe(struct platform_device *pdev)
ehci = hcd_to_ehci(hcd);
ehci->caps = (struct ehci_caps *) ehci_mv->cap_regs;
- ehci->regs = (struct ehci_regs *) ehci_mv->op_regs;
- ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
ehci_mv->mode = pdata->mode;
if (ehci_mv->mode == MV_USB_MODE_OTG) {