kernels/linux-2.4.0/drivers/video/sa1100fb.c
/*
 *  sa1100fb_enable_lcd_controller():
 *    	Enables LCD controller.  If the controller is already enabled, it is first disabled.
 *      This forces all changes to the LCD controller registers to be done when the 
 *      controller is disabled.  Platform specific hardware enabling is also included.
 */
Enables LCD controller.  If the controller is already enabled, it is first disabled.
This forces all changes to the LCD controller registers to be done when the
controller is disabled.  Platform specific hardware enabling is also included.
Enables LCD controller . If the controller is already enabled it is first disabled . This forces all changes to the LCD controller registers to be done when the controller is disabled . Platform specific hardware enabling is also included .
static void sa1100fb_enable_lcd_controller(void)
{
	u_long	flags;
	local_irq_save(flags);		
	if (current_par.controller_state == LCD_MODE_ENABLED) 	{
		current_par.controller_state = LCD_MODE_DISABLE_BEFORE_ENABLE;
		sa1100fb_disable_lcd_controller();
	} else {
		DPRINTK("Enabling LCD controller\n");
		current_par.v_palette_base[0] &= 0x0FFF; 	           
		current_par.v_palette_base[0] |= SA1100_PALETTE_MODE_VAL(current_par.bits_per_pixel); 	 
		if (lcd_shadow.lccr0 & LCCR0_SDS) {
		  GPDR |= 0x3fc;
		  GAFR |= 0x3fc;
		}
		LCCR3 = lcd_shadow.lccr3;
		LCCR2 = lcd_shadow.lccr2;
		LCCR1 = lcd_shadow.lccr1;
		LCCR0 = lcd_shadow.lccr0 & ~LCCR0_LEN;
		DBAR1 = lcd_shadow.dbar1;
		DBAR2 = lcd_shadow.dbar2;
		LCCR0 |= LCCR0_LEN;
		if (machine_is_assabet()) {
#ifdef CONFIG_SA1100_ASSABET
			BCR_set(BCR_LCD_ON);
#endif
		} else if (machine_is_bitsy()) {
#ifdef CONFIG_SA1100_BITSY
                  set_bitsy_egpio(EGPIO_BITSY_LCD_ON | EGPIO_BITSY_LCD_PCI | EGPIO_BITSY_LCD_5V_ON | EGPIO_BITSY_LVDD_ON);
			DPRINTK("DBAR1=%p\n", DBAR1);
			DPRINTK("LCCR0=%x\n", LCCR0);
			DPRINTK("LCCR1=%x\n", LCCR1);
			DPRINTK("LCCR2=%x\n", LCCR2);
			DPRINTK("LCCR3=%x\n", LCCR3);
#endif
		} else if (machine_is_penny()) {
#ifdef CONFIG_SA1100_PENNY
			FpgaLcdCS1 = 0x0FF;	
			FpgaPortI  |= LCD_ON;	
#endif
		} else if (machine_is_tifon()) {
			GPCR = GPIO_GPIO(24);	
			udelay(150);
			GPSR = GPIO_GPIO(24);	
		}
		current_par.controller_state = LCD_MODE_ENABLED;
	}
	local_irq_restore(flags);
}
static void sa1100fb_enable_lcd_controller ( void ) { u_long flags ; local_irq_save ( flags ) ; if ( current_par . controller_state == LCD_MODE_ENABLED ) { current_par . controller_state = LCD_MODE_DISABLE_BEFORE_ENABLE ; sa1100fb_disable_lcd_controller ( ) ; } else { DPRINTK ( " \n " ) ; current_par . v_palette_base [ 0 ] &= 0x0FFF ; current_par . v_palette_base [ 0 ] |= SA1100_PALETTE_MODE_VAL ( current_par . bits_per_pixel ) ; if ( lcd_shadow . lccr0 & LCCR0_SDS ) { GPDR |= 0x3fc ; GAFR |= 0x3fc ; } LCCR3 = lcd_shadow . lccr3 ; LCCR2 = lcd_shadow . lccr2 ; LCCR1 = lcd_shadow . lccr1 ; LCCR0 = lcd_shadow . lccr0 & ~ LCCR0_LEN ; DBAR1 = lcd_shadow . dbar1 ; DBAR2 = lcd_shadow . dbar2 ; LCCR0 |= LCCR0_LEN ; if ( machine_is_assabet ( ) ) { #ifdef CONFIG_SA1100_ASSABET BCR_set ( BCR_LCD_ON ) ; #endif } else if ( machine_is_bitsy ( ) ) { #ifdef CONFIG_SA1100_BITSY set_bitsy_egpio ( EGPIO_BITSY_LCD_ON | EGPIO_BITSY_LCD_PCI | EGPIO_BITSY_LCD_5V_ON | EGPIO_BITSY_LVDD_ON ) ; DPRINTK ( " \n " , DBAR1 ) ; DPRINTK ( " \n " , LCCR0 ) ; DPRINTK ( " \n " , LCCR1 ) ; DPRINTK ( " \n " , LCCR2 ) ; DPRINTK ( " \n " , LCCR3 ) ; #endif } else if ( machine_is_penny ( ) ) { #ifdef CONFIG_SA1100_PENNY FpgaLcdCS1 = 0x0FF ; FpgaPortI |= LCD_ON ; #endif } else if ( machine_is_tifon ( ) ) { GPCR = GPIO_GPIO ( 24 ) ; udelay ( 150 ) ; GPSR = GPIO_GPIO ( 24 ) ; } current_par . controller_state = LCD_MODE_ENABLED ; } local_irq_restore ( flags ) ; }
sa1100fb_enable_lcd_controller():
      Enables LCD controller.
sa1100fb_enable_lcd_controller () : Enables LCD controller .
/* Disable controller before changing parameters */ /* Make sure the mode bits are present in the first palette entry */ /* Enable GPIO<9:2> for LCD usage if dual-scan */ /* Sequence from 11.7.10 */ /* LCD Backlight to 100% */ /* Turn on LCD Backlight */ /* cycle on/off-switch */ /* turn on display */ /* Restore interrupt status */