aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/agp/nvidia-agp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/agp/nvidia-agp.c')
-rw-r--r--drivers/char/agp/nvidia-agp.c29
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
380static 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
388static 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
379static struct pci_device_id agp_nvidia_pci_table[] = { 404static 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
408static int __init agp_nvidia_init(void) 437static int __init agp_nvidia_init(void)