Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[pandora-kernel.git] / drivers / char / agp / efficeon-agp.c
index fed0a87..30f730f 100644 (file)
@@ -64,6 +64,12 @@ static struct gatt_mask efficeon_generic_masks[] =
        {.mask = 0x00000001, .type = 0}
 };
 
+/* This function does the same thing as mask_memory() for this chipset... */
+static inline unsigned long efficeon_mask_memory(unsigned long addr)
+{
+       return addr | 0x00000001;
+}
+
 static struct aper_size_info_lvl2 efficeon_generic_sizes[4] =
 {
        {256, 65536, 0},
@@ -171,7 +177,7 @@ static int efficeon_free_gatt_table(struct agp_bridge_data *bridge)
 
 
 /*
- * Since we don't need contigious memory we just try
+ * Since we don't need contiguous memory we just try
  * to get the gatt table once
  */
 
@@ -251,7 +257,7 @@ static int efficeon_insert_memory(struct agp_memory * mem, off_t pg_start, int t
        last_page = NULL;
        for (i = 0; i < count; i++) {
                int index = pg_start + i;
-               unsigned long insert = mem->memory[i];
+               unsigned long insert = efficeon_mask_memory(mem->memory[i]);
 
                page = (unsigned int *) efficeon_private.l1_table[index >> 10];
 
@@ -331,13 +337,6 @@ static struct agp_bridge_driver efficeon_driver = {
        .agp_destroy_page       = agp_generic_destroy_page,
 };
 
-
-static int agp_efficeon_resume(struct pci_dev *pdev)
-{
-       printk(KERN_DEBUG PFX "agp_efficeon_resume()\n");
-       return efficeon_configure();
-}
-
 static int __devinit agp_efficeon_probe(struct pci_dev *pdev,
                                     const struct pci_device_id *ent)
 {
@@ -408,11 +407,18 @@ static void __devexit agp_efficeon_remove(struct pci_dev *pdev)
        agp_put_bridge(bridge);
 }
 
+#ifdef CONFIG_PM
 static int agp_efficeon_suspend(struct pci_dev *dev, pm_message_t state)
 {
        return 0;
 }
 
+static int agp_efficeon_resume(struct pci_dev *pdev)
+{
+       printk(KERN_DEBUG PFX "agp_efficeon_resume()\n");
+       return efficeon_configure();
+}
+#endif
 
 static struct pci_device_id agp_efficeon_pci_table[] = {
        {
@@ -433,8 +439,10 @@ static struct pci_driver agp_efficeon_pci_driver = {
        .id_table       = agp_efficeon_pci_table,
        .probe          = agp_efficeon_probe,
        .remove         = agp_efficeon_remove,
+#ifdef CONFIG_PM
        .suspend        = agp_efficeon_suspend,
        .resume         = agp_efficeon_resume,
+#endif
 };
 
 static int __init agp_efficeon_init(void)