X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fvideo%2Fvesafb.c;h=8982e540214c56b2de7d0299ce8c15258d76fc83;hb=fe69102188cde0700cddd8d4cda0b77d68284884;hp=e25eae1a78c1de86e9f1f7f25103c12708c63a38;hpb=e532c37858fdcc18e9a91d24c2e22cd21aa22561;p=linux-2.6 diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c index e25eae1a78..8982e54021 100644 --- a/drivers/video/vesafb.c +++ b/drivers/video/vesafb.c @@ -57,7 +57,6 @@ static unsigned short *pmi_base = NULL; static void (*pmi_start)(void); static void (*pmi_pal)(void); static int depth; -static int vga_compat; /* --------------------------------------------------------------------- */ @@ -67,15 +66,6 @@ static int vesafb_pan_display(struct fb_var_screeninfo *var, #ifdef __i386__ int offset; - if (!ypan) - return -EINVAL; - if (var->xoffset) - return -EINVAL; - if (var->yoffset > var->yres_virtual) - return -EINVAL; - if ((ypan==1) && var->yoffset+var->yres > var->yres_virtual) - return -EINVAL; - offset = (var->yoffset * info->fix.line_length + var->xoffset) / 4; __asm__ __volatile__( @@ -90,37 +80,6 @@ static int vesafb_pan_display(struct fb_var_screeninfo *var, return 0; } -static int vesafb_blank(int blank, struct fb_info *info) -{ - int err = 1; - - if (vga_compat) { - int loop = 10000; - u8 seq = 0, crtc17 = 0; - - if (blank == FB_BLANK_POWERDOWN) { - seq = 0x20; - crtc17 = 0x00; - err = 0; - } else { - seq = 0x00; - crtc17 = 0x80; - err = (blank == FB_BLANK_UNBLANK) ? 0 : -EINVAL; - } - - vga_wseq(NULL, 0x00, 0x01); - seq |= vga_rseq(NULL, 0x01) & ~0x20; - vga_wseq(NULL, 0x00, seq); - - crtc17 |= vga_rcrt(NULL, 0x17) & ~0x80; - while (loop--); - vga_wcrt(NULL, 0x17, crtc17); - vga_wseq(NULL, 0x00, 0x03); - } - - return err; -} - static void vesa_setpalette(int regno, unsigned red, unsigned green, unsigned blue) { @@ -205,7 +164,6 @@ static struct fb_ops vesafb_ops = { .owner = THIS_MODULE, .fb_setcolreg = vesafb_setcolreg, .fb_pan_display = vesafb_pan_display, - .fb_blank = vesafb_blank, .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, @@ -245,9 +203,8 @@ static int __init vesafb_setup(char *options) return 0; } -static int __init vesafb_probe(struct device *device) +static int __init vesafb_probe(struct platform_device *dev) { - struct platform_device *dev = to_platform_device(device); struct fb_info *info; int i, err; unsigned int size_vmode; @@ -414,6 +371,7 @@ static int __init vesafb_probe(struct device *device) * region already (FIXME) */ request_region(0x3c0, 32, "vesafb"); +#ifdef CONFIG_MTRR if (mtrr) { unsigned int temp_size = size_total; unsigned int type = 0; @@ -451,6 +409,7 @@ static int __init vesafb_probe(struct device *device) } while (temp_size >= PAGE_SIZE && rc == -EINVAL); } } +#endif info->fbops = &vesafb_ops; info->var = vesafb_defined; @@ -458,9 +417,8 @@ static int __init vesafb_probe(struct device *device) info->flags = FBINFO_FLAG_DEFAULT | (ypan) ? FBINFO_HWACCEL_YPAN : 0; - vga_compat = (screen_info.capabilities & 2) ? 0 : 1; - printk("vesafb: Mode is %sVGA compatible\n", - (vga_compat) ? "" : "not "); + if (!ypan) + info->fbops->fb_pan_display = NULL; if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) { err = -ENOMEM; @@ -480,10 +438,11 @@ err: return err; } -static struct device_driver vesafb_driver = { - .name = "vesafb", - .bus = &platform_bus_type, +static struct platform_driver vesafb_driver = { .probe = vesafb_probe, + .driver = { + .name = "vesafb", + }, }; static struct platform_device vesafb_device = { @@ -498,12 +457,12 @@ static int __init vesafb_init(void) /* ignore error return of fb_get_options */ fb_get_options("vesafb", &option); vesafb_setup(option); - ret = driver_register(&vesafb_driver); + ret = platform_driver_register(&vesafb_driver); if (!ret) { ret = platform_device_register(&vesafb_device); if (ret) - driver_unregister(&vesafb_driver); + platform_driver_unregister(&vesafb_driver); } return ret; }