From 90be4b49b8b54505772a6a766ac0891ec92b4c2d Mon Sep 17 00:00:00 2001 From: "akpm@osdl.org" Date: Tue, 3 Jan 2006 23:00:10 -0800 Subject: [PATCH] [AGPGART] Suspend/Resume support for AMD64 GART. 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 Cc: Andi Kleen Signed-off-by: Andrew Morton Signed-off-by: Dave Jones --- drivers/char/agp/amd64-agp.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c index 810679dcbbb..9964c508c11 100644 --- a/drivers/char/agp/amd64-agp.c +++ b/drivers/char/agp/amd64-agp.c @@ -600,6 +600,26 @@ static void __devexit agp_amd64_remove(struct pci_dev *pdev) 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_driver = { .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 }; -- 2.39.5