public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* PATCH/RFC: ohci wakeup updates (4/4)
@ 2004-10-04 21:11 David Brownell
  0 siblings, 0 replies; only message in thread
From: David Brownell @ 2004-10-04 21:11 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

The HCDs that understand about wakeup (OHCI, EHCI) would
need small tweaks to use the driver model hooks.

EHCI needs comparable changes, but I didn't want to spend
the time splitting them out from other patches unless there
was some agreement that this was the way the driver model
should expose wakeup.

[-- Attachment #2: wake-ohci.patch --]
[-- Type: text/x-diff, Size: 2130 bytes --]

Makes OHCI use the new pmcore wakeup bits, not the old usbcore ones.
Also includes a slightly better interpretation of the RWC bit.

[ against Greg's 2.6.9-rc3 USB tree, hence 2.6.9-rc3-mm2 ]


--- 1.83/drivers/usb/host/ohci-hcd.c	Fri Oct  1 16:23:18 2004
+++ edited/drivers/usb/host/ohci-hcd.c	Sat Oct  2 11:01:41 2004
@@ -505,10 +505,6 @@
 			hcfs2string (ohci->hc_control & OHCI_CTRL_HCFS),
 			ohci->hc_control);
 
-	if (ohci->hc_control & OHCI_CTRL_RWC
-			&& !(ohci->flags & OHCI_QUIRK_AMD756))
-		ohci->hcd.can_wakeup = 1;
-
 	switch (ohci->hc_control & OHCI_CTRL_HCFS) {
 	case OHCI_USB_OPER:
 		temp = 0;
@@ -655,7 +651,7 @@
 		usb_set_device_state (udev, USB_STATE_CONFIGURED);
 		return 0;
 	}
- 
+
 	/* connect the virtual root hub */
 	udev = usb_alloc_dev (NULL, bus, 0);
 	if (!udev) {
@@ -664,6 +660,11 @@
 		writel (ohci->hc_control, &ohci->regs->control);
 		return -ENOMEM;
 	}
+	/* RWC doesn't always mean the same thing... */
+	if (device_can_wakeup(bus->controller))
+		device_init_wakeup(bus->controller,
+				ohci->hc_control & OHCI_CTRL_RWC);
+	device_init_wakeup(&udev->dev, !(ohci->flags & OHCI_QUIRK_AMD756));
 
 	udev->speed = USB_SPEED_FULL;
 	if (hcd_register_root (udev, &ohci->hcd) != 0) {
--- 1.36/drivers/usb/host/ohci-hub.c	Mon Sep 20 10:31:27 2004
+++ edited/drivers/usb/host/ohci-hub.c	Sat Oct  2 11:01:41 2004
@@ -105,7 +105,7 @@
 	writel (ohci_readl (&ohci->regs->intrstatus), &ohci->regs->intrstatus);
 
 	/* maybe resume can wake root hub */
-	if (ohci->hcd.remote_wakeup)
+	if (device_may_wakeup(&root->dev))
 		ohci->hc_control |= OHCI_CTRL_RWE;
 	else
 		ohci->hc_control &= ~OHCI_CTRL_RWE;
@@ -231,7 +231,7 @@
 	msleep (3);
 
 	temp = OHCI_CONTROL_INIT | OHCI_USB_OPER;
-	if (ohci->hcd.can_wakeup)
+	if (device_can_wakeup(hcd->self.controller));
 		temp |= OHCI_CTRL_RWC;
 	ohci->hc_control = temp;
 	writel (temp, &ohci->regs->control);
@@ -347,7 +347,8 @@
 		 */
 		if (!(status & RH_PS_CCS))
 			continue;
-		if ((status & RH_PS_PSS) && ohci->hcd.remote_wakeup)
+		if ((status & RH_PS_PSS)
+				&& device_may_wakeup(&hcd->self.root_hub->dev))
 			continue;
 		can_suspend = 0;
 	}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-10-04 22:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-04 21:11 PATCH/RFC: ohci wakeup updates (4/4) David Brownell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox