void acl_data(struct msm_fb_data_type *mfd, int data) { mutex_lock(&mfd->dma->ov_mutex); mdp4_dsi_cmd_dma_busy_wait(mfd); mdp4_dsi_blt_dmap_busy_wait(mfd); mipi_dsi_mdp_busy_wait(mfd); mipi_set_tx_power_mode(0); switch(data){ case 10 : mipi_dsi_cmds_tx(mfd, &oscar_tx_buf, oscar_acl_control10, ARRAY_SIZE(oscar_acl_control10)); oscar_state.acl_data=data; break; case 30 : mipi_dsi_cmds_tx(mfd, &oscar_tx_buf, oscar_acl_control30, ARRAY_SIZE(oscar_acl_control30)); oscar_state.acl_data=data; break; case 50 :mipi_dsi_cmds_tx(mfd, &oscar_tx_buf, oscar_acl_control50, ARRAY_SIZE(oscar_acl_control50)); oscar_state.acl_data=data; break; } mipi_set_tx_power_mode(1); mutex_unlock(&mfd->dma->ov_mutex); printk(KERN_WARNING"mipi_oscar_lcd_acl_data = %d\n",data); }
static void himax_self_refresh_switch(int on) { PR_DISP_INFO("%s %d \n", __func__, on); if (on) { mutex_lock(&cmdlock); mipi_set_tx_power_mode(0); mipi_dsi_cmds_tx(&himax_tx_buf, video_to_cmd, ARRAY_SIZE(video_to_cmd)); mipi_set_tx_power_mode(1); disable_video_mode_clk(); mutex_unlock(&cmdlock); } else { mutex_lock(&cmdlock); mipi_set_tx_power_mode(0); enable_irq(vsync_irq); mipi_dsi_cmds_tx(&himax_tx_buf, cmd_to_video, ARRAY_SIZE(cmd_to_video)); wait_vsync = 1; wait_event_timeout(himax_vsync_wait, himax_vsync_gpio || gpio_get_value(28), HZ/2); disable_irq(vsync_irq); wait_vsync = 0; himax_vsync_gpio = 0; udelay(100); mipi_dsi_cmds_tx(&himax_tx_buf, vsync_hsync_cmds, ARRAY_SIZE(vsync_hsync_cmds)); mutex_unlock(&cmdlock); enable_video_mode_clk(); } }
static void mipi_sony_set_backlight(struct msm_fb_data_type *mfd) { struct dcs_cmd_req cmdreq; static int prev_bl_level = 0; if (prev_bl_level == mfd->bl_level) return; mutex_lock(&sony_mutex); prev_bl_level = mfd->bl_level; memset(&cmdreq, 0, sizeof(cmdreq)); #ifdef CONFIG_SONY_CMD_720P_CABC mipi_set_tx_power_mode(0); backlight_pwm[1] = mfd->bl_level;//mipi_sony_backlight_tbl[mfd->bl_level]; cmdreq.cmds = &backlight_cmd; cmdreq.cmds_cnt =1; cmdreq.flags = CMD_REQ_COMMIT; cmdreq.rlen = 0; cmdreq.cb = NULL; mipi_dsi_cmdlist_put(&cmdreq); mipi_set_tx_power_mode(1); #endif mutex_unlock(&sony_mutex); pr_debug("%s : %d\n",__func__,mfd->bl_level); }
void mipi_cabc_lcd_bl_init(int bl_level) { #ifdef CONFIG_FB_PANTECH_MIPI_SONY_CMD_HD_PANEL struct dcs_cmd_req cmdreq; #endif //printk(KERN_ERR"[SKY_LCD]mipi_cabc_lcd_bl_init\n"); //dump_stack(); if (bl_level >= 1 && bl_level <= 16) { wrdisbv[1] = mipi_sony_backlight_tbl[bl_level]; #ifdef CONFIG_FB_PANTECH_MIPI_SONY_CMD_HD_PANEL mutex_lock(&sony_state.lcd_mutex); mipi_set_tx_power_mode(0); cmdreq.cmds = sony_display_cabc_bl_set_cmds; cmdreq.cmds_cnt = ARRAY_SIZE(sony_display_cabc_bl_set_cmds); cmdreq.flags = CMD_REQ_COMMIT; cmdreq.rlen = 0; cmdreq.cb = NULL; mipi_dsi_cmdlist_put(&cmdreq); mipi_set_tx_power_mode(1); mutex_unlock(&sony_state.lcd_mutex); #endif gpio_set_value_cansleep(gpio_lcd_bl_ctl, GPIO_HIGH_VALUE); gpio_set_value_cansleep(gpio_lcd_bl_en, GPIO_HIGH_VALUE); } #ifdef BOOT_TOUCH_RESET // shkwak 20111112, ##1199 reset need touch reset. if(touch_init == true) touch_init = false; #endif }
static int is_bl_supported(struct msm_fb_data_type *mfd) { static int is_bl_supported = -1; int ret; u8 rdata; if (is_bl_supported == -1) { if (!is_evt0_sample(mfd)) is_bl_supported = 1; else { /* To determine if BL is supported, need to read MTP to see if it is programmed. Per spec, must be done in LP mode */ mipi_set_tx_power_mode(1); mipi_mot_tx_cmds(&set_mtp_read_off[0], ARRAY_SIZE(set_mtp_read_off)); ret = mipi_mot_rx_cmd(&mtp_read_cmd, &rdata, 1); mipi_set_tx_power_mode(0); if (ret < 0) pr_err("%s: failed to determine if MTP is programmed, ret = %d", __func__, ret); else { pr_info("%s: Panel MTP data = 0x%02x\n", __func__, rdata); is_bl_supported = (!rdata) ? 0 : 1; } } } return ((is_bl_supported == 1) ? 1 : 0); }
void cabc_control(struct msm_fb_data_type *mfd, int state) { #ifndef SKY_LCD_SINGLE_WIRE_LB_CON printk(KERN_INFO"[LCD] %s() state:%d\n", __func__, state); /* NOTE that cabc_ctrl_con[] is included in renesas_1Column[] and another(resesas_xxx). Search cabc_ctrl_con[] in this file. */ if(state == true) cabc_ctrl_con[1] = 0; // CABC OFF else cabc_ctrl_con[1] = 3; // CABC movie mode if(renesas_state.disp_initialized == true) { mutex_lock(&renesas_state.lcd_mutex); mipi_set_tx_power_mode(0); mipi_dsi_cmds_tx(&renesas_tx_buf, renesas_cabc_ctrl_con_cmds, ARRAY_SIZE(renesas_cabc_ctrl_con_cmds)); mipi_set_tx_power_mode(1); mutex_unlock(&renesas_state.lcd_mutex); } #else printk(KERN_INFO"[LCD] %s(), do nothing\n", __func__); #endif }
void acl_contol(struct msm_fb_data_type *mfd, int state) { mutex_lock(&mfd->dma->ov_mutex); mdp4_dsi_cmd_dma_busy_wait(mfd); mdp4_dsi_blt_dmap_busy_wait(mfd); mipi_dsi_mdp_busy_wait(mfd); mipi_set_tx_power_mode(0); if(state == true){ mipi_dsi_cmds_tx(mfd, &oscar_tx_buf, oscar_acl_on, ARRAY_SIZE(oscar_acl_on)); oscar_state.acl_flag = true; } else{ mipi_dsi_cmds_tx(mfd, &oscar_tx_buf, oscar_acl_off, ARRAY_SIZE(oscar_acl_off)); oscar_state.acl_flag = false; } mipi_set_tx_power_mode(1); mutex_unlock(&mfd->dma->ov_mutex); printk(KERN_WARNING"mipi_oscar_lcd_ACL = %d\n",state); }
static int mipi_renesas_lcd_off(struct platform_device *pdev) { struct msm_fb_data_type *mfd; ENTER_FUNC2(); mfd = platform_get_drvdata(pdev); if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; if (renesas_state.disp_on == true) { mutex_lock(&renesas_state.lcd_mutex); mipi_set_tx_power_mode(0); mipi_dsi_cmds_tx(&renesas_tx_buf, renesas_display_off_cmds, ARRAY_SIZE(renesas_display_off_cmds)); renesas_state.disp_on = false; renesas_state.disp_initialized = false; mipi_set_tx_power_mode(1); mutex_unlock(&renesas_state.lcd_mutex); #ifdef CONFIG_F_SKYDISP_SILENT_BOOT sky_sys_rst_set_silent_boot_backlight(0); is_silent_boot_mode_n_bl_off = 0; #endif } EXIT_FUNC2(); return 0; }
void pantech_mipi_lcd_shutdown(void) { struct msm_fb_data_type *mfd; struct fb_info *info; //ENTER_FUNC2(); info = registered_fb[0]; mfd = (struct msm_fb_data_type *)info->par; { mutex_lock(&renesas_state.lcd_mutex); mipi_set_tx_power_mode(0); mipi_dsi_cmds_tx(&renesas_tx_buf, renesas_display_off_cmds, ARRAY_SIZE(renesas_display_off_cmds)); renesas_state.disp_on = false; renesas_state.disp_initialized = false; mipi_set_tx_power_mode(1); mutex_unlock(&renesas_state.lcd_mutex); mipi_renesas_panel_power_shutdown(); } //EXIT_FUNC2(); }
/*lcd resume function*/ static int mipi_nt35560_lcd_on(struct platform_device *pdev) { struct msm_fb_data_type *mfd; mfd = platform_get_drvdata(pdev); if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; mipi_set_tx_power_mode(1); /* < lishubin update baseline change this begin */ mipi_dsi_cmds_tx( &nt35560_tx_buf, nt35560_sleep_out_cmds, ARRAY_SIZE(nt35560_sleep_out_cmds)); mipi_dsi_cmds_tx( &nt35560_tx_buf, nt35560_lcd_init_cmds, ARRAY_SIZE(nt35560_lcd_init_cmds)); mipi_dsi_cmds_tx( &nt35560_tx_buf, nt35560_lcd_cabc_cmds, ARRAY_SIZE(nt35560_lcd_cabc_cmds)); mipi_dsi_cmds_tx( &nt35560_tx_buf, nt35560_display_on_cmds, ARRAY_SIZE(nt35560_display_on_cmds)); /* lishubin update baseline change this end > */ mipi_set_tx_power_mode(0); pr_info("leave mipi_nt35560_lcd_on \n"); return 0; }
void mipi_sharp_set_backlight(struct msm_fb_data_type *mfd) { /*value range is 1--32*/ int current_lel = mfd->bl_level; uint16 level_to_map=0; //unsigned long flags; printk("zhangqi add for CABC level=%d in %s func \n ",current_lel,__func__); if(current_lel==0) { index_51[1]=0x00; index_51[2]=0x00; } else { //zhangqi add for sharp lcd begin level_to_map=current_lel*(4096/15); index_51[1]=(level_to_map & 0xff00)>>8; index_51[2]=level_to_map & 0x00ff; //zhangqi add for sharp lcd end } printk("zhangqi add r63311 backlightcabc index_51=%x %x \n",index_51[1],index_51[2]); mipi_set_tx_power_mode(0); mipi_dsi_cmds_tx(&sharp_tx_buf, cabc_cmds,ARRAY_SIZE(cabc_cmds)); mipi_set_tx_power_mode(1); return; }
void mtp_work_fnc(struct work_struct *work) { mipi_set_tx_power_mode(0); mtp_read(); mipi_set_tx_power_mode(1); }
void mipi_oscar_sec_lcd_on(struct msm_fb_data_type *mfd) { mipi_set_tx_power_mode(0); mipi_dsi_cmds_tx(mfd, &oscar_tx_buf, oscar_sleep_out, ARRAY_SIZE(oscar_sleep_out)); mipi_set_tx_power_mode(1); }
static int mipi_lcd_on(struct platform_device *pdev) { struct msm_fb_data_type *mfd = platform_get_drvdata(pdev); printk("gequn mipi_lcd_on\n"); if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; if(first_time_panel_on){ first_time_panel_on = 0; return 0; if(LcdPanleID != (u32)LCD_PANEL_NOPANEL) return 0; else LcdPanleID = mipi_get_icpanleid(mfd); } LcdPanleID = (u32)LCD_PANEL_3P95_HX8357_BOE_BOE; lcd_panle_reset(); printk("mipi init start\n"); mipi_set_tx_power_mode(1); switch(LcdPanleID){ case (u32)LCD_PANEL_3P95_HX8357_BOE_BOE: mipi_dsi_cmds_tx(mfd, &lead_tx_buf, hx8357c_trulylg_display_on_cmds,ARRAY_SIZE(hx8357c_trulylg_display_on_cmds)); printk("trulylg init ok !!\n"); break; case (u32)LCD_PANEL_3P95_HX8357_IVO_YUSHUN: mipi_dsi_cmds_tx(mfd, &lead_tx_buf, hx8357c_yushun_display_on_cmds,ARRAY_SIZE(hx8357c_yushun_display_on_cmds)); printk("yushun init ok !!\n"); break; case (u32)LCD_PANEL_3P95_HX8357_HANSTAR_LEAD: mipi_dsi_cmds_tx(mfd, &lead_tx_buf, hx8357c_lead_display_on_cmds,ARRAY_SIZE(hx8357c_lead_display_on_cmds)); printk("lead init ok !!\n"); break; case (u32)LCD_PANEL_3P95_HX8357_TIANMA_TIANMA: mipi_dsi_cmds_tx(mfd, &lead_tx_buf, hx8357c_tianma_display_on_cmds,ARRAY_SIZE(hx8357c_tianma_display_on_cmds)); printk("tianma init ok !!\n"); break; default: mipi_dsi_cmds_tx(mfd, &lead_tx_buf, hx8357c_trulylg_display_on_cmds,ARRAY_SIZE(hx8357c_trulylg_display_on_cmds)); printk("BOE_hx8357C init ok !!\n"); //printk("can't get icpanelid value\n"); break; } mipi_set_tx_power_mode(0); return 0; }
/*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; }
void disp_ext_refresh_seq( struct msm_fb_data_type *mfd, unsigned int cmd ) { struct msm_fb_data_type *mipi_novatek_wxga_mfd; DISP_LOCAL_LOG_EMERG("DISP disp_ext_refresh_seq S\n"); #ifndef CONFIG_FB_MSM_MIPI_DSI_RENESAS_CM mipi_novatek_wxga_mfd = mipi_novatek_wxga_get_mfd(); #else mipi_novatek_wxga_mfd = mipi_renesas_cm_get_mfd(); #endif if( mipi_novatek_wxga_mfd == NULL ) { pr_debug("%s:bot found device\n", __func__); return; } if( disp_ext_reflesh_get_start() != 1 ) { DISP_LOCAL_LOG_EMERG("%s:refresh not start\n", __func__); return; } #ifndef CONFIG_FB_MSM_MIPI_DSI_RENESAS_CM mdp4_dsi_cmd_dma_busy_wait(mipi_novatek_wxga_mfd); mdp4_dsi_blt_dmap_busy_wait(mipi_novatek_wxga_mfd); mipi_dsi_mdp_busy_wait(mipi_novatek_wxga_mfd); #else mdp4_dsi_cmd_busy(); mipi_dsi_mdp_busy_wait(); #endif if( cmd == MIPI_REFREH_SEQ_ALL ) { mdp4_dsi_clock_mod(); disp_ext_refresh_te_monitor_timer_release(); disp_ext_reflesh_set_start(0); #ifndef CONFIG_FB_MSM_MIPI_DSI_RENESAS_CM mipi_set_tx_power_mode(1); mipi_novatek_wxga_initial_sequence( mipi_novatek_wxga_mfd ); mipi_set_tx_power_mode(0); mipi_novatek_wxga_display_direction_sequence( mipi_novatek_wxga_mfd ); mdp4_dsi_refresh_screen_at_once( mfd ); mipi_novatek_wxga_display_on_sequence( mipi_novatek_wxga_mfd ); #else mipi_renesas_cm_refresh_exec( mipi_novatek_wxga_mfd ); #endif disp_ext_reflesh_set_sw(0); disp_ext_reflesh_set_start(1); disp_ext_reflesh_before_te_run_count_init(); disp_ext_refresh_te_monitor_timer_set(); } DISP_LOCAL_LOG_EMERG("DISP disp_ext_refresh_seq E\n"); }
static int mipi_get_manufacture_icid(struct msm_fb_data_type *mfd) { uint32 icid = 0; int i ; struct mipi_manufacture_ic mipi_manufacture_icid[3] = { {hx8363_setpassword_cmd,ARRAY_SIZE(hx8363_setpassword_cmd),&hx8363_icid_rd_cmd,3,1}, {nt3511_setpassword_cmd,ARRAY_SIZE(nt3511_setpassword_cmd),&nt3511_icid_rd_cmd,3,0}, {hx8369_setpassword_cmd,ARRAY_SIZE(hx8369_setpassword_cmd),&hx8369_icid_rd_cmd,3,1}, }; for(i = 0; i < ARRAY_SIZE(mipi_manufacture_icid) ; i++) { lcd_panle_reset(); mipi_dsi_buf_init(&lead_tx_buf); mipi_dsi_buf_init(&lead_rx_buf); mipi_set_tx_power_mode(1); mipi_dsi_cmds_tx(mfd, &lead_tx_buf, mipi_manufacture_icid[i].readid_tx,mipi_manufacture_icid[i].readid_len_tx); mipi_dsi_cmd_bta_sw_trigger(); if(!mipi_manufacture_icid[i].mode) mipi_set_tx_power_mode(0); mipi_dsi_cmds_rx(mfd,&lead_tx_buf, &lead_rx_buf, mipi_manufacture_icid[i].readid_rx,mipi_manufacture_icid[i].readid_len_rx); if(mipi_manufacture_icid[i].mode) mipi_set_tx_power_mode(0); icid = *(uint32 *)(lead_rx_buf.data); printk("debug read icid is %x\n",icid & 0xffffff); switch(icid & 0xffffff){ case 0x1055: return NOVATEK_35510; case 0x6383ff: return HIMAX_8363; case 0x6983ff: return HIMAX_8369; default: break; } } return 0; }
static int mipi_r63306_disp_off(struct msm_fb_data_type *mfd) { int ret = 0; struct mipi_dsi_data *dsi_data; dsi_data = platform_get_drvdata(mfd->panel_pdev); if (!dsi_data || !dsi_data->lcd_power) return -ENODEV; if (!dsi_data->panel_detecting) { mipi_dsi_op_mode_config(DSI_CMD_MODE); mipi_dsi_buf_init(&dsi_data->tx_buf); mipi_dsi_cmds_tx(&dsi_data->tx_buf, dsi_data->panel->pctrl->display_off_cmds, dsi_data->panel->pctrl->display_off_cmds_size); #ifdef CONFIG_FB_MSM_RECOVER_PANEL mipi_set_tx_power_mode(1); #endif ret = dsi_data->lcd_power(FALSE); } else { dsi_data->panel_detecting = false; ret = 0; } return ret; }
static ssize_t mDNIeScenario_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size) { unsigned int value; strict_strtoul(buf, 0, (unsigned long *)&value); DPRINT("%s:value=%d\n", __func__, value); switch(value) { case UI_MODE: case VIDEO_MODE: case VIDEO_WARM_MODE: case VIDEO_COLD_MODE: case CAMERA_MODE: case GALLERY_MODE: break; default: value = UI_MODE; break; }; mDNIe_cfg.scenario = value; mipi_set_tx_power_mode(0); // High Speed Power set_mDNIe_Mode(&mDNIe_cfg); return size; }
static ssize_t show_nvm(struct device *dev, struct device_attribute *attr, char *buf) { struct platform_device *pdev; struct mipi_dsi_data *dsi_data; struct msm_fb_data_type *mfd; int rc; pdev = container_of(dev, struct platform_device, dev); mfd = platform_get_drvdata(pdev); dsi_data = platform_get_drvdata(mfd->panel_pdev); if (dsi_data->nvrw_ic_vendor != NVRW_DRV_RENESAS || !dsi_data->nvrw_panel_detective) return 0; rc = prepare_for_reg_access(mfd); if (rc) return 0; mipi_set_tx_power_mode(1); rc = 0; if (dsi_data->panel->pnvrw_ctl && dsi_data->seq_nvm_read) rc = dsi_data->seq_nvm_read(mfd, buf); post_reg_access(mfd); return rc; };
static void panel_set_backlight(struct msm_fb_data_type *mfd) { static int bl_level_old = -1; int idx = 0; pr_debug("%s +(%d)\n", __func__, (s32)mfd->bl_level); bl_set = 1; if (!mfd->panel_power_on) return; if (bl_level_old == mfd->bl_level) return; if (is_bl_supported(mfd) != 1) return; idx = mfd->bl_level; if (mfd->bl_level < MIN_BRIGHTNESS_LEVEL) idx = MIN_BRIGHTNESS_LEVEL; if (mfd->bl_level > MAX_BRIGHTNESS_LEVEL) idx = MAX_BRIGHTNESS_LEVEL; brightness_ctrl[1] = idx; mutex_lock(&mfd->dma->ov_mutex); mipi_set_tx_power_mode(0); mipi_mot_exec_cmd_seq(mfd, set_brightness_seq, ARRAY_SIZE(set_brightness_seq)); bl_level_old = mfd->bl_level; mutex_unlock(&mfd->dma->ov_mutex); pr_debug("%s -(%d)\n", __func__, idx); return; }
int mipi_lgit_lcd_off(struct platform_device *pdev) { struct msm_fb_data_type *mfd; mfd = platform_get_drvdata(pdev); if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; #if defined(CONFIG_FB_MSM_MIPI_LGIT_LH470WX1_VIDEO_HD_PT) /*LG display 4.7" HD for FX1 */ mipi_dsi_cmds_tx(&lgit_tx_buf, lgit_power_off_set1, ARRAY_SIZE(lgit_power_off_set1)); gpio_set_value(GPIO_LCD_DSV_EN,0); mdelay(10); mipi_dsi_cmds_tx(&lgit_tx_buf, lgit_power_off_set2, ARRAY_SIZE(lgit_power_off_set2)); mipi_set_tx_power_mode(1); #elif defined(CONFIG_FB_MSM_MIPI_LGIT_VIDEO_HD_PT) printk(KERN_INFO "%s: mipi lgit lcd off started \n", __func__); mipi_dsi_cmds_tx(&lgit_tx_buf, lgit_power_off_set, ARRAY_SIZE(lgit_power_off_set)); #else mipi_dsi_cmds_tx(&lgit_tx_buf, mipi_lgit_pdata->power_off_set, mipi_lgit_pdata->power_off_set_size); #endif return 0; }
/*setting for support continuous splash */ static int mipi_hx8369b_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( "hx8369b_lcd_init_table_debug", (void**)&hx8369b_lcd_init_table_debug,¶_num); lcd_reset(); mipi_set_tx_power_mode(1);//Low power mode if( (TRUE == para_debug_flag) && (NULL != hx8369b_lcd_init_table_debug)) { process_mipi_table(mfd,&hx8369b_tx_buf,hx8369b_lcd_init_table_debug, para_num, lcd_panel_wvga); } else { process_mipi_table(mfd,&hx8369b_tx_buf,(struct sequence*)&hx8369b_tianma_lcd_init_table, ARRAY_SIZE(hx8369b_tianma_lcd_init_table), lcd_panel_wvga); } mipi_set_tx_power_mode(0);//High speed mode if((TRUE == para_debug_flag)&&(NULL != hx8369b_lcd_init_table_debug)) { lcd_debug_free_para((void *)hx8369b_lcd_init_table_debug); } if (!mfd->cont_splash_done) { mfd->cont_splash_done = 1; hx8369b_wvga_write_cabc_brightness_table[1].reg = 0x00064; process_mipi_table(mfd,&hx8369b_tx_buf,(struct sequence*)&hx8369b_wvga_write_cabc_brightness_table, ARRAY_SIZE(hx8369b_wvga_write_cabc_brightness_table), lcd_panel_wvga); } LCD_DEBUG("leave mipi_otm8018b_lcd_on \n"); return 0; }
static uint32 mipi_get_commic_panleid(struct msm_fb_data_type *mfd,struct dsi_cmd_desc *para,uint32 len,int mode) { uint32 panelid = 0; mipi_dsi_buf_init(&lead_tx_buf); mipi_dsi_buf_init(&lead_rx_buf); mipi_dsi_cmd_bta_sw_trigger(); if(mode) mipi_set_tx_power_mode(1); else mipi_set_tx_power_mode(0); mipi_dsi_cmds_rx(mfd,&lead_tx_buf, &lead_rx_buf, para,len); if(mode) mipi_set_tx_power_mode(0); panelid = *(uint32 *)(lead_rx_buf.data); printk("debug read panelid is %x\n",panelid & 0xffffffff); return panelid & 0xff; }
static void himax_self_refresh_switch(int on) { int vsync_timeout; mutex_lock(&cmdlock); wake_lock(&himax_idle_wake_lock); #ifdef CONFIG_PERFLOCK if (!is_perf_lock_active(&himax_perf_lock)) perf_lock(&himax_perf_lock); #endif if (on) { mipi_set_tx_power_mode(0); mipi_dsi_cmds_tx(&himax_tx_buf, video_to_cmd, ARRAY_SIZE(video_to_cmd)); mipi_set_tx_power_mode(1); disable_video_mode_clk(); } else { mipi_set_tx_power_mode(0); enable_irq(vsync_irq); mipi_dsi_cmds_tx(&himax_tx_buf, cmd_to_video, ARRAY_SIZE(cmd_to_video)); wait_vsync = 1; udelay(300); vsync_timeout = wait_event_timeout(himax_vsync_wait, himax_vsync_gpio || gpio_get_value(28), HZ/2); if (vsync_timeout == 0) PR_DISP_DEBUG("Lost vsync!\n"); disable_irq(vsync_irq); wait_vsync = 0; himax_vsync_gpio = 0; udelay(300); mipi_dsi_cmds_tx(&himax_tx_buf, vsync_hsync_cmds, ARRAY_SIZE(vsync_hsync_cmds)); enable_video_mode_clk(); if (vsync_timeout == 0) mipi_himax_panel_recover(); } #ifdef CONFIG_PERFLOCK if (is_perf_lock_active(&himax_perf_lock)) perf_unlock(&himax_perf_lock); #endif wake_unlock(&himax_idle_wake_lock); PR_DISP_DEBUG("[SR] %d\n", on); mutex_unlock(&cmdlock); }
void cabc_control(struct msm_fb_data_type *mfd, int state) { #ifdef CONFIG_FB_PANTECH_MIPI_SONY_CMD_HD_PANEL // kkcho, 20121213, Only Command_MODE applied struct dcs_cmd_req cmdreq; printk(KERN_INFO"[LCD] %s() state:%d\n", __func__, state); if(state == true) wrcbc_on[1] = 0; // CABC OFF else wrcbc_on[1] = 3; // 00 off 01 ui 02 still 03 movie if(sony_state.disp_initialized) { mutex_lock(&sony_state.lcd_mutex); mipi_set_tx_power_mode(0); cmdreq.cmds = sony_display_cabc_on_cmds; cmdreq.cmds_cnt = ARRAY_SIZE(sony_display_cabc_on_cmds); cmdreq.flags = CMD_REQ_COMMIT; cmdreq.rlen = 0; cmdreq.cb = NULL; mipi_dsi_cmdlist_put(&cmdreq); mipi_set_tx_power_mode(1); mutex_unlock(&sony_state.lcd_mutex); if (!is_silent_boot_mode_n_bl_off && !only_cabc_val_durnig_bootani) { mutex_lock(&sony_state.lcd_mutex); mipi_set_tx_power_mode(0); wrdisbv[1] = 0x40; // First backlight_value at boot-animation, must set : same lk_value! cmdreq.cmds = sony_display_cabc_bl_set_cmds; cmdreq.cmds_cnt = ARRAY_SIZE(sony_display_cabc_bl_set_cmds); cmdreq.flags = CMD_REQ_COMMIT; cmdreq.rlen = 0; cmdreq.cb = NULL; mipi_dsi_cmdlist_put(&cmdreq); mipi_set_tx_power_mode(1); mutex_unlock(&sony_state.lcd_mutex); only_cabc_val_durnig_bootani =1; } } #else printk(KERN_INFO"[LCD] %s+, do nothing\n", __func__); #endif }
static int mipi_r63306_nvm_erase_all(struct msm_fb_data_type *mfd) { struct device *dev = &mfd->panel_pdev->dev; struct mipi_dsi_data *dsi_data; struct dsi_nvm_rewrite_ctl *pnvrw_ctl; int ret = 0; int i; dev_dbg(dev, "%s: start\n", __func__); dsi_data = platform_get_drvdata(mfd->panel_pdev); if (!dsi_data && !dsi_data->panel && !dsi_data->panel->pnvrw_ctl) { ret = -1; goto exit; } pnvrw_ctl = dsi_data->panel->pnvrw_ctl; /* Enter sleep not in spec, but we come get here when panel is on */ mipi_dsi_cmds_tx(&dsi_data->tx_buf, pnvrw_ctl->nvm_enter_sleep, pnvrw_ctl->nvm_enter_sleep_size); mipi_dsi_cmds_tx(&dsi_data->tx_buf, pnvrw_ctl->nvm_mcap_unlock, pnvrw_ctl->nvm_mcap_unlock_size); mipi_set_tx_power_mode(0); for (i = 0; i < NVRW_RETRY; i++) { mipi_dsi_cmds_tx(&dsi_data->tx_buf, pnvrw_ctl->nvm_erase_all, pnvrw_ctl->nvm_erase_all_size); mipi_dsi_cmds_rx(mfd, &dsi_data->tx_buf, &dsi_data->rx_buf, pnvrw_ctl->nvm_read_e4, 1); if (dsi_data->rx_buf.data[0] == 0xBD) { dev_warn(dev, "%s: E4 failed (0x%02x), retry %d\n", __func__, dsi_data->rx_buf.data[0], i + 1); nvm_retry(dsi_data, pnvrw_ctl); continue; } mipi_dsi_cmds_tx(&dsi_data->tx_buf, pnvrw_ctl->nvm_erase_finish, pnvrw_ctl->nvm_erase_finish_size); mipi_dsi_cmds_rx(mfd, &dsi_data->tx_buf, &dsi_data->rx_buf, pnvrw_ctl->nvm_read_e1, 1); if (dsi_data->rx_buf.data[0] == 0x00) { dev_warn(dev, "%s: E1 failed (0x%02x), retry %d\n", __func__, dsi_data->rx_buf.data[0], i + 1); nvm_retry(dsi_data, pnvrw_ctl); continue; } break; } if (i >= NVRW_RETRY) { dev_err(&mfd->panel_pdev->dev, "%s: failed.\n", __func__); ret = -1; } end_nvm_command(dsi_data, pnvrw_ctl); exit: dev_dbg(dev, "%s: end, ret = %d\n", __func__, ret); return ret; }
static void enable_acl(struct msm_fb_data_type *mfd) { /* Write the value only if the display is enable and powerd on */ if ((mfd->op_enable != 0) && (mfd->panel_power_on != 0)) { mipi_set_tx_power_mode(0); mipi_mot_tx_cmds(&acl_enable_disable[0], ARRAY_SIZE(acl_enable_disable)); } }
static void mipi_orise_lcd_backlight(struct msm_fb_data_type *mfd) { printk(KERN_ALERT "[DISPLAY] Enter %s, set backlight level to %d\n", __func__, mfd->bl_level); /* FIH-SW2-MM-NC-LCM_INIT-01-[+ */ if (unlikely(!display_initialize)) return; write_display_brightness[1] = BKL_PWM[mfd->bl_level]; /* Duty_Cycle */ down(&mfd->dma->mutex); mipi_set_tx_power_mode(0); mipi_dsi_cmds_tx(&orise_tx_buf, orise_video_bkl_cmds, ARRAY_SIZE(orise_video_bkl_cmds)); mipi_set_tx_power_mode(1); up(&mfd->dma->mutex); /* FIH-SW2-MM-NC-LCM_INIT-01-]- */ }
static int mipi_samsung_disp_on(struct platform_device *pdev) { struct msm_fb_data_type *mfd; struct mipi_panel_info *mipi; static int first_boot_on; u32 tmp; mfd = platform_get_drvdata(pdev); if (unlikely(!mfd)) return -ENODEV; if (unlikely(mfd->key != MFD_KEY)) return -EINVAL; mipi = &mfd->panel_info.mipi; if (!first_boot_on) { execute_panel_init(mfd); first_boot_on = 1; } if (get_ldi_chip() == LDI_MAGNA) { mipi_set_tx_power_mode(LP_TX_MODE); mipi_samsung_disp_send_cmd(mfd, PANEL_READY_TO_ON, false); mipi_set_tx_power_mode(HS_TX_MODE); /* force dsi_clk alway on * Magan nees clk lane LP mode before sending 0xF0 & 0xFC & 0xD2 cmds */ tmp = MIPI_INP(MIPI_DSI_BASE + 0xA8); tmp |= (1<<28); MIPI_OUTP(MIPI_DSI_BASE + 0xA8, tmp); wmb(); } if (get_auto_brightness() >= 6) msd.mpd->first_bl_hbm_psre = 1; sec_debug_mdp_reset_value(); pr_info("[%s]\n", __func__); return 0; }