#ifndef _HDMI_IF_H_
#define _HDMI_IF_H_
#include "x_typedef.h"
//-----------------------------------------------------------------------------
// HDMI_DRIVER_V2 == Only HDMI2.0 driver is implemented
//-----------------------------------------------------------------------------
#if CC_HDMI_2_0_SUPPORT
#define HDMI_DRIVER_V2 1
#else
#define HDMI_DRIVER_V2 0
#endif
//-----------------------------------------------------------------------------
// Include hdmi driver header files
//-----------------------------------------------------------------------------
#if HDMI_DRIVER_V2
#include "hw_hdmi2.h"
#include "drv_hdmi2.h"
#include "drv_dvi2.h"
#else
#include "hw_hdmi.h"
#include "drv_hdmi.h"
#include "drv_dvi.h"
#endif

//-----------------------------------------------------------------------------
// Constant definitions
//-----------------------------------------------------------------------------
#ifndef HDMI_HDR_METADATA_LENGTH
#define HDMI_HDR_METADATA_LENGTH 24 //Should be defined in drv_hdmi(2).h, but set default define here if not defined
#endif
#ifndef HDMI_INVALID_HDR_EOTF_VALUE
#define HDMI_INVALID_HDR_EOTF_VALUE 0xff //Should be defined in drv_hdmi(2).h, but set default define here if not defined
#endif

//-----------------------------------------------------------------------------
// Type definitions
//-----------------------------------------------------------------------------

#ifndef HDMI_IF_AUDIO_DATABLOCK_SIZE
#define HDMI_IF_AUDIO_DATABLOCK_SIZE 3
#define HDMI_IF_SAD_MAX_DATA_BLOCK 10
typedef struct
{
    BOOL fgSet;
    UINT8 u1FormatNum;
    UINT8 au1AudDataBlock[HDMI_IF_AUDIO_DATABLOCK_SIZE*HDMI_IF_SAD_MAX_DATA_BLOCK];
}HDMI_IF_SAD_SET_DATA;
#endif

typedef enum
{
    HDMI_IF_AUDIOFREQUENCY_32K = 0,
    HDMI_IF_AUDIOFREQUENCY_44K,
    HDMI_IF_AUDIOFREQUENCY_48K,
    HDMI_IF_AUDIOFREQUENCY_88K,
    HDMI_IF_AUDIOFREQUENCY_96K,
    HDMI_IF_AUDIOFREQUENCY_176K,
    HDMI_IF_AUDIOFREQUENCY_192K,
    HDMI_IF_AUDIOFREQUENCY_NOTINDICATED,
    HDMI_IF_AUDIOFREQUENCY_UNKNOWN,
    HDMI_IF_AUDIOFREQUENCY_MAX
}E_HDMI_IF_AUD_FREQUENCY;

typedef enum
{
    HDMI_IF_NO_SIGNAL = 0,
    HDMI_IF_HDMI,
    HDMI_IF_DVI,
    HDMI_IF_MODE_MAX
}HDMI_IF_MODE_T;

typedef enum
{
    HDMI_IF_InfoFrame_AVI,
    HDMI_IF_InfoFrame_SPD,
    HDMI_IF_InfoFrame_AUDIO,
    HDMI_IF_InfoFrame_MPEG,
    HDMI_IF_InfoFrame_UNREC,
    HDMI_IF_InfoFrame_HDR87,
    HDMI_IF_InfoFrame_HDR86,
    HDMI_IF_InfoFrame_GAMUT,
    HDMI_IF_InfoFrame_ACP,
    HDMI_IF_InfoFrame_VSDB,
    HDMI_IF_InfoFrame_ISRC0,
    HDMI_IF_InfoFrame_ISRC1,
    HDMI_IF_InfoFrame_GCP,
    HDMI_IF_InfoFrame_HFVSI,
    HDMI_IF_InfoFrame_EMPPKT1,
}HDMI_IF_INFOFRAME_TYPE;

typedef enum
{
    HDMI_IF_FORMAT_RGB,
    HDMI_IF_FORMAT_YC420,
    HDMI_IF_FORMAT_YC422,
    HDMI_IF_FORMAT_YC444
}HDMI_IF_SINGAL_FORMAT;

typedef struct
{
  UINT8 HDMI_FrameSize; //*sizeof(UINT32)
  UINT8 HDMI_FrameData[32];
}HDMI_IF_INFOFRAME;

typedef enum
{
    HDMI_IF_CLRSPC_UNKNOW,
    HDMI_IF_CLRSPC_YC444_601,
    HDMI_IF_CLRSPC_YC422_601,
    HDMI_IF_CLRSPC_YC420_601,

    HDMI_IF_CLRSPC_YC444_709,
    HDMI_IF_CLRSPC_YC422_709,
    HDMI_IF_CLRSPC_YC420_709,

    HDMI_IF_CLRSPC_XVYC444_601,
    HDMI_IF_CLRSPC_XVYC422_601,
    HDMI_IF_CLRSPC_XVYC420_601,

    HDMI_IF_CLRSPC_XVYC444_709,
    HDMI_IF_CLRSPC_XVYC422_709,
    HDMI_IF_CLRSPC_XVYC420_709,

    HDMI_IF_CLRSPC_sYCC444_601,
    HDMI_IF_CLRSPC_sYCC422_601,
    HDMI_IF_CLRSPC_sYCC420_601,

    HDMI_IF_CLRSPC_Adobe_YCC444_601,
    HDMI_IF_CLRSPC_Adobe_YCC422_601,
    HDMI_IF_CLRSPC_Adobe_YCC420_601,
    HDMI_IF_CLRSPC_YUV_NO_DATA,
    HDMI_IF_CLRSPC_Adobe_sYUV,

    HDMI_IF_CLRSPC_RGB,
    HDMI_IF_CLRSPC_Adobe_RGB,

    HDMI_IF_CLRSPC_BT_2020_RGB_non_const_luminous,
    HDMI_IF_CLRSPC_BT_2020_RGB_const_luminous,

    HDMI_IF_CLRSPC_BT_2020_YCC444_non_const_luminous,
    HDMI_IF_CLRSPC_BT_2020_YCC422_non_const_luminous,
    HDMI_IF_CLRSPC_BT_2020_YCC420_non_const_luminous,

    HDMI_IF_CLRSPC_BT_2020_YCC444_const_luminous,
    HDMI_IF_CLRSPC_BT_2020_YCC422_const_luminous,
    HDMI_IF_CLRSPC_BT_2020_YCC420_const_luminous,
    HDMI_IF_CLRSPC_HDMI_RX_CLRSPC_Reserved

}HDMI_IF_CLR_SPC;

typedef enum {
    HDMI_IF_HDMI_EDID14 = 0,
    HDMI_IF_HDMI_EDID20_STANDARD,//Standard ,no HF_VSDB
    HDMI_IF_HDMI_EDID20_ENHANCE,//Enhance, has HF_VSDB
    HDMI_IF_MHL_EDID,
    HDMI_IF_HDMI_HDCP1X,
    HDMI_IF_HDMI_HDCP2X
}HDMI_IF__HDMI_PARAMS_CHECK_MODE_T;

typedef enum
{
    HDMI_IF_KEYTYPE_HDCP1X,
    HDMI_IF_KEYTYPE_HDCP2X
}HDMI_IF_HDCP_KEY_TYPE_T;

typedef enum {
    HDMI_IF_AUD_NORMAL = 0,
    HDMI_IF_AUD_DSD,
    HDMI_IF_AUD_HBR
}HDMI_IF_AUD_MODE_T;

typedef enum {
    HDMI_IF_COLOR_DEPTH_8BIT = 0,
    HDMI_IF_COLOR_DEPTH_10BIT,
    HDMI_IF_COLOR_DEPTH_12BIT,
    HDMI_IF_COLOR_DEPTH_16BIT
}HDMI_IF_COLOR_DEPTH_T;

typedef enum {
    HDMI_IF_AUDIO_WIDTH_16BITS = 0,
    HDMI_IF_AUDIO_WIDTH_17BITS,
    HDMI_IF_AUDIO_WIDTH_18BITS,
    HDMI_IF_AUDIO_WIDTH_19BITS,
    HDMI_IF_AUDIO_WIDTH_20BITS,
    HDMI_IF_AUDIO_WIDTH_21BITS,
    HDMI_IF_AUDIO_WIDTH_22BITS,
    HDMI_IF_AUDIO_WIDTH_23BITS,
    HDMI_IF_AUDIO_WIDTH_24BITS,
    HDMI_IF_AUDIO_WIDTH_UNKNOWN
}HDMI_IF_AUDIO_WIDTH_T;

typedef enum {
    HDMI_IF_EARC_IDLE1 = 0,
    HDMI_IF_EARC_IDLE2,
    HDMI_IF_EARC_DISC1_WAITCOMMA,
    HDMI_IF_EARC_DISC2_HEARTBEAT,
    HDMI_IF_EARC_CONNECTED,
    HDMI_IF_EARC_NOT_EARC,
}HDMI_IF_EARC_STATE;

typedef struct
{
    UINT8 au1HdrMetadata[HDMI_HDR_METADATA_LENGTH];
}HDMI_IF_HDR_METADATA;

typedef enum {
    HDMI_IF_FRL_MODE_LEGACY = 0,
    HDMI_IF_FRL_MODE_FRL_3G_3CH,
    HDMI_IF_FRL_MODE_FRL_6G_3CH,
    HDMI_IF_FRL_MODE_FRL_6G_4CH,
    HDMI_IF_FRL_MODE_FRL_8G,
    HDMI_IF_FRL_MODE_FRL_10G,
    HDMI_IF_FRL_MODE_FRL_12G,
    HDMI_IF_FRL_MODE_FRL_NONE
}HDMI_IF_FRL_MODE_T;

typedef void (*HDMI_IF_ACP_CHG_CB)(UINT8 u1AcpChg,void* pvTag);
//-----------------------------------------------------------------------------
// Function Declaration
//-----------------------------------------------------------------------------
/**
 * @brief        Init HDMI module
*/
extern void vHdmiIf_HdmiInit(void);

/**
 * @brief        Get HDMI SPD UP status
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       HDMI SPD UP status
*/
extern UINT8 u1HdmiIf_GetUpSta(UINT8 u1Path);

/**
 * @brief        Check HDMI SPD UP status change
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       HDMI SPD UP status change type
*/
extern UINT8 u1HdmiIf_GetUPStaChg(UINT8 u1Path);

/**
 * @brief        Get HDMI SPD SV status
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       HDMI SPD SV status
*/
extern UINT8 u1HdmiIf_GetSvSta(UINT8 u1Path);

/**
 * @brief        Check HDMI SPD SV status change
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       HDMI SPD SV status change type
*/
extern UINT8 u1HdmiIf_GetSvStaChg(UINT8 u1Path);

/**
 * @brief        Get HDMI SPD 4K ps status
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       HDMI SPD 4K ps status
*/
extern UINT8 u1HdmiIf_Get4KpsSta(UINT8 u1Path);

/**
 * @brief        Get HDMI scan info
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       HDMI scan info
*/
extern UINT8 u1HdmiIf_GetScanInfo(UINT8 u1Path);

/**
 * @brief        Get MHL port id
 * @retval       MHL port id
*/
extern UINT8 u1HdmiIf_GetMhlPortId(void);

/**
 * @brief        Check RGB or YCbCr
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       1 for RGB, 0 for YCbCr
*/
extern UINT8 u1HdmiIf_GetInputType(UINT8 u1Path);

/**
 * @brief        Check HDCP decrypting on or off
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       1 for HDCP decrypting on, 0 for off
*/
extern UINT8 u1HdmiIf_GetHdcpStatus(UINT8 u1Path);

/**
 * @brief        Get audio category code
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       Audio category code
*/
extern UINT8 u1HdmiIf_GetAudioCategoryCode(UINT8 u1Path);

/**
 * @brief        Get audio bit width
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       Enum for audio bit width, see HDMI_IF_AUDIO_WIDTH_T
*/
extern HDMI_IF_AUDIO_WIDTH_T eHdmiIf_GetAudioBitWidth(UINT8 u1Path);

/**
 * @brief        Get HDMI aspect ratio
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       HDMI aspect ratio
*/
extern UINT8 u1HdmiIf_GetAspectRatio(UINT8 u1Path);

/**
 * @brief        Get HDMI AFD
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       HDMI AFD
*/
extern UINT8 u1HdmiIf_GetAFD(UINT8 u1Path);

/**
 * @brief        Get HDMI deep color status
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       Enum for HDMI color depth, see HDMI_IF_COLOR_DEPTH_T
*/
extern HDMI_IF_COLOR_DEPTH_T eHdmiIf_GetDeepColorStatus(UINT8 u1Path);

/**
 * @brief        Check HDMI/DVI mode
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       Enum for HDMI/DVI mode, see HDMI_IF_MODE_T
*/
extern HDMI_IF_MODE_T u1HdmiIf_GetHdmiMode(UINT8 u1Path);

/**
 * @brief        Get HDMI audio frequency
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       Enum for HDMI audio frequency, see E_HDMI_IF_AUD_FREQUENCY
*/
extern E_HDMI_IF_AUD_FREQUENCY eHdmiIf_GetAudioFrequency(UINT8 u1Path);

/**
 * @brief        Check HDMI support audio
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       TRUE for support audio, FALSE fot not
*/
extern BOOL fgHdmiIf_IsSupportAudio(UINT8 u1Path);

/**
 * @brief        Check if HDMI audio is linear PCM
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       TRUE for linear PCM, FALSE for not
*/
extern BOOL fgHdmiIf_IsPcm(UINT8 u1Path);

/**
 * @brief        Not implemented
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval
*/
extern BOOL fgHdmiIf_IsMhlSignal(UINT8 u1Path);

/**
 * @brief        Check HDMI2.0 signal(4K 50/60p signal)
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       TRUE for HDMI2.0 signal, FALSE for not
*/
extern BOOL fgHdmiIf_IsHDMI2Signal(UINT8 u1Path);

/**
 * @brief        Get HDMI infoframe
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @param        u1FrameType---- Infoframe type, see HDMI_IF_INFOFRAME_TYPE
 * @param        *ptInfoFrame---- Pointer to infoframe structure, see HDMI_IF_INFOFRAME structure
 * @retval       TRUE for sucess to get required infoframe, FALSE for fail(usaully means no such infoframe is tramsmitted)
*/
extern BOOL fgHdmiIf_GetInfoframe(UINT8 u1Path, UINT8 u1FrameType, HDMI_IF_INFOFRAME *ptInfoFrame);


/**
 * @brief        Get HDMI audio channel number
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       HDMI audio channel number
*/
extern UINT8 u1HdmiIf_GetAudioChannelNum(UINT8 u1Path);

/**
 * @brief        Get HDMI signal format
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       0/1/2/3 are RGB/YC420/YC422/YC444 respectively, see enum typedef HDMI_IF_SINGAL_FORMAT
*/
extern HDMI_IF_SINGAL_FORMAT eHdmiIf_GetSignalFormat(UINT8 u1Path);

/**
 * @brief        Get HDMI RGB range
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       HDMI RGB range
*/
extern UINT8 u1HdmiIf_RgbRange(UINT8 u1Path);

/**
 * @brief        Check HDMI video/dvi timing
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       TRUE for video timing, FALSE for dvi timing
*/
extern BOOL fgHdmiIf_IsVideoTiming(UINT8 u1Path);
/**
 * @brief        Set HDMI ACP change call back function
 * @param        pfAcpChgCb---- Pointer to call back function
 * @param        pvTag---- Externed tag
*/
extern void vHdmiIf_SetAcpChgCb(HDMI_IF_ACP_CHG_CB pfAcpChgCb,void* pvTag);

/**
 * @brief        Get HDMI HDR EOTF value
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       HDMI HDR EOTF value
*/
extern UINT8 u1HdmiIf_GetHdrEOTF(UINT8 u1Path);
//#ifdef CC_MT5895
/**
 * @brief Get HDMI auto low latency mode(ALLM) config
 * @param u1Path
 * @retval
*/
extern UINT8 u1HdmiIf_GetAllmConfig(UINT8 u1Path);
//#endif
/**
 * @brief        Get the HDR metadata for HDMI
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @param        prHdrMetadata---- Pointer to HDR metadata struct
*/
extern void vHdmiIf_GetHdrMetadata(UINT8 u1Path,HDMI_IF_HDR_METADATA *prHdmiIfHdrMetadata);

/**
 * @brief        Get HDMI color space
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       Enum for HDMI color space, see HDMI_IF_CLR_SPC
*/
extern HDMI_IF_CLR_SPC eHdmiIf_GetColorSpace(UINT8 u1Path);
/**
 * @brief        Get HDMI Bit Rate
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       Bit Rate for hdmi
*/
extern UINT32 u4HdmiIf_GetBitRate(UINT8 u1Path);
/**
 * @brief        vHdmiIf_SetEDIDIndexByteByPort
                    Set EDID index for multi-edid switch purpose.
                    This API intends to set edid index for u1HdmiPort, but the behavior depends on the EDID hardware disign.
                    Some EDID hardware may not support edid index per port, then it will be same behavior as vHdmiIf_SetEDIDIndexByte.
 * @param        u1HdmiPort----  The hdmi port to set.
 * @param        u1EdidIndex---- The edid index to set.
 * @param        fgIsVirtualPort---- Virtual port(UI display) or physical port for u1HdmiPort.
*/
extern void vHdmiIf_SetEDIDIndexByteByPort(UINT8 u1HdmiPort,UINT8 u1EdidIndex,BOOL fgIsVirtualPort);

/**
 * @brief        vHdmiIf_SetEDIDIndexByte
                    Set EDID index for multi-edid switch purpose
                    This API impact all HDMI ports which support multi-edid switch.
 * @param        u1EdidIndex---- The edid index to set.
*/
extern void vHdmiIf_SetEDIDIndexByte(UINT8 u1EdidIndex);

/**
 * @brief        u1HdmiIf_GetEdidIndexByteByPort
                    Get EDID index for multi-edid switch purpose.
                    This API return current EDID index for u1HdmiPort.
 * @param        u1HdmiPort----  The hdmi port to get.
 * @param        fgIsVirtualPort---- Virtual port(UI display) or physical port for u1HdmiPort.
 * @retval       Current EDID index for u1HdmiPort
*/
extern UINT8 u1HdmiIf_GetEdidIndexByteByPort(UINT8 u1HdmiPort,BOOL fgIsVirtualPort);

/**
 * @brief        u1HdmiIf_GetEdidIndexByte
              This API return current EDID index.
 * @retval       Current EDID index
*/
extern UINT8 u1HdmiIf_GetEdidIndexByte(void);

/**
 * @brief        Get audio PCW mode
 * @retval       TRUE for HW mode, FALSE for SW mode
*/
extern BOOL fgHdmiIf_GetAudioPCWMode(void);

/**
 * @brief        Check HDCP/EDID data valid
 * @param        eParamCheckMode---- Enum for check items, see HDMI_IF__HDMI_PARAMS_CHECK_MODE_T
 * @retval       1 for valid, 0 for invalid
*/
extern UINT8 u1HdmiIf_ParamCheckValid(HDMI_IF__HDMI_PARAMS_CHECK_MODE_T eParamCheckMode);

/**
 * @brief        Check HDMI signal status
 * @param        u1Port---- HDMI port number
 * @param        fgIsVirtualPort---- TRUE for virtual port number, FALSE for physical port number
 * @retval       1 for HDMI has stable signal, 0 for no signal or unstable signal
*/
extern UINT8 u1HdmiIf_GetSignalStatus(UINT8 u1Port,BOOL fgIsVirtualPort);

/**
 * @brief        Get HDMI audio channel status
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @param        pfgCopyright---- Pointer to copy right info
 * @param        pu1CategoryCode---- Pointer to category code info
 * @param        p1WordLength---- Pointer to word length info
 * @param        pfgIsPcm---- Pointer to pcm info
*/
extern void vHdmiIf_GetAudChannelStatus(UINT8 u1Path,BOOL *pfgCopyright,UINT8 *pu1CategoryCode,UINT8 *p1WordLength,BOOL *pfgIsPcm);

/**
 * @brief        Handle the SAD data from CEC
 *           The EDID data might be change if needed, and the NO_SIGNAL state will be triggered if EDID data changed
 * @param        prSadSet---- Pointer to the SAD set data structure
*/
extern void vHdmiIf_SetSAD(HDMI_IF_SAD_SET_DATA *prSadSet);

/**
 * @brief        Get HDMI audio fifo status
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       0 for audio fifo is OK, 1 for audio fifo is underrun or overrun
*/
extern UINT8 u1HdmiIf_AudFifoStatus(UINT8 u1Path);

/**
 * @brief        Set HDMI APLL2 control
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @param        value1,value2,bSDINOVER---- Control parameters
*/
extern void vHdmiIf_AudioSigmaDeltaSetting(UINT8 u1Path,UINT32 value1,UINT8 value2,UINT8 bSDINOVR);

/**
 * @brief        Set HDMI APLL2 fine tune control
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @param        value1,value2,bSDINOVER---- Control parameters
*/
extern void vHdmiIf_AudioSigmaDeltaFineTuneSetting(UINT8 u1Path,UINT32 value1,UINT8 value2,UINT32 target,UINT8 bSDINOVR);

/**
 * @brief        Get Dolby EDR type
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @retval       The dolby EDR type. Currently implement as 0 for none-edr, 1 for with-edr.
*/
extern UINT8 u1HdmiIf_GetDolbyEdrType(UINT8 u1Path);

/**
 * @brief        Get HDMI Audio MODE status
 * @param        u1Path---- Video path number(SV_VP_MAIN/SV_VP_PIP or other invalid values for auto detect current active path)
 * @param        prMode---- Pointer to audio mode Enum, see HDMI_IF_AUD_MODE_T
 * @retval       TRUE for get sucess, FALE for get fail(means not implemented)
*/
extern BOOL fgHdmiIf_GetAudMode(UINT8 u1Path, HDMI_IF_AUD_MODE_T *prMode);

#ifndef CC_MT5895
/**
 * @brief u1HdmiIf_GetDolbyVision
 * @param u1Path
 * @retval
*/
extern UINT8 u1HdmiIf_GetDolbyVision(UINT8 u1Path);
#endif
/**
 * @brief u1HdmiIf_GetCAInfo
 * @param u1Path
 * @retval
*/
extern UINT8 u1HdmiIf_GetCAInfo(UINT8 u1Path, UINT8 *u1Data);

/**
 * @brief u1HdmiIf_GetActivePort
 * @param u1Path
 * @retval Port number
*/
//extern UINT8 u1HdmiIf_GetActivePort(UINT8 u1Path);

/**
 * @brief Reload HDCP key. Call this API after HDCP key is writen to storage.
 * @param eKeyType Refer to ENUM HDMI_IF_HDCP_KEY_TYPE_T
 * @retval
*/
extern void vHdmiIf_ReloadHDCPKey(HDMI_IF_HDCP_KEY_TYPE_T eKeyType);

/**
 * @brief Set HDCP key to storage.
 * @param eKeyType Refer to ENUM HDMI_IF_HDCP_KEY_TYPE_T
 * @param pu1KeyBuffer Pointer to key buffer
 * @param u4KeySize Key size
 * @retval
*/
extern BOOL fgHdmiIf_SetHdcpKey(HDMI_IF_HDCP_KEY_TYPE_T eKeyType, UINT8 *pu1KeyBuffer, UINT32 u4KeySize);
extern void vHdmiIf_ReplaceSad(HDMI_IF_SAD_SET_DATA *prSadSet);
#ifdef CC_MT5895
extern UINT8 u1HdmiIf_SetHdmiEdid(UINT8 u1EdidType, const UINT8* pu1HdmiEdid);
extern HDMI_IF_EARC_STATE eHdmiIf_HDMI2GetEarcState(void);
extern UINT8 u1HdmiIf_HDMI2SetEarcOnOff(UINT8 u1Status);
extern UINT8 u1HdmiIf_HDMI2SetEarcLatency(UINT8 u1Latency);
#endif

/**
 * @brief eHdmiIf_GetFRLRate
 * @param u1Path
 * @retval FRL Mode
*/
extern HDMI_IF_FRL_MODE_T eHdmiIf_GetFRLMode(UINT8 u1Path);

#endif
