static int __init nt35582_init(void) { int ret; struct msm_panel_info *pinfo; lcd_panel_wvga=lcd_panel_probe(); if((LCD_NT35582_TRULY_WVGA!=lcd_panel_wvga)&& (LCD_NT35582_BYD_WVGA!=lcd_panel_wvga)) { return 0; } MDDI_LCD_DEBUG("------nt35582_init------\n"); ret = platform_driver_register(&this_driver); if (!ret) { pinfo = &nt35582_panel_data.panel_info; pinfo->xres = 480; pinfo->yres = 800; pinfo->type = MDDI_PANEL; pinfo->pdest = DISPLAY_1; pinfo->mddi.vdopkt = MDDI_DEFAULT_PRIM_PIX_ATTR; pinfo->wait_cycle = 0; /* Set MDDI clk 192MHz,set 24bit per pixel, * adjust the start of data to sync with vsync signal */ /* change 24bit into 16bit */ pinfo->bpp = 16; pinfo->fb_num = 2; pinfo->clk_rate = 192000000; pinfo->clk_min = 192000000; pinfo->clk_max = 192000000; MDDI_LCD_DEBUG("%s: BYD LCD and Truly LCD,set MDDI_CLK=%d \n",__func__, pinfo->clk_rate); #ifdef CONFIG_FB_MSM_DEFAULT_DEPTH_RGB565 pinfo->lcd.vsync_enable = FALSE; #else pinfo->lcd.vsync_enable = TRUE; #endif /* Reduce the fps,sync depend on the vsync signal*/ pinfo->lcd.refx100 = 4000; pinfo->lcd.v_back_porch = 0; pinfo->lcd.v_front_porch = 0; pinfo->lcd.v_pulse_width = 22; pinfo->lcd.hw_vsync_mode = TRUE; pinfo->lcd.vsync_notifier_period = 0; pinfo->bl_max = 255; ret = platform_device_register(&this_device); if (ret) { platform_driver_unregister(&this_driver); MDDI_LCD_DEBUG("%s: Failed on platform_device_register(): rc=%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_lcd_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_lcd_table((struct sequence*)&nt35560_fwvga_automatic_moving_selection_table, ARRAY_SIZE(nt35560_fwvga_automatic_moving_selection_table), lcd_panel_fwvga); } MDDI_LCD_DEBUG("%s: set cabc moving detect: %d\n", __func__, state); return ret; }
/* Revise some spelling mistakes */ int nt35560_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_lcd_table((struct sequence*)&nt35560_fwvga_dynamic_gamma25_table, ARRAY_SIZE(nt35560_fwvga_dynamic_gamma25_table), lcd_panel_fwvga); break ; case GAMMA22: ret = process_lcd_table((struct sequence*)&nt35560_fwvga_dynamic_gamma22_table, ARRAY_SIZE(nt35560_fwvga_dynamic_gamma22_table), lcd_panel_fwvga); break; case HIGH_LIGHT: ret = process_lcd_table((struct sequence*)&nt35560_fwvga_dynamic_gamma19_table, ARRAY_SIZE(nt35560_fwvga_dynamic_gamma19_table), lcd_panel_fwvga); break; default: ret= -1; break; } MDDI_LCD_DEBUG("%s: change gamma mode to %d\n",__func__,gamma_mode); return ret; }
static int nt35582_lcd_off(struct platform_device *pdev) { int ret = 0; ret = process_lcd_table((struct sequence*)&nt35582_wvga_standby_enter_table, ARRAY_SIZE(nt35582_wvga_standby_enter_table), lcd_panel_wvga); MDDI_LCD_DEBUG("%s: nt35582_lcd enter sleep mode ,off_ret=%d\n",__func__,ret); return ret; }
static int nt35582_lcd_off(struct platform_device *pdev) { int ret; /*enter sleep mode*/ ret = mddi_queue_register_write(0x1000,0,TRUE,0); mdelay(50); MDDI_LCD_DEBUG("%s: nt35582_lcd enter sleep mode ,off_ret=%d\n",__func__,ret); 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_lcd_table(nt35560_fwvga_init_table, para_num, lcd_panel_fwvga); } else { if(machine_is_msm8255_u8860lp() || machine_is_msm8255_u8860_51()) { /* Exit Standby Mode */ ret = process_lcd_table((struct sequence*)&nt35560_fwvga_standby_exit_tablelp, ARRAY_SIZE(nt35560_fwvga_standby_exit_tablelp), lcd_panel_fwvga); } else { /* Exit Standby Mode */ ret = process_lcd_table((struct sequence*)&nt35560_fwvga_standby_exit_table, ARRAY_SIZE(nt35560_fwvga_standby_exit_table), lcd_panel_fwvga); } } /* 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); } MDDI_LCD_DEBUG("%s: nt35560_lcd exit sleep mode ,on_ret=%d\n",__func__,ret); 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_lcd_table((struct sequence*)&nt35560_fwvga_write_cabc_mode_table, ARRAY_SIZE(nt35560_fwvga_write_cabc_mode_table), lcd_panel_fwvga); MDDI_LCD_DEBUG("%s: set cabc mode to %d\n", __func__, mode); break; default: MDDI_LCD_DEBUG("%s: invalid cabc mode: %d\n", __func__, mode); ret = -EINVAL; break; } 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_lcd_table(nt35582_wvga_init_table, para_num, lcd_panel_wvga); } else { /* Exit Standby Mode */ ret = process_lcd_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); } MDDI_LCD_DEBUG("%s: nt35582_lcd exit sleep mode ,on_ret=%d\n",__func__,ret); return ret; }
/*************************************************************** 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_lcd_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_lcd_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_lcd_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_lcd_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_lcd_table((struct sequence*)&nt35560_fwvga_abc_ctrl_7_table, ARRAY_SIZE(nt35560_fwvga_abc_ctrl_7_table), lcd_panel_fwvga); } MDDI_LCD_DEBUG("%s: set cabc dimming: %d\n", __func__, state); return ret; }
static int __init nt35510_init_type2(void) { int ret = 0; struct msm_panel_info *pinfo = NULL; bpp_type bpp = MDDI_OUT_16BPP; mddi_type mddi_port_type = mddi_port_type_probe(); lcd_panel_wvga=lcd_panel_probe(); if(LCD_NT35510_ALPHA_SI_WVGA_TYPE2 != lcd_panel_wvga) { return 0; } MDDI_LCD_DEBUG("%s:------nt35510_init_type2------\n",__func__); /* Select which bpp accroding MDDI port type */ if(MDDI_TYPE1 == mddi_port_type) { bpp = MDDI_OUT_16BPP; } else if(MDDI_TYPE2 == mddi_port_type) { bpp = MDDI_OUT_24BPP; } else { bpp = MDDI_OUT_16BPP; } ret = platform_driver_register(&this_driver); if (!ret) { pinfo = &nt35510_panel_data_type2.panel_info; pinfo->xres = 480; pinfo->yres = 800; pinfo->type = MDDI_PANEL; pinfo->pdest = DISPLAY_1; pinfo->mddi.vdopkt = MDDI_DEFAULT_PRIM_PIX_ATTR; pinfo->wait_cycle = 0; pinfo->bpp = (uint32)bpp; pinfo->fb_num = 2; pinfo->clk_rate = 192000000; pinfo->clk_min = 192000000; pinfo->clk_max = 192000000; pinfo->lcd.vsync_enable = TRUE; pinfo->lcd.refx100 = 5500; pinfo->lcd.v_back_porch = 0; pinfo->lcd.v_front_porch = 0; pinfo->lcd.v_pulse_width = 22; pinfo->lcd.hw_vsync_mode = TRUE; pinfo->lcd.vsync_notifier_period = 0; pinfo->bl_max = 255; ret = platform_device_register(&this_device); if (ret) { platform_driver_unregister(&this_driver); } } return ret; }
/* < BU5D10320 lijianzhao 20100521 begin */ static int __init nt35582_init(void) { int ret; struct msm_panel_info *pinfo; /*<BU5D09397 lijuan 00152865, 20100506 begin*/ /*< DTS2010122802758 lijianzhao 20101229 begin */ lcd_panel_wvga=lcd_panel_probe(); if((LCD_NT35582_TRULY_WVGA!=lcd_panel_wvga)&& (LCD_NT35582_BYD_WVGA!=lcd_panel_wvga)) { return 0; } /* DTS2010122802758 lijianzhao 20101229 end >*/ /*BU5D09397 lijuan 00152865, 20100506 end>*/ MDDI_LCD_DEBUG("------nt35582_init------\n"); ret = platform_driver_register(&this_driver); if (!ret) { pinfo = &nt35582_panel_data.panel_info; pinfo->xres = 480; pinfo->yres = 800; pinfo->type = MDDI_PANEL; pinfo->pdest = DISPLAY_1; pinfo->mddi.vdopkt = MDDI_DEFAULT_PRIM_PIX_ATTR; pinfo->wait_cycle = 0; /*< DTS2010071503480 lijianzhao 20100715 begin */ /* Set MDDI clk 192MHz,set 24bit per pixel, * adjust the start of data to sync with vsync signal */ /*< DTS2010093000641 lijianzhao 20100930 begin */ /* change 24bit into 16bit */ pinfo->bpp = 16; /* DTS2010093000641 lijianzhao 20100930 end >*/ pinfo->fb_num = 2; /*< DTS2010080603169 lijianzhao 20100819 begin */ /* Remove the case:DTS2010080602421,BYD and Truly LCD use 192M clk */ pinfo->clk_rate = 192000000; pinfo->clk_min = 192000000; pinfo->clk_max = 192000000; MDDI_LCD_DEBUG("%s: BYD LCD and Truly LCD,set MDDI_CLK=%d \n",__func__, pinfo->clk_rate); pinfo->lcd.vsync_enable = TRUE; /*< DTS2010111203128 lijianzhao 20101112 begin */ /* Reduce the fps,sync depend on the vsync signal*/ pinfo->lcd.refx100 = 4000; /* DTS2010111203128 lijianzhao 20101112 end >*/ /* DTS2010080603169 lijianzhao 20100819 end >*/ pinfo->lcd.v_back_porch = 0; pinfo->lcd.v_front_porch = 0; pinfo->lcd.v_pulse_width = 22; /* DTS2010071503480 lijianzhao 20100715 end >*/ pinfo->lcd.hw_vsync_mode = TRUE; pinfo->lcd.vsync_notifier_period = 0; /*<BU5D09482 sibingsong 20100507 begin*/ pinfo->bl_max = 255; /*BU5D09482 sibingsong 20100507 end>*/ ret = platform_device_register(&this_device); if (ret) { platform_driver_unregister(&this_driver); MDDI_LCD_DEBUG("%s: Failed on platform_device_register(): rc=%d \n",__func__, ret); } } return ret; }