hgafb.c 17 KB

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