* This file is licenced under the GPL.
*/
+#include <linux/config.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/pci.h>
static int ohci_init (struct ohci_hcd *ohci)
{
int ret;
- struct usb_hcd *hcd = ohci_to_hcd(ohci);
disable (ohci);
- ohci->regs = hcd->regs;
+ ohci->regs = ohci_to_hcd(ohci)->regs;
ohci->next_statechange = jiffies;
- /* REVISIT this BIOS handshake is now moved into PCI "quirks", and
- * was never needed for most non-PCI systems ... remove the code?
- */
-
#ifndef IR_DISABLE
/* SMM owns the HC? not for long! */
if (!no_handshake && ohci_readl (ohci,
/* Disable HC interrupts */
ohci_writel (ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable);
-
- /* flush the writes, and save key bits like RWC */
- if (ohci_readl (ohci, &ohci->regs->control) & OHCI_CTRL_RWC)
- ohci->hc_control |= OHCI_CTRL_RWC;
+ // flush the writes
+ (void) ohci_readl (ohci, &ohci->regs->control);
/* Read the number of ports unless overridden */
if (ohci->num_ports == 0)
if (ohci->hcca)
return 0;
- ohci->hcca = dma_alloc_coherent (hcd->self.controller,
+ ohci->hcca = dma_alloc_coherent (ohci_to_hcd(ohci)->self.controller,
sizeof *ohci->hcca, &ohci->hcca_dma, 0);
if (!ohci->hcca)
return -ENOMEM;
if ((ret = ohci_mem_init (ohci)) < 0)
- ohci_stop (hcd);
- else {
- register_reboot_notifier (&ohci->reboot_notifier);
- create_debug_files (ohci);
- }
+ ohci_stop (ohci_to_hcd(ohci));
return ret;
+
}
/*-------------------------------------------------------------------------*/
{
u32 mask, temp;
int first = ohci->fminterval == 0;
- struct usb_hcd *hcd = ohci_to_hcd(ohci);
disable (ohci);
/* also: power/overcurrent flags in roothub.a */
}
- /* Reset USB nearly "by the book". RemoteWakeupConnected was
- * saved if boot firmware (BIOS/SMM/...) told us it's connected,
- * or if bus glue did the same (e.g. for PCI add-in cards with
- * PCI PM support).
+ /* Reset USB nearly "by the book". RemoteWakeupConnected
+ * saved if boot firmware (BIOS/SMM/...) told us it's connected
+ * (for OHCI integrated on mainboard, it normally is)
*/
+ ohci->hc_control = ohci_readl (ohci, &ohci->regs->control);
ohci_dbg (ohci, "resetting from state '%s', control = 0x%x\n",
hcfs2string (ohci->hc_control & OHCI_CTRL_HCFS),
- ohci_readl (ohci, &ohci->regs->control));
- if ((ohci->hc_control & OHCI_CTRL_RWC) != 0
- && !device_may_wakeup(hcd->self.controller))
- device_init_wakeup(hcd->self.controller, 1);
+ ohci->hc_control);
+
+ if (ohci->hc_control & OHCI_CTRL_RWC
+ && !(ohci->flags & OHCI_QUIRK_AMD756))
+ ohci_to_hcd(ohci)->can_wakeup = 1;
switch (ohci->hc_control & OHCI_CTRL_HCFS) {
case OHCI_USB_OPER:
ohci->hc_control &= OHCI_CTRL_RWC;
ohci->hc_control |= OHCI_CONTROL_INIT | OHCI_USB_OPER;
ohci_writel (ohci, ohci->hc_control, &ohci->regs->control);
- hcd->state = HC_STATE_RUNNING;
+ ohci_to_hcd(ohci)->state = HC_STATE_RUNNING;
/* wake on ConnectStatusChange, matching external hubs */
ohci_writel (ohci, RH_HS_DRWE, &ohci->regs->roothub.status);
// POTPGT delay is bits 24-31, in 2 ms units.
mdelay ((temp >> 23) & 0x1fe);
- hcd->state = HC_STATE_RUNNING;
+ ohci_to_hcd(ohci)->state = HC_STATE_RUNNING;
ohci_dump (ohci, 1);
+ if (ohci_to_hcd(ohci)->self.root_hub == NULL) {
+ register_reboot_notifier (&ohci->reboot_notifier);
+ create_debug_files (ohci);
+ }
+
return 0;
}
i = ohci->num_ports;
while (i--)
ohci_writel (ohci, RH_PS_PSS,
- &ohci->regs->roothub.portstatus [i]);
+ &ohci->regs->roothub.portstatus [temp]);
ohci_dbg (ohci, "restart complete\n");
}
return 0;
#include "ohci-pxa27x.c"
#endif
-#ifdef CONFIG_ARCH_EP93XX
-#include "ohci-ep93xx.c"
-#endif
-
#ifdef CONFIG_SOC_AU1X00
#include "ohci-au1xxx.c"
#endif
#include "ohci-ppc-soc.c"
#endif
-#if defined(CONFIG_ARCH_AT91RM9200) || defined(CONFIG_ARCH_AT91SAM9261)
-#include "ohci-at91.c"
-#endif
-
#if !(defined(CONFIG_PCI) \
|| defined(CONFIG_SA1111) \
|| defined(CONFIG_ARCH_S3C2410) \
|| defined(CONFIG_ARCH_OMAP) \
|| defined (CONFIG_ARCH_LH7A404) \
|| defined (CONFIG_PXA27x) \
- || defined (CONFIG_ARCH_EP93XX) \
|| defined (CONFIG_SOC_AU1X00) \
|| defined (CONFIG_USB_OHCI_HCD_PPC_SOC) \
- || defined (CONFIG_ARCH_AT91RM9200) \
- || defined (CONFIG_ARCH_AT91SAM9261) \
)
#error "missing bus glue for ohci-hcd"
#endif