예제 #1
0
int mdnie_send_sequence(struct mdnie_info *mdnie, const unsigned char *seq)
{
 	int ret = 0, i = 0;
 	const unsigned short *wbuf;
 
 	if (IS_ERR_OR_NULL(seq)) {
 		dev_err(mdnie->dev, "mdnie sequence is null\n");
 		return -EPERM;
 	}
 
      if(MDNIE_SUSPEND == mdnie_status)
            return -EPERM;
 
 	mutex_lock(&mdnie->dev_lock);

   printk(" %s write sequence START\n", __func__);
   #if defined(CONFIG_MACH_CAPRI_SS_CRATER)
   ret = vc_display_bus_write(0,0xB9,cabc_on00,3); // test
   ret = vc_display_bus_write(0,0xCD,seq,112);
   #else
   ret = vc_display_bus_write(0,0xE6,seq,112);
   #endif
   printk(" %s write sequence ret =  %d END\n", __func__, ret);
 
 	mutex_unlock(&mdnie->dev_lock);
 
 	return ret;
 }
 static int ldi_cabc_on(void)
{
   int ret = 0;

   ret = vc_display_bus_write(0,0xB9,cabc_on00,3);
   ret = vc_display_bus_write(0,0xC9,cabc_on01,2);
   ret = vc_display_bus_write(0,0x51,cabc_on02,2);
   ret = vc_display_bus_write(0,0x53,cabc_on03,2);
   ret = vc_display_bus_write(0,0x55,cabc_ui,2);
   
   mdelay(5);

   return ret;
}
예제 #3
0
파일: ktd_bl.c 프로젝트: Neves4/DatKernel
static void ktd259b_backlight_earlyresume(struct early_suspend *desc)
{
    struct ktd259b_bl_data *ktd259b = container_of(desc, struct ktd259b_bl_data,
                                                                          early_suspend_desc);
    struct backlight_device *bl = platform_get_drvdata(ktd259b->pdev);
    struct timespec ts;
    struct rtc_time tm;
#ifdef PWM_BRIGHTNESS    
    int temp_brightness = 0;
#endif   
    
    gpio_set_value(backlight_pwm,1);
    
#ifdef PWM_BRIGHTNESS 
    vc_display_bus_write(0,0x51,&temp_brightness,1);    
    mdelay(100);   
    lcd_backlight_control(5);
#endif
    
    getnstimeofday(&ts);
    rtc_time_to_tm(ts.tv_sec, &tm);
    backlight_mode=BACKLIGHT_RESUME;

     if(cabc_status)
     {
        backlight_cabc_on();
     }
     else
     {
        backlight_cabc_off();
     }
    
    printk("[%02d:%02d:%02d.%03lu][BACKLIGHT] earlyresume\n", tm.tm_hour, tm.tm_min, tm.tm_sec, ts.tv_nsec);
    backlight_update_status(bl);
}
예제 #4
0
static int ldi_cabc_off(void)
{
   int ret = 0;

   ret = vc_display_bus_write(0,0x55,cabc_off,1);

   mdelay(5);

   return ret;
}
예제 #5
0
void mdnie_late_resume(struct early_suspend *h)
{
 	u32 i, conversion;
 	struct mdnie_info *mdnie = container_of(h, struct mdnie_info, early_suspend);
#if defined(CONFIG_FB_MDNIE_PWM)
 	struct lcd_platform_data *pd = NULL;
 
 	dev_info(mdnie->dev, "+%s\n", __func__);
 	pd = mdnie->lcd_pd;
 
 	if (mdnie->enable)
 		mdnie_pwm_control(mdnie, 0);
 
 	if (!pd)
 		dev_info(&mdnie->bd->dev, "platform data is NULL.\n");
 
 	if (!pd->power_on)
 		dev_info(&mdnie->bd->dev, "power_on is NULL.\n");
 	else
 		pd->power_on(NULL, 1);
 
 	if (mdnie->enable) {
 		dev_info(&mdnie->bd->dev, "brightness=%d\n", mdnie->bd->props.brightness);
 		update_brightness(mdnie);
 	}
 
 	mdnie->bd_enable = TRUE;
 	dev_info(mdnie->dev, "-%s\n", __func__);
#endif

      printk("[mdnie] %s \n", __func__);

      mdnie_status = MDNIE_RESUME;

 	for (i = 0; i < 5; i++) {
 		if (negative[i].enable){
 			dev_info(mdnie->dev, "pid=%d, %s, %s\n", negative[i].pid, negative[i].comm, negative[i].time);
                   mdnie->negative = NEGATIVE_ON;
 	}
 	}


      //if(NEGATIVE_ON == mdnie->negative)
         mdelay(110);

      set_cabc_value(mdnie, 0);
      set_mdnie_value(mdnie, 0);

      //if(NEGATIVE_ON == mdnie->negative)
        mdelay(30);
 
#if LCD_LOW_TEMP_CONVERSION
        if(lcd_panel_id == LCD_PANEL_DTC){
           if( -50 < get_temp_from_ps_battery()){
         conversion = 0x02;
            }else{
         conversion = 0x01;
            }
        }else{
            if( -50 < get_temp_from_ps_battery()){
                conversion = 0x02;
            }else{
                conversion = 0x01;
            }
         }
      vc_display_bus_write(0,0xB4,&conversion,1);
#endif

 	return ;
}
예제 #6
0
파일: ktd_bl.c 프로젝트: Neves4/DatKernel
/* input: intensity in percentage 0% - 100% */
static int ktd259b_backlight_update_status(struct backlight_device *bd)
{
    int user_intensity = bd->props.brightness;
    int tune_level = 0;
    int pulse;
    int i;

    BLDBG("[BACKLIGHT] ktd259b_backlight_update_status ==> user_intensity  : %d\n", user_intensity);

    g_bl.props.brightness = user_intensity;
    current_intensity = user_intensity;

    if(backlight_mode==BACKLIGHT_RESUME){
       #ifdef PWM_BRIGHTNESS    
        return vc_display_bus_write(0,0x51,&user_intensity,1);
       #endif
        if(user_intensity > 0) {
            if(user_intensity < MIN_BRIGHTNESS_VALUE) {
                tune_level = DIMMING_VALUE; /* DIMMING */
            }else if (user_intensity == MAX_BRIGHTNESS_VALUE) {

                 if(cabc_status){
                   tune_level = brt_table_ktd_cabc[MAX_BRT_STAGE_KTD_CABC-1].tune_level;
                }else{
                tune_level = brt_table_ktd[MAX_BRT_STAGE_KTD-1].tune_level;
                }
            }else{

                if(cabc_status){

                   BLDBG("[BACKLIGHT] cabc ON!\n");
                   for(i = 0; i < MAX_BRT_STAGE_KTD_CABC; i++) {
                       if(user_intensity <= brt_table_ktd_cabc[i].level ) {
                          tune_level = brt_table_ktd_cabc[i].tune_level;
                           break;
                        }
                   }

                }else{
                    BLDBG("[BACKLIGHT] cabc OFF!\n");
                for(i = 0; i < MAX_BRT_STAGE_KTD; i++) {
                    if(user_intensity <= brt_table_ktd[i].level ) {
                        tune_level = brt_table_ktd[i].tune_level;
                        break;
                    }
                }

               }
            }
        }

        if (real_level==tune_level){
            return 0;
        }else{          
            if(tune_level<=0){
                gpio_set_value(backlight_pin,0);
                mdelay(3); 

	      }else{
                if( real_level<=tune_level){
                    pulse = tune_level - real_level;
                }else{
                    pulse = 32 - (real_level - tune_level);
                }

                if (pulse==0){
                    return 0;
                }

                BLDBG("[BACKLIGHT] ktd259b_backlight_update_status ==> tune_level : %d & pulse = %d\n", tune_level, pulse);

                lcd_backlight_control(pulse); 
            }

            real_level = tune_level;
            return 0;
        }

    }
      
    return 0;
}