diff options
Diffstat (limited to 'drivers/video')
38 files changed, 2600 insertions, 2274 deletions
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c index e4e4d433b00..9ee67d6da71 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c @@ -1931,22 +1931,22 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i * PowerMac2,2 summer 2000 iMacs * PowerMac4,1 january 2001 iMacs "flower power" */ - if (machine_is_compatible("PowerMac2,1") || - machine_is_compatible("PowerMac2,2") || - machine_is_compatible("PowerMac4,1")) + if (of_machine_is_compatible("PowerMac2,1") || + of_machine_is_compatible("PowerMac2,2") || + of_machine_is_compatible("PowerMac4,1")) default_vmode = VMODE_1024_768_75; /* iBook SE */ - if (machine_is_compatible("PowerBook2,2")) + if (of_machine_is_compatible("PowerBook2,2")) default_vmode = VMODE_800_600_60; /* PowerBook Firewire (Pismo), iBook Dual USB */ - if (machine_is_compatible("PowerBook3,1") || - machine_is_compatible("PowerBook4,1")) + if (of_machine_is_compatible("PowerBook3,1") || + of_machine_is_compatible("PowerBook4,1")) default_vmode = VMODE_1024_768_60; /* PowerBook Titanium */ - if (machine_is_compatible("PowerBook3,2")) + if (of_machine_is_compatible("PowerBook3,2")) default_vmode = VMODE_1152_768_60; if (default_cmode > 16) diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index 1ddeb4c3476..e45ab8db2dd 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c @@ -2439,7 +2439,7 @@ static int __devinit aty_init(struct fb_info *info) * The Apple iBook1 uses non-standard memory frequencies. * We detect it and set the frequency manually. */ - if (machine_is_compatible("PowerBook2,1")) { + if (of_machine_is_compatible("PowerBook2,1")) { par->pll_limits.mclk = 70; par->pll_limits.xclk = 53; } @@ -2659,7 +2659,7 @@ static int __devinit aty_init(struct fb_info *info) FBINFO_HWACCEL_YPAN; #ifdef CONFIG_PMAC_BACKLIGHT - if (M64_HAS(G3_PB_1_1) && machine_is_compatible("PowerBook1,1")) { + if (M64_HAS(G3_PB_1_1) && of_machine_is_compatible("PowerBook1,1")) { /* * these bits let the 101 powerbook * wake up from sleep -- paulus @@ -2690,9 +2690,9 @@ static int __devinit aty_init(struct fb_info *info) if (M64_HAS(G3_PB_1024x768)) /* G3 PowerBook with 1024x768 LCD */ default_vmode = VMODE_1024_768_60; - else if (machine_is_compatible("iMac")) + else if (of_machine_is_compatible("iMac")) default_vmode = VMODE_1024_768_75; - else if (machine_is_compatible("PowerBook2,1")) + else if (of_machine_is_compatible("PowerBook2,1")) /* iBook with 800x600 LCD */ default_vmode = VMODE_800_600_60; else @@ -3104,7 +3104,7 @@ static int __devinit atyfb_setup_sparc(struct pci_dev *pdev, } dp = pci_device_to_OF_node(pdev); - if (node == dp->node) { + if (node == dp->phandle) { struct fb_var_screeninfo *var = &default_var; unsigned int N, P, Q, M, T, R; u32 v_total, h_total; diff --git a/drivers/video/aty/radeon_backlight.c b/drivers/video/aty/radeon_backlight.c index 1a056adb61c..fa1198c4ccc 100644 --- a/drivers/video/aty/radeon_backlight.c +++ b/drivers/video/aty/radeon_backlight.c @@ -175,9 +175,9 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo) #ifdef CONFIG_PMAC_BACKLIGHT pdata->negative = pdata->negative || - machine_is_compatible("PowerBook4,3") || - machine_is_compatible("PowerBook6,3") || - machine_is_compatible("PowerBook6,5"); + of_machine_is_compatible("PowerBook4,3") || + of_machine_is_compatible("PowerBook6,3") || + of_machine_is_compatible("PowerBook6,5"); #endif rinfo->info->bl_dev = bd; diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c index 72d68b3dc47..4637bcbe03a 100644 --- a/drivers/video/fsl-diu-fb.c +++ b/drivers/video/fsl-diu-fb.c @@ -1633,6 +1633,11 @@ static int __init fsl_diu_setup(char *options) #endif static struct of_device_id fsl_diu_match[] = { +#ifdef CONFIG_PPC_MPC512x + { + .compatible = "fsl,mpc5121-diu", + }, +#endif { .compatible = "fsl,diu", }, diff --git a/drivers/video/macfb.c b/drivers/video/macfb.c index d66887e8cbb..43207cc6cc1 100644 --- a/drivers/video/macfb.c +++ b/drivers/video/macfb.c @@ -1,29 +1,33 @@ -/* macfb.c: Generic framebuffer for Macs whose colourmaps/modes we - don't know how to set */ - -/* (c) 1999 David Huggins-Daines <dhd@debian.org> - - Primarily based on vesafb.c, by Gerd Knorr - (c) 1998 Gerd Knorr <kraxel@cs.tu-berlin.de> - - Also uses information and code from: - - The original macfb.c from Linux/mac68k 2.0, by Alan Cox, Juergen - Mellinger, Mikael Forselius, Michael Schmitz, and others. - - valkyriefb.c, by Martin Costabel, Kevin Schoedel, Barry Nathan, Dan - Jacobowitz, Paul Mackerras, Fabio Riccardi, and Geert Uytterhoeven. - - This code is free software. You may copy, modify, and distribute - it subject to the terms and conditions of the GNU General Public - License, version 2, or any later version, at your convenience. */ +/* + * macfb.c: Generic framebuffer for Macs whose colourmaps/modes we + * don't know how to set. + * + * (c) 1999 David Huggins-Daines <dhd@debian.org> + * + * Primarily based on vesafb.c, by Gerd Knorr + * (c) 1998 Gerd Knorr <kraxel@cs.tu-berlin.de> + * + * Also uses information and code from: + * + * The original macfb.c from Linux/mac68k 2.0, by Alan Cox, Juergen + * Mellinger, Mikael Forselius, Michael Schmitz, and others. + * + * valkyriefb.c, by Martin Costabel, Kevin Schoedel, Barry Nathan, Dan + * Jacobowitz, Paul Mackerras, Fabio Riccardi, and Geert Uytterhoeven. + * + * The VideoToolbox "Bugs" web page at + * http://rajsky.psych.nyu.edu/Tips/VideoBugs.html + * + * This code is free software. You may copy, modify, and distribute + * it subject to the terms and conditions of the GNU General Public + * License, version 2, or any later version, at your convenience. + */ #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/string.h> #include <linux/mm.h> -#include <linux/slab.h> #include <linux/delay.h> #include <linux/nubus.h> #include <linux/init.h> @@ -31,9 +35,6 @@ #include <asm/setup.h> #include <asm/bootinfo.h> -#include <asm/uaccess.h> -#include <asm/pgtable.h> -#include <asm/irq.h> #include <asm/macintosh.h> #include <asm/io.h> @@ -44,7 +45,7 @@ #define DAFB_BASE 0xf9800200 /* Address for the built-in Civic framebuffer in Quadra AVs */ -#define CIVIC_BASE 0x50f30800 /* Only tested on 660AV! */ +#define CIVIC_BASE 0x50f30800 /* GSC (Gray Scale Controller) base address */ #define GSC_BASE 0x50F20000 @@ -52,37 +53,9 @@ /* CSC (Color Screen Controller) base address */ #define CSC_BASE 0x50F20000 -static int (*macfb_setpalette) (unsigned int regno, unsigned int red, - unsigned int green, unsigned int blue, - struct fb_info *info) = NULL; -static int valkyrie_setpalette (unsigned int regno, unsigned int red, - unsigned int green, unsigned int blue, - struct fb_info *info); -static int dafb_setpalette (unsigned int regno, unsigned int red, - unsigned int green, unsigned int blue, - struct fb_info *fb_info); -static int rbv_setpalette (unsigned int regno, unsigned int red, - unsigned int green, unsigned int blue, - struct fb_info *fb_info); -static int mdc_setpalette (unsigned int regno, unsigned int red, - unsigned int green, unsigned int blue, - struct fb_info *fb_info); -static int toby_setpalette (unsigned int regno, unsigned int red, - unsigned int green, unsigned int blue, - struct fb_info *fb_info); -static int civic_setpalette (unsigned int regno, unsigned int red, - unsigned int green, unsigned int blue, - struct fb_info *fb_info); -static int csc_setpalette (unsigned int regno, unsigned int red, - unsigned int green, unsigned int blue, - struct fb_info *fb_info); - -static struct { - unsigned char addr; - /* Note: word-aligned */ - char pad[3]; - unsigned char lut; -} __iomem *valkyrie_cmap_regs; +static int (*macfb_setpalette)(unsigned int regno, unsigned int red, + unsigned int green, unsigned int blue, + struct fb_info *info); static struct { unsigned char addr; @@ -116,15 +89,15 @@ static struct { } __iomem *civic_cmap_regs; static struct { - char pad1[0x40]; - unsigned char clut_waddr; /* 0x40 */ - char pad2; - unsigned char clut_data; /* 0x42 */ - char pad3[0x3]; - unsigned char clut_raddr; /* 0x46 */ + char pad1[0x40]; + unsigned char clut_waddr; /* 0x40 */ + char pad2; + unsigned char clut_data; /* 0x42 */ + char pad3[0x3]; + unsigned char clut_raddr; /* 0x46 */ } __iomem *csc_cmap_regs; -/* We will leave these the way they are for the time being */ +/* The registers in these structs are in NuBus slot space */ struct mdc_cmap_regs { char pad1[0x200200]; unsigned char addr; @@ -145,13 +118,10 @@ struct jet_cmap_regs { unsigned char lut; }; -#define PIXEL_TO_MM(a) (((a)*10)/28) /* width in mm at 72 dpi */ - -/* mode */ -static int video_slot = 0; +#define PIXEL_TO_MM(a) (((a)*10)/28) /* width in mm at 72 dpi */ static struct fb_var_screeninfo macfb_defined = { - .bits_per_pixel = 8, + .bits_per_pixel = 8, .activate = FB_ACTIVATE_NOW, .width = -1, .height = -1, @@ -167,181 +137,152 @@ static struct fb_fix_screeninfo macfb_fix = { .accel = FB_ACCEL_NONE, }; +static void *slot_addr; static struct fb_info fb_info; static u32 pseudo_palette[16]; -static int inverse = 0; -static int vidtest = 0; +static int inverse; +static int vidtest; -static int valkyrie_setpalette (unsigned int regno, unsigned int red, - unsigned int green, unsigned int blue, - struct fb_info *info) -{ - unsigned long flags; - - red >>= 8; - green >>= 8; - blue >>= 8; - - local_irq_save(flags); - - /* tell clut which address to fill */ - nubus_writeb(regno, &valkyrie_cmap_regs->addr); - nop(); - - /* send one color channel at a time */ - nubus_writeb(red, &valkyrie_cmap_regs->lut); - nop(); - nubus_writeb(green, &valkyrie_cmap_regs->lut); - nop(); - nubus_writeb(blue, &valkyrie_cmap_regs->lut); - - local_irq_restore(flags); - return 0; -} - -/* Unlike the Valkyrie, the DAFB cannot set individual colormap - registers. Therefore, we do what the MacOS driver does (no - kidding!) and simply set them one by one until we hit the one we - want. */ -static int dafb_setpalette (unsigned int regno, unsigned int red, - unsigned int green, unsigned int blue, - struct fb_info *info) +/* + * Unlike the Valkyrie, the DAFB cannot set individual colormap + * registers. Therefore, we do what the MacOS driver does (no + * kidding!) and simply set them one by one until we hit the one we + * want. + */ +static int dafb_setpalette(unsigned int regno, unsigned int red, + unsigned int green, unsigned int blue, + struct fb_info *info) { - /* FIXME: really, really need to use ioremap() here, - phys_to_virt() doesn't work anymore */ static int lastreg = -1; unsigned long flags; - - red >>= 8; - green >>= 8; - blue >>= 8; local_irq_save(flags); - - /* fbdev will set an entire colourmap, but X won't. Hopefully - this should accommodate both of them */ - if (regno != lastreg+1) { + + /* + * fbdev will set an entire colourmap, but X won't. Hopefully + * this should accommodate both of them + */ + if (regno != lastreg + 1) { int i; - + /* Stab in the dark trying to reset the CLUT pointer */ nubus_writel(0, &dafb_cmap_regs->reset); nop(); - + /* Loop until we get to the register we want */ for (i = 0; i < regno; i++) { - nubus_writeb(info->cmap.red[i] >> 8, &dafb_cmap_regs->lut); + nubus_writeb(info->cmap.red[i] >> 8, + &dafb_cmap_regs->lut); nop(); - nubus_writeb(info->cmap.green[i] >> 8, &dafb_cmap_regs->lut); + nubus_writeb(info->cmap.green[i] >> 8, + &dafb_cmap_regs->lut); nop(); - nubus_writeb(info->cmap.blue[i] >> 8, &dafb_cmap_regs->lut); + nubus_writeb(info->cmap.blue[i] >> 8, + &dafb_cmap_regs->lut); nop(); } } - + nubus_writeb(red, &dafb_cmap_regs->lut); nop(); nubus_writeb(green, &dafb_cmap_regs->lut); nop(); nubus_writeb(blue, &dafb_cmap_regs->lut); - + local_irq_restore(flags); lastreg = regno; return 0; } /* V8 and Brazil seem to use the same DAC. Sonora does as well. */ -static int v8_brazil_setpalette (unsigned int regno, unsigned int red, - unsigned int green, unsigned int blue, - struct fb_info *info) +static int v8_brazil_setpalette(unsigned int regno, unsigned int red, + unsigned int green, unsigned int blue, + struct fb_info *info) { unsigned int bpp = info->var.bits_per_pixel; - unsigned char _red =red>>8; - unsigned char _green=green>>8; - unsigned char _blue =blue>>8; - unsigned char _regno; unsigned long flags; - if (bpp > 8) return 1; /* failsafe */ + if (bpp > 8) + return 1; /* failsafe */ local_irq_save(flags); /* On these chips, the CLUT register numbers are spread out - across the register space. Thus: - - In 8bpp, all regnos are valid. - - In 4bpp, the regnos are 0x0f, 0x1f, 0x2f, etc, etc - - In 2bpp, the regnos are 0x3f, 0x7f, 0xbf, 0xff */ - _regno = (regno << (8 - bpp)) | (0xFF >> bpp); - nubus_writeb(_regno, &v8_brazil_cmap_regs->addr); nop(); + * across the register space. Thus: + * In 8bpp, all regnos are valid. + * In 4bpp, the regnos are 0x0f, 0x1f, 0x2f, etc, etc + * In 2bpp, the regnos are 0x3f, 0x7f, 0xbf, 0xff + */ + regno = (regno << (8 - bpp)) | (0xFF >> bpp); + nubus_writeb(regno, &v8_brazil_cmap_regs->addr); + nop(); /* send one color channel at a time */ - nubus_writeb(_red, &v8_brazil_cmap_regs->lut); nop(); - nubus_writeb(_green, &v8_brazil_cmap_regs->lut); nop(); - nubus_writeb(_blue, &v8_brazil_cmap_regs->lut); + nubus_writeb(red, &v8_brazil_cmap_regs->lut); + nop(); + nubus_writeb(green, &v8_brazil_cmap_regs->lut); + nop(); + nubus_writeb(blue, &v8_brazil_cmap_regs->lut); - local_irq_restore(flags); + local_irq_restore(flags); return 0; } -static int rbv_setpalette (unsigned int regno, unsigned int red, - unsigned int green, unsigned int blue, - struct fb_info *info) +/* RAM-Based Video */ +static int rbv_setpalette(unsigned int regno, unsigned int red, + unsigned int green, unsigned int blue, + struct fb_info *info) { - /* use MSBs */ - unsigned char _red =red>>8; - unsigned char _green=green>>8; - unsigned char _blue =blue>>8; - unsigned char _regno; unsigned long flags; - if (info->var.bits_per_pixel > 8) return 1; /* failsafe */ + if (info->var.bits_per_pixel > 8) + return 1; /* failsafe */ local_irq_save(flags); - + /* From the VideoToolbox driver. Seems to be saying that * regno #254 and #255 are the important ones for 1-bit color, * regno #252-255 are the important ones for 2-bit color, etc. */ - _regno = regno + (256-(1 << info->var.bits_per_pixel)); + regno += 256 - (1 << info->var.bits_per_pixel); /* reset clut? (VideoToolbox sez "not necessary") */ - nubus_writeb(0xFF, &rbv_cmap_regs->cntl); nop(); - + nubus_writeb(0xFF, &rbv_cmap_regs->cntl); + nop(); + /* tell clut which address to use. */ - nubus_writeb(_regno, &rbv_cmap_regs->addr); nop(); - + nubus_writeb(regno, &rbv_cmap_regs->addr); + nop(); + /* send one color channel at a time. */ - nubus_writeb(_red, &rbv_cmap_regs->lut); nop(); - nubus_writeb(_green, &rbv_cmap_regs->lut); nop(); - nubus_writeb(_blue, &rbv_cmap_regs->lut); - - local_irq_restore(flags); /* done. */ + nubus_writeb(red, &rbv_cmap_regs->lut); + nop(); + nubus_writeb(green, &rbv_cmap_regs->lut); + nop(); + nubus_writeb(blue, &rbv_cmap_regs->lut); + + local_irq_restore(flags); return 0; } -/* Macintosh Display Card (8x24) */ +/* Macintosh Display Card (8*24) */ static int mdc_setpalette(unsigned int regno, unsigned int red, unsigned int green, unsigned int blue, struct fb_info *info) { - volatile struct mdc_cmap_regs *cmap_regs = - nubus_slot_addr(video_slot); - /* use MSBs */ - unsigned char _red =red>>8; - unsigned char _green=green>>8; - unsigned char _blue =blue>>8; - unsigned char _regno=regno; + struct mdc_cmap_regs *cmap_regs = slot_addr; unsigned long flags; local_irq_save(flags); - + /* the nop's are there to order writes. */ - nubus_writeb(_regno, &cmap_regs->addr); nop(); - nubus_writeb(_red, &cmap_regs->lut); nop(); - nubus_writeb(_green, &cmap_regs->lut); nop(); - nubus_writeb(_blue, &cmap_regs->lut); + nubus_writeb(regno, &cmap_regs->addr); + nop(); + nubus_writeb(red, &cmap_regs->lut); + nop(); + nubus_writeb(green, &cmap_regs->lut); + nop(); + nubus_writeb(blue, &cmap_regs->lut); local_irq_restore(flags); return 0; @@ -350,24 +291,26 @@ static int mdc_setpalette(unsigned int regno, unsigned int red, /* Toby frame buffer */ static int toby_setpalette(unsigned int regno, unsigned int red, unsigned int green, unsigned int blue, - struct fb_info *info) + struct fb_info *info) { - volatile struct toby_cmap_regs *cmap_regs = - nubus_slot_addr(video_slot); + struct toby_cmap_regs *cmap_regs = slot_addr; unsigned int bpp = info->var.bits_per_pixel; - /* use MSBs */ - unsigned char _red =~(red>>8); - unsigned char _green=~(green>>8); - unsigned char _blue =~(blue>>8); - unsigned char _regno = (regno << (8 - bpp)) | (0xFF >> bpp); unsigned long flags; + red = ~red; + green = ~green; + blue = ~blue; + regno = (regno << (8 - bpp)) | (0xFF >> bpp); + local_irq_save(flags); - - nubus_writeb(_regno, &cmap_regs->addr); nop(); - nubus_writeb(_red, &cmap_regs->lut); nop(); - nubus_writeb(_green, &cmap_regs->lut); nop(); - nubus_writeb(_blue, &cmap_regs->lut); + + nubus_writeb(regno, &cmap_regs->addr); + nop(); + nubus_writeb(red, &cmap_regs->lut); + nop(); + nubus_writeb(green, &cmap_regs->lut); + nop(); + nubus_writeb(blue, &cmap_regs->lut); local_irq_restore(flags); return 0; @@ -378,20 +321,18 @@ static int jet_setpalette(unsigned int regno, unsigned int red, unsigned int green, unsigned int blue, struct fb_info *info) { - volatile struct jet_cmap_regs *cmap_regs = - nubus_slot_addr(video_slot); - /* use MSBs */ - unsigned char _red = (red>>8); - unsigned char _green = (green>>8); - unsigned char _blue = (blue>>8); + struct jet_cmap_regs *cmap_regs = slot_addr; unsigned long flags; local_irq_save(flags); - - nubus_writeb(regno, &cmap_regs->addr); nop(); - nubus_writeb(_red, &cmap_regs->lut); nop(); - nubus_writeb(_green, &cmap_regs->lut); nop(); - nubus_writeb(_blue, &cmap_regs->lut); + + nubus_writeb(regno, &cmap_regs->addr); + nop(); + nubus_writeb(red, &cmap_regs->lut); + nop(); + nubus_writeb(green, &cmap_regs->lut); + nop(); + nubus_writeb(blue, &cmap_regs->lut); local_irq_restore(flags); return 0; @@ -400,53 +341,27 @@ static int jet_setpalette(unsigned int regno, unsigned int red, /* * Civic framebuffer -- Quadra AV built-in video. A chip * called Sebastian holds the actual color palettes, and - * apparently, there are two different banks of 512K RAM + * apparently, there are two different banks of 512K RAM * which can act as separate framebuffers for doing video * input and viewing the screen at the same time! The 840AV - * Can add another 1MB RAM to give the two framebuffers + * Can add another 1MB RAM to give the two framebuffers * 1MB RAM apiece. - * - * FIXME: this doesn't seem to work anymore. */ -static int civic_setpalette (unsigned int regno, unsigned int red, - unsigned int green, unsigned int blue, - struct fb_info *info) +static int civic_setpalette(unsigned int regno, unsigned int red, + unsigned int green, unsigned int blue, + struct fb_info *info) { - static int lastreg = -1; unsigned long flags; int clut_status; - if (info->var.bits_per_pixel > 8) return 1; /* failsafe */ - - red >>= 8; - green >>= 8; - blue >>= 8; + if (info->var.bits_per_pixel > 8) + return 1; /* failsafe */ local_irq_save(flags); - - /* - * Set the register address - */ - nubus_writeb(regno, &civic_cmap_regs->addr); nop(); - /* - * Wait for VBL interrupt here; - * They're usually not enabled from Penguin, so we won't check - */ -#if 0 - { -#define CIVIC_VBL_OFFSET 0x120 - volatile unsigned long *vbl = nubus_readl(civic_cmap_regs->vbl_addr + CIVIC_VBL_OFFSET); - /* do interrupt setup stuff here? */ - *vbl = 0L; nop(); /* clear */ - *vbl = 1L; nop(); /* set */ - while (*vbl != 0L) /* wait for next vbl */ - { - usleep(10); /* needed? */ - } - /* do interrupt shutdown stuff here? */ - } -#endif + /* Set the register address */ + nubus_writeb(regno, &civic_cmap_regs->addr); + nop(); /* * Grab a status word and do some checking; @@ -459,39 +374,52 @@ static int civic_setpalette (unsigned int regno, unsigned int red, #if 0 if ((clut_status & 0x000D) != 0) { - nubus_writeb(0x00, &civic_cmap_regs->lut); nop(); - nubus_writeb(0x00, &civic_cmap_regs->lut); nop(); + nubus_writeb(0x00, &civic_cmap_regs->lut); + nop(); + nubus_writeb(0x00, &civic_cmap_regs->lut); + nop(); } #endif - nubus_writeb( red, &civic_cmap_regs->lut); nop(); - nubus_writeb(green, &civic_cmap_regs->lut); nop(); - nubus_writeb( blue, &civic_cmap_regs->lut); nop(); - nubus_writeb( 0x00, &civic_cmap_regs->lut); nop(); + nubus_writeb(red, &civic_cmap_regs->lut); + nop(); + nubus_writeb(green, &civic_cmap_regs->lut); + nop(); + nubus_writeb(blue, &civic_cmap_regs->lut); + nop(); + nubus_writeb(0x00, &civic_cmap_regs->lut); } else { unsigned char junk; - junk = nubus_readb(&civic_cmap_regs->lut); nop(); - junk = nubus_readb(&civic_cmap_regs->lut); nop(); - junk = nubus_readb(&civic_cmap_regs->lut); nop(); - junk = nubus_readb(&civic_cmap_regs->lut); nop(); + junk = nubus_readb(&civic_cmap_regs->lut); + nop(); + junk = nubus_readb(&civic_cmap_regs->lut); + nop(); + junk = nubus_readb(&civic_cmap_regs->lut); + nop(); + junk = nubus_readb(&civic_cmap_regs->lut); + nop(); if ((clut_status & 0x000D) != 0) { - nubus_writeb(0x00, &civic_cmap_regs->lut); nop(); - nubus_writeb(0x00, &civic_cmap_regs->lut); nop(); + nubus_writeb(0x00, &civic_cmap_regs->lut); + nop(); + nubus_writeb(0x00, &civic_cmap_regs->lut); + nop(); } - nubus_writeb( red, &civic_cmap_regs->lut); nop(); - nubus_writeb(green, &civic_cmap_regs->lut); nop(); - nubus_writeb( blue, &civic_cmap_regs->lut); nop(); - nubus_writeb( junk, &civic_cmap_regs->lut); nop(); + nubus_writeb(red, &civic_cmap_regs->lut); + nop(); + nubus_writeb(green, &civic_cmap_regs->lut); + nop(); + nubus_writeb(blue, &civic_cmap_regs->lut); + nop(); + nubus_writeb(junk, &civic_cmap_regs->lut); } local_irq_restore(flags); - lastreg = regno; return 0; } @@ -500,16 +428,21 @@ static int civic_setpalette (unsigned int regno, unsigned int red, * (and the 5300 too, but that's a PowerMac). This function * brought to you in part by the ECSC driver for MkLinux. */ - -static int csc_setpalette (unsigned int regno, unsigned int red, - unsigned int green, unsigned int blue, - struct fb_info *info) +static int csc_setpalette(unsigned int regno, unsigned int red, + unsigned int gr |