u32 temp;
u32 power_okay;
int i;
- unsigned long resume_needed = 0;
+ u8 resume_needed = 0;
if (time_before (jiffies, ehci->next_statechange))
msleep(5);
if (test_bit(i, &ehci->bus_suspended) &&
(temp & PORT_SUSPEND)) {
temp |= PORT_RESUME;
- set_bit(i, &resume_needed);
+ resume_needed = 1;
}
ehci_writel(ehci, temp, &ehci->regs->port_status [i]);
}
i = HCS_N_PORTS (ehci->hcs_params);
while (i--) {
temp = ehci_readl(ehci, &ehci->regs->port_status [i]);
- if (test_bit(i, &resume_needed)) {
+ if (test_bit(i, &ehci->bus_suspended) &&
+ (temp & PORT_SUSPEND)) {
temp &= ~(PORT_RWC_BITS | PORT_RESUME);
ehci_writel(ehci, temp, &ehci->regs->port_status [i]);
ehci_vdbg (ehci, "resumed port %d\n", i + 1);
* power switching; they're allowed to just limit the
* current. khubd will turn the power back on.
*/
- if ((temp & PORT_OC) && HCS_PPC(ehci->hcs_params)) {
+ if (HCS_PPC (ehci->hcs_params)){
ehci_writel(ehci,
temp & ~(PORT_RWC_BITS | PORT_POWER),
status_reg);
- temp = ehci_readl(ehci, status_reg);
}
}
if (!selector || selector > 5)
goto error;
ehci_quiesce(ehci);
-
- /* Put all enabled ports into suspend */
- while (ports--) {
- u32 __iomem *sreg =
- &ehci->regs->port_status[ports];
-
- temp = ehci_readl(ehci, sreg) & ~PORT_RWC_BITS;
- if (temp & PORT_PE)
- ehci_writel(ehci, temp | PORT_SUSPEND,
- sreg);
- }
ehci_halt(ehci);
- temp = ehci_readl(ehci, status_reg);
temp |= selector << 16;
ehci_writel(ehci, temp, status_reg);
break;