hgafb.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  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 const struct fb_var_screeninfo hga_default_var = {
  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 = {
  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 bool 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 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 (!hga_vram)
  239. return -ENOMEM;
  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. goto error;
  253. /* Ok, there is definitely a card registering at the correct
  254. * memory location, so now we do an I/O port test.
  255. */
  256. if (!test_hga_b(0x66, 0x0f)) /* cursor low register */
  257. goto error;
  258. if (!test_hga_b(0x99, 0x0f)) /* cursor low register */
  259. goto error;
  260. /* See if the card is a Hercules, by checking whether the vsync
  261. * bit of the status register is changing. This test lasts for
  262. * approximately 1/10th of a second.
  263. */
  264. p_save = q_save = inb_p(HGA_STATUS_PORT) & HGA_STATUS_VSYNC;
  265. for (count=0; count < 50000 && p_save == q_save; count++) {
  266. q_save = inb(HGA_STATUS_PORT) & HGA_STATUS_VSYNC;
  267. udelay(2);
  268. }
  269. if (p_save == q_save)
  270. goto error;
  271. switch (inb_p(HGA_STATUS_PORT) & 0x70) {
  272. case 0x10:
  273. hga_type = TYPE_HERCPLUS;
  274. hga_type_name = "HerculesPlus";
  275. break;
  276. case 0x50:
  277. hga_type = TYPE_HERCCOLOR;
  278. hga_type_name = "HerculesColor";
  279. break;
  280. default:
  281. hga_type = TYPE_HERC;
  282. hga_type_name = "Hercules";
  283. break;
  284. }
  285. return 0;
  286. error:
  287. if (release_io_ports)
  288. release_region(0x3b0, 12);
  289. if (release_io_port)
  290. release_region(0x3bf, 1);
  291. iounmap(hga_vram);
  292. pr_err("hgafb: HGA card not detected.\n");
  293. return -EINVAL;
  294. }
  295. /**
  296. * hgafb_open - open the framebuffer device
  297. * @info: pointer to fb_info object containing info for current hga board
  298. * @init: open by console system or userland.
  299. *
  300. * Returns: %0
  301. */
  302. static int hgafb_open(struct fb_info *info, int init)
  303. {
  304. hga_gfx_mode();
  305. hga_clear_screen();
  306. if (!nologo) hga_show_logo(info);
  307. return 0;
  308. }
  309. /**
  310. * hgafb_release - open the framebuffer device
  311. * @info: pointer to fb_info object containing info for current hga board
  312. * @init: open by console system or userland.
  313. *
  314. * Returns: %0
  315. */
  316. static int hgafb_release(struct fb_info *info, int init)
  317. {
  318. hga_txt_mode();
  319. hga_clear_screen();
  320. return 0;
  321. }
  322. /**
  323. * hgafb_setcolreg - set color registers
  324. * @regno:register index to set
  325. * @red:red value, unused
  326. * @green:green value, unused
  327. * @blue:blue value, unused
  328. * @transp:transparency value, unused
  329. * @info:unused
  330. *
  331. * This callback function is used to set the color registers of a HGA
  332. * board. Since we have only two fixed colors only @regno is checked.
  333. * A zero is returned on success and 1 for failure.
  334. *
  335. * Returns: %0
  336. */
  337. static int hgafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
  338. u_int transp, struct fb_info *info)
  339. {
  340. if (regno > 1)
  341. return 1;
  342. return 0;
  343. }
  344. /**
  345. * hgafb_pan_display - pan or wrap the display
  346. * @var:contains new xoffset, yoffset and vmode values
  347. * @info:pointer to fb_info object containing info for current hga board
  348. *
  349. * This function looks only at xoffset, yoffset and the %FB_VMODE_YWRAP
  350. * flag in @var. If input parameters are correct it calls hga_pan() to
  351. * program the hardware. @info->var is updated to the new values.
  352. *
  353. * Returns: %0 on success or %-EINVAL for failure.
  354. */
  355. static int hgafb_pan_display(struct fb_var_screeninfo *var,
  356. struct fb_info *info)
  357. {
  358. if (var->vmode & FB_VMODE_YWRAP) {
  359. if (var->yoffset >= info->var.yres_virtual ||
  360. var->xoffset)
  361. return -EINVAL;
  362. } else {
  363. if (var->xoffset + info->var.xres > info->var.xres_virtual
  364. || var->yoffset + info->var.yres > info->var.yres_virtual
  365. || var->yoffset % 8)
  366. return -EINVAL;
  367. }
  368. hga_pan(var->xoffset, var->yoffset);
  369. return 0;
  370. }
  371. /**
  372. * hgafb_blank - (un)blank the screen
  373. * @blank_mode:blanking method to use
  374. * @info:unused
  375. *
  376. * Blank the screen if blank_mode != 0, else unblank.
  377. * Implements VESA suspend and powerdown modes on hardware that supports
  378. * disabling hsync/vsync:
  379. * @blank_mode == 2 means suspend vsync,
  380. * @blank_mode == 3 means suspend hsync,
  381. * @blank_mode == 4 means powerdown.
  382. *
  383. * Returns: %0
  384. */
  385. static int hgafb_blank(int blank_mode, struct fb_info *info)
  386. {
  387. hga_blank(blank_mode);
  388. return 0;
  389. }
  390. /*
  391. * Accel functions
  392. */
  393. static void hgafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
  394. {
  395. u_int rows, y;
  396. u8 __iomem *dest;
  397. y = rect->dy;
  398. for (rows = rect->height; rows--; y++) {
  399. dest = rowaddr(info, y) + (rect->dx >> 3);
  400. switch (rect->rop) {
  401. case ROP_COPY:
  402. memset_io(dest, rect->color, (rect->width >> 3));
  403. break;
  404. case ROP_XOR:
  405. fb_writeb(~(fb_readb(dest)), dest);
  406. break;
  407. }
  408. }
  409. }
  410. static void hgafb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
  411. {
  412. u_int rows, y1, y2;
  413. u8 __iomem *src;
  414. u8 __iomem *dest;
  415. if (area->dy <= area->sy) {
  416. y1 = area->sy;
  417. y2 = area->dy;
  418. for (rows = area->height; rows--; ) {
  419. src = rowaddr(info, y1) + (area->sx >> 3);
  420. dest = rowaddr(info, y2) + (area->dx >> 3);
  421. memmove(dest, src, (area->width >> 3));
  422. y1++;
  423. y2++;
  424. }
  425. } else {
  426. y1 = area->sy + area->height - 1;
  427. y2 = area->dy + area->height - 1;
  428. for (rows = area->height; rows--;) {
  429. src = rowaddr(info, y1) + (area->sx >> 3);
  430. dest = rowaddr(info, y2) + (area->dx >> 3);
  431. memmove(dest, src, (area->width >> 3));
  432. y1--;
  433. y2--;
  434. }
  435. }
  436. }
  437. static void hgafb_imageblit(struct fb_info *info, const struct fb_image *image)
  438. {
  439. u8 __iomem *dest;
  440. u8 *cdat = (u8 *) image->data;
  441. u_int rows, y = image->dy;
  442. u_int x;
  443. u8 d;
  444. for (rows = image->height; rows--; y++) {
  445. for (x = 0; x < image->width; x+= 8) {
  446. d = *cdat++;
  447. dest = rowaddr(info, y) + ((image->dx + x)>> 3);
  448. fb_writeb(d, dest);
  449. }
  450. }
  451. }
  452. static const struct fb_ops hgafb_ops = {
  453. .owner = THIS_MODULE,
  454. .fb_open = hgafb_open,
  455. .fb_release = hgafb_release,
  456. __FB_DEFAULT_IOMEM_OPS_RDWR,
  457. .fb_setcolreg = hgafb_setcolreg,
  458. .fb_pan_display = hgafb_pan_display,
  459. .fb_blank = hgafb_blank,
  460. .fb_fillrect = hgafb_fillrect,
  461. .fb_copyarea = hgafb_copyarea,
  462. .fb_imageblit = hgafb_imageblit,
  463. __FB_DEFAULT_IOMEM_OPS_MMAP,
  464. };
  465. /* ------------------------------------------------------------------------- *
  466. *
  467. * Functions in fb_info
  468. *
  469. * ------------------------------------------------------------------------- */
  470. /* ------------------------------------------------------------------------- */
  471. /*
  472. * Initialization
  473. */
  474. static int hgafb_probe(struct platform_device *pdev)
  475. {
  476. struct fb_info *info;
  477. int ret;
  478. ret = hga_card_detect();
  479. if (ret)
  480. return ret;
  481. printk(KERN_INFO "hgafb: %s with %ldK of memory detected.\n",
  482. hga_type_name, hga_vram_len/1024);
  483. info = framebuffer_alloc(0, &pdev->dev);
  484. if (!info) {
  485. iounmap(hga_vram);
  486. return -ENOMEM;
  487. }
  488. hga_fix.smem_start = (unsigned long)hga_vram;
  489. hga_fix.smem_len = hga_vram_len;
  490. info->flags = FBINFO_HWACCEL_YPAN;
  491. info->var = hga_default_var;
  492. info->fix = hga_fix;
  493. info->monspecs.hfmin = 0;
  494. info->monspecs.hfmax = 0;
  495. info->monspecs.vfmin = 10000;
  496. info->monspecs.vfmax = 10000;
  497. info->monspecs.dpms = 0;
  498. info->fbops = &hgafb_ops;
  499. info->screen_base = hga_vram;
  500. if (register_framebuffer(info) < 0) {
  501. framebuffer_release(info);
  502. iounmap(hga_vram);
  503. return -EINVAL;
  504. }
  505. fb_info(info, "%s frame buffer device\n", info->fix.id);
  506. platform_set_drvdata(pdev, info);
  507. return 0;
  508. }
  509. static void hgafb_remove(struct platform_device *pdev)
  510. {
  511. struct fb_info *info = platform_get_drvdata(pdev);
  512. hga_txt_mode();
  513. hga_clear_screen();
  514. if (info) {
  515. unregister_framebuffer(info);
  516. framebuffer_release(info);
  517. }
  518. iounmap(hga_vram);
  519. if (release_io_ports)
  520. release_region(0x3b0, 12);
  521. if (release_io_port)
  522. release_region(0x3bf, 1);
  523. }
  524. static struct platform_driver hgafb_driver = {
  525. .probe = hgafb_probe,
  526. .remove = hgafb_remove,
  527. .driver = {
  528. .name = "hgafb",
  529. },
  530. };
  531. static struct platform_device *hgafb_device;
  532. static int __init hgafb_init(void)
  533. {
  534. int ret;
  535. if (fb_get_options("hgafb", NULL))
  536. return -ENODEV;
  537. ret = platform_driver_register(&hgafb_driver);
  538. if (!ret) {
  539. hgafb_device = platform_device_register_simple("hgafb", 0, NULL, 0);
  540. if (IS_ERR(hgafb_device)) {
  541. platform_driver_unregister(&hgafb_driver);
  542. ret = PTR_ERR(hgafb_device);
  543. }
  544. }
  545. return ret;
  546. }
  547. static void __exit hgafb_exit(void)
  548. {
  549. platform_device_unregister(hgafb_device);
  550. platform_driver_unregister(&hgafb_driver);
  551. }
  552. /* -------------------------------------------------------------------------
  553. *
  554. * Modularization
  555. *
  556. * ------------------------------------------------------------------------- */
  557. MODULE_AUTHOR("Ferenc Bakonyi <fero@drama.obuda.kando.hu>");
  558. MODULE_DESCRIPTION("FBDev driver for Hercules Graphics Adaptor");
  559. MODULE_LICENSE("GPL");
  560. module_param(nologo, bool, 0);
  561. MODULE_PARM_DESC(nologo, "Disables startup logo if != 0 (default=0)");
  562. module_init(hgafb_init);
  563. module_exit(hgafb_exit);