diff options
author | Dave Jones <davej@redhat.com> | 2006-06-20 00:44:38 -0400 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2006-06-20 00:44:38 -0400 |
commit | c5f2f261e7a47e4c72723cdcbe99e1bd771a81ea (patch) | |
tree | 2223901dd5dd2cfc33e81d3ac820e26a814bdda8 /drivers/char/agp | |
parent | a4aec2622340e356e7dcd0e8fd05378dacb71c89 (diff) |
[AGPGART] Suspend/Resume support for nVidia nForce AGP.
Based on a patch from the Ubuntu kernel.
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/char/agp')
-rw-r--r-- | drivers/char/agp/nvidia-agp.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/char/agp/nvidia-agp.c b/drivers/char/agp/nvidia-agp.c index 4c67135c12d8..b3a53e7f3602 100644 --- a/drivers/char/agp/nvidia-agp.c +++ b/drivers/char/agp/nvidia-agp.c | |||
@@ -376,6 +376,31 @@ static void __devexit agp_nvidia_remove(struct pci_dev *pdev) | |||
376 | agp_put_bridge(bridge); | 376 | agp_put_bridge(bridge); |
377 | } | 377 | } |
378 | 378 | ||
379 | #ifdef CONFIG_PM | ||
380 | static int agp_nvidia_suspend(struct pci_dev *pdev, pm_message_t state) | ||
381 | { | ||
382 | pci_save_state (pdev); | ||
383 | pci_set_power_state (pdev, 3); | ||
384 | |||
385 | return 0; | ||
386 | } | ||
387 | |||
388 | static int agp_nvidia_resume(struct pci_dev *pdev) | ||
389 | { | ||
390 | struct agp_bridge_data *bridge = pci_get_drvdata(pdev); | ||
391 | |||
392 | /* set power state 0 and restore PCI space */ | ||
393 | pci_set_power_state (pdev, 0); | ||
394 | pci_restore_state(pdev); | ||
395 | |||
396 | /* reconfigure AGP hardware again */ | ||
397 | nvidia_configure(); | ||
398 | |||
399 | return 0; | ||
400 | } | ||
401 | #endif | ||
402 | |||
403 | |||
379 | static struct pci_device_id agp_nvidia_pci_table[] = { | 404 | static struct pci_device_id agp_nvidia_pci_table[] = { |
380 | { | 405 | { |
381 | .class = (PCI_CLASS_BRIDGE_HOST << 8), | 406 | .class = (PCI_CLASS_BRIDGE_HOST << 8), |
@@ -403,6 +428,10 @@ static struct pci_driver agp_nvidia_pci_driver = { | |||
403 | .id_table = agp_nvidia_pci_table, | 428 | .id_table = agp_nvidia_pci_table, |
404 | .probe = agp_nvidia_probe, | 429 | .probe = agp_nvidia_probe, |
405 | .remove = agp_nvidia_remove, | 430 | .remove = agp_nvidia_remove, |
431 | #ifdef CONFIG_PM | ||
432 | .suspend = agp_nvidia_suspend, | ||
433 | .resume = agp_nvidia_resume, | ||
434 | #endif | ||
406 | }; | 435 | }; |
407 | 436 | ||
408 | static int __init agp_nvidia_init(void) | 437 | static int __init agp_nvidia_init(void) |