public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: root <ole.rohne-vJEk5272eHo@public.gmane.org>
To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Patch: PCI device RESUME_POWER_ON handler
Date: 12 Mar 2003 17:33:26 +0100	[thread overview]
Message-ID: <1y1c35pl.fsf@pcpenn04.cern.ch> (raw)

The appended patch allows pci-devices to register a handler for
RESUME_POWER_ON, to be called during S2/S3 resume *before* interrupts
are enabled. This is necessary eg to revive the Radeon M6 graphics
adapter on the Fujitsu P2120. (This is not all there is to getting the
P2120 video to work after resume...)

Now, how can I do the corresponding thing with the keyboard and mouse?
I don't see any pm related hooks in serio...

Ole

diff -Nru -X dontdiff linux-2.5.64/drivers/pci/pci-driver.c linux-p2120/drivers/pci/pci-driver.c
--- linux-2.5.64/drivers/pci/pci-driver.c	2003-03-05 04:29:31.000000000 +0100
+++ linux-p2120/drivers/pci/pci-driver.c	2003-03-07 10:29:07.000000000 +0100
@@ -91,11 +91,9 @@
 	struct pci_dev * pci_dev = to_pci_dev(dev);
 
 	if (pci_dev->driver) {
-		/* We may not call PCI drivers resume at
-		   RESUME_POWER_ON because interrupts are not yet
-		   working at that point. Calling resume at
-		   RESUME_RESTORE_STATE seems like solution. */
-		if (level == RESUME_RESTORE_STATE && pci_dev->driver->resume)
+	        if (level == RESUME_POWER_ON && pci_dev->driver->power_on)
+			pci_dev->driver->power_on(pci_dev);
+		else if (level == RESUME_RESTORE_STATE && pci_dev->driver->resume)
 			pci_dev->driver->resume(pci_dev);
 	}
 	return 0;
diff -Nru -X dontdiff linux-2.5.64/include/linux/pci.h linux-p2120/include/linux/pci.h
--- linux-2.5.64/include/linux/pci.h	2003-03-05 04:29:18.000000000 +0100
+++ linux-p2120/include/linux/pci.h	2003-03-07 10:29:07.000000000 +0100
@@ -499,6 +499,7 @@
 	void (*remove) (struct pci_dev *dev);	/* Device removed (NULL if not a hot-plug capable driver) */
 	int  (*save_state) (struct pci_dev *dev, u32 state);    /* Save Device Context */
 	int  (*suspend) (struct pci_dev *dev, u32 state);	/* Device suspended */
+	int  (*power_on) (struct pci_dev *dev);	                /* Device power on */
 	int  (*resume) (struct pci_dev *dev);	                /* Device woken up */
 	int  (*enable_wake) (struct pci_dev *dev, u32 state, int enable);   /* Enable wake event */
 



-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en

                 reply	other threads:[~2003-03-12 16:33 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=1y1c35pl.fsf@pcpenn04.cern.ch \
    --to=ole.rohne-vjek5272eho@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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