public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] amd64-agp suspend support
@ 2005-12-26 14:15 Michal Schmidt
  0 siblings, 0 replies; only message in thread
From: Michal Schmidt @ 2005-12-26 14:15 UTC (permalink / raw)
  To: Dave Jones; +Cc: linux-kernel

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

Hi,

This adds support for suspend/resume to the amd64-agp driver. Without 
it, X displays garbage after resume from swsusp.

Signed-off-by: Michal Schmidt <xschmi00@stud.feec.vutbr.cz>

[-- Attachment #2: amd64-agp-suspend-support.diff --]
[-- Type: text/plain, Size: 1107 bytes --]

diff -Nurp -X linux-mich/Documentation/dontdiff linux/drivers/char/agp/amd64-agp.c linux-mich/drivers/char/agp/amd64-agp.c
--- linux/drivers/char/agp/amd64-agp.c	2005-12-25 19:33:28.000000000 +0100
+++ linux-mich/drivers/char/agp/amd64-agp.c	2005-12-26 14:38:30.000000000 +0100
@@ -600,6 +600,26 @@ static void __devexit agp_amd64_remove(s
 	agp_put_bridge(bridge);
 }
 
+#ifdef CONFIG_PM
+
+static int agp_amd64_suspend(struct pci_dev *pdev, pm_message_t state)
+{
+	pci_save_state(pdev);
+	pci_set_power_state(pdev, pci_choose_state(pdev, state));
+
+	return 0;
+}
+
+static int agp_amd64_resume(struct pci_dev *pdev)
+{
+	pci_set_power_state(pdev, PCI_D0);
+	pci_restore_state(pdev);
+
+	return amd_8151_configure();	
+}
+
+#endif /* CONFIG_PM */
+
 static struct pci_device_id agp_amd64_pci_table[] = {
 	{
 	.class		= (PCI_CLASS_BRIDGE_HOST << 8),
@@ -718,6 +738,10 @@ static struct pci_driver agp_amd64_pci_d
 	.id_table	= agp_amd64_pci_table,
 	.probe		= agp_amd64_probe,
 	.remove		= agp_amd64_remove,
+#ifdef CONFIG_PM
+	.suspend	= agp_amd64_suspend,
+	.resume		= agp_amd64_resume,
+#endif
 };
 
 

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

only message in thread, other threads:[~2005-12-26 14:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-26 14:15 [PATCH] amd64-agp suspend support Michal Schmidt

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