/* * linux/drivers/video/vga16.c -- VGA 16-color framebuffer driver * * Copyright 1999 Ben Pfaff <pfaffben@debian.org> and Petr Vandrovec <VANDROVE@vc.cvut.cz> * Based on VGA info at http://www.goodnet.com/~tinara/FreeVGA/home.htm * Based on VESA framebuffer (c) 1998 Gerd Knorr <kraxel@goldbach.in-berlin.de> * * This file is subject to the terms and conditions of the GNU General * Public License. See the file COPYING in the main directory of this * archive for more details. */#include<linux/module.h>#include<linux/kernel.h>#include<linux/errno.h>#include<linux/string.h>#include<linux/mm.h>#include<linux/tty.h>#include<linux/slab.h>#include<linux/delay.h>#include<linux/fb.h>#include<linux/ioport.h>#include<linux/init.h>#include<asm/io.h>#include<video/vga.h>#define GRAPHICS_ADDR_REG VGA_GFX_I /* Graphics address register. */#define GRAPHICS_DATA_REG VGA_GFX_D /* Graphics data register. */#define SET_RESET_INDEX VGA_GFX_SR_VALUE /* Set/Reset Register index. */#define ENABLE_SET_RESET_INDEX VGA_GFX_SR_ENABLE /* Enable Set/Reset Register index. */#define DATA_ROTATE_INDEX VGA_GFX_DATA_ROTATE /* Data Rotate Register index. */#define GRAPHICS_MODE_INDEX VGA_GFX_MODE /* Graphics Mode Register index. */#define BIT_MASK_INDEX VGA_GFX_BIT_MASK /* Bit Mask Register index. */#define dac_reg (VGA_PEL_IW)#define dac_val (VGA_PEL_D)#define VGA_FB_PHYS 0xA0000#define VGA_FB_PHYS_LEN 65536#define MODE_SKIP4 1#define MODE_8BPP 2#define MODE_CFB 4#define MODE_TEXT 8/* --------------------------------------------------------------------- *//* * card parameters */staticstructfb_infovga16fb;staticstructvga16fb_par{/* structure holding original VGA register settings when the screen is blanked */struct{unsignedcharSeqCtrlIndex;/* Sequencer Index reg. */unsignedcharCrtCtrlIndex;/* CRT-Contr. Index reg. */unsignedcharCrtMiscIO;/* Miscellaneous register */unsignedcharHorizontalTotal;/* CRT-Controller:00h */unsignedcharHorizDisplayEnd;/* CRT-Controller:01h */unsignedcharStartHorizRetrace;/* CRT-Controller:04h */unsignedcharEndHorizRetrace;/* CRT-Controller:05h */unsignedcharOverflow;/* CRT-Controller:07h */unsignedcharStartVertRetrace;/