/*************************************************************** Function: hx8369b_config_auto_cabc Description: Set CABC configuration Parameters: struct msmfb_cabc_config cabc_cfg: CABC configuration struct Return: 0: success ***************************************************************/ static int hx8369b_config_auto_cabc(struct msmfb_cabc_config cabc_cfg,struct msm_fb_data_type *mfd) { int ret = 0; switch(cabc_cfg.mode) { case CABC_MODE_UI: hx8369b_auto_cabc_set_table[1].reg=0x00001; break; case CABC_MODE_MOVING: case CABC_MODE_STILL: hx8369b_auto_cabc_set_table[1].reg=0x00003; break; default: LCD_DEBUG("%s: invalid cabc mode: %d\n", __func__, cabc_cfg.mode); ret = -EINVAL; break; } if(likely(0 == ret)) { process_mipi_table(mfd,&hx8369b_tx_buf,(struct sequence*)&hx8369b_auto_cabc_set_table, ARRAY_SIZE(hx8369b_auto_cabc_set_table), lcd_panel_wvga); } LCD_DEBUG("%s: change cabc mode to %d\n",__func__,cabc_cfg.mode); return ret; }
static int __init mipi_cmd_nt35510_fwvga_init(void) { int ret = 0; struct msm_panel_info *pinfo = NULL; lcd_panel_fwvga = get_lcd_panel_type(); if (MIPI_CMD_NT35510_BOE_FWVGA != lcd_panel_fwvga ) { return 0; } LCD_DEBUG("enter mipi_cmd_nt35510_fwvga_init \n"); mipi_dsi_buf_alloc(&nt35510_fwvga_tx_buf, DSI_BUF_SIZE); mipi_dsi_buf_alloc(&nt35510_fwvga_rx_buf, DSI_BUF_SIZE); ret = platform_driver_register(&this_driver); if (!ret) { pinfo = &nt35510_fwvga_panel_data.panel_info; pinfo->xres = 480; pinfo->yres = 854; pinfo->type = MIPI_CMD_PANEL; pinfo->pdest = DISPLAY_1; pinfo->wait_cycle = 0; pinfo->bpp = 24; pinfo->bl_max = 255; pinfo->bl_min = 30; pinfo->fb_num = 2; /* increase the DSI bit clock to 490 MHz */ pinfo->clk_rate = 490000000; pinfo->lcd.refx100 = 6000; /* adjust refx100 to prevent tearing */ pinfo->mipi.mode = DSI_CMD_MODE; pinfo->mipi.dst_format = DSI_CMD_DST_FORMAT_RGB888; pinfo->mipi.vc = 0; pinfo->mipi.rgb_swap = DSI_RGB_SWAP_RGB; pinfo->mipi.data_lane0 = TRUE; pinfo->mipi.data_lane1 = TRUE; pinfo->mipi.t_clk_post = 0xB0;// min 60 + 128*UI pinfo->mipi.t_clk_pre = 0x2f;// min 8*UI pinfo->mipi.stream = 0; /* dma_p */ pinfo->mipi.mdp_trigger = DSI_CMD_TRIGGER_SW; pinfo->mipi.dma_trigger = DSI_CMD_TRIGGER_SW; pinfo->lcd.hw_vsync_mode = TRUE; pinfo->lcd.vsync_enable = TRUE; pinfo->mipi.te_sel = 1; /* TE from vsync gpio */ pinfo->mipi.interleave_max = 1; pinfo->mipi.insert_dcs_cmd = TRUE; pinfo->mipi.wr_mem_continue = 0x3c; pinfo->mipi.wr_mem_start = 0x2c; pinfo->mipi.dsi_phy_db = &dsi_cmd_mode_phy_db_nt35510_fwvga; pinfo->mipi.tx_eot_append = 0x01; pinfo->mipi.rx_eot_ignore = 0; pinfo->mipi.dlane_swap = 0x1; ret = platform_device_register(&this_device); if (ret) LCD_DEBUG("%s: failed to register device!\n", __func__); } return ret; }
static int nt35510_config_auto_cabc(struct msmfb_cabc_config cabc_cfg,struct msm_fb_data_type *mfd) { int ret = 0; switch(cabc_cfg.mode) { case CABC_MODE_UI: /* the value of cabc register should be 24 in UI mode */ nt35510_auto_cabc_set_table[1].reg=0x00024; nt35510_auto_cabc_set_table[3].reg=0x00001; break; case CABC_MODE_MOVING: case CABC_MODE_STILL: /* the value of cabc register should be 2C in moving mode and still mode */ nt35510_auto_cabc_set_table[1].reg=0x0002C; nt35510_auto_cabc_set_table[3].reg=0x00003; break; default: LCD_DEBUG("%s: invalid cabc mode: %d\n", __func__, cabc_cfg.mode); ret = -EINVAL; break; } if(likely(0 == ret)) { process_mipi_table(mfd,&nt35510_tx_buf,(struct sequence*)&nt35510_auto_cabc_set_table, ARRAY_SIZE(nt35510_auto_cabc_set_table), lcd_panel_wvga); } LCD_DEBUG("%s: change cabc mode to %d\n",__func__,cabc_cfg.mode); return ret; }
static int hx8357a_hvga_panel_on(struct platform_device *pdev) { if (!hx8357a_hvga_state.disp_initialized) { hx8357a_hvga_reset(); lcd_spi_init(lcdc_hx8357a_hvga_pdata); /* LCD needs SPI */ hx8357a_hvga_disp_powerup(); hx8357a_hvga_disp_on(); hx8357a_hvga_state.disp_initialized = TRUE; LCD_DEBUG("%s: hx8357a lcd initialized\n", __func__); } else if (!hx8357a_hvga_state.display_on) { switch(lcd_panel_hvga) { case LCD_HX8357A_TRULY_HVGA: /* Exit Standby Mode */ process_lcdc_table((struct command*)&hx8357a_truly_hvga_standby_exit_table, ARRAY_SIZE(hx8357a_truly_hvga_standby_exit_table)); break; case LCD_HX8357A_WINTEK_HVGA: /* Exit Standby Mode */ process_lcdc_table((struct command*)&hx8357a_wintek_hvga_standby_exit_table, ARRAY_SIZE(hx8357a_wintek_hvga_standby_exit_table)); break; } LCD_DEBUG("%s: Exit Standby Mode\n", __func__); hx8357a_hvga_state.display_on = TRUE; } return 0; }
static int hx8357c_hvga_panel_on(struct platform_device *pdev) { boolean para_debug_flag = FALSE; uint32 para_num = 0; /* open debug file and read the para */ switch(lcd_panel_hvga) { case LCD_HX8357C_TIANMA_HVGA: para_debug_flag = lcd_debug_malloc_get_para( "hx8357c_tianma_hvga_init_table", (void**)&hx8357c_hvga_init_table,¶_num); break; default: break; } if (!hx8357c_hvga_state.disp_initialized) { hx8357c_hvga_reset(); lcd_spi_init(lcdc_hx8357c_hvga_pdata); /* LCD needs SPI */ hx8357c_hvga_disp_powerup(); hx8357c_hvga_disp_on(); hx8357c_hvga_state.disp_initialized = TRUE; if( (TRUE == para_debug_flag) && (NULL != hx8357c_hvga_init_table)) { // lcd_reset(); process_lcdc_table(hx8357c_hvga_init_table, para_num,lcd_panel_hvga); } LCD_DEBUG("%s: hx8357c lcd initialized\n", __func__); } else if (!hx8357c_hvga_state.display_on) { switch(lcd_panel_hvga) { case LCD_HX8357C_TIANMA_HVGA: if( (TRUE == para_debug_flag)&&(NULL != hx8357c_hvga_init_table)) { // lcd_reset(); process_lcdc_table(hx8357c_hvga_init_table, para_num,lcd_panel_hvga); } else { /* Exit Standby Mode */ process_lcdc_table((struct sequence*)&hx8357c_tianma_hvga_standby_exit_table, ARRAY_SIZE(hx8357c_tianma_hvga_standby_exit_table), lcd_panel_hvga); } break; default: break; } LCD_DEBUG("%s: Exit Standby Mode\n", __func__); hx8357c_hvga_state.display_on = TRUE; } /* 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); } return 0; }
static int nt35410_hvga_panel_on(struct platform_device *pdev) { boolean para_debug_flag = FALSE; uint32 para_num = 0; switch(lcd_panel_hvga) { case LCD_NT35410_CHIMEI_HVGA: para_debug_flag = lcd_debug_malloc_get_para( "lcdc_nt35410_hvga_init_table", (void**)&lcdc_nt35410_hvga_init_table,¶_num); break; default: break; } if (!nt35410_hvga_state.disp_initialized) { nt35410_hvga_reset(); lcd_spi_init(lcdc_nt35410_hvga_pdata); /* LCD needs SPI */ nt35410_hvga_disp_powerup(); nt35410_hvga_disp_on(); nt35410_hvga_state.disp_initialized = TRUE; if((TRUE == para_debug_flag) && (NULL != lcdc_nt35410_hvga_init_table)) { process_lcdc_table(lcdc_nt35410_hvga_init_table,para_num,lcd_panel_hvga); } LCD_DEBUG("%s: nt35410 lcd initialized\n", __func__); } else if (!nt35410_hvga_state.display_on) { switch(lcd_panel_hvga) { case LCD_NT35410_CHIMEI_HVGA: if( (TRUE == para_debug_flag)&&(NULL != lcdc_nt35410_hvga_init_table)) { process_lcdc_table(lcdc_nt35410_hvga_init_table,para_num,lcd_panel_hvga); } else { /* Exit Standby Mode */ process_lcdc_table((struct sequence*)&nt35410_chimei_hvga_standby_exit_table, ARRAY_SIZE(nt35410_chimei_hvga_standby_exit_table),lcd_panel_hvga); } break; default: break; } LCD_DEBUG("%s: Exit Standby Mode\n", __func__); nt35410_hvga_state.display_on = TRUE; } /* Must malloc before,then you can call free */ if((TRUE == para_debug_flag)&&(NULL != lcdc_nt35410_hvga_init_table)) { lcd_debug_free_para((void *)lcdc_nt35410_hvga_init_table); } return 0; }
static int __init lcdc_s6d74a0_panel_init(void) { int ret; struct msm_panel_info *pinfo; #ifdef CONFIG_FB_MSM_TRY_MDDI_CATCH_LCDC_PRISM //if (msm_fb_detect_client("lcdc_s6d74a0_hvga")) // return 0; #endif LCD_DEBUG("ENTER lcdc_s6d74a0_panel_init\n"); lcd_panel_hvga = lcd_panel_probe(); if((LCD_S6D74A0_SAMSUNG_HVGA != lcd_panel_hvga) && \ (msm_fb_detect_client("lcdc_s6d74a0_hvga")) ) { return 0; } ret = platform_driver_register(&this_driver); if (ret) return ret; pinfo = &s6d74a0_panel_data.panel_info; pinfo->xres = 320; pinfo->yres = 480; pinfo->type = LCDC_PANEL; pinfo->pdest = DISPLAY_1; pinfo->wait_cycle = 0; pinfo->bpp = 24; pinfo->fb_num = 2; /*modify HVGA LCD pclk frequency to 8.192MHz*/ /*the pixel clk is different for different Resolution LCD*/ //pinfo->clk_rate = 24500000; /*for VGA pixel clk*/ //pinfo->clk_rate = 8192000; /*for HVGA pixel clk*/ pinfo->clk_rate = 9660000; //pinfo->clk_rate = 6125000; /*for QVGA pixel clk*/ pinfo->lcdc.h_back_porch = 7; pinfo->lcdc.h_front_porch = 4; pinfo->lcdc.h_pulse_width = 4; pinfo->lcdc.v_back_porch = 2; pinfo->lcdc.v_front_porch = 4; pinfo->lcdc.v_pulse_width = 2; pinfo->lcdc.border_clr = 0; /* blk */ pinfo->lcdc.underflow_clr = 0xff; /* blue */ pinfo->lcdc.hsync_skew = 0; pinfo->bl_max = 255; ret = platform_device_register(&this_device); if (ret) platform_driver_unregister(&this_driver); LCD_DEBUG(" lcdc_s6d74a0_panel_init OK \n"); return ret; }
void sp_send(const uint _debug) { if (sp_fd >= 0) { if (strlen(sp_tx_buf) > 0) { LCD_DEBUG(_debug,"- sp_tx_buf = [%s]\tbefore send\n", sp_tx_buf); LED_SET(LED_LCD,1); write(sp_fd, sp_tx_buf, strlen(sp_tx_buf)); } memset(sp_tx_buf, 0, sizeof (sp_tx_buf)); LCD_DEBUG(_debug,"- sp_tx_buf = [%s]\tafter send\n", sp_tx_buf); } }
static int __init nt35582_init(void) { int ret; struct msm_panel_info *pinfo; lcd_panel_wvga=get_lcd_panel_type(); if((LCD_NT35582_TRULY_WVGA!=lcd_panel_wvga)&& (LCD_NT35582_BYD_WVGA!=lcd_panel_wvga)) { return 0; } 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; LCD_DEBUG("%s: BYD LCD and Truly LCD,set MDDI_CLK=%d \n",__func__, pinfo->clk_rate); pinfo->lcd.vsync_enable = TRUE; /* 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); 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_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 void lcm_resume_tm(void) { //enable VSP & VSN lcm_util.set_gpio_out(GPIO_LCD_BIAS_ENP_PIN, GPIO_OUT_ONE); mdelay(10); lcm_util.set_gpio_out(GPIO_LCD_BIAS_ENN_PIN, GPIO_OUT_ONE); msleep(50); //reset low to high lcm_util.set_gpio_out(GPIO_DISP_LRSTB_PIN, GPIO_OUT_ONE); mdelay(5); lcm_util.set_gpio_out(GPIO_DISP_LRSTB_PIN, GPIO_OUT_ZERO); mdelay(5); lcm_util.set_gpio_out(GPIO_DISP_LRSTB_PIN, GPIO_OUT_ONE); msleep(20); push_table(lcm_initialization_setting_tm, sizeof(lcm_initialization_setting_tm) / sizeof(struct LCM_setting_table), 1); //Back to MP.P7 baseline , solve LCD display abnormal On the right //when sleep out, config output high ,enable backlight drv chip lcm_util.set_gpio_out(GPIO_LCD_DRV_EN_PIN, GPIO_OUT_ONE); LCD_DEBUG("uboot:tm_nt35521_lcm_resume\n"); }
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; }
/* 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 void nt35410_hvga_disp_on(void) { if (nt35410_hvga_state.disp_powered_up && !nt35410_hvga_state.display_on) { LCD_DEBUG("%s: disp on lcd\n", __func__); nt35410_hvga_state.display_on = TRUE; } }
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 lcdc_s6d74a0_panel_on(struct platform_device *pdev) { boolean para_debug_flag = FALSE; uint32 para_num = 0; LCD_DEBUG("ENTER lcdc_s6d74a0_panel_on\n"); /* open debug file and read the para */ switch(lcd_panel_hvga) { case LCD_S6D74A0_SAMSUNG_HVGA: para_debug_flag = lcd_debug_malloc_get_para( "s6d74a0_samsung_init_table", (void**)&s6d74a0_samsung_init_table,¶_num); break; default: break; } if(!lcd_s6d74a0_state.disp_initialized) { lcdc_s6d74a0_pdata->panel_config_gpio(1); lcd_reset_gpio = *(lcdc_s6d74a0_pdata->gpio_num + 4); lcd_spi_init(lcdc_s6d74a0_pdata); /* LCD needs SPI */ lcd_s6d74a0_disp_powerup(); lcd_s6d74a0_state.display_on = TRUE; lcd_s6d74a0_state.disp_initialized = TRUE; } else if(!lcd_s6d74a0_state.display_on) { switch(lcd_panel_hvga) { case LCD_S6D74A0_SAMSUNG_HVGA: if((TRUE == para_debug_flag) &&(NULL != s6d74a0_samsung_init_table)) { //seriout(0x0010, 0x0000); the table should add this value on the front delete by zhangpeng 20110112 process_lcdc_table(s6d74a0_samsung_init_table, para_num, LCD_S6D74A0_SAMSUNG_HVGA); } else { process_lcdc_table((struct sequence*)&s6d74a0_samsung_init, ARRAY_SIZE(s6d74a0_samsung_init), LCD_S6D74A0_SAMSUNG_HVGA); } break; default: break; } lcd_s6d74a0_state.display_on = TRUE; } /* Must malloc before,then you can call free */ if((TRUE == para_debug_flag)&&(NULL != s6d74a0_samsung_init_table)) { lcd_debug_free_para((void *)s6d74a0_samsung_init_table); } return 0; }
static void hx8347d_qvga_disp_on(void) { if (hx8347d_qvga_state.disp_powered_up && !hx8347d_qvga_state.display_on) { LCD_DEBUG("%s: disp on lcd\n", __func__); /* Initialize LCD */ hx8347d_qvga_state.display_on = TRUE; } }
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; }
static int __init truly_r61529_hvga_panel_init(void) { int ret; struct msm_panel_info *pinfo; /*< DTS2011122306018 fengwei 20111224 begin */ lcd_panel_hvga = get_lcd_panel_type(); /* DTS2011122306018 fengwei 20111224 end >*/ if((LCD_R61529_TRULY_HVGA != lcd_panel_hvga) && \ (msm_fb_detect_client(lCD_DRIVER_NAME)) ) { return 0; } LCD_DEBUG(" lcd_type=%s, lcd_panel_hvga = %d\n", lCD_DRIVER_NAME, lcd_panel_hvga); ret = platform_driver_register(&this_driver); if (ret) return ret; pinfo = &truly_r61529_hvga_panel_data.panel_info; pinfo->xres = 320; pinfo->yres = 480; pinfo->type = LCDC_PANEL; pinfo->pdest = DISPLAY_1; pinfo->wait_cycle = 0; pinfo->bpp = 18; pinfo->fb_num = 2; pinfo->bl_max = LCD_MAX_BACKLIGHT_LEVEL; pinfo->bl_min = LCD_MIN_BACKLIGHT_LEVEL; if(LCD_R61529_TRULY_HVGA== lcd_panel_hvga) { /* changge the frequency high */ pinfo->clk_rate = 9660 * 1000; /*for HVGA pixel clk*/ } else { pinfo->clk_rate = 8192000; /*for HVGA pixel clk*/ } pinfo->lcdc.h_back_porch = 20; pinfo->lcdc.h_front_porch = 40; pinfo->lcdc.h_pulse_width = 10; pinfo->lcdc.v_back_porch = 8; pinfo->lcdc.v_front_porch = 15; pinfo->lcdc.v_pulse_width = 2; pinfo->lcdc.border_clr = 0; /* blk */ pinfo->lcdc.underflow_clr = 0xff; /* blue */ pinfo->lcdc.hsync_skew = 0; ret = platform_device_register(&this_device); if (ret) platform_driver_unregister(&this_driver); return ret; }
static void truly_r61529_hvga_disp_on(void) { if (truly_r61529_hvga_state.disp_powered_up && !truly_r61529_hvga_state.display_on) { LCD_DEBUG("%s: disp on lcd\n", __func__); /* Initialize LCD */ truly_r61529_hvga_state.display_on = TRUE; } return; }
static int __init nt35410_hvga_panel_init(void) { int ret; struct msm_panel_info *pinfo; lcd_panel_hvga = lcd_panel_probe(); if((LCD_NT35410_CHIMEI_HVGA != lcd_panel_hvga) && \ (msm_fb_detect_client(lCD_DRIVER_NAME)) ) { return 0; } LCD_DEBUG(" lcd_type=%s, lcd_panel_hvga = %d\n", lCD_DRIVER_NAME, lcd_panel_hvga); ret = platform_driver_register(&this_driver); if (ret) return ret; pinfo = &nt35410_hvga_panel_data.panel_info; pinfo->xres = 320; pinfo->yres = 480; pinfo->type = LCDC_PANEL; pinfo->pdest = DISPLAY_1; pinfo->wait_cycle = 0; pinfo->bpp = 18; pinfo->fb_num = 2; pinfo->bl_max = LCD_MAX_BACKLIGHT_LEVEL; pinfo->bl_min = LCD_MIN_BACKLIGHT_LEVEL; if(LCD_NT35410_CHIMEI_HVGA == lcd_panel_hvga) { pinfo->clk_rate = 9660 * 1000; /*for HVGA pixel clk*/ } else { pinfo->clk_rate = 8192000; /*for HVGA pixel clk*/ } pinfo->lcdc.h_back_porch = 18; pinfo->lcdc.h_front_porch = 30; pinfo->lcdc.h_pulse_width = 4; pinfo->lcdc.v_back_porch = 3; pinfo->lcdc.v_front_porch = 55; pinfo->lcdc.v_pulse_width = 3; pinfo->lcdc.border_clr = 0; /* blk */ pinfo->lcdc.underflow_clr = 0xff; /* blue */ pinfo->lcdc.hsync_skew = 0; ret = platform_device_register(&this_device); if (ret) platform_driver_unregister(&this_driver); return ret; }
/*setting for support continuous splash */ static int mipi_nt35512_lcd_on(struct platform_device *pdev) { boolean para_debug_flag = FALSE; uint32 para_num = 0; struct msm_fb_data_type *mfd; mfd = platform_get_drvdata(pdev); if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; para_debug_flag = lcd_debug_malloc_get_para( "nt35512_lcd_init_table_debug", (void**)&nt35512_lcd_init_table_debug,¶_num); lcd_reset(); mipi_set_tx_power_mode(1);//Low power mode if( (TRUE == para_debug_flag) && (NULL != nt35512_lcd_init_table_debug)) { process_mipi_table(mfd,&nt35512_tx_buf,nt35512_lcd_init_table_debug, para_num, lcd_panel_wvga); } else { /*Add nt35512 video mode for byd*/ if (MIPI_VIDEO_NT35512_BOE_WVGA == lcd_panel_wvga ){ process_mipi_table(mfd,&nt35512_tx_buf,(struct sequence*)&nt35512_boe_lcd_init_table, ARRAY_SIZE(nt35512_boe_lcd_init_table), lcd_panel_wvga); } else if ( MIPI_VIDEO_NT35512_BYD_WVGA == lcd_panel_wvga ){ process_mipi_table(mfd,&nt35512_tx_buf,(struct sequence*)&nt35512_byd_lcd_init_table, ARRAY_SIZE(nt35512_byd_lcd_init_table), lcd_panel_wvga); } } mipi_set_tx_power_mode(0); //High speed mode if((TRUE == para_debug_flag)&&(NULL != nt35512_lcd_init_table_debug)) { lcd_debug_free_para((void *)nt35512_lcd_init_table_debug); } if (!mfd->cont_splash_done) { mfd->cont_splash_done = 1; nt35512_cabc_enable_table[1].reg = 0x00064; process_mipi_table(mfd,&nt35512_tx_buf,(struct sequence*)&nt35512_cabc_enable_table, ARRAY_SIZE(nt35512_cabc_enable_table), lcd_panel_wvga); } LCD_DEBUG("leave mipi_nt35512_lcd_on \n"); return 0; }
static void hx8357a_disp_on(void) { if (hx8357a_state.disp_powered_up && !hx8357a_state.display_on) { LCD_DEBUG("%s: disp on lcd\n", __func__); /* Initialize LCD */ //process_lcdc_table((struct command*)&hx8357a_init_table, ARRAY_SIZE(hx8357a_init_table)); //seriout_transfer_byte(0x22, DEVICE_ID | WRITE_REGISTER); hx8357a_state.display_on = TRUE; } }
static int hx8357a_panel_off(struct platform_device *pdev) { if (hx8357a_state.disp_powered_up && hx8357a_state.display_on) { /* Enter Standby Mode */ process_lcdc_table((struct command*)&hx8357a_standby_enter_table, ARRAY_SIZE(hx8357a_standby_enter_table)); hx8357a_state.display_on = FALSE; LCD_DEBUG("%s: Enter Standby Mode\n", __func__); } return 0; }
bool If_append_done(const uint _debug,SP_RX_CACHE* cache) { bool ready = If_cache_ready(cache); if (ready) { LCD_DEBUG(_debug,"+++ <%d> [%s]", sp_rx_queue.first, cache->buff); sp_rx_queue.first ++; sp_rx_queue.first %= SP_QUEUE_SIZE; sp_rx_queue.dirty = true; } return ready; }
static void lcm_resume_tm(void) { push_table(lcm_initialization_setting_tm, sizeof(lcm_initialization_setting_tm) / sizeof(struct LCM_setting_table), 1); //Back to MP.P7 baseline , solve LCD display abnormal On the right //when sleep out, config output high ,enable backlight drv chip LCD_DEBUG("uboot:tm_nt35521_lcm_resume\n"); }
static int hx8357a_panel_on(struct platform_device *pdev) { if (!hx8357a_state.disp_initialized) { hx8357a_reset(); lcd_spi_init(lcdc_hx8357a_pdata); /* LCD needs SPI */ hx8357a_disp_powerup(); hx8357a_disp_on(); hx8357a_state.disp_initialized = TRUE; LCD_DEBUG("%s: hx8357a lcd initialized\n", __func__); } else if (!hx8357a_state.display_on) { /* Exit Standby Mode */ process_lcdc_table((struct command*)&hx8357a_standby_exit_table, ARRAY_SIZE(hx8357a_standby_exit_table)); LCD_DEBUG("%s: Exit Standby Mode\n", __func__); hx8357a_state.display_on = TRUE; } return 0; }
/*Interface for dynamic gamma*/ int mipi_nt35516_set_dynamic_gamma(enum danymic_gamma_mode gamma_mode,struct msm_fb_data_type *mfd) { int ret = 0; switch(gamma_mode) { case GAMMA25: process_mipi_table(mfd,&nt35516_tx_buf,(struct sequence*)&tianma_nt35516_gamma_25, ARRAY_SIZE(tianma_nt35516_gamma_25), lcd_panel_qhd); break ; case GAMMA22: process_mipi_table(mfd,&nt35516_tx_buf,(struct sequence*)&tianma_nt35516_gamma_22, ARRAY_SIZE(tianma_nt35516_gamma_22), lcd_panel_qhd); break; default: LCD_DEBUG("%s: invalid dynamic_gamma: %d\n", __func__,gamma_mode); ret = -EINVAL; break; } LCD_DEBUG("%s: change gamma mode to %d\n",__func__,gamma_mode); return ret; }
/****************************************************************************** Function: which_lcd_module_Tmp Description: get lcd module value , used for G610-T11 V1 board, only ID0 PIN Input: none Output: none Return: lcd module value Others: none ******************************************************************************/ unsigned char which_lcd_module_Tmp() { unsigned char lcd_id0; /*use to judge return value*/ unsigned int ret = 0; //only recognise once if(0xFF != lcd_id_pins_value) { return lcd_id_pins_value; } /*because of gpio no initialization,do it by hand*/ /*checked return value of function for coverity*/ ret = mt_set_gpio_mode(GPIO_DISP_ID0_PIN, GPIO_MODE_00); if(0 != ret) { LCD_DEBUG("ID0 mt_set_gpio_mode fail\n"); } ret = mt_set_gpio_dir(GPIO_DISP_ID0_PIN, GPIO_DIR_IN); if(0 != ret) { LCD_DEBUG("ID0 mt_set_gpio_dir fail\n"); } ret = mt_set_gpio_pull_enable(GPIO_DISP_ID0_PIN, GPIO_PULL_ENABLE); if(0 != ret) { LCD_DEBUG("ID0 mt_set_gpio_pull_enable fail\n"); } lcd_id0 = mt_get_gpio_in(GPIO_DISP_ID0_PIN); #ifdef BUILD_LK printf("which_lcd_module,lcd_id0:%d\n",lcd_id0); #else printk("which_lcd_module,lcd_id0:%d\n",lcd_id0); #endif lcd_id_pins_value = lcd_id0; return lcd_id0; }