Merge master.kernel.org:/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[pandora-kernel.git] / drivers / char / agp / nvidia-agp.c
index 4c67135..2563286 100644 (file)
@@ -310,6 +310,7 @@ static struct agp_bridge_driver nvidia_driver = {
        .free_by_type           = agp_generic_free_by_type,
        .agp_alloc_page         = agp_generic_alloc_page,
        .agp_destroy_page       = agp_generic_destroy_page,
+       .agp_type_to_mask_type  = agp_generic_type_to_mask_type,
 };
 
 static int __devinit agp_nvidia_probe(struct pci_dev *pdev,
@@ -376,6 +377,29 @@ static void __devexit agp_nvidia_remove(struct pci_dev *pdev)
        agp_put_bridge(bridge);
 }
 
+#ifdef CONFIG_PM
+static int agp_nvidia_suspend(struct pci_dev *pdev, pm_message_t state)
+{
+       pci_save_state (pdev);
+       pci_set_power_state (pdev, 3);
+
+       return 0;
+}
+
+static int agp_nvidia_resume(struct pci_dev *pdev)
+{
+       /* set power state 0 and restore PCI space */
+       pci_set_power_state (pdev, 0);
+       pci_restore_state(pdev);
+
+       /* reconfigure AGP hardware again */
+       nvidia_configure();
+
+       return 0;
+}
+#endif
+
+
 static struct pci_device_id agp_nvidia_pci_table[] = {
        {
        .class          = (PCI_CLASS_BRIDGE_HOST << 8),
@@ -403,6 +427,10 @@ static struct pci_driver agp_nvidia_pci_driver = {
        .id_table       = agp_nvidia_pci_table,
        .probe          = agp_nvidia_probe,
        .remove         = agp_nvidia_remove,
+#ifdef CONFIG_PM
+       .suspend        = agp_nvidia_suspend,
+       .resume         = agp_nvidia_resume,
+#endif
 };
 
 static int __init agp_nvidia_init(void)