patch-2.4.0-test5 linux/drivers/video/sa1100fb.c

Next file: linux/drivers/video/sbusfb.c
Previous file: linux/drivers/video/retz3fb.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test4/linux/drivers/video/sa1100fb.c linux/drivers/video/sa1100fb.c
@@ -158,13 +158,10 @@
 
 
 static int  sa1100fb_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *info);
-static int  sa1100fb_ioctl(struct inode *ino, struct file *file, unsigned int cmd,
-	       		  unsigned long arg, int con, struct fb_info *info);
 static int  sa1100fb_get_var(struct fb_var_screeninfo *var, int con, struct fb_info *info);
 static int  sa1100fb_set_var(struct fb_var_screeninfo *var, int con, struct fb_info *info);
 static int  sa1100fb_get_cmap(struct fb_cmap *cmap, int kspc, int con, struct fb_info *info);
 static int  sa1100fb_set_cmap(struct fb_cmap *cmap, int kspc, int con, struct fb_info *info);
-static int  sa1100fb_pan_display(struct fb_var_screeninfo *var, int con, struct fb_info *info);
  
 static int  sa1100fb_switch(int con, struct fb_info *info);
 static void sa1100fb_blank(int blank, struct fb_info *info);
@@ -180,8 +177,6 @@
 	fb_set_var:	sa1100fb_set_var,
 	fb_get_cmap:	sa1100fb_get_cmap,
 	fb_set_cmap:	sa1100fb_set_cmap,
-	fb_pan_display:	sa1100fb_pan_display,
-	fb_ioctl:	sa1100fb_ioctl,
 };
 
 
@@ -845,15 +840,15 @@
 			LCCR0_LDM + LCCR0_BAM + LCCR0_ERM + LCCR0_Act +
 			LCCR0_LtlEnd + LCCR0_DMADel(0);
 		lcd_shadow.lccr1 = 
-			LCCR1_DisWdth(var->xres) + LCCR1_HorSnchWdth(4) + 
-			LCCR1_BegLnDel(30) + LCCR1_EndLnDel(30);
+			LCCR1_DisWdth(var->xres) + LCCR1_HorSnchWdth(6) + 
+			LCCR1_BegLnDel(61) + LCCR1_EndLnDel(9);
 		lcd_shadow.lccr2 = 
-			LCCR2_DisHght(var->yres) + LCCR2_VrtSnchWdth(1) + 
-			LCCR2_BegFrmDel(0) + LCCR2_EndFrmDel(0);
+			LCCR2_DisHght(var->yres) + LCCR2_VrtSnchWdth(2) + 
+			LCCR2_BegFrmDel(3) + LCCR2_EndFrmDel(0);
 		lcd_shadow.lccr3 = 
 			LCCR3_OutEnH + LCCR3_PixFlEdg + LCCR3_VrtSnchH + 
 			LCCR3_HorSnchH + LCCR3_ACBsCntOff + 
-			LCCR3_ACBsDiv(2) + LCCR3_PixClkDiv(28);
+			LCCR3_ACBsDiv(2) + LCCR3_PixClkDiv(38);
 
 		/* Set board control register to handle new color depth */
 		sa1100fb_assabet_set_truecolor(var->bits_per_pixel >= 16);
@@ -1095,15 +1090,6 @@
 	restore_flags(flags);
 }
 
-static int
-sa1100fb_pan_display(struct fb_var_screeninfo *var, int con,
-		    struct fb_info *info)
-{
-	DPRINTK("entered\n");
-	return -EINVAL;
-}
-
-
 /*
  * sa1100fb_blank():
  *	Blank the display by setting all palette values to zero.  Note, the 
@@ -1117,6 +1103,7 @@
 
   	DPRINTK("blank=%d info->modename=%s\n", blank, info->modename);
 	if (blank) {
+                if (current_par.visual != FB_VISUAL_TRUECOLOR)
 		for (i = 0; i < current_par.palette_size; i++)
 			sa1100fb_palette_write(i, sa1100fb_palette_encode(i, 0, 0, 0, 0));
 		sa1100fb_disable_lcd_controller();
@@ -1155,24 +1142,29 @@
 	fb_display[con].var.activate = FB_ACTIVATE_NOW;
 	DPRINTK("fb_display[%d].var.activate=%x\n", con, fb_display[con].var.activate);
 	sa1100fb_set_var(&fb_display[con].var, con, info);
+	current_par.v_palette_base[0] = (current_par.v_palette_base[0] &
+		0xcfff) | SA1100_PALETTE_MODE_VAL(current_par.bits_per_pixel);
+
 	return 0;
 }
 
 
-void __init sa1100fb_init(void)
+int __init sa1100fb_init(void)
 {
+	int ret;
+
 	sa1100fb_init_fbinfo();
 
 	/* Initialize video memory */
-	if (sa1100fb_map_video_memory())
-		return;
+	if ((ret = sa1100fb_map_video_memory()) != 0)
+		return ret;
 
 	if (current_par.montype < 0 || current_par.montype > NR_MONTYPES)
 		current_par.montype = 1;
 
 	if (request_irq(IRQ_LCD, sa1100fb_inter_handler, SA_INTERRUPT, "SA1100 LCD", NULL) != 0) {
 		printk("sa1100fb: failed in request_irq\n");
-		return;
+		return -EBUSY;
 	}
 	DPRINTK("sa1100fb: request_irq succeeded\n");
 	disable_irq(IRQ_LCD);
@@ -1202,23 +1194,12 @@
 
 	/* This driver cannot be unloaded at the moment */
 	MOD_INC_USE_COUNT;
-}
-
-void __init sa1100fb_setup(char *options)
-{
-	if (!options || !*options)
-		return;
 
-	return; 
+	return 0;
 }
 
-
-
-static int
-sa1100fb_ioctl(struct inode *ino, struct file *file, unsigned int cmd,
-	      unsigned long arg, int con, struct fb_info *info)
+int __init sa1100fb_setup(char *options)
 {
-	return -ENOIOCTLCMD;
+	return 0;
 }
-
 

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