/* add the function to set different gama by different mode */ int hx8357c_set_dynamic_gamma(enum danymic_gamma_mode gamma_mode) { int ret = 0; if (LOW_LIGHT == gamma_mode) { printk(KERN_ERR "the dynamic_gamma_setting is wrong\n"); } switch(gamma_mode) { case GAMMA25: ret = process_mddi_table((struct sequence*)&hx8357c_hvga_dynamic_gamma25_table, ARRAY_SIZE(hx8357c_hvga_dynamic_gamma25_table), lcd_panel_hvga); break ; case GAMMA22: ret = process_mddi_table((struct sequence*)&hx8357c_hvga_dynamic_gamma22_table, ARRAY_SIZE(hx8357c_hvga_dynamic_gamma22_table), lcd_panel_hvga); break; case HIGH_LIGHT: ret = process_mddi_table((struct sequence*)&hx8357c_hvga_dynamic_gamma19_table, ARRAY_SIZE(hx8357c_hvga_dynamic_gamma19_table), lcd_panel_hvga); break; default: ret= -1; break; } LCD_DEBUG("%s: change gamma mode to %d\n",__func__,gamma_mode); return ret; }
static int hx8357c_lcd_on(struct platform_device *pdev) { boolean para_debug_flag = FALSE; uint32 para_num = 0; int ret = 0; /* open debug file and read the para */ para_debug_flag = lcd_debug_malloc_get_para( "hx8357c_hvga_init_table", (void**)&hx8357c_hvga_init_table,¶_num); /* If exist the init file ,then init lcd with it for debug */ if( (TRUE == para_debug_flag)&&(NULL != hx8357c_hvga_init_table)) { ret = process_mddi_table(hx8357c_hvga_init_table, para_num, lcd_panel_hvga); } else { /* Exit Standby Mode */ ret = process_mddi_table((struct sequence*)&hx8357c_hvga_standby_exit_table, ARRAY_SIZE(hx8357c_hvga_standby_exit_table), lcd_panel_hvga); } /* 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); } LCD_DEBUG("%s: hx8357c_lcd exit sleep mode ,on_ret=%d\n",__func__,ret); return ret; }
/*************************************************************** Function: nt35560_set_cabc_moving_detect Description: Set CABC moving detect function on or off Parameters: uint32 state: 0 for off, 1 for on Return: 0: success ***************************************************************/ static int nt35560_set_cabc_moving_detect(uint32 state) { int ret = 0; if (state == STATE_OFF) { /* Turn off automatic moving mode selection */ nt35560_fwvga_automatic_moving_selection_table[0].value = DEFAULT_VAL_MOV_CTRL1; ret = process_mddi_table((struct sequence*)&nt35560_fwvga_automatic_moving_selection_table, ARRAY_SIZE(nt35560_fwvga_automatic_moving_selection_table), lcd_panel_fwvga); } else { /* Automatic moving mode selection * If host's frame RAM update rate is 20 frames per second, * the CABC mode will be changed from still mode to moving mode. * This function is only available in normal display mode with CABC mode is set still mode. */ nt35560_fwvga_automatic_moving_selection_table[0].value = (DEFAULT_VAL_MOV_CTRL1 & (~MASK_MOVDET)) | VAL_MOVDET(0x13); ret = process_mddi_table((struct sequence*)&nt35560_fwvga_automatic_moving_selection_table, ARRAY_SIZE(nt35560_fwvga_automatic_moving_selection_table), lcd_panel_fwvga); } LCD_DEBUG("%s: set cabc moving detect: %d\n", __func__, state); return ret; }
static int nt35560_lcd_on(struct platform_device *pdev) { int ret = 0; boolean para_debug_flag = FALSE; uint32 para_num = 0; /* open debug file and read the para */ switch(lcd_panel_fwvga) { case LCD_NT35560_TOSHIBA_FWVGA: para_debug_flag = lcd_debug_malloc_get_para( "nt35560_toshiba_fwvga_init_table", (void**)&nt35560_fwvga_init_table,¶_num); break; default: break; } /* If exist the init file ,then init lcd with it for debug */ if( (TRUE == para_debug_flag)&&(NULL != nt35560_fwvga_init_table)) { ret = process_mddi_table(nt35560_fwvga_init_table, para_num, lcd_panel_fwvga); } else { /*<DTS2011081002714 jiaoshuangwei 20110810 begin*/ if(machine_is_msm8255_u8860lp() /* < DTS2012022905490 ganfan 20120301 begin */ || machine_is_msm8255_u8860_r() /* DTS2012022905490 ganfan 20120301 end > */ /*<DTS2011091502092 liyuping 20110915 begin */ || machine_is_msm8255_u8860_51()) /* DTS2011091502092 liyuping 20110915 end> */ { /* Exit Standby Mode */ ret = process_mddi_table((struct sequence*)&nt35560_fwvga_standby_exit_tablelp, ARRAY_SIZE(nt35560_fwvga_standby_exit_tablelp), lcd_panel_fwvga); } else { /* Exit Standby Mode */ ret = process_mddi_table((struct sequence*)&nt35560_fwvga_standby_exit_table, ARRAY_SIZE(nt35560_fwvga_standby_exit_table), lcd_panel_fwvga); } /*DTS2011081002714 jiaoshuangwei 20110810 end >*/ } /* Must malloc before,then you can call free */ if((TRUE == para_debug_flag)&&(NULL != nt35560_fwvga_init_table)) { lcd_debug_free_para((void *)nt35560_fwvga_init_table); } LCD_DEBUG("%s: nt35560_lcd exit sleep mode ,on_ret=%d\n",__func__,ret); return ret; }
void mddi_rsp61408_set_cabc_backlight(struct msm_fb_data_type *mfd,uint32 bl_level) { rsp61408_wvga_write_cabc_brightness_table[2].reg = bl_level; process_mddi_table((struct sequence*)&rsp61408_wvga_write_cabc_brightness_table, ARRAY_SIZE(rsp61408_wvga_write_cabc_brightness_table), lcd_panel_wvga); }
static void hx8369a_set_cabc_brightness(struct msm_fb_data_type *mfd,uint32 bl_level) { int ret = 0; hx8369a_wvga_write_cabc_brightness_table[1].reg = bl_level; ret = process_mddi_table((struct sequence*)&hx8369a_wvga_write_cabc_brightness_table, ARRAY_SIZE(hx8369a_wvga_write_cabc_brightness_table), lcd_panel_wvga); }
static int nt35510_lcd_off_type2(struct platform_device *pdev) { int ret = 0; ret = process_mddi_table((struct sequence*)&nt35510_wvga_standby_enter_table_type2, ARRAY_SIZE(nt35510_wvga_standby_enter_table_type2), lcd_panel_wvga); LCD_DEBUG("%s: nt35510_lcd_type2 enter sleep mode ,off_ret=%d\n",__func__,ret); return ret; }
static int hx8357c_lcd_off(struct platform_device *pdev) { int ret = 0; ret = process_mddi_table((struct sequence*)&hx8357c_hvga_standby_enter_table, ARRAY_SIZE(hx8357c_hvga_standby_enter_table), lcd_panel_hvga); LCD_DEBUG("%s: hx8357c_lcd enter sleep mode ,off_ret=%d\n",__func__,ret); return ret; }
static int rsp61408_lcd_on(struct platform_device *pdev) { boolean para_debug_flag = FALSE; uint32 para_num = 0; int ret = 0; switch(lcd_panel_wvga) { case MDDI_RSP61408_BYD_WVGA: case MDDI_RSP61408_CHIMEI_WVGA: para_debug_flag = lcd_debug_malloc_get_para( "rsp61408_wvga_init_table", (void**)&rsp61408_wvga_init_table,¶_num); break; default: break; } if( (TRUE == para_debug_flag)&&(NULL != rsp61408_wvga_init_table)) { ret = process_mddi_table(rsp61408_wvga_init_table, para_num, lcd_panel_wvga); } else { /*reset the direction register to resolve the problem of revert. */ /* Exit Standby Mode */ if(machine_is_msm8255_u8730()) { ret = process_mddi_table((struct sequence*)&reverse_rsp61408_wvga_exit_table, ARRAY_SIZE(reverse_rsp61408_wvga_exit_table), lcd_panel_wvga); } else { ret = process_mddi_table((struct sequence*)&rsp61408_wvga_standby_exit_table, ARRAY_SIZE(rsp61408_wvga_standby_exit_table), lcd_panel_wvga); } } if((TRUE == para_debug_flag)&&(NULL != rsp61408_wvga_init_table)) { lcd_debug_free_para((void *)rsp61408_wvga_init_table); } LCD_DEBUG("%s: rsp61408_lcd exit sleep mode ,on_ret=%d\n",__func__,ret); return ret; }
static int nt35582_lcd_on(struct platform_device *pdev) { boolean para_debug_flag = FALSE; uint32 para_num = 0; int ret = 0; /* open debug file and read the para */ switch(lcd_panel_wvga) { case LCD_NT35582_TRULY_WVGA: para_debug_flag = lcd_debug_malloc_get_para( "nt35582_truly_wvga_init_table", (void**)&nt35582_wvga_init_table,¶_num); break; case LCD_NT35582_BYD_WVGA: para_debug_flag = lcd_debug_malloc_get_para( "nt35582_byd_wvga_init_table", (void**)&nt35582_wvga_init_table,¶_num); break; default: break; } /* If exist the init file ,then init lcd with it for debug */ if( (TRUE == para_debug_flag)&&(NULL != nt35582_wvga_init_table)) { ret = process_mddi_table(nt35582_wvga_init_table, para_num, lcd_panel_wvga); } else { /* Exit Standby Mode */ ret = process_mddi_table((struct sequence*)&nt35582_wvga_standby_exit_table, ARRAY_SIZE(nt35582_wvga_standby_exit_table), lcd_panel_wvga); } /* Must malloc before,then you can call free */ if((TRUE == para_debug_flag)&&(NULL != nt35582_wvga_init_table)) { lcd_debug_free_para((void *)nt35582_wvga_init_table); } LCD_DEBUG("%s: nt35582_lcd exit sleep mode ,on_ret=%d\n",__func__,ret); return ret; }
static int htcrhod_mddi_client_uninit( struct msm_mddi_bridge_platform_data *bridge_data, struct msm_mddi_client_data *client_data) { printk(KERN_DEBUG "+%s\n", __func__); process_mddi_table(client_data, nov_deinit_seq, ARRAY_SIZE(nov_deinit_seq)); printk(KERN_DEBUG "-%s\n", __func__); return 0; }
/*************************************************************** Function: nt35560_set_cabc_dimming Description: Set CABC dimming function on or off Parameters: uint32 state: 0 for off, 1 for on Return: 0: success ***************************************************************/ static int nt35560_set_cabc_dimming(uint32 state) { int ret = 0; /* Set DMCT bit to 1, then the CABC dimming function is controlled by DD_C */ nt35560_fwvga_abc_ctrl_14_table[0].value = VAL_BIT_DMCT | DEFAULT_VAL_ABC_CTRL14; ret = process_mddi_table((struct sequence*)&nt35560_fwvga_abc_ctrl_14_table, ARRAY_SIZE(nt35560_fwvga_abc_ctrl_14_table), lcd_panel_fwvga); if (state == STATE_OFF) { /* Turn off the CABC dimming function */ nt35560_fwvga_abc_ctrl_2_table[0].value = (~VAL_BIT_DD_C) & DEFAULT_VAL_ABC_CTRL2; ret = process_mddi_table((struct sequence*)&nt35560_fwvga_abc_ctrl_2_table, ARRAY_SIZE(nt35560_fwvga_abc_ctrl_2_table), lcd_panel_fwvga); } else { /* Turn on the CABC dimming function */ nt35560_fwvga_abc_ctrl_2_table[0].value = VAL_BIT_DD_C | DEFAULT_VAL_ABC_CTRL2; ret = process_mddi_table((struct sequence*)&nt35560_fwvga_abc_ctrl_2_table, ARRAY_SIZE(nt35560_fwvga_abc_ctrl_2_table), lcd_panel_fwvga); /* DIM_STEP_STILL, 8 steps */ nt35560_fwvga_abc_ctrl_6_table[0].value = (DEFAULT_VAL_ABC_CTRL6 & (~MASK_DIM_STEP_STILL)) | VAL_DIM_STEP_STILL(0x02); ret = process_mddi_table((struct sequence*)&nt35560_fwvga_abc_ctrl_6_table, ARRAY_SIZE(nt35560_fwvga_abc_ctrl_6_table), lcd_panel_fwvga); /* DMST_C, 4 frames per step */ nt35560_fwvga_abc_ctrl_7_table[0].value = (DEFAULT_VAL_ABC_CTRL7 & (~MASK_DMST_C)) | VAL_DMST_C(0x3); ret = process_mddi_table((struct sequence*)&nt35560_fwvga_abc_ctrl_7_table, ARRAY_SIZE(nt35560_fwvga_abc_ctrl_7_table), lcd_panel_fwvga); } LCD_DEBUG("%s: set cabc dimming: %d\n", __func__, state); return ret; }
/*************************************************************** Function: nt35560_set_cabc_mode Description: Set CABC mode Parameters: uint32 mode: 0 for off, 1 for UI mode, 2 for still mode, 3 for moving mode Return: 0: success ***************************************************************/ static int nt35560_set_cabc_mode(uint32 mode) { int ret = 0; switch (mode) { case CABC_MODE_OFF: case CABC_MODE_UI: case CABC_MODE_STILL: case CABC_MODE_MOVING: /* Set CABC mode, 0 for off, 1 for UI mode, 2 for still mode, 3 for moving mode */ nt35560_fwvga_write_cabc_mode_table[0].value = mode; ret = process_mddi_table((struct sequence*)&nt35560_fwvga_write_cabc_mode_table, ARRAY_SIZE(nt35560_fwvga_write_cabc_mode_table), lcd_panel_fwvga); LCD_DEBUG("%s: set cabc mode to %d\n", __func__, mode); break; default: LCD_DEBUG("%s: invalid cabc mode: %d\n", __func__, mode); ret = -EINVAL; break; } return ret; }
/*************************************************************** Function: nt35560_set_cabc_brightness Description: Set CABC brightness Parameters: uint32 brightness: backlight brightness value Return: 0: success ***************************************************************/ static void nt35560_set_cabc_brightness(struct msm_fb_data_type *mfd,uint32 bl_level) { nt35560_fwvga_write_cabc_brightness_table[0].value = bl_level; process_mddi_table((struct sequence*)&nt35560_fwvga_write_cabc_brightness_table, ARRAY_SIZE(nt35560_fwvga_write_cabc_brightness_table), lcd_panel_fwvga); }
static int htcrhod_mddi_client_init( struct msm_mddi_bridge_platform_data *bridge_data, struct msm_mddi_client_data *client_data) { static int initial_init = 1; printk(KERN_DEBUG "+%s\n", __func__); switch (panel_id) { case PANEL_EID: /* 0x07 - EID */ client_data->auto_hibernate(client_data, 0); process_mddi_table(client_data, nov_init_eid, ARRAY_SIZE(nov_init_eid)); client_data->auto_hibernate(client_data, 1); break; case PANEL_EID_ES3: /* 0x14 - EID ES3*/ client_data->auto_hibernate(client_data, 0); process_mddi_table(client_data, nov_init_eid_es3, ARRAY_SIZE(nov_init_eid_es3)); client_data->auto_hibernate(client_data, 1); break; case PANEL_AUO_ES1: /* 0x01 - AUO ES1 */ client_data->auto_hibernate(client_data, 0); /* todo: set clock a cleaner way.*/ writel((readl(MSM_CLK_CTL_BASE + 0x8c) &0xfffff000) | 0xA41, MSM_CLK_CTL_BASE + 0x8c); process_mddi_table(client_data, nov_init_auo_es1_1, ARRAY_SIZE(nov_init_auo_es1_1)); writel((readl(MSM_CLK_CTL_BASE + 0x8c) &0xfffff000) | 0xA21, MSM_CLK_CTL_BASE + 0x8c); process_mddi_table(client_data, nov_init_auo_es1_2, ARRAY_SIZE(nov_init_auo_es1_2)); client_data->auto_hibernate(client_data, 1); break; case PANEL_AUO_ES2: /* 0x13 - AUO ES2 */ client_data->auto_hibernate(client_data, 0); /* todo: set clock a cleaner way. This panel has been problematic.*/ writel((readl(MSM_CLK_CTL_BASE + 0x8c) &0xfffff000) | 0xA41, MSM_CLK_CTL_BASE + 0x8c); process_mddi_table(client_data, nov_init_auo_es2_1, ARRAY_SIZE(nov_init_auo_es2_1)); writel((readl(MSM_CLK_CTL_BASE + 0x8c) &0xfffff000) | 0xA21, MSM_CLK_CTL_BASE + 0x8c); process_mddi_table(client_data, nov_init_auo_es2_2, ARRAY_SIZE(nov_init_auo_es2_2)); client_data->auto_hibernate(client_data, 1); break; case PANEL_SHARP_EVT: /* 0x15 - SHARP EVT*/ client_data->auto_hibernate(client_data, 0); process_mddi_table(client_data, nov_init_sharp_evt, ARRAY_SIZE(nov_init_sharp_evt)); process_mddi_table(client_data, nov_init_sharp, ARRAY_SIZE(nov_init_sharp)); client_data->auto_hibernate(client_data, 1); break; default: printk(KERN_WARNING "%s: FIXME! Unknown panel_id 0x%x?\n", __func__, panel_id); return 0; } /* The init sequence disables the backlight brightness (0x5100 set to 0). * On first boot, unblank is called around second 20. Until then the panel * is kept blank. We set the initial panel brightness to full in order to * see the output. */ if (initial_init) { initial_init = 0; printk(KERN_DEBUG "%s: setting initial panel brightness=%d\n", __func__, LED_FULL); client_data->remote_write(client_data, LED_FULL, 0x5100); } printk(KERN_DEBUG "-%s\n", __func__); return 0; }