v002:
1. support 900mA if define "Support_MHL2".

v003:
1. to add 3D code, flag is "Support_3D", but no comply yet.

v004:
1. improve to send DSCR_CHG out when WB CMD done and define no "Support_3D".

v005:
1. to fix building wrong.

v006:
1. keep fix building wrong.

v007:
1. to fix issue that is REQ_WRT send twice.
2. keep fix building wrong.

v008:
1. improve 3D function for compliance.
2. to set DEM_MSC_MAX_REPLY_DELAY 300ms to 100ms for fixed CTS long term items fail sometimes.
3. add RAP Polling CMD send out in fgSil_RapKeys()

v009:
1. to modify RAPK doesn't send twice
2. to add 3D DTD list on API
3. to disable Support_3D, because 3D WB will impact original WB function.
4. to correct function name -> SI_3DConfig_For_Sony_KDL46HX800() to SI_3D_EDID_Configuration_VIC_DTD()
5. to add new API "fgSil_NFYRAPK", purpose: in case RAPK
6. to disable SI_RapAckRcvd() in SI_RapHandler(), because CbusProcessSubCommand already called. Don't do twice.

v010:
1. to fix issue, which WB CMD impact 3D WB CMD. Please search "kh, add 2 functions (SiiWriteBurstData, SI_MscWriteBurst_Done) when customer wants to use WB do something."
2. to add new API "fgSil_Set_MHL2_State", purpose is when system initially, SoC calls fgSil_Set_MHL2_State for desicion DUT support MHL2 or MHL1. And decistion support 900mA or 1500mA.
3. to add new API "fgSil_Set_3D_State(support)", purpose is when system initially, SoC calls fgSil_Set_3D_State for desicion DUT supports 3D or not. SoC shall set "support" value when initally.
4. to add new API "SI_3D_EDID_Configuration_VIC_DTD", purpose is when system initially, SoC calls SI_3D_EDID_Configuration_VIC_DTD for decision MHL 3D format. SoC shall set "MHL_3D_VIC_Struction_T" and "MHL_3D_DTD_Struction_T" in initally.

v011:
1. to improve EDID_CHG CMD.

v012:
1. to add DevCap API.

v013:
1. EDID_CHG will impact HDCP error... therefore remove the CMD.
2. fix issue that no notify SoC when DevCap read done.

v014:
1. remove CBUS CMD retry...

v015:
1. modify debugging MSG on SI_MscReadDevCat()
2. add retry 3 times when ABORT & NonACK & NACK
3. re-add retry value 3 when Non-MSC_MSG CMD.
4. modify some debugging MSG desrciption.

v016:
1. modify some debugging MSG.
2. About RETRY 3 times CMD when ABORT & NACK & NonACK: I fixed no retry the same CMD 3 times.

v017:
1. add SW and CBUS RESET on initial. In case DC off to on, power of the system no power cycle and no HW reset and re-initiall 1292 SW. On this moment, need SW RESET.

v018:
1. fix issue that is read error DevCap value from Tx.
2. compele to read DevCap0x00 ~ 0x0E.

v019: Base on v013 development
1. Base on v013 to set 0xD0:0x7A[3] for enabled Dev_Cat writable. The version is no included v014 ~ v018 solution inside.
2. Print 1292 DEV_CAP all offsets.

v020: Base on v018 development
1 - Enable 0xD0:0x7A[3] for writable DevCap regs for 1292A used. Even enable the bit and use 1292 non-A version, there is not any impact.
2 - When send non-3D WriteBurst CMD, system will send DSRC_CHG firstly then send WB, this is wrong sequence and no follow SPEC. Fixed.
3 - Add new OPT version 5 for 1292A used.
4 - Add print MSG to show 1292 Device Capability.
5 - Non-3D WB CMD impacts 3D WB. Fixed.
6 - When happening retry 3 times non-MSC_MSG CMD, system will alrways send same as command out. It is wrong for always sent. Fixed.
7 - Reduce "DEM_MSC_MAX_REPLY_DELAY" timer 100 to 50ms, it is speed up to send next CMD out.

v021: Base on v019 development
1. Base on v019 to develop. When OTP = 4, MHL_toggle_500ms() will be executed without OTP = 5, so OTP version cannot be effected MHL_toggle_500ms(), move MHL_toggle_500ms() to other place.
2. Add OTP 0~3 solution.
3. Fixed HuaWei P1 phone issue.

v022: Base on v021 development
1. remove print MSG for Device Capability. If print, will impact hTC sensation doesn't send DCAP_RDY.

v030: Base on v020 development
1. OTP version will not impact MHL_toggle_500ms().
2. remove print MSG for Device Capability. If print, will impact hTC sensation doesn't send DCAP_RDY.

v031: Base on v030 development
1. Issue: If non3D WB sent, driver will not retry 3 times when no ACK and get NACK and get ABORT.
		Solution:
			(1) disable SI_CbusOQCleanActiveReq() in SI_MscWriteBurst_Done().
			(2) add SI_CbusOQCleanActiveReq() in SI_WriteBurstDataDoneDummy().
			(3) modify MSC_WRITE_BURST CMD retry value 0 to 3 in SiiWriteBurstData().
			(4) modify CBUS_INT_BIT_DSCR_CHG retry value 0 to 3 SI_MscWriteBurst_Done().
2. Issue: MHL CTS 4.3.17.2 item random fail
		Solution:
			CANCEL --> Reduce "DEM_MSC_MAX_REPLY_DELAY" timer 100 to 50ms, it is speed up to send next CMD out.
3. Issue: Improve compatibility issue with smartphone, because time is diiferent between initially and mainloop.
		Solution:
			(1) Move MHL_toggle_500ms() from CpCheckOTPRev() to SI_DeviceEventMonitor(). Some SoCs's procession 1292 driver time is too long after inital procession.
			(2) Change SI_DeviceEventMonitor() placement to main top side, because system shall run SI_DeviceEventMonitor() firstly when initially for detection cable kind.
			(3) control 0xD0:0x70[7] in fgSil_MHLSignalControl().
4. Issue: VBUS output 5v when initially.
		Solution:
			vPsCtrl(VBUS_ON) changes to CpCableDetect() in fgSil_RecoveryMHLCable(). Because system doesn't know cable kind in initially procession.
5. Issue: Device Capability API reports error value to SoC, because SI_MscReadBandwidth() is not last CMD for read DevCap.
		Solution:
			SI_MscDevCapAPIStateUpdate() move from SI_MscReadBandwidth() to SI_MscReadIntStatSize()

v032: Base on v031 development
1. Issue: Show OSD name slow
		Solution:
			Add new APIs that are fgSil_NTF_CBUS_Connected() and fgSil_NTF_CBUS_Disconnected() and fgSil_NTF_3D_Communicated() for notification SoC. 
2. Issue: MHL CTS Protocol Fail on MHL2.0 non-3D
		Solution:
			Follow MHL SPEC 5.9.1.2 "Notes on Use of WRITE_BURST for 3D".
			
v033: Base on v032 development
1. Change latest OTP version 4 to 5.
2. Issue: Complier fail on SI_3DConfig_For_3D_Not_Supported()
		Solution:
			Add function content.
			
v034: Base on v033 development
1. Issue: VBUS be controlled by SoC.
		Solution:
			Add new call back functions on API.
			(1) void fgSil_NTF_VBUS_High(void);
			(2) void fgSil_NTF_VBUS_Low(void);
2. Issue: No HW resets for 1292.
		Solution:
			Add new call back functions on API.
			void fgSil_NTF_HWRST_1292(void);
			
v035: Base on v034 development:
Remove SW-RESET and CBUS RESET on initially for compatibility testing.

v036: Base on v033 development:
Remove SW-RESET and CBUS RESET on initially for compatibility testing.

v037: Base on v034 development:
1. Remove HW-RESET, it is by system control.
2. Modify PS_CTRL# way.

v038: Base on v037 development:
1. Issue: 3D_WB abnormal send out when replug MHL cable.
		Solution:
			index = 0 when 3D_REQ arrived.

v039: Base on v038 development:
1: Issue: when DC Off, Termination needs to disable
		Solution:
			Add new API (fgSil_Enable_Termination) for SoC call
2: Issue: when TV/Monitor into STBY mode, loop needs to stop then disable Termination. Of course, 1292 needs fully power on STBY.
		Solution:
			Add new API (fgSil_MHL_Enable_MLoop) for SoC call

v040: Base on v039 development:
Remove API (fgSil_Enable_Termination). In case termination needs to disable, can use fgSil_MHLSignalControl to achieve.

v001: modified by zhangyue for sony's Malaysia case we made this version as the first correct base version
v002: modified by zhangyue for improve sony's power sequence. In order to control VBUS betterly, 
sony should replace PS_CTRL with MTK's GPIO. and MTK side should implement the two 
API, also need to define VbusCtrl_By_SoC macro
void fgSil_NTF_VBUS_High(void);
void fgSil_NTF_VBUS_Low(void);

1: Add two API 
// Function:    fgSil_Enable_Termination
// Description: @bOn True  :  Termination On
//              @bOn False  :  Termination Off
VOID fgSil_Enable_Termination(BOOL bOn)

// Function:	fgSil_Enable_Cbus
// Description: @bOn True  :  Enable Cbus default 1k On
//              @bOn False :  Diable Cbus Hi-Z	
VOID fgSil_Enable_Cbus(BOOL bOn)

v003:modified by zhangyue for meeting sony's power seq spec, OCP spec and 
Device Cap register spec
1 modified Init values of two global variables as following
//modified by zhangyue on 2013-03-21 for meeting sony's OCP spec start
#if 1
uint8_t GPIO_uData_LastStatus = 0xFF;
uint8_t GPIO_uData_CurrentStatus = 0xFF;
#else
uint8_t GPIO_uData_LastStatus=0;
uint8_t GPIO_uData_CurrentStatus = 0;
#endif
//modified by zhangyue on 2013-03-21 for meeting sony's OCP spec end

2 modified the OCP related code snippet in fgSil_Init() like following
	//modified by zhangyue on 2013-03-21 for meeting sony's OCP spec start
	#if 1
	fgSil_GetOCPStatus(0);
	#else
	SiIRegioRead(REG_GPIO_CTRL, &GPIO_uData_CurrentStatus);
		GPIO_uData_CurrentStatus &= BIT_GPIO0_INPUT;
	if(GPIO_uData_CurrentStatus == 0x00)fgSil_NFYOCPStatus(0, GPIO_uData_CurrentStatus);
		GPIO_uData_LastStatus = GPIO_uData_CurrentStatus;
	#endif
	//modified by zhangyue on 2013-03-21 for meeting sony's OCP spec end

3 removed the OCP related code snippet in function SI_DeviceEventMonitor()as 
  following for MTK will call fgSil_GetOCPStatus()every 10ms,
#ifdef DETECT_OCP
	//deleted by zhangyue on 2013 for meeting sony's OCP spec start
	#if 0
		SiIRegioRead(REG_GPIO_CTRL, &GPIO_uData_CurrentStatus);
		GPIO_uData_CurrentStatus &= BIT_GPIO0_INPUT;
		if(GPIO_uData_CurrentStatus != GPIO_uData_LastStatus)
		{
			fgSil_NFYOCPStatus(0, GPIO_uData_CurrentStatus);
		}
		GPIO_uData_LastStatus = GPIO_uData_CurrentStatus;
	#endif
	//deleted by zhangyue on 2013 for meeting sony's OCP spec end
#endif

4 Modified the function fgSil_GetOCPStatus as following

BOOL fgSil_GetOCPStatus(UINT8 port)
{

	//modified by zhangyue on 2013-03-21 for meeting sony's OCP spec start	
	#if 1
	SiIRegioRead(REG_GPIO_CTRL, &GPIO_uData_CurrentStatus);
	GPIO_uData_CurrentStatus &= BIT_GPIO0_INPUT;
	if(GPIO_uData_CurrentStatus != GPIO_uData_LastStatus)
	{
		fgSil_NFYOCPStatus(0, GPIO_uData_CurrentStatus);
	}
	GPIO_uData_LastStatus = GPIO_uData_CurrentStatus;
	
	return GPIO_uData_CurrentStatus ? false : true;
	#else
 	uint8_t u1buf = 0;
 
    if (GPIO_uData_CurrentStatus & BIT_GPIO0_INPUT) {
        return (true);
    } else {
        SiIRegioRead(REG_GPIO_CTRL, &u1buf);
        return ((u1buf & BIT_GPIO0_INPUT) ? true:false);
    }
	#endif
	//modified by zhangyue on 2013-03-21 for meeting sony's OCP spec end
}

5 Change  macro DEVICE_ID_L from 0x02 to 0x01

