Merge branch 'merge'
[pandora-kernel.git] / drivers / char / agp / uninorth-agp.c
index c825531..91b71e7 100644 (file)
@@ -95,12 +95,12 @@ static void uninorth_cleanup(void)
 static int uninorth_configure(void)
 {
        struct aper_size_info_32 *current_size;
-       
+
        current_size = A_SIZE_32(agp_bridge->current_size);
 
        printk(KERN_INFO PFX "configuring for size idx: %d\n",
               current_size->size_value);
-       
+
        /* aperture size and gatt addr */
        pci_write_config_dword(agp_bridge->dev,
                UNI_N_CFG_GART_BASE,
@@ -127,7 +127,7 @@ static int uninorth_configure(void)
                                       UNI_N_CFG_GART_DUMMY_PAGE,
                                       agp_bridge->scratch_page_real >> 12);
        }
-       
+
        return 0;
 }
 
@@ -162,7 +162,7 @@ static int uninorth_insert_memory(struct agp_memory *mem, off_t pg_start,
        }
        (void)in_le32((volatile u32*)&agp_bridge->gatt_table[pg_start]);
        mb();
-       flush_dcache_range((unsigned long)&agp_bridge->gatt_table[pg_start], 
+       flush_dcache_range((unsigned long)&agp_bridge->gatt_table[pg_start],
                (unsigned long)&agp_bridge->gatt_table[pg_start + mem->page_count]);
 
        uninorth_tlbflush(mem);
@@ -235,7 +235,7 @@ static void uninorth_agp_enable(struct agp_bridge_data *bridge, u32 mode)
 
        command = agp_collect_device_status(bridge, mode, status);
        command |= PCI_AGP_COMMAND_AGP;
-       
+
        if (uninorth_rev == 0x21) {
                /*
                 * Darwin disable AGP 4x on this revision, thus we
@@ -329,7 +329,7 @@ static int agp_uninorth_suspend(struct pci_dev *pdev)
        /* turn off AGP on the bridge */
        agp = pci_find_capability(pdev, PCI_CAP_ID_AGP);
        pci_read_config_dword(pdev, agp + PCI_AGP_COMMAND, &cmd);
-       bridge->dev_private_data = (void *)cmd;
+       bridge->dev_private_data = (void *)(long)cmd;
        if (cmd & PCI_AGP_COMMAND_AGP) {
                printk("uninorth-agp: disabling AGP on bridge %s\n",
                                pci_name(pdev));
@@ -351,7 +351,7 @@ static int agp_uninorth_resume(struct pci_dev *pdev)
        if (bridge == NULL)
                return -ENODEV;
 
-       command = (u32)bridge->dev_private_data;
+       command = (long)bridge->dev_private_data;
        bridge->dev_private_data = NULL;
        if (!(command & PCI_AGP_COMMAND_AGP))
                return 0;
@@ -456,7 +456,7 @@ static struct aper_size_info_32 uninorth_sizes[7] =
        {256, 65536, 6, 64},
        {128, 32768, 5, 32},
        {64, 16384, 4, 16},
-#endif 
+#endif
        {32, 8192, 3, 8},
        {16, 4096, 2, 4},
        {8, 2048, 1, 2},
@@ -557,6 +557,10 @@ static struct agp_device_ids uninorth_agp_device_ids[] __devinitdata = {
                .device_id      = PCI_DEVICE_ID_APPLE_U3H_AGP,
                .chipset_name   = "U3H",
        },
+       {
+               .device_id      = PCI_DEVICE_ID_APPLE_IPID2_AGP,
+               .chipset_name   = "UniNorth/Intrepid2",
+       },
 };
 
 static int __devinit agp_uninorth_probe(struct pci_dev *pdev,
@@ -597,8 +601,8 @@ static int __devinit agp_uninorth_probe(struct pci_dev *pdev,
                uninorth_node = of_find_node_by_name(NULL, "u3");
        }
        if (uninorth_node) {
-               int *revprop = (int *)
-                       get_property(uninorth_node, "device-rev", NULL);
+               const int *revprop = get_property(uninorth_node,
+                               "device-rev", NULL);
                if (revprop != NULL)
                        uninorth_rev = *revprop & 0x3f;
                of_node_put(uninorth_node);