]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/pci-gart_64.c
Merge branch 'linus' into x86/gart
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / pci-gart_64.c
index 1f99b62ff616ee34f48723897af2cf187ad18b12..3710097f02ebbaeefc009235cdc05b5a271c5584 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/kdebug.h>
 #include <linux/scatterlist.h>
 #include <linux/iommu-helper.h>
+#include <linux/sysdev.h>
 #include <asm/atomic.h>
 #include <asm/io.h>
 #include <asm/mtrr.h>
@@ -548,6 +549,28 @@ static __init unsigned read_aperture(struct pci_dev *dev, u32 *size)
        return aper_base;
 }
 
+static int gart_resume(struct sys_device *dev)
+{
+       return 0;
+}
+
+static int gart_suspend(struct sys_device *dev, pm_message_t state)
+{
+       return -EINVAL;
+}
+
+static struct sysdev_class gart_sysdev_class = {
+       .name = "gart",
+       .suspend = gart_suspend,
+       .resume = gart_resume,
+
+};
+
+static struct sys_device device_gart = {
+       .id     = 0,
+       .cls    = &gart_sysdev_class,
+};
+
 /*
  * Private Northbridge GATT initialization in case we cannot use the
  * AGP driver for some reason.
@@ -558,7 +581,7 @@ static __init int init_k8_gatt(struct agp_kern_info *info)
        unsigned aper_base, new_aper_base;
        struct pci_dev *dev;
        void *gatt;
-       int i;
+       int i, error;
 
        printk(KERN_INFO "PCI-DMA: Disabling AGP.\n");
        aper_size = aper_base = info->aper_size = 0;
@@ -595,6 +618,12 @@ static __init int init_k8_gatt(struct agp_kern_info *info)
                dev = k8_northbridges[i];
                enable_gart_translation(dev, __pa(gatt));
        }
+
+       error = sysdev_class_register(&gart_sysdev_class);
+       if (!error)
+               error = sysdev_register(&device_gart);
+       if (error)
+               panic("Could not register gart_sysdev -- would corrupt data on next suspend");
        flush_gart();
 
        printk(KERN_INFO "PCI-DMA: aperture base @ %x size %u KB\n",