hgafb.c 17 KB

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