--- linux-vr-decvs/drivers/video/vr4181fb.c.old Sun Jun 10 18:53:55 2001 +++ linux-vr-decvs/drivers/video/vr4181fb.c Sun Jun 10 18:59:45 2001 @@ -35,6 +35,31 @@ // #define VR4181FB_DEBUG KERN_INFO +#ifdef MODULE +static char *font= NULL; +static int xres= 0; +static int yres= 0; +static int bpp= 0; +static int gray= 0; +static int inv= 0; +static int hpck= 0; + +MODULE_PARM(xres, "i"); +MODULE_PARM_DESC(xres, "horizontal resolution"); +MODULE_PARM(yres, "i"); +MODULE_PARM_DESC(yres, "vertical resolution"); +MODULE_PARM(bpp, "i"); +MODULE_PARM_DESC(bpp, "color depth"); +MODULE_PARM(font, "s"); +MODULE_PARM_DESC(font, "default font (4x6 recommended)"); +MODULE_PARM(gray, "i"); +MODULE_PARM_DESC(gray, "set to 1 unless using a color display"); +MODULE_PARM(inv, "i"); +MODULE_PARM_DESC(inv, "inverse screen (white on black)"); +MODULE_PARM(hpck, "i"); +MODULE_PARM_DESC(hpck, "VR41XX_LCDCFGREG1?"); +#endif + #define DEVICE_NAME "vr4181fb" #define VR4181FB_XRES_MAX 320 @@ -735,6 +760,36 @@ } return 0; } +# else +int __init vr4181fb_setup() +{ + +#ifdef VR4181FB_DEBUG + printk(VR4181FB_DEBUG DEVICE_NAME ": vr4181fb_setup\n"); +#endif + + + my_fb_info.fontname[0] = '\0'; + + + if (xres) + var_def.xres = var_def.xres_virtual = xres; + if (yres) + var_def.yres = var_def.yres_virtual = yres; + if (bpp) + var_def.bits_per_pixel = bpp; + if (font) + strncpy(my_fb_info.fontname, font, sizeof(my_fb_info.fontname)-1); + if (gray) + var_def.grayscale = 1; + if (inv) + // No "inverse" in fb_var_screeninfo, so use separate global. + inverse_def = 1; + if (hpck) + // HACK: store hpck setting in pixclock. + var_def.pixclock = hpck; + return 0; +} #endif #ifdef CONFIG_PM @@ -820,6 +875,7 @@ { static int contrast_save; + // Exported for fbmem.c for compiled-in frame buffer driver. switch (rqst) { case PM_SUSPEND: #ifdef VR4181FB_DEBUG @@ -873,8 +929,10 @@ return 0; } +#ifndef MODULE __initcall(vr4181fb_pm_init); #endif +#endif static struct fb_ops my_fb_ops = { owner: THIS_MODULE, @@ -901,7 +959,10 @@ printk(VR4181FB_DEBUG DEVICE_NAME ": initializing\n"); #endif - +#ifdef MODULE + vr4181fb_setup(); + vr4181fb_pm_init(); +#endif // Set up my_fb_info. strcpy(my_fb_info.modename, DEVICE_NAME); my_fb_info.changevar = NULL;