void mtp_read(void) { struct fb_info *info; struct msm_fb_data_type *mfd; info = registered_fb[0]; mfd = (struct msm_fb_data_type *)info->par; mipi_dsi_cmd_bta_sw_trigger(); mipi_samsung_oled_hd_read(mfd); mipi_dsi_cmds_tx(mfd, &oscar_tx_buf, samsung_oled_hd_gpara11_cmd, ARRAY_SIZE(samsung_oled_hd_gpara11_cmd)); mipi_dsi_cmd_bta_sw_trigger(); mipi_samsung_oled_hd_read(mfd); mipi_dsi_cmds_tx(mfd, &oscar_tx_buf, samsung_oled_hd_gpara21_cmd, ARRAY_SIZE(samsung_oled_hd_gpara21_cmd)); mipi_dsi_cmd_bta_sw_trigger(); mipi_samsung_oled_hd_read(mfd); mtp_buffer[6] = mtp_buffer[6] & 0x01; mtp_buffer[14] = mtp_buffer[14] & 0x01; mtp_buffer[22] = mtp_buffer[22] & 0x01; }
static int ville_lcd_on(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; if (mipi->mode == DSI_VIDEO_MODE) { PR_DISP_ERR("%s: not support DSI_VIDEO_MODE!(%d)\n", __func__, mipi->mode); } else { if (!mipi_lcd_on) { mipi_dsi_cmd_bta_sw_trigger(); if (panel_type == PANEL_ID_VILLE_SAMSUNG_SG) { printk(KERN_INFO "ville_lcd_on PANEL_ID_VILLE_SAMSUNG_SG\n"); cmdreq.cmds = samsung_cmd_on_cmds; cmdreq.cmds_cnt = ARRAY_SIZE(samsung_cmd_on_cmds); } else if (panel_type == PANEL_ID_VILLE_SAMSUNG_SG_C2) { printk(KERN_INFO "ville_lcd_on PANEL_ID_VILLE_SAMSUNG_SG_C2\n"); cmdreq.cmds = samsung_cmd_on_cmds_c2; cmdreq.cmds_cnt = ARRAY_SIZE(samsung_cmd_on_cmds_c2); } else if (panel_type == PANEL_ID_VILLE_AUO) { printk(KERN_INFO "ville_lcd_on PANEL_ID_VILLE_AUO\n"); cmdreq.cmds = auo_cmd_on_cmds; cmdreq.cmds_cnt = ARRAY_SIZE(auo_cmd_on_cmds); } else { PR_DISP_ERR("%s: un-supported panel_type(%d)!\n", __func__, panel_type); cmdreq.cmds = samsung_cmd_on_cmds; cmdreq.cmds_cnt = ARRAY_SIZE(samsung_cmd_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); } mipi_dsi_cmd_bta_sw_trigger(); mipi_samsung_manufacture_id(mfd); } mipi_lcd_on = 1; return 0; }
static int ville_lcd_on(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; if (mipi->mode == DSI_VIDEO_MODE) { /* //-mipi_dsi_cmds_tx(mfd, &ville_panel_tx_buf, novatek_video_on_cmds, //- ARRAY_SIZE(novatek_video_on_cmds)); */ PR_DISP_ERR("%s: not support DSI_VIDEO_MODE!(%d)\n", __func__, mipi->mode); } else { if (!mipi_lcd_on) { mipi_dsi_cmd_bta_sw_trigger(); /* clean up ack_err_status */ if (panel_type == PANEL_ID_VILLE_SAMSUNG_SG) { printk(KERN_INFO "ville_lcd_on PANEL_ID_VILLE_SAMSUNG_SG\n"); mipi_dsi_cmds_tx(mfd, &ville_panel_tx_buf, samsung_cmd_on_cmds, ARRAY_SIZE(samsung_cmd_on_cmds)); } else if (panel_type == PANEL_ID_VILLE_SAMSUNG_SG_C2) { printk(KERN_INFO "ville_lcd_on PANEL_ID_VILLE_SAMSUNG_SG_C2\n"); mipi_dsi_cmds_tx(mfd, &ville_panel_tx_buf, samsung_cmd_on_cmds_c2, ARRAY_SIZE(samsung_cmd_on_cmds)); } else if (panel_type == PANEL_ID_VILLE_AUO) { printk(KERN_INFO "ville_lcd_on PANEL_ID_VILLE_AUO\n"); mipi_dsi_cmds_tx(mfd, &ville_panel_tx_buf, auo_cmd_on_cmds, ARRAY_SIZE(auo_cmd_on_cmds)); } else { PR_DISP_ERR("%s: panel_type is not supported!(%d)\n", __func__, panel_type); mipi_dsi_cmds_tx(mfd, &ville_panel_tx_buf, samsung_cmd_on_cmds, ARRAY_SIZE(samsung_cmd_on_cmds)); } } mipi_dsi_cmd_bta_sw_trigger(); /* clean up ack_err_status */ mipi_samsung_manufacture_id(mfd); } mipi_lcd_on = 1; return 0; }
static int mipi_orise_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 (mipi->mode == DSI_VIDEO_MODE) { mipi_dsi_cmds_tx(&orise_tx_buf, orise_video_on_cmds, ARRAY_SIZE(orise_video_on_cmds)); } else { mipi_dsi_cmds_tx(&orise_tx_buf, orise_cmd_on_cmds, ARRAY_SIZE(orise_cmd_on_cmds)); mipi_dsi_cmd_bta_sw_trigger(); /* clean up ack_err_status */ } return 0; }
static int mipi_nt35565_lcd_on(struct platform_device *pdev) { struct msm_fb_data_type *mfd; struct mipi_panel_info *mipi; pr_debug("mipi_nt35565_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; mipi_dsi_cmds_tx(mfd, &nt35565_tx_buf, nt35565_cmd_display_on_cmds, ARRAY_SIZE(nt35565_cmd_display_on_cmds)); #if 0 mipi_dsi_cmd_bta_sw_trigger(); /* clean up ack_err_status */ mipi_nt35565_manufacture_id(mfd); #endif pr_debug("mipi_nt35565_lcd_on X\n"); return 0; }
// ----------------------------------------------------------------------------- // Common Routine Implementation // ----------------------------------------------------------------------------- static int mipi_himax_lcd_on(struct platform_device *pdev) { struct msm_fb_data_type *mfd; struct mipi_panel_info *mipi; // static int init; mfd = platform_get_drvdata(pdev); if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; mipi = &mfd->panel_info.mipi; /* if (init == 0) { init = 1; goto end; } else */ { if (mipi->mode == DSI_VIDEO_MODE) { pr_info("DSI_VIDEO_MODE.%s",__func__); mipi_dsi_cmds_tx(&himax_tx_buf, himax_video_on_cmds, ARRAY_SIZE(himax_video_on_cmds)); } else { pr_info("DSI_CMD_MODE.%s",__func__); mipi_dsi_cmds_tx(&himax_tx_buf, himax_cmd_on_cmds, ARRAY_SIZE(himax_cmd_on_cmds)); mipi_dsi_cmd_bta_sw_trigger(); mipi_himax_manufacture_id(); } } //end: return 0; }
struct fbcon_config *mipi_init(void) { int status = 0; struct mipi_dsi_panel_config *panel_info = get_panel_info(); /* Enable MMSS_AHB_ARB_MATER_PORT_E for arbiter master0 and master 1 request */ #if (!DISPLAY_MIPI_PANEL_RENESAS) writel(0x00001800, MMSS_SFPB_GPREG); #endif #if DISPLAY_MIPI_PANEL_TOSHIBA_MDT61 mipi_dsi_phy_init(panel_info); #else mipi_dsi_phy_ctrl_config(panel_info); #endif status += mipi_dsi_panel_initialize(panel_info); #if DISPLAY_MIPI_PANEL_NOVATEK_BLUE mipi_dsi_cmd_bta_sw_trigger(); mipi_novatek_manufacture_id(); #endif mipi_fb_cfg.base = MIPI_FB_ADDR; if (panel_info->mode == MIPI_VIDEO_MODE) status += mipi_dsi_video_config(panel_info->num_of_lanes); if (panel_info->mode == MIPI_CMD_MODE) cmd_mode_status = 1; return &mipi_fb_cfg; }
// ----------------------------------------------------------------------------- // Common Routine Implementation // ----------------------------------------------------------------------------- static int mipi_himax_lcd_on(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; if (panel_type == PANEL_ID_VIG_SHARP_HX_C2) PR_DISP_INFO("Panel type = PANEL_ID_VIG_SHARP_HX_C2\n"); else if (panel_type == PANEL_ID_VIG_SHARP_HX) PR_DISP_INFO("Panel type = PANEL_ID_VIG_SHARP_HX\n"); else if (panel_type == PANEL_ID_VIG_CHIMEI_HX) PR_DISP_INFO("Panel type = PANEL_ID_VIG_CHIMEI_HX\n"); mutex_lock(&cmdlock); if (mipi->mode == DSI_VIDEO_MODE) { PR_DISP_INFO("DSI_VIDEO_MODE.%s",__func__); if (panel_type == PANEL_ID_VIG_CHIMEI_HX) { mipi_dsi_cmds_tx(&himax_tx_buf, himax_CMI_video_on_cmds, ARRAY_SIZE(himax_CMI_video_on_cmds)); }else { mipi_dsi_cmds_tx(&himax_tx_buf, himax_video_on_cmds, ARRAY_SIZE(himax_video_on_cmds)); } } else { PR_DISP_INFO("DSI_CMD_MODE.%s",__func__); if (panel_type == PANEL_ID_VIG_CHIMEI_HX) { mipi_dsi_cmds_tx(&himax_tx_buf, himax_CMI_cmd_on_cmds, ARRAY_SIZE(himax_CMI_cmd_on_cmds)); }else { mipi_dsi_cmds_tx(&himax_tx_buf, himax_cmd_on_cmds, ARRAY_SIZE(himax_cmd_on_cmds)); } mipi_dsi_cmd_bta_sw_trigger(); mipi_himax_manufacture_id(); } mutex_unlock(&cmdlock); return 0; }
static int mipi_dsi_set_backlight(struct msm_fb_data_type *mfd) { struct mipi_panel_info *mipi; mipi = &mfd->panel_info.mipi; if (mipi_status == 0 || bl_level_prevset == mfd->bl_level) { PR_DISP_DEBUG("Skip the backlight setting > mipi_status : %d, bl_level_prevset : %d, bl_level : %d\n", mipi_status, bl_level_prevset, mfd->bl_level); goto end; } led_pwm1[1] = protou_shrink_pwm(mfd->bl_level); if (mfd->bl_level == 0 || board_mfg_mode() == 4 || (board_mfg_mode() == 5 && !(htc_battery_get_zcharge_mode() % 2))) { led_pwm1[1] = 0; } htc_mdp_sem_down(current, &mfd->dma->mutex); if (mipi->mode == DSI_VIDEO_MODE) { if (panel_type == PANEL_ID_PROTOU_LG) { /* This is added for LG panel which is needed to use BTA to clear the error happened in driverIC */ MIPI_OUTP(MIPI_DSI_BASE + 0xA8, 0x10000000); mipi_dsi_cmd_bta_sw_trigger(); /* Need to send blk disable cmd to turn off backlight, or it will change to dim brightness even sending 0 brightness */ if (led_pwm1[1] == 0) mipi_dsi_cmds_tx(mfd, &protou_panel_tx_buf, lg_bkl_disable_cmds, ARRAY_SIZE(lg_bkl_disable_cmds)); else if (bl_level_prevset == 0) mipi_dsi_cmds_tx(mfd, &protou_panel_tx_buf, lg_bkl_enable_cmds, ARRAY_SIZE(lg_bkl_enable_cmds)); } mipi_dsi_cmds_tx(mfd, &protou_panel_tx_buf, backlight_cmds, ARRAY_SIZE(backlight_cmds)); } else { mipi_dsi_op_mode_config(DSI_CMD_MODE); mipi_dsi_cmds_tx(mfd, &protou_panel_tx_buf, backlight_cmds, ARRAY_SIZE(backlight_cmds)); } htc_mdp_sem_up(&mfd->dma->mutex); bl_level_prevset = mfd->bl_level; /* Record the last value which was not zero for resume use */ if (mfd->bl_level >= BRI_SETTING_MIN) last_brightness = mfd->bl_level; PR_DISP_INFO("mipi_dsi_set_backlight > set brightness to %d(%d)\n", led_pwm1[1], mfd->bl_level); end: return 0; }
static int mipi_novatek_lcd_on(struct platform_device *pdev) { struct msm_fb_data_type *mfd; struct msm_fb_panel_data *pdata = NULL; struct msm_panel_info *pinfo; mfd = platform_get_drvdata(pdev); if (!mfd) return -ENODEV; pdata = (struct msm_fb_panel_data *)mfd->pdev->dev.platform_data; if (mfd->key != MFD_KEY) return -EINVAL; pinfo = &mfd->panel_info; if (pinfo->is_3d_panel) support_3d = TRUE; if (mfd->init_mipi_lcd == 0) { PR_DISP_DEBUG("Display On - 1st time\n"); if (pdata && pdata->panel_type_detect) pdata->panel_type_detect(&pinfo->mipi); mfd->init_mipi_lcd = 1; } else { PR_DISP_DEBUG("Display On \n"); if (panel_type != PANEL_ID_NONE) { PR_DISP_INFO("%s\n", ptype); htc_mdp_sem_down(current, &mfd->dma->mutex); mipi_dsi_cmds_tx(&novatek_tx_buf, mipi_power_on_cmd, mipi_power_on_cmd_size); htc_mdp_sem_up(&mfd->dma->mutex); #if 0 /* mipi read command verify */ /* clean up ack_err_status */ mipi_dsi_cmd_bta_sw_trigger(); mipi_novatek_manufacture_id(mfd); #endif } else { printk(KERN_ERR "panel_type=0x%x not support at power on\n", panel_type); return -EINVAL; } } PR_DISP_DEBUG("Init done!\n"); return 0; }
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 protou_lcd_on(struct platform_device *pdev) { struct msm_fb_data_type *mfd; struct msm_fb_panel_data *pdata = NULL; struct mipi_panel_info *mipi; mfd = platform_get_drvdata(pdev); if (!mfd) return -ENODEV; pdata = (struct msm_fb_panel_data *)mfd->pdev->dev.platform_data; if (mfd->key != MFD_KEY) return -EINVAL; mipi = &mfd->panel_info.mipi; if (mfd->init_mipi_lcd == 0) { PR_DISP_INFO("Display On - 1st time\n"); if (panel_type == PANEL_ID_PROTOU_SHARP || panel_type == PANEL_ID_PROTOU_SHARP_C1) mipi_dsi_cmds_tx(mfd, &protou_panel_tx_buf, protou_power_on_cmd, protou_power_on_cmd_size); mfd->init_mipi_lcd = 1; } else { PR_DISP_INFO("Display On \n"); if (panel_type != PANEL_ID_NONE) { PR_DISP_INFO("%s\n", ptype); htc_mdp_sem_down(current, &mfd->dma->mutex); mipi_dsi_cmds_tx(mfd, &protou_panel_tx_buf, protou_power_on_cmd, protou_power_on_cmd_size); htc_mdp_sem_up(&mfd->dma->mutex); #if 0 /* mipi read command verify */ /* clean up ack_err_status */ mdelay(1000); mipi_dsi_cmd_bta_sw_trigger(); protou_manufacture_id(mfd); #endif } else { printk(KERN_ERR "panel_type=0x%x not support at power on\n", panel_type); return -EINVAL; } } PR_DISP_DEBUG("Init done!\n"); return 0; }
// ----------------------------------------------------------------------------- // 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 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 int mipi_orise_lcd_on(struct platform_device *pdev) { struct msm_fb_data_type *mfd; struct mipi_panel_info *mipi; struct msm_panel_info *pinfo; struct dcs_cmd_req cmdreq; 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; memset(&cmdreq, 0, sizeof(cmdreq)); if (mipi->mode == DSI_VIDEO_MODE) { cmdreq.cmds = orise_video_on_cmds; cmdreq.cmds_cnt = ARRAY_SIZE(orise_video_on_cmds); cmdreq.flags = CMD_REQ_COMMIT; cmdreq.rlen = 0; cmdreq.cb = NULL; mipi_dsi_cmdlist_put(&cmdreq); } else { cmdreq.cmds = orise_cmd_on_cmds; cmdreq.cmds_cnt = ARRAY_SIZE(orise_cmd_on_cmds); cmdreq.flags = CMD_REQ_COMMIT; cmdreq.rlen = 0; cmdreq.cb = NULL; mipi_dsi_cmdlist_put(&cmdreq); mipi_dsi_cmd_bta_sw_trigger(); /* clean up ack_err_status */ } return 0; }
uint32 nt35590_read_manufacture_id(struct msm_fb_data_type *mfd) { struct dsi_buf *rp, *tp; struct dsi_cmd_desc *cmd; uint32 *lp; uint32 id=0xff; printk("==========%s:line%d===========\n",__func__,__LINE__); tp = &z5mini_tx_buf; rp = &z5mini_rx_buf; cmd = nt35590_manufacture_id_cmd; mipi_dsi_buf_init(rp); mipi_dsi_buf_init(tp); mipi_dsi_cmd_bta_sw_trigger(); /* clean up ack_err_status */ mipi_dsi_cmds_rx(mfd, tp, rp, cmd, 2); lp = (uint32 *)rp->data; // id=(((*lp)&0xff00)>>8); id=(*lp); pr_info("%s: manufacture_id=0x%x,id=0x%x\n", __func__, (*lp)&0xffff ,id); return id; }
static int mipi_oscar_lcd_on(struct platform_device *pdev) { struct msm_fb_data_type *mfd; struct fb_info *fbi; ENTER_FUNC2(); mfd = platform_get_drvdata(pdev); fbi = mfd->fbi; if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; if (oscar_state.disp_initialized == false) { mdelay(25); gpio_direction_output(gpio43, 0); udelay(10); gpio_direction_output(gpio43, 1); // lcd panel reset mdelay(10); mipi_set_tx_power_mode(0); mipi_dsi_cmds_tx(mfd, &oscar_tx_buf, oscar_display_init_cmds, ARRAY_SIZE(oscar_display_init_cmds)); mipi_set_tx_power_mode(1); #ifdef SAMSUNG_LCD_MIPI_CELL if(id_read_flag == false){ //read ID3 mipi_set_tx_power_mode(0); mipi_dsi_cmd_bta_sw_trigger(); mipi_oscar_lcd_read(mfd); mipi_set_tx_power_mode(1); printk("oscar_mipi_cell-read\n"); id_read_flag = true; } #endif #ifdef CONFIG_ACL_FOR_AMOLED mipi_set_tx_power_mode(0); switch(oscar_state.acl_data) { case 10: mipi_dsi_cmds_tx(mfd, &oscar_tx_buf, oscar_acl_control10, ARRAY_SIZE(oscar_acl_control10)); break; case 30: mipi_dsi_cmds_tx(mfd, &oscar_tx_buf, oscar_acl_control30, ARRAY_SIZE(oscar_acl_control30)); break; case 50: mipi_dsi_cmds_tx(mfd, &oscar_tx_buf, oscar_acl_control50, ARRAY_SIZE(oscar_acl_control50)); break; } mipi_set_tx_power_mode(1); #endif if(first == 0){ 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); first =true; } oscar_state.disp_initialized = true; } #ifdef SAMSUNG_LCD_MIPI_CELL mipi_set_tx_power_mode(0); //after read id, mipi_dsi_cmds_tx(mfd, &oscar_tx_buf, Cell_on_cmd, ARRAY_SIZE(Cell_on_cmd)); mipi_set_tx_power_mode(1); #endif oscar_state.disp_on = true; printk(KERN_WARNING"mipi_oscar_lcd_acl_data = %d, %d\n",oscar_state.acl_data,oscar_state.acl_data); EXIT_FUNC2(); return 0; }
/* ----------------------------------------------------------------------------- // Common Routine Implementation // ----------------------------------------------------------------------------- */ static int mipi_himax_lcd_on(struct platform_device *pdev) { struct msm_fb_data_type *mfd; struct mipi_panel_info *mipi; static int turn_on_logo = 1; mfd = platform_get_drvdata(pdev); if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; mipi = &mfd->panel_info.mipi; mutex_lock(&cmdlock); #if defined CONFIG_FB_MSM_SELF_REFRESH #ifdef CONFIG_PERFLOCK if (!is_perf_lock_active(&himax_perf_lock)) perf_lock(&himax_perf_lock); #endif #endif if (mipi->mode == DSI_VIDEO_MODE) { PR_DISP_DEBUG("DSI_VIDEO_MODE.%s", __func__); if (panel_type == PANEL_ID_VIG_CHIMEI_HX) { PR_DISP_DEBUG("Panel type = PANEL_ID_VIG_CHIMEI_HX\n"); mipi_dsi_cmds_tx(&himax_tx_buf, himax_CMI_video_on_cmds, ARRAY_SIZE(himax_CMI_video_on_cmds)); } else if (panel_type == PANEL_ID_VIG_CHIMEI_HX_C25) { PR_DISP_DEBUG("Panel type = PANEL_ID_VIG_CHIMEI_HX_C25\n"); mipi_dsi_cmds_tx(&himax_tx_buf, himax_CMI_video_on_c25_cmds, ARRAY_SIZE(himax_CMI_video_on_c25_cmds)); } else if (panel_type == PANEL_ID_VIG_CHIMEI_HX_C3) { PR_DISP_DEBUG("Panel type = PANEL_ID_VIG_CHIMEI_HX_C3\n"); mipi_dsi_cmds_tx(&himax_tx_buf, himax_CMI_video_on_c3_cmds, ARRAY_SIZE(himax_CMI_video_on_c3_cmds)); } else if (panel_type == PANEL_ID_VIG_SHARP_HX_C3) { PR_DISP_DEBUG("Panel type = PANEL_ID_VIG_SHARP_HX_C3\n"); mipi_dsi_cmds_tx(&himax_tx_buf, himax_video_on_c3_cmds, ARRAY_SIZE(himax_video_on_c3_cmds)); } else if (panel_type == PANEL_ID_VIG_SHARP_HX_C25) { PR_DISP_DEBUG("Panel type = PANEL_ID_VIG_SHARP_HX_C25\n"); mipi_dsi_cmds_tx(&himax_tx_buf, himax_video_on_c2_cmds, ARRAY_SIZE(himax_video_on_c2_cmds)); } else if (panel_type == PANEL_ID_VIG_SHARP_HX_C2) { PR_DISP_DEBUG("Panel type = PANEL_ID_VIG_SHARP_HX_C2\n"); mipi_dsi_cmds_tx(&himax_tx_buf, himax_video_on_c2_cmds, ARRAY_SIZE(himax_video_on_c2_cmds)); } else { PR_DISP_DEBUG("Panel type = PANEL_ID_VIG_SHARP_HX\n"); mipi_dsi_cmds_tx(&himax_tx_buf, himax_video_on_cmds, ARRAY_SIZE(himax_video_on_cmds)); } if (turn_on_logo && board_mfg_mode() == 0) { mipi_dsi_cmds_tx(&himax_tx_buf, himax_show_logo_cmds, ARRAY_SIZE(himax_show_logo_cmds)); turn_on_logo = 0; } } else { PR_DISP_DEBUG("DSI_CMD_MODE.%s", __func__); if (panel_type == PANEL_ID_VIG_CHIMEI_HX) { mipi_dsi_cmds_tx(&himax_tx_buf, himax_CMI_cmd_on_cmds, ARRAY_SIZE(himax_CMI_cmd_on_cmds)); } else { mipi_dsi_cmds_tx(&himax_tx_buf, himax_cmd_on_cmds, ARRAY_SIZE(himax_cmd_on_cmds)); } mipi_dsi_cmd_bta_sw_trigger(); mipi_himax_manufacture_id(); } #if defined CONFIG_FB_MSM_SELF_REFRESH #ifdef CONFIG_PERFLOCK if (is_perf_lock_active(&himax_perf_lock)) perf_unlock(&himax_perf_lock); #endif #endif mutex_unlock(&cmdlock); return 0; }
static int mipi_samsung_oled_hd_on(struct platform_device *pdev) { struct msm_fb_data_type *mfd; #if (BOARD_VER > WS10) int noled_det; #endif ENTER_FUNC2(); mfd = platform_get_drvdata(pdev); if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; if (samsung_oled_hd_state.disp_initialized == false) { samsung_oled_hd_state.disp_initialized = true; gpio_set_value_cansleep(gpio43, 0); usleep(10); gpio_set_value_cansleep(gpio43, 1); // lcd panel reset usleep(10); // mdelay(10); // mdelay(1); mipi_dsi_cmds_tx(mfd, &samsung_oled_hd_tx_buf, samsung_oled_hd_display_init_cmds, ARRAY_SIZE(samsung_oled_hd_display_init_cmds)); /* mipi_dsi_cmds_tx(mfd, &samsung_oled_hd_tx_buf, samsung_oled_hd_display_sleepout_cmds, ARRAY_SIZE(samsung_oled_hd_display_sleepout_cmds)); mipi_dsi_cmds_tx(mfd, &samsung_oled_hd_tx_buf, samsung_oled_hd_display_on1_cmds, ARRAY_SIZE(samsung_oled_hd_display_on1_cmds)); */ #if (BOARD_VER > WS10) noled_det = gpio_get_value(OLED_DET); if(noled_det) printk("[PANTECH_LCD] OLED Panel Connector State : Disconnect !!!(%d)\n",noled_det); else printk("[PANTECH_LCD] OLED Panel Connector State : Connect !!!(%d)\n",noled_det); if((!is_read)&(!noled_det)) #else if(!is_read) #endif { mipi_dsi_cmd_bta_sw_trigger(); mipi_samsung_oled_hd_read_id(mfd); mipi_dsi_cmds_tx(mfd, &samsung_oled_hd_tx_buf, samsung_oled_hd_display_gamma_cmds_300, ARRAY_SIZE(samsung_oled_hd_display_gamma_cmds_300)); is_read = TRUE; }else{ mipi_dsi_cmds_tx(mfd, &samsung_oled_hd_tx_buf, samsung_oled_hd_display_gamma_cmds_20, ARRAY_SIZE(samsung_oled_hd_display_gamma_cmds_20)); } mipi_dsi_cmds_tx(mfd, &samsung_oled_hd_tx_buf, samsung_oled_hd_display_on2_cmds, ARRAY_SIZE(samsung_oled_hd_display_on2_cmds)); is_sleep = FALSE; printk("[PANTECH_LCD] power on state (oled_hd panel).... \n"); #ifdef D_SKY_OLED_TEMP is_oled_temp_check(); #endif samsung_oled_hd_state.disp_on = true; #ifdef CONFIG_PANTECH_HDMI_PW_CTRL_ON_LCD hdmi_autodetect_control(HDMI_PW_ON); HDMI_Schedule_Control(1); #endif } EXIT_FUNC2(); return 0; }
static int mipi_dsi_on(struct platform_device *pdev) { int ret = 0; u32 clk_rate; struct msm_fb_data_type *mfd; struct fb_info *fbi; struct fb_var_screeninfo *var; struct msm_panel_info *pinfo; struct mipi_panel_info *mipi; u32 hbp, hfp, vbp, vfp, hspw, vspw, width, height; u32 ystride, bpp, data; u32 dummy_xres, dummy_yres; int target_type = 0; mfd = platform_get_drvdata(pdev); fbi = mfd->fbi; var = &fbi->var; pinfo = &mfd->panel_info; if (mipi_dsi_pdata && mipi_dsi_pdata->dsi_power_save) mipi_dsi_pdata->dsi_power_save(1); clk_rate = mfd->fbi->var.pixclock; clk_rate = min(clk_rate, mfd->panel_info.clk_max); local_bh_disable(); mipi_dsi_clk_enable(); local_bh_enable(); #ifndef CONFIG_FB_MSM_MDP303 mdp4_overlay_dsi_state_set(ST_DSI_RESUME); #endif MIPI_OUTP(MIPI_DSI_BASE + 0x114, 1); MIPI_OUTP(MIPI_DSI_BASE + 0x114, 0); hbp = var->left_margin; hfp = var->right_margin; vbp = var->upper_margin; vfp = var->lower_margin; hspw = var->hsync_len; vspw = var->vsync_len; width = mfd->panel_info.xres; height = mfd->panel_info.yres; mipi_dsi_phy_ctrl(1); if (mdp_rev == MDP_REV_42 && mipi_dsi_pdata) target_type = mipi_dsi_pdata->target_type; mipi_dsi_phy_init(0, &(mfd->panel_info), target_type); mipi = &mfd->panel_info.mipi; if (mfd->panel_info.type == MIPI_VIDEO_PANEL) { dummy_xres = mfd->panel_info.mipi.xres_pad; dummy_yres = mfd->panel_info.mipi.yres_pad; if (mdp_rev >= MDP_REV_41) { MIPI_OUTP(MIPI_DSI_BASE + 0x20, ((hspw + hbp + width + dummy_xres) << 16 | (hspw + hbp))); MIPI_OUTP(MIPI_DSI_BASE + 0x24, ((vspw + vbp + height + dummy_yres) << 16 | (vspw + vbp))); MIPI_OUTP(MIPI_DSI_BASE + 0x28, (vspw + vbp + height + dummy_yres + vfp - 1) << 16 | (hspw + hbp + width + dummy_xres + hfp - 1)); } else { /* DSI_LAN_SWAP_CTRL */ MIPI_OUTP(MIPI_DSI_BASE + 0x00ac, mipi->dlane_swap); MIPI_OUTP(MIPI_DSI_BASE + 0x20, ((hbp + width + dummy_xres) << 16 | (hbp))); MIPI_OUTP(MIPI_DSI_BASE + 0x24, ((vbp + height + dummy_yres) << 16 | (vbp))); MIPI_OUTP(MIPI_DSI_BASE + 0x28, (vbp + height + dummy_yres + vfp) << 16 | (hbp + width + dummy_xres + hfp)); } MIPI_OUTP(MIPI_DSI_BASE + 0x2c, (hspw << 16)); MIPI_OUTP(MIPI_DSI_BASE + 0x30, 0); MIPI_OUTP(MIPI_DSI_BASE + 0x34, (vspw << 16)); } else { /* command mode */ if (mipi->dst_format == DSI_CMD_DST_FORMAT_RGB888) bpp = 3; else if (mipi->dst_format == DSI_CMD_DST_FORMAT_RGB666) bpp = 3; else if (mipi->dst_format == DSI_CMD_DST_FORMAT_RGB565) bpp = 2; else bpp = 3; /* Default format set to RGB888 */ ystride = width * bpp + 1; /* DSI_COMMAND_MODE_MDP_STREAM_CTRL */ data = (ystride << 16) | (mipi->vc << 8) | DTYPE_DCS_LWRITE; MIPI_OUTP(MIPI_DSI_BASE + 0x5c, data); MIPI_OUTP(MIPI_DSI_BASE + 0x54, data); /* DSI_COMMAND_MODE_MDP_STREAM_TOTAL */ data = height << 16 | width; MIPI_OUTP(MIPI_DSI_BASE + 0x60, data); MIPI_OUTP(MIPI_DSI_BASE + 0x58, data); } mipi_dsi_host_init(mipi); mipi_dsi_cmd_bta_sw_trigger(); /* clean up ack_err_status */ ret = panel_next_on(pdev); mipi_dsi_op_mode_config(mipi->mode); if (mfd->panel_info.type == MIPI_CMD_PANEL) { if (pinfo->lcd.vsync_enable) { if (pinfo->lcd.hw_vsync_mode && vsync_gpio > 0) { if (gpio_request(vsync_gpio, "MDP_VSYNC") == 0) gpio_direction_input(vsync_gpio); else pr_err("%s: unable to request gpio=%d\n", __func__, vsync_gpio); } mipi_dsi_set_tear_on(mfd); } } #ifdef CONFIG_MSM_BUS_SCALING mdp_bus_scale_update_request(2); #endif return ret; }