#ifndef _DRV_MAPLE_API_H_
#define _DRV_MAPLE_API_H_

#include "general.h"
#include "util.h"
#include "hw_sw.h"
#include "hw_srs.h"
#include "video_def.h"
#include "pe_if.h"
#include "panel.h"
#include "drv_meter.h"
#include "drv_di.h"
#include "drv_dvi.h"
#include "drv_tdtv_drvif.h"
#include "drv_scaler.h"
#include "drv_mjc.h"
#include "drv_pq_cust.h"
#include "mute_if.h"

//////////////////////////////////////////////////////////////////


// drv_MapleGetApiSys.c 

typedef enum {    
    E_CUST_INPUT_TYPE_A_RF,   
    E_CUST_INPUT_TYPE_D_RF,
    E_CUST_INPUT_TYPE_COMPOSITE,
    E_CUST_INPUT_TYPE_COMPONENT,
    E_CUST_INPUT_TYPE_SCART,
    E_CUST_INPUT_TYPE_A_PC,
    E_CUST_INPUT_TYPE_HDMI,
    E_CUST_INPUT_TYPE_USB,
    E_CUST_INPUT_TYPE_DNLA,
    E_CUST_INPUT_TYPE_IPTV,
    E_CUST_INPUT_TYPE_BROWSER,
    E_CUST_INPUT_TYPE_WIFI_DISPLAY,
    E_CUST_INPUT_TYPE_UNKNOWN,
} E_CUST_INPUT_TYPE;

typedef struct {
    E_CUST_INPUT_TYPE	eMainInputType;
	E_CUST_INPUT_TYPE   eSubInputType;
} CUST_INPUT_TYPE_T;

typedef enum {    
    E_CUST_SIG_STA_STABLE,
    E_CUST_SIG_STA_NO_SIG,
    E_CUST_SIG_STA_UNKNOWN,
} E_CUST_SIG_STA;

typedef enum {
    E_CUST_CONTENT_TYPE_VIDEO,
    E_CUST_CONTENT_TYPE_PHOTO, // for Photo contents
    E_CUST_CONTENT_TYPE_GRAPHICS // for Analog PC, HDMI PC, Browser
} E_CUST_CONTENT_TYPE;

typedef enum {
    E_CUST_SCAN_TYPE_INTERLACE,
    E_CUST_SCAN_TYPE_PROGRESSIVE,
    E_CUST_SCAN_TYPE_UNKNOWN
} E_CUST_SCAN_TYPE;

typedef enum {
    E_CUST_COLOR_SYSTEM_NTSC_358,
    E_CUST_COLOR_SYSTEM_NTSC_443,
    E_CUST_COLOR_SYSTEM_PAL,
    E_CUST_COLOR_SYSTEM_SECAM,
    E_CUST_COLOR_SYSTEM_PAL_M,
    E_CUST_COLOR_SYSTEM_PAL_N,
    E_CUST_COLOR_SYSTEM_PAL60,
    E_CUST_COLOR_SYSTEM_UNKNOWN
} E_CUST_COLOR_SYSTEM;

typedef enum {
    E_CUST_FRAME_RATE_8,
    E_CUST_FRAME_RATE_10,
    E_CUST_FRAME_RATE_12,
    E_CUST_FRAME_RATE_15,
    E_CUST_FRAME_RATE_23_976,
    E_CUST_FRAME_RATE_24,
    E_CUST_FRAME_RATE_25,
    E_CUST_FRAME_RATE_29_97,
    E_CUST_FRAME_RATE_30,
    E_CUST_FRAME_RATE_48,
    E_CUST_FRAME_RATE_50,
    E_CUST_FRAME_RATE_59_94,
    E_CUST_FRAME_RATE_60,
    E_CUST_FRAME_RATE_96,
    E_CUST_FRAME_RATE_100,
    E_CUST_FRAME_RATE_120,
    E_CUST_FRAME_RATE_UNKNWON,
} E_CUST_FRAME_RATE;

typedef enum {
    E_CUST_STREAMING_TYPE_NORMAL,
    E_CUST_STREAMING_TYPE_ADAPTIVE, //Adaptive Streaming
} E_CUST_STREAMING_TYPE;

typedef enum {
    E_CUST_DIMENSION_2D,
    E_CUST_DIMENSION_3D,
    E_CUST_DIMENSION_UNKNOWN,
} E_CUST_DIMENSION;

typedef enum {
    E_CUST_3D_FMT_FS, // Frame Sequential
    E_CUST_3D_FMT_FP, // Frame Packing
    E_CUST_3D_FMT_TB, // Top and Bottom
    E_CUST_3D_FMT_SS, // Side by Side    
    E_CUST_3D_FMT_LI, // Line interleave
    E_CUST_3D_FMT_UNKNOWN,
} E_CUST_3D_FMT;

typedef enum {
    E_CUST_COLMT_601,
    E_CUST_COLMT_709,
    E_CUST_COLMT_2020,
    E_CUST_COLMT_UNKOWN,
} E_CUST_COLMT;

typedef enum {
    E_CUST_COL_FMT_RGB,
    E_CUST_COL_FMT_YUV_444,
    E_CUST_COL_FMT_YUV_422,
    E_CUST_COL_FMT_YUV_420,
    E_CUST_COL_FMT_UNKOWN,
} E_CUST_COL_FMT;

typedef enum {
    E_CUST_COL_DEPTH_8,
    E_CUST_COL_DEPTH_10,
    E_CUST_COL_DEPTH_12,
    E_CUST_COL_DEPTH_UNKNOWN,
} E_CUST_COL_DEPTH;

typedef enum {
    E_CUST_COL_SPACE_NORMAL,
    E_CUST_COL_SPACE_XV_COLOR,
    E_CUST_COL_SPACE_BT202C,
    E_CUST_COL_SPACE_BT2020,
    E_CUST_COL_SPACE_UNKNOWN,
} E_CUST_COL_SPACE;

typedef enum {
    E_CUST_PHOTO_COL_SPACE_SRGB,
    E_CUST_PHOTO_COL_SPACE_SYCC,
    E_CUST_PHOTO_COL_SPACE_ADOBE_RGB,
    E_CUST_PHOTO_COL_SPACE_UNKNOWN,
} E_CUST_PHOTO_COL_SPACE;

typedef enum {
    E_CUST_DRANGE_FULL,
    E_CUST_DRANGE_LIMITED,
    E_CUST_DRANGE_UNKNOWN,
} E_CUST_DRANGE;

typedef enum {
    E_CUST_ASPECT_4_3,
    E_CUST_ASPECT_16_9,
    E_CUST_ASPECT_14_9,
    E_CUST_ASPECT_UNKNOWN,
} E_CUST_ASPECT;


typedef enum {
    E_CUST_VDO_CODEC_MPEG1,
    E_CUST_VDO_CODEC_MPEG2,
    E_CUST_VDO_CODEC_MPEG4_VISUAL,
    E_CUST_VDO_CODEC_AVC,
    E_CUST_VDO_CODEC_HEVC,
    E_CUST_VDO_CODEC_AVS,
    E_CUST_VDO_CODEC_XVID,
    E_CUST_VDO_CODEC_VC1,
    E_CUST_VDO_CODEC_REAL,
    E_CUST_VDO_CODEC_VP8,
    E_CUST_VDO_CODEC_MOTION_JPEG,
    E_CUST_VDO_CODEC_JPEG,  // for photo
    E_CUST_VDO_CODEC_MPO,   // for photo
    E_CUST_VDO_CODEC_RAW,   // for photo
    E_CUST_VDO_CODEC_UNKNOWN,
} E_CUST_VDO_CODEC;

typedef enum {
E_CUST_CHROMA_SAMPLE_TYPE_0,
E_CUST_CHROMA_SAMPLE_TYPE_1,
E_CUST_CHROMA_SAMPLE_TYPE_2,
E_CUST_CHROMA_SAMPLE_TYPE_3,
E_CUST_CHROMA_SAMPLE_TYPE_4,
E_CUST_CHROMA_SAMPLE_TYPE_5,
E_CUST_CHROMA_SAMPLE_TYPE_INVALID,// Chroma sample type is invalid or color format is not YUV420
} E_CUST_CHROMA;

typedef enum
{
	E_CUST_HDR_TYPE_SDR,
	E_CUST_HDR_TYPE_HDR1,
	E_CUST_HDR_TYPE_HDR2,
	E_CUST_HDR_TYPE_UNKNOWN,
}E_CUST_HDR_TYPE;


typedef enum {
    E_CUST_HDMI_4K_PHOTO_OFF,
    E_CUST_HDMI_4K_PHOTO_ON,
} E_CUST_HDMI_4K_PHOTO;

typedef struct {
    E_CUST_SIG_STA  eSigSta;
    UINT32  u4Width;
    UINT32  u4Height;    
    UINT32  u4CodecWidth;
    UINT32  u4CodecHeight;
    E_CUST_CONTENT_TYPE eContentType;
    E_CUST_SCAN_TYPE    eScanType;
    E_CUST_COLOR_SYSTEM eColorSystem;
    E_CUST_FRAME_RATE   eFrameRate;
    E_CUST_STREAMING_TYPE   eStreamingType;
    E_CUST_DIMENSION    eDimension;
    E_CUST_3D_FMT   e3dFormat;
    E_CUST_COLMT    eColorimetry;
    E_CUST_COL_FMT  eColorFormat;
    E_CUST_COL_DEPTH    eColorDepth;
    E_CUST_COL_SPACE    eColorSpace;        //for video
    E_CUST_PHOTO_COL_SPACE  ePhotoColorSpace;   //for photo
    E_CUST_DRANGE   eDynamicRange;
    E_CUST_ASPECT   eAspect;
    E_CUST_VDO_CODEC    eVideoCodec;
	E_CUST_CHROMA	eCromaSample;
    E_CUST_HDMI_4K_PHOTO    eHdmi4kPhoto;
	E_CUST_HDR_TYPE eHDRType;
} CUST_SIG_FMT_T;

typedef enum {
    E_CUST_WINDOW_MODE_SINGLE,
    E_CUST_WINDOW_MODE_PIP,
    E_CUST_WINDOW_MODE_PAP,
} E_CUST_WINDOW_MODE;

typedef enum {
    E_CUST_MUTE_STATE_UNMUTE,
    E_CUST_MUTE_STATE_MUTE,
} E_CUST_MUTE_STATE;

typedef struct {
    E_CUST_MUTE_STATE	eMainMuteState;
    E_CUST_MUTE_STATE	eSubMuteState;
    E_CUST_MUTE_STATE	eVideoOutputMuteState;
    E_CUST_MUTE_STATE	eGfxOutputMuteState;
} CUST_MUTE_STATE_T;

typedef struct {
    UINT32	u4X;
    UINT32	u4Y;
    UINT32	u4Width;
    UINT32	u4Height;
} CUST_OUT_POSI_T;

typedef struct {
    UINT32	u4SrcX;
    UINT32	u4SrcY;
    UINT32	u4SrcWidth;
    UINT32	u4SrcHeight;
} CUST_SRC_AREA_T;

typedef struct {
    UINT32	u4DestX;
    UINT32	u4DestY;
    UINT32	u4DestWidth;
    UINT32	u4DestHeight;
} CUST_DEST_AREA_T;

typedef enum {
    E_CUST_PATH_PQ,
    E_CUST_PATH_BYPASS,
} E_CUST_PATH;

typedef struct {
    UINT32	u4Htotal;
    UINT32	u4Vtotal;
    UINT32	u4ActX;
    UINT32	u4ActY;
    UINT32	u4ActWidth;
    UINT32	u4ActHeight;
    E_CUST_FRAME_RATE	eFrameRate;
    E_CUST_DIMENSION	eDimension;
    E_CUST_3D_FMT	    e3dFormat;
    E_CUST_COLMT	    eColorimetry;
    E_CUST_COL_FMT	    eColorFormat;
    E_CUST_COL_DEPTH	eColorDepth;
    E_CUST_COL_SPACE	eColorSpace;
    E_CUST_DRANGE	    eDynamicRange;
    E_CUST_PATH         ePath;
	UINT8 	bCtrlBitValid;
} CUST_OUT_FMT_T;

typedef struct {
    UINT32	u4Htotal;
    UINT32	u4Vtotal;
    UINT32	u4ActX;
    UINT32	u4ActY;
    UINT32	u4ActWidth;
    UINT32	u4ActHeight;
    E_CUST_FRAME_RATE	eFrameRate;
} CUST_OUT_GFX_FMT_T;

typedef struct {
    UINT8	u1NoiseLevel;
    UINT8	u1BlockNoiseLevel;
    UINT32	u4FrmDiff;
    UINT8	u1FreqHpfH;    // TBD
    UINT8	u1FreqHpfV;    // TBD
    UINT8	u1FreqBpfH;    // TBD
} CUST_MCVP_METER_T;

typedef enum {
    E_CUST_CADENSE_32,
    E_CUST_CADENSE_22,
    E_CUST_CADENSE_2224,
    E_CUST_CADENSE_2332,
    E_CUST_CADENSE_32322,
    E_CUST_CADENSE_44,
    E_CUST_CADENSE_55,
    E_CUST_CADENSE_64,
    E_CUST_CADENSE_66,
    E_CUST_CADENSE_87,
    E_CUST_CADENSE_UNKOWN,
} E_CUST_CADENSE;


typedef struct {
    UINT32	u4X;
    UINT32	u4Y;
    UINT32	u4Width;
    UINT32	u4Height;
    UINT16	u2HueHistL[HUE_HIST_NUM];
    UINT16	u2SatHistL[SAT_HIST_NUM];
    UINT16	u2LumaHistL[65];
    UINT8	u1ASLL;
    UINT8	u1APLL;
    UINT16	u2HueHistR[HUE_HIST_NUM];
    UINT16	u2SatHistR[SAT_HIST_NUM];
    UINT16	u2LumaHistR[65];
    UINT8	u1ASLR;
    UINT8	u1APLR;
    UINT32	u4LumaSumL;
    UINT8	u1LumaMaxL;
    UINT8	u1LumaMinL;
    UINT32	u4LumaSumR;
    UINT8	u1LumaMaxR;
    UINT8	u1LumaMinR;
} CUST_POST_PROC_METER_T;

typedef struct {
    UINT8	u1LdMaxRGB[32];
    UINT16	u2LdMaxHist[33];
    UINT16	u2LdDimInfo[32];
} CUST_LD_METER_T;

typedef struct {
    UINT32	u4MCVP;
    UINT32	u4Scaler;
    UINT32	u4MJC;
} CUST_VDO_DELAY_INFO_T;

typedef struct {
    UINT32	u4TotalOpTime;
    UINT32	u4PanelOpTime;
} CUST_HISTORY_DATA_T;

typedef enum {
    E_CUST_PANEL_STATE_OFF,
    E_CUST_PANEL_STATE_ON,
} E_CUST_PANEL_STATE; 

typedef struct {
    E_CUST_PANEL_STATE	ePanelState;
} CUST_POWER_STATE_T;


// drv_MapleGetApiAp.c
typedef enum {
E_CUST_PIC_MODE_VIVID,
E_CUST_PIC_MODE_STANDARD,
E_CUST_PIC_MODE_CUSTOM,
E_CUST_PIC_MODE_CINEMA1,      //CINEMA_PRO
E_CUST_PIC_MODE_CINEMA2,      //CINEMA_HOME
E_CUST_PIC_MODE_SPORTS,
E_CUST_PIC_MODE_GAME_STD,
E_CUST_PIC_MODE_GAME_ORG,      // Not Used
E_CUST_PIC_MODE_GRAPHICS,
E_CUST_PIC_MODE_PHOTO_VIVID,
E_CUST_PIC_MODE_PHOTO_STD,
E_CUST_PIC_MODE_PHOTO_ORG,        // Not Used
E_CUST_PIC_MODE_PHOTO_CUST,
E_CUST_PIC_MODE_ANIME,
E_CUST_PIC_MODE_RESERVE1
} E_CUST_PIC_MODE;


typedef enum {
E_CUST_COL_TMP_COOL,
E_CUST_COL_TMP_NATURAL,
E_CUST_COL_TMP_WARM1,
E_CUST_COL_TMP_WARM2,  // Not Used
E_CUST_COL_TMP_EXPERT1,
E_CUST_COL_TMP_EXPERT2
} E_CUST_COL_TMP;


typedef enum {
    E_CUST_NOISE_REDUCTION_OFF,
    E_CUST_NOISE_REDUCTION_LOW,
    E_CUST_NOISE_REDUCTION_MID,
    E_CUST_NOISE_REDUCTION_HIGH,
    E_CUST_NOISE_REDUCTION_AUTO,
E_CUST_NOISE_REDUCTION_INTELLIGENT,
} E_CUST_NOISE_REDUCTION;

typedef enum {
    E_CUST_MPEG_NOISE_REDUCTION_OFF,
E_CUST_MPEG_NOISE_REDUCTION_LOW,
E_CUST_MPEG_NOISE_REDUCTION_MID,
    E_CUST_MPEG_NOISE_REDUCTION_HIGH,
E_CUST_MPEG_NOISE_REDUCTION_AUTO,
} E_CUST_MPEG_NOISE_REDUCTION;

typedef enum {
E_CUST_REALITY_CREATION_OFF,
E_CUST_REALITY_CREATION_MANUAL,
E_CUST_REALITY_CREATION_AUTO,
} E_CUST_REALITY_CREATION;

typedef enum {
E_CUST_MASTERED_IN_4K_OFF,
E_CUST_MASTERED_IN_4K_ON,
} E_CUST_MASTERED_IN_4K;

typedef enum {
    E_CUST_MOTION_FLOW_OFF,
    E_CUST_MOTION_FLOW_STANDARD,
E_CUST_MOTION_FLOW_SMOOTH,
E_CUST_MOTION_FLOW_CLEAR,
E_CUST_MOTION_FLOW_IMPLUSE,
E_CUST_MOTION_FLOW_TRUE_CINEMA,
E_CUST_MOTION_FLOW_CUSTOM,
} E_CUST_MOTION_FLOW;

typedef enum {
    E_CUST_FILM_MODE_OFF,
E_CUST_FILM_MODE_LOW,
E_CUST_FILM_MODE_MID,
E_CUST_FILM_MODE_HIGH,
} E_CUST_FILM_MODE;

typedef enum {
    E_CUST_ADV_CONTRAST_ENHANCER_OFF,
    E_CUST_ADV_CONTRAST_ENHANCER_LOW,
    E_CUST_ADV_CONTRAST_ENHANCER_MID,
    E_CUST_ADV_CONTRAST_ENHANCER_HIGH,
} E_CUST_ADV_CONTRAST_ENHANCER;

typedef enum {
    E_CUST_BLACK_CORRECTOR_OFF,
    E_CUST_BLACK_CORRECTOR_LOW,
    E_CUST_BLACK_CORRECTOR_MID,
    E_CUST_BLACK_CORRECTOR_HIGH,
} E_CUST_BLACK_CORRECTOR;

typedef enum {
E_CUST_LED_DYNAMIC_CTRL_OFF,
E_CUST_LED_DYNAMIC_CTRL_LOW,
E_CUST_LED_DYNAMIC_CTRL_MID,
E_CUST_LED_DYNAMIC_CTRL_HIGH,
} E_CUST_LED_DYNAMIC_CTRL;


typedef enum {
    E_CUST_LIVE_COLOR_OFF,
    E_CUST_LIVE_COLOR_LOW,
    E_CUST_LIVE_COLOR_MID,
    E_CUST_LIVE_COLOR_HIGH,
} E_CUST_LIVE_COLOR;

typedef enum {
E_CUST_SPEED_PREFERENCE_OFF,
E_CUST_SPEED_PREFERENCE_ON,
} E_CUST_SPEED_PREFERENCE;

typedef enum {
E_CUST_LED_MOTION_MODE_OFF,
E_CUST_LED_MOTION_MODE_ON,
} E_CUST_LED_MOTION_MODE;

typedef enum {
E_CUST_XDR_OFF,
E_CUST_XDR_LOW,
E_CUST_XDR_MID,
E_CUST_XDR_HIGH,
} E_CUST_XDR;

typedef enum {
E_CUST_DRANGE_UI_AUTO,
E_CUST_DRANGE_UI_FULL,
E_CUST_DRANGE_UI_LIMITED,
} E_CUST_DRANGE_UI;


typedef enum {
E_CUST_COL_SPACE_UI_AUTO,
E_CUST_COL_SPACE_UI_SRGB_709,
E_CUST_COL_SPACE_UI_DCI,
E_CUST_COL_SPACE_UI_ADOBE_RGB,
E_CUST_COL_SPACE_UI_2020,
} E_CUST_COL_SPACE_UI;

typedef struct {
    E_CUST_PIC_MODE	ePicMode;
    UINT8	u1Backlight;
    UINT8	u1Contrast;
    UINT8	u1Brightness;
    UINT8	u1Color;
    UINT8	u1Hue;
    UINT8	u1Sharpness;
    E_CUST_COL_TMP	eColTmp;
    E_CUST_NOISE_REDUCTION	eNoiseReduction;
    E_CUST_MPEG_NOISE_REDUCTION	eMpegNoiseReduction;
	E_CUST_REALITY_CREATION	eRealityCreation;
	E_CUST_MASTERED_IN_4K	eMasteredIn4K;
	INT16	i2Resolution;
	INT16	i2NoiseFiltering;
    E_CUST_MOTION_FLOW	eMotionFlow;
	INT16	i2MotionFlowSmoothness;
	INT16	i2MotionFlowClearness;
    E_CUST_FILM_MODE	eFilmMode;
    E_CUST_ADV_CONTRAST_ENHANCER    eAdvContrastEnhancer;
    E_CUST_BLACK_CORRECTOR	eBlackCorrector;
    INT16	i2Gamma;
	E_CUST_LED_DYNAMIC_CTRL	eLedDynamicCtrl;
    E_CUST_LIVE_COLOR	eLiveColor;
    INT16	i2RGain;
    INT16	i2GGain;
    INT16	i2BGain;
    INT16	i2RBias;
    INT16	i2GBias;
    INT16	i2BBias;
	E_CUST_SPEED_PREFERENCE	eSpeedPreference;
	E_CUST_LED_MOTION_MODE	eLedMotionMode;
	E_CUST_XDR				eXdr;
	E_CUST_DRANGE_UI		eDrange;
	E_CUST_COL_SPACE_UI		eColorSpace;
} CUST_PIC_SETTING_T;

typedef enum {
    E_CUST_WIDE_MODE_WIDE_ZOOM,
    E_CUST_WIDE_MODE_NORMAL,
    E_CUST_WIDE_MODE_FULL,
    E_CUST_WIDE_MODE_ZOOM,
    E_CUST_WIDE_MODE_14_9,
    E_CUST_WIDE_MODE_UNKNOWN,
} E_CUST_WIDE_MODE;

typedef enum {
    E_CUST_DISPLAY_AREA_FULL, //+1
    E_CUST_DISPLAY_AREA_NORMAL,
    E_CUST_DISPLAY_AREA_MINUS_1,
} E_CUST_DISPLAY_AREA;

typedef enum {
    E_CUST_ZOOM_1X,
    E_CUST_ZOOM_2X,
    E_CUST_ZOOM_4X,
    E_CUST_ZOOM_FULL,
    E_CUST_ZOOM_UNKNOWN, 
} E_CUST_ZOOM;

typedef enum {
    E_CUST_PC_WIDE_MODE_NORMAL,
    E_CUST_PC_WIDE_MODE_FULL1,
    E_CUST_PC_WIDE_MODE_FULL2,
    E_CUST_PC_WIDE_MODE_UNKNOWN,
} E_CUST_PC_WIDE_MODE;

typedef struct {
    E_CUST_WIDE_MODE	eWideMode;
    E_CUST_DISPLAY_AREA	eDisplayArea;
    INT16	i2HCenter;
    INT16	i2VCenter;
    INT16	i2VerticalSize;
    E_CUST_ZOOM eZoom; // For USB and IPTV contents
    E_CUST_PC_WIDE_MODE	ePcWIdeMode; // For PC
    INT16	i2PcPhase; // For PC
    INT16	i2PcPitch; // For PC
    INT16	i2PcHCenter; // For PC
    INT16	i2PcVCenter; // For PC
} CUST_SCREEN_SETTING_T;

typedef enum {
    E_CUST_3D_DISP_OFF,
    E_CUST_3D_DISP_SBS,
    E_CUST_3D_DISP_TAB,
    E_CUST_3D_DISP_ON,
} E_CUST_3D_DISPLAY;

typedef enum {
E_CUST_3D_GLASS_BRIGHTNESS_LOW,
E_CUST_3D_GLASS_BRIGHTNESS_MID,
E_CUST_3D_GLASS_BRIGHTNESS_HIGH,
} E_CUST_3D_GLASS_BRIGHTNESS;

typedef struct {
    E_CUST_3D_DISPLAY	e3dDisplay;
    INT16	i23dDepthAdjustment;
    E_CUST_3D_GLASS_BRIGHTNESS	e3dGlassBrightness;
} CUST_3D_SETTING_T;

typedef enum {
    E_CUST_POWER_SAVING_OFF,
    E_CUST_POWER_SAVING_LOW,
    E_CUST_POWER_SAVING_MID,
    E_CUST_POWER_SAVING_HIGH,
    E_CUST_POWER_SAVING_PICTURE_OFF,
} E_CUST_POWER_SAVING;

typedef enum {
    E_CUST_LIGHT_SENSOR_OFF,
    E_CUST_LIGHT_SENSOR_ON,
} E_CUST_LIGHT_SENSOR;

typedef struct {
    E_CUST_POWER_SAVING	ePowerSaving;
    E_CUST_LIGHT_SENSOR	eLightSensor;
} CUST_ECO_SETTING_T;

typedef struct {
    UINT32 u4TBD;
} CUST_PHOTO_SETTING_T;

typedef enum {
E_CUST_DEMO_MODE_OFF,
E_CUST_DEMO_MODE_STANDBY,
E_CUST_DEMO_MODE_X_REALITY,
E_CUST_DEMO_MODE_X_REALITY_2,
E_CUST_DEMO_MODE_MOTION_FLOW,
E_CUST_DEMO_MODE_MOTION_FLOW_2,
E_CUST_DEMO_MODE_TRILUMINOUS,
E_CUST_DEMO_MODE_XDR,
E_CUST_DEMO_MODE_XDR_BL,
} E_CUST_DEMO_MODE;

typedef enum {
E_CUST_DEMO_PATTERN_NONE,
E_CUST_DEMO_PATTERN_SPLIT_L_ON,
E_CUST_DEMO_PATTERN_SPLIT_R_ON,
E_CUST_DEMO_PATTERN_SPLIT_2,
E_CUST_DEMO_PATTERN_ACT_1,
E_CUST_DEMO_PATTERN_ACT_2,
E_CUST_DEMO_PATTERN_ACT_3,
E_CUST_DEMO_PATTERN_FULL_ON,
E_CUST_DEMO_PATTERN_FULL_OFF,
} E_CUST_DEMO_PATTERN;

typedef struct {
    E_CUST_DEMO_MODE eDemoMode;	
	E_CUST_DEMO_PATTERN eDemoPattern;
	UINT32	u4DemoOption;
} CUST_DEMO_MODE_T;

typedef struct {
    UINT16 u2X;
    UINT16 u2Y;
    UINT16 u2Width;
    UINT16 u2Height;
} CUST_RECT_AREA_T;

typedef struct {
	UINT8	u1Num;
	CUST_RECT_AREA_T	rectArea[8];
	UINT8	b4KCoordinate;    
} CUST_DEMO_OSD_MASK_T;

typedef struct {
    UINT16	u2RGain;
    UINT16	u2GGain;
    UINT16	u2BGain;
    UINT16	u2ROffset;
    UINT16	u2GOffset;
    UINT16	u2BOffset;
} CUST_SERVICE_SETTING_T;

typedef enum {
	E_CUST_SERVICE_TRANS_SOC_TO_TCON,
	E_CUST_SERVICE_TRANS_TCON_TO_SOC,
	E_CUST_SERVICE_TRANS_INITIALIZE,
	E_CUST_SERVICE_TRANS_NONE,
} E_CUST_SERVICE_TRANS;

typedef struct {
    E_CUST_SERVICE_TRANS	eWBTransferMode;
    E_CUST_SERVICE_TRANS	eMuraTransferMode;
    E_CUST_SERVICE_TRANS	eCUCTransferMode;
} CUST_SERVICE_TRANS_T;

typedef struct {
    UINT8	bMode;
    UINT16	u2Data;
} CUST_SERVICE_VCOM_T;

typedef struct {
    UINT16	i2ROffset1;
    UINT16	i2ROffset2;
	UINT16	i2ROffset3;
	UINT16	i2ROffset4;
	UINT16	i2ROffset5;
	UINT16	i2ROffset6;
	UINT16	i2ROffset7;
	UINT16	i2ROffset8;
	UINT16	i2ROffset9;
	UINT16	i2ROffset10;
	UINT16	i2GOffset1;
    UINT16	i2GOffset2;
	UINT16	i2GOffset3;
	UINT16	i2GOffset4;
	UINT16	i2GOffset5;
	UINT16	i2GOffset6;
	UINT16	i2GOffset7;
	UINT16	i2GOffset8;
	UINT16	i2GOffset9;
	UINT16	i2GOffset10;
	UINT16	i2BOffset1;
    UINT16	i2BOffset2;
	UINT16	i2BOffset3;
	UINT16	i2BOffset4;
	UINT16	i2BOffset5;
	UINT16	i2BOffset6;
	UINT16	i2BOffset7;
	UINT16	i2BOffset8;
	UINT16	i2BOffset9;
	UINT16	i2BOffset10;
} CUST_WB_OFFSET_T;

typedef struct {
    UINT8	bDelayMode;
} CUST_BT_SETTING_T;


typedef struct {
    UINT16	u2RGain;
    UINT16	u2GGain;
    UINT16	u2BGain;
    UINT16	u2ROffset;
    UINT16	u2GOffset;
    UINT16	u2BOffset;
} CUST_RGB_GAIN_OFST_T;

typedef enum {
    E_CUST_RESET_REBOOT,
    E_CUST_RESET_SHUTDOWN,
} E_CUST_RESET;
#if 0
typedef enum {
E_CUST_BE_SCL_TYPE_PQ,
E_CUST_BE_SCL_TYPE_VIDEO,
E_CUST_BE_SCL_TYPE_GFX,
E_CUST_BE_SCL_TYPE_INVALID,
} E_CUST_BE_SCL_TYPE;
#endif
typedef enum {
E_CUST_RESULT_OK,
E_CUST_RESULT_ERROR_NOT_READY,
E_CUST_RESULT_ERROR_INSUFFICIENT_RESOURCES,
E_CUST_RESULT_ERROR_RESOURCES_PREEMPTED,
E_CUST_RESULT_ERROR_BAD_PARAMETER,
E_CUST_RESULT_MAX,
} E_CUST_RESULT;

typedef enum {
E_CUST_UI_INPUT_TARGET_DEFAULT,
E_CUST_UI_INPUT_TARGET_PHOTO_APP,
E_CUST_UI_INPUT_TARGET_VIDEO_APP,
E_CUST_UI_INPUT_TARGET_GEN_APP,
E_CUST_UI_INPUT_TARGET_WIFI_DISPLAY,
E_CUST_UI_INPUT_TARGET_VIDEO_CHAT,
E_CUST_UI_INPUT_TARGET_GAME_APP,
E_CUST_UI_INPUT_TARGET_UNKNOWN,
}E_CUST_UI_INPUT_TARGET;


typedef struct {
UINT8  u1PlaneOrder;
UINT32 u4SrcX;
UINT32 u4SrcY;
UINT32 u4SrcWidth;
UINT32 u4SrcHeight;
UINT32 u4DestX;
UINT32 u4DestY;
UINT32 u4DestWidth;
UINT32 u4DestHeight;
} CUST_BE_SCL_CONFIG_T;


typedef struct _SONY_PQ_FUNC_T
{
    void (*pq_post_out_vsync_isr_func)(void);                        // DRVCUST_PostOutVSyncISR(void)
    void (*pq_post_de_end_isr_func)(void);                           // DRVCUST_PostDEEndISR(void)
    void (*pq_out_vsync_isr_func)(void);                             // DRVCUST_OutVSyncISR(void)
    void (*pq_vdo_in_isr_func)(void);                                // DRVCUST_VdoInISR(void)
    void (*pq_video_main_loop_func)(void);                           // DRVCUST_VideoMainloop(void)
    void (*pq_vdo_mode_chg_done_func)(void);                         // DRVCUST_VdoModeChgDone(UINT8 bPath)
    void (*pq_send_event_func)(E_CUST_EVENT, UINT8);                 // Trigger Event
    void (*pq_associate_path)(UINT8 , UINT8);                         // Notify logical path ID for Physical path ID
    void (*pq_dissociate_path)(UINT8);
    void (*pq_send_ecs_func)(UINT8* , UINT32);                       // ECS Command
} SONY_PQ_FUNC_T;


typedef struct _SONY_BE_FUNC_T
{
    void (*be_send_event_func)(E_CUST_EVENT, UINT8);
    void (*be_receive_from_pq)(UINT8* , UINT32);    
    void (*be_send_ecs_func)(UINT8* , UINT32); 
    void (*be_panel_power_func)(BOOL);
    E_CUST_RESULT (*be_allocate_resource)(UINT8 , E_CUST_BE_SCL_TYPE , CUST_BE_SCL_CONFIG_T* , UINT8*);
    E_CUST_RESULT (*be_free_resource)(UINT8);
    E_CUST_RESULT (*be_associate_path)(UINT8 , UINT8);
    E_CUST_RESULT (*be_dissociate_path)(UINT8 , UINT8);
} SONY_BE_FUNC_T;

typedef struct _SONY_BE_GEN_FUNC_T
{
   void (*be_set_general_data)(UINT8*, UINT8);
   void (*be_get_general_data)(UINT8*, UINT8*) ; //Maximum size is 255. Please allocate 255byte data area before calling get API.
   void (*be_set_color_pickup_data)(INT16, INT16);
   void (*be_get_color_pickup_data)(INT16*, INT16*, INT16*);
} SONY_BE_GEN_FUNC_T;


EXTERN UINT8* SRS_Table_A;
EXTERN UINT8* SRS_Table_B;

typedef enum {
	E_CUST_PART_DDRI,
	E_CUST_PART_MLFW,
	E_CUST_PART_LDAT,
	E_CUST_PART_MAFW,
	E_CUST_PART_DFW1,
	E_CUST_PART_DFW2,
	E_CUST_PART_PDAT,
	E_CUST_PART_BDAT,
	E_CUST_PART_NDAT,
	E_CUST_PART_FDAT,
	E_CUST_PART_UDAT,	
	E_CUST_PART_BDIX,
	E_CUST_PART_MINF,
	E_CUST_PART_BEDAT,
	E_CUST_PART_RSV1,
	E_CUST_PART_RSV2,
	E_CUST_PART_RSV3,
	E_CUST_PART_RSV4,
	E_CUST_PART_MAX,
} E_CUST_BE_PART;

typedef enum {
    PANEL_INFO,
    BE_SW_VERSION,
 }E_BE_DEVICE;

typedef enum {
    E_CUST_TCON_ERR,
    E_CUST_P_ID_ERR,
    E_CUST_VLED_ERR,
    E_CUST_LD_ERR_ADC,
    E_CUST_BACKLIGHT_ERR,
    E_CUST_SOFTWARE_ERR,
    E_CUST_EXT_FRC_ERR, //2K Model Ext. FRC Error
    E_CUST_4KBE_ERR,
    E_CUST_TUNER_DEMOD_ERR,
 }E_BE_ERROR_DETECT;


typedef struct {
	UINT16 u2LDDimTable[33];
	UINT16 u2LDGainTable[41];
	UINT16 u2LDGainLimitTable[33];
} CUST_LD_HW_TABLE_T;

typedef struct {
	UINT16 u2LDGainLimitTable_LOW_BND[33];
	UINT16 u2LDGainLimitTable_UP_BND[33];
} CUST_LD_SW_TABLE_T;

typedef struct {
	UINT16  u2max_pxl_th; 
    UINT8   u1dim_wet_0; 
    UINT8   u1dim_wet_1; 
    UINT8   u1dim_wet_2; 
    UINT8   u1dim_wet_3; 
    UINT8   u1dim_wet_4; 
    UINT8   u1rgb_weight; 
    UINT8   u1rgb_weight2; 
    UINT8   u1lpf_weight; 
    UINT8   u1blkinfo_weight; 
    UINT8   u1maxinfo_lpf_mode; 
    UINT16  u2max_dim; 
    UINT16  u2min_dim; 
    UINT8   u1dy_dim_slope; 
    UINT8   u1max_up_dim_step; 
    UINT8   u1max_dn_dim_step;    
	UINT16	u2max_diff_thd; 
	UINT16	u2total_diff_thd; 
	UINT16	u2avg_diff_thd; 
} CUST_LD_HW_PARAM_T;

typedef struct {
	UINT8   u1lcdim_speed_ctrl_en; 
    UINT8   u1osd_detect; 
    UINT8   u1motion_th; 
    UINT16  u2max_diff_thd2; 
    UINT16  u2total_diff_thd2; 
    UINT16  u2avg_diff_thd2; 
    UINT8   u1scg_wait_th; 
    UINT8   u1motion_penalty; 
    UINT8   u1gamma_penalty; 
    UINT8   u1static_step; 
    UINT8   u1maxrgb_step_low; 
    UINT8   u1maxrgb_step_mid_dn; 
    UINT8   u1maxrgb_step_mid_up; 
    UINT8   u1maxrgb_step_high; 
    UINT8   u1predet_apl_th_low; 
    UINT8   u1predet_apl_th_high; 
    UINT8   u1predet_apl_th_ostg; 
    UINT8   u1predet_step; 
    UINT8   u1predet_frame_th; 
    UINT8   u1fadein_det_dark_th; 
    UINT8   u1fadein_det_inc_th; 
    UINT8   u1fadein_step; 
    UINT8   u1confidence_th0; 
    UINT8   u1confidence_th1; 
    UINT8   u1confidence_th2; 
    UINT8   u1confidence_th3; 
    UINT8   u1confidence_thdft; 
    UINT8   u1lcdim_max_up_dim_step_low; 
    UINT8   u1lcdim_max_up_dim_step_mid_dn; 
    UINT8   u1lcdim_max_up_dim_step_mid_up; 
    UINT8   u1lcdim_max_up_dim_step_high; 
    UINT8   u1lcdim_max_dn_dim_step_low; 
    UINT8   u1lcdim_max_dn_dim_step_mid_dn; 
    UINT8   u1lcdim_max_dn_dim_step_mid_up; 
    UINT8   u1lcdim_max_dn_dim_step_high; 
    UINT8   u1lcdim_dy_dim_slope_low; 
    UINT8   u1lcdim_dy_dim_slope_mid_dn; 
    UINT8   u1lcdim_dy_dim_slope_mid_up; 
    UINT8   u1lcdim_dy_dim_slope_high; 
    UINT8   u1lcdim_adap_mindim; 
    UINT8   u1dist_th; 
    UINT8   u1apl_th; 
    UINT8   u1adap_weight_0_l; 
    UINT8   u1adap_weight_1_l; 
    UINT8   u1adap_weight_2_l; 
    UINT8   u1adap_weight_3_l; 
    UINT8   u1adap_weight_4_l; 
    UINT8   u1adap_weight_0_h; 
    UINT8   u1adap_weight_1_h; 
    UINT8   u1adap_weight_2_h; 
    UINT8   u1adap_weight_3_h; 
    UINT8   u1adap_weight_4_h; 
    UINT8   u1adv_ps_en; 
    UINT8   u1adv_ps_ratio; 
    UINT8   u1scg_iir_en; 
    UINT8   u1iir_sel; 
    UINT8   u1downtrend_dim_th; 
    UINT8   u1scg_enable; 
    UINT8   u1boost_0; 
    UINT8   u1boost_1; 
    UINT8   u1boost_2;
} CUST_LD_SW_PARAM_T;


typedef struct {
    UINT8 u1GainH[3];
    UINT8 u1GainV[3];
    UINT8 u1GainD[3];
    UINT8 u1CorzH[3];
    UINT8 u1CorzV[3];
    UINT8 u1CorzD[3];
	UINT8 u1HSHPGainLow[2];
    UINT8 u1HSHPGainMid[2];
    UINT8 u1HSHPGainHigh[2];
    UINT8 u1HSHPCor[3];
    UINT8 u1EdgeGain[3];
    UINT8 u1DetailGain[3];
	UINT8 u1LTIGain[3];
    UINT8 u1LTICorz[3];
} CUST_SHARP_OFST_T;

typedef enum {
	E_CUST_ADC_PORT_SCART_FS,
	E_CUST_ADC_PORT_KEY,
	E_CUST_ADC_PORT_LIGHT_SENSOR,
	E_CUST_ADC_PORT_PANEL_PWR_DET,
	E_CUST_ADC_PORT_BL_ERR_DET,
	E_CUST_ADC_PORT_USB_OC2_DET,
	E_CUST_ADC_PORT_RF_AGCI,
	E_CUST_ADC_PORT_X_SYSTEM_RST,
	E_CUST_ADC_PORT_12V_DET,
	E_CUST_ADC_PORT_5V_DET,
} E_CUST_ADC_PORT;

typedef enum {
	E_CUST_SCREEN_SAVER_MODE_0,
	E_CUST_SCREEN_SAVER_MODE_1,
	E_CUST_SCREEN_SAVER_MODE_2,
	E_CUST_SCREEN_SAVER_MODE_3,
	E_CUST_SCREEN_SAVER_MODE_4,
} E_CUST_SCREEN_SAVER_MODE;

typedef enum {
	CUST_SCR_MIRROR_PROTOCOL_UDP,
	CUST_SCR_MIRROR_PROTOCOL_TCP,
	CUST_SCR_MIRROR_PROTOCOL_UNKNOWN,
} E_CUST_SCR_MIRROR_PROTOCOL;


typedef struct {
	E_CUST_SCREEN_SAVER_MODE eScreenSaverMode;
} CUST_SCREEN_SAVER_T;

typedef struct {
	UINT8 bAgingMode;
} CUST_AGING_MODE_T;

typedef struct {
	E_CUST_DIMENSION eDimension;
} CUST_TV_OUT_FMT_T;

typedef struct{
    UINT32 u4Width;
    UINT32 u4Height;
}CUST_AREA_T;

typedef struct{
	CUST_AREA_T   t_DownScalerInput ;
	CUST_AREA_T   t_DownScalerOutput;
	CUST_AREA_T   t_ScalerInput;
	CUST_AREA_T   t_ScalerOutput;
}
CUST_SCL_AREA_T;

typedef struct{
    E_CUST_SCR_MIRROR_PROTOCOL eProtocol;
}CUST_SCR_MIRROR_CONFIG_T;

typedef enum {
E_CUST_PIC_CONTROL_DISABLE,
E_CUST_PIC_CONTROL_ENABLE,
}E_CUST_PIC_CONTROL_STATE;


// drv_MapleGetApiSys.c
E_CUST_INPUT_TYPE DRVCUST_GetInputType(UINT8 bPath);
void DRVCUST_GetSignalFormat(UINT8 bPath, CUST_SIG_FMT_T* pSignalFormat);
UINT8 DRVCUST_GetAnalogDecNoiseLevel(UINT8 bPath);
UINT32 DRVCUST_GetDecoderAvgBitRate(UINT8 ucEsId);
E_CUST_WINDOW_MODE DRVCUST_GetWindowMode(void);
E_CUST_MUTE_STATE DRVCUST_GetPlaneMuteState(UINT8 bPath);
E_CUST_MUTE_STATE DRVCUST_GetOutputMuteState(UINT8 u1TxPath);
void DRVCUST_GetOutputPosition(UINT8 bPath, CUST_OUT_POSI_T* pOutPosition);
void DRVCUST_GetSourceArea(UINT8 u1BeHandle, CUST_SRC_AREA_T* pSclReq);
void DRVCUST_GetScalingRequest(UINT8 u1BeHandle, CUST_DEST_AREA_T* pSclReq);
void DRVCUST_GetOutputFormat(UINT8 u1TxPath, CUST_OUT_FMT_T* pOutFmt);
UINT8 DRVCUST_GetBorderPlaneRequest(UINT8 u1BeHandle);
UINT8 DRVCUST_GetBlurRequest(UINT8 u1BeHandle);
void DRVCUST_GetMCVPMeter(CUST_MCVP_METER_T* pMcvpMeter);
E_CUST_CADENSE DRVCUST_GetCadense(void);
E_CUST_FRAME_RATE DRVCUST_GetMJCInputFrequency(void);
void DRVCUST_GetPostProcMeter(CUST_POST_PROC_METER_T* pPostProcMeter);
void DRVCUST_GetLdMeter(CUST_LD_METER_T* pLdMeter);
UINT8 DRVCUST_GetOpticalSensorLevel(void);
UINT8 DRVCUST_GetTemperatureSensorLevel(void);
UINT8 DRVCUST_GetBLPowerLimit(void);
UINT8 DRVCUST_GetPwmSetting(void);
void DRVCUST_GetVideoFrameDelay(CUST_VDO_DELAY_INFO_T* pVdoDelayInfo);
void DRVCUST_GetHistoryData(CUST_HISTORY_DATA_T* pHistoryData);
void DRVCUST_GetPowerState(CUST_POWER_STATE_T* pPowerState);
UINT32 DRVCUST_BePartitionRead(E_CUST_BE_PART ePartId, UINT32 u4Offset, VOID *pvBuf, UINT32 u4BufSize);
UINT16 DRVCUST_GetAdcValue(E_CUST_ADC_PORT eAdcPort);
void DRVCUST_GetScreenSaver(CUST_SCREEN_SAVER_T* pScreenSaver);
void DRVCUST_GetAgingMode(CUST_AGING_MODE_T* pAgingMode);
void DRVCUST_GetTvOutputFormat(CUST_TV_OUT_FMT_T* pTvOutFmt);
void DRVCUST_GetMuffinScalerInfo(UINT8 bPath, CUST_SCL_AREA_T* pScalerArea);
void DRVCUST_GetOsdState(BOOL* bOsdState);
void DRVCUST_GetModelVariationInfoStartAddress(UINT32* pAddress);
void DRVCUST_GetScreenMirroringConfig(UINT8 bPath, CUST_SCR_MIRROR_CONFIG_T* pScrMirrorConfig);



// drv_MapleGetApiAp.c
void DRVCUST_GetPictureSetting(CUST_PIC_SETTING_T* pPictureSetting);
void DRVCUST_GetScreenSetting(CUST_SCREEN_SETTING_T* pScreenSetting);
void DRVCUST_Get3DSetting(CUST_3D_SETTING_T* p3dSetting);
void DRVCUST_GetEcoSetting(CUST_ECO_SETTING_T* pEcoSetting);
void DRVCUST_GetPhotoSetting(CUST_PHOTO_SETTING_T* pPhotoSetting);
void DRVCUST_GetDemoMode(CUST_DEMO_MODE_T* pDemoMode);
void DRVCUST_GetDemoOsdMaskArea(CUST_DEMO_OSD_MASK_T* pOsdMask);
void DRVCUST_GetServiceSetting(CUST_SERVICE_SETTING_T* pServiceSetting);
void DRVCUST_GetServiceTransferSetting(CUST_SERVICE_TRANS_T* pServiceTrans);
void DRVCUST_GetServiceVcomAdjust(CUST_SERVICE_VCOM_T* pServiceVcom);
E_CUST_UI_INPUT_TARGET DRVCUST_GetUiInputTarget(void);
void DRVCUST_GetWhiteBalanceOffset(CUST_WB_OFFSET_T* pWbOffset);
void DRVCUST_GetBTSetting(CUST_BT_SETTING_T* pBtSetting);
void DRVCUST_GetPicControlState(E_CUST_PIC_CONTROL_STATE *pPicControlState);

// drv_MapleSetApi.c
void DRVCUST_SetExclusiveReg(UINT8 u1Enable);
void DRVCUST_SetLumaCurve(const UINT16* waLArray, const UINT16* waSkinLArray);
void DRVCUST_SetContrast(UINT16 u2Value);
void DRVCUST_SetColor(UINT16 u2Value);
void DRVCUST_SetHue(UINT16 u2Value);
void DRVCUST_SetPqWBGainOffset(CUST_RGB_GAIN_OFST_T* pstRgbGainOfst);
void DRVCUST_SetSharpnessOffset(CUST_SHARP_OFST_T* pSharpOfst);
void DRVCUST_SetSRSLut(UINT8* pTableA, UINT8* pTableB);
UINT8 DRVCUST_FlushPqSetting(void);
void DRVCUST_EnNoiseLevel(UINT8 u1Enable);
void DRVCUST_SetNoiseLevel(UINT8 u1NoiseLevel);
void DRVCUST_SetPostSharpYLev(UINT8* pYLev);
void DRVCUST_UpdateTimingGroup(UINT8* pCustSrcTimingTbl, UINT8* pCustSrcGroup);
void DRVCUST_PqSendDataToBe(UINT8* pData, UINT32 u4Size);
void DRVCUST_RegisterPqFunc(SONY_PQ_FUNC_T *pq_func);
void DRVCUST_DeregisterPqFunc(void);
void DRVCUST_RegisterBeFunc(SONY_BE_FUNC_T *be_func);
void DRVCUST_DeregisterBeFunc(void);
void DRVCUST_RegisterBeGeneralFunc (SONY_BE_GEN_FUNC_T* be_gen_func);
void DRVCUST_DeregisterBeGeneralFunc(void);
void DRVCUST_ResetSystem(E_CUST_RESET eReset);
void DRVCUST_SetEcsCommandReply(UINT8* pData, UINT32 u4Size);
UINT32 DRVCUST_BePartitionWrite(E_CUST_BE_PART ePartId, UINT32 u4Offset, VOID *pvBuf, UINT32 u4BufSize);
void DRVCUST_SetBeDeviceErrorDetect(E_BE_ERROR_DETECT Efactor);
void DRV_CUST_SetBEDeviceVersion(UINT8 u1Number, UINT8* pVersion);
void DRVCUST_SetBeDeviceInformation(E_BE_DEVICE device, VOID* pParam, UINT32 size);
void DRVCUST_SetPqColMatrixParam(UINT8 u1Upof_ext, UINT8 u1Ucof_ext,UINT8 u1Ubof_ext );
void DRVCUST_SetPqNewPartialS(UINT8* u1PointL, UINT8* u1PointM, UINT8* u1PointH);
void DRVCUST_SetPqPartialY(UINT8* u1Point);
void DRVCUST_SetScalerCoefLumaH(UINT32* u4Array);
void DRVCUST_SetScalerCoefChromaH(UINT32* u4Array);
void DRVCUST_SetScalerCoefLumaV(UINT32* u4Array);
void DRVCUST_SetScalerCoefChromaV(UINT32* u4Array);
void DRVCUST_SetLdHwParam(CUST_LD_HW_PARAM_T* pLDHWParam);
void DRVCUST_SetLdSwParam(CUST_LD_SW_PARAM_T* pLDSWParam);
void DRVCUST_SetLdHwTable(CUST_LD_HW_TABLE_T* pLDHWTable);
void DRVCUST_SetLdSwTable(CUST_LD_SW_TABLE_T* pLDSWTable);
void DRVCUST_SetPqSwVersion(UINT8* pData);



// backlight control

UINT32 DRVCUST_GetBLPwmFrequency(UINT8 u1Channel);
UINT16 DRVCUST_GetBLPwmDuty(UINT8 u1Channel);
void DRVCUST_GetBLScanPwmNumberOfPulses(UINT16* pulseNumber);
void DRVCUST_GetBLScanPwmDuty(UINT16* ratio);
void DRVCUST_GetBLScanPwmPhase(UINT32* commonPhase, INT32* phase);
void DRVCUST_InitBLScanPWM(UINT16 pulseNumber, UINT16 ratio, UINT32 commonPhase, INT32 phase);
UINT8 DRVCUST_GetBLPwmMode(UINT8 channel);
UINT8 DRVCUST_GetBLControlState(void);
void DRVCUST_SetBLPwmFrequency(UINT8 u1Channel, UINT32 u4TimeBase);
void DRVCUST_SetBLPwmDuty(UINT8 u1Channel, UINT16 u2Ratio);
void DRVCUST_SetBLScanPwmNumberOfPulses(UINT16* pulseNumber);
void DRVCUST_SetBLScanPwmDuty(UINT16* ratio);
void DRVCUST_SetBLScanPwmPhase(UINT32* commonPhase, INT32* phase);
void DRVCUST_SetBLPwmMode(UINT8 channel, UINT8 mode);
UINT8 DRVCUST_SetBLHeaderFooter(UINT32 u4CmdHeader, UINT32 u4CmdFooter);

// Gamma table
void DRVCUST_GetWBGammaTable(UINT8 u1Index, UINT16 * pData);
void DRVCUST_SetWBGammaTable(UINT8 u1Index, UINT16 * pData);

UINT8 DRVCUST_SuperGameMode(UINT32 u4VdpId);
#endif //_DRV_MAPLE_API_H_

