valkyriefb.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591
  1. /*
  2. * valkyriefb.c -- frame buffer device for the PowerMac 'valkyrie' display
  3. *
  4. * Created 8 August 1998 by
  5. * Martin Costabel <costabel@wanadoo.fr> and Kevin Schoedel
  6. *
  7. * Vmode-switching changes and vmode 15/17 modifications created 29 August
  8. * 1998 by Barry K. Nathan <barryn@pobox.com>.
  9. *
  10. * Ported to m68k Macintosh by David Huggins-Daines <dhd@debian.org>
  11. *
  12. * Derived directly from:
  13. *
  14. * controlfb.c -- frame buffer device for the PowerMac 'control' display
  15. * Copyright (C) 1998 Dan Jacobowitz <dan@debian.org>
  16. *
  17. * pmc-valkyrie.c -- Console support for PowerMac "valkyrie" display adaptor.
  18. * Copyright (C) 1997 Paul Mackerras.
  19. *
  20. * and indirectly:
  21. *
  22. * Frame buffer structure from:
  23. * drivers/video/chipsfb.c -- frame buffer device for
  24. * Chips & Technologies 65550 chip.
  25. *
  26. * Copyright (C) 1998 Paul Mackerras
  27. *
  28. * This file is derived from the Powermac "chips" driver:
  29. * Copyright (C) 1997 Fabio Riccardi.
  30. * And from the frame buffer device for Open Firmware-initialized devices:
  31. * Copyright (C) 1997 Geert Uytterhoeven.
  32. *
  33. * Hardware information from:
  34. * control.c: Console support for PowerMac "control" display adaptor.
  35. * Copyright (C) 1996 Paul Mackerras
  36. *
  37. * This file is subject to the terms and conditions of the GNU General Public
  38. * License. See the file COPYING in the main directory of this archive for
  39. * more details.
  40. */
  41. #include <linux/module.h>
  42. #include <linux/kernel.h>
  43. #include <linux/errno.h>
  44. #include <linux/string.h>
  45. #include <linux/mm.h>
  46. #include <linux/slab.h>
  47. #include <linux/vmalloc.h>
  48. #include <linux/delay.h>
  49. #include <linux/interrupt.h>
  50. #include <linux/fb.h>
  51. #include <linux/selection.h>
  52. #include <linux/init.h>
  53. #include <linux/nvram.h>
  54. #include <linux/adb.h>
  55. #include <linux/cuda.h>
  56. #include <asm/io.h>
  57. #ifdef CONFIG_MAC
  58. #include <asm/bootinfo.h>
  59. #include <asm/macintosh.h>
  60. #else
  61. #include <asm/prom.h>
  62. #endif
  63. #include <asm/pgtable.h>
  64. #include "macmodes.h"
  65. #include "valkyriefb.h"
  66. #ifdef CONFIG_MAC
  67. /* We don't yet have functions to read the PRAM... perhaps we can
  68. adapt them from the PPC code? */
  69. static int default_vmode = VMODE_CHOOSE;
  70. static int default_cmode = CMODE_8;
  71. #else
  72. static int default_vmode = VMODE_NVRAM;
  73. static int default_cmode = CMODE_NVRAM;
  74. #endif
  75. struct fb_par_valkyrie {
  76. int vmode, cmode;
  77. int xres, yres;
  78. int vxres, vyres;
  79. struct valkyrie_regvals *init;
  80. };
  81. struct fb_info_valkyrie {
  82. struct fb_info info;
  83. struct fb_par_valkyrie par;
  84. struct cmap_regs __iomem *cmap_regs;
  85. unsigned long cmap_regs_phys;
  86. struct valkyrie_regs __iomem *valkyrie_regs;
  87. unsigned long valkyrie_regs_phys;
  88. __u8 __iomem *frame_buffer;
  89. unsigned long frame_buffer_phys;
  90. int sense;
  91. unsigned long total_vram;
  92. u32 pseudo_palette[16];
  93. };
  94. /*
  95. * Exported functions
  96. */
  97. int valkyriefb_init(void);
  98. int valkyriefb_setup(char*);
  99. static int valkyriefb_check_var(struct fb_var_screeninfo *var,
  100. struct fb_info *info);
  101. static int valkyriefb_set_par(struct fb_info *info);
  102. static int valkyriefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
  103. u_int transp, struct fb_info *info);
  104. static int valkyriefb_blank(int blank_mode, struct fb_info *info);
  105. static int read_valkyrie_sense(struct fb_info_valkyrie *p);
  106. static void set_valkyrie_clock(unsigned char *params);
  107. static int valkyrie_var_to_par(struct fb_var_screeninfo *var,
  108. struct fb_par_valkyrie *par, const struct fb_info *fb_info);
  109. static int valkyrie_init_info(struct fb_info *info, struct fb_info_valkyrie *p);
  110. static void valkyrie_par_to_fix(struct fb_par_valkyrie *par, struct fb_fix_screeninfo *fix);
  111. static void valkyrie_init_fix(struct fb_fix_screeninfo *fix, struct fb_info_valkyrie *p);
  112. static struct fb_ops valkyriefb_ops = {
  113. .owner = THIS_MODULE,
  114. .fb_check_var = valkyriefb_check_var,
  115. .fb_set_par = valkyriefb_set_par,
  116. .fb_setcolreg = valkyriefb_setcolreg,
  117. .fb_blank = valkyriefb_blank,
  118. .fb_fillrect = cfb_fillrect,
  119. .fb_copyarea = cfb_copyarea,
  120. .fb_imageblit = cfb_imageblit,
  121. };
  122. /* Sets the video mode according to info->var */
  123. static int valkyriefb_set_par(struct fb_info *info)
  124. {
  125. struct fb_info_valkyrie *p = (struct fb_info_valkyrie *) info;
  126. volatile struct valkyrie_regs __iomem *valkyrie_regs = p->valkyrie_regs;
  127. struct fb_par_valkyrie *par = info->par;
  128. struct valkyrie_regvals *init;
  129. int err;
  130. if ((err = valkyrie_var_to_par(&info->var, par, info)))
  131. return err;
  132. valkyrie_par_to_fix(par, &info->fix);
  133. /* Reset the valkyrie */
  134. out_8(&valkyrie_regs->status.r, 0);
  135. udelay(100);
  136. /* Initialize display timing registers */
  137. init = par->init;
  138. out_8(&valkyrie_regs->mode.r, init->mode | 0x80);
  139. out_8(&valkyrie_regs->depth.r, par->cmode + 3);
  140. set_valkyrie_clock(init->clock_params);
  141. udelay(100);
  142. /* Turn on display */
  143. out_8(&valkyrie_regs->mode.r, init->mode);
  144. return 0;
  145. }
  146. static inline int valkyrie_par_to_var(struct fb_par_valkyrie *par,
  147. struct fb_var_screeninfo *var)
  148. {
  149. return mac_vmode_to_var(par->vmode, par->cmode, var);
  150. }
  151. static int
  152. valkyriefb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
  153. {
  154. int err;
  155. struct fb_par_valkyrie par;
  156. if ((err = valkyrie_var_to_par(var, &par, info)))
  157. return err;
  158. valkyrie_par_to_var(&par, var);
  159. return 0;
  160. }
  161. /*
  162. * Blank the screen if blank_mode != 0, else unblank. If blank_mode == NULL
  163. * then the caller blanks by setting the CLUT (Color Look Up Table) to all
  164. * black. Return 0 if blanking succeeded, != 0 if un-/blanking failed due
  165. * to e.g. a video mode which doesn't support it. Implements VESA suspend
  166. * and powerdown modes on hardware that supports disabling hsync/vsync:
  167. * blank_mode == 2: suspend vsync
  168. * blank_mode == 3: suspend hsync
  169. * blank_mode == 4: powerdown
  170. */
  171. static int valkyriefb_blank(int blank_mode, struct fb_info *info)
  172. {
  173. struct fb_info_valkyrie *p = (struct fb_info_valkyrie *) info;
  174. struct fb_par_valkyrie *par = info->par;
  175. struct valkyrie_regvals *init = par->init;
  176. if (init == NULL)
  177. return 1;
  178. switch (blank_mode) {
  179. case FB_BLANK_UNBLANK: /* unblank */
  180. out_8(&p->valkyrie_regs->mode.r, init->mode);
  181. break;
  182. case FB_BLANK_NORMAL:
  183. return 1; /* get caller to set CLUT to all black */
  184. case FB_BLANK_VSYNC_SUSPEND:
  185. case FB_BLANK_HSYNC_SUSPEND:
  186. /*
  187. * [kps] Value extracted from MacOS. I don't know
  188. * whether this bit disables hsync or vsync, or
  189. * whether the hardware can do the other as well.
  190. */
  191. out_8(&p->valkyrie_regs->mode.r, init->mode | 0x40);
  192. break;
  193. case FB_BLANK_POWERDOWN:
  194. out_8(&p->valkyrie_regs->mode.r, 0x66);
  195. break;
  196. }
  197. return 0;
  198. }
  199. static int valkyriefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
  200. u_int transp, struct fb_info *info)
  201. {
  202. struct fb_info_valkyrie *p = (struct fb_info_valkyrie *) info;
  203. volatile struct cmap_regs __iomem *cmap_regs = p->cmap_regs;
  204. struct fb_par_valkyrie *par = info->par;
  205. if (regno > 255)
  206. return 1;
  207. red >>= 8;
  208. green >>= 8;
  209. blue >>= 8;
  210. /* tell clut which address to fill */
  211. out_8(&p->cmap_regs->addr, regno);
  212. udelay(1);
  213. /* send one color channel at a time */
  214. out_8(&cmap_regs->lut, red);
  215. out_8(&cmap_regs->lut, green);
  216. out_8(&cmap_regs->lut, blue);
  217. if (regno < 16 && par->cmode == CMODE_16)
  218. ((u32 *)info->pseudo_palette)[regno] =
  219. (regno << 10) | (regno << 5) | regno;
  220. return 0;
  221. }
  222. static inline int valkyrie_vram_reqd(int video_mode, int color_mode)
  223. {
  224. int pitch;
  225. struct valkyrie_regvals *init = valkyrie_reg_init[video_mode-1];
  226. if ((pitch = init->pitch[color_mode]) == 0)
  227. pitch = 2 * init->pitch[0];
  228. return init->vres * pitch;
  229. }
  230. static void set_valkyrie_clock(unsigned char *params)
  231. {
  232. struct adb_request req;
  233. int i;
  234. #ifdef CONFIG_ADB_CUDA
  235. for (i = 0; i < 3; ++i) {
  236. cuda_request(&req, NULL, 5, CUDA_PACKET, CUDA_GET_SET_IIC,
  237. 0x50, i + 1, params[i]);
  238. while (!req.complete)
  239. cuda_poll();
  240. }
  241. #endif
  242. }
  243. static void __init valkyrie_choose_mode(struct fb_info_valkyrie *p)
  244. {
  245. p->sense = read_valkyrie_sense(p);
  246. printk(KERN_INFO "Monitor sense value = 0x%x\n", p->sense);
  247. /* Try to pick a video mode out of NVRAM if we have one. */
  248. #if !defined(CONFIG_MAC) && defined(CONFIG_NVRAM)
  249. if (default_vmode == VMODE_NVRAM) {
  250. default_vmode = nvram_read_byte(NV_VMODE);
  251. if (default_vmode <= 0
  252. || default_vmode > VMODE_MAX
  253. || !valkyrie_reg_init[default_vmode - 1])
  254. default_vmode = VMODE_CHOOSE;
  255. }
  256. #endif
  257. if (default_vmode == VMODE_CHOOSE)
  258. default_vmode = mac_map_monitor_sense(p->sense);
  259. if (!valkyrie_reg_init[default_vmode - 1])
  260. default_vmode = VMODE_640_480_67;
  261. #if !defined(CONFIG_MAC) && defined(CONFIG_NVRAM)
  262. if (default_cmode == CMODE_NVRAM)
  263. default_cmode = nvram_read_byte(NV_CMODE);
  264. #endif
  265. /*
  266. * Reduce the pixel size if we don't have enough VRAM or bandwidth.
  267. */
  268. if (default_cmode < CMODE_8 || default_cmode > CMODE_16
  269. || valkyrie_reg_init[default_vmode-1]->pitch[default_cmode] == 0
  270. || valkyrie_vram_reqd(default_vmode, default_cmode) > p->total_vram)
  271. default_cmode = CMODE_8;
  272. printk(KERN_INFO "using video mode %d and color mode %d.\n",
  273. default_vmode, default_cmode);
  274. }
  275. int __init valkyriefb_init(void)
  276. {
  277. struct fb_info_valkyrie *p;
  278. unsigned long frame_buffer_phys, cmap_regs_phys, flags;
  279. int err;
  280. char *option = NULL;
  281. if (fb_get_options("valkyriefb", &option))
  282. return -ENODEV;
  283. valkyriefb_setup(option);
  284. #ifdef CONFIG_MAC
  285. if (!MACH_IS_MAC)
  286. return -ENODEV;
  287. if (!(mac_bi_data.id == MAC_MODEL_Q630
  288. /* I'm not sure about this one */
  289. || mac_bi_data.id == MAC_MODEL_P588))
  290. return -ENODEV;
  291. /* Hardcoded addresses... welcome to 68k Macintosh country :-) */
  292. frame_buffer_phys = 0xf9000000;
  293. cmap_regs_phys = 0x50f24000;
  294. flags = IOMAP_NOCACHE_SER; /* IOMAP_WRITETHROUGH?? */
  295. #else /* ppc (!CONFIG_MAC) */
  296. {
  297. struct device_node *dp;
  298. struct resource r;
  299. dp = of_find_node_by_name(NULL, "valkyrie");
  300. if (dp == 0)
  301. return 0;
  302. if (of_address_to_resource(dp, 0, &r)) {
  303. printk(KERN_ERR "can't find address for valkyrie\n");
  304. return 0;
  305. }
  306. frame_buffer_phys = r.start;
  307. cmap_regs_phys = r.start + 0x304000;
  308. flags = _PAGE_WRITETHRU;
  309. }
  310. #endif /* ppc (!CONFIG_MAC) */
  311. p = kzalloc(sizeof(*p), GFP_ATOMIC);
  312. if (p == 0)
  313. return -ENOMEM;
  314. /* Map in frame buffer and registers */
  315. if (!request_mem_region(frame_buffer_phys, 0x100000, "valkyriefb")) {
  316. kfree(p);
  317. return 0;
  318. }
  319. p->total_vram = 0x100000;
  320. p->frame_buffer_phys = frame_buffer_phys;
  321. p->frame_buffer = __ioremap(frame_buffer_phys, p->total_vram, flags);
  322. p->cmap_regs_phys = cmap_regs_phys;
  323. p->cmap_regs = ioremap(p->cmap_regs_phys, 0x1000);
  324. p->valkyrie_regs_phys = cmap_regs_phys+0x6000;
  325. p->valkyrie_regs = ioremap(p->valkyrie_regs_phys, 0x1000);
  326. err = -ENOMEM;
  327. if (p->frame_buffer == NULL || p->cmap_regs == NULL
  328. || p->valkyrie_regs == NULL) {
  329. printk(KERN_ERR "valkyriefb: couldn't map resources\n");
  330. goto out_free;
  331. }
  332. valkyrie_choose_mode(p);
  333. mac_vmode_to_var(default_vmode, default_cmode, &p->info.var);
  334. err = valkyrie_init_info(&p->info, p);
  335. if (err < 0)
  336. goto out_free;
  337. valkyrie_init_fix(&p->info.fix, p);
  338. if (valkyriefb_set_par(&p->info))
  339. /* "can't happen" */
  340. printk(KERN_ERR "valkyriefb: can't set default video mode\n");
  341. if ((err = register_framebuffer(&p->info)) != 0)
  342. goto out_cmap_free;
  343. printk(KERN_INFO "fb%d: valkyrie frame buffer device\n", p->info.node);
  344. return 0;
  345. out_cmap_free:
  346. fb_dealloc_cmap(&p->info.cmap);
  347. out_free:
  348. if (p->frame_buffer)
  349. iounmap(p->frame_buffer);
  350. if (p->cmap_regs)
  351. iounmap(p->cmap_regs);
  352. if (p->valkyrie_regs)
  353. iounmap(p->valkyrie_regs);
  354. kfree(p);
  355. return err;
  356. }
  357. /*
  358. * Get the monitor sense value.
  359. */
  360. static int read_valkyrie_sense(struct fb_info_valkyrie *p)
  361. {
  362. int sense, in;
  363. out_8(&p->valkyrie_regs->msense.r, 0); /* release all lines */
  364. __delay(20000);
  365. sense = ((in = in_8(&p->valkyrie_regs->msense.r)) & 0x70) << 4;
  366. /* drive each sense line low in turn and collect the other 2 */
  367. out_8(&p->valkyrie_regs->msense.r, 4); /* drive A low */
  368. __delay(20000);
  369. sense |= ((in = in_8(&p->valkyrie_regs->msense.r)) & 0x30);
  370. out_8(&p->valkyrie_regs->msense.r, 2); /* drive B low */
  371. __delay(20000);
  372. sense |= ((in = in_8(&p->valkyrie_regs->msense.r)) & 0x40) >> 3;
  373. sense |= (in & 0x10) >> 2;
  374. out_8(&p->valkyrie_regs->msense.r, 1); /* drive C low */
  375. __delay(20000);
  376. sense |= ((in = in_8(&p->valkyrie_regs->msense.r)) & 0x60) >> 5;
  377. out_8(&p->valkyrie_regs->msense.r, 7);
  378. return sense;
  379. }
  380. /*
  381. * This routine takes a user-supplied var,
  382. * and picks the best vmode/cmode from it.
  383. */
  384. /* [bkn] I did a major overhaul of this function.
  385. *
  386. * Much of the old code was "swiped by jonh from atyfb.c". Because
  387. * macmodes has mac_var_to_vmode, I felt that it would be better to
  388. * rework this function to use that, instead of reinventing the wheel to
  389. * add support for vmode 17. This was reinforced by the fact that
  390. * the previously swiped atyfb.c code is no longer there.
  391. *
  392. * So, I swiped and adapted platinum_var_to_par (from platinumfb.c), replacing
  393. * most, but not all, of the old code in the process. One side benefit of
  394. * swiping the platinumfb code is that we now have more comprehensible error
  395. * messages when a vmode/cmode switch fails. (Most of the error messages are
  396. * platinumfb.c, but I added two of my own, and I also changed some commas
  397. * into colons to make the messages more consistent with other Linux error
  398. * messages.) In addition, I think the new code *might* fix some vmode-
  399. * switching oddities, but I'm not sure.
  400. *
  401. * There may be some more opportunities for cleanup in here, but this is a
  402. * good start...
  403. */
  404. static int valkyrie_var_to_par(struct fb_var_screeninfo *var,
  405. struct fb_par_valkyrie *par, const struct fb_info *fb_info)
  406. {
  407. int vmode, cmode;
  408. struct valkyrie_regvals *init;
  409. struct fb_info_valkyrie *p = (struct fb_info_valkyrie *) fb_info;
  410. if (mac_var_to_vmode(var, &vmode, &cmode) != 0) {
  411. printk(KERN_ERR "valkyriefb: can't do %dx%dx%d.\n",
  412. var->xres, var->yres, var->bits_per_pixel);
  413. return -EINVAL;
  414. }
  415. /* Check if we know about the wanted video mode */
  416. if (vmode < 1 || vmode > VMODE_MAX || !valkyrie_reg_init[vmode-1]) {
  417. printk(KERN_ERR "valkyriefb: vmode %d not valid.\n", vmode);
  418. return -EINVAL;
  419. }
  420. if (cmode != CMODE_8 && cmode != CMODE_16) {
  421. printk(KERN_ERR "valkyriefb: cmode %d not valid.\n", cmode);
  422. return -EINVAL;
  423. }
  424. if (var->xres_virtual > var->xres || var->yres_virtual > var->yres
  425. || var->xoffset != 0 || var->yoffset != 0) {
  426. return -EINVAL;
  427. }
  428. init = valkyrie_reg_init[vmode-1];
  429. if (init->pitch[cmode] == 0) {
  430. printk(KERN_ERR "valkyriefb: vmode %d does not support "
  431. "cmode %d.\n", vmode, cmode);
  432. return -EINVAL;
  433. }
  434. if (valkyrie_vram_reqd(vmode, cmode) > p->total_vram) {
  435. printk(KERN_ERR "valkyriefb: not enough ram for vmode %d, "
  436. "cmode %d.\n", vmode, cmode);
  437. return -EINVAL;
  438. }
  439. par->vmode = vmode;
  440. par->cmode = cmode;
  441. par->init = init;
  442. par->xres = var->xres;
  443. par->yres = var->yres;
  444. par->vxres = par->xres;
  445. par->vyres = par->yres;
  446. return 0;
  447. }
  448. static void valkyrie_init_fix(struct fb_fix_screeninfo *fix, struct fb_info_valkyrie *p)
  449. {
  450. memset(fix, 0, sizeof(*fix));
  451. strcpy(fix->id, "valkyrie");
  452. fix->mmio_start = p->valkyrie_regs_phys;
  453. fix->mmio_len = sizeof(struct valkyrie_regs);
  454. fix->type = FB_TYPE_PACKED_PIXELS;
  455. fix->smem_start = p->frame_buffer_phys + 0x1000;
  456. fix->smem_len = p->total_vram;
  457. fix->type_aux = 0;
  458. fix->ywrapstep = 0;
  459. fix->ypanstep = 0;
  460. fix->xpanstep = 0;
  461. }
  462. /* Fix must already be inited above */
  463. static void valkyrie_par_to_fix(struct fb_par_valkyrie *par,
  464. struct fb_fix_screeninfo *fix)
  465. {
  466. fix->smem_len = valkyrie_vram_reqd(par->vmode, par->cmode);
  467. fix->visual = (par->cmode == CMODE_8) ?
  468. FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR;
  469. fix->line_length = par->vxres << par->cmode;
  470. /* ywrapstep, xpanstep, ypanstep */
  471. }
  472. static int __init valkyrie_init_info(struct fb_info *info,
  473. struct fb_info_valkyrie *p)
  474. {
  475. info->fbops = &valkyriefb_ops;
  476. info->screen_base = p->frame_buffer + 0x1000;
  477. info->flags = FBINFO_DEFAULT;
  478. info->pseudo_palette = p->pseudo_palette;
  479. info->par = &p->par;
  480. return fb_alloc_cmap(&info->cmap, 256, 0);
  481. }
  482. /*
  483. * Parse user speficied options (`video=valkyriefb:')
  484. */
  485. int __init valkyriefb_setup(char *options)
  486. {
  487. char *this_opt;
  488. if (!options || !*options)
  489. return 0;
  490. while ((this_opt = strsep(&options, ",")) != NULL) {
  491. if (!strncmp(this_opt, "vmode:", 6)) {
  492. int vmode = simple_strtoul(this_opt+6, NULL, 0);
  493. if (vmode > 0 && vmode <= VMODE_MAX)
  494. default_vmode = vmode;
  495. }
  496. else if (!strncmp(this_opt, "cmode:", 6)) {
  497. int depth = simple_strtoul(this_opt+6, NULL, 0);
  498. switch (depth) {
  499. case 8:
  500. default_cmode = CMODE_8;
  501. break;
  502. case 15:
  503. case 16:
  504. default_cmode = CMODE_16;
  505. break;
  506. }
  507. }
  508. }
  509. return 0;
  510. }
  511. module_init(valkyriefb_init);
  512. MODULE_LICENSE("GPL");