aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/macfb.c
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2009-11-03 08:43:52 -0500
committerGeert Uytterhoeven <geert@linux-m68k.org>2010-02-27 12:31:13 -0500
commit11e8faca2e501c25d2f98c1b9534776a9a9704c5 (patch)
tree0f98adbc0b0880e5fc88d47a02c0c39f6f5085bd /drivers/video/macfb.c
parentd876c11a0fd40993136f5cc1e81371ccc6c21a63 (diff)
valkyriefb: various fixes
Valkyriefb and macfb will adopt the same card if they get the chance, so remove valkyrie support from macfb. Also fix the "valkyriefb: can't do 832x624x8" problem reported by Raylynn Knight some time ago, by adding vmode 13 support for CONFIG_MAC. Also add vmode 11 since that works too. Make use of the monitor sense lines on 68k Macs too. Also some cleanups. Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'drivers/video/macfb.c')
-rw-r--r--drivers/video/macfb.c53
1 files changed, 4 insertions, 49 deletions
diff --git a/drivers/video/macfb.c b/drivers/video/macfb.c
index d66887e8cbb1..a92322558ec0 100644
--- a/drivers/video/macfb.c
+++ b/drivers/video/macfb.c
@@ -55,9 +55,6 @@
55static int (*macfb_setpalette) (unsigned int regno, unsigned int red, 55static int (*macfb_setpalette) (unsigned int regno, unsigned int red,
56 unsigned int green, unsigned int blue, 56 unsigned int green, unsigned int blue,
57 struct fb_info *info) = NULL; 57 struct fb_info *info) = NULL;
58static int valkyrie_setpalette (unsigned int regno, unsigned int red,
59 unsigned int green, unsigned int blue,
60 struct fb_info *info);
61static int dafb_setpalette (unsigned int regno, unsigned int red, 58static int dafb_setpalette (unsigned int regno, unsigned int red,
62 unsigned int green, unsigned int blue, 59 unsigned int green, unsigned int blue,
63 struct fb_info *fb_info); 60 struct fb_info *fb_info);
@@ -79,13 +76,6 @@ static int csc_setpalette (unsigned int regno, unsigned int red,
79 76
80static struct { 77static struct {
81 unsigned char addr; 78 unsigned char addr;
82 /* Note: word-aligned */
83 char pad[3];
84 unsigned char lut;
85} __iomem *valkyrie_cmap_regs;
86
87static struct {
88 unsigned char addr;
89 unsigned char lut; 79 unsigned char lut;
90} __iomem *v8_brazil_cmap_regs; 80} __iomem *v8_brazil_cmap_regs;
91 81
@@ -172,33 +162,6 @@ static u32 pseudo_palette[16];
172static int inverse = 0; 162static int inverse = 0;
173static int vidtest = 0; 163static int vidtest = 0;
174 164
175static int valkyrie_setpalette (unsigned int regno, unsigned int red,
176 unsigned int green, unsigned int blue,
177 struct fb_info *info)
178{
179 unsigned long flags;
180
181 red >>= 8;
182 green >>= 8;
183 blue >>= 8;
184
185 local_irq_save(flags);
186
187 /* tell clut which address to fill */
188 nubus_writeb(regno, &valkyrie_cmap_regs->addr);
189 nop();
190
191 /* send one color channel at a time */
192 nubus_writeb(red, &valkyrie_cmap_regs->lut);
193 nop();
194 nubus_writeb(green, &valkyrie_cmap_regs->lut);
195 nop();
196 nubus_writeb(blue, &valkyrie_cmap_regs->lut);
197
198 local_irq_restore(flags);
199 return 0;
200}
201
202/* Unlike the Valkyrie, the DAFB cannot set individual colormap 165/* Unlike the Valkyrie, the DAFB cannot set individual colormap
203 registers. Therefore, we do what the MacOS driver does (no 166 registers. Therefore, we do what the MacOS driver does (no
204 kidding!) and simply set them one by one until we hit the one we 167 kidding!) and simply set them one by one until we hit the one we
@@ -614,8 +577,6 @@ static void __init macfb_setup(char *options)
614 577
615static void __init iounmap_macfb(void) 578static void __init iounmap_macfb(void)
616{ 579{
617 if (valkyrie_cmap_regs)
618 iounmap(valkyrie_cmap_regs);
619 if (dafb_cmap_regs) 580 if (dafb_cmap_regs)
620 iounmap(dafb_cmap_regs); 581 iounmap(dafb_cmap_regs);
621 if (v8_brazil_cmap_regs) 582 if (v8_brazil_cmap_regs)
@@ -642,6 +603,10 @@ static int __init macfb_init(void)
642 if (!MACH_IS_MAC) 603 if (!MACH_IS_MAC)
643 return -ENODEV; 604 return -ENODEV;
644 605
606 if (mac_bi_data.id == MAC_MODEL_Q630 ||
607 mac_bi_data.id == MAC_MODEL_P588)
608 return -ENODEV; /* See valkyriefb.c */
609
645 /* There can only be one internal video controller anyway so 610 /* There can only be one internal video controller anyway so
646 we're not too worried about this */ 611 we're not too worried about this */
647 macfb_defined.xres = mac_bi_data.dimensions & 0xFFFF; 612 macfb_defined.xres = mac_bi_data.dimensions & 0xFFFF;
@@ -784,16 +749,6 @@ static int __init macfb_init(void)
784 if (!video_is_nubus) 749 if (!video_is_nubus)
785 switch( mac_bi_data.id ) 750 switch( mac_bi_data.id )
786 { 751 {
787 /* Valkyrie Quadras */
788 case MAC_MODEL_Q630:
789 /* I'm not sure about this one */
790 case MAC_MODEL_P588:
791 strcpy(macfb_fix.id, "Valkyrie");
792 macfb_setpalette = valkyrie_setpalette;
793 macfb_defined.activate = FB_ACTIVATE_NOW;
794 valkyrie_cmap_regs = ioremap(DAC_BASE, 0x1000);
795 break;
796
797 /* DAFB Quadras */ 752 /* DAFB Quadras */
798 /* Note: these first four have the v7 DAFB, which is 753 /* Note: these first four have the v7 DAFB, which is
799 known to be rather unlike the ones used in the 754 known to be rather unlike the ones used in the