Merge branch 'master' into for_paulus
[linux-drm-fsl-dcu.git] / drivers / video / sis / sis_main.c
index 8adf5bf91eee075716b12d95d5eb26ef6c0312bc..01197d7402174a113ad103f40c2197be1c809d6d 100644 (file)
  *
  */
 
-#include <linux/config.h>
 #include <linux/version.h>
 #include <linux/module.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
 #include <linux/moduleparam.h>
-#endif
 #include <linux/kernel.h>
 #include <linux/smp_lock.h>
 #include <linux/spinlock.h>
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/mm.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)
 #include <linux/tty.h>
+#else
+#include <linux/screen_info.h>
+#endif
+
 #include <linux/slab.h>
 #include <linux/fb.h>
 #include <linux/selection.h>
@@ -53,9 +56,6 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/vmalloc.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-#include <linux/vt_kern.h>
-#endif
 #include <linux/capability.h>
 #include <linux/fs.h>
 #include <linux/types.h>
 #include <asm/mtrr.h>
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-#include <video/fbcon.h>
-#include <video/fbcon-cfb8.h>
-#include <video/fbcon-cfb16.h>
-#include <video/fbcon-cfb24.h>
-#include <video/fbcon-cfb32.h>
-#endif
-
 #include "sis.h"
 #include "sis_main.h"
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,3)
-#error "This version of sisfb requires at least 2.6.3"
-#endif
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-#ifdef FBCON_HAS_CFB8
-extern struct display_switch fbcon_sis8;
-#endif
-#ifdef FBCON_HAS_CFB16
-extern struct display_switch fbcon_sis16;
-#endif
-#ifdef FBCON_HAS_CFB32
-extern struct display_switch fbcon_sis32;
-#endif
-#endif
-
 static void sisfb_handle_command(struct sis_video_info *ivideo,
                                 struct sisfb_cmd *sisfb_command);
 
@@ -109,17 +83,7 @@ sisfb_setdefaultparms(void)
        sisfb_max               = -1;
        sisfb_userom            = -1;
        sisfb_useoem            = -1;
-#ifdef MODULE
-       /* Module: "None" for 2.4, default mode for 2.5+ */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-       sisfb_mode_idx          = -1;
-#else
-       sisfb_mode_idx          = MODE_INDEX_NONE;
-#endif
-#else
-       /* Static: Default mode */
        sisfb_mode_idx          = -1;
-#endif
        sisfb_parm_rate         = -1;
        sisfb_crt1off           = 0;
        sisfb_forcecrt1         = -1;
@@ -137,10 +101,6 @@ sisfb_setdefaultparms(void)
        sisfb_tvxposoffset      = 0;
        sisfb_tvyposoffset      = 0;
        sisfb_nocrt2rate        = 0;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-       sisfb_inverse           = 0;
-       sisfb_fontname[0]       = 0;
-#endif
 #if !defined(__i386__) && !defined(__x86_64__)
        sisfb_resetcard         = 0;
        sisfb_videoram          = 0;
@@ -150,21 +110,18 @@ sisfb_setdefaultparms(void)
 /* ------------- Parameter parsing -------------- */
 
 static void __devinit
-sisfb_search_vesamode(unsigned int vesamode, BOOLEAN quiet)
+sisfb_search_vesamode(unsigned int vesamode, bool quiet)
 {
        int i = 0, j = 0;
 
        /* We don't know the hardware specs yet and there is no ivideo */
 
        if(vesamode == 0) {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-               sisfb_mode_idx = MODE_INDEX_NONE;
-#else
                if(!quiet)
                        printk(KERN_ERR "sisfb: Invalid mode. Using default.\n");
 
                sisfb_mode_idx = DEFAULT_MODE;
-#endif
+
                return;
        }
 
@@ -193,7 +150,7 @@ sisfb_search_vesamode(unsigned int vesamode, BOOLEAN quiet)
 }
 
 static void __devinit
-sisfb_search_mode(char *name, BOOLEAN quiet)
+sisfb_search_mode(char *name, bool quiet)
 {
        unsigned int j = 0, xres = 0, yres = 0, depth = 0, rate = 0;
        int i = 0;
@@ -210,7 +167,6 @@ sisfb_search_mode(char *name, BOOLEAN quiet)
                return;
        }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
        if(!strnicmp(name, sisbios_mode[MODE_INDEX_NONE].name, strlen(name))) {
                if(!quiet)
                        printk(KERN_ERR "sisfb: Mode 'none' not supported anymore. Using default.\n");
@@ -218,7 +174,7 @@ sisfb_search_mode(char *name, BOOLEAN quiet)
                sisfb_mode_idx = DEFAULT_MODE;
                return;
        }
-#endif
+
        if(strlen(name) <= 19) {
                strcpy(strbuf1, name);
                for(i = 0; i < strlen(strbuf1); i++) {
@@ -275,7 +231,7 @@ sisfb_search_mode(char *name, BOOLEAN quiet)
 static void __devinit
 sisfb_get_vga_mode_from_kernel(void)
 {
-#if (defined(__i386__) || defined(__x86_64__)) && defined(CONFIG_VIDEO_SELECT)
+#ifdef CONFIG_X86
        char mymode[32];
        int  mydepth = screen_info.lfb_depth;
 
@@ -295,7 +251,7 @@ sisfb_get_vga_mode_from_kernel(void)
                        "sisfb: Using vga mode %s pre-set by kernel as default\n",
                        mymode);
 
-               sisfb_search_mode(mymode, TRUE);
+               sisfb_search_mode(mymode, true);
        }
 #endif
        return;
@@ -351,7 +307,7 @@ static void __init
 sisfb_search_specialtiming(const char *name)
 {
        int i = 0;
-       BOOLEAN found = FALSE;
+       bool found = false;
 
        /* We don't know the hardware specs yet and there is no ivideo */
 
@@ -366,7 +322,7 @@ sisfb_search_specialtiming(const char *name)
                        if(!strnicmp(name,mycustomttable[i].optionName,
                           strlen(mycustomttable[i].optionName))) {
                                sisfb_specialtiming = mycustomttable[i].SpecialID;
-                               found = TRUE;
+                               found = true;
                                printk(KERN_INFO "sisfb: Special timing for %s %s forced (\"%s\")\n",
                                        mycustomttable[i].vendorName,
                                        mycustomttable[i].cardName,
@@ -397,7 +353,7 @@ sisfb_detect_custom_timing(struct sis_video_info *ivideo)
 {
        unsigned char *biosver = NULL;
        unsigned char *biosdate = NULL;
-       BOOLEAN footprint;
+       bool footprint;
        u32 chksum = 0;
        int i, j;
 
@@ -424,16 +380,16 @@ sisfb_detect_custom_timing(struct sis_video_info *ivideo)
                      (mycustomttable[i].bioschksum == chksum)))                &&
                    (mycustomttable[i].pcisubsysvendor == ivideo->subsysvendor) &&
                    (mycustomttable[i].pcisubsyscard == ivideo->subsysdevice) ) {
-                       footprint = TRUE;
+                       footprint = true;
                        for(j = 0; j < 5; j++) {
                                if(mycustomttable[i].biosFootprintAddr[j]) {
                                        if(ivideo->SiS_Pr.UseROM) {
                                                if(ivideo->SiS_Pr.VirtualRomBase[mycustomttable[i].biosFootprintAddr[j]] !=
                                                        mycustomttable[i].biosFootprintData[j]) {
-                                                       footprint = FALSE;
+                                                       footprint = false;
                                                }
                                        } else
-                                               footprint = FALSE;
+                                               footprint = false;
                                }
                        }
                        if(footprint) {
@@ -450,7 +406,7 @@ sisfb_detect_custom_timing(struct sis_video_info *ivideo)
        } while(mycustomttable[i].chipID);
 }
 
-static BOOLEAN __devinit
+static bool __devinit
 sisfb_interpret_edid(struct sisfb_monitor *monitor, u8 *buffer)
 {
        int i, j, xres, yres, refresh, index;
@@ -461,13 +417,13 @@ sisfb_interpret_edid(struct sisfb_monitor *monitor, u8 *buffer)
           buffer[4] != 0xff || buffer[5] != 0xff ||
           buffer[6] != 0xff || buffer[7] != 0x00) {
                printk(KERN_DEBUG "sisfb: Bad EDID header\n");
-               return FALSE;
+               return false;
        }
 
        if(buffer[0x12] != 0x01) {
                printk(KERN_INFO "sisfb: EDID version %d not supported\n",
                        buffer[0x12]);
-               return FALSE;
+               return false;
        }
 
        monitor->feature = buffer[0x18];
@@ -493,7 +449,7 @@ sisfb_interpret_edid(struct sisfb_monitor *monitor, u8 *buffer)
                  monitor->vmin = buffer[j + 5];
                  monitor->vmax = buffer[j + 6];
                  monitor->dclockmax = buffer[j + 9] * 10 * 1000;
-                 monitor->datavalid = TRUE;
+                 monitor->datavalid = true;
                  break;
               }
               j += 18;
@@ -545,7 +501,7 @@ sisfb_interpret_edid(struct sisfb_monitor *monitor, u8 *buffer)
              index += 2;
           }
           if((monitor->hmin <= monitor->hmax) && (monitor->vmin <= monitor->vmax)) {
-             monitor->datavalid = TRUE;
+             monitor->datavalid = true;
           }
        }
 
@@ -558,7 +514,7 @@ sisfb_handle_ddc(struct sis_video_info *ivideo, struct sisfb_monitor *monitor, i
        unsigned short temp, i, realcrtno = crtno;
        unsigned char  buffer[256];
 
-       monitor->datavalid = FALSE;
+       monitor->datavalid = false;
 
        if(crtno) {
           if(ivideo->vbflags & CRT2_LCD)      realcrtno = 1;
@@ -607,7 +563,7 @@ sisfb_handle_ddc(struct sis_video_info *ivideo, struct sisfb_monitor *monitor, i
 
 /* -------------- Mode validation --------------- */
 
-static BOOLEAN
+static bool
 sisfb_verify_rate(struct sis_video_info *ivideo, struct sisfb_monitor *monitor,
                int mode_idx, int rate_idx, int rate)
 {
@@ -615,10 +571,10 @@ sisfb_verify_rate(struct sis_video_info *ivideo, struct sisfb_monitor *monitor,
        unsigned int dclock, hsync;
 
        if(!monitor->datavalid)
-               return TRUE;
+               return true;
 
        if(mode_idx < 0)
-               return FALSE;
+               return false;
 
        /* Skip for 320x200, 320x240, 640x400 */
        switch(sisbios_mode[mode_idx].mode_no[ivideo->mni]) {
@@ -631,34 +587,34 @@ sisfb_verify_rate(struct sis_video_info *ivideo, struct sisfb_monitor *monitor,
        case 0x2f:
        case 0x5d:
        case 0x5e:
-               return TRUE;
+               return true;
 #ifdef CONFIG_FB_SIS_315
        case 0x5a:
        case 0x5b:
-               if(ivideo->sisvga_engine == SIS_315_VGA) return TRUE;
+               if(ivideo->sisvga_engine == SIS_315_VGA) return true;
 #endif
        }
 
        if(rate < (monitor->vmin - 1))
-               return FALSE;
+               return false;
        if(rate > (monitor->vmax + 1))
-               return FALSE;
+               return false;
 
        if(sisfb_gettotalfrommode(&ivideo->SiS_Pr,
                                  sisbios_mode[mode_idx].mode_no[ivideo->mni],
                                  &htotal, &vtotal, rate_idx)) {
                dclock = (htotal * vtotal * rate) / 1000;
                if(dclock > (monitor->dclockmax + 1000))
-                       return FALSE;
+                       return false;
                hsync = dclock / htotal;
                if(hsync < (monitor->hmin - 1))
-                       return FALSE;
+                       return false;
                if(hsync > (monitor->hmax + 1))
-                       return FALSE;
+                       return false;
         } else {
-               return FALSE;
+               return false;
        }
-       return TRUE;
+       return true;
 }
 
 static int
@@ -776,49 +732,49 @@ sisfb_search_refresh_rate(struct sis_video_info *ivideo, unsigned int rate, int
        }
 }
 
-static BOOLEAN
+static bool
 sisfb_bridgeisslave(struct sis_video_info *ivideo)
 {
        unsigned char P1_00;
 
        if(!(ivideo->vbflags2 & VB2_VIDEOBRIDGE))
-               return FALSE;
+               return false;
 
        inSISIDXREG(SISPART1,0x00,P1_00);
        if( ((ivideo->sisvga_engine == SIS_300_VGA) && (P1_00 & 0xa0) == 0x20) ||
            ((ivideo->sisvga_engine == SIS_315_VGA) && (P1_00 & 0x50) == 0x10) ) {
-               return TRUE;
+               return true;
        } else {
-               return FALSE;
+               return false;
        }
 }
 
-static BOOLEAN
+static bool
 sisfballowretracecrt1(struct sis_video_info *ivideo)
 {
        u8 temp;
 
        inSISIDXREG(SISCR,0x17,temp);
        if(!(temp & 0x80))
-               return FALSE;
+               return false;
 
        inSISIDXREG(SISSR,0x1f,temp);
        if(temp & 0xc0)
-               return FALSE;
+               return false;
 
-       return TRUE;
+       return true;
 }
 
-static BOOLEAN
+static bool
 sisfbcheckvretracecrt1(struct sis_video_info *ivideo)
 {
        if(!sisfballowretracecrt1(ivideo))
-               return FALSE;
+               return false;
 
        if(inSISREG(SISINPSTAT) & 0x08)
-               return TRUE;
+               return true;
        else
-               return FALSE;
+               return false;
 }
 
 static void
@@ -835,7 +791,7 @@ sisfbwaitretracecrt1(struct sis_video_info *ivideo)
        while((inSISREG(SISINPSTAT) & 0x08) && --watchdog);
 }
 
-static BOOLEAN
+static bool
 sisfbcheckvretracecrt2(struct sis_video_info *ivideo)
 {
        unsigned char temp, reg;
@@ -843,17 +799,17 @@ sisfbcheckvretracecrt2(struct sis_video_info *ivideo)
        switch(ivideo->sisvga_engine) {
        case SIS_300_VGA: reg = 0x25; break;
        case SIS_315_VGA: reg = 0x30; break;
-       default:          return FALSE;
+       default:          return false;
        }
 
        inSISIDXREG(SISPART1, reg, temp);
        if(temp & 0x02)
-               return TRUE;
+               return true;
        else
-               return FALSE;
+               return false;
 }
 
-static BOOLEAN
+static bool
 sisfb_CheckVBRetrace(struct sis_video_info *ivideo)
 {
        if(ivideo->currentvbflags & VB_DISPTYPE_DISP2) {
@@ -918,7 +874,7 @@ static int
 sisfb_myblank(struct sis_video_info *ivideo, int blank)
 {
        u8 sr01, sr11, sr1f, cr63=0, p2_0, p1_13;
-       BOOLEAN backlight = TRUE;
+       bool backlight = true;
 
        switch(blank) {
                case FB_BLANK_UNBLANK:  /* on */
@@ -928,7 +884,7 @@ sisfb_myblank(struct sis_video_info *ivideo, int blank)
                        cr63  = 0x00;
                        p2_0  = 0x20;
                        p1_13 = 0x00;
-                       backlight = TRUE;
+                       backlight = true;
                        break;
                case FB_BLANK_NORMAL:   /* blank */
                        sr01  = 0x20;
@@ -937,7 +893,7 @@ sisfb_myblank(struct sis_video_info *ivideo, int blank)
                        cr63  = 0x00;
                        p2_0  = 0x20;
                        p1_13 = 0x00;
-                       backlight = TRUE;
+                       backlight = true;
                        break;
                case FB_BLANK_VSYNC_SUSPEND:    /* no vsync */
                        sr01  = 0x20;
@@ -946,7 +902,7 @@ sisfb_myblank(struct sis_video_info *ivideo, int blank)
                        cr63  = 0x40;
                        p2_0  = 0x40;
                        p1_13 = 0x80;
-                       backlight = FALSE;
+                       backlight = false;
                        break;
                case FB_BLANK_HSYNC_SUSPEND:    /* no hsync */
                        sr01  = 0x20;
@@ -955,7 +911,7 @@ sisfb_myblank(struct sis_video_info *ivideo, int blank)
                        cr63  = 0x40;
                        p2_0  = 0x80;
                        p1_13 = 0x40;
-                       backlight = FALSE;
+                       backlight = false;
                        break;
                case FB_BLANK_POWERDOWN:        /* off */
                        sr01  = 0x20;
@@ -964,7 +920,7 @@ sisfb_myblank(struct sis_video_info *ivideo, int blank)
                        cr63  = 0x40;
                        p2_0  = 0xc0;
                        p1_13 = 0xc0;
-                       backlight = FALSE;
+                       backlight = false;
                        break;
                default:
                        return 1;
@@ -1153,11 +1109,11 @@ sisfb_calc_pitch(struct sis_video_info *ivideo, struct fb_var_screeninfo *var)
 static void
 sisfb_set_pitch(struct sis_video_info *ivideo)
 {
-       BOOLEAN isslavemode = FALSE;
+       bool isslavemode = false;
        unsigned short HDisplay1 = ivideo->scrnpitchCRT1 >> 3;
        unsigned short HDisplay2 = ivideo->video_linelength >> 3;
 
-       if(sisfb_bridgeisslave(ivideo)) isslavemode = TRUE;
+       if(sisfb_bridgeisslave(ivideo)) isslavemode = true;
 
        /* We need to set pitch for CRT1 if bridge is in slave mode, too */
        if((ivideo->currentvbflags & VB_DISPTYPE_DISP1) || (isslavemode)) {
@@ -1222,7 +1178,7 @@ sisfb_set_mode(struct sis_video_info *ivideo, int clrscrn)
 
        sisfb_pre_setmode(ivideo);
 
-       if(SiSSetMode(&ivideo->SiS_Pr, modeno) == 0) {
+       if(!SiSSetMode(&ivideo->SiS_Pr, modeno)) {
                printk(KERN_ERR "sisfb: Setting mode[0x%x] failed\n", ivideo->mode_no);
                return -EINVAL;
        }
@@ -1310,20 +1266,7 @@ sisfb_do_set_var(struct fb_var_screeninfo *var, int isactive, struct fb_info *in
                ivideo->refresh_rate = 60;
        }
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-       if(ivideo->sisfb_thismonitor.datavalid) {
-               if(!sisfb_verify_rate(ivideo, &ivideo->sisfb_thismonitor, ivideo->sisfb_mode_idx,
-                                ivideo->rate_idx, ivideo->refresh_rate)) {
-                       printk(KERN_INFO "sisfb: WARNING: Refresh rate exceeds monitor specs!\n");
-               }
-       }
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-       if(((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) && isactive) {
-#else
        if(isactive) {
-#endif
                /* If acceleration to be used? Need to know
                 * before pre/post_set_mode()
                 */
@@ -1362,9 +1305,7 @@ sisfb_do_set_var(struct fb_var_screeninfo *var, int isactive, struct fb_info *in
                ivideo->current_linelength = ivideo->video_linelength;
                ivideo->current_pixclock = var->pixclock;
                ivideo->current_refresh_rate = ivideo->refresh_rate;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
                ivideo->sisfb_lastrates[ivideo->mode_no] = ivideo->refresh_rate;
-#endif
        }
 
        return 0;
@@ -1430,18 +1371,6 @@ sisfb_pan_var(struct sis_video_info *ivideo, struct fb_var_screeninfo *var)
        return 0;
 }
 
-/* ------------ FBDev related routines for 2.4 series ----------- */
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-
-#include "sisfb_fbdev_2_4.h"
-
-#endif
-
-/* ------------ FBDev related routines for 2.6 series ----------- */
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-
 static int
 sisfb_open(struct fb_info *info, int user)
 {
@@ -1517,7 +1446,7 @@ sisfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
        unsigned int drate = 0, hrate = 0, maxyres;
        int found_mode = 0;
        int refresh_rate, search_idx, tidx;
-       BOOLEAN recalc_clock = FALSE;
+       bool recalc_clock = false;
        u32 pixclock;
 
        htotal = var->left_margin + var->xres + var->right_margin + var->hsync_len;
@@ -1595,7 +1524,7 @@ sisfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
            (var->bits_per_pixel == 8) ) {
                /* Slave modes on LVDS and 301B-DH */
                refresh_rate = 60;
-               recalc_clock = TRUE;
+               recalc_clock = true;
        } else if( (ivideo->current_htotal == htotal) &&
                   (ivideo->current_vtotal == vtotal) &&
                   (ivideo->current_pixclock == pixclock) ) {
@@ -1616,17 +1545,17 @@ sisfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
                } else {
                        refresh_rate = 60;
                }
-               recalc_clock = TRUE;
+               recalc_clock = true;
        } else if((pixclock) && (htotal) && (vtotal)) {
                drate = 1000000000 / pixclock;
                hrate = (drate * 1000) / htotal;
                refresh_rate = (unsigned int) (hrate * 2 / vtotal);
        } else if(ivideo->current_refresh_rate) {
                refresh_rate = ivideo->current_refresh_rate;
-               recalc_clock = TRUE;
+               recalc_clock = true;
        } else {
                refresh_rate = 60;
-               recalc_clock = TRUE;
+               recalc_clock = true;
        }
 
        myrateindex = sisfb_search_refresh_rate(ivideo, refresh_rate, search_idx);
@@ -1739,8 +1668,6 @@ sisfb_blank(int blank, struct fb_info *info)
        return sisfb_myblank(ivideo, blank);
 }
 
-#endif
-
 /* ----------- FBDev related routines for all series ---------- */
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
@@ -1964,20 +1891,6 @@ sisfb_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *info)
 
 /* ----------------  fb_ops structures ----------------- */
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-static struct fb_ops sisfb_ops = {
-       .owner          = THIS_MODULE,
-       .fb_get_fix     = sisfb_get_fix,
-       .fb_get_var     = sisfb_get_var,
-       .fb_set_var     = sisfb_set_var,
-       .fb_get_cmap    = sisfb_get_cmap,
-       .fb_set_cmap    = sisfb_set_cmap,
-       .fb_pan_display = sisfb_pan_display,
-       .fb_ioctl       = sisfb_ioctl
-};
-#endif
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
 static struct fb_ops sisfb_ops = {
        .owner          = THIS_MODULE,
        .fb_open        = sisfb_open,
@@ -1999,7 +1912,6 @@ static struct fb_ops sisfb_ops = {
 #endif
        .fb_ioctl       = sisfb_ioctl
 };
-#endif
 
 /* ---------------- Chip generation dependent routines ---------------- */
 
@@ -2269,7 +2181,7 @@ sisfb_detect_VB_connect(struct sis_video_info *ivideo)
 
 /* ------------------ Sensing routines ------------------ */
 
-static BOOLEAN __devinit
+static bool __devinit
 sisfb_test_DDC1(struct sis_video_info *ivideo)
 {
     unsigned short old;
@@ -2279,13 +2191,13 @@ sisfb_test_DDC1(struct sis_video_info *ivideo)
     do {
        if(old != SiS_ReadDDC1Bit(&ivideo->SiS_Pr)) break;
     } while(count--);
-    return (count == -1) ? FALSE : TRUE;
+    return (count != -1);
 }
 
 static void __devinit
 sisfb_sense_crt1(struct sis_video_info *ivideo)
 {
-    BOOLEAN mustwait = FALSE;
+    bool mustwait = false;
     u8  sr1F, cr17;
 #ifdef CONFIG_FB_SIS_315
     u8  cr63=0;
@@ -2296,7 +2208,7 @@ sisfb_sense_crt1(struct sis_video_info *ivideo)
     inSISIDXREG(SISSR,0x1F,sr1F);
     orSISIDXREG(SISSR,0x1F,0x04);
     andSISIDXREG(SISSR,0x1F,0x3F);
-    if(sr1F & 0xc0) mustwait = TRUE;
+    if(sr1F & 0xc0) mustwait = true;
 
 #ifdef CONFIG_FB_SIS_315
     if(ivideo->sisvga_engine == SIS_315_VGA) {
@@ -2310,7 +2222,7 @@ sisfb_sense_crt1(struct sis_video_info *ivideo)
     cr17 &= 0x80;
     if(!cr17) {
        orSISIDXREG(SISCR,0x17,0x80);
-       mustwait = TRUE;
+       mustwait = true;
        outSISIDXREG(SISSR, 0x00, 0x01);
        outSISIDXREG(SISSR, 0x00, 0x03);
     }
@@ -2372,7 +2284,7 @@ SiS_SenseLCD(struct sis_video_info *ivideo)
        u8 reg, cr37 = 0, paneltype = 0;
        u16 xres, yres;
 
-       ivideo->SiS_Pr.PanelSelfDetected = FALSE;
+       ivideo->SiS_Pr.PanelSelfDetected = false;
 
        /* LCD detection only for TMDS bridges */
        if(!(ivideo->vbflags2 & VB2_SISTMDSBRIDGE))
@@ -2449,7 +2361,7 @@ SiS_SenseLCD(struct sis_video_info *ivideo)
        setSISIDXREG(SISCR, 0x37, 0x0c, cr37);
        orSISIDXREG(SISCR, 0x32, 0x08);
 
-       ivideo->SiS_Pr.PanelSelfDetected = TRUE;
+       ivideo->SiS_Pr.PanelSelfDetected = true;
 }
 
 static int __devinit
@@ -3104,7 +3016,7 @@ sisfb_save_pdc_emi(struct sis_video_info *ivideo)
                        int tmp;
                        inSISIDXREG(SISPART1,0x13,tmp);
                        if(tmp & 0x04) {
-                               ivideo->SiS_Pr.SiS_UseLCDA = TRUE;
+                               ivideo->SiS_Pr.SiS_UseLCDA = true;
                                ivideo->detectedlcda = 0x03;
                        }
                }
@@ -3159,9 +3071,9 @@ sisfb_save_pdc_emi(struct sis_video_info *ivideo)
                                inSISIDXREG(SISPART4,0x31,ivideo->SiS_Pr.EMI_31);
                                inSISIDXREG(SISPART4,0x32,ivideo->SiS_Pr.EMI_32);
                                inSISIDXREG(SISPART4,0x33,ivideo->SiS_Pr.EMI_33);
-                               ivideo->SiS_Pr.HaveEMI = TRUE;
+                               ivideo->SiS_Pr.HaveEMI = true;
                                if((tmp & 0x20) || (ivideo->detectedlcda != 0xff)) {
-                                       ivideo->SiS_Pr.HaveEMILCD = TRUE;
+                                       ivideo->SiS_Pr.HaveEMILCD = true;
                                }
                        }
                }
@@ -3646,8 +3558,8 @@ sisfb_pre_setmode(struct sis_video_info *ivideo)
        }
 #endif
 
-       SiS_SetEnableDstn(&ivideo->SiS_Pr, FALSE);
-       SiS_SetEnableFstn(&ivideo->SiS_Pr, FALSE);
+       SiS_SetEnableDstn(&ivideo->SiS_Pr, false);
+       SiS_SetEnableFstn(&ivideo->SiS_Pr, false);
        ivideo->curFSTN = ivideo->curDSTN = 0;
 
        switch(ivideo->currentvbflags & VB_DISPTYPE_DISP2) {
@@ -3902,8 +3814,8 @@ sisfb_set_TVyposoffset(struct sis_video_info *ivideo, int val)
 static void
 sisfb_post_setmode(struct sis_video_info *ivideo)
 {
-       BOOLEAN crt1isoff = FALSE;
-       BOOLEAN doit = TRUE;
+       bool crt1isoff = false;
+       bool doit = true;
 #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315)
        u8 reg;
 #endif
@@ -3922,17 +3834,17 @@ sisfb_post_setmode(struct sis_video_info *ivideo)
 
        /* We can't switch off CRT1 if bridge is in slave mode */
        if(ivideo->vbflags2 & VB2_VIDEOBRIDGE) {
-               if(sisfb_bridgeisslave(ivideo)) doit = FALSE;
+               if(sisfb_bridgeisslave(ivideo)) doit = false;
        } else
                ivideo->sisfb_crt1off = 0;
 
 #ifdef CONFIG_FB_SIS_300
        if(ivideo->sisvga_engine == SIS_300_VGA) {
                if((ivideo->sisfb_crt1off) && (doit)) {
-                       crt1isoff = TRUE;
+                       crt1isoff = true;
                        reg = 0x00;
                } else {
-                       crt1isoff = FALSE;
+                       crt1isoff = false;
                        reg = 0x80;
                }
                setSISIDXREG(SISCR, 0x17, 0x7f, reg);
@@ -3941,11 +3853,11 @@ sisfb_post_setmode(struct sis_video_info *ivideo)
 #ifdef CONFIG_FB_SIS_315
        if(ivideo->sisvga_engine == SIS_315_VGA) {
                if((ivideo->sisfb_crt1off) && (doit)) {
-                       crt1isoff = TRUE;
+                       crt1isoff = true;
                        reg  = 0x40;
                        reg1 = 0xc0;
                } else {
-                       crt1isoff = FALSE;
+                       crt1isoff = false;
                        reg  = 0x00;
                        reg1 = 0x00;
                }
@@ -4092,19 +4004,9 @@ sisfb_setup(char *options)
                } else if(!strnicmp(this_opt, "tvstandard:",11)) {
                        sisfb_search_tvstd(this_opt + 11);
                } else if(!strnicmp(this_opt, "mode:", 5)) {
-                       sisfb_search_mode(this_opt + 5, FALSE);
+                       sisfb_search_mode(this_opt + 5, false);
                } else if(!strnicmp(this_opt, "vesa:", 5)) {
-                       sisfb_search_vesamode(simple_strtoul(this_opt + 5, NULL, 0), FALSE);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-               } else if(!strnicmp(this_opt, "inverse", 7)) {
-                       sisfb_inverse = 1;
-                       /* fb_invert_cmaps(); */
-               } else if(!strnicmp(this_opt, "font:", 5)) {
-                       if(strlen(this_opt + 5) < 40) {
-                          strncpy(sisfb_fontname, this_opt + 5, sizeof(sisfb_fontname) - 1);
-                          sisfb_fontname[sizeof(sisfb_fontname) - 1] = '\0';
-                       }
-#endif
+                       sisfb_search_vesamode(simple_strtoul(this_opt + 5, NULL, 0), false);
                } else if(!strnicmp(this_opt, "rate:", 5)) {
                        sisfb_parm_rate = simple_strtoul(this_opt + 5, NULL, 0);
                } else if(!strnicmp(this_opt, "forcecrt1:", 10)) {
@@ -4160,7 +4062,7 @@ sisfb_setup(char *options)
                           sisfb_lvdshl = temp;
                        }
                } else if(this_opt[0] >= '0' && this_opt[0] <= '9') {
-                       sisfb_search_mode(this_opt, TRUE);
+                       sisfb_search_mode(this_opt, true);
 #if !defined(__i386__) && !defined(__x86_64__)
                } else if(!strnicmp(this_opt, "resetcard", 9)) {
                        sisfb_resetcard = 1;
@@ -4662,9 +4564,9 @@ sisfb_post_sis300(struct pci_dev *pdev)
        sisfb_sense_crt1(ivideo);
 
        /* Set default mode, don't clear screen */
-       ivideo->SiS_Pr.SiS_UseOEM = FALSE;
-       SiS_SetEnableDstn(&ivideo->SiS_Pr, FALSE);
-       SiS_SetEnableFstn(&ivideo->SiS_Pr, FALSE);
+       ivideo->SiS_Pr.SiS_UseOEM = false;
+       SiS_SetEnableDstn(&ivideo->SiS_Pr, false);
+       SiS_SetEnableFstn(&ivideo->SiS_Pr, false);
        ivideo->curFSTN = ivideo->curDSTN = 0;
        ivideo->SiS_Pr.VideoMemorySize = 8 << 20;
        SiSSetMode(&ivideo->SiS_Pr, 0x2e | 0x80);
@@ -5778,9 +5680,9 @@ sisfb_post_xgi(struct pci_dev *pdev)
        } else {
 
                /* Set default mode, don't clear screen */
-               ivideo->SiS_Pr.SiS_UseOEM = FALSE;
-               SiS_SetEnableDstn(&ivideo->SiS_Pr, FALSE);
-               SiS_SetEnableFstn(&ivideo->SiS_Pr, FALSE);
+               ivideo->SiS_Pr.SiS_UseOEM = false;
+               SiS_SetEnableDstn(&ivideo->SiS_Pr, false);
+               SiS_SetEnableFstn(&ivideo->SiS_Pr, false);
                ivideo->curFSTN = ivideo->curDSTN = 0;
                ivideo->SiS_Pr.VideoMemorySize = 8 << 20;
                SiSSetMode(&ivideo->SiS_Pr, 0x2e | 0x80);
@@ -5821,9 +5723,9 @@ sisfb_post_xgi(struct pci_dev *pdev)
        }
 
        /* Set default mode, don't clear screen */
-       ivideo->SiS_Pr.SiS_UseOEM = FALSE;
-       SiS_SetEnableDstn(&ivideo->SiS_Pr, FALSE);
-       SiS_SetEnableFstn(&ivideo->SiS_Pr, FALSE);
+       ivideo->SiS_Pr.SiS_UseOEM = false;
+       SiS_SetEnableDstn(&ivideo->SiS_Pr, false);
+       SiS_SetEnableFstn(&ivideo->SiS_Pr, false);
        ivideo->curFSTN = ivideo->curDSTN = 0;
        SiSSetMode(&ivideo->SiS_Pr, 0x2e | 0x80);
 
@@ -5865,17 +5767,9 @@ sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        if(sisfb_off)
                return -ENXIO;
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,3))
        sis_fb_info = framebuffer_alloc(sizeof(*ivideo), &pdev->dev);
        if(!sis_fb_info)
                return -ENOMEM;
-#else
-       sis_fb_info = kmalloc(sizeof(*sis_fb_info) + sizeof(*ivideo), GFP_KERNEL);
-       if(!sis_fb_info)
-               return -ENOMEM;
-       memset(sis_fb_info, 0, sizeof(*sis_fb_info) + sizeof(*ivideo));
-       sis_fb_info->par = ((char *)sis_fb_info + sizeof(*sis_fb_info));
-#endif
 
        ivideo = (struct sis_video_info *)sis_fb_info->par;
        ivideo->memyselfandi = sis_fb_info;
@@ -5925,7 +5819,7 @@ sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        ivideo->detectedpdca = 0xff;
        ivideo->detectedlcda = 0xff;
 
-       ivideo->sisfb_thismonitor.datavalid = FALSE;
+       ivideo->sisfb_thismonitor.datavalid = false;
 
        ivideo->current_base = 0;
 
@@ -5965,10 +5859,6 @@ sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        ivideo->tvxpos = sisfb_tvxposoffset;
        ivideo->tvypos = sisfb_tvyposoffset;
        ivideo->sisfb_nocrt2rate = sisfb_nocrt2rate;
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0)
-       ivideo->sisfb_inverse = sisfb_inverse;
-#endif
-
        ivideo->refresh_rate = 0;
        if(ivideo->sisfb_parm_rate != -1) {
                ivideo->refresh_rate = ivideo->sisfb_parm_rate;
@@ -5981,21 +5871,21 @@ sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
        ivideo->SiS_Pr.SiS_Backup70xx = 0xff;
        ivideo->SiS_Pr.SiS_CHOverScan = -1;
-       ivideo->SiS_Pr.SiS_ChSW = FALSE;
-       ivideo->SiS_Pr.SiS_UseLCDA = FALSE;
-       ivideo->SiS_Pr.HaveEMI = FALSE;
-       ivideo->SiS_Pr.HaveEMILCD = FALSE;
-       ivideo->SiS_Pr.OverruleEMI = FALSE;
-       ivideo->SiS_Pr.SiS_SensibleSR11 = FALSE;
+       ivideo->SiS_Pr.SiS_ChSW = false;
+       ivideo->SiS_Pr.SiS_UseLCDA = false;
+       ivideo->SiS_Pr.HaveEMI = false;
+       ivideo->SiS_Pr.HaveEMILCD = false;
+       ivideo->SiS_Pr.OverruleEMI = false;
+       ivideo->SiS_Pr.SiS_SensibleSR11 = false;
        ivideo->SiS_Pr.SiS_MyCR63 = 0x63;
        ivideo->SiS_Pr.PDC  = -1;
        ivideo->SiS_Pr.PDCA = -1;
-       ivideo->SiS_Pr.DDCPortMixup = FALSE;
+       ivideo->SiS_Pr.DDCPortMixup = false;
 #ifdef CONFIG_FB_SIS_315
        if(ivideo->chip >= SIS_330) {
                ivideo->SiS_Pr.SiS_MyCR63 = 0x53;
                if(ivideo->chip >= SIS_661) {
-                       ivideo->SiS_Pr.SiS_SensibleSR11 = TRUE;
+                       ivideo->SiS_Pr.SiS_SensibleSR11 = true;
                }
        }
 #endif
@@ -6044,10 +5934,6 @@ sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                }
        }
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-       strcpy(sis_fb_info->modename, ivideo->myid);
-#endif
-
        ivideo->SiS_Pr.ChipType = ivideo->chip;
 
        ivideo->SiS_Pr.ivideo = (void *)ivideo;
@@ -6083,7 +5969,7 @@ sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                do {
                        if(mychswtable[i].subsysVendor == ivideo->subsysvendor &&
                           mychswtable[i].subsysCard   == ivideo->subsysdevice) {
-                               ivideo->SiS_Pr.SiS_ChSW = TRUE;
+                               ivideo->SiS_Pr.SiS_ChSW = true;
                                printk(KERN_DEBUG "sisfb: Identified [%s %s] "
                                        "requiring Chrontel/GPIO setup\n",
                                        mychswtable[i].vendorName,
@@ -6129,37 +6015,23 @@ sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 #endif
        }
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-#ifdef MODULE
-       if((reg & 0x80) && (reg != 0xff)) {
-               if((sisbios_mode[ivideo->sisfb_mode_idx].mode_no[ivideo->mni])
-                                                                       != 0xFF) {
-                       printk(KERN_INFO "sisfb: Cannot initialize display mode, "
-                                        "X server is active\n");
-                       ret = -EBUSY;
-                       goto error_4;
-               }
-       }
-#endif
-#endif
-
        /* Search and copy ROM image */
        ivideo->bios_abase = NULL;
        ivideo->SiS_Pr.VirtualRomBase = NULL;
-       ivideo->SiS_Pr.UseROM = FALSE;
-       ivideo->haveXGIROM = ivideo->SiS_Pr.SiS_XGIROM = FALSE;
+       ivideo->SiS_Pr.UseROM = false;
+       ivideo->haveXGIROM = ivideo->SiS_Pr.SiS_XGIROM = false;
        if(ivideo->sisfb_userom) {
                ivideo->SiS_Pr.VirtualRomBase = sisfb_find_rom(pdev);
                ivideo->bios_abase = ivideo->SiS_Pr.VirtualRomBase;
-               ivideo->SiS_Pr.UseROM = (ivideo->SiS_Pr.VirtualRomBase) ? TRUE : FALSE;
+               ivideo->SiS_Pr.UseROM = (bool)(ivideo->SiS_Pr.VirtualRomBase);
                printk(KERN_INFO "sisfb: Video ROM %sfound\n",
                        ivideo->SiS_Pr.UseROM ? "" : "not ");
                if((ivideo->SiS_Pr.UseROM) && (ivideo->chip >= XGI_20)) {
-                  ivideo->SiS_Pr.UseROM = FALSE;
-                  ivideo->haveXGIROM = ivideo->SiS_Pr.SiS_XGIROM = TRUE;
+                  ivideo->SiS_Pr.UseROM = false;
+                  ivideo->haveXGIROM = ivideo->SiS_Pr.SiS_XGIROM = true;
                   if( (ivideo->revision_id == 2) &&
                       (!(ivideo->bios_abase[0x1d1] & 0x01)) ) {
-                       ivideo->SiS_Pr.DDCPortMixup = TRUE;
+                       ivideo->SiS_Pr.DDCPortMixup = true;
                   }
                }
        } else {
@@ -6276,9 +6148,6 @@ error_0:  iounmap(ivideo->video_vbase);
 error_1:       release_mem_region(ivideo->video_base, ivideo->video_size);
 error_2:       release_mem_region(ivideo->mmio_base, ivideo->mmio_size);
 error_3:       vfree(ivideo->bios_abase);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-error_4:
-#endif
                if(ivideo->lpcdev)
                        SIS_PCI_PUT_DEVICE(ivideo->lpcdev);
                if(ivideo->nbridge)
@@ -6581,7 +6450,6 @@ error_4:
                sis_fb_info->fix = ivideo->sisfb_fix;
                sis_fb_info->screen_base = ivideo->video_vbase + ivideo->video_offset;
                sis_fb_info->fbops = &sisfb_ops;
-
                sisfb_get_fix(&sis_fb_info->fix, -1, sis_fb_info);
                sis_fb_info->pseudo_palette = ivideo->pseudo_palette;
 
@@ -6598,10 +6466,6 @@ error_4:
                }
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-               vc_resize_con(1, 1, 0);
-#endif
-
                if(register_framebuffer(sis_fb_info) < 0) {
                        printk(KERN_ERR "sisfb: Fatal error: Failed to register framebuffer\n");
                        ret = -EINVAL;
@@ -6648,12 +6512,7 @@ error_4:
 
 
                printk(KERN_INFO "fb%d: %s frame buffer device version %d.%d.%d\n",
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-                       GET_FB_IDX(sis_fb_info->node),
-#else
-                       sis_fb_info->node,
-#endif
-                       ivideo->myid, VER_MAJOR, VER_MINOR, VER_LEVEL);
+                       sis_fb_info->node, ivideo->myid, VER_MAJOR, VER_MINOR, VER_LEVEL);
 
                printk(KERN_INFO "sisfb: Copyright (C) 2001-2005 Thomas Winischhofer\n");
 
@@ -6727,11 +6586,7 @@ static void __devexit sisfb_remove(struct pci_dev *pdev)
        /* Unregister the framebuffer */
        if(ivideo->registered) {
                unregister_framebuffer(sis_fb_info);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,3))
                framebuffer_release(sis_fb_info);
-#else
-               kfree(sis_fb_info);
-#endif
        }
 
        /* OK, our ivideo is gone for good from here. */
@@ -6757,7 +6612,6 @@ static struct pci_driver sisfb_driver = {
 
 SISINITSTATIC int __init sisfb_init(void)
 {
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,8)
 #ifndef MODULE
        char *options = NULL;
 
@@ -6765,16 +6619,13 @@ SISINITSTATIC int __init sisfb_init(void)
                return -ENODEV;
 
        sisfb_setup(options);
-#endif
 #endif
        return pci_register_driver(&sisfb_driver);
 }
 
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,8)
 #ifndef MODULE
 module_init(sisfb_init);
 #endif
-#endif
 
 /*****************************************************/
 /*                      MODULE                       */
@@ -6794,9 +6645,6 @@ static int                pdc1 = -1;
 static int             noaccel = -1;
 static int             noypan  = -1;
 static int             nomax = -1;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-static int             inverse = 0;
-#endif
 static int             userom = -1;
 static int             useoem = -1;
 static char            *tvstandard = NULL;
@@ -6829,9 +6677,9 @@ static int __init sisfb_init_module(void)
                sisfb_search_tvstd(tvstandard);
 
        if(mode)
-               sisfb_search_mode(mode, FALSE);
+               sisfb_search_mode(mode, false);
        else if(vesa != -1)
-               sisfb_search_vesamode(vesa, FALSE);
+               sisfb_search_vesamode(vesa, false);
 
        sisfb_crt1off = (crt1off == 0) ? 1 : 0;
 
@@ -6856,10 +6704,6 @@ static int __init sisfb_init_module(void)
        else if(nomax == 0)
                sisfb_max = 1;
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-       if(inverse) sisfb_inverse = 1;
-#endif
-
        if(mem)
                sisfb_parm_mem = mem;
 
@@ -6908,35 +6752,6 @@ MODULE_DESCRIPTION("SiS 300/540/630/730/315/55x/65x/661/74x/330/76x/34x, XGI V3X
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Thomas Winischhofer <thomas@winischhofer.net>, Others");
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-MODULE_PARM(mem, "i");
-MODULE_PARM(noaccel, "i");
-MODULE_PARM(noypan, "i");
-MODULE_PARM(nomax, "i");
-MODULE_PARM(userom, "i");
-MODULE_PARM(useoem, "i");
-MODULE_PARM(mode, "s");
-MODULE_PARM(vesa, "i");
-MODULE_PARM(rate, "i");
-MODULE_PARM(forcecrt1, "i");
-MODULE_PARM(forcecrt2type, "s");
-MODULE_PARM(scalelcd, "i");
-MODULE_PARM(pdc, "i");
-MODULE_PARM(pdc1, "i");
-MODULE_PARM(specialtiming, "s");
-MODULE_PARM(lvdshl, "i");
-MODULE_PARM(tvstandard, "s");
-MODULE_PARM(tvxposoffset, "i");
-MODULE_PARM(tvyposoffset, "i");
-MODULE_PARM(nocrt2rate, "i");
-MODULE_PARM(inverse, "i");
-#if !defined(__i386__) && !defined(__x86_64__)
-MODULE_PARM(resetcard, "i");
-MODULE_PARM(videoram, "i");
-#endif
-#endif
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
 module_param(mem, int, 0);
 module_param(noaccel, int, 0);
 module_param(noypan, int, 0);
@@ -6961,18 +6776,7 @@ module_param(nocrt2rate, int, 0);
 module_param(resetcard, int, 0);
 module_param(videoram, int, 0);
 #endif
-#endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-MODULE_PARM_DESC(mem,
-       "\nDetermines the beginning of the video memory heap in KB. This heap is used\n"
-         "for video RAM management for eg. DRM/DRI. On 300 series, the default depends\n"
-         "on the amount of video RAM available. If 8MB of video RAM or less is available,\n"
-         "the heap starts at 4096KB, if between 8 and 16MB are available at 8192KB,\n"
-         "otherwise at 12288KB. On 315/330/340 series, the heap size is 32KB by default.\n"
-         "The value is to be specified without 'KB' and must match the MaxXFBMem setting\n"
-         "for XFree86 4.x/X.org 6.7 and later.\n");
-#else
 MODULE_PARM_DESC(mem,
        "\nDetermines the beginning of the video memory heap in KB. This heap is used\n"
          "for video RAM management for eg. DRM/DRI. On 300 series, the default depends\n"
@@ -6980,7 +6784,6 @@ MODULE_PARM_DESC(mem,
          "the heap starts at 4096KB, if between 8 and 16MB are available at 8192KB,\n"
          "otherwise at 12288KB. On 315/330/340 series, the heap size is 32KB by default.\n"
          "The value is to be specified without 'KB'.\n");
-#endif
 
 MODULE_PARM_DESC(noaccel,
        "\nIf set to anything other than 0, 2D acceleration will be disabled.\n"
@@ -6997,23 +6800,6 @@ MODULE_PARM_DESC(nomax,
          "enable the user to positively specify a virtual Y size of the screen using\n"
          "fbset. (default: 0)\n");
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-MODULE_PARM_DESC(mode,
-       "\nSelects the desired display mode in the format [X]x[Y]x[Depth], eg.\n"
-         "1024x768x16. Other formats supported include XxY-Depth and\n"
-         "XxY-Depth@Rate. If the parameter is only one (decimal or hexadecimal)\n"
-         "number, it will be interpreted as a VESA mode number. (default: none if\n"
-         "sisfb is a module; this leaves the console untouched and the driver will\n"
-         "only do the video memory management for eg. DRM/DRI; 800x600x8 if sisfb\n"
-         "is in the kernel)\n");
-MODULE_PARM_DESC(vesa,
-       "\nSelects the desired display mode by VESA defined mode number, eg. 0x117\n"
-         "(default: 0x0000 if sisfb is a module; this leaves the console untouched\n"
-         "and the driver will only do the video memory management for eg. DRM/DRI;\n"
-         "0x0103 if sisfb is in the kernel)\n");
-#endif
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
 MODULE_PARM_DESC(mode,
        "\nSelects the desired default display mode in the format XxYxDepth,\n"
         "eg. 1024x768x16. Other formats supported include XxY-Depth and\n"
@@ -7023,7 +6809,6 @@ MODULE_PARM_DESC(mode,
 MODULE_PARM_DESC(vesa,
        "\nSelects the desired default display mode by VESA defined mode number, eg.\n"
         "0x117 (default: 0x0103)\n");
-#endif
 
 MODULE_PARM_DESC(rate,
        "\nSelects the desired vertical refresh rate for CRT1 (external VGA) in Hz.\n"
@@ -7089,12 +6874,6 @@ MODULE_PARM_DESC(nocrt2rate,
        "\nSetting this to 1 will force the driver to use the default refresh rate for\n"
          "CRT2 if CRT2 type is VGA. (default: 0, use same rate as CRT1)\n");
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-MODULE_PARM_DESC(inverse,
-       "\nSetting this to anything but 0 should invert the display colors, but this\n"
-         "does not seem to work. (default: 0)\n");
-#endif
-
 #if !defined(__i386__) && !defined(__x86_64__)
 #ifdef CONFIG_FB_SIS_300
 MODULE_PARM_DESC(resetcard,