static void update_acl_status(ACL_STATUS newAclStatus)
{   
    unsigned int flags;
    unsigned int uRegValue;

    if( newAclStatus >= ACL_STATUS_MAX )
    {
        gprintk(" newAclStatus(%d) is invalid \n", newAclStatus);
    }
        
    if( cur_acl_status != newAclStatus )
    {
        mutex_lock(&acl_lock);
        
        acl_is_processing = 1;
        msleep(15); //for 60HZ

        if( newAclStatus == ACL_STATUS_0P )
        {           
            ams397g201_acl_onoff(0);
        }
        else
        {
            panel_acl_send_sequence(acl_cutoff_param_set_tbl[newAclStatus], 
                                    ACL_CUTOFF_PARAM_SET_DATA_COUNT);
        }
        
        acl_is_processing = 0;        
        cur_acl_status = newAclStatus;

        mutex_unlock(&acl_lock);
    }

    gprintk("cur_acl_status is %s \n", acl_status_debug_strtbl[cur_acl_status]);    
}
Exemple #2
0
static int s6e8ax0_set_acl(struct lcd_info *lcd)
{
	int ret = 0;

	if (lcd->acl_enable) {
		if (lcd->cur_acl == 0) {
			if (lcd->bl == 0 || lcd->bl == 1) {
				s6e8ax0_write(lcd, SEQ_ACL_OFF, ARRAY_SIZE(SEQ_ACL_OFF));
				dev_dbg(lcd->dev, "ACL_cutoff_set Percentage : off!!\n");
			} else
				s6e8ax0_write(lcd, SEQ_ACL_ON, ARRAY_SIZE(SEQ_ACL_ON));
		}
		switch (lcd->bl) {
		case 0 ... 1: /* 30cd ~ 40cd */
			if (lcd->cur_acl != 0) {
				s6e8ax0_write(lcd, SEQ_ACL_OFF, ARRAY_SIZE(SEQ_ACL_OFF));
				dev_dbg(&lcd->ld->dev, "ACL_cutoff_set Percentage : off!!\n");
				lcd->cur_acl = 0;
			}
			break;
		case 2 ... 12: /* 70cd ~ 180cd */
			if (lcd->cur_acl != 40) {
				panel_acl_send_sequence(lcd, acl_cutoff_table[1]);
				dev_dbg(&lcd->ld->dev, "ACL_cutoff_set Percentage : 40!!\n");
				lcd->cur_acl = 40;
			}
			break;
		case 13: /* 190cd */
			if (lcd->cur_acl != 43) {
				panel_acl_send_sequence(lcd, acl_cutoff_table[2]);
				dev_dbg(&lcd->ld->dev, "ACL_cutoff_set Percentage : 43!!\n");
				lcd->cur_acl = 43;
			}
			break;
		case 14: /* 200cd */
			if (lcd->cur_acl != 45) {
				panel_acl_send_sequence(lcd, acl_cutoff_table[3]);
				dev_dbg(&lcd->ld->dev, "ACL_cutoff_set Percentage : 45!!\n");
				lcd->cur_acl = 45;
			}
			break;
		case 15: /* 210cd */
			if (lcd->cur_acl != 47) {
				panel_acl_send_sequence(lcd, acl_cutoff_table[4]);
				dev_dbg(&lcd->ld->dev, "ACL_cutoff_set Percentage : 47!!\n");
				lcd->cur_acl = 47;
			}
			break;
		case 16: /* 220cd */
			if (lcd->cur_acl != 48) {
				panel_acl_send_sequence(lcd, acl_cutoff_table[5]);
				dev_dbg(&lcd->ld->dev, "ACL_cutoff_set Percentage : 48!!\n");
				lcd->cur_acl = 48;
			}
			break;
		default:
			if (lcd->cur_acl != 50) {
				panel_acl_send_sequence(lcd, acl_cutoff_table[6]);
				dev_dbg(&lcd->ld->dev, "ACL_cutoff_set Percentage : 50!!\n");
				lcd->cur_acl = 50;
			}
			break;
		}
	} else {
Exemple #3
0
static int s6e8aa0_set_acl(void)
{
	int ret = 0;

	if(!lcd.ldi_enable) {
		ret = -1;
		goto acl_err;
	}

	if (lcd.acl_enable) {
		if(lcd.cur_acl == 0)  {
			s6e8aa0_acl_onoff(1);
		}
		switch (lcd.bl) {
		case 0 ... 1: /* 30cd ~ 40cd */			
			if (lcd.cur_acl != 0) {
				panel_acl_send_sequence(acl_cutoff_param_set_tbl[0], ACL_CUTOFF_PARAM_SET_DATA_COUNT);
				dev_dbg(lcd.dev, "ACL_cutoff_set Percentage : off!!\n");
				lcd.cur_acl = 0;
			}
			break;
		case 2 ... 12: /* 70cd ~ 180cd */
			if (lcd.cur_acl != 40) {
				panel_acl_send_sequence(acl_cutoff_param_set_tbl[1], ACL_CUTOFF_PARAM_SET_DATA_COUNT);
				dev_dbg(lcd.dev, "ACL_cutoff_set Percentage : 40!!\n");
				lcd.cur_acl = 40;
			}
			break;
		case 13: /* 190cd */
			if (lcd.cur_acl != 43) {
				panel_acl_send_sequence(acl_cutoff_param_set_tbl[2], ACL_CUTOFF_PARAM_SET_DATA_COUNT);
				dev_dbg(lcd.dev, "ACL_cutoff_set Percentage : 43!!\n");
				lcd.cur_acl = 43;
			}
			break;
		case 14: /* 200cd */			
			if (lcd.cur_acl != 45) {
				panel_acl_send_sequence(acl_cutoff_param_set_tbl[3], ACL_CUTOFF_PARAM_SET_DATA_COUNT);
				dev_dbg(lcd.dev, "ACL_cutoff_set Percentage : 45!!\n");
				lcd.cur_acl = 45;
			}
			break;
		case 15: /* 210cd */
			if (lcd.cur_acl != 47) {
				panel_acl_send_sequence(acl_cutoff_param_set_tbl[4], ACL_CUTOFF_PARAM_SET_DATA_COUNT);
				dev_dbg(lcd.dev, "ACL_cutoff_set Percentage : 47!!\n");
				lcd.cur_acl = 47;
			}
			break;
		case 16: /* 220cd */			
			if (lcd.cur_acl != 48) {
				panel_acl_send_sequence(acl_cutoff_param_set_tbl[5], ACL_CUTOFF_PARAM_SET_DATA_COUNT);
				dev_dbg(lcd.dev, "ACL_cutoff_set Percentage : 48!!\n");
				lcd.cur_acl = 48;
			}
			break;
		default:
			if (lcd.cur_acl != 50) {
				panel_acl_send_sequence(acl_cutoff_param_set_tbl[6], ACL_CUTOFF_PARAM_SET_DATA_COUNT);
				dev_dbg(lcd.dev, "ACL_cutoff_set Percentage : 50!!\n");
				lcd.cur_acl = 50;
			}
			break;
		}
	}
	else{