void is_negative_on(void)
{
	DPRINT("is negative Mode On = %d\n", mdnie_tun_state.negative);

	if (mdnie_tun_state.negative) {
		DPRINT("mDNIe_Set_Negative = %d\n", mdnie_tun_state.negative);
		DPRINT(" = NEGATIVE MODE =\n");

		INPUT_PAYLOAD1(NEGATIVE_1);
		INPUT_PAYLOAD2(NEGATIVE_2);
		INPUT_PAYLOAD3(NEGATIVE_3);
		INPUT_PAYLOAD4(NEGATIVE_4);
		INPUT_PAYLOAD5(NEGATIVE_5);

		sending_tuning_cmd();
		free_tun_cmd();
	} else {
		/* check the mode and tuning again when wake up*/
		DPRINT("negative off when resume, tuning again!\n");
		mDNIe_Set_Mode(mdnie_tun_state.scenario);
	}
}
void mDNIe_set_negative(enum Lcd_mDNIe_Negative negative)
{
	DPRINT("mDNIe_Set_Negative state:%d\n",negative);
	if (negative == 0) {
		DPRINT("Negative mode(%d) -> reset mode(%d)\n",
			mdnie_tun_state.negative, mdnie_tun_state.scenario);
		mDNIe_Set_Mode(mdnie_tun_state.scenario);

	} else {

		DPRINT("mDNIe_Set_Negative = %d\n", mdnie_tun_state.negative);
		DPRINT(" = NEGATIVE MODE =\n");

		INPUT_PAYLOAD1(NEGATIVE_1);
		INPUT_PAYLOAD2(NEGATIVE_2);
		INPUT_PAYLOAD3(NEGATIVE_3);
		INPUT_PAYLOAD4(NEGATIVE_4);
		INPUT_PAYLOAD5(NEGATIVE_5);

		sending_tuning_cmd();
		free_tun_cmd();
	}
}
Exemplo n.º 3
0
void mDNIe_Set_Mode(enum Lcd_mDNIe_UI mode)
{
	struct msm_fb_data_type *mfd;
	mfd = mdnie_msd->mfd;

	DPRINT("mDNIe_Set_Mode start , mode(%d), background(%d)\n",
		mode, mdnie_tun_state.background);


	if (get_lcd_attached() == 0)
	{
		printk("%s: LCD not connected!\n",__func__);
		return;
	}


	if (mfd->resume_state == MIPI_SUSPEND_STATE) {
		DPRINT("[ERROR] not ST_DSI_RESUME. do not send mipi cmd.\n");
		return;
	}
	if (!mdnie_tun_state.mdnie_enable) {
		DPRINT("[ERROR] mDNIE engine is OFF.\n");
		return;
	}

	if (mode < mDNIe_UI_MODE || mode >= MAX_mDNIe_MODE) {
		DPRINT("[ERROR] wrong Scenario mode value : %d\n",
			mode);
		return;
	}

	if (mdnie_tun_state.negative) {
		DPRINT("already negative mode(%d), do not set background(%d)\n",
			mdnie_tun_state.negative, mdnie_tun_state.background);
		return;
	}

	play_speed_1_5 = 0;

	/*
	*	Blind mode & Screen mode has separated menu.
	*	To make a sync below code added.
	*	Bline mode has priority than Screen mode
	*/
	if (mdnie_tun_state.blind == COLOR_BLIND)
		mode = mDNIE_BLINE_MODE;

	switch (mode) {
#if defined (CONFIG_FB_MSM_MDSS_SDC_WXGA_PANEL)
	case mDNIe_UI_MODE:
		DPRINT(" = UI MODE =\n");
		INPUT_PAYLOAD1(UI_1);
		INPUT_PAYLOAD2(UI_2);
		INPUT_PAYLOAD3(UI_3);
		INPUT_PAYLOAD4(UI_4);
		INPUT_PAYLOAD5(UI_5);
		INPUT_PAYLOAD6(UI_6);
		break;

	case mDNIe_VIDEO_MODE:
		DPRINT(" = VIDEO MODE =\n");
		INPUT_PAYLOAD1(VIDEO_1);
		INPUT_PAYLOAD2(VIDEO_2);
		INPUT_PAYLOAD3(VIDEO_3);
		INPUT_PAYLOAD4(VIDEO_4);
		INPUT_PAYLOAD5(VIDEO_5);
		INPUT_PAYLOAD6(VIDEO_6);
		break;

	case mDNIe_VIDEO_WARM_MODE:
		DPRINT(" = VIDEO WARM MODE =\n");
		DPRINT("no data for WARM MODE..\n");
		break;

	case mDNIe_VIDEO_COLD_MODE:
		DPRINT(" = VIDEO COLD MODE =\n");
		DPRINT("no data for COLD MODE..\n");
		break;

	case mDNIe_CAMERA_MODE:
		DPRINT(" = CAMERA MODE =\n");
		INPUT_PAYLOAD1(CAMERA_1);
		INPUT_PAYLOAD2(CAMERA_2);
		INPUT_PAYLOAD3(CAMERA_3);
		INPUT_PAYLOAD4(CAMERA_4);
		INPUT_PAYLOAD5(CAMERA_5);
		INPUT_PAYLOAD6(CAMERA_6);
		break;

	case mDNIe_NAVI:
		DPRINT(" = NAVI MODE =\n");
		DPRINT("no data for NAVI MODE..\n");
		break;

	case mDNIe_GALLERY:
		DPRINT(" = GALLERY MODE =\n");
		INPUT_PAYLOAD1(GALLERY_1);
		INPUT_PAYLOAD2(GALLERY_2);
		INPUT_PAYLOAD3(GALLERY_3);
		INPUT_PAYLOAD4(GALLERY_4);
		INPUT_PAYLOAD5(GALLERY_5);
		INPUT_PAYLOAD6(GALLERY_6);
		break;

	case mDNIe_VT_MODE:
		DPRINT(" = VT MODE =\n");
		INPUT_PAYLOAD1(VT_1);
		INPUT_PAYLOAD2(VT_2);
		INPUT_PAYLOAD3(VT_3);
		INPUT_PAYLOAD4(VT_4);
		INPUT_PAYLOAD5(VT_5);
		INPUT_PAYLOAD6(VT_6);
		break;

#if defined(CONFIG_TDMB)
	case mDNIe_DMB_MODE:
		DPRINT(" = DMB MODE =\n");
		DPRINT("no data for DMB MODE..\n");
		break;

	case mDNIe_DMB_WARM_MODE:
		DPRINT(" = DMB WARM MODE =\n");
		DPRINT("no data for DMB  WARM MODE..\n");
		break;

	case mDNIe_DMB_COLD_MODE:
		DPRINT(" = DMB COLD MODE =\n");
		DPRINT("no data for DMB COLD MODE..\n");
		break;
#endif

	case mDNIe_BROWSER_MODE:
		DPRINT(" = BROWSER MODE =\n");
		INPUT_PAYLOAD1(BROWSER_1);
		INPUT_PAYLOAD2(BROWSER_2);
		INPUT_PAYLOAD3(BROWSER_3);
		INPUT_PAYLOAD4(BROWSER_4);
		INPUT_PAYLOAD5(BROWSER_5);
		INPUT_PAYLOAD6(BROWSER_6);
		break;

	case mDNIe_eBOOK_MODE:
		DPRINT(" = eBOOK MODE =\n");
		INPUT_PAYLOAD1(eBOOK_1);
		INPUT_PAYLOAD2(eBOOK_2);
		INPUT_PAYLOAD3(eBOOK_3);
		INPUT_PAYLOAD4(eBOOK_4);
		INPUT_PAYLOAD5(eBOOK_5);
		INPUT_PAYLOAD6(eBOOK_6);
		break;

	case mDNIe_EMAIL_MODE:
		DPRINT(" = EMAIL MODE =\n");
		INPUT_PAYLOAD1(eMAIL_1);
		INPUT_PAYLOAD2(eMAIL_2);
		INPUT_PAYLOAD3(eMAIL_3);
		INPUT_PAYLOAD4(eMAIL_4);
		INPUT_PAYLOAD5(eMAIL_5);
		INPUT_PAYLOAD6(eMAIL_6);
		break;

	case mDNIE_BLINE_MODE:
		DPRINT(" = BLIND MODE =\n");
		INPUT_PAYLOAD1(COLOR_BLIND_1);
		INPUT_PAYLOAD2(COLOR_BLIND_2);
		INPUT_PAYLOAD3(COLOR_BLIND_3);
		INPUT_PAYLOAD4(COLOR_BLIND_4);
		INPUT_PAYLOAD5(COLOR_BLIND_5);
		INPUT_PAYLOAD6(COLOR_BLIND_6);
		break;
#else
	case mDNIe_UI_MODE:
		DPRINT(" = UI MODE =\n");
		INPUT_PAYLOAD1(UI_1);
		INPUT_PAYLOAD2(UI_2);
		break;

	case mDNIe_VIDEO_MODE:
		DPRINT(" = VIDEO MODE =\n");
		INPUT_PAYLOAD1(VIDEO_1);
		INPUT_PAYLOAD2(VIDEO_2);
		break;

	case mDNIe_VIDEO_WARM_MODE:
		DPRINT(" = VIDEO WARM MODE =\n");
		DPRINT("no data for WARM MODE..\n");
		break;

	case mDNIe_VIDEO_COLD_MODE:
		DPRINT(" = VIDEO COLD MODE =\n");
		DPRINT("no data for COLD MODE..\n");
		break;

	case mDNIe_CAMERA_MODE:
		DPRINT(" = CAMERA MODE =\n");
		INPUT_PAYLOAD1(CAMERA_1);
		INPUT_PAYLOAD2(CAMERA_2);
		break;

	case mDNIe_NAVI:
		DPRINT(" = NAVI MODE =\n");
		DPRINT("no data for NAVI MODE..\n");
		break;

	case mDNIe_GALLERY:
		DPRINT(" = GALLERY MODE =\n");
		INPUT_PAYLOAD1(GALLERY_1);
		INPUT_PAYLOAD2(GALLERY_2);
		break;

	case mDNIe_VT_MODE:
		DPRINT(" = VT MODE =\n");
		INPUT_PAYLOAD1(VT_1);
		INPUT_PAYLOAD2(VT_2);
		break;

#if defined(CONFIG_TDMB)
	case mDNIe_DMB_MODE:
		DPRINT(" = DMB MODE =\n");
		INPUT_PAYLOAD1(TDMB_1);
		INPUT_PAYLOAD2(TDMB_2);
		break;

	case mDNIe_DMB_WARM_MODE:
		DPRINT(" = DMB WARM MODE =\n");
		DPRINT("no data for DMB  WARM MODE..\n");
		break;

	case mDNIe_DMB_COLD_MODE:
		DPRINT(" = DMB COLD MODE =\n");
		DPRINT("no data for DMB COLD MODE..\n");
		break;
#endif

	case mDNIe_BROWSER_MODE:
		DPRINT(" = BROWSER MODE =\n");
		INPUT_PAYLOAD1(BROWSER_1);
		INPUT_PAYLOAD2(BROWSER_2);
		break;

	case mDNIe_eBOOK_MODE:
		DPRINT(" = eBOOK MODE =\n");
		INPUT_PAYLOAD1(eBOOK_1);
		INPUT_PAYLOAD2(eBOOK_2);
		break;

	case mDNIe_EMAIL_MODE:
		DPRINT(" = EMAIL MODE =\n");
		INPUT_PAYLOAD1(eMAIL_1);
		INPUT_PAYLOAD2(eMAIL_2);
		break;

	case mDNIE_BLINE_MODE:
		DPRINT(" = BLIND MODE =\n");
		INPUT_PAYLOAD1(COLOR_BLIND_1);
		INPUT_PAYLOAD2(COLOR_BLIND_2);
		break;
#endif

	default:
		DPRINT("[%s] no option (%d)\n", __func__, mode);
		return;
	}
	sending_tuning_cmd();
	free_tun_cmd();

	DPRINT("mDNIe_Set_Mode end , mode(%d), background(%d)\n",
		mode, mdnie_tun_state.background);
}
void mDNIe_Set_Mode(enum Lcd_mDNIe_UI mode)
{
	struct msm_fb_data_type *mfd;
	mfd = mdnie_msd->mfd;

	DPRINT("mDNIe_Set_Mode start , mode(%d), background(%d)\n",
		mode, mdnie_tun_state.background);


	if (get_lcd_attached() == 0)
	{
		printk("%s: LCD not connected!\n",__func__);
		return;
	}


	if (mfd->resume_state == MIPI_SUSPEND_STATE) {
		DPRINT("[ERROR] not ST_DSI_RESUME. do not send mipi cmd.\n");
		return;
	}
	if (!mdnie_tun_state.mdnie_enable) {
		DPRINT("[ERROR] mDNIE engine is OFF.\n");
		return;
	}

	if (mode < mDNIe_UI_MODE || mode >= MAX_mDNIe_MODE) {
		DPRINT("[ERROR] wrong Scenario mode value : %d\n",
			mode);
		return;
	}

	if (mdnie_tun_state.negative) {
		DPRINT("already negative mode(%d), do not set background(%d)\n",
			mdnie_tun_state.negative, mdnie_tun_state.background);
		return;
	}

	play_speed_1_5 = 0;

	/*
	*	Blind mode & Screen mode has separated menu.
	*	To make a sync below code added.
	*	Bline mode has priority than Screen mode
	*/
	if (mdnie_tun_state.blind == COLOR_BLIND)
		mode = mDNIE_BLINE_MODE;

#if defined(CONFIG_SEC_RUBENS_PROJECT)
	if (mdnie_msd->dstat.auto_brightness >= 6) {
		if ((mdnie_tun_state.scenario == mDNIe_eBOOK_MODE) || (mdnie_tun_state.scenario == mDNIe_BROWSER_MODE))
			mode = mDNIE_OUTDOOR_MODE_FOR_TEXT;
		else
			mode = mDNIE_OUTDOOR_MODE;
	} else {
		if (mdnie_tun_state.blind == COLOR_BLIND)
			mode = mDNIE_BLINE_MODE;
		else
			mode = mdnie_tun_state.scenario;
	}
#endif
#if !defined(CONFIG_SEC_MATISSE_PROJECT) && !defined(CONFIG_MDP_NEGATIVE_SUPPORT)
	switch (mode) {
#if defined (CONFIG_FB_MSM_MDSS_SDC_WXGA_PANEL)
	case mDNIe_UI_MODE:
		DPRINT(" = UI MODE =\n");
		INPUT_PAYLOAD1(UI_1);
		INPUT_PAYLOAD2(UI_2);
		INPUT_PAYLOAD3(UI_3);
		INPUT_PAYLOAD4(UI_4);
		INPUT_PAYLOAD5(UI_5);
		INPUT_PAYLOAD6(UI_6);
		break;

	case mDNIe_VIDEO_MODE:
		DPRINT(" = VIDEO MODE =\n");
		INPUT_PAYLOAD1(VIDEO_1);
		INPUT_PAYLOAD2(VIDEO_2);
		INPUT_PAYLOAD3(VIDEO_3);
		INPUT_PAYLOAD4(VIDEO_4);
		INPUT_PAYLOAD5(VIDEO_5);
		INPUT_PAYLOAD6(VIDEO_6);
		break;

	case mDNIe_VIDEO_WARM_MODE:
		DPRINT(" = VIDEO WARM MODE =\n");
		DPRINT("no data for WARM MODE..\n");
		break;

	case mDNIe_VIDEO_COLD_MODE:
		DPRINT(" = VIDEO COLD MODE =\n");
		DPRINT("no data for COLD MODE..\n");
		break;

	case mDNIe_CAMERA_MODE:
		DPRINT(" = CAMERA MODE =\n");
		INPUT_PAYLOAD1(CAMERA_1);
		INPUT_PAYLOAD2(CAMERA_2);
		INPUT_PAYLOAD3(CAMERA_3);
		INPUT_PAYLOAD4(CAMERA_4);
		INPUT_PAYLOAD5(CAMERA_5);
		INPUT_PAYLOAD6(CAMERA_6);
		break;

	case mDNIe_NAVI:
		DPRINT(" = NAVI MODE =\n");
		DPRINT("no data for NAVI MODE..\n");
		break;

	case mDNIe_GALLERY:
		DPRINT(" = GALLERY MODE =\n");
		INPUT_PAYLOAD1(GALLERY_1);
		INPUT_PAYLOAD2(GALLERY_2);
		INPUT_PAYLOAD3(GALLERY_3);
		INPUT_PAYLOAD4(GALLERY_4);
		INPUT_PAYLOAD5(GALLERY_5);
		INPUT_PAYLOAD6(GALLERY_6);
		break;

	case mDNIe_VT_MODE:
		DPRINT(" = VT MODE =\n");
		INPUT_PAYLOAD1(VT_1);
		INPUT_PAYLOAD2(VT_2);
		INPUT_PAYLOAD3(VT_3);
		INPUT_PAYLOAD4(VT_4);
		INPUT_PAYLOAD5(VT_5);
		INPUT_PAYLOAD6(VT_6);
		break;

#if defined(CONFIG_TDMB)
	case mDNIe_DMB_MODE:
		DPRINT(" = DMB MODE =\n");
		DPRINT("no data for DMB MODE..\n");
		break;

	case mDNIe_DMB_WARM_MODE:
		DPRINT(" = DMB WARM MODE =\n");
		DPRINT("no data for DMB  WARM MODE..\n");
		break;

	case mDNIe_DMB_COLD_MODE:
		DPRINT(" = DMB COLD MODE =\n");
		DPRINT("no data for DMB COLD MODE..\n");
		break;
#endif

	case mDNIe_BROWSER_MODE:
		DPRINT(" = BROWSER MODE =\n");
		INPUT_PAYLOAD1(BROWSER_1);
		INPUT_PAYLOAD2(BROWSER_2);
		INPUT_PAYLOAD3(BROWSER_3);
		INPUT_PAYLOAD4(BROWSER_4);
		INPUT_PAYLOAD5(BROWSER_5);
		INPUT_PAYLOAD6(BROWSER_6);
		break;

	case mDNIe_eBOOK_MODE:
		DPRINT(" = eBOOK MODE =\n");
		INPUT_PAYLOAD1(eBOOK_1);
		INPUT_PAYLOAD2(eBOOK_2);
		INPUT_PAYLOAD3(eBOOK_3);
		INPUT_PAYLOAD4(eBOOK_4);
		INPUT_PAYLOAD5(eBOOK_5);
		INPUT_PAYLOAD6(eBOOK_6);
		break;

	case mDNIe_EMAIL_MODE:
		DPRINT(" = EMAIL MODE =\n");
		INPUT_PAYLOAD1(eMAIL_1);
		INPUT_PAYLOAD2(eMAIL_2);
		INPUT_PAYLOAD3(eMAIL_3);
		INPUT_PAYLOAD4(eMAIL_4);
		INPUT_PAYLOAD5(eMAIL_5);
		INPUT_PAYLOAD6(eMAIL_6);
		break;

	case mDNIE_BLINE_MODE:
		DPRINT(" = BLIND MODE =\n");
		INPUT_PAYLOAD1(COLOR_BLIND_1);
		INPUT_PAYLOAD2(COLOR_BLIND_2);
		INPUT_PAYLOAD3(COLOR_BLIND_3);
		INPUT_PAYLOAD4(COLOR_BLIND_4);
		INPUT_PAYLOAD5(COLOR_BLIND_5);
		INPUT_PAYLOAD6(COLOR_BLIND_6);
		break;
#if defined(CONFIG_SEC_RUBENS_PROJECT)
		case mDNIE_OUTDOOR_MODE:
		if (mdnie_msd->dstat.auto_brightness >= 6) {
		DPRINT(" = OUTDOOR MODE =\n");
			INPUT_PAYLOAD1(OUTDOOR_1);
			INPUT_PAYLOAD2(OUTDOOR_2);
			INPUT_PAYLOAD3(OUTDOOR_3);
			INPUT_PAYLOAD4(OUTDOOR_4);
			INPUT_PAYLOAD5(OUTDOOR_5);
			INPUT_PAYLOAD6(OUTDOOR_6);
		} else {
			mDNIe_Set_Mode(mdnie_tun_state.scenario);
		}
		break;
	case mDNIE_OUTDOOR_MODE_FOR_TEXT:
		if (mdnie_msd->dstat.auto_brightness >= 6) {
			DPRINT(" = OUTDOOR MODE FOR TEXT = \n");
			INPUT_PAYLOAD1(OUTDOOR_FOR_TEXT_1);
			INPUT_PAYLOAD2(OUTDOOR_FOR_TEXT_2);
			INPUT_PAYLOAD3(OUTDOOR_FOR_TEXT_3);
			INPUT_PAYLOAD4(OUTDOOR_FOR_TEXT_4);
			INPUT_PAYLOAD5(OUTDOOR_FOR_TEXT_5);
			INPUT_PAYLOAD6(OUTDOOR_FOR_TEXT_6);
		} else {
			mDNIe_Set_Mode(mdnie_tun_state.scenario);
		}
		break;
#endif
#elif defined (CONFIG_FB_MSM_MDSS_HX8394C_TFT_VIDEO_720P_PANEL)
	case mDNIe_UI_MODE:
		DPRINT(" = UI MODE =\n");
		if (!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][0] ||
			!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][1] ||
			!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][2] ||
			!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][3]) {
			pr_err("mdnie tune data is NULL!\n");
			return;
		} else {
			INPUT_PAYLOAD1(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][0]);
			INPUT_PAYLOAD2(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][1]);
			INPUT_PAYLOAD3(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][2]);
			INPUT_PAYLOAD4(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][3]);

		}
		break;

	case mDNIe_VIDEO_MODE:
		DPRINT(" = VIDEO MODE =\n");
		if (!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][0] ||
			!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][1] ||
			!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][2] ||
			!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][3]) {
			pr_err("mdnie tune data is NULL!\n");
			return;
		} else {
			INPUT_PAYLOAD1(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][0]);
			INPUT_PAYLOAD2(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][1]);
			INPUT_PAYLOAD3(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][2]);
			INPUT_PAYLOAD4(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][3]);

		}

		break;

	case mDNIe_VIDEO_WARM_MODE:
		DPRINT(" = VIDEO WARM MODE =\n");
		DPRINT("no data for WARM MODE..\n");
		break;

	case mDNIe_VIDEO_COLD_MODE:
		DPRINT(" = VIDEO COLD MODE =\n");
		DPRINT("no data for COLD MODE..\n");
		break;

	case mDNIe_CAMERA_MODE:
		DPRINT(" = CAMERA MODE =\n");
		if (!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][0] ||
			!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][1] ||
			!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][2] ||
			!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][3]) {
			pr_err("mdnie tune data is NULL!\n");
			return;
		} else {
			INPUT_PAYLOAD1(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][0]);
			INPUT_PAYLOAD2(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][1]);
			INPUT_PAYLOAD3(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][2]);
			INPUT_PAYLOAD4(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][3]);

		}

		break;

	case mDNIe_NAVI:
		DPRINT(" = NAVI MODE =\n");
		DPRINT("no data for NAVI MODE..\n");
		break;

	case mDNIe_GALLERY:
		DPRINT(" = GALLERY MODE =\n");
		if (!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][0] ||
			!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][1] ||
			!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][2] ||
			!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][3]) {
			pr_err("mdnie tune data is NULL!\n");
			return;
		} else {
			INPUT_PAYLOAD1(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][0]);
			INPUT_PAYLOAD2(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][1]);
			INPUT_PAYLOAD3(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][2]);
			INPUT_PAYLOAD4(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][3]);

		}

		break;

	case mDNIe_VT_MODE:
		DPRINT(" = VT MODE =\n");
		if (!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][0] ||
			!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][1] ||
			!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][2] ||
			!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][3]) {
			pr_err("mdnie tune data is NULL!\n");
			return;
		} else {
			INPUT_PAYLOAD1(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][0]);
			INPUT_PAYLOAD2(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][1]);
			INPUT_PAYLOAD3(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][2]);
			INPUT_PAYLOAD4(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][3]);

		}

		break;

#if defined(CONFIG_TDMB)
	case mDNIe_DMB_MODE:
		DPRINT(" = DMB MODE =\n");
		DPRINT("no data for DMB MODE..\n");
		break;

	case mDNIe_DMB_WARM_MODE:
		DPRINT(" = DMB WARM MODE =\n");
		DPRINT("no data for DMB  WARM MODE..\n");
		break;

	case mDNIe_DMB_COLD_MODE:
		DPRINT(" = DMB COLD MODE =\n");
		DPRINT("no data for DMB COLD MODE..\n");
		break;
#endif

	case mDNIe_BROWSER_MODE:
		DPRINT(" = BROWSER MODE =\n");
		if (!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][0] ||
			!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][1] ||
			!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][2] ||
			!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][3]) {
			pr_err("mdnie tune data is NULL!\n");
			return;
		} else {
			INPUT_PAYLOAD1(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][0]);
			INPUT_PAYLOAD2(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][1]);
			INPUT_PAYLOAD3(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][2]);
			INPUT_PAYLOAD4(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][3]);

		}

		break;

	case mDNIe_eBOOK_MODE:
		DPRINT(" = eBOOK MODE =\n");
		if (!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][0] ||
			!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][1] ||
			!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][2] ||
			!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][3]) {
			pr_err("mdnie tune data is NULL!\n");
			return;
		} else {
			INPUT_PAYLOAD1(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][0]);
			INPUT_PAYLOAD2(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][1]);
			INPUT_PAYLOAD3(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][2]);
			INPUT_PAYLOAD4(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][3]);

		}

		break;

	case mDNIe_EMAIL_MODE:
		DPRINT(" = EMAIL MODE =\n");
		if (!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][0] ||
			!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][1] ||
			!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][2] ||
			!mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][3]) {
			pr_err("mdnie tune data is NULL!\n");
			return;
		} else {
			INPUT_PAYLOAD1(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][0]);
			INPUT_PAYLOAD2(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][1]);
			INPUT_PAYLOAD3(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][2]);
			INPUT_PAYLOAD4(
				mdnie_tune_value[mdnie_tun_state.scenario][mdnie_tun_state.background][mdnie_tun_state.outdoor][3]);

		}

		break;

	case mDNIE_BLINE_MODE:
		DPRINT(" = BLIND MODE =\n");

		if (!blind_tune_value[mdnie_tun_state.blind][0] || !blind_tune_value[mdnie_tun_state.blind][1] ||
			!blind_tune_value[mdnie_tun_state.blind][2] || !blind_tune_value[mdnie_tun_state.blind][3]) {
			pr_err("mdnie tune data is NULL!\n");
			return;
		} else {
			INPUT_PAYLOAD1(blind_tune_value[mdnie_tun_state.blind][0]);
			INPUT_PAYLOAD2(blind_tune_value[mdnie_tun_state.blind][1]);
			INPUT_PAYLOAD3(blind_tune_value[mdnie_tun_state.blind][2]);
			INPUT_PAYLOAD4(blind_tune_value[mdnie_tun_state.blind][3]);
		}
		break;

#else
	case mDNIe_UI_MODE:
		DPRINT(" = UI MODE =\n");
		INPUT_PAYLOAD1(UI_1);
		INPUT_PAYLOAD2(UI_2);
		break;

	case mDNIe_VIDEO_MODE:
		DPRINT(" = VIDEO MODE =\n");
		INPUT_PAYLOAD1(VIDEO_1);
		INPUT_PAYLOAD2(VIDEO_2);
		break;

	case mDNIe_VIDEO_WARM_MODE:
		DPRINT(" = VIDEO WARM MODE =\n");
		DPRINT("no data for WARM MODE..\n");
		break;

	case mDNIe_VIDEO_COLD_MODE:
		DPRINT(" = VIDEO COLD MODE =\n");
		DPRINT("no data for COLD MODE..\n");
		break;

	case mDNIe_CAMERA_MODE:
		DPRINT(" = CAMERA MODE =\n");
		INPUT_PAYLOAD1(CAMERA_1);
		INPUT_PAYLOAD2(CAMERA_2);
		break;

	case mDNIe_NAVI:
		DPRINT(" = NAVI MODE =\n");
		DPRINT("no data for NAVI MODE..\n");
		break;

	case mDNIe_GALLERY:
		DPRINT(" = GALLERY MODE =\n");
		INPUT_PAYLOAD1(GALLERY_1);
		INPUT_PAYLOAD2(GALLERY_2);
		break;

	case mDNIe_VT_MODE:
		DPRINT(" = VT MODE =\n");
		INPUT_PAYLOAD1(VT_1);
		INPUT_PAYLOAD2(VT_2);
		break;

#if defined(CONFIG_TDMB)
	case mDNIe_DMB_MODE:
		DPRINT(" = DMB MODE =\n");
		INPUT_PAYLOAD1(TDMB_1);
		INPUT_PAYLOAD2(TDMB_2);
		break;

	case mDNIe_DMB_WARM_MODE:
		DPRINT(" = DMB WARM MODE =\n");
		DPRINT("no data for DMB  WARM MODE..\n");
		break;

	case mDNIe_DMB_COLD_MODE:
		DPRINT(" = DMB COLD MODE =\n");
		DPRINT("no data for DMB COLD MODE..\n");
		break;
#endif

	case mDNIe_BROWSER_MODE:
		DPRINT(" = BROWSER MODE =\n");
		INPUT_PAYLOAD1(BROWSER_1);
		INPUT_PAYLOAD2(BROWSER_2);
		break;

	case mDNIe_eBOOK_MODE:
		DPRINT(" = eBOOK MODE =\n");
		INPUT_PAYLOAD1(eBOOK_1);
		INPUT_PAYLOAD2(eBOOK_2);
		break;

	case mDNIe_EMAIL_MODE:
		DPRINT(" = EMAIL MODE =\n");
		INPUT_PAYLOAD1(eMAIL_1);
		INPUT_PAYLOAD2(eMAIL_2);
		break;

	case mDNIE_BLINE_MODE:
		DPRINT(" = BLIND MODE =\n");
		INPUT_PAYLOAD1(COLOR_BLIND_1);
		INPUT_PAYLOAD2(COLOR_BLIND_2);
		break;
#endif

	default:
		DPRINT("[%s] no option (%d)\n", __func__, mode);
		return;
	}
#endif
	sending_tuning_cmd();
	free_tun_cmd();

#if defined(CONFIG_FB_MSM_MDSS_HX8394C_TFT_VIDEO_720P_PANEL)
		DPRINT("mDNIe_Set_Mode end , %s(%d), %s(%d),\n",
		scenario_name[mdnie_tun_state.scenario], mdnie_tun_state.scenario,
		background_name[mdnie_tun_state.background], mdnie_tun_state.background);
#else
		mdnie_msd->scenario = mode;
		DPRINT("mDNIe_Set_Mode end , mode(%d), background(%d)\n",
		mode, mdnie_tun_state.background);
#endif
}
void CABC_Set_Mode(void)
{
	if (!cabc_tun_state.cabc_enable) {
		DPRINT("[ERROR] CABC engine is OFF.\n");
		return;
	}

	if (!get_panel_power_state()) {
		pr_info("%s : get_panel_power_state off", __func__);
		return;
	}

	DPRINT("CABC_Set_Mode start , mode(%d), negative(%d), lux(%d)\n",
		cabc_tun_state.mode, cabc_tun_state.negative,
						cabc_tun_state.luxvalue);

	switch (cabc_tun_state.mode) {
	case CABC_MODE_UI:
		DPRINT(" = UI MODE =\n");
		INPUT_PAYLOAD1(CABC_NORMAL_1);
		INPUT_PAYLOAD2(CABC_NORMAL_2);
		INPUT_PAYLOAD3(CABC_NORMAL_3);
		INPUT_PAYLOAD4(CABC_NORMAL_4);
		break;

	case CABC_MODE_VIDEO:
		DPRINT(" = VIDEO MODE =\n");
		INPUT_PAYLOAD1(CABC_NORMAL_1);
		INPUT_PAYLOAD2(CABC_NORMAL_2);
		INPUT_PAYLOAD3(CABC_NORMAL_3);
		INPUT_PAYLOAD4(CABC_NORMAL_4);
		break;
	default:
		DPRINT("[%s] no option for mode (%d)\n", __func__,
							cabc_tun_state.mode);
		return;
	}

	switch (cabc_tun_state.negative) {
	case CABC_NEGATIVE_OFF:
		DPRINT(" = Negative Disabled =\n");
		INPUT_PAYLOAD5(CABC_NORMAL_5);
		break;
	case CABC_NEGATIVE_ON:
		DPRINT(" = Negative Enabled =\n");
		INPUT_PAYLOAD5(CABC_NEGATIVE_5);
		break;
	default:
		DPRINT("[%s] no option for Negative (%d)\n", __func__,
						cabc_tun_state.negative);
		return;
	}

	if(cabc_tun_state.auto_br) {
		DPRINT(" = Auto Br Enabled =\n");
		switch (cabc_tun_state.luxvalue) {
		case CABC_LUX_0:
			DPRINT(" = LUX 0 ~ 150 =\n");
			INPUT_SELECT(CABC_SELECT_2);
			break;
		case CABC_LUX_1:
			DPRINT(" = LUX 150 ~ 5000 =\n");
			if(cabc_tun_state.mode == CABC_MODE_VIDEO)
				INPUT_SELECT(CABC_SELECT_2);
			else
				INPUT_SELECT(CABC_SELECT_1);
			break;
		case CABC_LUX_2:
			DPRINT(" = LUX 5000 ~ =\n");
			INPUT_SELECT(CABC_SELECT_0);
			break;
		default:
			DPRINT("[%s] no option (%d)\n", __func__,
							cabc_tun_state.mode);
			INPUT_SELECT(CABC_SELECT_0);
			return;
		}
	} else {
		DPRINT(" = Auto Br Disabled =\n");
		INPUT_SELECT(CABC_SELECT_0);
	}

	sending_tuning_cmd();
	free_tun_cmd();

	DPRINT("CABC_Set_Mode end , mode(%d), negative(%d), lux(%d)\n",
		cabc_tun_state.mode, cabc_tun_state.negative,
						cabc_tun_state.luxvalue);

}