Esempio n. 1
0
static int mipi_hx8369b_lcd_off(struct platform_device *pdev)
{
	struct msm_fb_data_type *mfd;

	DPRINT("%s +\n", __func__);

	mfd = platform_get_drvdata(pdev);

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

	backlight_ic_set_brightness(0);
	gpio_set_value(GPIO_PWM_CTRL, 0);
	
	is_lcd_on = 0;
	
	mipi_dsi_cmds_tx(&hx8369b_tx_buf, hx8369b_disp_off_cmds,
			ARRAY_SIZE(hx8369b_disp_off_cmds));

	mipi_dsi_cmds_tx(&hx8369b_tx_buf, hx8369b_sleep_in_cmds,
			ARRAY_SIZE(hx8369b_sleep_in_cmds));

#ifdef CONFIG_PANEL_ESD_DETECT
	esd_det_irq_disable();
#endif

	DPRINT("%s -\n", __func__);
	return 0;
}
Esempio n. 2
0
static void mipi_nt35510_set_backlight(struct msm_fb_data_type *mfd)
{
	int level = mfd->bl_level;

	/* function will spin lock */
	backlight_ic_set_brightness(level);
}
Esempio n. 3
0
static void mipi_hx8369b_set_backlight(struct msm_fb_data_type *mfd)
{
	int level = mfd->bl_level;

	pr_info("BL : %d, lcd_on : %d\n", level, is_lcd_on);

	if(!is_lcd_on)
		return;
        /* function will spin lock */
	backlight_ic_set_brightness(level);
}
static int mipi_hx8369b_lcd_off(struct platform_device *pdev)
{
	struct msm_fb_data_type *mfd;

	DPRINT("%s +\n", __func__);

	mfd = platform_get_drvdata(pdev);

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

	backlight_ic_set_brightness(0);
	
	is_lcd_on = 0;
	
	mipi_dsi_cmds_tx(&hx8369b_tx_buf, hx8369b_display_off_cmds, ARRAY_SIZE(hx8369b_display_off_cmds));

	DPRINT("%s -\n", __func__);
	return 0;
}
Esempio n. 5
0
static int mipi_hx8369b_lcd_on(struct platform_device *pdev)
{
	struct msm_fb_data_type *mfd;
	struct mipi_panel_info *mipi;
	int ret = 0;

#ifdef CONFIG_PANEL_ESD_DETECT
	esd_det_init_wait(6);
#endif

	DPRINT("%s +\n", __func__);

	mfd = platform_get_drvdata(pdev);
	if (!mfd)
		return -ENODEV;

	if (mfd->key != MFD_KEY)
		return -EINVAL;

	mipi  = &mfd->panel_info.mipi;

	if(is_lcd_on)
		backlight_ic_set_brightness(0);

//	hx8369b_lcd_set_temperature();

	mutex_lock(&lcdc_mlock);

	if (mipi->mode == DSI_VIDEO_MODE) {
		ret  = mipi_dsi_cmds_tx(&hx8369b_tx_buf, BAFFIN_hx8369b_video_display_init_rev1_cmds, ARRAY_SIZE(BAFFIN_hx8369b_video_display_init_rev1_cmds));
                if(ret==0)
			goto MIPI_ERROR;
	}

#if defined(CONFIG_MDNIE_TUNING)
	if(tuning_enable && hx8369b_video_display_mDNIe_tune_cmds[0].dlen > 0) {
		ret = mipi_dsi_cmds_tx(&hx8369b_tx_buf,
			hx8369b_video_display_mDNIe_tune_cmds,
			ARRAY_SIZE(hx8369b_video_display_mDNIe_tune_cmds));
                        if(ret==0)
			        goto MIPI_ERROR;
                 }
#endif

#if defined(CONFIG_APPLY_MDNIE)
  DPRINT("%s [mDNIe] negative=%d\n", __func__, mDNIe_cfg.negative);
	if(mDNIe_cfg.negative) {
		ret = mipi_dsi_cmds_tx(&hx8369b_tx_buf,
			hx8369b_video_display_mDNIe_scenario_cmds[SCENARIO_MAX],
			ARRAY_SIZE(hx8369b_video_display_mDNIe_scenario_cmds[SCENARIO_MAX]));
		mDNIe_cfg.curIndex = SCENARIO_MAX;
		if(ret==0)
			goto MIPI_ERROR;
	} else {
		ret = mipi_dsi_cmds_tx(&hx8369b_tx_buf,
			hx8369b_video_display_mDNIe_scenario_cmds[0],
			ARRAY_SIZE(hx8369b_video_display_mDNIe_scenario_cmds[0]));
		mDNIe_cfg.curIndex = UI_MODE;
		if(ret==0)
			goto MIPI_ERROR;
	}
#endif

	is_lcd_on = 1;		
	mutex_unlock(&lcdc_mlock);

	backlight_ic_set_brightness(mfd->bl_level);

#ifdef CONFIG_PANEL_ESD_DETECT
	esd_det_irq_enable();
#endif
	DPRINT("%s -\n", __func__);
	return ret;

MIPI_ERROR:
	mutex_unlock(&lcdc_mlock);
	DPRINT("%s MIPI_ERROR -\n", __func__);
	return ret;
}
static int mipi_hx8369b_lcd_on(struct platform_device *pdev)
{
	struct msm_fb_data_type *mfd;
	struct mipi_panel_info *mipi;
	int ret = 0;

	DPRINT("%s +\n", __func__);

	mfd = platform_get_drvdata(pdev);
	if (!mfd)
		return -ENODEV;

	if (mfd->key != MFD_KEY)
		return -EINVAL;

	mipi  = &mfd->panel_info.mipi;

	DPRINT("Setting +\n");
	
	ret  = mipi_dsi_cmds_tx(&hx8369b_tx_buf, hx8369b_video_display_init_boe_cmds, ARRAY_SIZE(hx8369b_video_display_init_boe_cmds));
	if(ret==0)
		goto MIPI_ERROR;

#if defined(CONFIG_APPLY_MDNIE)
	if(mDNIe_cfg.negative) {
		ret = mipi_dsi_cmds_tx(&hx8369b_tx_buf,
			hx8369b_video_display_mDNIe_scenario_cmds[SCENARIO_MAX],
			ARRAY_SIZE(hx8369b_video_display_mDNIe_scenario_cmds[SCENARIO_MAX]));
		mDNIe_cfg.curIndex = SCENARIO_MAX;
		if(ret==0)
			goto MIPI_ERROR;
	} else {
		ret = mipi_dsi_cmds_tx(&hx8369b_tx_buf,
			hx8369b_video_display_mDNIe_scenario_cmds[0],
			ARRAY_SIZE(hx8369b_video_display_mDNIe_scenario_cmds[0]));
		mDNIe_cfg.curIndex = UI_MODE;
		if(ret==0)
			goto MIPI_ERROR;
	}
#endif

#if defined(CONFIG_MDNIE_TUNING)
	if(tuning_enable && hx8369b_video_display_mDNIe_tune_cmds[0].dlen > 0) {
		ret  = mipi_dsi_cmds_tx(&hx8369b_tx_buf,
			hx8369b_video_display_mDNIe_tune_cmds,
			ARRAY_SIZE(hx8369b_video_display_mDNIe_tune_cmds));
		if(ret==0)
			goto MIPI_ERROR;
	}
#endif
		
	ret = mipi_dsi_cmds_tx(&hx8369b_tx_buf, hx8369b_video_display_on_cmds, ARRAY_SIZE(hx8369b_video_display_on_cmds));
	if(ret==0)
		goto MIPI_ERROR;

	DPRINT("Setting -\n");

	is_lcd_on = 1;

	backlight_ic_set_brightness(mfd->bl_level);

	DPRINT("%s -\n", __func__);
	return ret;

MIPI_ERROR:
	DPRINT("%s MIPI_ERROR -\n", __func__);
	return ret;
}