2 * macfb.c: Generic framebuffer for Macs whose colourmaps/modes we
3 * don't know how to set.
5 * (c) 1999 David Huggins-Daines <dhd@debian.org>
7 * Primarily based on vesafb.c, by Gerd Knorr
8 * (c) 1998 Gerd Knorr <kraxel@cs.tu-berlin.de>
10 * Also uses information and code from:
12 * The original macfb.c from Linux/mac68k 2.0, by Alan Cox, Juergen
13 * Mellinger, Mikael Forselius, Michael Schmitz, and others.
15 * valkyriefb.c, by Martin Costabel, Kevin Schoedel, Barry Nathan, Dan
16 * Jacobowitz, Paul Mackerras, Fabio Riccardi, and Geert Uytterhoeven.
18 * The VideoToolbox "Bugs" web page at
19 * http://rajsky.psych.nyu.edu/Tips/VideoBugs.html
21 * This code is free software. You may copy, modify, and distribute
22 * it subject to the terms and conditions of the GNU General Public
23 * License, version 2, or any later version, at your convenience.
26 #include <linux/module.h>
27 #include <linux/kernel.h>
28 #include <linux/errno.h>
29 #include <linux/string.h>
31 #include <linux/delay.h>
32 #include <linux/nubus.h>
33 #include <linux/init.h>
36 #include <asm/setup.h>
37 #include <asm/bootinfo.h>
38 #include <asm/macintosh.h>
41 /* Common DAC base address for the LC, RBV, Valkyrie, and IIvx */
42 #define DAC_BASE 0x50f24000
44 /* Some addresses for the DAFB */
45 #define DAFB_BASE 0xf9800200
47 /* Address for the built-in Civic framebuffer in Quadra AVs */
48 #define CIVIC_BASE 0x50f30800
50 /* GSC (Gray Scale Controller) base address */
51 #define GSC_BASE 0x50F20000
53 /* CSC (Color Screen Controller) base address */
54 #define CSC_BASE 0x50F20000
56 static int (*macfb_setpalette)(unsigned int regno, unsigned int red,
57 unsigned int green, unsigned int blue,
58 struct fb_info *info);
63 } __iomem *v8_brazil_cmap_regs;
67 char pad1[3]; /* word aligned */
69 char pad2[3]; /* word aligned */
70 unsigned char cntl; /* a guess as to purpose */
71 } __iomem *rbv_cmap_regs;
75 unsigned long pad1[3];
76 unsigned char pad2[3];
78 } __iomem *dafb_cmap_regs;
81 unsigned char addr; /* OFFSET: 0x00 */
82 unsigned char pad1[15];
83 unsigned char lut; /* OFFSET: 0x10 */
84 unsigned char pad2[15];
85 unsigned char status; /* OFFSET: 0x20 */
86 unsigned char pad3[7];
87 unsigned long vbl_addr; /* OFFSET: 0x28 */
88 unsigned int status2; /* OFFSET: 0x2C */
89 } __iomem *civic_cmap_regs;
93 unsigned char clut_waddr; /* 0x40 */
95 unsigned char clut_data; /* 0x42 */
97 unsigned char clut_raddr; /* 0x46 */
98 } __iomem *csc_cmap_regs;
100 /* The registers in these structs are in NuBus slot space */
101 struct mdc_cmap_regs {
108 struct toby_cmap_regs {
110 unsigned char lut; /* TFBClutWDataReg, offset 0x90018 */
112 unsigned char addr; /* TFBClutAddrReg, offset 0x9001C */
115 struct jet_cmap_regs {
121 #define PIXEL_TO_MM(a) (((a)*10)/28) /* width in mm at 72 dpi */
123 static int video_slot = 0;
125 static struct fb_var_screeninfo macfb_defined = {
127 .activate = FB_ACTIVATE_NOW,
134 .vmode = FB_VMODE_NONINTERLACED,
137 static struct fb_fix_screeninfo macfb_fix = {
138 .type = FB_TYPE_PACKED_PIXELS,
139 .accel = FB_ACCEL_NONE,
142 static struct fb_info fb_info;
143 static u32 pseudo_palette[16];
148 * Unlike the Valkyrie, the DAFB cannot set individual colormap
149 * registers. Therefore, we do what the MacOS driver does (no
150 * kidding!) and simply set them one by one until we hit the one we
153 static int dafb_setpalette(unsigned int regno, unsigned int red,
154 unsigned int green, unsigned int blue,
155 struct fb_info *info)
157 static int lastreg = -1;
164 local_irq_save(flags);
167 * fbdev will set an entire colourmap, but X won't. Hopefully
168 * this should accommodate both of them
170 if (regno != lastreg + 1) {
173 /* Stab in the dark trying to reset the CLUT pointer */
174 nubus_writel(0, &dafb_cmap_regs->reset);
177 /* Loop until we get to the register we want */
178 for (i = 0; i < regno; i++) {
179 nubus_writeb(info->cmap.red[i] >> 8,
180 &dafb_cmap_regs->lut);
182 nubus_writeb(info->cmap.green[i] >> 8,
183 &dafb_cmap_regs->lut);
185 nubus_writeb(info->cmap.blue[i] >> 8,
186 &dafb_cmap_regs->lut);
191 nubus_writeb(red, &dafb_cmap_regs->lut);
193 nubus_writeb(green, &dafb_cmap_regs->lut);
195 nubus_writeb(blue, &dafb_cmap_regs->lut);
197 local_irq_restore(flags);
202 /* V8 and Brazil seem to use the same DAC. Sonora does as well. */
203 static int v8_brazil_setpalette(unsigned int regno, unsigned int red,
204 unsigned int green, unsigned int blue,
205 struct fb_info *info)
207 unsigned int bpp = info->var.bits_per_pixel;
208 unsigned char _red =red>>8;
209 unsigned char _green=green>>8;
210 unsigned char _blue =blue>>8;
211 unsigned char _regno;
215 return 1; /* failsafe */
217 local_irq_save(flags);
219 /* On these chips, the CLUT register numbers are spread out
220 * across the register space. Thus:
221 * In 8bpp, all regnos are valid.
222 * In 4bpp, the regnos are 0x0f, 0x1f, 0x2f, etc, etc
223 * In 2bpp, the regnos are 0x3f, 0x7f, 0xbf, 0xff
225 _regno = (regno << (8 - bpp)) | (0xFF >> bpp);
226 nubus_writeb(_regno, &v8_brazil_cmap_regs->addr);
229 /* send one color channel at a time */
230 nubus_writeb(_red, &v8_brazil_cmap_regs->lut);
232 nubus_writeb(_green, &v8_brazil_cmap_regs->lut);
234 nubus_writeb(_blue, &v8_brazil_cmap_regs->lut);
236 local_irq_restore(flags);
240 /* RAM-Based Video */
241 static int rbv_setpalette(unsigned int regno, unsigned int red,
242 unsigned int green, unsigned int blue,
243 struct fb_info *info)
246 unsigned char _red =red>>8;
247 unsigned char _green=green>>8;
248 unsigned char _blue =blue>>8;
249 unsigned char _regno;
252 if (info->var.bits_per_pixel > 8)
253 return 1; /* failsafe */
255 local_irq_save(flags);
257 /* From the VideoToolbox driver. Seems to be saying that
258 * regno #254 and #255 are the important ones for 1-bit color,
259 * regno #252-255 are the important ones for 2-bit color, etc.
261 _regno = regno + (256-(1 << info->var.bits_per_pixel));
263 /* reset clut? (VideoToolbox sez "not necessary") */
264 nubus_writeb(0xFF, &rbv_cmap_regs->cntl);
267 /* tell clut which address to use. */
268 nubus_writeb(_regno, &rbv_cmap_regs->addr);
271 /* send one color channel at a time. */
272 nubus_writeb(_red, &rbv_cmap_regs->lut);
274 nubus_writeb(_green, &rbv_cmap_regs->lut);
276 nubus_writeb(_blue, &rbv_cmap_regs->lut);
278 local_irq_restore(flags);
282 /* Macintosh Display Card (8*24) */
283 static int mdc_setpalette(unsigned int regno, unsigned int red,
284 unsigned int green, unsigned int blue,
285 struct fb_info *info)
287 volatile struct mdc_cmap_regs *cmap_regs =
288 nubus_slot_addr(video_slot);
290 unsigned char _red =red>>8;
291 unsigned char _green=green>>8;
292 unsigned char _blue =blue>>8;
293 unsigned char _regno=regno;
296 local_irq_save(flags);
298 /* the nop's are there to order writes. */
299 nubus_writeb(_regno, &cmap_regs->addr);
301 nubus_writeb(_red, &cmap_regs->lut);
303 nubus_writeb(_green, &cmap_regs->lut);
305 nubus_writeb(_blue, &cmap_regs->lut);
307 local_irq_restore(flags);
311 /* Toby frame buffer */
312 static int toby_setpalette(unsigned int regno, unsigned int red,
313 unsigned int green, unsigned int blue,
314 struct fb_info *info)
316 volatile struct toby_cmap_regs *cmap_regs =
317 nubus_slot_addr(video_slot);
318 unsigned int bpp = info->var.bits_per_pixel;
320 unsigned char _red =~(red>>8);
321 unsigned char _green=~(green>>8);
322 unsigned char _blue =~(blue>>8);
323 unsigned char _regno = (regno << (8 - bpp)) | (0xFF >> bpp);
326 local_irq_save(flags);
328 nubus_writeb(_regno, &cmap_regs->addr);
330 nubus_writeb(_red, &cmap_regs->lut);
332 nubus_writeb(_green, &cmap_regs->lut);
334 nubus_writeb(_blue, &cmap_regs->lut);
336 local_irq_restore(flags);
340 /* Jet frame buffer */
341 static int jet_setpalette(unsigned int regno, unsigned int red,
342 unsigned int green, unsigned int blue,
343 struct fb_info *info)
345 volatile struct jet_cmap_regs *cmap_regs =
346 nubus_slot_addr(video_slot);
348 unsigned char _red = (red>>8);
349 unsigned char _green = (green>>8);
350 unsigned char _blue = (blue>>8);
353 local_irq_save(flags);
355 nubus_writeb(regno, &cmap_regs->addr);
357 nubus_writeb(_red, &cmap_regs->lut);
359 nubus_writeb(_green, &cmap_regs->lut);
361 nubus_writeb(_blue, &cmap_regs->lut);
363 local_irq_restore(flags);
368 * Civic framebuffer -- Quadra AV built-in video. A chip
369 * called Sebastian holds the actual color palettes, and
370 * apparently, there are two different banks of 512K RAM
371 * which can act as separate framebuffers for doing video
372 * input and viewing the screen at the same time! The 840AV
373 * Can add another 1MB RAM to give the two framebuffers
376 static int civic_setpalette(unsigned int regno, unsigned int red,
377 unsigned int green, unsigned int blue,
378 struct fb_info *info)
383 if (info->var.bits_per_pixel > 8)
384 return 1; /* failsafe */
390 local_irq_save(flags);
392 /* Set the register address */
393 nubus_writeb(regno, &civic_cmap_regs->addr);
397 * Grab a status word and do some checking;
398 * Then finally write the clut!
400 clut_status = nubus_readb(&civic_cmap_regs->status2);
402 if ((clut_status & 0x0008) == 0)
405 if ((clut_status & 0x000D) != 0)
407 nubus_writeb(0x00, &civic_cmap_regs->lut);
409 nubus_writeb(0x00, &civic_cmap_regs->lut);
414 nubus_writeb(red, &civic_cmap_regs->lut);
416 nubus_writeb(green, &civic_cmap_regs->lut);
418 nubus_writeb(blue, &civic_cmap_regs->lut);
420 nubus_writeb(0x00, &civic_cmap_regs->lut);
426 junk = nubus_readb(&civic_cmap_regs->lut);
428 junk = nubus_readb(&civic_cmap_regs->lut);
430 junk = nubus_readb(&civic_cmap_regs->lut);
432 junk = nubus_readb(&civic_cmap_regs->lut);
435 if ((clut_status & 0x000D) != 0)
437 nubus_writeb(0x00, &civic_cmap_regs->lut);
439 nubus_writeb(0x00, &civic_cmap_regs->lut);
443 nubus_writeb(red, &civic_cmap_regs->lut);
445 nubus_writeb(green, &civic_cmap_regs->lut);
447 nubus_writeb(blue, &civic_cmap_regs->lut);
449 nubus_writeb(junk, &civic_cmap_regs->lut);
452 local_irq_restore(flags);
457 * The CSC is the framebuffer on the PowerBook 190 series
458 * (and the 5300 too, but that's a PowerMac). This function
459 * brought to you in part by the ECSC driver for MkLinux.
461 static int csc_setpalette(unsigned int regno, unsigned int red,
462 unsigned int green, unsigned int blue,
463 struct fb_info *info)
466 nubus_writeb(regno, &csc_cmap_regs->clut_waddr);
467 nubus_writeb(red, &csc_cmap_regs->clut_data);
468 nubus_writeb(green, &csc_cmap_regs->clut_data);
469 nubus_writeb(blue, &csc_cmap_regs->clut_data);
473 static int macfb_setcolreg(unsigned regno, unsigned red, unsigned green,
474 unsigned blue, unsigned transp,
475 struct fb_info *fb_info)
478 * Set a single color register. The values supplied are
479 * already rounded down to the hardware's capabilities
480 * (according to the entries in the `var' structure).
481 * Return non-zero for invalid regno.
484 if (regno >= fb_info->cmap.len)
487 if (fb_info->var.bits_per_pixel <= 8) {
488 switch (fb_info->var.bits_per_pixel) {
490 /* We shouldn't get here */
495 if (macfb_setpalette)
496 macfb_setpalette(regno, red, green, blue,
502 } else if (regno < 16) {
503 switch (fb_info->var.bits_per_pixel) {
505 if (fb_info->var.red.offset == 10) {
507 ((u32*) (fb_info->pseudo_palette))[regno] =
508 ((red & 0xf800) >> 1) |
509 ((green & 0xf800) >> 6) |
510 ((blue & 0xf800) >> 11) |
511 ((transp != 0) << 15);
514 ((u32*) (fb_info->pseudo_palette))[regno] =
515 ((red & 0xf800) >> 0) |
516 ((green & 0xfc00) >> 5) |
517 ((blue & 0xf800) >> 11);
521 * 24-bit colour almost doesn't exist on 68k Macs --
522 * http://support.apple.com/kb/TA28634 (Old Article: 10992)
529 ((u32 *)(fb_info->pseudo_palette))[regno] =
530 (red << fb_info->var.red.offset) |
531 (green << fb_info->var.green.offset) |
532 (blue << fb_info->var.blue.offset);
540 static struct fb_ops macfb_ops = {
541 .owner = THIS_MODULE,
542 .fb_setcolreg = macfb_setcolreg,
543 .fb_fillrect = cfb_fillrect,
544 .fb_copyarea = cfb_copyarea,
545 .fb_imageblit = cfb_imageblit,
548 static void __init macfb_setup(char *options)
552 if (!options || !*options)
555 while ((this_opt = strsep(&options, ",")) != NULL) {
559 if (!strcmp(this_opt, "inverse"))
562 if (!strcmp(this_opt, "vidtest"))
563 vidtest = 1; /* enable experimental CLUT code */
567 static void __init iounmap_macfb(void)
570 iounmap(dafb_cmap_regs);
571 if (v8_brazil_cmap_regs)
572 iounmap(v8_brazil_cmap_regs);
574 iounmap(rbv_cmap_regs);
576 iounmap(civic_cmap_regs);
578 iounmap(csc_cmap_regs);
581 static int __init macfb_init(void)
583 int video_cmap_len, video_is_nubus = 0;
584 struct nubus_dev* ndev = NULL;
588 if (fb_get_options("macfb", &option))
595 if (mac_bi_data.id == MAC_MODEL_Q630 ||
596 mac_bi_data.id == MAC_MODEL_P588)
597 return -ENODEV; /* See valkyriefb.c */
599 macfb_defined.xres = mac_bi_data.dimensions & 0xFFFF;
600 macfb_defined.yres = mac_bi_data.dimensions >> 16;
601 macfb_defined.bits_per_pixel = mac_bi_data.videodepth;
603 macfb_fix.line_length = mac_bi_data.videorow;
604 macfb_fix.smem_len = macfb_fix.line_length * macfb_defined.yres;
605 /* Note: physical address (since 2.1.127) */
606 macfb_fix.smem_start = mac_bi_data.videoaddr;
609 * This is actually redundant with the initial mappings.
610 * However, there are some non-obvious aspects to the way
611 * those mappings are set up, so this is in fact the safest
612 * way to ensure that this driver will work on every possible Mac
614 fb_info.screen_base = ioremap(mac_bi_data.videoaddr, macfb_fix.smem_len);
616 printk("macfb: framebuffer at 0x%08lx, mapped to 0x%p, size %dk\n",
617 macfb_fix.smem_start, fb_info.screen_base,
618 macfb_fix.smem_len / 1024);
619 printk("macfb: mode is %dx%dx%d, linelength=%d\n",
620 macfb_defined.xres, macfb_defined.yres,
621 macfb_defined.bits_per_pixel, macfb_fix.line_length);
624 * Fill in the available video resolution
626 macfb_defined.xres_virtual = macfb_defined.xres;
627 macfb_defined.yres_virtual = macfb_defined.yres;
628 macfb_defined.height = PIXEL_TO_MM(macfb_defined.yres);
629 macfb_defined.width = PIXEL_TO_MM(macfb_defined.xres);
631 printk("macfb: scrolling: redraw\n");
633 /* some dummy values for timing to make fbset happy */
634 macfb_defined.pixclock = 10000000 / macfb_defined.xres *
635 1000 / macfb_defined.yres;
636 macfb_defined.left_margin = (macfb_defined.xres / 8) & 0xf8;
637 macfb_defined.hsync_len = (macfb_defined.xres / 8) & 0xf8;
639 switch (macfb_defined.bits_per_pixel) {
642 * XXX: I think this will catch any program that tries
643 * to do FBIO_PUTCMAP when the visual is monochrome.
645 macfb_defined.red.length = macfb_defined.bits_per_pixel;
646 macfb_defined.green.length = macfb_defined.bits_per_pixel;
647 macfb_defined.blue.length = macfb_defined.bits_per_pixel;
649 macfb_fix.visual = FB_VISUAL_MONO01;
654 macfb_defined.red.length = macfb_defined.bits_per_pixel;
655 macfb_defined.green.length = macfb_defined.bits_per_pixel;
656 macfb_defined.blue.length = macfb_defined.bits_per_pixel;
657 video_cmap_len = 1 << macfb_defined.bits_per_pixel;
658 macfb_fix.visual = FB_VISUAL_PSEUDOCOLOR;
661 macfb_defined.transp.offset = 15;
662 macfb_defined.transp.length = 1;
663 macfb_defined.red.offset = 10;
664 macfb_defined.red.length = 5;
665 macfb_defined.green.offset = 5;
666 macfb_defined.green.length = 5;
667 macfb_defined.blue.offset = 0;
668 macfb_defined.blue.length = 5;
669 printk("macfb: directcolor: "
670 "size=1:5:5:5, shift=15:10:5:0\n");
673 * Should actually be FB_VISUAL_DIRECTCOLOR, but this
676 macfb_fix.visual = FB_VISUAL_TRUECOLOR;
680 macfb_defined.red.offset = 16;
681 macfb_defined.red.length = 8;
682 macfb_defined.green.offset = 8;
683 macfb_defined.green.length = 8;
684 macfb_defined.blue.offset = 0;
685 macfb_defined.blue.length = 8;
686 printk("macfb: truecolor: "
687 "size=0:8:8:8, shift=0:16:8:0\n");
689 macfb_fix.visual = FB_VISUAL_TRUECOLOR;
692 macfb_fix.visual = FB_VISUAL_MONO01;
693 printk("macfb: unknown or unsupported bit depth: %d\n",
694 macfb_defined.bits_per_pixel);
699 * We take a wild guess that if the video physical address is
700 * in nubus slot space, that the nubus card is driving video.
701 * Penguin really ought to tell us whether we are using internal
703 * Hopefully we only find one of them. Otherwise our NuBus
704 * code is really broken :-)
707 while ((ndev = nubus_find_type(NUBUS_CAT_DISPLAY, NUBUS_TYPE_VIDEO, ndev))
710 if (!(mac_bi_data.videoaddr >= ndev->board->slot_addr
711 && (mac_bi_data.videoaddr <
712 (unsigned long)nubus_slot_addr(ndev->board->slot+1))))
715 /* We should probably just use the slot address... */
716 video_slot = ndev->board->slot;
718 switch(ndev->dr_hw) {
719 case NUBUS_DRHW_APPLE_MDC:
720 strcpy(macfb_fix.id, "Mac Disp. Card");
721 macfb_setpalette = mdc_setpalette;
722 macfb_defined.activate = FB_ACTIVATE_NOW;
724 case NUBUS_DRHW_APPLE_TFB:
725 strcpy(macfb_fix.id, "Toby");
726 macfb_setpalette = toby_setpalette;
727 macfb_defined.activate = FB_ACTIVATE_NOW;
729 case NUBUS_DRHW_APPLE_JET:
730 strcpy(macfb_fix.id, "Jet");
731 macfb_setpalette = jet_setpalette;
732 macfb_defined.activate = FB_ACTIVATE_NOW;
735 strcpy(macfb_fix.id, "Generic NuBus");
740 /* If it's not a NuBus card, it must be internal video */
742 switch (mac_bi_data.id) {
745 * Note: these first four have the v7 DAFB, which is
746 * known to be rather unlike the ones used in the
750 case MAC_MODEL_P475F:
762 strcpy(macfb_fix.id, "DAFB");
763 macfb_setpalette = dafb_setpalette;
764 macfb_defined.activate = FB_ACTIVATE_NOW;
765 dafb_cmap_regs = ioremap(DAFB_BASE, 0x1000);
769 * LC II uses the V8 framebuffer
772 strcpy(macfb_fix.id, "V8");
773 macfb_setpalette = v8_brazil_setpalette;
774 macfb_defined.activate = FB_ACTIVATE_NOW;
775 v8_brazil_cmap_regs = ioremap(DAC_BASE, 0x1000);
779 * IIvi, IIvx use the "Brazil" framebuffer (which is
780 * very much like the V8, it seems, and probably uses
786 strcpy(macfb_fix.id, "Brazil");
787 macfb_setpalette = v8_brazil_setpalette;
788 macfb_defined.activate = FB_ACTIVATE_NOW;
789 v8_brazil_cmap_regs = ioremap(DAC_BASE, 0x1000);
793 * LC III (and friends) use the Sonora framebuffer
794 * Incidentally this is also used in the non-AV models
795 * of the x100 PowerMacs
796 * These do in fact seem to use the same DAC interface
799 case MAC_MODEL_LCIII:
803 macfb_setpalette = v8_brazil_setpalette;
804 macfb_defined.activate = FB_ACTIVATE_NOW;
805 strcpy(macfb_fix.id, "Sonora");
806 v8_brazil_cmap_regs = ioremap(DAC_BASE, 0x1000);
810 * IIci and IIsi use the infamous RBV chip
811 * (the IIsi is just a rebadged and crippled
812 * IIci in a different case, BTW)
816 macfb_setpalette = rbv_setpalette;
817 macfb_defined.activate = FB_ACTIVATE_NOW;
818 strcpy(macfb_fix.id, "RBV");
819 rbv_cmap_regs = ioremap(DAC_BASE, 0x1000);
823 * AVs use the Civic framebuffer
827 macfb_setpalette = civic_setpalette;
828 macfb_defined.activate = FB_ACTIVATE_NOW;
829 strcpy(macfb_fix.id, "Civic");
830 civic_cmap_regs = ioremap(CIVIC_BASE, 0x1000);
836 * We think this may be like the LC II
840 macfb_setpalette = v8_brazil_setpalette;
841 macfb_defined.activate = FB_ACTIVATE_NOW;
842 v8_brazil_cmap_regs =
843 ioremap(DAC_BASE, 0x1000);
845 strcpy(macfb_fix.id, "LC");
849 * We think this may be like the LC II
853 macfb_setpalette = v8_brazil_setpalette;
854 macfb_defined.activate = FB_ACTIVATE_NOW;
855 v8_brazil_cmap_regs =
856 ioremap(DAC_BASE, 0x1000);
858 strcpy(macfb_fix.id, "Color Classic");
862 * And we *do* mean "weirdos"
865 strcpy(macfb_fix.id, "Mac TV");
869 * These don't have colour, so no need to worry
873 strcpy(macfb_fix.id, "Monochrome");
877 * Powerbooks are particularly difficult. Many of
878 * them have separate framebuffers for external and
879 * internal video, which is admittedly pretty cool,
880 * but will be a bit of a headache to support here.
881 * Also, many of them are grayscale, and we don't
882 * really support that.
885 case MAC_MODEL_PB140:
886 case MAC_MODEL_PB145:
887 case MAC_MODEL_PB170:
888 strcpy(macfb_fix.id, "DDC");
892 * Internal is GSC, External (if present) is ViSC
894 case MAC_MODEL_PB150: /* no external video */
895 case MAC_MODEL_PB160:
896 case MAC_MODEL_PB165:
897 case MAC_MODEL_PB180:
898 case MAC_MODEL_PB210:
899 case MAC_MODEL_PB230:
900 strcpy(macfb_fix.id, "GSC");
904 * Internal is TIM, External is ViSC
906 case MAC_MODEL_PB165C:
907 case MAC_MODEL_PB180C:
908 strcpy(macfb_fix.id, "TIM");
912 * Internal is CSC, External is Keystone+Ariel.
914 case MAC_MODEL_PB190: /* external video is optional */
915 case MAC_MODEL_PB520:
916 case MAC_MODEL_PB250:
917 case MAC_MODEL_PB270C:
918 case MAC_MODEL_PB280:
919 case MAC_MODEL_PB280C:
920 macfb_setpalette = csc_setpalette;
921 macfb_defined.activate = FB_ACTIVATE_NOW;
922 strcpy(macfb_fix.id, "CSC");
923 csc_cmap_regs = ioremap(CSC_BASE, 0x1000);
927 strcpy(macfb_fix.id, "Unknown");
931 fb_info.fbops = &macfb_ops;
932 fb_info.var = macfb_defined;
933 fb_info.fix = macfb_fix;
934 fb_info.pseudo_palette = pseudo_palette;
935 fb_info.flags = FBINFO_DEFAULT;
937 err = fb_alloc_cmap(&fb_info.cmap, video_cmap_len, 0);
941 err = register_framebuffer(&fb_info);
945 printk("fb%d: %s frame buffer device\n",
946 fb_info.node, fb_info.fix.id);
950 fb_dealloc_cmap(&fb_info.cmap);
952 iounmap(fb_info.screen_base);
957 module_init(macfb_init);
958 MODULE_LICENSE("GPL");