ide: Force VIA IDE legacy interrupts for AmigaOne boards
[safe/jmp/linux-2.6] / drivers / video / aty / radeon_base.c
index 72cd0d2..d0f1a7f 100644 (file)
@@ -1286,11 +1286,10 @@ static void radeon_write_pll_regs(struct radeonfb_info *rinfo, struct radeon_reg
        radeon_pll_errata_after_data(rinfo);
 
        /* Set PPLL ref. div */
-       if (rinfo->family == CHIP_FAMILY_R300 ||
+       if (IS_R300_VARIANT(rinfo) ||
            rinfo->family == CHIP_FAMILY_RS300 ||
-           rinfo->family == CHIP_FAMILY_R350 ||
-           rinfo->family == CHIP_FAMILY_RV350 ||
-           rinfo->family == CHIP_FAMILY_RV380 ) {
+           rinfo->family == CHIP_FAMILY_RS400 ||
+           rinfo->family == CHIP_FAMILY_RS480) {
                if (mode->ppll_ref_div & R300_PPLL_REF_DIV_ACC_MASK) {
                        /* When restoring console mode, use saved PPLL_REF_DIV
                         * setting.
@@ -1461,10 +1460,7 @@ static void radeon_calc_pll_regs(struct radeonfb_info *rinfo, struct radeon_regs
                /* Not all chip revs have the same format for this register,
                 * extract the source selection
                 */
-               if (rinfo->family == CHIP_FAMILY_R200 ||
-                   rinfo->family == CHIP_FAMILY_R300 ||
-                   rinfo->family == CHIP_FAMILY_R350 ||
-                   rinfo->family == CHIP_FAMILY_RV350) {
+               if (rinfo->family == CHIP_FAMILY_R200 || IS_R300_VARIANT(rinfo)) {
                        source = (fp2_gen_cntl >> 10) & 0x3;
                        /* sourced from transform unit, check for transform unit
                         * own source
@@ -2005,6 +2001,7 @@ static void radeon_identify_vram(struct radeonfb_info *rinfo)
             (rinfo->family == CHIP_FAMILY_RS200) ||
             (rinfo->family == CHIP_FAMILY_RS300) ||
             (rinfo->family == CHIP_FAMILY_RC410) ||
+            (rinfo->family == CHIP_FAMILY_RS400) ||
            (rinfo->family == CHIP_FAMILY_RS480) ) {
           u32 tom = INREG(NB_TOM);
           tmp = ((((tom >> 16) - (tom & 0xffff) + 1) << 6) * 1024);
@@ -2098,15 +2095,7 @@ static void radeon_identify_vram(struct radeonfb_info *rinfo)
 
 static ssize_t radeon_show_one_edid(char *buf, loff_t off, size_t count, const u8 *edid)
 {
-       if (off > EDID_LENGTH)
-               return 0;
-
-       if (off + count > EDID_LENGTH)
-               count = EDID_LENGTH - off;
-
-       memcpy(buf, edid + off, count);
-
-       return count;
+       return memory_read_from_buffer(buf, count, &off, edid, EDID_LENGTH);
 }
 
 
@@ -2161,6 +2150,7 @@ static int __devinit radeonfb_pci_register (struct pci_dev *pdev,
        struct radeonfb_info *rinfo;
        int ret;
        unsigned char c1, c2;
+       int err = 0;
 
        pr_debug("radeonfb_pci_register BEGIN\n");
        
@@ -2277,8 +2267,8 @@ static int __devinit radeonfb_pci_register (struct pci_dev *pdev,
        do {
                rinfo->fb_base = ioremap (rinfo->fb_base_phys,
                                          rinfo->mapped_vram);
-       } while (   rinfo->fb_base == 0 &&
-                 ((rinfo->mapped_vram /=2) >= MIN_MAPPED_VRAM) );
+       } while (rinfo->fb_base == NULL &&
+                ((rinfo->mapped_vram /= 2) >= MIN_MAPPED_VRAM));
 
        if (rinfo->fb_base == NULL) {
                printk (KERN_ERR "radeonfb (%s): cannot map FB\n",
@@ -2340,9 +2330,14 @@ static int __devinit radeonfb_pci_register (struct pci_dev *pdev,
 
        /* Register some sysfs stuff (should be done better) */
        if (rinfo->mon1_EDID)
-               sysfs_create_bin_file(&rinfo->pdev->dev.kobj, &edid1_attr);
+               err |= sysfs_create_bin_file(&rinfo->pdev->dev.kobj,
+                                               &edid1_attr);
        if (rinfo->mon2_EDID)
-               sysfs_create_bin_file(&rinfo->pdev->dev.kobj, &edid2_attr);
+               err |= sysfs_create_bin_file(&rinfo->pdev->dev.kobj,
+                                               &edid2_attr);
+       if (err)
+               pr_warning("%s() Creating sysfs files failed, continuing\n",
+                          __func__);
 
        /* save current mode regs before we switch into the new one
         * so we can restore this upon __exit