ehci-hub.c (97f2aab6698f3ab2552c41c1024a65ffd0763a6d) ehci-hub.c (2c1c3c4cd5f796b1912c65aaf3bf48c0ddf11f5e)
1/*
2 * Copyright (C) 2001-2004 by David Brownell
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *

--- 45 unchanged lines hidden (view full) ---

54 /* suspend any active/unsuspended ports, maybe allow wakeup */
55 while (port--) {
56 u32 __iomem *reg = &ehci->regs->port_status [port];
57 u32 t1 = readl (reg) & ~PORT_RWC_BITS;
58 u32 t2 = t1;
59
60 if ((t1 & PORT_PE) && !(t1 & PORT_OWNER))
61 t2 |= PORT_SUSPEND;
1/*
2 * Copyright (C) 2001-2004 by David Brownell
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *

--- 45 unchanged lines hidden (view full) ---

54 /* suspend any active/unsuspended ports, maybe allow wakeup */
55 while (port--) {
56 u32 __iomem *reg = &ehci->regs->port_status [port];
57 u32 t1 = readl (reg) & ~PORT_RWC_BITS;
58 u32 t2 = t1;
59
60 if ((t1 & PORT_PE) && !(t1 & PORT_OWNER))
61 t2 |= PORT_SUSPEND;
62 if (hcd->remote_wakeup)
62 if (device_may_wakeup(&hcd->self.root_hub->dev))
63 t2 |= PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E;
64 else
65 t2 &= ~(PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E);
66
67 if (t1 != t2) {
68 ehci_vdbg (ehci, "port %d, %08x -> %08x\n",
69 port + 1, t1, t2);
70 writel (t2, reg);

--- 441 unchanged lines hidden (view full) ---

512 break;
513
514 temp &= ~PORT_RWC_BITS;
515 switch (wValue) {
516 case USB_PORT_FEAT_SUSPEND:
517 if ((temp & PORT_PE) == 0
518 || (temp & PORT_RESET) != 0)
519 goto error;
63 t2 |= PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E;
64 else
65 t2 &= ~(PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E);
66
67 if (t1 != t2) {
68 ehci_vdbg (ehci, "port %d, %08x -> %08x\n",
69 port + 1, t1, t2);
70 writel (t2, reg);

--- 441 unchanged lines hidden (view full) ---

512 break;
513
514 temp &= ~PORT_RWC_BITS;
515 switch (wValue) {
516 case USB_PORT_FEAT_SUSPEND:
517 if ((temp & PORT_PE) == 0
518 || (temp & PORT_RESET) != 0)
519 goto error;
520 if (hcd->remote_wakeup)
520 if (device_may_wakeup(&hcd->self.root_hub->dev))
521 temp |= PORT_WAKE_BITS;
522 writel (temp | PORT_SUSPEND,
523 &ehci->regs->port_status [wIndex]);
524 break;
525 case USB_PORT_FEAT_POWER:
526 if (HCS_PPC (ehci->hcs_params))
527 writel (temp | PORT_POWER,
528 &ehci->regs->port_status [wIndex]);

--- 43 unchanged lines hidden ---
521 temp |= PORT_WAKE_BITS;
522 writel (temp | PORT_SUSPEND,
523 &ehci->regs->port_status [wIndex]);
524 break;
525 case USB_PORT_FEAT_POWER:
526 if (HCS_PPC (ehci->hcs_params))
527 writel (temp | PORT_POWER,
528 &ehci->regs->port_status [wIndex]);

--- 43 unchanged lines hidden ---