int mipi_lgit_lcd_on(struct platform_device *pdev)
{
	int cnt = 0;
	bool cabc_off_state = 1;
	struct msm_fb_data_type *mfd;

	if (check_stable_lcd_on)
		mipi_stable_lcd_on(pdev);

	mfd = platform_get_drvdata(pdev);
	if (!mfd)
		return -ENODEV;
	if (mfd->key != MFD_KEY)
		return -EINVAL;
#if defined(CONFIG_LGIT_COLOR_ENGINE_SWITCH)
	if(local_mfd0 == NULL)
		local_mfd0 = mfd;
#endif

	pr_info("%s:+ wuxga \n", __func__);

//                                                                                         
	//MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x10000000);     //HS mode

	cnt = mipi_dsi_cmds_tx(&lgit_tx_buf,
		mipi_lgit_pdata->power_on_set_1,
		mipi_lgit_pdata->power_on_set_size_1);
	if (cnt < 0)
		return cnt;


#if defined(CONFIG_LGE_BACKLIGHT_CABC)
	cabc_off_state = lgit_lcd_cabc_state();

	if (cabc_off_state == 1) {
		if ((mipi_lgit_pdata->power_on_set_3_noCABC != NULL) &&
			(mipi_lgit_pdata->power_on_set_size_3_noCABC > 0)) {
			cnt = mipi_dsi_cmds_tx(&lgit_tx_buf,
				mipi_lgit_pdata->power_on_set_3_noCABC,
				mipi_lgit_pdata->power_on_set_size_3_noCABC);

			if (cnt < 0)
				return cnt;
			pr_info("%s: CABC OFF\n", __func__);
		}
	} else {
		if ((mipi_lgit_pdata->power_on_set_3 != NULL) &&
			(mipi_lgit_pdata->power_on_set_size_3 > 0)) {
			cnt = mipi_dsi_cmds_tx(&lgit_tx_buf,
				mipi_lgit_pdata->power_on_set_3,
				mipi_lgit_pdata->power_on_set_size_3);

			if (cnt < 0)
				return cnt;

			pr_info("%s: CABC ON\n", __func__);
		}
	}
#endif

	cnt = mipi_dsi_cmds_tx(&lgit_tx_buf,
	mipi_lgit_pdata->power_on_set_2,
	mipi_lgit_pdata->power_on_set_size_2);
	if (cnt < 0)
		return cnt;

	mipi_dsi_op_mode_config(DSI_VIDEO_MODE);
	mdp4_overlay_dsi_video_start();
	mdelay(120);
//                                                                                         

	pr_info("%s:- wuxga \n", __func__);

	return cnt;
}
Exemplo n.º 2
0
int mipi_lgit_lcd_on(struct platform_device *pdev)
{
	int cnt = 0;
	bool cabc_off_state = 1;
	struct msm_fb_data_type *mfd;

	if (check_stable_lcd_on)
		mipi_stable_lcd_on(pdev);

	mfd = platform_get_drvdata(pdev);
	if (!mfd)
		return -ENODEV;
	if (mfd->key != MFD_KEY)
		return -EINVAL;
#if defined(CONFIG_LGIT_COLOR_ENGINE_SWITCH)
	if(local_mfd0 == NULL)
		local_mfd0 = mfd;
#endif

	printk(KERN_INFO "[LCD][DEBUG] %s is started \n", __func__);

//LGE_UPDATE_S [email protected] : adding change mipi mode to write register setting of LCD IC
	//MIPI_OUTP(MIPI_DSI_BASE + 0x38, 0x10000000);     //HS mode

	cnt = mipi_dsi_cmds_tx(&lgit_tx_buf,
		mipi_lgit_pdata->power_on_set_1,
		mipi_lgit_pdata->power_on_set_size_1);
	if (cnt < 0)
		return cnt;


#if defined(CONFIG_LGE_BACKLIGHT_CABC)
	cabc_off_state = lgit_lcd_cabc_state();

	if (cabc_off_state == 1) {
		if ((mipi_lgit_pdata->power_on_set_3_noCABC != NULL) &&
			(mipi_lgit_pdata->power_on_set_size_3_noCABC > 0)) {
			cnt = mipi_dsi_cmds_tx(&lgit_tx_buf,
				mipi_lgit_pdata->power_on_set_3_noCABC,
				mipi_lgit_pdata->power_on_set_size_3_noCABC);

			if (cnt < 0)
				return cnt;
			printk(KERN_INFO "[LCD][DEBUG] %s : CABC OFF\n", __func__);
		}
	} else {
		if ((mipi_lgit_pdata->power_on_set_3 != NULL) &&
			(mipi_lgit_pdata->power_on_set_size_3 > 0)) {
			cnt = mipi_dsi_cmds_tx(&lgit_tx_buf,
				mipi_lgit_pdata->power_on_set_3,
				mipi_lgit_pdata->power_on_set_size_3);

			if (cnt < 0)
				return cnt;

			printk(KERN_INFO "[LCD][DEBUG] %s : CABC ON\n", __func__);
		}
	}
#endif

	cnt = mipi_dsi_cmds_tx(&lgit_tx_buf,
	mipi_lgit_pdata->power_on_set_2,
	mipi_lgit_pdata->power_on_set_size_2);
	if (cnt < 0)
		return cnt;

	mipi_dsi_op_mode_config(DSI_VIDEO_MODE);
	mdp4_overlay_dsi_video_start();
	mdelay(120);
//LGE_UPDATE_E [email protected] : adding change mipi mode to write register setting of LCD IC

	printk(KERN_INFO "[LCD][DEBUG] %s is ended \n", __func__);

	return cnt;
}