public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: linux-kernel@vger.kernel.org
Subject: PATCH/RFC: ohci wakeup updates (4/4)
Date: Mon, 4 Oct 2004 14:11:25 -0700	[thread overview]
Message-ID: <200410041411.25567.david-b@pacbell.net> (raw)

[-- 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;
 	}

                 reply	other threads:[~2004-10-04 22:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200410041411.25567.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox