Import 2.4.0-test5pre6
[davej-history.git] / drivers / video / hgafb.c
blobd2b09416b4b881bf1b5000fb345c66cc6e8f4714
1 /*
2 * linux/drivers/video/hgafb.c -- Hercules graphics adaptor frame buffer device
3 *
4 * Created 25 Nov 1999 by Ferenc Bakonyi (fero@drama.obuda.kando.hu)
5 * Based on skeletonfb.c by Geert Uytterhoeven and
6 * mdacon.c by Andrew Apted
8 * History:
10 * - Revision 0.1.5 (13 Mar 2000): spinlocks instead of saveflags();cli();etc
11 * minor fixes
12 * - Revision 0.1.4 (24 Jan 2000): fixed a bug in hga_card_detect() for
13 * HGA-only systems
14 * - Revision 0.1.3 (22 Jan 2000): modified for the new fb_info structure
15 * screen is cleared after rmmod
16 * virtual resolutions
17 * kernel parameter 'video=hga:font:{fontname}'
18 * module parameter 'font={fontname}'
19 * module parameter 'nologo={0|1}'
20 * the most important: boot logo :)
21 * - Revision 0.1.0 (6 Dec 1999): faster scrolling and minor fixes
22 * - First release (25 Nov 1999)
24 * This file is subject to the terms and conditions of the GNU General Public
25 * License. See the file COPYING in the main directory of this archive
26 * for more details.
29 #include <linux/module.h>
30 #include <linux/kernel.h>
31 #include <linux/errno.h>
32 #include <linux/spinlock.h>
33 #include <linux/string.h>
34 #include <linux/mm.h>
35 #include <linux/tty.h>
36 #include <linux/malloc.h>
37 #include <linux/delay.h>
38 #include <linux/fb.h>
39 #include <linux/init.h>
40 #include <linux/ioport.h>
41 #include <asm/io.h>
42 #include <asm/vga.h>
43 #include <video/fbcon.h>
44 #include <video/fbcon-hga.h>
46 #ifdef MODULE
48 #define INCLUDE_LINUX_LOGOBW
49 #include <linux/linux_logo.h>
51 #endif /* MODULE */
53 #if 0
54 #define DPRINTK(args...) printk(KERN_DEBUG __FILE__": " ##args)
55 #else
56 #define DPRINTK(args...)
57 #endif
59 #if 0
60 #define CHKINFO(ret) if (info != &fb_info) { printk(KERN_DEBUG __FILE__": This should never happen, line:%d \n", __LINE__); return ret; }
61 #else
62 #define CHKINFO(ret)
63 #endif
65 /* Description of the hardware layout */
67 static unsigned long hga_vram_base; /* Base of video memory */
68 static unsigned long hga_vram_len; /* Size of video memory */
70 #define HGA_TXT 0
71 #define HGA_GFX 1
73 static int hga_mode = -1; /* 0 = txt, 1 = gfx mode */
75 static enum { TYPE_HERC, TYPE_HERCPLUS, TYPE_HERCCOLOR } hga_type;
76 static char *hga_type_name;
78 #define HGA_INDEX_PORT 0x3b4 /* Register select port */
79 #define HGA_VALUE_PORT 0x3b5 /* Register value port */
80 #define HGA_MODE_PORT 0x3b8 /* Mode control port */
81 #define HGA_STATUS_PORT 0x3ba /* Status and Config port */
82 #define HGA_GFX_PORT 0x3bf /* Graphics control port */
84 /* HGA register values */
86 #define HGA_CURSOR_BLINKING 0x00
87 #define HGA_CURSOR_OFF 0x20
88 #define HGA_CURSOR_SLOWBLINK 0x60
90 #define HGA_MODE_GRAPHICS 0x02
91 #define HGA_MODE_VIDEO_EN 0x08
92 #define HGA_MODE_BLINK_EN 0x20
93 #define HGA_MODE_GFX_PAGE1 0x80
95 #define HGA_STATUS_HSYNC 0x01
96 #define HGA_STATUS_VSYNC 0x80
97 #define HGA_STATUS_VIDEO 0x08
99 #define HGA_CONFIG_COL132 0x08
100 #define HGA_GFX_MODE_EN 0x01
101 #define HGA_GFX_PAGE_EN 0x02
103 /* Global locks */
105 spinlock_t hga_reg_lock = SPIN_LOCK_UNLOCKED;
107 /* Framebuffer driver structures */
109 static struct fb_var_screeninfo hga_default_var = {
110 720, 348, /* xres, yres */
111 720, 348, /* xres_virtual, yres_virtual */
112 0, 0, /* xoffset, yoffset */
113 1, /* bits_per_pixel */
114 0, /* grayscale */
115 {0, 1, 0}, /* red */
116 {0, 1, 0}, /* green */
117 {0, 1, 0}, /* blue */
118 {0, 0, 0}, /* transp */
119 0, /* nonstd (FB_NONSTD_HGA ?) */
120 0, /* activate */
121 -1, -1, /* height, width */
122 0, /* accel_flags */
123 /* pixclock */
124 /* left_margin, right_margin */
125 /* upper_margin, lower_margin */
126 /* hsync_len, vsync_len */
127 /* sync */
128 /* vmode */
131 static struct fb_fix_screeninfo hga_fix = {
132 "HGA", /* id */
133 (unsigned long) NULL, /* smem_start */
134 0, /* smem_len */
135 FB_TYPE_PACKED_PIXELS, /* type (not sure) */
136 0, /* type_aux (not sure) */
137 FB_VISUAL_MONO10, /* visual */
138 8, /* xpanstep */
139 8, /* ypanstep */
140 0, /* ywrapstep */
141 90, /* line_length */
142 0, /* mmio_start */
143 0, /* mmio_len */
144 FB_ACCEL_NONE /* accel */
147 static struct fb_info fb_info;
148 static struct display disp;
150 /* Don't assume that tty1 will be the initial current console. */
151 static int currcon = -1;
152 static int release_io_port = 0;
153 static int release_io_ports = 0;
155 #ifdef MODULE
156 static char *font = NULL;
157 static int nologo = 0;
158 #endif
160 /* -------------------------------------------------------------------------
162 * Low level hardware functions
164 * ------------------------------------------------------------------------- */
166 static void write_hga_b(unsigned int val, unsigned char reg)
168 outb_p(reg, HGA_INDEX_PORT);
169 outb_p(val, HGA_VALUE_PORT);
172 static void write_hga_w(unsigned int val, unsigned char reg)
174 outb_p(reg, HGA_INDEX_PORT); outb_p(val >> 8, HGA_VALUE_PORT);
175 outb_p(reg+1, HGA_INDEX_PORT); outb_p(val & 0xff, HGA_VALUE_PORT);
178 static int test_hga_b(unsigned char val, unsigned char reg)
180 outb_p(reg, HGA_INDEX_PORT);
181 outb (val, HGA_VALUE_PORT);
182 udelay(20); val = (inb_p(HGA_VALUE_PORT) == val);
183 return val;
186 static void hga_clear_screen(void)
188 unsigned char fillchar = 0xbf; /* magic */
189 unsigned long flags;
191 spin_lock_irqsave(&hga_reg_lock, flags);
192 if (hga_mode == HGA_TXT)
193 fillchar = ' ';
194 else if (hga_mode == HGA_GFX)
195 fillchar = 0x00;
196 spin_unlock_irqrestore(&hga_reg_lock, flags);
197 if (fillchar != 0xbf)
198 memset((char *)hga_vram_base, fillchar, hga_vram_len);
202 #ifdef MODULE
203 static void hga_txt_mode(void)
205 unsigned long flags;
207 spin_lock_irqsave(&hga_reg_lock, flags);
208 outb_p(HGA_MODE_VIDEO_EN | HGA_MODE_BLINK_EN, HGA_MODE_PORT);
209 outb_p(0x00, HGA_GFX_PORT);
210 outb_p(0x00, HGA_STATUS_PORT);
212 write_hga_b(0x61, 0x00); /* horizontal total */
213 write_hga_b(0x50, 0x01); /* horizontal displayed */
214 write_hga_b(0x52, 0x02); /* horizontal sync pos */
215 write_hga_b(0x0f, 0x03); /* horizontal sync width */
217 write_hga_b(0x19, 0x04); /* vertical total */
218 write_hga_b(0x06, 0x05); /* vertical total adjust */
219 write_hga_b(0x19, 0x06); /* vertical displayed */
220 write_hga_b(0x19, 0x07); /* vertical sync pos */
222 write_hga_b(0x02, 0x08); /* interlace mode */
223 write_hga_b(0x0d, 0x09); /* maximum scanline */
224 write_hga_b(0x0c, 0x0a); /* cursor start */
225 write_hga_b(0x0d, 0x0b); /* cursor end */
227 write_hga_w(0x0000, 0x0c); /* start address */
228 write_hga_w(0x0000, 0x0e); /* cursor location */
230 hga_mode = HGA_TXT;
231 spin_unlock_irqrestore(&hga_reg_lock, flags);
233 #endif /* MODULE */
235 static void hga_gfx_mode(void)
237 unsigned long flags;
239 spin_lock_irqsave(&hga_reg_lock, flags);
240 outb_p(0x00, HGA_STATUS_PORT);
241 outb_p(HGA_GFX_MODE_EN, HGA_GFX_PORT);
242 outb_p(HGA_MODE_VIDEO_EN | HGA_MODE_GRAPHICS, HGA_MODE_PORT);
244 write_hga_b(0x35, 0x00); /* horizontal total */
245 write_hga_b(0x2d, 0x01); /* horizontal displayed */
246 write_hga_b(0x2e, 0x02); /* horizontal sync pos */
247 write_hga_b(0x07, 0x03); /* horizontal sync width */
249 write_hga_b(0x5b, 0x04); /* vertical total */
250 write_hga_b(0x02, 0x05); /* vertical total adjust */
251 write_hga_b(0x57, 0x06); /* vertical displayed */
252 write_hga_b(0x57, 0x07); /* vertical sync pos */
254 write_hga_b(0x02, 0x08); /* interlace mode */
255 write_hga_b(0x03, 0x09); /* maximum scanline */
256 write_hga_b(0x00, 0x0a); /* cursor start */
257 write_hga_b(0x00, 0x0b); /* cursor end */
259 write_hga_w(0x0000, 0x0c); /* start address */
260 write_hga_w(0x0000, 0x0e); /* cursor location */
262 hga_mode = HGA_GFX;
263 spin_unlock_irqrestore(&hga_reg_lock, flags);
266 #ifdef MODULE
267 static void hga_show_logo(void)
269 int x, y;
270 char *dest = (char *)hga_vram_base;
271 char *logo = linux_logo_bw;
272 for (y = 134; y < 134 + 80 ; y++) /* this needs some cleanup */
273 for (x = 0; x < 10 ; x++)
274 *(dest + (y%4)*8192 + (y>>2)*90 + x + 40) = ~*(logo++);
276 #endif /* MODULE */
278 static void hga_pan(unsigned int xoffset, unsigned int yoffset)
280 unsigned int base;
281 unsigned long flags;
283 base = (yoffset / 8) * 90 + xoffset;
284 spin_lock_irqsave(&hga_reg_lock, flags);
285 write_hga_w(base, 0x0c); /* start address */
286 spin_unlock_irqrestore(&hga_reg_lock, flags);
287 DPRINTK("hga_pan: base:%d\n", base);
290 static void hga_blank(int blank_mode)
292 unsigned long flags;
294 spin_lock_irqsave(&hga_reg_lock, flags);
295 if (blank_mode) {
296 outb_p(0x00, HGA_MODE_PORT); /* disable video */
297 } else {
298 outb_p(HGA_MODE_VIDEO_EN | HGA_MODE_GRAPHICS, HGA_MODE_PORT);
300 spin_unlock_irqrestore(&hga_reg_lock, flags);
303 static int __init hga_card_detect(void)
305 int count=0;
306 u16 *p, p_save;
307 u16 *q, q_save;
309 hga_vram_base = VGA_MAP_MEM(0xb0000);
310 hga_vram_len = 0x08000;
312 if (request_region(0x3b0, 12, "hgafb"))
313 release_io_ports = 1;
314 if (request_region(0x3bf, 1, "hgafb"))
315 release_io_port = 1;
317 /* do a memory check */
319 p = (u16 *) hga_vram_base;
320 q = (u16 *) (hga_vram_base + 0x01000);
322 p_save = scr_readw(p); q_save = scr_readw(q);
324 scr_writew(0xaa55, p); if (scr_readw(p) == 0xaa55) count++;
325 scr_writew(0x55aa, p); if (scr_readw(p) == 0x55aa) count++;
326 scr_writew(p_save, p);
328 if (count != 2) {
329 return 0;
332 /* Ok, there is definitely a card registering at the correct
333 * memory location, so now we do an I/O port test.
336 if (!test_hga_b(0x66, 0x0f)) { /* cursor low register */
337 return 0;
339 if (!test_hga_b(0x99, 0x0f)) { /* cursor low register */
340 return 0;
343 /* See if the card is a Hercules, by checking whether the vsync
344 * bit of the status register is changing. This test lasts for
345 * approximately 1/10th of a second.
348 p_save = q_save = inb_p(HGA_STATUS_PORT) & HGA_STATUS_VSYNC;
350 for (count=0; count < 50000 && p_save == q_save; count++) {
351 q_save = inb(HGA_STATUS_PORT) & HGA_STATUS_VSYNC;
352 udelay(2);
355 if (p_save != q_save) {
356 switch (inb_p(HGA_STATUS_PORT) & 0x70) {
357 case 0x10:
358 hga_type = TYPE_HERCPLUS;
359 hga_type_name = "HerculesPlus";
360 break;
361 case 0x50:
362 hga_type = TYPE_HERCCOLOR;
363 hga_type_name = "HerculesColor";
364 break;
365 default:
366 hga_type = TYPE_HERC;
367 hga_type_name = "Hercules";
368 break;
371 return 1;
374 /* ------------------------------------------------------------------------- *
376 * dispsw functions
378 * ------------------------------------------------------------------------- */
381 * Get the Fixed Part of the Display
384 int hga_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *info)
386 CHKINFO(-EINVAL);
387 DPRINTK("hga_get_fix: con:%d, info:%x, fb_info:%x\n", con, (unsigned)info, (unsigned)&fb_info);
389 *fix = info->fix;
390 return 0;
395 * Get the User Defined Part of the Display
398 int hga_get_var(struct fb_var_screeninfo *var, int con, struct fb_info *info)
400 CHKINFO(-EINVAL);
401 DPRINTK("hga_get_var: con:%d, info:%x, fb_info:%x\n", con, (unsigned)info, (unsigned)&fb_info);
403 *var = info->var;
404 return 0;
408 * Set the User Defined Part of the Display
409 * This is the most mystical function (at least for me).
410 * What is the exact specification of xxx_set_var?
411 * Should it handle xoffset, yoffset? Should it do pannig?
412 * What does vmode mean?
415 int hga_set_var(struct fb_var_screeninfo *var, int con, struct fb_info *info)
417 CHKINFO(-EINVAL);
418 DPRINTK("hga_set_var: con:%d, activate:%x, info:0x%x, fb_info:%x\n", con, var->activate, (unsigned)info, (unsigned)&fb_info);
420 if (var->xres != 720 || var->yres != 348 ||
421 var->xres_virtual != 720 ||
422 var->yres_virtual < 348 || var->yres_virtual > 348 + 16 ||
423 var->bits_per_pixel != 1 || var->grayscale != 0) {
424 return -EINVAL;
426 if ((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) {
427 info->var = *var;
428 if (info->changevar)
429 (*info->changevar)(con);
431 return 0;
436 * Get the Colormap
439 static int hga_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue,
440 u_int *transp, struct fb_info *info)
442 if (regno == 0) {
443 *red = *green = *blue = 0x0000;
444 *transp = 0;
445 } else if (regno == 1) {
446 *red = *green = *blue = 0xaaaa;
447 *transp = 0;
448 } else
449 return 1;
450 return 0;
453 int hga_get_cmap(struct fb_cmap *cmap, int kspc, int con,
454 struct fb_info *info)
456 CHKINFO(-EINVAL);
457 DPRINTK("hga_get_cmap: con:%d\n", con);
458 return fb_get_cmap(cmap, kspc, hga_getcolreg, info);
462 * Set the Colormap
465 static int hga_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
466 u_int transp, struct fb_info *info)
468 if (regno > 1)
469 return 1;
470 return 0;
473 int hga_set_cmap(struct fb_cmap *cmap, int kspc, int con,
474 struct fb_info *info)
476 CHKINFO(-EINVAL);
477 DPRINTK("hga_set_cmap: con:%d\n", con);
478 return fb_set_cmap(cmap, kspc, hga_setcolreg, info);
482 * Pan or Wrap the Display
484 * This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag
487 int hga_pan_display(struct fb_var_screeninfo *var, int con,
488 struct fb_info *info)
490 CHKINFO(-EINVAL);
491 DPRINTK("pan_disp: con:%d, wrap:%d, xoff:%d, yoff:%d\n", con, var->vmode & FB_VMODE_YWRAP, var->xoffset, var->yoffset);
493 if (var->vmode & FB_VMODE_YWRAP) {
494 if (var->yoffset < 0 ||
495 var->yoffset >= info->var.yres_virtual ||
496 var->xoffset)
497 return -EINVAL;
498 } else {
499 if (var->xoffset + var->xres > info->var.xres_virtual
500 || var->yoffset + var->yres > info->var.yres_virtual
501 || var->yoffset % 8)
502 return -EINVAL;
505 hga_pan(var->xoffset, var->yoffset);
507 info->var.xoffset = var->xoffset;
508 info->var.yoffset = var->yoffset;
509 if (var->vmode & FB_VMODE_YWRAP)
510 info->var.vmode |= FB_VMODE_YWRAP;
511 else
512 info->var.vmode &= ~FB_VMODE_YWRAP;
513 return 0;
517 static struct fb_ops hgafb_ops = {
518 owner: THIS_MODULE,
519 fb_get_fix: hga_get_fix,
520 fb_get_var: hga_get_var,
521 fb_set_var: hga_set_var,
522 fb_get_cmap: hga_get_cmap,
523 fb_set_cmap: hga_set_cmap,
524 fb_pan_display: hga_pan_display,
528 /* ------------------------------------------------------------------------- *
530 * Functions in fb_info
532 * ------------------------------------------------------------------------- */
534 static int hgafbcon_switch(int con, struct fb_info *info)
536 CHKINFO(-EINVAL);
537 DPRINTK("hgafbcon_switch: currcon:%d, con:%d, info:%x, fb_info:%x\n", currcon, con, (unsigned)info, (unsigned)&fb_info);
539 /* Save the colormap and video mode */
540 #if 0 /* Not necessary in hgafb, we use fixed colormap */
541 fb_copy_cmap(&info->cmap, &fb_display[currcon].cmap, 0);
542 #endif
544 if (currcon != -1) /* this check is absolute necessary! */
545 memcpy(&fb_display[currcon].var, &info->var,
546 sizeof(struct fb_var_screeninfo));
548 /* Install a new colormap and change the video mode. By default fbcon
549 * sets all the colormaps and video modes to the default values at
550 * bootup.
552 #if 0
553 fb_copy_cmap(&fb_display[con].cmap, &info->cmap, 0);
554 fb_set_cmap(&info->cmap, 1, hga_setcolreg, info);
555 #endif
557 memcpy(&info->var, &fb_display[con].var,
558 sizeof(struct fb_var_screeninfo));
559 /* hga_set_var(&info->var, con, &fb_info); is it necessary? */
560 currcon = con;
562 /* Hack to work correctly with XF86_Mono */
563 hga_gfx_mode();
564 return 0;
567 static int hgafbcon_updatevar(int con, struct fb_info *info)
569 CHKINFO(-EINVAL);
570 DPRINTK("hga_update_var: con:%d, info:%x, fb_info:%x\n", con, (unsigned)info, (unsigned)&fb_info);
571 return (con < 0) ? -EINVAL : hga_pan_display(&fb_display[con].var, con, info);
574 static void hgafbcon_blank(int blank_mode, struct fb_info *info)
577 * Blank the screen if blank_mode != 0, else unblank.
578 * Implements VESA suspend and powerdown modes on hardware
579 * that supports disabling hsync/vsync:
580 * blank_mode == 2: suspend vsync
581 * blank_mode == 3: suspend hsync
582 * blank_mode == 4: powerdown
585 CHKINFO( );
586 DPRINTK("hga_blank: blank_mode:%d, info:%x, fb_info:%x\n", blank_mode, (unsigned)info, (unsigned)&fb_info);
588 hga_blank(blank_mode);
592 /* ------------------------------------------------------------------------- */
595 * Initialization
598 int __init hgafb_init(void)
600 if (! hga_card_detect()) {
601 printk(KERN_ERR "hgafb: HGA card not detected.\n");
602 return -EINVAL;
605 printk(KERN_INFO "hgafb: %s with %ldK of memory detected.\n",
606 hga_type_name, hga_vram_len/1024);
608 hga_gfx_mode();
609 hga_clear_screen();
610 #ifdef MODULE
611 if (!nologo) hga_show_logo();
612 #endif /* MODULE */
614 hga_fix.smem_start = hga_vram_base;
615 hga_fix.smem_len = hga_vram_len;
617 disp.var = hga_default_var;
618 /* disp.cmap = ???; */
619 disp.screen_base = (char*)hga_fix.smem_start;
620 disp.visual = hga_fix.visual;
621 disp.type = hga_fix.type;
622 disp.type_aux = hga_fix.type_aux;
623 disp.ypanstep = hga_fix.ypanstep;
624 disp.ywrapstep = hga_fix.ywrapstep;
625 disp.line_length = hga_fix.line_length;
626 disp.can_soft_blank = 1;
627 disp.inverse = 0;
628 #ifdef FBCON_HAS_HGA
629 disp.dispsw = &fbcon_hga;
630 #else
631 #warning HGAFB will not work as a console!
632 disp.dispsw = &fbcon_dummy;
633 #endif
634 disp.dispsw_data = NULL;
636 disp.scrollmode = SCROLL_YREDRAW;
638 strcpy (fb_info.modename, hga_fix.id);
639 fb_info.node = -1;
640 fb_info.flags = FBINFO_FLAG_DEFAULT;
641 /* fb_info.open = ??? */
642 fb_info.var = hga_default_var;
643 fb_info.fix = hga_fix;
644 fb_info.monspecs.hfmin = 0;
645 fb_info.monspecs.hfmax = 0;
646 fb_info.monspecs.vfmin = 10000;
647 fb_info.monspecs.vfmax = 10000;
648 fb_info.monspecs.dpms = 0;
649 fb_info.fbops = &hgafb_ops;
650 fb_info.screen_base = (char *)hga_fix.smem_start;
651 fb_info.disp = &disp;
652 /* fb_info.display_fg = ??? */
653 /* fb_info.fontname initialized later */
654 fb_info.changevar = NULL;
655 fb_info.switch_con = hgafbcon_switch;
656 fb_info.updatevar = hgafbcon_updatevar;
657 fb_info.blank = hgafbcon_blank;
658 fb_info.pseudo_palette = NULL; /* ??? */
659 fb_info.par = NULL;
661 if (register_framebuffer(&fb_info) < 0)
662 return -EINVAL;
664 printk(KERN_INFO "fb%d: %s frame buffer device\n",
665 GET_FB_IDX(fb_info.node), fb_info.modename);
667 return 0;
671 * Setup
674 #ifndef MODULE
675 int __init hgafb_setup(char *options)
678 * Parse user speficied options
679 * `video=hga:font:VGA8x16' or
680 * `video=hga:font:SUN8x16' recommended
681 * Other supported fonts: VGA8x8, Acorn8x8, PEARL8x8
682 * More different fonts can be used with the `setfont' utility.
685 char *this_opt;
687 fb_info.fontname[0] = '\0';
689 if (!options || !*options)
690 return 0;
692 for (this_opt = strtok(options, ","); this_opt;
693 this_opt = strtok(NULL, ",")) {
694 if (!strncmp(this_opt, "font:", 5))
695 strcpy(fb_info.fontname, this_opt+5);
697 return 0;
699 #endif /* !MODULE */
703 * Cleanup
706 #ifdef MODULE
707 static void hgafb_cleanup(struct fb_info *info)
709 hga_txt_mode();
710 hga_clear_screen();
711 unregister_framebuffer(info);
712 if (release_io_ports) release_region(0x3b0, 12);
713 if (release_io_port) release_region(0x3bf, 1);
715 #endif /* MODULE */
719 /* -------------------------------------------------------------------------
721 * Modularization
723 * ------------------------------------------------------------------------- */
725 #ifdef MODULE
726 int init_module(void)
728 if (font)
729 strncpy(fb_info.fontname, font, sizeof(fb_info.fontname)-1);
730 else
731 fb_info.fontname[0] = '\0';
733 return hgafb_init();
736 void cleanup_module(void)
738 hgafb_cleanup(&fb_info);
741 MODULE_AUTHOR("Ferenc Bakonyi (fero@drama.obuda.kando.hu)");
742 MODULE_DESCRIPTION("FBDev driver for Hercules Graphics Adaptor");
744 MODULE_PARM(font, "s");
745 MODULE_PARM_DESC(font, "Specifies one of the compiled-in fonts (VGA8x8, VGA8x16, SUN8x16, Acorn8x8, PEARL8x8) (default=none)");
746 MODULE_PARM(nologo, "i");
747 MODULE_PARM_DESC(nologo, "Disables startup logo if != 0 (default=0)");
749 #endif /* MODULE */