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(); }
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 }
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; }
static void ville_display_on(struct msm_fb_data_type *mfd) { if (panel_type == PANEL_ID_VILLE_AUO) { cmdreq.cmds = auo_display_on_cmds; cmdreq.cmds_cnt = ARRAY_SIZE(auo_display_on_cmds); } else { cmdreq.cmds = samsung_display_on_cmds; cmdreq.cmds_cnt = ARRAY_SIZE(samsung_display_on_cmds); } cmdreq.flags = CMD_REQ_COMMIT; if (mfd && mfd->panel_info.type == MIPI_CMD_PANEL) cmdreq.flags |= CMD_CLK_CTRL; cmdreq.rlen = 0; cmdreq.cb = NULL; mipi_dsi_cmdlist_put(&cmdreq); cur_bl_level = 0; if (acl_enable) { mipi_dsi_cmds_tx(&ville_panel_tx_buf, samsung_acl_on_cmd, ARRAY_SIZE(samsung_acl_on_cmd)); acl_enable = 1; PR_DISP_INFO("%s acl enable", __func__); } }
static void sending_tune_cmd(char *src, int len) { struct msm_fb_data_type *mfd = NULL; int data_pos; int cmd_step; int cmd_pos; cmd_step = 0; cmd_pos = 0; for (data_pos = 0; data_pos < len;) { if (*(src + data_pos) == '0') { if (*(src + data_pos + 1) == 'x') { if (!cmd_step) { mdni_tuning1[cmd_pos] = char_to_dec(*(src + data_pos + 2), *(src + data_pos + 3)); } else { mdni_tuning2[cmd_pos] = char_to_dec(*(src + data_pos + 2), *(src + data_pos + 3)); } data_pos += 3; cmd_pos++; if (cmd_pos == TUNE_FIRST_SIZE && !cmd_step) { cmd_pos = 0; cmd_step = 1; } } else data_pos++; } else { data_pos++; } } /* printk(KERN_INFO "\n"); for (data_pos = 0; data_pos < TUNE_FIRST_SIZE ; data_pos++) printk(KERN_INFO "0x%x ", mdni_tuning1[data_pos]); printk(KERN_INFO "\n"); for (data_pos = 0; data_pos < TUNE_SECOND_SIZE ; data_pos++) printk(KERN_INFO"0x%x ", mdni_tuning2[data_pos]); printk(KERN_INFO "\n"); */ mfd = platform_get_drvdata(msd.msm_pdev); if (unlikely(!mfd)) return; if (unlikely(mfd->key != MFD_KEY)) return; mutex_lock(&dsi_tx_mutex); mipi_dsi_mdp_busy_wait(); mipi_dsi_cmds_tx(&msd.samsung_tx_buf, mdni_tune_cmd, ARRAY_SIZE(mdni_tune_cmd)); mutex_unlock(&dsi_tx_mutex); }
static int mipi_hx8389b_lcd_on(struct platform_device *pdev) { struct msm_fb_data_type *mfd; struct mipi_panel_info *mipi; pr_debug("mipi_hx8389b_lcd_on E\n"); mfd = platform_get_drvdata(pdev); if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; mipi = &mfd->panel_info.mipi; if (!mfd->cont_splash_done) { mfd->cont_splash_done = 1; return 0; } if (mipi->mode == DSI_VIDEO_MODE) { mipi_dsi_cmds_tx(&hx8389b_tx_buf, hx8389b_video_display_on_cmds, ARRAY_SIZE(hx8389b_video_display_on_cmds)); } pr_debug("mipi_hx8389b_lcd_on X\n"); return 0; }
static int mipi_himax_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 (himax_state.disp_on == true) { gpio_set_value_cansleep(gpio43, GPIO_LOW_VALUE); usleep(10); gpio_set_value_cansleep(gpio43, GPIO_HIGH_VALUE); usleep(10); mipi_dsi_cmds_tx(mfd, &himax_tx_buf, himax_sleep_in_cmds, ARRAY_SIZE(himax_sleep_in_cmds)); himax_state.disp_on = false; himax_state.disp_initialized = false; EXIT_FUNC2(); } return 0; }
static int k2_lcd_on(struct platform_device *pdev) { struct msm_fb_data_type *mfd; struct mipi_panel_info *mipi; struct msm_panel_info *pinfo; mfd = platform_get_drvdata(pdev); if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; pinfo = &mfd->panel_info; mipi = &mfd->panel_info.mipi; if (mfd->init_mipi_lcd == 0) { PR_DISP_DEBUG("Display On - 1st time\n"); mfd->init_mipi_lcd = 1; return 0; } PR_DISP_INFO("Display On.\n"); mipi_dsi_cmds_tx(&k2_panel_tx_buf, init_on_cmds, init_on_cmds_count); atomic_set(&lcd_power_state, 1); PR_DISP_DEBUG("Init done!\n"); return 0; }
static int mipi_ili9486_hsd_djn375_lcd_off(struct platform_device *pdev) { struct msm_fb_data_type *mfd; pr_debug("mipi_ili9486_hsd_djn375_lcd_off Start\n"); mfd = platform_get_drvdata(pdev); if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; mipi_dsi_cmds_tx(mfd, &ili9486_hsd_djn375_tx_buf, ili9486_display_off_cmds, ARRAY_SIZE(ili9486_display_off_cmds)); #if 0 if (mipi_ili9486_hsd_djn375_lcd_reset() < 0) { pr_debug("mipi_ili9486_hsd_djn375_lcd_reset error\n"); return -EINVAL; } #endif gpio_set_value_cansleep(GPIO_AW551_LCD_RESET, 0); #ifdef CONFIG_LCT_AW550 pr_info("AW550 config LCM_ID"); gpio_tlmm_config(GPIO_CFG(35, 0, 0, 0, 0), 0);//LCM_ID #endif pr_debug("mipi_ili9486_hsd_djn375_lcd_off End\n"); return 0; }
static int mipi_hx8389b_lcd_off(struct platform_device *pdev) { struct msm_fb_data_type *mfd; struct mipi_panel_info *mipi; mfd = platform_get_drvdata(pdev); if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; mipi = &mfd->panel_info.mipi; printk(KERN_ERR "[LCD] mipi_hx8389b_lcd_off\n"); if (mipi->mode == DSI_VIDEO_MODE) { mutex_lock(&dsi_tx_mutex); mipi_dsi_cmds_tx(&hx8389b_tx_buf, hx8389b_video_display_off_cmds, ARRAY_SIZE(hx8389b_video_display_off_cmds)); mutex_unlock(&dsi_tx_mutex); } #if defined(CONFIG_BACKLIGHT_IC_KTD3102) pr_info("%s: DISP_BL_CONT_GPIO low-block\n", __func__); gpio_set_value(DISP_BL_CONT_GPIO, 0); lcd_brightness = -1; #endif gpio_set_value(7, 0); mdelay(1); gpio_set_value(69, 0); return 0; }
static void impression_j_set_backlight(struct msm_fb_data_type *mfd) { struct mipi_panel_info *mipi; mipi = &mfd->panel_info.mipi; #if 0 mutex_lock(&mfd->dma->ov_mutex); if (mdp4_overlay_dsi_state_get() <= ST_DSI_SUSPEND) { mutex_unlock(&mfd->dma->ov_mutex); return; } led_pwm1[1] = impression_j_shrink_pwm((unsigned char)(mfd->bl_level)); mipi_dsi_cmds_tx(&impression_j_panel_tx_buf, backlight_cmds, ARRAY_SIZE(backlight_cmds)); mutex_unlock(&mfd->dma->ov_mutex); #endif led_pwm1[1] = impression_j_shrink_pwm((unsigned char)(mfd->bl_level)); cmdreq.cmds = backlight_cmds; cmdreq.cmds_cnt = 1; cmdreq.flags = CMD_REQ_COMMIT; cmdreq.rlen = 0; cmdreq.cb = NULL; mipi_dsi_cmdlist_put(&cmdreq); return; }
static void mipi_sharp_shutdown(struct platform_device *pdev) { printk("%s\n", __func__); printk("R63311_SHARP shutdown \n"); mipi_dsi_cmds_tx(&sharp_tx_buf, sharp_video_off_cmds,ARRAY_SIZE(sharp_video_off_cmds)); //return 0; }
int mipi_lgit_lcd_off(struct platform_device *pdev) { int cnt = 0; struct msm_fb_data_type *mfd; printk(KERN_INFO "[LCD][DEBUG] %s is started \n", __func__); mfd = platform_get_drvdata(pdev); if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x10000000);//HS mode // mipi_dsi_cmds_tx(mfd, &lgit_tx_buf, cnt = mipi_dsi_cmds_tx(&lgit_tx_buf, mipi_lgit_pdata->power_off_set_1, mipi_lgit_pdata->power_off_set_size_1); if (cnt < 0) { MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x14000000);//LP mode return cnt; } MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x14000000);//LP mode printk(KERN_INFO "[LCD][DEBUG] %s is ended \n", __func__); return cnt; }
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(mfd, &dsi_data->tx_buf, dsi_data->panel->pctrl->display_off_cmds, dsi_data->panel->pctrl->display_off_cmds_size); ret = dsi_data->lcd_power(FALSE); } else { dsi_data->panel_detecting = false; ret = 0; } return ret; }
static void update_power_data(int index, unsigned int *gamma) { struct dsi_cmd_desc *pos; int i; int ret = 0; pos = mipi_lgit_pdata->power_on_set_1; for (i = 0; i < 9; i++) { pos[index].payload[i + 1] = gamma[i]; pos[index + 1].payload[i + 1] = gamma[i]; } /* * Only attempt to apply if the LCD is active. * If it isn't, the device will panic-reboot */ if (lcd_isactive) { MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x10000000); ret = mipi_dsi_cmds_tx(&lgit_tx_buf, pos, mipi_lgit_pdata->power_on_set_size_1); MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x14000000); if (ret < 0) pr_err("%s: failed to transmit power_on_set_1 cmds\n", __func__); } else pr_warn("%s: Tried to apply gamma settings when LCD was off\n", __func__); }
static inline void mipi_dsi_set_backlight(struct msm_fb_data_type *mfd) { struct mipi_panel_info *mipi; mipi = &mfd->panel_info.mipi; if (panel_type == PANEL_ID_VILLE_SAMSUNG_SG_C2) ville_shrink_pwm_c2(mfd->bl_level); else if (panel_type == PANEL_ID_VILLE_SAMSUNG_SG) ville_shrink_pwm(mfd->bl_level); mutex_lock(&mfd->dma->ov_mutex); /* Remove the check first for impact MFG test. Command by adb to set backlight not work */ #if 0 if (mdp4_overlay_dsi_state_get() <= ST_DSI_SUSPEND) { mutex_unlock(&mfd->dma->ov_mutex); return; } #endif if (mfd->panel_info.type == MIPI_CMD_PANEL) { mdp4_dsi_cmd_dma_busy_wait(mfd); mdp4_dsi_blt_dmap_busy_wait(mfd); mipi_dsi_mdp_busy_wait(mfd); } if (panel_type == PANEL_ID_VILLE_SAMSUNG_SG || panel_type == PANEL_ID_VILLE_SAMSUNG_SG_C2) mipi_dsi_cmds_tx(mfd, &ville_panel_tx_buf, samsung_cmd_backlight_cmds, ARRAY_SIZE(samsung_cmd_backlight_cmds)); PR_DISP_DEBUG("%s+ bl_level=%d\n", __func__, mfd->bl_level); mutex_unlock(&mfd->dma->ov_mutex); return; }
static ssize_t kgamma_apply_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { int ret = 0; /* * Only attempt to apply if the LCD is active. * If it isn't, the device will panic-reboot */ if(lcd_isactive) { MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x10000000); ret = mipi_dsi_cmds_tx(&lgit_tx_buf, local_power_on_set_1, mipi_lgit_pdata->power_on_set_size_1); MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x14000000); if (ret < 0) { pr_err("%s: failed to transmit power_on_set_1 cmds\n", __func__); return ret; } } else { pr_err("%s: Tried to apply gamma settings when LCD was off\n",__func__); //Is ENODEV correct here? Perhaps it should be something else? return -ENODEV; } return count; }
static int mipi_dsi_set_backlight(struct msm_fb_data_type *mfd) { struct mipi_panel_info *mipi; static int bl_level_old; mutex_lock(&cmdlock); mipi = &mfd->panel_info.mipi; pr_debug("%s+:bl=%d status=%d\n", __func__, mfd->bl_level, mipi_status); if (mipi_status == 0) goto end; if (mipi_renesas_pdata && mipi_renesas_pdata->shrink_pwm && mfd->bl_level!=0) led_pwm[2] = mipi_renesas_pdata->shrink_pwm(mfd->bl_level); else led_pwm[2] = (unsigned char)(mfd->bl_level); if (mfd->bl_level == 0 || board_mfg_mode() == 4 || board_mfg_mode() == 5) { led_pwm[2] = 0; } mipi_dsi_op_mode_config(DSI_CMD_MODE); mipi_dsi_cmds_tx(&renesas_tx_buf, renesas_cmd_backlight_cmds, ARRAY_SIZE(renesas_cmd_backlight_cmds)); bl_level_prevset = bl_level_old = mfd->bl_level; end: mutex_unlock(&cmdlock); 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; }
static int mipi_lgit_lcd_on(struct platform_device *pdev) { struct msm_fb_data_type *mfd; #if defined(CONFIG_FB_MSM_MIPI_LGIT_VIDEO_WVGA_INVERSE_PT_PANEL) static int gpio43 = PM8921_GPIO_PM_TO_SYS(43); #endif /* CONFIG_FB_MSM_MIPI_LGIT_VIDEO_WVGA_INVERSE_PT_PANEL */ mfd = platform_get_drvdata(pdev); if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; printk(KERN_INFO "%s: mipi lgit lcd on started \n", __func__); /* */ #if defined(CONFIG_FB_MSM_MIPI_LGIT_VIDEO_WVGA_INVERSE_PT_PANEL) gpio_direction_output(gpio43, 0); mdelay(12); gpio_direction_output(gpio43, 1); #endif /* CONFIG_FB_MSM_MIPI_LGIT_VIDEO_WVGA_INVERSE_PT_PANEL */ /* */ mipi_dsi_cmds_tx(&lgit_tx_buf, mipi_lgit_pdata->power_on_set, mipi_lgit_pdata->power_on_set_size); return 0; }
/* FIH-SW-MM-VH-DISPLAY-22*[ */ static int mipi_orise_lcd_on(struct platform_device *pdev) { int rc = 0; /* FIH-SW2-MM-NC-LCM_INIT-00 */ struct msm_fb_data_type *mfd = NULL; printk(KERN_ALERT "[DISPLAY] Enter %s\n", __func__); mfd = platform_get_drvdata(pdev); if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; if (unlikely(display_initialize)) return 0; if (unlikely(gPanelModel == 0)) { gPanelModel = mipi_orise_manufacture_id(mfd); } //gPanelModel = CMI_PANEL_ID; switch (gPanelModel) { case AUO_PANEL_ID: rc = mipi_dsi_cmds_tx(&orise_tx_buf, orise_auo_video_on_cmds, ARRAY_SIZE(orise_auo_video_on_cmds)); break; case CMI_PANEL_ID: rc = mipi_dsi_cmds_tx(&orise_tx_buf, orise_cmi_video_on_cmds, ARRAY_SIZE(orise_cmi_video_on_cmds)); break; default: printk(KERN_ERR "[DISPLAY] illegal PID <0x%02x>\n", gPanelModel); rc = mipi_dsi_cmds_tx(&orise_tx_buf, orise_cmi_video_on_cmds, ARRAY_SIZE(orise_cmi_video_on_cmds)); } printk(KERN_ALERT "[DISPLAY] dsi commands done, rc <%d>, PID <0x%02x>\n", rc, gPanelModel); display_initialize = 1; if (rc > 0) rc = 0; return rc; }
static int mipi_lgit_lcd_off(struct platform_device *pdev) { struct msm_fb_data_type *mfd; int ret = 0; pr_info("%s started\n", __func__); if (mipi_lgit_pdata->bl_pwm_disable) mipi_lgit_pdata->bl_pwm_disable(); mfd = platform_get_drvdata(pdev); if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x10000000); ret = mipi_dsi_cmds_tx(&lgit_tx_buf, mipi_lgit_pdata->power_off_set_1, mipi_lgit_pdata->power_off_set_size_1); MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x14000000); if (ret < 0) { pr_err("%s: failed to transmit power_off_set_1 cmds\n", __func__); return ret; } ret = lgit_external_dsv_onoff(0); if (ret < 0) { pr_err("%s: failed to turn off external dsv\n", __func__); return ret; } MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x10000000); ret = mipi_dsi_cmds_tx(&lgit_tx_buf, mipi_lgit_pdata->power_off_set_2, mipi_lgit_pdata->power_off_set_size_2); MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x14000000); if (ret < 0) { pr_err("%s: failed to transmit power_off_set_2 cmds\n", __func__); return ret; } pr_info("%s finished\n", __func__); return 0; }
int mipi_nt35510_video_wvga_rotate() { int ret = NO_ERROR; ret = mipi_dsi_cmds_tx(nt35510_video_rotate_cmds, ARRAY_SIZE(nt35510_video_rotate_cmds)); return ret; }
void mipi_dsi_set_tear_off(void) { mutex_lock(&dsi_mutex); mipi_dsi_buf_init(&dsi_tx_buf); mipi_dsi_cmds_tx(&dsi_tx_buf, &dsi_tear_off_cmd, 1); mutex_unlock(&dsi_mutex); }
/* EMC workaround for LCM hang after ESD test */ void mipi_novatek_set_prevent_esd(struct msm_fb_data_type *mfd) { htc_mdp_sem_down(current, &mfd->dma->mutex); mipi_dsi_op_mode_config(DSI_CMD_MODE); mipi_dsi_cmds_tx(&novatek_tx_buf, prevent_esd_cmds, ARRAY_SIZE(prevent_esd_cmds)); htc_mdp_sem_up(&mfd->dma->mutex); }
// ----------------------------------------------------------------------------- // Common Routine Implementation // ----------------------------------------------------------------------------- static int mipi_orise_lcd_on(struct platform_device *pdev) { struct msm_fb_data_type *mfd; struct msm_fb_panel_data *pdata = NULL; struct mipi_panel_info *mipi; static int init = 0; mfd = platform_get_drvdata(pdev); pdata = (struct msm_fb_panel_data *)mfd->pdev->dev.platform_data; if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; mipi = &mfd->panel_info.mipi; mutex_lock(&cmdlock); if (init == 0) { if(pdata && pdata->panel_type_detect) pdata->panel_type_detect(); init = 1; goto end; } else { if (mipi->mode == DSI_VIDEO_MODE) { mipi_dsi_cmds_tx(&orise_tx_buf, orise_video_on_cmds, ARRAY_SIZE(orise_video_on_cmds)); } else { if(panel_type != PANEL_ID_NONE) { pr_info("%s\n", ptype); mipi_dsi_cmds_tx(&orise_tx_buf, mipi_power_on_cmd, mipi_power_on_cmd_size); #ifdef MIPI_READ_DISPLAY_ID /* mipi read command verify */ /* clean up ack_err_status */ mipi_dsi_cmd_bta_sw_trigger(); mipi_novatek_manufacture_id(); #endif } else { printk(KERN_ERR "panel_type=0x%x not support at power on\n", panel_type); mutex_unlock(&cmdlock); return -EINVAL; } } } end: mutex_unlock(&cmdlock); return 0; }
static int mipi_nt35510_lcd_on(struct platform_device *pdev) { struct msm_fb_data_type *mfd; struct mipi_panel_info *mipi; static int rotate; mfd = platform_get_drvdata(pdev); if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; mipi = &mfd->panel_info.mipi; if (!mfd->cont_splash_done) { mfd->cont_splash_done = 1; return 0; } if (mipi_nt35510_pdata && mipi_nt35510_pdata->rotate_panel) rotate = mipi_nt35510_pdata->rotate_panel(); if (mipi->mode == DSI_VIDEO_MODE) { mipi_dsi_cmds_tx(mfd, &nt35510_tx_buf, nt35510_video_display_on_cmds, ARRAY_SIZE(nt35510_video_display_on_cmds)); if (rotate) { mipi_dsi_cmds_tx(mfd, &nt35510_tx_buf, nt35510_video_display_on_cmds_rotate, ARRAY_SIZE(nt35510_video_display_on_cmds_rotate)); } } else if (mipi->mode == DSI_CMD_MODE) { mipi_dsi_cmds_tx(mfd, &nt35510_tx_buf, nt35510_cmd_display_on_cmds, ARRAY_SIZE(nt35510_cmd_display_on_cmds)); if (rotate) { mipi_dsi_cmds_tx(mfd, &nt35510_tx_buf, nt35510_cmd_display_on_cmds_rotate, ARRAY_SIZE(nt35510_cmd_display_on_cmds_rotate)); } } return 0; }
static int mipi_nt35560_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; mipi_dsi_cmds_tx(mfd, &nt35560_tx_buf, nt35560_display_off_cmds, ARRAY_SIZE(nt35560_display_off_cmds)); mipi_dsi_cmds_tx(mfd, &nt35560_tx_buf, nt35560_sleep_in_cmds, ARRAY_SIZE(nt35560_sleep_in_cmds)); pr_info("leave mipi_nt35560_lcd_off \n"); return 0; }
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); }
static int mipi_ili9486_hsd_djn375_lcd_on(struct platform_device *pdev) { struct msm_fb_data_type *mfd; struct mipi_panel_info *mipi; static int first_in = 0; pr_debug("mipi_ili9486_hsd_djn375_lcd_on Start\n"); if(first_in == 0){//booted then doesnot reset first_in = 1; if(current_mode == 0){ return 0; }else{ mipi_backlight_turnoff(); } } mfd = platform_get_drvdata(pdev); if (!mfd) { return -ENODEV; } if (mfd->key != MFD_KEY) { return -EINVAL; } mipi = &mfd->panel_info.mipi; pr_debug("%s: mode = %d\n", __func__, mipi->mode); if (mipi_ili9486_hsd_djn375_lcd_reset() < 0) { pr_debug("mipi_ili9486_hsd_djn375_lcd_reset error\n"); return -EINVAL; } if(current_mode == 0){ pr_info("%s, command mode", __func__); mipi_dsi_cmds_tx(mfd, &ili9486_hsd_djn375_tx_buf, ili9486_hsd_djn375_cmd_display_on_cmds, ARRAY_SIZE(ili9486_hsd_djn375_cmd_display_on_cmds)); }else{ pr_info("%s, video mode", __func__); mipi_dsi_cmds_tx(mfd, &ili9486_hsd_djn375_tx_buf, ili9486_hsd_djn375_video_display_on_cmds, ARRAY_SIZE(ili9486_hsd_djn375_video_display_on_cmds)); } pr_debug("mipi_ili9486_hsd_djn375_lcd_on End\n"); return 0; }