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 int mipi_sony_lcd_off(struct platform_device *pdev) { struct msm_fb_data_type *mfd; #ifdef MIPI_CMDSTX_CHANGE_TO_CMDLISTPUT struct dcs_cmd_req cmdreq; #endif ENTER_FUNC2(); mfd = platform_get_drvdata(pdev); if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; mutex_lock(&sony_state.lcd_mutex); if (sony_state.disp_on == true) { sony_state.disp_on = false; sony_state.disp_initialized = false; //mipi_set_tx_power_mode(0); #ifdef MIPI_CMDSTX_CHANGE_TO_CMDLISTPUT cmdreq.cmds = sony_display_off_cmds; cmdreq.cmds_cnt = ARRAY_SIZE(sony_display_off_cmds); cmdreq.flags = CMD_REQ_COMMIT; cmdreq.rlen = 0; cmdreq.cb = NULL; mipi_dsi_cmdlist_put(&cmdreq); #else mipi_dsi_cmds_tx(&sony_tx_buf, sony_display_off_cmds, ARRAY_SIZE(sony_display_off_cmds)); #endif #if defined(CONFIG_F_SKYDISP_SILENT_BOOT) && defined(CONFIG_PANTECH_RESET_REASON) sky_sys_rst_set_silent_boot_backlight(0); is_silent_boot_mode_n_bl_off = 0; #endif //mipi_set_tx_power_mode(1); } #ifdef FEATURE_RENESAS_BL_CTRL_CHG wrdisbv[1] = 0; if(gpio_get_value_cansleep(gpio_lcd_bl_en)) gpio_set_value_cansleep(gpio_lcd_bl_en, GPIO_LOW_VALUE); #endif mutex_unlock(&sony_state.lcd_mutex); EXIT_FUNC2(); return 0; }
int mipi_sony_force_lcd_off(void) { struct msm_fb_data_type *mfd; struct fb_info *info; struct dcs_cmd_req cmdreq; ENTER_FUNC2(); info = registered_fb[0]; mfd = (struct msm_fb_data_type *)info->par; if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; mutex_lock(&sony_state.lcd_mutex); if (sony_state.disp_on == true) { //mipi_set_tx_power_mode(0); cmdreq.cmds = sony_display_off_cmds; cmdreq.cmds_cnt = ARRAY_SIZE(sony_display_off_cmds); cmdreq.flags = CMD_REQ_COMMIT; cmdreq.rlen = 0; cmdreq.cb = NULL; mipi_dsi_cmdlist_put(&cmdreq); sony_state.disp_on = false; sony_state.disp_initialized = false; #if defined(CONFIG_F_SKYDISP_SILENT_BOOT) && defined(CONFIG_PANTECH_RESET_REASON) sky_sys_rst_set_silent_boot_backlight(0); is_silent_boot_mode_n_bl_off = 0; #endif //mipi_set_tx_power_mode(1); } mutex_unlock(&sony_state.lcd_mutex); #ifdef FEATURE_RENESAS_BL_CTRL_CHG wrdisbv[1] = 0; #endif EXIT_FUNC2(); return 0; }
//extern void LCD_gpio_set_vci_control(int on); static int mipi_sony_lcd_on(struct platform_device *pdev) { struct msm_fb_data_type *mfd; #ifdef MIPI_CMDSTX_CHANGE_TO_CMDLISTPUT struct dcs_cmd_req cmdreq; #endif ENTER_FUNC2(); mfd = platform_get_drvdata(pdev); if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; #ifdef FEATURE_SKYDISP_BOOT_ANI_SKIP_BUG_FIX if (!lcd_on_skip_during_bootup) { lcd_on_skip_during_bootup = true; sony_state.disp_initialized = true; sony_state.disp_on = true; goto out; } #endif mutex_lock(&sony_state.lcd_mutex); if(!gpio_get_value_cansleep(gpio_lcd_bl_en)) gpio_set_value_cansleep(gpio_lcd_bl_en, GPIO_HIGH_VALUE); if (sony_state.disp_initialized == false) { #ifdef MIPI_CMDSTX_CHANGE_TO_CMDLISTPUT cmdreq.cmds = sony_display_init_cmds; cmdreq.cmds_cnt = ARRAY_SIZE(sony_display_init_cmds); cmdreq.flags = CMD_REQ_COMMIT; cmdreq.rlen = 0; cmdreq.cb = NULL; mipi_dsi_cmdlist_put(&cmdreq); #else mipi_dsi_cmds_tx(&sony_tx_buf, sony_display_init_cmds, ARRAY_SIZE(sony_display_init_cmds)); #endif sony_state.disp_initialized = true; } #ifdef MIPI_CMDSTX_CHANGE_TO_CMDLISTPUT cmdreq.cmds = sony_display_on_cmds; cmdreq.cmds_cnt = ARRAY_SIZE(sony_display_on_cmds); cmdreq.flags = CMD_REQ_COMMIT; cmdreq.rlen = 0; cmdreq.cb = NULL; mipi_dsi_cmdlist_put(&cmdreq); #else mipi_dsi_cmds_tx(&sony_tx_buf, sony_display_on_cmds, ARRAY_SIZE(sony_display_on_cmds)); #endif sony_state.disp_on = true; #ifdef MIPI_CMDSTX_CHANGE_TO_CMDLISTPUT 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); #else mipi_dsi_cmds_tx(&sony_tx_buf, sony_display_cabc_on_cmds, ARRAY_SIZE(sony_display_cabc_on_cmds)); #endif mutex_unlock(&sony_state.lcd_mutex); #ifdef FEATURE_SKYDISP_BOOT_ANI_SKIP_BUG_FIX out: #endif #if defined(CONFIG_F_SKYDISP_SILENT_BOOT) && defined(CONFIG_PANTECH_RESET_REASON) // In case of reset when silentboot mode(doing boot), only when is_silent_boot_mode_n_bl_off == 0, do it. // If always do it, display silentboot image eventhough reset occur when backlight off. if(is_silent_boot_mode_n_bl_off == 0) sky_sys_rst_set_silent_boot_backlight(1); #endif #ifdef BOOT_TOUCH_RESET // touch reset code #ifdef PANTECH_LCD_REQUEST_GPIO_TOUCHRESET if (touch_init == false) { pr_info("[LIVED] %s touch_init=%d, gpio_init=%d\n", __func__, touch_init, gpio_init); if (gpio_init == false) { if (gpio_request(touch_reset_gpio, "TOUCH_RESET_GPIO") != 0) { pr_err("[LCD]%s: fail to request touch_reset_gpio=%d, touch_init=%d, gpio_init=%d\n", __func__, touch_reset_gpio, touch_init, gpio_init); } gpio_init = true; } gpio_direction_output(TOUCH_RST_GPIO, 1); gpio_set_value(TOUCH_RST_GPIO, GPIO_LOW_VALUE); msleep(50); gpio_set_value(TOUCH_RST_GPIO, GPIO_HIGH_VALUE); touch_init = true; } #else if (touch_init == false) { gpio_direction_output(TOUCH_RST_GPIO, 1); gpio_set_value(TOUCH_RST_GPIO, GPIO_LOW_VALUE); msleep(50); gpio_set_value(TOUCH_RST_GPIO, GPIO_HIGH_VALUE); touch_init = true; } #endif #endif EXIT_FUNC2(); return 0; }
int mipi_sony_force_lcd_on(void) { struct msm_fb_data_type *mfd; struct fb_info *info; struct dcs_cmd_req cmdreq; ENTER_FUNC2(); info = registered_fb[0]; mfd = (struct msm_fb_data_type *)info->par; if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; mutex_lock(&sony_state.lcd_mutex); if (sony_state.disp_initialized == false) { cmdreq.cmds = sony_display_init_cmds; cmdreq.cmds_cnt = ARRAY_SIZE(sony_display_init_cmds); cmdreq.flags = CMD_REQ_COMMIT; cmdreq.rlen = 0; cmdreq.cb = NULL; mipi_dsi_cmdlist_put(&cmdreq); sony_state.disp_initialized = true; } cmdreq.cmds = sony_display_on_cmds; cmdreq.cmds_cnt = ARRAY_SIZE(sony_display_on_cmds); cmdreq.flags = CMD_REQ_COMMIT; cmdreq.rlen = 0; cmdreq.cb = NULL; mipi_dsi_cmdlist_put(&cmdreq); sony_state.disp_on = true; 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); wrdisbv[1] = 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); mutex_unlock(&sony_state.lcd_mutex); #if defined(CONFIG_F_SKYDISP_SILENT_BOOT) && defined(CONFIG_PANTECH_RESET_REASON) // In case of reset when silentboot mode(doing boot), only when is_silent_boot_mode_n_bl_off == 0, do it. // If always do it, display silentboot image eventhough reset occur when backlight off. if(is_silent_boot_mode_n_bl_off == 0) sky_sys_rst_set_silent_boot_backlight(1); #endif #ifdef BOOT_TOUCH_RESET //gpio_direction_output(TOUCH_RST_GPIO, 1); gpio_set_value(TOUCH_RST_GPIO, GPIO_LOW_VALUE); msleep(50); gpio_set_value(TOUCH_RST_GPIO, GPIO_HIGH_VALUE); #endif EXIT_FUNC2(); return 0; }
//extern void LCD_gpio_set_vci_control(int on); static int mipi_sony_lcd_on(struct platform_device *pdev) { struct msm_fb_data_type *mfd; #ifdef MIPI_CMDSTX_CHANGE_TO_CMDLISTPUT struct dcs_cmd_req cmdreq; #endif ENTER_FUNC2(); mfd = platform_get_drvdata(pdev); if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; mutex_lock(&sony_state.lcd_mutex); if (sony_state.disp_initialized == false) { #ifdef MIPI_CMDSTX_CHANGE_TO_CMDLISTPUT cmdreq.cmds = sony_display_init_cmds; cmdreq.cmds_cnt = ARRAY_SIZE(sony_display_init_cmds); cmdreq.flags = CMD_REQ_COMMIT; cmdreq.rlen = 0; cmdreq.cb = NULL; mipi_dsi_cmdlist_put(&cmdreq); #else mipi_dsi_cmds_tx(&sony_tx_buf, sony_display_init_cmds, ARRAY_SIZE(sony_display_init_cmds)); #endif sony_state.disp_initialized = true; } #ifdef MIPI_CMDSTX_CHANGE_TO_CMDLISTPUT cmdreq.cmds = sony_display_on_cmds; cmdreq.cmds_cnt = ARRAY_SIZE(sony_display_on_cmds); cmdreq.flags = CMD_REQ_COMMIT; cmdreq.rlen = 0; cmdreq.cb = NULL; mipi_dsi_cmdlist_put(&cmdreq); #else mipi_dsi_cmds_tx(&sony_tx_buf, sony_display_on_cmds, ARRAY_SIZE(sony_display_on_cmds)); #endif sony_state.disp_on = true; #if (1)// kkcho_temp #if (0) if(sony_state.acl_flag == true){ #ifdef MIPI_CMDSTX_CHANGE_TO_CMDLISTPUT cmdreq.cmds = sony_display_cabc_off_cmds; cmdreq.cmds_cnt = ARRAY_SIZE(sony_display_cabc_off_cmds); cmdreq.flags = CMD_REQ_COMMIT; cmdreq.rlen = 0; cmdreq.cb = NULL; mipi_dsi_cmdlist_put(&cmdreq); #else mipi_dsi_cmds_tx(mfd, &sony_tx_buf, sony_display_cabc_off_cmds, ARRAY_SIZE(sony_display_cabc_off_cmds)); #endif } else{ #ifdef MIPI_CMDSTX_CHANGE_TO_CMDLISTPUT 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); #else mipi_dsi_cmds_tx(mfd, &sony_tx_buf, sony_display_cabc_on_cmds, ARRAY_SIZE(sony_display_cabc_on_cmds)); #endif } //#else #endif // if 0 #ifdef MIPI_CMDSTX_CHANGE_TO_CMDLISTPUT 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); #else mipi_dsi_cmds_tx(&sony_tx_buf, sony_display_cabc_on_cmds, ARRAY_SIZE(sony_display_cabc_on_cmds)); #endif #endif // if 1 //kkcho_temp mutex_unlock(&sony_state.lcd_mutex); #ifdef CONFIG_F_SKYDISP_SILENT_BOOT // In case of reset when silentboot mode(doing boot), only when is_silent_boot_mode_n_bl_off == 0, do it. // If always do it, display silentboot image eventhough reset occur when backlight off. if(is_silent_boot_mode_n_bl_off == 0) sky_sys_rst_set_silent_boot_backlight(1); #endif #ifdef BOOT_TOUCH_RESET // touch reset code if(touch_init == false) { gpio_direction_output(TOUCH_RST_GPIO, 1); gpio_set_value(TOUCH_RST_GPIO, 0); msleep(50); gpio_set_value(TOUCH_RST_GPIO, 1); touch_init = true; } #endif EXIT_FUNC2(); return 0; }
static int mipi_renesas_lcd_on(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; #ifndef SKY_LCD_SINGLE_WIRE_LB_CON #ifdef CONFIG_F_SKYDISP_CHANGE_BL_TABLE_WHEN_OFFLINE_CHARGING if(is_offline_charging_mode == 1) { // Configure cabc_ctrl_con[1] to turn off CABC. cabc_ctrl_con[1] = 0; // CABC OFF } #endif #endif if (!lcd_on_skip_during_bootup) { lcd_on_skip_during_bootup = true; renesas_state.disp_initialized = true; renesas_state.disp_on = true; goto out; } if (renesas_state.disp_initialized == false) { #if defined(FEATURE_RENESAS_BL_ON_DEBUG) #ifndef SKY_LCD_SINGLE_WIRE_LB_CON cabc_data_val[2] = bl_table[0]; #endif // SKY_LCD_SINGLE_WIRE_LB_CON #endif // vci enable gpio_set_value(LCD_VCI_EN, GPIO_HIGH_VALUE); msleep(20); // reset low gpio_set_value_cansleep(gpio_lcd_mipi_reset, GPIO_LOW_VALUE); msleep(10); // reset high gpio_set_value_cansleep(gpio_lcd_mipi_reset, GPIO_HIGH_VALUE); msleep(10); mutex_lock(&renesas_state.lcd_mutex); mipi_dsi_cmds_tx(&renesas_tx_buf, renesas_part1, ARRAY_SIZE(renesas_part1)); mutex_unlock(&renesas_state.lcd_mutex); switch (renesas_state.test_control_flag) { case 0: //default mipi_dsi_cmds_tx(&renesas_tx_buf, renesas_1Column, ARRAY_SIZE(renesas_1Column)); break; case 1: mipi_dsi_cmds_tx(&renesas_tx_buf, renesas_1HDot, ARRAY_SIZE(renesas_1HDot)); PRINT("[kkcho]renesas_1HDot bl_level\n"); break; case 2: mipi_dsi_cmds_tx(&renesas_tx_buf, renesas_2HDot, ARRAY_SIZE(renesas_2HDot)); PRINT("[kkcho]renesas_2HDot bl_level\n"); break; case 3: mipi_dsi_cmds_tx(&renesas_tx_buf, renesas_3HDot, ARRAY_SIZE(renesas_3HDot)); PRINT("[kkcho]renesas_3HDot bl_level\n"); break; case 4: mipi_dsi_cmds_tx(&renesas_tx_buf, renesas_3Column, ARRAY_SIZE(renesas_3Column)); PRINT("[kkcho]renesas_3Column bl_level\n"); break; default: mipi_dsi_cmds_tx(&renesas_tx_buf, renesas_1Column, ARRAY_SIZE(renesas_1Column)); break; } mutex_lock(&renesas_state.lcd_mutex); mipi_dsi_cmds_tx(&renesas_tx_buf, renesas_part2, ARRAY_SIZE(renesas_part2)); mutex_unlock(&renesas_state.lcd_mutex); renesas_state.disp_initialized = true; } mutex_lock(&renesas_state.lcd_mutex); mipi_dsi_cmds_tx(&renesas_tx_buf, renesas_display_on_cmds, ARRAY_SIZE(renesas_display_on_cmds)); mipi_dsi_cmds_tx(&renesas_tx_buf, renesas_sleep_out_cmds, ARRAY_SIZE(renesas_sleep_out_cmds)); mutex_unlock(&renesas_state.lcd_mutex); //============================================ // read test //============================================ #ifdef SKY_LCD_MIPI_TEST_READ mipi_renesas_read_buf(pdev); #endif //============================================ renesas_state.disp_on = true; out: #ifdef CONFIG_F_SKYDISP_SILENT_BOOT // In case of reset when silentboot mode(doing boot), only when is_silent_boot_mode_n_bl_off == 0, do it. // If always do it, display silentboot image eventhough reset occur when backlight off. if(is_silent_boot_mode_n_bl_off == 0) sky_sys_rst_set_silent_boot_backlight(1); #endif EXIT_FUNC2(); return 0; }