Example #1
0
static int ams397g201_suspend(struct device *dev, pm_message_t mesg)
{
    ACL_STATUS  prev_acl_status;
        
	pr_err("[Pannel][%s] \n",__func__);
	
	// SERI-START (grip-lcd-lock)
	panel_initialized = 0;
	// SERI-END
	
#ifdef ACL_ENABLE
    update_acl_status(ACL_STATUS_0P);
#endif

	ams397g201_sleep_in(dev);
	msleep(120);

	return 0;
}
Example #2
0
static int s5p_bl_update_status(struct backlight_device* bd)
{

	int bl = bd->props.brightness;
	int level = 0;
	int gamma_value = 0;
	int gamma_val_x10 = 0;
	char i;
	u32 uRegValue;


	if (bl >= MIN_BL)
	{
		gamma_val_x10 = 10*(MAX_GAMMA_VALUE-1)*bl/(MAX_BL-MIN_BL) + (10 - 10*(MAX_GAMMA_VALUE-1)*(MIN_BL)/(MAX_BL-MIN_BL)) ;
		gamma_value = (gamma_val_x10+5)/10;
	}	
	else
	{
		gamma_value = 0;
	}

	for(i=0; i<200; i++)
	{       
		if(IsLDIEnabled())
			break;
 		gprintk("ldi_enable : %d \n",ldi_enable);        

		msleep(10);
	};
	
       gprintk("update status brightness[0~255] : (%d) \n",bd->props.brightness);
	  
	if(IsLDIEnabled())
	{
		bFrameDone = 0;

	       mdelay(10);
		for(i=0;i<15;i++)
		{
			uRegValue = readl(ddi_pd->dsim_base + S5P_DSIM_INTSRC);
			if ( uRegValue & (1 << 24) )
				break;
	 		msleep(7);			
		}

		if(lcd_on_off == 0) 
			ams397g201_display_on(bd->dev.parent);

		if(bl == 0)
			level = 0;	//lcd off
		else if((bl < MIN_BL) && (bl > 0))
			level = 1;	//dimming
		else
			level = 6;	//normal

              pr_err("bl=%d, gamma_value=%d, acl_enable=%d,on_19gamma=%d \n",bl, gamma_value, acl_enable, on_19gamma);

		if(level==0)
		{
			msleep(20);
			ams397g201_display_off(bd->dev.parent);
			gprintk("Update status brightness[0~255]:(%d) - LCD OFF \n", bl);
			lcd_on_off=0;
			bd_brightness = 0;
			backlight_level = 0;
			current_gamma_value = -1;
			bFrameDone = 1;
			return 0;
		}	

		bd_brightness = bd->props.brightness;
		backlight_level = level;
        
		if(current_gamma_value == gamma_value)
		{
			bFrameDone = 1;
			return 0;
		}

	 	if(level)
		{
			switch(level)
			{
				case  5:
				case  4:
				case  3:
				case  2:
				case  1: //dimming
                     {            
				#ifdef ACL_ENABLE
					if (acl_enable)
					{
                        update_acl_status(ACL_STATUS_0P);						
					}
				#endif


                    update_gamma(gamma_value);
                
					break;                
                }
				case  6:
								{		                    
#ifdef ACL_ENABLE
                    if (acl_enable)
                    {   
						if (gamma_value == 1)
						{
						    update_acl_status(ACL_STATUS_0P);
						}
						else
						{							
							if(gamma_value >=2 && gamma_value <=12) 
							{
							    update_acl_status(ACL_STATUS_40P);
							}
							else if(gamma_value == 13) 
							{
							    update_acl_status(ACL_STATUS_43P);
							}
							else if(gamma_value == 14) 
							{
							    update_acl_status(ACL_STATUS_45P);
							}
							else if(gamma_value == 15) 
							{
							    update_acl_status(ACL_STATUS_47P);
							}
							else if(gamma_value == 16) 
							{
							    update_acl_status(ACL_STATUS_48P);
							}
							else
							{
							    update_acl_status(ACL_STATUS_50P);
							}	
						}	
					}              
#endif
                    update_gamma(gamma_value);
                    					
					break;
				}
			}

            current_gamma_value = gamma_value;            
		}			
	}
	bFrameDone = 1;
	
	return 0;
}
Example #3
0
static ssize_t aclset_file_cmd_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
{
	int value;

    gprintk("called %s \n",__func__);

	sscanf(buf, "%d", &value);


	if(IsLDIEnabled()==0)
	{
		printk(KERN_DEBUG "[acl set] return because LDI is disabled, input value = %d \n",value);
		return size;
	}

	if(value==1 && acl_enable == 0)
	{		
		acl_enable = value;
	
        if (current_gamma_value >=0 && current_gamma_value <= 1)
        {
            update_acl_status(ACL_STATUS_0P);            //0 %
        }
        else if(current_gamma_value >=2 && current_gamma_value <= 12)
        {
            update_acl_status(ACL_STATUS_40P);
        }
        else if(current_gamma_value ==13)
        {
            update_acl_status(ACL_STATUS_43P);
        }
        else if(current_gamma_value ==14)
        {
            update_acl_status(ACL_STATUS_45P);
        }
        else if(current_gamma_value ==15)
        {
            update_acl_status(ACL_STATUS_47P);
        }
        else if(current_gamma_value ==16)
        {
            update_acl_status(ACL_STATUS_48P);
        }
        else
        {
            update_acl_status(ACL_STATUS_50P);
        }
	}
	else if(value==0 && acl_enable == 1)
	{
		acl_enable = value;

        //ACL Off
        update_acl_status(ACL_STATUS_0P);            //0 %
		
        gprintk("ACL is disable \n");    
	}
	else
		printk("aclset_file_cmd_store value is same : value(%d)\n",value);

	return size;
}