//----------------------------------------------------------------------------------------------------
// ID Code      : Power.c No.0002
// Update Note  :
//
//----------------------------------------------------------------------------------------------------

#define __POWER_CUSTOMER__

#include "Core\Header\Include.h"
//#include "Core\Header\Tv.h"


/**
 * CPowerHandler
 * do powercontrol if power switch is changed
 * only called at the start of CModeHandler
 * @param <none>
 * @return {none}
 *
*/

//--------------------------------------------------
// Description  : Execute power up/down process
// Input Value  : None
// Output Value : None
//--------------------------------------------------
void CPowerDownCustomerControl(void)
{
	CLR_POWERSTATUS();
	CPowerPanelOff();
	CPowerADCAPLLOff();
	CPowerLVDSOff();
	CPowerDPLLOff();
	//CPowerTMDSOff();//Alanli20070801
	CScalerSetByte(_HOST_CTRL_01, 0x02);

	if (!GET_POWER_SW_BY_SLEEP())
		CEepromSaveSystemData();
	CLR_POWER_SW_BY_SLEEP();

	CTimerCancelNosignal_Icon_Powersaving();

	COsdIconMoveDisableResetEnv();

}

void CPowerUpCustomerControl(void)
{

#if(_FIX_POWER_ON_ERROR)//fix at power on have a bright band 070809

#else
	CPowerPanelOn();
	CPowerADCAPLLOn();
	CPowerLVDSOn();
	CPowerDPLLOff();
	CPowerTMDSOn();
#endif
	CEepromLoadBacklightData();
	CAdjustBacklight();
	//czl 071126
    	#if(_POWER_ON_LOGO_SUPPROT == _ON)
       COsdDispPowerOnLogoProc();
   	 #endif
	 //20080825 ccy modify
	 #if (_PCB_TYPE == _PCB_TEST)
	 #else
	CAudioSetVolume(stAudioData.Volume);
	#endif
//#if(_SCAN_TYPE==_SEQUENTIAL_SCAN)
	//bFirstChannelFlag=1;
//#endif
	
//741002***	
#if( _HDMI_SUPPORT == _ON)
	if(GET_INPUTSOURCE_TYPE() == _SOURCE_DVI)
	{
		CLR_HDMISHOWSEARCH();
	}
#endif
}


