/* Idle the controller (turn off the schedules). Must be called with interrupts enabled and the lock not held.  */
static void ehci_quiesce(struct ehci_hcd *ehci)
/* Idle the controller (turn off the schedules). Must be called with interrupts enabled and the lock not held.  */
static void ehci_quiesce(struct ehci_hcd *ehci)
{
    u32 temp;
    uint32_t cpusr;
    if (ehci->rh_state != EHCI_RH_RUNNING)
        return;
    temp = (ehci->command << 10) & (STS_ASS | STS_PSS);
    ehci_handshake(ehci, &ehci->regs->status, STS_ASS | STS_PSS, temp,
            16 * 125);
    hal_spin_lock(&ehci->lock);
    ehci->command &= ~(CMD_ASE | CMD_PSE);
    ehci_writel(ehci, ehci->command, &ehci->regs->command);
    hal_spin_unlock(&ehci->lock);
    ehci_handshake(ehci, &ehci->regs->status, STS_ASS | STS_PSS, 0,
            16 * 125);
}