]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
usb: chipidea: host: override hcd reset API
authorPeter Chen <peter.chen@freescale.com>
Wed, 5 Aug 2015 02:16:19 +0000 (10:16 +0800)
committerPeter Chen <peter.chen@freescale.com>
Fri, 14 Aug 2015 01:13:13 +0000 (09:13 +0800)
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>
drivers/usb/chipidea/host.c

index ee38c5da211adafd05dc0e20df2e68fddc8ca844..3d24304405b36f358a56d7a8dc6a881804b62df9 100644 (file)
@@ -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: