diff options
Diffstat (limited to 'drivers/video/pmag-ba-fb.c')
-rw-r--r-- | drivers/video/pmag-ba-fb.c | 93 |
1 files changed, 42 insertions, 51 deletions
diff --git a/drivers/video/pmag-ba-fb.c b/drivers/video/pmag-ba-fb.c index 7987082fc..1ba65e446 100644 --- a/drivers/video/pmag-ba-fb.c +++ b/drivers/video/pmag-ba-fb.c @@ -1,5 +1,5 @@ /* - * linux/drivers/video/pmagbafb.c + * linux/drivers/video/pmag-ba-fb.c * * PMAG-BA TurboChannel framebuffer card support ... derived from: * "HP300 Topcat framebuffer support (derived from macfb of all things) @@ -10,9 +10,10 @@ * "PMAG-BA TURBOchannel Color Frame Buffer * Functional Specification", Revision 1.2, August 27, 1990 * - * DECstation related code Copyright (C) 1999, 2000 by - * Michael Engel <engel@unix-ag.org>, Karsten Merker <merker@guug.de> - * and Harald Koerfgen <harald@unix-ag.org>. + * DECstation related code Copyright (C) 1999, 2000, 2001 by + * Michael Engel <engel@unix-ag.org>, + * Karsten Merker <merker@linuxtag.org> and + * Harald Koerfgen <harald@unix-ag.org>. * This file is subject to the terms and conditions of the GNU General * Public License. See the file COPYING in the main directory of this * archive for more details. @@ -33,6 +34,7 @@ #include <asm/bootinfo.h> #include <asm/dec/machtype.h> #include <asm/dec/tc.h> +#include "pmag-ba-fb.h" #include <video/fbcon.h> #include <video/fbcon-mfb.h> @@ -42,18 +44,7 @@ #define arraysize(x) (sizeof(x)/sizeof(*(x))) -/* - * Bt459 RAM DAC register base offset (rel. to TC slot base address) - */ -#define BT459_OFFSET 0x00200000 - -/* - * Begin of DECstation 5000/xx onboard framebuffer memory, resolution - * is 1024x864x8 - */ -#define PMAG_BA_ONBOARD_FBMEM_OFFSET 0x00000000 - -struct ramdac_regs { +struct pmag_ba_ramdac_regs { unsigned char addr_low; unsigned char pad0[3]; unsigned char addr_hi; @@ -63,9 +54,9 @@ struct ramdac_regs { unsigned char cmap; }; -struct my_fb_info { +struct pmag_ba_my_fb_info { struct fb_info info; - struct ramdac_regs *bt459_regs; + struct pmag_ba_ramdac_regs *bt459_regs; unsigned long pmagba_fb_start; unsigned long pmagba_fb_size; unsigned long pmagba_fb_line_length; @@ -75,7 +66,7 @@ static struct display disp; /* * Max 3 TURBOchannel slots -> max 3 PMAG-BA :) */ -static struct my_fb_info pmagba_fb_info[3]; +static struct pmag_ba_my_fb_info pmagba_fb_info[3]; static struct fb_var_screeninfo pmagbafb_defined = { 0, 0, 0, 0, /* W,H, W, H (virtual) load xres,xres_virtual */ @@ -157,7 +148,7 @@ static int pmagba_do_fb_set_var(struct fb_var_screeninfo *var, /* * Turn hardware cursor off */ -void pmagbafb_erase_cursor(struct my_fb_info *info) +void pmagbafb_erase_cursor(struct pmag_ba_my_fb_info *info) { info->bt459_regs->addr_low = 0; info->bt459_regs->addr_hi = 3; @@ -167,8 +158,8 @@ void pmagbafb_erase_cursor(struct my_fb_info *info) /* * Write to a Bt459 color map register */ -void bt459_write_colormap(struct my_fb_info *info, - int reg, __u8 red, __u8 green, __u8 blue) +void pmag_ba_bt459_write_colormap(struct pmag_ba_my_fb_info *info, + int reg, __u8 red, __u8 green, __u8 blue) { info->bt459_regs->addr_low = (__u8) reg; info->bt459_regs->addr_hi = 0; @@ -193,9 +184,9 @@ static int pmagbafb_get_cmap(struct fb_cmap *cmap, int kspc, int con, length = cmap->len; } for (i = 0; i < length; i++) { - /* - * TODO - */ + /* + * TODO + */ } return 0; } @@ -220,9 +211,10 @@ static int pmagbafb_set_cmap(struct fb_cmap *cmap, int kspc, int con, cmap_green = ((cmap->green[i]) >> 8); /* wide, but the harware colormap */ cmap_blue = ((cmap->blue[i]) >> 8); /* registers are only 8 bits wide */ - bt459_write_colormap((struct my_fb_info *) info, - cmap->start + i, cmap_red, cmap_green, - cmap_blue); + pmag_ba_bt459_write_colormap((struct pmag_ba_my_fb_info *) + info, cmap->start + i, + cmap_red, cmap_green, + cmap_blue); } return 0; } @@ -252,14 +244,11 @@ static int pmagbafb_set_var(struct fb_var_screeninfo *var, int con, static void pmagbafb_encode_fix(struct fb_fix_screeninfo *fix, struct pmagbafb_par *par, - struct my_fb_info *info) + struct pmag_ba_my_fb_info *info) { memset(fix, 0, sizeof(struct fb_fix_screeninfo)); strcpy(fix->id, "PMAG-BA"); - /* - * X works, but screen wraps ... - */ fix->smem_start = info->pmagba_fb_start; fix->smem_len = info->pmagba_fb_size; fix->type = FB_TYPE_PACKED_PIXELS; @@ -274,10 +263,10 @@ static int pmagbafb_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *info) { struct pmagbafb_par par; - + pmagbafb_get_par(&par); - pmagbafb_encode_fix(fix, &par, (struct my_fb_info *) info); - + pmagbafb_encode_fix(fix, &par, (struct pmag_ba_my_fb_info *) info); + return 0; } @@ -293,7 +282,7 @@ static int pmagbafb_switch(int con, struct fb_info *info) { pmagba_do_fb_set_var(&fb_display[con].var, 1); currcon = con; - + return 0; } @@ -313,7 +302,7 @@ static int pmagbafb_open(struct fb_info *info, int user) return (0); } -static void pmagbafb_set_disp(int con, struct my_fb_info *info) +static void pmagbafb_set_disp(int con, struct pmag_ba_my_fb_info *info) { struct fb_fix_screeninfo fix; struct display *display; @@ -346,31 +335,33 @@ static int pmagbafb_release(struct fb_info *info, int user) } static struct fb_ops pmagbafb_ops = { - owner: THIS_MODULE, - fb_open: pmagbafb_open, - fb_release: pmagbafb_release, - fb_get_fix: pmagbafb_get_fix, - fb_get_var: pmagbafb_get_var, - fb_set_var: pmagbafb_set_var, - fb_get_cmap: pmagbafb_get_cmap, - fb_set_cmap: pmagbafb_set_cmap, - fb_ioctl: pmagbafb_ioctl, - fb_mmap: 0, - fb_rasterimg: 0 + owner:THIS_MODULE, + fb_open:pmagbafb_open, + fb_release:pmagbafb_release, + fb_get_fix:pmagbafb_get_fix, + fb_get_var:pmagbafb_get_var, + fb_set_var:pmagbafb_set_var, + fb_get_cmap:pmagbafb_get_cmap, + fb_set_cmap:pmagbafb_set_cmap, + fb_ioctl:pmagbafb_ioctl, + fb_mmap:0, + fb_rasterimg:0 }; int __init pmagbafb_init_one(int slot) { unsigned long base_addr = get_tc_base_addr(slot); - struct my_fb_info *ip = - (struct my_fb_info *) &pmagba_fb_info[slot]; + struct pmag_ba_my_fb_info *ip = + (struct pmag_ba_my_fb_info *) &pmagba_fb_info[slot]; printk("PMAG-BA framebuffer in slot %d\n", slot); /* * Framebuffer display memory base address and friends */ - ip->bt459_regs = (struct ramdac_regs *) (base_addr + BT459_OFFSET); + ip->bt459_regs = + (struct pmag_ba_ramdac_regs *) (base_addr + + PMAG_BA_BT459_OFFSET); ip->pmagba_fb_start = base_addr + PMAG_BA_ONBOARD_FBMEM_OFFSET; ip->pmagba_fb_size = 1024 * 864; ip->pmagba_fb_line_length = 1024; |