patch-2.4.22 linux-2.4.22/drivers/video/au1100fb.c

Next file: linux-2.4.22/drivers/video/au1100fb.h
Previous file: linux-2.4.22/drivers/video/Makefile
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/drivers/video/au1100fb.c linux-2.4.22/drivers/video/au1100fb.c
@@ -61,7 +61,8 @@
  * Sanity check. If this is a new Au1100 based board, search for
  * the PB1100 ifdefs to make sure you modify the code accordingly.
  */
-#ifndef CONFIG_MIPS_PB1100
+#if defined(CONFIG_MIPS_PB1100) || defined(CONFIG_MIPS_DB1100)
+#else
 error Unknown Au1100 board
 #endif
 
@@ -318,8 +319,8 @@
 		p_lcd_reg->lcd_control |= LCD_CONTROL_GO;
 		au_writew(au_readw(PB1100_G_CONTROL) | p_lcd->mode_backlight, 
 			PB1100_G_CONTROL);
-		au_sync();
 #endif
+		au_sync();
 		break;
 
 	case VESA_VSYNC_SUSPEND:
@@ -328,11 +329,11 @@
 		/* turn off panel */
 		//printk("turn off panel\n");
 #ifdef CONFIG_MIPS_PB1100
-		p_lcd_reg->lcd_control &= ~LCD_CONTROL_GO;
 		au_writew(au_readw(PB1100_G_CONTROL) & ~p_lcd->mode_backlight, 
 			PB1100_G_CONTROL);
-		au_sync();
+		p_lcd_reg->lcd_control &= ~LCD_CONTROL_GO;
 #endif
+		au_sync();
 		break;
 	default: 
 		break;
@@ -395,7 +396,8 @@
 	vma->vm_pgoff = off >> PAGE_SHIFT;
 
 	pgprot_val(vma->vm_page_prot) &= ~_CACHE_MASK;
-	pgprot_val(vma->vm_page_prot) |= _CACHE_CACHABLE_NONCOHERENT;
+	//pgprot_val(vma->vm_page_prot) |= _CACHE_CACHABLE_NONCOHERENT;
+	pgprot_val(vma->vm_page_prot) |= (6 << 9); //CCA=6
 
 	/* This is an IO map - tell maydump to skip this VMA */
 	vma->vm_flags |= VM_IO;
@@ -472,12 +474,12 @@
 	p_lcd_reg->lcd_words = words - 1;
 	p_lcd_reg->lcd_dmaaddr0 = fb_info.fb_phys;
 
-#ifdef CONFIG_MIPS_PB1100
 	/* turn on panel */
+#ifdef CONFIG_MIPS_PB1100
 	au_writew(au_readw(PB1100_G_CONTROL) | p_lcd->mode_backlight, 
 			PB1100_G_CONTROL);
-	p_lcd_reg->lcd_control |= LCD_CONTROL_GO;
 #endif
+	p_lcd_reg->lcd_control |= LCD_CONTROL_GO;
 
 	return 0;
 }
@@ -612,6 +614,19 @@
 	for(this_opt=strtok(options, ","); this_opt;
 	    this_opt=strtok(NULL, ",")) {
 		if (!strncmp(this_opt, "panel:", 6)) {
+#if defined(CONFIG_MIPS_PB1100) || defined(CONFIG_MIPS_DB1100)
+			/* Read Pb1100 Switch S10 ? */
+			if (!strncmp(this_opt+6, "s10", 3))
+			{
+				int panel;
+				panel = *(volatile int *)0xAE000008; /* BCSR SWITCHES */
+				panel >>= 8;
+				panel &= 0x0F;
+				if (panel >= num_panels) panel = 0;
+				my_lcd_index = panel;
+			}
+			else
+#endif
 			/* Get the panel name, everything else if fixed */
 			for (i=0; i<num_panels; i++) {
 				if (!strncmp(this_opt+6, panels[i].panel_name, 
@@ -626,6 +641,9 @@
 			fb_info.nohwcursor = 1;
 		}
 	} 
+
+	printk("au1100fb: Panel %d %s\n", my_lcd_index,
+		panels[my_lcd_index].panel_name);
 }
 
 

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