Merge branch 'i915fb' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/intelf...
[sfrench/cifs-2.6.git] / drivers / video / aty / atyfb_base.c
index e370125e4fbc8ebe5a1cf192544d902bdda1e2a6..d9d7d3c4cae2ed83b81b4b8db846d7fa8d826ed6 100644 (file)
@@ -75,6 +75,7 @@
 #include "ati_ids.h"
 
 #ifdef __powerpc__
+#include <asm/machdep.h>
 #include <asm/prom.h>
 #include "../macmodes.h"
 #endif
@@ -238,13 +239,12 @@ static int atyfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
        u_int transp, struct fb_info *info);
 static int atyfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info);
 static int atyfb_blank(int blank, struct fb_info *info);
-static int atyfb_ioctl(struct inode *inode, struct file *file, u_int cmd,
-       u_long arg, struct fb_info *info);
+static int atyfb_ioctl(struct fb_info *info, u_int cmd, u_long arg);
 extern void atyfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
 extern void atyfb_copyarea(struct fb_info *info, const struct fb_copyarea *area);
 extern void atyfb_imageblit(struct fb_info *info, const struct fb_image *image);
 #ifdef __sparc__
-static int atyfb_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma);
+static int atyfb_mmap(struct fb_info *info, struct vm_area_struct *vma);
 #endif
 static int atyfb_sync(struct fb_info *info);
 
@@ -435,7 +435,7 @@ static int __devinit correct_chipset(struct atyfb_par *par)
        const char *name;
        int i;
 
-       for (i = sizeof(aty_chips) / sizeof(*aty_chips) - 1; i >= 0; i--)
+       for (i = ARRAY_SIZE(aty_chips) - 1; i >= 0; i--)
                if (par->pci_id == aty_chips[i].pci_id)
                        break;
 
@@ -1739,8 +1739,7 @@ struct atyclk {
 #define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
 #endif
 
-static int atyfb_ioctl(struct inode *inode, struct file *file, u_int cmd,
-       u_long arg, struct fb_info *info)
+static int atyfb_ioctl(struct fb_info *info, u_int cmd, u_long arg)
 {
        struct atyfb_par *par = (struct atyfb_par *) info->par;
 #ifdef __sparc__
@@ -1845,7 +1844,7 @@ static int atyfb_sync(struct fb_info *info)
 }
 
 #ifdef __sparc__
-static int atyfb_mmap(struct fb_info *info, struct file *file, struct vm_area_struct *vma)
+static int atyfb_mmap(struct fb_info *info, struct vm_area_struct *vma)
 {
        struct atyfb_par *par = (struct atyfb_par *) info->par;
        unsigned int size, page, map_size = 0;
@@ -2170,10 +2169,10 @@ static void __init aty_calc_mem_refresh(struct atyfb_par *par, int xclk)
 
        if (IS_XL(par->pci_id) || IS_MOBILITY(par->pci_id)) {
                refresh_tbl = ragexl_tbl;
-               size = sizeof(ragexl_tbl)/sizeof(int);
+               size = ARRAY_SIZE(ragexl_tbl);
        } else {
                refresh_tbl = ragepro_tbl;
-               size = sizeof(ragepro_tbl)/sizeof(int);
+               size = ARRAY_SIZE(ragepro_tbl);
        }
 
        for (i=0; i < size; i++) {
@@ -2300,6 +2299,10 @@ static int __init aty_init(struct fb_info *info, const char *name)
                case CLK_ATI18818_1:
                        par->pll_ops = &aty_pll_ati18818_1;
                        break;
+               case CLK_IBMRGB514:
+                       par->pll_ops = &aty_pll_ibm514;
+                       break;
+#if 0 /* dead code */
                case CLK_STG1703:
                        par->pll_ops = &aty_pll_stg1703;
                        break;
@@ -2309,9 +2312,7 @@ static int __init aty_init(struct fb_info *info, const char *name)
                case CLK_ATT20C408:
                        par->pll_ops = &aty_pll_att20c408;
                        break;
-               case CLK_IBMRGB514:
-                       par->pll_ops = &aty_pll_ibm514;
-                       break;
+#endif
                default:
                        PRINTKI("aty_init: CLK type not implemented yet!");
                        par->pll_ops = &aty_pll_unsupported;
@@ -2518,7 +2519,7 @@ static int __init aty_init(struct fb_info *info, const char *name)
 
        memset(&var, 0, sizeof(var));
 #ifdef CONFIG_PPC
-       if (_machine == _MACH_Pmac) {
+       if (machine_is(powermac)) {
                /*
                 *  FIXME: The NVRAM stuff should be put in a Mac-specific file, as it
                 *         applies to all Mac video cards
@@ -2673,7 +2674,7 @@ static int atyfb_blank(int blank, struct fb_info *info)
                return 0;
 
 #ifdef CONFIG_PMAC_BACKLIGHT
-       if ((_machine == _MACH_Pmac) && blank > FB_BLANK_NORMAL)
+       if (machine_is(powermac) && blank > FB_BLANK_NORMAL)
                set_backlight_enable(0);
 #elif defined(CONFIG_FB_ATY_GENERIC_LCD)
        if (par->lcd_table && blank > FB_BLANK_NORMAL &&
@@ -2705,7 +2706,7 @@ static int atyfb_blank(int blank, struct fb_info *info)
        aty_st_le32(CRTC_GEN_CNTL, gen_cntl, par);
 
 #ifdef CONFIG_PMAC_BACKLIGHT
-       if ((_machine == _MACH_Pmac) && blank <= FB_BLANK_NORMAL)
+       if (machine_is(powermac) && blank <= FB_BLANK_NORMAL)
                set_backlight_enable(1);
 #elif defined(CONFIG_FB_ATY_GENERIC_LCD)
        if (par->lcd_table && blank <= FB_BLANK_NORMAL &&
@@ -3399,7 +3400,7 @@ static int __devinit atyfb_pci_probe(struct pci_dev *pdev, const struct pci_devi
        struct atyfb_par *par;
        int i, rc = -ENOMEM;
 
-       for (i = sizeof(aty_chips) / sizeof(*aty_chips) - 1; i >= 0; i--)
+       for (i = ARRAY_SIZE(aty_chips) - 1; i >= 0; i--)
                if (pdev->device == aty_chips[i].pci_id)
                        break;
 
@@ -3501,7 +3502,7 @@ err_release_mem:
 
 static int __devinit atyfb_atari_probe(void)
 {
-       struct aty_par *par;
+       struct atyfb_par *par;
        struct fb_info *info;
        int m64_num;
        u32 clock_r;