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 && (hdev->level == 0) && dev->type) {
- if (port1 == 1 && pdata->init)
- pdata->init(NULL);
- }
- if ((port1 == 1) && (hdev->level == 0)) {
- /* Must clear HOSTDISCONDETECT when port connect change happen*/
- if (pdata->platform_set_disconnect_det)
- pdata->platform_set_disconnect_det(pdata, 0);
-
- }
- }
-#endif
#ifdef CONFIG_USB_OTG
/* during HNP, don't repeat the debounce */
if (hdev->bus->is_b_host)
usb_disconnect(&hdev->children[port1-1]);
clear_bit(port1, hub->change_bits);
+#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 && (hdev->level == 0) && dev->type) {
+ if (port1 == 1 && pdata->init)
+ pdata->init(NULL);
+ }
+ if ((port1 == 1) && (hdev->level == 0)) {
+ /* Must clear HOSTDISCONDETECT when port connect change happen*/
+ if (pdata->platform_set_disconnect_det)
+ pdata->platform_set_disconnect_det(pdata, 0);
+
+ }
+ }
+#endif
+
/* We can forget about a "removed" device when there's a physical
* disconnect or the connect status changes.
*/
fsl_platform_set_host_mode(hcd);
hcd->power_budget = pdata->power_budget;
- /*
- * The ehci_fsl_pre_irq must be registered before usb_hcd_irq, in that case
- * it can be called before usb_hcd_irq when irq occurs
- */
- retval = request_irq(irq, ehci_fsl_pre_irq, IRQF_SHARED,
- "fsl ehci pre interrupt", (void *)pdev);
- if (retval != 0)
- goto err4;
-
- retval = usb_add_hcd(hcd, irq, IRQF_DISABLED | IRQF_SHARED);
- if (retval != 0)
- goto err5;
-
+ ehci = hcd_to_ehci(hcd);
if (pdata->operating_mode == FSL_USB2_DR_OTG) {
- struct ehci_hcd *ehci = hcd_to_ehci(hcd);
dbg("pdev=0x%p hcd=0x%p ehci=0x%p\n", pdev, hcd, ehci);
if (!ehci->transceiver) {
printk(KERN_ERR "can't find transceiver\n");
retval = -ENODEV;
- goto err6;
+ goto err4;
}
retval = otg_set_host(ehci->transceiver, &ehci_to_hcd(ehci)->self);
(pdata->operating_mode == FSL_USB2_DR_HOST))
fsl_platform_set_vbus_power(pdata, 1);
+ /*
+ * The ehci_fsl_pre_irq must be registered before usb_hcd_irq, in that case
+ * it can be called before usb_hcd_irq when irq occurs
+ */
+ retval = request_irq(irq, ehci_fsl_pre_irq, IRQF_SHARED,
+ "fsl ehci pre interrupt", (void *)pdev);
+ if (retval != 0)
+ goto err5;
+
+ retval = usb_add_hcd(hcd, irq, IRQF_DISABLED | IRQF_SHARED);
+ if (retval != 0)
+ goto err6;
+
fsl_platform_set_ahb_burst(hcd);
ehci_testmode_init(hcd_to_ehci(hcd));
/*
pdata->pm_command = ehci->command;
return retval;
err6:
- usb_remove_hcd(hcd);
-err5:
free_irq(irq, (void *)pdev);
+err5:
+ otg_put_transceiver(ehci->transceiver);
err4:
iounmap(hcd->regs);
err3: