patch-2.4.20 linux-2.4.20/drivers/video/hpfb.c

Next file: linux-2.4.20/drivers/video/macfb.c
Previous file: linux-2.4.20/drivers/video/fbmem.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.19/drivers/video/hpfb.c linux-2.4.20/drivers/video/hpfb.c
@@ -145,16 +145,16 @@
 	unsigned int i;
 	for (i = 0; i < cmap->len; i++)
 	{
-		while (readw(fb_regs + 0x6002) & 0x4) udelay(1);
-		writew(0, fb_regs + 0x60f0);
-		writew(cmap->start + i, fb_regs + 0x60b8);
-		writew(cmap->red[i], fb_regs + 0x60b2);
-		writew(cmap->green[i], fb_regs + 0x60b4);
-		writew(cmap->blue[i], fb_regs + 0x60b6);
-		writew(0xff, fb_regs + 0x60f0);
+		while (in_be16(fb_regs + 0x6002) & 0x4) udelay(1);
+		out_be16(fb_regs + 0x60f0, 0);
+		out_be16(fb_regs + 0x60b8, cmap->start + i);
+		out_be16(fb_regs + 0x60b2, cmap->red[i]);
+		out_be16(fb_regs + 0x60b4, cmap->green[i]);
+		out_be16(fb_regs + 0x60b6, cmap->blue[i]);
+		out_be16(fb_regs + 0x60f0, 0xff);
 		udelay(100);
 	}
-	writew(0xffff, fb_regs + 0x60ba);
+	out_be16(fb_regs + 0x60ba, 0xffff);
 	return 0;
 }
 
@@ -212,15 +212,15 @@
 
 static void topcat_blit(int x0, int y0, int x1, int y1, int w, int h)
 {
-	while (readb(fb_regs + BUSY) & fb_bitmask);
-	writeb(0x3, fb_regs + WMRR);
-	writew(x0, fb_regs + SOURCE_X);
-	writew(y0, fb_regs + SOURCE_Y);
-	writew(x1, fb_regs + DEST_X);
-	writew(y1, fb_regs + DEST_Y);
-	writew(h, fb_regs + WHEIGHT);
-	writew(w, fb_regs + WWIDTH);
-	writeb(fb_bitmask, fb_regs + WMOVE);
+	while (in_8(fb_regs + BUSY) & fb_bitmask);
+	out_8(fb_regs + WMRR, 0x3);
+	out_be16(fb_regs + SOURCE_X, x0);
+	out_be16(fb_regs + SOURCE_Y, y0);
+	out_be16(fb_regs + DEST_X, x1);
+	out_be16(fb_regs + DEST_Y, y1);
+	out_be16(fb_regs + WHEIGHT, h);
+	out_be16(fb_regs + WWIDTH, w);
+	out_8(fb_regs + WMOVE, fb_bitmask);
 }
 
 static int hpfb_switch(int con, struct fb_info *info)
@@ -249,7 +249,7 @@
 
 	hpfb_get_fix(&fix, con, 0);
 
-	display->screen_base = fix.smem_start;
+	display->screen_base = (char *)fix.smem_start;
 	display->visual = fix.visual;
 	display->type = fix.type;
 	display->type_aux = fix.type_aux;
@@ -260,7 +260,11 @@
 	display->can_soft_blank = 0;
 	display->inverse = 0;
 
+#ifdef FBCON_HAS_CFB8
 	display->dispsw = &fbcon_cfb8;
+#else
+	display->dispsw = &fbcon_dummy;
+#endif
 }
 
 static struct fb_ops hpfb_ops = {
@@ -279,20 +283,19 @@
 {
 	unsigned long fboff;
 
-	fboff = (readb(base + TOPCAT_FBOMSB) << 8) 
-		| readb(base + TOPCAT_FBOLSB);
+	fboff = (in_8(base + TOPCAT_FBOMSB) << 8) | in_8(base + TOPCAT_FBOLSB);
 
-	fb_start = 0xf0000000 | (readb(base + fboff) << 16);
+	fb_start = 0xf0000000 | (in_8(base + fboff) << 16);
 	fb_regs = base;
 
 #if 0
 	/* This is the magic incantation NetBSD uses to make Catseye boards work. */
-	writeb(0, base+0x4800);
-	writeb(0, base+0x4510);
-	writeb(0, base+0x4512);
-	writeb(0, base+0x4514);
-	writeb(0, base+0x4516);
-	writeb(0x90, base+0x4206);
+	out_8(base+0x4800, 0);
+	out_8(base+0x4510, 0);
+	out_8(base+0x4512, 0);
+	out_8(base+0x4514, 0);
+	out_8(base+0x4516, 0);
+	out_8(base+0x4206, 0x90);
 #endif
 
 	/*
@@ -310,18 +313,18 @@
 	 *	pixel are supported.
 	 */
 	
-	writeb(0xff, base + TC_WEN);
-	writeb(0xff, base + TC_FBEN);
-	writeb(0xff, fb_start);
-	fb_bitmask = readb(fb_start);
+	out_8(base + TC_WEN, 0xff);
+	out_8(base + TC_FBEN, 0xff);
+	out_8(fb_start, 0xff);
+	fb_bitmask = in_8(fb_start);
 
 	/*
 	 *	Enable reading/writing of all the planes.
 	 */
-	writeb(fb_bitmask, base + TC_WEN);
-	writeb(fb_bitmask, base + TC_REN);
-	writeb(fb_bitmask, base + TC_FBEN);
-	writeb(0x1, base + TC_NBLANK);
+	out_8(base + TC_WEN, fb_bitmask);
+	out_8(base + TC_REN, fb_bitmask);
+	out_8(base + TC_FBEN, fb_bitmask);
+	out_8(base + TC_NBLANK, 0x1);
 
 	/*
 	 *	Let there be consoles..

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)