static void execute_panel_init(struct msm_fb_data_type *mfd)
{
	/* read LID ID */
	mipi_samsung_disp_send_cmd(mfd, PANEL_MTP_ENABLE, false);

	msd.mpd->manufacture_id = mipi_samsung_manufacture_id(mfd);

	mipi_samsung_disp_send_cmd(mfd, PANEL_MTP_DISABLE, false);
}
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;
}
Beispiel #3
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_samsung_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 (pdata && pdata->panel_type_detect)
			pdata->panel_type_detect(mipi);

		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, &samsung_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_samsung_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;
}
Beispiel #5
0
static void execute_panel_init(struct msm_fb_data_type *mfd)
{
	struct SMART_DIM *psmart = &(msd.mpd->smart_s6e88a[msd.mpd->lcd_no]);
	char *mtp_buffer = (char *)&(msd.mpd->smart_s6e88a[msd.mpd->lcd_no].MTP_ORIGN);

	/* LSI HBM */
	char *mtp_buffer2 = (char *)&(msd.mpd->smart_s6e88a[msd.mpd->lcd_no].hbm_reg.b5_reg);
	char *mtp_buffer3 = (char *)&(msd.mpd->smart_s6e88a[msd.mpd->lcd_no].hbm_reg.b6_reg);
	int i;

	mipi_samsung_disp_send_cmd(mfd, PANEL_MTP_ENABLE, false);

	/* read LDi ID */
	msd.mpd->manufacture_id = mipi_samsung_manufacture_id(mfd);
	// msd.mpd->cmd_set_change(PANEL_ON, msd.mpd->manufacture_id);

	/* smart dimming & AID*/
	psmart->plux_table = msd.mpd->lux_table;
	psmart->lux_table_max = msd.mpd->lux_table_max_cnt;
	psmart->ldi_revision = msd.mpd->manufacture_id;

	read_mtp(MTP_START_ADDR, 0, GAMMA_SET_MAX, mtp_buffer, mfd);

	/* LSI HBM */
	read_mtp(0xb5, 13-1, 16, mtp_buffer2, mfd); // read b5h 13~28th
	read_mtp(0xb6, 3-1, 12, mtp_buffer3, mfd); // read b6h 3~14th
	msd.mpd->smart_s6e88a[msd.mpd->lcd_no].hbm_reg.b5_reg_19 = mtp_buffer2[6]; // save b5h 19th

	i = 0;
#ifdef CONFIG_HBM_PSRE_DEBUG
	printk("[HBM] b5_reg : ");
	for(i=0; i<16; i++)
		printk("%x ",msd.mpd->smart_s6e88a[msd.mpd->lcd_no].hbm_reg.b5_reg[i]);
	pr_info("\n");
	printk("[HBM] b6_reg : ");
	for(i=0; i<12; i++)
		printk("%x ",msd.mpd->smart_s6e88a[msd.mpd->lcd_no].hbm_reg.b6_reg[i]);
	pr_info("\n");
	printk("[HBM] b5_19th_reg : ");
	printk("%x ",msd.mpd->smart_s6e88a[msd.mpd->lcd_no].hbm_reg.b5_reg_19);
#endif

	smart_dimming_init(&(msd.mpd->smart_s6e88a[msd.mpd->lcd_no]));

	pr_info("%s - [%d]\n", __func__, msd.mpd->lcd_no);
}
static void execute_panel_init(struct msm_fb_data_type *mfd)
{
	int i;
	struct SMART_DIM *psmart = &(msd.mpd->smart_se6e8fa);
	char *mtp_buffer = (char *)&(msd.mpd->smart_se6e8fa.MTP_ORIGN);
	char *mtp_buffer1 = (char *)&(msd.mpd->smart_se6e8fa.hbm_reg.c8_reg_1);
	/* LSI */
	char *mtp_buffer2 = (char *)&(msd.mpd->smart_se6e8fa.hbm_reg.c8_reg_2);
	char *mtp_buffer3 = (char *)&(msd.mpd->smart_se6e8fa.hbm_reg.b6_reg_lsi);
	char temp[4];
	char C8_reg[3];
	/* MAGNA */
	char *mtp_buffer4 = (char *)&(msd.mpd->smart_se6e8fa.hbm_reg.b1_reg);
	char *mtp_buffer5 = (char *)&(msd.mpd->smart_se6e8fa.hbm_reg.b6_reg_magna);

	mipi_samsung_disp_send_cmd(mfd, PANEL_MTP_ENABLE, false);

	/* read LDi ID */
	msd.mpd->manufacture_id = mipi_samsung_manufacture_id(mfd);
	msd.mpd->cmd_set_change(PANEL_ON, msd.mpd->manufacture_id);

	/* smart dimming & AID*/
	psmart->plux_table = msd.mpd->lux_table;
	psmart->lux_table_max = msd.mpd->lux_table_max_cnt;
	psmart->ldi_revision = msd.mpd->manufacture_id;

	read_mtp(MTP_START_ADDR, 0, GAMMA_SET_MAX, mtp_buffer, mfd);

	if (get_ldi_chip() == LDI_LSI) {
		pr_info("#### LSI panel!!\n");
		if (msd.mpd->ldi_rev == 'H') {
			read_mtp(0xCB, 0, ARRAY_SIZE(C8_reg), C8_reg, mfd); // hover_flicker..
			msd.mpd->hover_flicker_change(C8_reg[2]);
		}
		read_mtp(MTP_START_ADDR, 34-1, 7, mtp_buffer1, mfd); // read C8h 34~40th
		if (msd.mpd->ldi_rev == 'I')
			read_mtp(MTP_START_ADDR, 73-1, 15, mtp_buffer2, mfd); // read C8h 73~87th
		else
			read_mtp(0xb6, 17-1, 1, mtp_buffer3, mfd); // recover original's ELVSS offset b6's 17th
	} else if (get_ldi_chip() == LDI_MAGNA) {
		pr_info("#### MAGNA panel!!\n");
		read_mtp(0xB1, 10-1, 6, mtp_buffer4, mfd); // read B1h 10~18th
		read_mtp(0xB6, 4-1, 23, mtp_buffer5, mfd); // read B6h 4~26th
	}

	i = 0;
#ifdef CONFIG_HBM_PSRE_DEBUG
	pr_info("%s c8[34~40](%x)(%x)(%x)(%x)(%x)(%x)(%x)", __func__,
		msd.mpd->smart_se6e8fa.hbm_reg.c8_reg_1[0],
		msd.mpd->smart_se6e8fa.hbm_reg.c8_reg_1[1], 
		msd.mpd->smart_se6e8fa.hbm_reg.c8_reg_1[2],
		msd.mpd->smart_se6e8fa.hbm_reg.c8_reg_1[3], 
		msd.mpd->smart_se6e8fa.hbm_reg.c8_reg_1[4],
		msd.mpd->smart_se6e8fa.hbm_reg.c8_reg_1[5],
		msd.mpd->smart_se6e8fa.hbm_reg.c8_reg_1[6]);
	pr_info("\n");

	printk("c8_reg_1 : ");
	for(i=0; i<7; i++)
		printk("%x ",msd.mpd->smart_se6e8fa.hbm_reg.c8_reg_1[i]);
	pr_info("\n");

	if (msd.mpd->ldi_rev == 'I') {
		printk("c8_reg_2 : ");
		for(i=0; i<15; i++)
			printk("%x ",msd.mpd->smart_se6e8fa.hbm_reg.c8_reg_2[i]);
		pr_info("\n");
	} else
		printk("b6_reg : %x \n",msd.mpd->smart_se6e8fa.hbm_reg.b6_reg[0]);

#endif

#if defined(CONFIG_MDNIE_LITE_TUNING)
	read_mtp(LDI_COORDINATE_REG, 0,  ARRAY_SIZE(temp), temp, mfd);
	msd.mpd->coordinate[0] =  temp[0] << 8 | temp[1];	/* X */
	msd.mpd->coordinate[1] = temp[2] << 8 | temp[3];	/* Y */
	coordinate_tunning(msd.mpd->coordinate[0], msd.mpd->coordinate[1]);
#endif

	/* TO set default temperature value 25 degree*/
	msd.mpd->temperature_value = 25;

	mipi_samsung_disp_send_cmd(mfd, PANEL_MTP_DISABLE, false);
	smart_dimming_init(&(msd.mpd->smart_se6e8fa));

}
static int mipi_samsung_disp_on(struct platform_device *pdev)
{
	struct msm_fb_data_type *mfd;
	struct mipi_panel_info *mipi;
#if defined(CONFIG_FB_MSM_MIPI_SAMSUNG_OLED_VIDEO_HD_PT) \
	|| defined(CONFIG_FB_MSM_MIPI_SAMSUNG_OLED_VIDEO_WVGA_PT) \
	|| defined(CONFIG_FB_MSM_MIPI_MAGNA_OLED_VIDEO_WVGA_PT)
	static int boot_on;
#endif

	mfd = platform_get_drvdata(pdev);
	if (unlikely(!mfd))
		return -ENODEV;
	if (unlikely(mfd->key != MFD_KEY))
		return -EINVAL;

	mipi = &mfd->panel_info.mipi;

#if defined(CONFIG_FB_MSM_MIPI_SAMSUNG_OLED_CMD_QHD_PT)
	mipi_samsung_disp_send_cmd(mfd, MTP_READ_ENABLE, false);
#endif

#if defined(CONFIG_FB_MSM_MIPI_SAMSUNG_OLED_VIDEO_WVGA_PT) \
	|| defined(CONFIG_FB_MSM_MIPI_MAGNA_OLED_VIDEO_WVGA_PT)
	if (boot_on == 0)
		mipi_samsung_disp_send_cmd(mfd, MTP_READ_ENABLE, false);
#endif

#ifdef USE_READ_ID
#if defined(CONFIG_FB_MSM_MIPI_SAMSUNG_OLED_VIDEO_WVGA_PT) \
	|| defined(CONFIG_FB_MSM_MIPI_MAGNA_OLED_VIDEO_WVGA_PT)
	if (boot_on == 0)
		msd.mpd->manufacture_id = mipi_samsung_manufacture_id(mfd);
#elif defined(CONFIG_FB_MSM_MIPI_SAMSUNG_OLED_CMD_QHD_PT)
	msd.mpd->manufacture_id = mipi_samsung_manufacture_id(mfd);
#elif defined(CONFIG_FB_MSM_MIPI_SAMSUNG_OLED_VIDEO_HD_PT)
	if (!samsung_has_cmc624())
		msd.mpd->manufacture_id = mipi_samsung_manufacture_id(mfd);
	else
		msd.mpd->manufacture_id = LCD_Get_Value();
#endif
#endif

#if defined(CONFIG_FB_MSM_MIPI_SAMSUNG_OLED_CMD_QHD_PT)
	if (!msd.dstat.is_elvss_loaded) {
		read_reg(ELVSS_REGISTER, ELVSS_DATA_SIZE,
			msd.mpd->lcd_elvss_data,
				 FALSE, mfd);  /* read ELVSS data */
		msd.dstat.is_elvss_loaded = true;
	}


	if (!msd.dstat.is_smart_dim_loaded) {
		/* Load MTP Data */
		int i;
		read_reg(MTP_REGISTER, MTP_DATA_SIZE,
				(u8 *)&(msd.mpd->smart_s6e39a0x02.MTP),
						FALSE, mfd);
		for (i = 0; i < MTP_DATA_SIZE; i++) {
			pr_info("%s MTP DATA[%d] : %02x\n", __func__, i,
			((char *)&(msd.mpd->smart_s6e39a0x02.MTP))[i]);
		}

		smart_dimming_init(&(msd.mpd->smart_s6e39a0x02));
#ifdef READ_MTP_ONCE
		msd.dstat.is_smart_dim_loaded = true;
#else
		msd.dstat.is_smart_dim_loaded = false;
#endif
		msd.dstat.gamma_mode = GAMMA_SMART;
	}
#endif
#if defined(CONFIG_FB_MSM_MIPI_SAMSUNG_OLED_VIDEO_HD_PT)
	if (!msd.dstat.is_elvss_loaded) {
		if (!samsung_has_cmc624())
			msd.mpd->lcd_elvss_data[0] = elvss_value;
		else
			msd.mpd->lcd_elvss_data[0] = LCD_ID3();

		msd.dstat.is_elvss_loaded = true;
	}

	if (!msd.dstat.is_smart_dim_loaded) {
		/*Load MTP Data*/
		char pBuffer[256] = {0,};
		int i;
		struct SMART_DIM *psmart;
		char *mtp_data;
		int mtp_cnt;

		psmart = &(msd.mpd->smart_s6e8aa0x01);
		mtp_data = (char *)&(msd.mpd->smart_s6e8aa0x01.MTP);

		if (samsung_has_cmc624()) {
			memcpy(mtp_data, mtp_read_data, GAMMA_SET_MAX);
			pr_info("%s This board support CMC", __func__);
		} else {
			mtp_cnt = find_mtp(mfd, mtp_data);
			pr_info("%s MTP is determined : %d", __func__, mtp_cnt);
		}


		for (i = 0; i < MTP_DATA_SIZE; i++)
			snprintf(pBuffer + strnlen(pBuffer, 256), 256, " %02x",
				mtp_data[i]);
		pr_info("MTP: %s", pBuffer);

		psmart->plux_table = msd.mpd->lux_table;
		psmart->lux_table_max = msd.mpd->lux_table_max_cnt;

		if (samsung_has_cmc624())
			psmart->ldi_revision = LCD_Get_Value();
		else
			psmart->ldi_revision = bypass_LCD_Id();

		smart_dimming_init(psmart);

		msd.dstat.is_smart_dim_loaded = true;
		msd.dstat.gamma_mode = GAMMA_SMART;
	}

	if (msd.mpd->gamma_initial && boot_on == 0) {
		msd.mpd->smart_s6e8aa0x01.brightness_level = 180;
		generate_gamma(&msd.mpd->smart_s6e8aa0x01,
			&(msd.mpd->gamma_initial[2]), GAMMA_SET_MAX);

		if (recovery_boot_mode == 0)
			boot_on = 1;
	} else {
		get_min_lux_table(&(msd.mpd->gamma_initial[2]),
					GAMMA_SET_MAX);
		reset_gamma_level();
	}
#endif

#if defined(CONFIG_FB_MSM_MIPI_SAMSUNG_OLED_VIDEO_WVGA_PT)
	if (!msd.dstat.is_smart_dim_loaded) {
		/* Load MTP Data */
		int i, mtp_cnt, err_cnt;
		char *mtp_data = (char *)&(msd.mpd->smart_s6e63m0.MTP);

		for (err_cnt = 0; err_cnt < 10; err_cnt++) {
			mtp_cnt = find_mtp(mfd, mtp_data);

			if (mtp_cnt != 0)
				break;
		}

		pr_info("%s MTP is determined:%d err_cnt:%d",
					__func__, mtp_cnt, err_cnt);

		for (i = 0; i < MTP_DATA_SIZE_S6E63M0; i++) {
			pr_info("%s MTP DATA[%d] : %02x\n", __func__, i,
				mtp_data[i]);
		}

		smart_dimming_init(&(msd.mpd->smart_s6e63m0));

		msd.dstat.is_smart_dim_loaded = true;
		msd.dstat.gamma_mode = GAMMA_SMART;
	}

	if (msd.mpd->gamma_initial && boot_on == 0) {
		msd.mpd->smart_s6e63m0.brightness_level = 140;
		generate_gamma(&msd.mpd->smart_s6e63m0,
			&(msd.mpd->gamma_initial[2]), GAMMA_SET_MAX);

		if (recovery_boot_mode == 0)
			boot_on = 1;

	} else {
		msd.mpd->smart_s6e63m0.brightness_level = 30;
		generate_gamma(&msd.mpd->smart_s6e63m0,
			&(msd.mpd->gamma_initial[2]), GAMMA_SET_MAX);
		reset_gamma_level();
	}
#endif

#if defined(CONFIG_FB_MSM_MIPI_MAGNA_OLED_VIDEO_WVGA_PT)
	if (!msd.dstat.is_smart_dim_loaded) {
		/* Load MTP Data */
		int i, mtp_cnt, err_cnt;
		char *mtp_data = (char *)&(msd.mpd->smart_ea8868.MTP);

		if (bypass_lcd_id == 0x4a) {
			for (err_cnt = 0; err_cnt < 10; err_cnt++) {
				mtp_cnt = find_mtp(mfd, mtp_data);

				if (mtp_cnt != 0)
					break;
			}

			pr_info("%s MTP is determined:%d err_cnt:%d",
						__func__, mtp_cnt, err_cnt);

			for (i = 0; i < MTP_DATA_SIZE_EA8868; i++) {
				pr_info("%s MTP DATA[%d] : %02x\n",
						__func__, i, mtp_data[i]);
			}
		} else {
			pr_info("%s MTP is not used LDI_ID: 0x%x",
						__func__, bypass_lcd_id);
			memset(mtp_data, 0x0, MTP_DATA_SIZE_EA8868);
		}

		smart_dimming_init(&(msd.mpd->smart_ea8868));

		msd.dstat.is_smart_dim_loaded = true;
		msd.dstat.gamma_mode = GAMMA_SMART;
	}

	if (msd.mpd->gamma_initial && boot_on == 0) {
		msd.mpd->smart_ea8868.brightness_level = 180;
		generate_gamma(&msd.mpd->smart_ea8868,
			&(msd.mpd->gamma_initial[1]), GAMMA_SET_MAX);

		if (recovery_boot_mode == 0)
			boot_on = 1;
	} else {
		msd.mpd->smart_ea8868.brightness_level = get_gamma_lux();
		generate_gamma(&msd.mpd->smart_ea8868,
			&(msd.mpd->gamma_initial[1]), GAMMA_SET_MAX);
		reset_gamma_level();
	}
#endif

	if (unlikely(first_on)) {
		first_on = false;
		return 0;
	}

	mipi_samsung_disp_send_cmd(mfd, PANEL_READY_TO_ON, false);
	if (mipi->mode == DSI_VIDEO_MODE)
		mipi_samsung_disp_send_cmd(mfd, PANEL_ON, false);

#if !defined(CONFIG_HAS_EARLYSUSPEND)
	mipi_samsung_disp_send_cmd(mfd, PANEL_LATE_ON, false);
#endif
#if defined(CONFIG_MIPI_SAMSUNG_ESD_REFRESH)
#if defined(CONFIG_MACH_JAGUAR)
	if  (system_rev >= 16)
		set_esd_enable();
	if (msd.esd_refresh == true)
		mipi_samsung_disp_send_cmd(mfd, PANEL_LATE_ON, false);
#else
	set_esd_enable();
#endif
#endif

#ifdef READ_REGISTER_ESD
	queue_delayed_work(msd.mpd->esd_workqueue,
				&(msd.mpd->esd_work), ESD_INTERVAL * HZ);
	wake_lock(&(msd.mpd->esd_wake_lock));
#endif

	return 0;
}
static int mipi_samsung_disp_on(struct platform_device *pdev)
{
	struct msm_fb_data_type *mfd;
	struct mipi_panel_info *mipi;
	static int boot_on;

#ifdef __DEBUG__
	static int test=0 ;
#endif

	mfd = platform_get_drvdata(pdev);
	if (unlikely(!mfd))
		return -ENODEV;
	if (unlikely(mfd->key != MFD_KEY))
		return -EINVAL;

	mipi = &mfd->panel_info.mipi;

#ifdef USE_READ_ID
	if (unlikely(!boot_on)) {
		msd.mpd->manufacture_id = mipi_samsung_manufacture_id(mfd);
		/*Display was initialized in bootloader,same settings
			are carried when splash is enabled*/
		}
#endif

#if defined(CONFIG_FB_MDP4_ENHANCE)
	is_negativeMode_on();
#endif

#ifdef __DEBUG__
	if(test==0)
        if(0)
	dumpreg(1);
		test++;
#endif		

	mipi_samsung_disp_send_cmd(mfd, PANEL_READY_TO_ON, false);

	if(!boot_on)
		boot_on = 1;
	else
		msleep(100);

#if defined(CONFIG_ESD_ERR_FG_RECOVERY)
	enable_irq(err_fg_gpio);
#endif

#ifndef CONFIG_MACH_CANE_EUR_3G
	pr_info("%s: DISP_BL_CONT_GPIO High\n", __func__);
	gpio_set_value(DISP_BL_CONT_GPIO, 1);
#endif	

#if !defined(CONFIG_HAS_EARLYSUSPEND)
	mipi_samsung_disp_send_cmd(mfd, PANEL_LATE_ON, false);
#endif

#if defined(CONFIG_MACH_CANE_EUR_3G)
	mfd->resume_state = MIPI_RESUME_STATE;
#endif

	return 0;
}