static int hx8357a_hvga_panel_on(struct platform_device *pdev)
{
    if (!hx8357a_hvga_state.disp_initialized) 
    {
        hx8357a_hvga_reset();
        lcd_spi_init(lcdc_hx8357a_hvga_pdata);	/* LCD needs SPI */
        hx8357a_hvga_disp_powerup();
        hx8357a_hvga_disp_on();
        hx8357a_hvga_state.disp_initialized = TRUE;
        LCD_DEBUG("%s: hx8357a lcd initialized\n", __func__);
    } 
    else if (!hx8357a_hvga_state.display_on) 
    {
    	switch(lcd_panel_hvga)
    	{
    	    case LCD_HX8357A_TRULY_HVGA:
    	      /* Exit Standby Mode */
    	      process_lcdc_table((struct command*)&hx8357a_truly_hvga_standby_exit_table, ARRAY_SIZE(hx8357a_truly_hvga_standby_exit_table));
    	      break;
    	    
    	    case LCD_HX8357A_WINTEK_HVGA:
    	      /* Exit Standby Mode */
    	      process_lcdc_table((struct command*)&hx8357a_wintek_hvga_standby_exit_table, ARRAY_SIZE(hx8357a_wintek_hvga_standby_exit_table));
    	      break;
			default:
    	      break;
    	}
        LCD_DEBUG("%s: Exit Standby Mode\n", __func__);
        hx8357a_hvga_state.display_on = TRUE;
    }
    
    return 0;
}
static int hx8357c_hvga_panel_on(struct platform_device *pdev)
{
    boolean para_debug_flag = FALSE;
    uint32 para_num = 0;
    /* open debug file and read the para */
    switch(lcd_panel_hvga)
    {
        case LCD_HX8357C_TIANMA_HVGA:
            para_debug_flag = lcd_debug_malloc_get_para( "hx8357c_tianma_hvga_init_table", 
            (void**)&hx8357c_hvga_init_table,&para_num);
            break;
        default:
            break;
    }    
       
    if (!hx8357c_hvga_state.disp_initialized) 
    {
        hx8357c_hvga_reset();
        lcd_spi_init(lcdc_hx8357c_hvga_pdata);	/* LCD needs SPI */
        hx8357c_hvga_disp_powerup();
        hx8357c_hvga_disp_on(); 
        hx8357c_hvga_state.disp_initialized = TRUE;
        if( (TRUE == para_debug_flag) && (NULL != hx8357c_hvga_init_table))
        {
            // lcd_reset();
            process_lcdc_table(hx8357c_hvga_init_table, para_num,lcd_panel_hvga);
        }
        LCD_DEBUG("%s: hx8357c lcd initialized\n", __func__);
    } 
    else if (!hx8357c_hvga_state.display_on) 
    {
    	switch(lcd_panel_hvga)
    	{
    	    case LCD_HX8357C_TIANMA_HVGA:
                if( (TRUE == para_debug_flag)&&(NULL != hx8357c_hvga_init_table))
                {
                     //  lcd_reset();
                     process_lcdc_table(hx8357c_hvga_init_table, para_num,lcd_panel_hvga);

                }
                else
                {
                    /* Exit Standby Mode */
                    process_lcdc_table((struct sequence*)&hx8357c_tianma_hvga_standby_exit_table, 
                    	ARRAY_SIZE(hx8357c_tianma_hvga_standby_exit_table), lcd_panel_hvga);
                }
                break;			
            default:
                break;
    	}
         LCD_DEBUG("%s: Exit Standby Mode\n", __func__);
        hx8357c_hvga_state.display_on = TRUE;
    }
/* Must malloc before,then you can call free */
	if((TRUE == para_debug_flag)&&(NULL != hx8357c_hvga_init_table))
	{
		lcd_debug_free_para((void *)hx8357c_hvga_init_table);
	}
    return 0;
}
static int nt35410_hvga_panel_on(struct platform_device *pdev)
{
    boolean para_debug_flag = FALSE;
    uint32 para_num = 0;
	
    switch(lcd_panel_hvga)
    {
        case LCD_NT35410_CHIMEI_HVGA:
            para_debug_flag = lcd_debug_malloc_get_para( "lcdc_nt35410_hvga_init_table", 
            (void**)&lcdc_nt35410_hvga_init_table,&para_num);
            break;
        default:
            break;
    }    
	
    if (!nt35410_hvga_state.disp_initialized) 
    {
        nt35410_hvga_reset();
        lcd_spi_init(lcdc_nt35410_hvga_pdata);	/* LCD needs SPI */
        nt35410_hvga_disp_powerup();
        nt35410_hvga_disp_on();
        nt35410_hvga_state.disp_initialized = TRUE;
    	if((TRUE == para_debug_flag) && (NULL != lcdc_nt35410_hvga_init_table))
        {
            process_lcdc_table(lcdc_nt35410_hvga_init_table,para_num,lcd_panel_hvga);
        }

        LCD_DEBUG("%s: nt35410 lcd initialized\n", __func__);
    } 
    else if (!nt35410_hvga_state.display_on) 
    {
    	switch(lcd_panel_hvga)
    	{
    	    case LCD_NT35410_CHIMEI_HVGA:
    		if( (TRUE == para_debug_flag)&&(NULL != lcdc_nt35410_hvga_init_table))
            {
                process_lcdc_table(lcdc_nt35410_hvga_init_table,para_num,lcd_panel_hvga);

            }
    		else
    		{
    	    	/* Exit Standby Mode */
                process_lcdc_table((struct sequence*)&nt35410_chimei_hvga_standby_exit_table, 
                ARRAY_SIZE(nt35410_chimei_hvga_standby_exit_table),lcd_panel_hvga);
    		}
            break;
        default:
            break;
    	}
        LCD_DEBUG("%s: Exit Standby Mode\n", __func__);
        nt35410_hvga_state.display_on = TRUE;
    }
/* Must malloc before,then you can call free */
    if((TRUE == para_debug_flag)&&(NULL != lcdc_nt35410_hvga_init_table))
    {
         lcd_debug_free_para((void *)lcdc_nt35410_hvga_init_table);
    }
    return 0;
}
static int lcdc_s6d74a0_panel_on(struct platform_device *pdev)
{
	boolean para_debug_flag = FALSE;
	uint32 para_num = 0;

	LCD_DEBUG("ENTER lcdc_s6d74a0_panel_on\n");
	/* open debug file and read the para */
	switch(lcd_panel_hvga)
	{
		case LCD_S6D74A0_SAMSUNG_HVGA:
			para_debug_flag = lcd_debug_malloc_get_para( "s6d74a0_samsung_init_table", 
			(void**)&s6d74a0_samsung_init_table,&para_num);
			break;
		default:
			break;
	} 
	if(!lcd_s6d74a0_state.disp_initialized)
	{
		lcdc_s6d74a0_pdata->panel_config_gpio(1);
		lcd_reset_gpio = *(lcdc_s6d74a0_pdata->gpio_num + 4);		
		lcd_spi_init(lcdc_s6d74a0_pdata);	/* LCD needs SPI */
		lcd_s6d74a0_disp_powerup();
		lcd_s6d74a0_state.display_on = TRUE;
		lcd_s6d74a0_state.disp_initialized = TRUE;

	}
	else if(!lcd_s6d74a0_state.display_on)
	{
		switch(lcd_panel_hvga)
		{
		case LCD_S6D74A0_SAMSUNG_HVGA:
			if((TRUE == para_debug_flag)
				&&(NULL != s6d74a0_samsung_init_table))
			{
				//seriout(0x0010, 0x0000); the table should add this value on the front delete by zhangpeng 20110112
				process_lcdc_table(s6d74a0_samsung_init_table, para_num, LCD_S6D74A0_SAMSUNG_HVGA);
			}
			else
			{
				process_lcdc_table((struct sequence*)&s6d74a0_samsung_init, 
						ARRAY_SIZE(s6d74a0_samsung_init), LCD_S6D74A0_SAMSUNG_HVGA);	
			}
			break;
		default:
			break;
		}
		lcd_s6d74a0_state.display_on = TRUE;  
	}

	/* Must malloc before,then you can call free */
	if((TRUE == para_debug_flag)&&(NULL != s6d74a0_samsung_init_table))
	{
		lcd_debug_free_para((void *)s6d74a0_samsung_init_table);
	}
	return 0;	
	
}
void hx8357c_lcdc_set_cabc_backlight(struct msm_fb_data_type *mfd,uint32 bl_level)
{	
	hx8357c_cabc_enable_table[1].reg = bl_level; // 1 will be changed if modify init code

	process_lcdc_table((struct sequence*)&hx8357c_cabc_enable_table,
		 ARRAY_SIZE(hx8357c_cabc_enable_table), lcd_panel_hvga);
}
void hx8347d_set_cabc_backlight(struct msm_fb_data_type *mfd,uint32 bl_level)
{
	/*warning reg :0x3c*/
	hx8347d_pwm_set_table[0].value = bl_level;

	process_lcdc_table((struct sequence*)&hx8347d_pwm_set_table, ARRAY_SIZE(hx8347d_pwm_set_table),lcd_panel_qvga);
}
Ejemplo n.º 7
0
static int hx8357a_panel_off(struct platform_device *pdev)
{
    if (hx8357a_state.disp_powered_up && hx8357a_state.display_on) {
        /* Enter Standby Mode */
        process_lcdc_table((struct command*)&hx8357a_standby_enter_table, ARRAY_SIZE(hx8357a_standby_enter_table));
        hx8357a_state.display_on = FALSE;
        LCD_DEBUG("%s: Enter Standby Mode\n", __func__);
    }

    return 0;
}
static void lcd_ili9481d_panel_exit_sleep(void)
{
        printk(KERN_INFO "%s:lcd_panel_hvga = %d\n", __func__, lcd_panel_hvga);

        switch(lcd_panel_hvga)
        {
            case LCD_ILI9481D_INNOLUX_HVGA:
                printk(KERN_INFO "%s:\n", __func__);
                process_lcdc_table((struct sequence*)&ili9481ds_innolux_disp_on, ARRAY_SIZE(ili9481ds_innolux_disp_on));
                break;
            case LCD_ILI9481DS_TIANMA_HVGA:
                printk(KERN_INFO "%s:TIANMA\n", __func__);
                process_lcdc_table((struct sequence*)&ili9481ds_tianma_disp_on, ARRAY_SIZE(ili9481ds_tianma_disp_on));
                break;
            default:
                break;
        }
        LCD_DEBUG("%s: Exit Standby Mode\n", __func__);
        lcd_ili9481d_state.display_on = TRUE;
}
static int hx8357a_hvga_panel_off(struct platform_device *pdev)
{
    if (hx8357a_hvga_state.disp_powered_up && hx8357a_hvga_state.display_on) {
    	switch(lcd_panel_hvga)
    	{
    	    case LCD_HX8357A_TRULY_HVGA:
    	      /* Enter Standby Mode */
    	      process_lcdc_table((struct command*)&hx8357a_truly_hvga_standby_enter_table, ARRAY_SIZE(hx8357a_truly_hvga_standby_enter_table));
    	      break;
    	    
    	    case LCD_HX8357A_WINTEK_HVGA:
    	      /* Enter Standby Mode */
    	      process_lcdc_table((struct command*)&hx8357a_wintek_hvga_standby_enter_table, ARRAY_SIZE(hx8357a_wintek_hvga_standby_enter_table));
    	      break;
    	}
        hx8357a_hvga_state.display_on = FALSE;
        LCD_DEBUG("%s: Enter Standby Mode\n", __func__);
    }

    return 0;
}
static int lcdc_ili9481d_panel_off(struct platform_device *pdev)
{

 if (lcd_ili9481d_state.disp_powered_up && lcd_ili9481d_state.display_on) {
        /* Enter Standby Mode */
        switch(lcd_panel_hvga)
        {
            case LCD_ILI9481D_INNOLUX_HVGA:
                process_lcdc_table((struct sequence*)&ili9481d_innolux_disp_off, ARRAY_SIZE(ili9481d_innolux_disp_off));
                break;
            case LCD_ILI9481DS_TIANMA_HVGA:
                process_lcdc_table((struct sequence*)&ili9481ds_tianma_disp_off, ARRAY_SIZE(ili9481ds_tianma_disp_off));
                break;
            default:
                break;
        }
        lcd_ili9481d_state.display_on = FALSE;
        LCD_DEBUG("%s: Enter Standby Mode\n", __func__);
    }

    return 0;
}
static int hx8347d_qvga_panel_off(struct platform_device *pdev)
{
    if (hx8347d_qvga_state.disp_powered_up && hx8347d_qvga_state.display_on) 
	{
        /* Enter Standby Mode */
		switch (lcd_panel_qvga)
		{
			case LCD_HX8347D_CHIMEI_QVGA:
		        process_lcdc_table((struct sequence*)&hx8347d_chimei_qvga_disp_off, ARRAY_SIZE(hx8347d_chimei_qvga_disp_off),lcd_panel_qvga);
				break;	
			case LCD_HX8347D_TRULY_QVGA:
		        process_lcdc_table((struct sequence*)&hx8347d_truly_qvga_disp_off, ARRAY_SIZE(hx8347d_truly_qvga_disp_off),lcd_panel_qvga);
				break;			
			default:
				break;
		}
		
        hx8347d_qvga_state.display_on = FALSE;
        LCD_DEBUG("%s: Enter Standby Mode\n", __func__);
    }
    return 0;
}
static void lcdc_s6d74a0_panel_set_contrast(struct msm_fb_data_type *mfd, unsigned int contrast)
{
	unsigned char i = 0;

    if(0 == contrast)
    {
        if (lcd_s6d74a0_state.disp_powered_up && lcd_s6d74a0_state.display_on)
        {
		switch(lcd_panel_hvga)
		{
		case LCD_S6D74A0_SAMSUNG_HVGA:
			process_lcdc_table((struct sequence*)&s6d74a0_samsung_gamma_normal, 
				ARRAY_SIZE(s6d74a0_samsung_gamma_normal), lcd_panel_hvga);
			break;    	  
		default:
			break;
		}
        }
    }
    else
    {
        if (lcd_s6d74a0_state.disp_powered_up && lcd_s6d74a0_state.display_on)
        {
		switch(lcd_panel_hvga)
		{
		case LCD_S6D74A0_SAMSUNG_HVGA:
			process_lcdc_table((struct sequence*)&s6d74a0_samsung_gamma_for_camrea, 
    	      		    ARRAY_SIZE(s6d74a0_samsung_gamma_for_camrea), lcd_panel_hvga);
			break;    	  
		default:
			break;
    	     }   
        }
    }

    return;
}
static void lcd_hx8357b_panel_exit_sleep(void)
{
        printk(KERN_INFO "%s:lcd_panel_hvga = %d\n", __func__, lcd_panel_hvga);

        switch(lcd_panel_hvga)
        {
            case LCD_HX8357B_TIANMA_HVGA:
                printk(KERN_INFO "%s:TIANMA_HX8357B\n", __func__);
                process_lcdc_table((struct sequence*)&hx8357b_tianma_disp_on, ARRAY_SIZE(hx8357b_tianma_disp_on));
                break;
            default:
                break;
        }
        LCD_DEBUG("%s: Exit Standby Mode\n", __func__);
        lcd_hx8357b_state.display_on = TRUE;
}
static int lcdc_hx8357b_panel_off(struct platform_device *pdev)
{

 if (lcd_hx8357b_state.disp_powered_up && lcd_hx8357b_state.display_on) {
        /* Enter Standby Mode */
        switch(lcd_panel_hvga)
        {
            case LCD_HX8357B_TIANMA_HVGA:
                process_lcdc_table((struct sequence*)&hx8357b_tianma_disp_off, ARRAY_SIZE(hx8357b_tianma_disp_off));
                break;
            default:
                break;
        }
        lcd_hx8357b_state.display_on = FALSE;
        LCD_DEBUG("%s: Enter Standby Mode\n", __func__);
    }

    return 0;
}
static int hx8357c_hvga_panel_off(struct platform_device *pdev)
{
    if (hx8357c_hvga_state.disp_powered_up && hx8357c_hvga_state.display_on) {
        switch(lcd_panel_hvga)
    	{
    	    case LCD_HX8357C_TIANMA_HVGA:
    	      /* Enter Standby Mode */
    	      process_lcdc_table((struct sequence*)&hx8357c_tianma_hvga_standby_enter_table, 
    	      		ARRAY_SIZE(hx8357c_tianma_hvga_standby_enter_table), lcd_panel_hvga);
    	      break;
	   default:
			break;
    	}
        hx8357c_hvga_state.display_on = FALSE;
        LCD_DEBUG("%s: Enter Standby Mode\n", __func__);
    }

    return 0;
}
static int nt35410_hvga_panel_off(struct platform_device *pdev)
{
    if (nt35410_hvga_state.disp_powered_up && nt35410_hvga_state.display_on) {
    	switch(lcd_panel_hvga)
    	{
        case LCD_NT35410_CHIMEI_HVGA:
        /* Enter Standby Mode */
            process_lcdc_table((struct sequence*)&nt35410_chimei_hvga_standby_enter_table, 
            ARRAY_SIZE(nt35410_chimei_hvga_standby_enter_table),lcd_panel_hvga);
        break;

	  	default:
			break;
    	}
        nt35410_hvga_state.display_on = FALSE;
        LCD_DEBUG("%s: Enter Standby Mode\n", __func__);
    }

    return 0;
}
static int lcdc_s6d74a0_panel_off(struct platform_device *pdev)
{
	unsigned char i = 0;

	if (lcd_s6d74a0_state.disp_powered_up && lcd_s6d74a0_state.display_on)
	{
		switch(lcd_panel_hvga)
		{
		case LCD_S6D74A0_SAMSUNG_HVGA:
			process_lcdc_table((struct sequence*)&s6d74a0_samsung_disp_off, 
				ARRAY_SIZE(s6d74a0_samsung_disp_off), lcd_panel_hvga);
			break;    	  
		default:
			break;
		}
		lcd_s6d74a0_state.display_on = FALSE;
	}
	
	return 0;
}
Ejemplo n.º 18
0
static int hx8357a_panel_on(struct platform_device *pdev)
{
    if (!hx8357a_state.disp_initialized) 
    {
        hx8357a_reset();
        lcd_spi_init(lcdc_hx8357a_pdata);	/* LCD needs SPI */
        hx8357a_disp_powerup();
        hx8357a_disp_on();
        hx8357a_state.disp_initialized = TRUE;
        LCD_DEBUG("%s: hx8357a lcd initialized\n", __func__);
    } 
    else if (!hx8357a_state.display_on) 
    {
        /* Exit Standby Mode */
        process_lcdc_table((struct command*)&hx8357a_standby_exit_table, ARRAY_SIZE(hx8357a_standby_exit_table));
        LCD_DEBUG("%s: Exit Standby Mode\n", __func__);
        hx8357a_state.display_on = TRUE;
    }
    
    return 0;
}
static int truly_r61529_hvga_panel_off(struct platform_device *pdev)
{
	if (truly_r61529_hvga_state.disp_powered_up && truly_r61529_hvga_state.display_on) {
		switch(lcd_panel_hvga)
		{
			case LCD_R61529_TRULY_HVGA:
				/* Enter Standby Mode */
				process_lcdc_table((struct sequence*)&truly_r61529_hvga_standby_enter_table, 
				ARRAY_SIZE(truly_r61529_hvga_standby_enter_table), lcd_panel_hvga);

				/* we use this function to set low to the SPI CS pin 
				 * to ensure this LCD can enter sleep mode and be waken up
				 */
				truly_r61529_set_cs(lcdc_truly_r61529_hvga_pdata);
				break;
			default:
				break;
		}
		truly_r61529_hvga_state.display_on = FALSE;
		LCD_DEBUG("%s: Enter Standby Mode\n", __func__);
	}
	return 0;
}
static int truly_r61529_hvga_panel_on(struct platform_device *pdev)
{
	boolean para_debug_flag = FALSE;
	uint32 para_num = 0;
	/* open debug file and read the para */
	switch(lcd_panel_hvga)
	{
		case LCD_R61529_TRULY_HVGA:
			para_debug_flag = lcd_debug_malloc_get_para( "truly_r61529_hvga_init_table", 
			(void**)&truly_r61529_hvga_init_table,&para_num);
			break;
		default:
			break;
	}    
       
	if (!truly_r61529_hvga_state.disp_initialized) 
	{
		truly_r61529_hvga_reset();
		lcd_spi_init(lcdc_truly_r61529_hvga_pdata);	/* LCD needs SPI */
		truly_r61529_hvga_disp_powerup();
		truly_r61529_hvga_disp_on(); 
		truly_r61529_hvga_state.disp_initialized = TRUE;
		if( (TRUE == para_debug_flag) && (NULL != truly_r61529_hvga_init_table))
		{
			// lcd_reset();
			process_lcdc_table(truly_r61529_hvga_init_table, para_num,lcd_panel_hvga);
		}
		LCD_DEBUG("%s: truly r61529  lcd initialized\n", __func__);
	} 
	else if (!truly_r61529_hvga_state.display_on) 
	{
		switch(lcd_panel_hvga)
		{
			case LCD_R61529_TRULY_HVGA:
				if( (TRUE == para_debug_flag)&&(NULL != truly_r61529_hvga_init_table))
				{
					//lcd_reset();
					process_lcdc_table(truly_r61529_hvga_init_table, para_num,lcd_panel_hvga);
				}
				else
				{
					/* Exit Standby Mode */
					process_lcdc_table((struct sequence*)&truly_r61529_hvga_standby_exit_table, 
					ARRAY_SIZE(truly_r61529_hvga_standby_exit_table), lcd_panel_hvga);
				}
				/* we use this function to set low to the SPI CS pin 
				 * to ensure this LCD can enter sleep mode and be waken up
				 */
				truly_r61529_set_cs(lcdc_truly_r61529_hvga_pdata);		
				break;
			default:
				break;
		}
		LCD_DEBUG("%s: Exit Standby Mode\n", __func__);
		truly_r61529_hvga_state.display_on = TRUE;
	}
	/* Must malloc before,then you can call free */
	if((TRUE == para_debug_flag)&&(NULL != truly_r61529_hvga_init_table))
	{
		lcd_debug_free_para((void *)truly_r61529_hvga_init_table);
	}
	return 0;
}