patch-2.4.21 linux-2.4.21/drivers/video/dnfb.c

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

diff -urN linux-2.4.20/drivers/video/dnfb.c linux-2.4.21/drivers/video/dnfb.c
@@ -107,12 +107,6 @@
 
 #define SWAP(A) ((A>>8) | ((A&0xff) <<8))
 
-#if 0
-#define outb(a,d) *(char *)(a)=(d)
-#define outw(a,d) *(unsigned short *)a=d
-#endif
-
-
 /* frame buffer operations */
 
 static int dn_fb_get_fix(struct fb_fix_screeninfo *fix, int con, 
@@ -322,12 +316,12 @@
  
 	/* now we have registered we can safely setup the hardware */
 
-        outb(RESET_CREG,  AP_CONTROL_3A);
-        outw(0x0,  AP_WRITE_ENABLE);
-        outb(NORMAL_MODE, AP_CONTROL_0); 
-        outb((AD_BLT | DST_EQ_SRC | NORM_CREG1),  AP_CONTROL_1);
-        outb(S_DATA_PLN,  AP_CONTROL_2);
-        outw(SWAP(0x3), AP_ROP_1);
+        out_8(AP_CONTROL_3A, RESET_CREG);
+        out_be16(AP_WRITE_ENABLE, 0x0);
+        out_8(AP_CONTROL_0, NORMAL_MODE); 
+        out_8(AP_CONTROL_1, (AD_BLT | DST_EQ_SRC | NORM_CREG1));
+        out_8(AP_CONTROL_2, S_DATA_PLN);
+        out_be16(AP_ROP_1, SWAP(0x3));
 
         printk("apollo frame buffer alive and kicking !\n");
 
@@ -354,10 +348,10 @@
 static void dnfbcon_blank(int blank,  struct fb_info *info) {
 
 	if(blank)  {
-        	outb(0x0,  AP_CONTROL_3A);
+		out_8(AP_CONTROL_3A, 0x0);
 	}
 	else {
-	        outb(0x1,  AP_CONTROL_3A);
+	        out_8(AP_CONTROL_3A, 0x1);
 	}
 
 	return ;
@@ -383,7 +377,8 @@
 		x_word_count=(x_end>>4) - (x_dest >> 4) + 1;
 		start_mask=0xffff0000 >> (x_dest & 0xf);
 		end_mask=0x7ffff >> (x_end & 0xf);
-		outb((((x_dest & 0xf) - (x_src &0xf))  % 16)|(0x4 << 5),AP_CONTROL_0);
+		out_8(AP_CONTROL_0,
+		      (((x_dest & 0xf) - (x_src &0xf))  % 16)|(0x4 << 5));
 		if((x_dest & 0xf) < (x_src & 0xf))
 			pre_read=1;
 	}
@@ -393,26 +388,27 @@
 		x_word_count=(x_dest>>4) - (x_end >> 4) + 1;
 		start_mask=0x7ffff >> (x_dest & 0xf);
 		end_mask=0xffff0000 >> (x_end & 0xf);
-		outb(((-((x_src & 0xf) - (x_dest &0xf))) % 16)|(0x4 << 5),AP_CONTROL_0);
+		out_8(AP_CONTROL_0,
+		      ((-((x_src & 0xf) - (x_dest &0xf))) % 16)|(0x4 << 5));
 		if((x_dest & 0xf) > (x_src & 0xf))
 			pre_read=1;
 	}
 
 	for(i=0;i<y_count;i++) {
 
-		outb(0xc | (dest >> 16), AP_CONTROL_3A);
-			
+		out_8(AP_CONTROL_3A, 0xc | (dest >> 16));
+
 		if(pre_read) {
 			dummy=*src;
 			src+=incr;
 		}
 
 		if(x_word_count) {
-			outb(start_mask,AP_WRITE_ENABLE);
+			out_8(AP_WRITE_ENABLE, start_mask);
 			*src=dest;
 			src+=incr;
 			dest+=incr;
-			outb(0,AP_WRITE_ENABLE);
+			out_8(AP_WRITE_ENABLE, 0);
 
 			for(j=1;j<(x_word_count-1);j++) {
 				*src=dest;
@@ -420,13 +416,13 @@
 				dest+=incr;
 			}
 
-			outb(start_mask,AP_WRITE_ENABLE);
+			out_8(AP_WRITE_ENABLE, start_mask);
 			*src=dest;
 			dest+=incr;
 			src+=incr;
 		}
 		else {
-			outb(start_mask | end_mask, AP_WRITE_ENABLE);
+			out_8(AP_WRITE_ENABLE, start_mask | end_mask);
 			*src=dest;
 			dest+=incr;
 			src+=incr;
@@ -434,7 +430,7 @@
 		src+=(y_delta/16);
 		dest+=(y_delta/16);
 	}
-	outb(NORMAL_MODE,AP_CONTROL_0);
+	out_8(AP_CONTROL_0, NORMAL_MODE);
 }
 
 static void bmove_apollofb(struct display *p, int sy, int sx, int dy, int dx,

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