]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/host/ohci-hub.c
Merge branch 'from-linus' into upstream
[linux-2.6-omap-h63xx.git] / drivers / usb / host / ohci-hub.c
index 4b2226d77b342dd68082733a2aac20e41be25fa9..5b0a23fd798bb46294885432878e4c6429a660ed 100644 (file)
@@ -107,7 +107,7 @@ static int ohci_bus_suspend (struct usb_hcd *hcd)
                        &ohci->regs->intrstatus);
 
        /* maybe resume can wake root hub */
-       if (hcd->remote_wakeup)
+       if (device_may_wakeup(&ohci_to_hcd(ohci)->self.root_hub->dev))
                ohci->hc_control |= OHCI_CTRL_RWE;
        else
                ohci->hc_control &= ~OHCI_CTRL_RWE;
@@ -246,9 +246,9 @@ static int ohci_bus_resume (struct usb_hcd *hcd)
        (void) ohci_readl (ohci, &ohci->regs->control);
        msleep (3);
 
-       temp = OHCI_CONTROL_INIT | OHCI_USB_OPER;
-       if (hcd->can_wakeup)
-               temp |= OHCI_CTRL_RWC;
+       temp = ohci->hc_control;
+       temp &= OHCI_CTRL_RWC;
+       temp |= OHCI_CONTROL_INIT | OHCI_USB_OPER;
        ohci->hc_control = temp;
        ohci_writel (ohci, temp, &ohci->regs->control);
        (void) ohci_readl (ohci, &ohci->regs->control);
@@ -302,7 +302,7 @@ ohci_hub_status_data (struct usb_hcd *hcd, char *buf)
 {
        struct ohci_hcd *ohci = hcd_to_ohci (hcd);
        int             i, changed = 0, length = 1;
-       int             can_suspend = hcd->can_wakeup;
+       int             can_suspend = device_may_wakeup(&hcd->self.root_hub->dev);
        unsigned long   flags;
 
        spin_lock_irqsave (&ohci->lock, flags);
@@ -354,7 +354,7 @@ ohci_hub_status_data (struct usb_hcd *hcd, char *buf)
                 */
                if (!(status & RH_PS_CCS))
                        continue;
-               if ((status & RH_PS_PSS) && hcd->remote_wakeup)
+               if ((status & RH_PS_PSS) && can_suspend)
                        continue;
                can_suspend = 0;
        }
@@ -581,14 +581,14 @@ static int ohci_hub_control (
                break;
        case GetHubStatus:
                temp = roothub_status (ohci) & ~(RH_HS_CRWE | RH_HS_DRWE);
-               *(__le32 *) buf = cpu_to_le32 (temp);
+               put_unaligned(cpu_to_le32 (temp), (__le32 *) buf);
                break;
        case GetPortStatus:
                if (!wIndex || wIndex > ports)
                        goto error;
                wIndex--;
                temp = roothub_portstatus (ohci, wIndex);
-               *(__le32 *) buf = cpu_to_le32 (temp);
+               put_unaligned(cpu_to_le32 (temp), (__le32 *) buf);
 
 #ifndef        OHCI_VERBOSE_DEBUG
        if (*(u16*)(buf+2))     /* only if wPortChange is interesting */