Exemple #1
0
static struct mdnie_tuning_info *mdnie_request_table(struct mdnie_info *mdnie)
{
	struct mdnie_tuning_info *table = NULL;

	mutex_lock(&mdnie->lock);

	if (ACCESSIBILITY_IS_VALID(mdnie->accessibility)) {
		table = &accessibility_table[mdnie->cabc][mdnie->accessibility];
		goto exit;
	} else if (SCENARIO_IS_DMB(mdnie->scenario)) {
#if defined(CONFIG_TDMB)
		table = &tune_dmb[mdnie->mode];
#endif
		goto exit;
	} else if (SCENARIO_IS_COLOR(mdnie->scenario)) {
		table = &color_tone_table[mdnie->scenario % COLOR_TONE_1];
		goto exit;
	} else if (mdnie->scenario < SCENARIO_MAX) {
		// depending on sharpness tweak status, take either normal or
		// tweaked tuning table
		if (mdnie_preset == 0)
			table = &tuning_table[mdnie->cabc][mdnie->mode][mdnie->scenario];
		else
			table = &tuning_table_sharp_tweak[mdnie->cabc][mdnie->mode][mdnie->scenario];
		goto exit;
	}

exit:
	mutex_unlock(&mdnie->lock);

	return table;
}
Exemple #2
0
static struct mdnie_tuning_info *mdnie_request_table(struct mdnie_info *mdnie)
{
	struct mdnie_tuning_info *table = NULL;

	mutex_lock(&mdnie->lock);

	if (ACCESSIBILITY_IS_VALID(mdnie->accessibility)) {
		table = &accessibility_table[mdnie->cabc][mdnie->accessibility];
		goto exit;
	} else if (SCENARIO_IS_DMB(mdnie->scenario)) {
#if defined(CONFIG_TDMB)
		table = &tune_dmb[mdnie->mode];
#endif
		goto exit;
	} else if (SCENARIO_IS_COLOR(mdnie->scenario)) {
		table = &color_tone_table[mdnie->scenario % COLOR_TONE_1];
		goto exit;
	} else if (mdnie->scenario < SCENARIO_MAX) {
		table = &tuning_table[mdnie->cabc][mdnie->mode][mdnie->scenario];
		goto exit;
	}

exit:
	mutex_unlock(&mdnie->lock);

	return table;
}
Exemple #3
0
void set_mdnie_value(struct mdnie_info *mdnie, u8 force)
{
	u8 idx;

	if ((!mdnie->enable) && (!force)) {
		dev_err(mdnie->dev, "mdnie states is off\n");
		return;
	}

	if (mdnie->scenario == VIDEO_WARM_MODE)
		mdnie->tone = TONE_WARM;
	else if (mdnie->scenario == VIDEO_COLD_MODE)
		mdnie->tone = TONE_COLD;
	else
		mdnie->tone = TONE_NORMAL;

	if (mdnie->tunning) {
		dev_info(mdnie->dev, "mdnie tunning mode is enabled\n");
		return;
	}

	mutex_lock(&mdnie->lock);

	if (mdnie->negative == NEGATIVE_ON) {
		dev_info(mdnie->dev, "NEGATIVE_ON\n");
		mdnie_send_sequence(mdnie, tune_negative[mdnie->cabc].seq);
		goto exit;
	}

#if defined(CONFIG_TDMB) || defined(CONFIG_TARGET_LOCALE_NTT)
	if (mdnie->scenario == DMB_WARM_MODE) 
		mdnie->tone = TONE_WARM;
	else if  (mdnie->scenario == DMB_COLD_MODE) 
		mdnie->tone = TONE_COLD;

	if (SCENARIO_IS_DMB(mdnie->scenario)) {
		idx = mdnie->scenario - DMB_NORMAL_MODE;
		mdnie_send_sequence(mdnie, tune_dmb[mdnie->mode].seq);
		dev_info(mdnie->dev, "[DMB] mode=%d, scenario=%d, outdoor=%d, cabc=%d, %s\n",
			mdnie->mode, mdnie->scenario, mdnie->outdoor, mdnie->cabc, 
			tune_dmb[mdnie->mode].name);
		goto etc;
	}
#endif

	// Browser 
	if (SCENARIO_IS_COLOR(mdnie->scenario)) {
		idx = mdnie->scenario - COLOR_TONE_1;
		mdnie_send_sequence(mdnie, tune_color_tone[idx].seq);
		dev_info(mdnie->dev, "[COLOR] mode=%d, scenario=%d, outdoor=%d, cabc=%d, %s\n",
			mdnie->mode, mdnie->scenario, mdnie->outdoor, mdnie->cabc,
			tune_color_tone[idx].name);

		goto exit;
	} else if ((mdnie->scenario == CAMERA_MODE) && (mdnie->outdoor == OUTDOOR_OFF)) {
		mdnie_send_sequence(mdnie, tune_camera);
		dev_info(mdnie->dev, "%s\n", "CAMERA");

		goto exit;
	} else if ((mdnie->scenario == CAMERA_MODE) && (mdnie->outdoor == OUTDOOR_ON)) {
		mdnie_send_sequence(mdnie, tune_camera_outdoor);
		dev_info(mdnie->dev, "%s\n", "CAMERA_OUTDOOR");

		goto exit;
	} else {
		mdnie_send_sequence(mdnie, tunning_table[mdnie->cabc][mdnie->mode][mdnie->scenario].seq);
		dev_info(mdnie->dev, "[TUNE] mode=%d, scenario=%d, outdoor=%d, cabc=%d, %s\n",
			mdnie->mode, mdnie->scenario, mdnie->outdoor, mdnie->cabc,
			tunning_table[mdnie->cabc][mdnie->mode][mdnie->scenario].name);
	}
	
#if defined(CONFIG_TDMB) || defined(CONFIG_TARGET_LOCALE_NTT)
etc:
#endif 

	// Warm / Cold Setup 
	mdnie_send_sequence(mdnie, etc_table[mdnie->cabc][mdnie->outdoor][mdnie->tone].seq);
	dev_info(mdnie->dev, "[Etc] mode=%d, scenario=%d, outdoor=%d, tone=%d, %s\n",
		mdnie->mode, mdnie->scenario, mdnie->outdoor, mdnie->tone,
		etc_table[mdnie->cabc][mdnie->outdoor][mdnie->tone].name);

exit:
	mutex_unlock(&mdnie->lock);

	return;
}
Exemple #4
0
void set_mdnie_value(struct mdnie_info *mdnie, u8 force)
{
	u8 idx;

	if ((!mdnie->enable) && (!force)) {
		dev_err(mdnie->dev, "mdnie states is off\n");
		return;
	}

	if (mdnie->scenario == VIDEO_WARM_MODE)
		mdnie->tone = TONE_WARM;
	else if (mdnie->scenario == VIDEO_COLD_MODE)
		mdnie->tone = TONE_COLD;
	else
		mdnie->tone = TONE_NORMAL;

	if (mdnie->tunning) {
		dev_info(mdnie->dev, "mdnie tunning mode is enabled\n");
		return;
	}

	mutex_lock(&mdnie->lock);

	if (mdnie->negative == NEGATIVE_ON) {
		dev_info(mdnie->dev, "NEGATIVE_ON\n");
		mdnie_send_sequence(mdnie, negative_table[mdnie->cabc].seq);
		goto exit;
	}

#if defined(CONFIG_TDMB) || defined(CONFIG_TARGET_LOCALE_NTT)
	if (SCENARIO_IS_DMB(mdnie->scenario)) {
		idx = mdnie->scenario - DMB_NORMAL_MODE;
		mdnie->tone = idx;

		mdnie_send_sequence(mdnie, tune_dmb[mdnie->mode].seq);
		dev_info(mdnie->dev, "mode=%d, scenario=%d, outdoor=%d, cabc=%d, %s\n",
			mdnie->mode, mdnie->scenario, mdnie->outdoor,
			mdnie->cabc, tune_dmb[mdnie->mode].name);
		goto etc;
	}
#endif

	if (SCENARIO_IS_COLOR(mdnie->scenario)) {
		idx = mdnie->scenario - COLOR_TONE_1;
		mdnie_send_sequence(mdnie, color_tone_table[idx].seq);
		dev_info(mdnie->dev, "mode=%d, scenario=%d, outdoor=%d, cabc=%d, %s\n",
			mdnie->mode, mdnie->scenario, mdnie->outdoor, mdnie->cabc,
			color_tone_table[idx].name);

		goto exit;
	} else if (mdnie->scenario == CAMERA_MODE) {
		mdnie_send_sequence(mdnie, camera_table[mdnie->outdoor].seq);
		dev_info(mdnie->dev, "%s\n", camera_table[mdnie->outdoor].name);

		goto exit;
	} else {
		mdnie_send_sequence(mdnie, tunning_table[mdnie->cabc][mdnie->mode][mdnie->scenario].seq);
		dev_info(mdnie->dev, "mode=%d, scenario=%d, outdoor=%d, cabc=%d, %s\n",
			mdnie->mode, mdnie->scenario, mdnie->outdoor, mdnie->cabc,
			tunning_table[mdnie->cabc][mdnie->mode][mdnie->scenario].name);
	}

#if defined(CONFIG_TDMB) || defined(CONFIG_TARGET_LOCALE_NTT)
etc:
#endif
	if (!IS_ERR_OR_NULL(etc_table[mdnie->cabc][mdnie->outdoor][mdnie->tone].seq)) {
		mdnie_send_sequence(mdnie, etc_table[mdnie->cabc][mdnie->outdoor][mdnie->tone].seq);
		dev_info(mdnie->dev, "%s\n", etc_table[mdnie->cabc][mdnie->outdoor][mdnie->tone].name);
	}

exit:
	mutex_unlock(&mdnie->lock);

	return;
}
Exemple #5
0
void set_mdnie_value(struct mdnie_info *mdnie)
{
	u8 idx;

	if (!mdnie->enable) {
		dev_err(mdnie->dev, "do not configure mDNIe after LCD/mDNIe power off\n");
		return;
	}

	if (mdnie->scenario == VIDEO_WARM_MODE)
		mdnie->tone = TONE_WARM;
	else if (mdnie->scenario == VIDEO_COLD_MODE)
		mdnie->tone = TONE_COLD;
	else
		mdnie->tone = TONE_NORMAL;

	if (mdnie->tunning) {
		dev_info(mdnie->dev, "mDNIe tunning mode is enabled\n");
		return;
	}

	mutex_lock(&mdnie->lock);

	if (mdnie->negative == NEGATIVE_ON) {
		dev_info(mdnie->dev, "NEGATIVE_ON\n");
		mdnie_send_sequence(mdnie, tune_negative[mdnie->cabc].seq);
		goto exit;
	}

#ifdef CONFIG_TARGET_LOCALE_KOR
	if (SCENARIO_IS_DMB(mdnie->scenario)) {
		idx = mdnie->scenario - DMB_NORMAL_MODE;
		mdnie_send_sequence(mdnie, tune_dmb[mdnie->outdoor][idx].seq);
		dev_info(mdnie->dev, "mode=%d, scenario=%d, outdoor=%d, cabc=%d, %s\n",
			mdnie->mode, mdnie->scenario, mdnie->outdoor,
			mdnie->cabc, tune_dmb[mdnie->outdoor][idx].name);
		goto exit;
	}
#endif

	if (SCENARIO_IS_COLOR(mdnie->scenario)) {
		idx = mdnie->scenario - COLOR_TONE_1;
		mdnie_send_sequence(mdnie, tune_color_tone[idx].seq);
		dev_info(mdnie->dev, "mode=%d, scenario=%d, outdoor=%d, cabc=%d, %s\n",
			mdnie->mode, mdnie->scenario, mdnie->outdoor, mdnie->cabc,
			tune_color_tone[idx].name);
		goto exit;
	} else if ((mdnie->scenario == CAMERA_MODE) && \
		(mdnie->outdoor == OUTDOOR_ON)) {
		mdnie_send_sequence(mdnie, tune_camera_outdoor);
		dev_info(mdnie->dev, "%s\n", "CAMERA_OUTDOOR");
		goto exit;
	} else if (mdnie->scenario < SCENARIO_MAX) {
		mdnie_send_sequence(mdnie, tunning_table[mdnie->cabc][mdnie->mode][mdnie->scenario].seq);
		dev_info(mdnie->dev, "mode=%d, scenario=%d, outdoor=%d, cabc=%d, %s\n",
			mdnie->mode, mdnie->scenario, mdnie->outdoor, mdnie->cabc,
			tunning_table[mdnie->cabc][mdnie->mode][mdnie->scenario].name);
		if (mdnie->scenario == CAMERA_MODE)
			goto exit;
	}

	if (!((mdnie->tone == TONE_NORMAL) && (mdnie->outdoor == OUTDOOR_OFF))) {
		dev_info(mdnie->dev, "%s\n", etc_table[mdnie->cabc][mdnie->outdoor][mdnie->tone].name);
		mdnie_send_sequence(mdnie, etc_table[mdnie->cabc][mdnie->outdoor][mdnie->tone].seq);
	}

exit:
	mutex_unlock(&mdnie->lock);

	return;
}
void set_mdnie_value(struct mdnie_info *mdnie, u8 force)
{
	u8 idx;

	if ((!mdnie->enable) && (!force)) {
		dev_err(mdnie->dev, "mdnie states is off\n");
		return;
	}

	if (mdnie->scenario == VIDEO_WARM_MODE)
		mdnie->tone = TONE_WARM;
	else if (mdnie->scenario == VIDEO_COLD_MODE)
		mdnie->tone = TONE_COLD;
	else
		mdnie->tone = TONE_NORMAL;

	if (mdnie->tunning) {
		dev_info(mdnie->dev, "mdnie tunning mode is enabled\n");
		return;
	}

	mutex_lock(&mdnie->lock);

	if (mdnie->negative == NEGATIVE_ON) {
		dev_info(mdnie->dev, "NEGATIVE_ON\n");
		mdnie_send_sequence(mdnie, tune_negative[mdnie->cabc].seq);
		goto exit;
	}

#ifdef CONFIG_TARGET_LOCALE_KOR
#if defined(CONFIG_MACH_M0_KOR_SKT) || defined(CONFIG_MACH_M0_KOR_KT) || \
	defined(CONFIG_MACH_C1_KOR_SKT) || defined(CONFIG_MACH_C1_KOR_KT) || \
	defined(CONFIG_MACH_C1_KOR_LGT)
	dev_info(mdnie->dev, "ICS DMB SCENARIO ON\n");
	if (SCENARIO_IS_DMB(mdnie->scenario)) {
		idx = mdnie->scenario - DMB_NORMAL_MODE;
		mdnie_send_sequence(mdnie, tune_ics_dmb[mdnie->mode].seq);
#ifndef PRODUCT_SHIP
		dev_info(mdnie->dev, "mode=%d, scenario=%d, outdoor=%d, cabc=%d, %s\n",
			mdnie->mode, mdnie->scenario, mdnie->outdoor,
			mdnie->cabc, tune_ics_dmb[mdnie->mode].name);
#endif
	}

	if (!((mdnie->tone == TONE_NORMAL) &&
		  (mdnie->outdoor == OUTDOOR_OFF))) {
		dev_info(mdnie->dev, "%s\n",
			etc_table[mdnie->cabc][mdnie->outdoor][mdnie->tone].name);
		mdnie_send_sequence(mdnie,
			etc_table[mdnie->cabc][mdnie->outdoor][mdnie->tone].seq);
	}
	goto exit;
#else
	if (SCENARIO_IS_DMB(mdnie->scenario)) {
		idx = mdnie->scenario - DMB_NORMAL_MODE;
		mdnie_send_sequence(mdnie, tune_dmb[mdnie->outdoor][idx].seq);
#ifndef PRODUCT_SHIP
		dev_info(mdnie->dev, "mode=%d, scenario=%d, outdoor=%d, cabc=%d, %s\n",
			mdnie->mode, mdnie->scenario, mdnie->outdoor,
			mdnie->cabc, tune_dmb[mdnie->outdoor][idx].name);
#endif
		goto exit;
	}
#endif
#endif

	if (SCENARIO_IS_COLOR(mdnie->scenario)) {
		idx = mdnie->scenario - COLOR_TONE_1;
		mdnie_send_sequence(mdnie, tune_color_tone[idx].seq);
#ifndef PRODUCT_SHIP
		dev_info(mdnie->dev, "mode=%d, scenario=%d, outdoor=%d, cabc=%d, %s\n",
			mdnie->mode, mdnie->scenario, mdnie->outdoor, mdnie->cabc,
			tune_color_tone[idx].name);
#endif
		goto exit;
	} else if ((mdnie->scenario == CAMERA_MODE) && \
		(mdnie->outdoor == OUTDOOR_ON)) {
		mdnie_send_sequence(mdnie, tune_camera_outdoor);
		dev_info(mdnie->dev, "%s\n", "CAMERA_OUTDOOR");
		goto exit;
	} else if (mdnie->scenario < SCENARIO_MAX) {
		mdnie_send_sequence(mdnie, tunning_table[mdnie->cabc][mdnie->mode][mdnie->scenario].seq);
#ifndef PRODUCT_SHIP
		dev_info(mdnie->dev, "mode=%d, scenario=%d, outdoor=%d, cabc=%d, %s\n",
			mdnie->mode, mdnie->scenario, mdnie->outdoor, mdnie->cabc,
			tunning_table[mdnie->cabc][mdnie->mode][mdnie->scenario].name);
#endif
		if (mdnie->scenario == CAMERA_MODE)
			goto exit;
	}

	if (!((mdnie->tone == TONE_NORMAL) && (mdnie->outdoor == OUTDOOR_OFF))) {
		dev_info(mdnie->dev, "%s\n", etc_table[mdnie->cabc][mdnie->outdoor][mdnie->tone].name);
		mdnie_send_sequence(mdnie, etc_table[mdnie->cabc][mdnie->outdoor][mdnie->tone].seq);
	}

exit:
	mutex_unlock(&mdnie->lock);

	return;
}
void set_mdnie_value(struct mdnie_info *mdnie, u8 force)
{
 	u8 idx;
 
 	if ((!mdnie->enable) && (!force)) {
 		dev_err(mdnie->dev, "mdnie states is off\n");
 		return;
 	}
 

#if 1
     printk("%s mdnie->mode = %d  mdnie->scenario = %d, mdnie->negative = %d \n",__func__, mdnie->mode ,mdnie->scenario, mdnie->negative);
     mutex_lock(&mdnie->lock);

      if(NEGATIVE_ON == mdnie->negative){
          mdnie_send_sequence(mdnie, negative_tuning); 
          mutex_unlock(&mdnie->lock);
          return;
      }
      
     switch (mdnie->scenario) {

	  case UI_MODE:
             mdnie_send_sequence(mdnie, ui_tuning); 
		break;

	  case VIDEO_MODE:

             if(OUTDOOR_ON == mdnie->outdoor)
                  mdnie_send_sequence(mdnie, video_outdoor_tuning); 
             else
                  mdnie_send_sequence(mdnie, video_tuning); 

		break;

        case VIDEO_WARM_MODE:

              if(OUTDOOR_ON == mdnie->outdoor)
                  mdnie_send_sequence(mdnie, video_warm_outdoor_tuning); 
             else
                  mdnie_send_sequence(mdnie, video_warm_tuning); 

		break;

        case VIDEO_COLD_MODE:

             if(OUTDOOR_ON == mdnie->outdoor)
                  mdnie_send_sequence(mdnie, video_cold_outdoor_tuning); 
             else
                  mdnie_send_sequence(mdnie, video_cold_tuning); 

		break;

	  case CAMERA_MODE:

             if(OUTDOOR_ON == mdnie->outdoor)
                 mdnie_send_sequence(mdnie, camera_outdoor_tuning); 
             else
                 mdnie_send_sequence(mdnie, camera_tuning); 

		break;

      	  case GALLERY_MODE:
             mdnie_send_sequence(mdnie, gallery_tuning); 
		break;

	  default:

		break;
     }
     



#else
 
 	if (mdnie->scenario == VIDEO_WARM_MODE)
 		mdnie->tone = TONE_WARM;
 	else if (mdnie->scenario == VIDEO_COLD_MODE)
 		mdnie->tone = TONE_COLD;
 	else
 		mdnie->tone = TONE_NORMAL;
 
 	if (mdnie->tunning) {
 		dev_info(mdnie->dev, "mdnie tunning mode is enabled\n");
 		return;
 	}
 
 	mutex_lock(&mdnie->lock);
 
 	if (mdnie->negative == NEGATIVE_ON) {
 		dev_info(mdnie->dev, "NEGATIVE_ON\n");

             printk("mdnie testNegative\n");
             mdnie_send_sequence(mdnie, camera_table[mdnie->outdoor].seq);  /* SKC for test */
 		//mdnie_send_sequence(mdnie, negative_table[mdnie->cabc].seq);
 		goto exit;
 	}
 
 #if defined(CONFIG_TDMB) || defined(CONFIG_TARGET_LOCALE_NTT)
 	if (SCENARIO_IS_DMB(mdnie->scenario)) {
 		idx = mdnie->scenario - DMB_NORMAL_MODE;
 		mdnie_send_sequence(mdnie, tune_dmb[mdnie->mode].seq);
 		dev_info(mdnie->dev, "mode=%d, scenario=%d, outdoor=%d, cabc=%d, %s\n",
 			mdnie->mode, mdnie->scenario, mdnie->outdoor,
 			mdnie->cabc, tune_dmb[mdnie->mode].name);
 		goto etc;
 	}
 #endif
 
 	if (SCENARIO_IS_COLOR(mdnie->scenario)) {
 		idx = mdnie->scenario - COLOR_TONE_1;
 		//mdnie_send_sequence(mdnie, color_tone_table[idx].seq);
 		//dev_info(mdnie->dev, "mode=%d, scenario=%d, outdoor=%d, cabc=%d, %s\n",
 		//	mdnie->mode, mdnie->scenario, mdnie->outdoor, mdnie->cabc,
 		//	color_tone_table[idx].name);
 
 		goto exit;
 	} else if (mdnie->scenario == CAMERA_MODE) {
 		mdnie_send_sequence(mdnie, camera_table[mdnie->outdoor].seq);
 		dev_info(mdnie->dev, "%s\n", camera_table[mdnie->outdoor].name);
 
 		goto exit;
 	} else {
 		mdnie_send_sequence(mdnie, tunning_table[mdnie->cabc][mdnie->mode][mdnie->scenario].seq);
 		dev_info(mdnie->dev, "mode=%d, scenario=%d, outdoor=%d, cabc=%d, %s\n",
 			mdnie->mode, mdnie->scenario, mdnie->outdoor, mdnie->cabc,
 			tunning_table[mdnie->cabc][mdnie->mode][mdnie->scenario].name);
 	}
 
 #if defined(CONFIG_TDMB) || defined(CONFIG_TARGET_LOCALE_NTT)
 etc:
 #endif
 	if (!IS_ERR_OR_NULL(etc_table[mdnie->cabc][mdnie->outdoor][mdnie->tone].seq)) {
 		mdnie_send_sequence(mdnie, etc_table[mdnie->cabc][mdnie->outdoor][mdnie->tone].seq);
 		dev_info(mdnie->dev, "%s\n", etc_table[mdnie->cabc][mdnie->outdoor][mdnie->tone].name);
 	}
 
#endif /* SKC */
 
 exit:
 	mutex_unlock(&mdnie->lock);
 
 	return;
 }