hgafb.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  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
  7. *
  8. * History:
  9. *
  10. * - Revision 0.1.8 (23 Oct 2002): Ported to new framebuffer api.
  11. *
  12. * - Revision 0.1.7 (23 Jan 2001): fix crash resulting from MDA only cards
  13. * being detected as Hercules. (Paul G.)
  14. * - Revision 0.1.6 (17 Aug 2000): new style structs
  15. * documentation
  16. * - Revision 0.1.5 (13 Mar 2000): spinlocks instead of saveflags();cli();etc
  17. * minor fixes
  18. * - Revision 0.1.4 (24 Jan 2000): fixed a bug in hga_card_detect() for
  19. * HGA-only systems
  20. * - Revision 0.1.3 (22 Jan 2000): modified for the new fb_info structure
  21. * screen is cleared after rmmod
  22. * virtual resolutions
  23. * module parameter 'nologo={0|1}'
  24. * the most important: boot logo :)
  25. * - Revision 0.1.0 (6 Dec 1999): faster scrolling and minor fixes
  26. * - First release (25 Nov 1999)
  27. *
  28. * This file is subject to the terms and conditions of the GNU General Public
  29. * License. See the file COPYING in the main directory of this archive
  30. * for more details.
  31. */
  32. #include <linux/module.h>
  33. #include <linux/kernel.h>
  34. #include <linux/errno.h>
  35. #include <linux/spinlock.h>
  36. #include <linux/string.h>
  37. #include <linux/mm.h>
  38. #include <linux/tty.h>
  39. #include <linux/slab.h>
  40. #include <linux/delay.h>
  41. #include <linux/fb.h>
  42. #include <linux/init.h>
  43. #include <linux/ioport.h>
  44. #include <linux/platform_device.h>
  45. #include <asm/io.h>
  46. #include <asm/vga.h>
  47. #if 0
  48. #define DPRINTK(args...) printk(KERN_DEBUG __FILE__": " ##args)
  49. #else
  50. #define DPRINTK(args...)
  51. #endif
  52. #if 0
  53. #define CHKINFO(ret) if (info != &fb_info) { printk(KERN_DEBUG __FILE__": This should never happen, line:%d \n", __LINE__); return ret; }
  54. #else
  55. #define CHKINFO(ret)
  56. #endif
  57. /* Description of the hardware layout */
  58. static void __iomem *hga_vram; /* Base of video memory */
  59. static unsigned long hga_vram_len; /* Size of video memory */
  60. #define HGA_ROWADDR(row) ((row%4)*8192 + (row>>2)*90)
  61. #define HGA_TXT 0
  62. #define HGA_GFX 1
  63. static inline u8 __iomem * rowaddr(struct fb_info *info, u_int row)
  64. {
  65. return info->screen_base + HGA_ROWADDR(row);
  66. }
  67. static int hga_mode = -1; /* 0 = txt, 1 = gfx mode */
  68. static enum { TYPE_HERC, TYPE_HERCPLUS, TYPE_HERCCOLOR } hga_type;
  69. static char *hga_type_name;
  70. #define HGA_INDEX_PORT 0x3b4 /* Register select port */
  71. #define HGA_VALUE_PORT 0x3b5 /* Register value port */
  72. #define HGA_MODE_PORT 0x3b8 /* Mode control port */
  73. #define HGA_STATUS_PORT 0x3ba /* Status and Config port */
  74. #define HGA_GFX_PORT 0x3bf /* Graphics control port */
  75. /* HGA register values */
  76. #define HGA_CURSOR_BLINKING 0x00
  77. #define HGA_CURSOR_OFF 0x20
  78. #define HGA_CURSOR_SLOWBLINK 0x60
  79. #define HGA_MODE_GRAPHICS 0x02
  80. #define HGA_MODE_VIDEO_EN 0x08
  81. #define HGA_MODE_BLINK_EN 0x20
  82. #define HGA_MODE_GFX_PAGE1 0x80
  83. #define HGA_STATUS_HSYNC 0x01
  84. #define HGA_STATUS_VSYNC 0x80
  85. #define HGA_STATUS_VIDEO 0x08
  86. #define HGA_CONFIG_COL132 0x08
  87. #define HGA_GFX_MODE_EN 0x01
  88. #define HGA_GFX_PAGE_EN 0x02
  89. /* Global locks */
  90. static DEFINE_SPINLOCK(hga_reg_lock);
  91. /* Framebuffer driver structures */
  92. static struct fb_var_screeninfo __initdata hga_default_var = {
  93. .xres = 720,
  94. .yres = 348,
  95. .xres_virtual = 720,
  96. .yres_virtual = 348,
  97. .bits_per_pixel = 1,
  98. .red = {0, 1, 0},
  99. .green = {0, 1, 0},
  100. .blue = {0, 1, 0},
  101. .transp = {0, 0, 0},
  102. .height = -1,
  103. .width = -1,
  104. };
  105. static struct fb_fix_screeninfo __initdata hga_fix = {
  106. .id = "HGA",
  107. .type = FB_TYPE_PACKED_PIXELS, /* (not sure) */
  108. .visual = FB_VISUAL_MONO10,
  109. .xpanstep = 8,
  110. .ypanstep = 8,
  111. .line_length = 90,
  112. .accel = FB_ACCEL_NONE
  113. };
  114. /* Don't assume that tty1 will be the initial current console. */
  115. static int release_io_port = 0;
  116. static int release_io_ports = 0;
  117. static int nologo = 0;
  118. /* -------------------------------------------------------------------------
  119. *
  120. * Low level hardware functions
  121. *
  122. * ------------------------------------------------------------------------- */
  123. static void write_hga_b(unsigned int val, unsigned char reg)
  124. {
  125. outb_p(reg, HGA_INDEX_PORT);
  126. outb_p(val, HGA_VALUE_PORT);
  127. }
  128. static void write_hga_w(unsigned int val, unsigned char reg)
  129. {
  130. outb_p(reg, HGA_INDEX_PORT); outb_p(val >> 8, HGA_VALUE_PORT);
  131. outb_p(reg+1, HGA_INDEX_PORT); outb_p(val & 0xff, HGA_VALUE_PORT);
  132. }
  133. static int test_hga_b(unsigned char val, unsigned char reg)
  134. {
  135. outb_p(reg, HGA_INDEX_PORT);
  136. outb (val, HGA_VALUE_PORT);
  137. udelay(20); val = (inb_p(HGA_VALUE_PORT) == val);
  138. return val;
  139. }
  140. static void hga_clear_screen(void)
  141. {
  142. unsigned char fillchar = 0xbf; /* magic */
  143. unsigned long flags;
  144. spin_lock_irqsave(&hga_reg_lock, flags);
  145. if (hga_mode == HGA_TXT)
  146. fillchar = ' ';
  147. else if (hga_mode == HGA_GFX)
  148. fillchar = 0x00;
  149. spin_unlock_irqrestore(&hga_reg_lock, flags);
  150. if (fillchar != 0xbf)
  151. memset_io(hga_vram, fillchar, hga_vram_len);
  152. }
  153. static void hga_txt_mode(void)
  154. {
  155. unsigned long flags;
  156. spin_lock_irqsave(&hga_reg_lock, flags);
  157. outb_p(HGA_MODE_VIDEO_EN | HGA_MODE_BLINK_EN, HGA_MODE_PORT);
  158. outb_p(0x00, HGA_GFX_PORT);
  159. outb_p(0x00, HGA_STATUS_PORT);
  160. write_hga_b(0x61, 0x00); /* horizontal total */
  161. write_hga_b(0x50, 0x01); /* horizontal displayed */
  162. write_hga_b(0x52, 0x02); /* horizontal sync pos */
  163. write_hga_b(0x0f, 0x03); /* horizontal sync width */
  164. write_hga_b(0x19, 0x04); /* vertical total */
  165. write_hga_b(0x06, 0x05); /* vertical total adjust */
  166. write_hga_b(0x19, 0x06); /* vertical displayed */
  167. write_hga_b(0x19, 0x07); /* vertical sync pos */
  168. write_hga_b(0x02, 0x08); /* interlace mode */
  169. write_hga_b(0x0d, 0x09); /* maximum scanline */
  170. write_hga_b(0x0c, 0x0a); /* cursor start */
  171. write_hga_b(0x0d, 0x0b); /* cursor end */
  172. write_hga_w(0x0000, 0x0c); /* start address */
  173. write_hga_w(0x0000, 0x0e); /* cursor location */
  174. hga_mode = HGA_TXT;
  175. spin_unlock_irqrestore(&hga_reg_lock, flags);
  176. }
  177. static void hga_gfx_mode(void)
  178. {
  179. unsigned long flags;
  180. spin_lock_irqsave(&hga_reg_lock, flags);
  181. outb_p(0x00, HGA_STATUS_PORT);
  182. outb_p(HGA_GFX_MODE_EN, HGA_GFX_PORT);
  183. outb_p(HGA_MODE_VIDEO_EN | HGA_MODE_GRAPHICS, HGA_MODE_PORT);
  184. write_hga_b(0x35, 0x00); /* horizontal total */
  185. write_hga_b(0x2d, 0x01); /* horizontal displayed */
  186. write_hga_b(0x2e, 0x02); /* horizontal sync pos */
  187. write_hga_b(0x07, 0x03); /* horizontal sync width */
  188. write_hga_b(0x5b, 0x04); /* vertical total */
  189. write_hga_b(0x02, 0x05); /* vertical total adjust */
  190. write_hga_b(0x57, 0x06); /* vertical displayed */
  191. write_hga_b(0x57, 0x07); /* vertical sync pos */
  192. write_hga_b(0x02, 0x08); /* interlace mode */
  193. write_hga_b(0x03, 0x09); /* maximum scanline */
  194. write_hga_b(0x00, 0x0a); /* cursor start */
  195. write_hga_b(0x00, 0x0b); /* cursor end */
  196. write_hga_w(0x0000, 0x0c); /* start address */
  197. write_hga_w(0x0000, 0x0e); /* cursor location */
  198. hga_mode = HGA_GFX;
  199. spin_unlock_irqrestore(&hga_reg_lock, flags);
  200. }
  201. static void hga_show_logo(struct fb_info *info)
  202. {
  203. /*
  204. void __iomem *dest = hga_vram;
  205. char *logo = linux_logo_bw;
  206. int x, y;
  207. for (y = 134; y < 134 + 80 ; y++) * this needs some cleanup *
  208. for (x = 0; x < 10 ; x++)
  209. writeb(~*(logo++),(dest + HGA_ROWADDR(y) + x + 40));
  210. */
  211. }
  212. static void hga_pan(unsigned int xoffset, unsigned int yoffset)
  213. {
  214. unsigned int base;
  215. unsigned long flags;
  216. base = (yoffset / 8) * 90 + xoffset;
  217. spin_lock_irqsave(&hga_reg_lock, flags);
  218. write_hga_w(base, 0x0c); /* start address */
  219. spin_unlock_irqrestore(&hga_reg_lock, flags);
  220. DPRINTK("hga_pan: base:%d\n", base);
  221. }
  222. static void hga_blank(int blank_mode)
  223. {
  224. unsigned long flags;
  225. spin_lock_irqsave(&hga_reg_lock, flags);
  226. if (blank_mode) {
  227. outb_p(0x00, HGA_MODE_PORT); /* disable video */
  228. } else {
  229. outb_p(HGA_MODE_VIDEO_EN | HGA_MODE_GRAPHICS, HGA_MODE_PORT);
  230. }
  231. spin_unlock_irqrestore(&hga_reg_lock, flags);
  232. }
  233. static int __init hga_card_detect(void)
  234. {
  235. int count=0;
  236. void __iomem *p, *q;
  237. unsigned short p_save, q_save;
  238. hga_vram_len = 0x08000;
  239. hga_vram = ioremap(0xb0000, hga_vram_len);
  240. if (request_region(0x3b0, 12, "hgafb"))
  241. release_io_ports = 1;
  242. if (request_region(0x3bf, 1, "hgafb"))
  243. release_io_port = 1;
  244. /* do a memory check */
  245. p = hga_vram;
  246. q = hga_vram + 0x01000;
  247. p_save = readw(p); q_save = readw(q);
  248. writew(0xaa55, p); if (readw(p) == 0xaa55) count++;
  249. writew(0x55aa, p); if (readw(p) == 0x55aa) count++;
  250. writew(p_save, p);
  251. if (count != 2) {
  252. return 0;
  253. }
  254. /* Ok, there is definitely a card registering at the correct
  255. * memory location, so now we do an I/O port test.
  256. */
  257. if (!test_hga_b(0x66, 0x0f)) { /* cursor low register */
  258. return 0;
  259. }
  260. if (!test_hga_b(0x99, 0x0f)) { /* cursor low register */
  261. return 0;
  262. }
  263. /* See if the card is a Hercules, by checking whether the vsync
  264. * bit of the status register is changing. This test lasts for
  265. * approximately 1/10th of a second.
  266. */
  267. p_save = q_save = inb_p(HGA_STATUS_PORT) & HGA_STATUS_VSYNC;
  268. for (count=0; count < 50000 && p_save == q_save; count++) {
  269. q_save = inb(HGA_STATUS_PORT) & HGA_STATUS_VSYNC;
  270. udelay(2);
  271. }
  272. if (p_save == q_save)
  273. return 0;
  274. switch (inb_p(HGA_STATUS_PORT) & 0x70) {
  275. case 0x10:
  276. hga_type = TYPE_HERCPLUS;
  277. hga_type_name = "HerculesPlus";
  278. break;
  279. case 0x50:
  280. hga_type = TYPE_HERCCOLOR;
  281. hga_type_name = "HerculesColor";
  282. break;
  283. default:
  284. hga_type = TYPE_HERC;
  285. hga_type_name = "Hercules";
  286. break;
  287. }
  288. return 1;
  289. }
  290. /**
  291. * hgafb_open - open the framebuffer device
  292. * @info:pointer to fb_info object containing info for current hga board
  293. * @int:open by console system or userland.
  294. */
  295. static int hgafb_open(struct fb_info *info, int init)
  296. {
  297. hga_gfx_mode();
  298. hga_clear_screen();
  299. if (!nologo) hga_show_logo(info);
  300. return 0;
  301. }
  302. /**
  303. * hgafb_open - open the framebuffer device
  304. * @info:pointer to fb_info object containing info for current hga board
  305. * @int:open by console system or userland.
  306. */
  307. static int hgafb_release(struct fb_info *info, int init)
  308. {
  309. hga_txt_mode();
  310. hga_clear_screen();
  311. return 0;
  312. }
  313. /**
  314. * hgafb_setcolreg - set color registers
  315. * @regno:register index to set
  316. * @red:red value, unused
  317. * @green:green value, unused
  318. * @blue:blue value, unused
  319. * @transp:transparency value, unused
  320. * @info:unused
  321. *
  322. * This callback function is used to set the color registers of a HGA
  323. * board. Since we have only two fixed colors only @regno is checked.
  324. * A zero is returned on success and 1 for failure.
  325. */
  326. static int hgafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
  327. u_int transp, struct fb_info *info)
  328. {
  329. if (regno > 1)
  330. return 1;
  331. return 0;
  332. }
  333. /**
  334. * hga_pan_display - pan or wrap the display
  335. * @var:contains new xoffset, yoffset and vmode values
  336. * @info:pointer to fb_info object containing info for current hga board
  337. *
  338. * This function looks only at xoffset, yoffset and the %FB_VMODE_YWRAP
  339. * flag in @var. If input parameters are correct it calls hga_pan() to
  340. * program the hardware. @info->var is updated to the new values.
  341. * A zero is returned on success and %-EINVAL for failure.
  342. */
  343. static int hgafb_pan_display(struct fb_var_screeninfo *var,
  344. struct fb_info *info)
  345. {
  346. if (var->vmode & FB_VMODE_YWRAP) {
  347. if (var->yoffset < 0 ||
  348. var->yoffset >= info->var.yres_virtual ||
  349. var->xoffset)
  350. return -EINVAL;
  351. } else {
  352. if (var->xoffset + var->xres > info->var.xres_virtual
  353. || var->yoffset + var->yres > info->var.yres_virtual
  354. || var->yoffset % 8)
  355. return -EINVAL;
  356. }
  357. hga_pan(var->xoffset, var->yoffset);
  358. return 0;
  359. }
  360. /**
  361. * hgafb_blank - (un)blank the screen
  362. * @blank_mode:blanking method to use
  363. * @info:unused
  364. *
  365. * Blank the screen if blank_mode != 0, else unblank.
  366. * Implements VESA suspend and powerdown modes on hardware that supports
  367. * disabling hsync/vsync:
  368. * @blank_mode == 2 means suspend vsync,
  369. * @blank_mode == 3 means suspend hsync,
  370. * @blank_mode == 4 means powerdown.
  371. */
  372. static int hgafb_blank(int blank_mode, struct fb_info *info)
  373. {
  374. hga_blank(blank_mode);
  375. return 0;
  376. }
  377. /*
  378. * Accel functions
  379. */
  380. #ifdef CONFIG_FB_HGA_ACCEL
  381. static void hgafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
  382. {
  383. u_int rows, y;
  384. u8 __iomem *dest;
  385. y = rect->dy;
  386. for (rows = rect->height; rows--; y++) {
  387. dest = rowaddr(info, y) + (rect->dx >> 3);
  388. switch (rect->rop) {
  389. case ROP_COPY:
  390. //fb_memset(dest, rect->color, (rect->width >> 3));
  391. break;
  392. case ROP_XOR:
  393. fb_writeb(~(fb_readb(dest)), dest);
  394. break;
  395. }
  396. }
  397. }
  398. static void hgafb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
  399. {
  400. u_int rows, y1, y2;
  401. u8 __iomem *src;
  402. u8 __iomem *dest;
  403. if (area->dy <= area->sy) {
  404. y1 = area->sy;
  405. y2 = area->dy;
  406. for (rows = area->height; rows--; ) {
  407. src = rowaddr(info, y1) + (area->sx >> 3);
  408. dest = rowaddr(info, y2) + (area->dx >> 3);
  409. //fb_memmove(dest, src, (area->width >> 3));
  410. y1++;
  411. y2++;
  412. }
  413. } else {
  414. y1 = area->sy + area->height - 1;
  415. y2 = area->dy + area->height - 1;
  416. for (rows = area->height; rows--;) {
  417. src = rowaddr(info, y1) + (area->sx >> 3);
  418. dest = rowaddr(info, y2) + (area->dx >> 3);
  419. //fb_memmove(dest, src, (area->width >> 3));
  420. y1--;
  421. y2--;
  422. }
  423. }
  424. }
  425. static void hgafb_imageblit(struct fb_info *info, const struct fb_image *image)
  426. {
  427. u8 __iomem *dest;
  428. u8 *cdat = (u8 *) image->data;
  429. u_int rows, y = image->dy;
  430. u8 d;
  431. for (rows = image->height; rows--; y++) {
  432. d = *cdat++;
  433. dest = rowaddr(info, y) + (image->dx >> 3);
  434. fb_writeb(d, dest);
  435. }
  436. }
  437. #else /* !CONFIG_FB_HGA_ACCEL */
  438. #define hgafb_fillrect cfb_fillrect
  439. #define hgafb_copyarea cfb_copyarea
  440. #define hgafb_imageblit cfb_imageblit
  441. #endif /* CONFIG_FB_HGA_ACCEL */
  442. static struct fb_ops hgafb_ops = {
  443. .owner = THIS_MODULE,
  444. .fb_open = hgafb_open,
  445. .fb_release = hgafb_release,
  446. .fb_setcolreg = hgafb_setcolreg,
  447. .fb_pan_display = hgafb_pan_display,
  448. .fb_blank = hgafb_blank,
  449. .fb_fillrect = hgafb_fillrect,
  450. .fb_copyarea = hgafb_copyarea,
  451. .fb_imageblit = hgafb_imageblit,
  452. };
  453. /* ------------------------------------------------------------------------- *
  454. *
  455. * Functions in fb_info
  456. *
  457. * ------------------------------------------------------------------------- */
  458. /* ------------------------------------------------------------------------- */
  459. /*
  460. * Initialization
  461. */
  462. static int __init hgafb_probe(struct device *device)
  463. {
  464. struct fb_info *info;
  465. if (! hga_card_detect()) {
  466. printk(KERN_INFO "hgafb: HGA card not detected.\n");
  467. if (hga_vram)
  468. iounmap(hga_vram);
  469. return -EINVAL;
  470. }
  471. printk(KERN_INFO "hgafb: %s with %ldK of memory detected.\n",
  472. hga_type_name, hga_vram_len/1024);
  473. info = framebuffer_alloc(0, NULL);
  474. if (!info) {
  475. iounmap(hga_vram);
  476. return -ENOMEM;
  477. }
  478. hga_fix.smem_start = (unsigned long)hga_vram;
  479. hga_fix.smem_len = hga_vram_len;
  480. info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN;
  481. info->var = hga_default_var;
  482. info->fix = hga_fix;
  483. info->monspecs.hfmin = 0;
  484. info->monspecs.hfmax = 0;
  485. info->monspecs.vfmin = 10000;
  486. info->monspecs.vfmax = 10000;
  487. info->monspecs.dpms = 0;
  488. info->fbops = &hgafb_ops;
  489. info->screen_base = hga_vram;
  490. if (register_framebuffer(info) < 0) {
  491. framebuffer_release(info);
  492. iounmap(hga_vram);
  493. return -EINVAL;
  494. }
  495. printk(KERN_INFO "fb%d: %s frame buffer device\n",
  496. info->node, info->fix.id);
  497. dev_set_drvdata(device, info);
  498. return 0;
  499. }
  500. static int hgafb_remove(struct device *device)
  501. {
  502. struct fb_info *info = dev_get_drvdata(device);
  503. hga_txt_mode();
  504. hga_clear_screen();
  505. if (info) {
  506. unregister_framebuffer(info);
  507. framebuffer_release(info);
  508. }
  509. iounmap(hga_vram);
  510. if (release_io_ports)
  511. release_region(0x3b0, 12);
  512. if (release_io_port)
  513. release_region(0x3bf, 1);
  514. return 0;
  515. }
  516. static struct device_driver hgafb_driver = {
  517. .name = "hgafb",
  518. .bus = &platform_bus_type,
  519. .probe = hgafb_probe,
  520. .remove = hgafb_remove,
  521. };
  522. static struct platform_device hgafb_device = {
  523. .name = "hgafb",
  524. };
  525. static int __init hgafb_init(void)
  526. {
  527. int ret;
  528. if (fb_get_options("hgafb", NULL))
  529. return -ENODEV;
  530. ret = driver_register(&hgafb_driver);
  531. if (!ret) {
  532. ret = platform_device_register(&hgafb_device);
  533. if (ret)
  534. driver_unregister(&hgafb_driver);
  535. }
  536. return ret;
  537. }
  538. static void __exit hgafb_exit(void)
  539. {
  540. platform_device_unregister(&hgafb_device);
  541. driver_unregister(&hgafb_driver);
  542. }
  543. /* -------------------------------------------------------------------------
  544. *
  545. * Modularization
  546. *
  547. * ------------------------------------------------------------------------- */
  548. MODULE_AUTHOR("Ferenc Bakonyi (fero@drama.obuda.kando.hu)");
  549. MODULE_DESCRIPTION("FBDev driver for Hercules Graphics Adaptor");
  550. MODULE_LICENSE("GPL");
  551. module_param(nologo, bool, 0);
  552. MODULE_PARM_DESC(nologo, "Disables startup logo if != 0 (default=0)");
  553. module_init(hgafb_init);
  554. module_exit(hgafb_exit);