static int mdss_dsi_panel_on(struct mdss_panel_data *pdata)
{
	struct mipi_panel_info *mipi;
	struct mdss_dsi_ctrl_pdata *ctrl = NULL;
	static int first_boot=1;

	if (pdata == NULL) {
		pr_err("%s: Invalid input data\n", __func__);
		return -EINVAL;
	}

	ctrl = container_of(pdata, struct mdss_dsi_ctrl_pdata,
				panel_data);

	mipi  = &pdata->panel_info.mipi;

	pr_info("%s: ctrl index=%d ++ \n", __func__, ctrl->ndx);



	if (ctrl->ndx == DSI_CTRL_1) {
		if (ctrl->on_cmds.cmd_cnt) {
			mdss_dsi_panel_cmds_send(ctrl, &ctrl->on_cmds);
		}
		panel_power_state = 1;

		if(bl_backup)
			mdss_dsi_panel_bl_ctrl(pdata, bl_backup);

		pwm_backlight_enable();

		if(first_boot) {
			pr_info("%s: first backlight set to 150 level \n",
				__func__);
			mdss_dsi_panel_bl_ctrl(pdata, 150);
			first_boot=0;
		}
		if (msd.dstat.recovery_boot_mode) {
			pr_info("%s: Recovery Mode backlight set to 180 level \n",
				__func__);
			msd.dstat.bright_level = RECOVERY_BRIGHTNESS;
			mdss_dsi_panel_bl_ctrl(pdata, RECOVERY_BRIGHTNESS);
		} else {
#if defined(CONFIG_CABC_TUNING)
			CABC_Set_Mode();
#endif
		}
	}

	pr_info("%s: ctrl index=%d -- \n", __func__, ctrl->ndx);

	return 0;
}
static void err_fg_work_func(struct work_struct *work)
{
	int bl_backup;
	struct mdss_panel_data *pdata = msd.mpd;
	struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL;

	if(msd.mfd == NULL){
		pr_err("%s: mfd not initialized Skip ESD recovery\n", __func__);
		return;
	}
	if(pdata == NULL){
		pr_err("%s: pdata not available... skipping update\n", __func__);
		return;
	}
	bl_backup=msd.mfd->bl_level;
	if( msd.mfd->panel_power_on == false){
		pr_err("%s: Display off Skip ESD recovery\n", __func__);
		return;
	}
	ctrl_pdata = container_of(pdata, struct mdss_dsi_ctrl_pdata,
						panel_data);

	printk("%s : start", __func__);
	err_fg_working = 1;
	gpio_direction_output(ctrl_pdata->bklt_ctrl, 0);
	msd.mfd->fbi->fbops->fb_blank(FB_BLANK_POWERDOWN, msd.mfd->fbi);
	msd.mfd->fbi->fbops->fb_blank(FB_BLANK_UNBLANK, msd.mfd->fbi);
	esd_count++;
	err_fg_working = 0;
	msd.mfd->bl_level=bl_backup;
	mdss_dsi_panel_bl_ctrl(pdata,msd.mfd->bl_level);
	printk("%s : end", __func__);
	return;
}