/*----------------------------------------------------------------------------*
 * No Warranty                                                                *
 * Except as may be otherwise agreed to in writing, no warranties of any      *
 * kind, whether express or implied, are given by MTK with respect to any MTK *
 * Deliverables or any use thereof, and MTK Deliverables are provided on an   *
 * "AS IS" basis.  MTK hereby expressly disclaims all such warranties,        *
 * including any implied warranties of merchantability, non-infringement and  *
 * fitness for a particular purpose and any warranties arising out of course  *
 * of performance, course of dealing or usage of trade.  Parties further      *
 * acknowledge that Company may, either presently and/or in the future,       *
 * instruct MTK to assist it in the development and the implementation, in    *
 * accordance with Company's designs, of certain softwares relating to        *
 * Company's product(s) (the "Services").  Except as may be otherwise agreed  *
 * to in writing, no warranties of any kind, whether express or implied, are  *
 * given by MTK with respect to the Services provided, and the Services are   *
 * provided on an "AS IS" basis.  Company further acknowledges that the       *
 * Services may contain errors, that testing is important and Company is      *
 * solely responsible for fully testing the Services and/or derivatives       *
 * thereof before they are used, sublicensed or distributed.  Should there be *
 * any third party action brought against MTK, arising out of or relating to  *
 * the Services, Company agree to fully indemnify and hold MTK harmless.      *
 * If the parties mutually agree to enter into or continue a business         *
 * relationship or other arrangement, the terms and conditions set forth      *
 * hereunder shall remain effective and, unless explicitly stated otherwise,  *
 * shall prevail in the event of a conflict in the terms in any agreements    *
 * entered into between the parties.                                          *
 *---------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------
 * Copyright (c) 2004, MediaTek Inc.
 * All rights reserved.
 *
 * Unauthorized use, practice, perform, copy, distribution, reproduction,
 * or disclosure of this information in whole or in part is prohibited.
 *-----------------------------------------------------------------------------
 * $RCSfile: Waff;e_d_custom.c,v $
 * $Revision: #3 $
 * $Date: 2017/10/16 $
 * $Author: sakamoto $
 *
 * Description:
 *         This header file contains specific implementation.
 *---------------------------------------------------------------------------*/

//----------------------------------------------------------------------------
// Check direct compile this file
//----------------------------------------------------------------------------
#ifndef NO_IMP
#define NO_IMP
#include "drvcust_lib.c"
#define IMP_MAPLE_D_CUSTOM_C
#endif  /* NO_IMP */
#include "macro_helper.h"

//-----------------------------------------------------------------------------
//                    include files
// ----------------------------------------------------------------------------
#ifdef TARGET_SPEC_DRV_CUST_CUSTOMIZED_HDR_FILE
#include TARGET_SPEC_DRV_CUST_CUSTOMIZED_HDR_FILE
#endif
#include "sv_const.h"
#include "nptv_debug.h"
#include "nptv_drvif.h"
#include "drv_tvd.h"
#include "pe_if.h"
#include "vdp_if.h"
#include "mute_if.h"	//wwj
#include "dmx_if.h"		//wwj
#include "vdo_if.h"		//wwj
#include "vdec_if.h"
#include "x_drv_cli.h"
#include "x_pdwnc.h"
#include "aud_if.h"
#include "aud_cfg.h"
#ifdef CC_AUD_SAKURA_RENDER
#include "aud_dsp_cfg.h"
#endif /* CC_AUD_SAKURA_RENDER */
#include "aud_hw.h"
#include "panel.h"
#include "x_gpio.h"
#ifdef CC_MAPLE_CUST_DRV
#include "bepqapi.h"
#include "drv_MapleApi.h"
#include "drv_MapleAudApi.h"
#endif
#if SUPPORT_SCART
#include "drv_scart.h"
#endif
#ifdef CC_SONY_GAMMA
#include "u_drv_cust.h"
#include "ATV/priv_drv/sony_drv_inc/rgb_if.h"
#include "ATV/priv_drv/sony_drv_inc/sig_bstr_if.h"
#include "ATV/priv_drv/sony_drv_inc/temp_setup_if.h"
#include "ATV/priv_drv/sony_drv_inc/a_bl_ctrl.h"
#include "ATV/priv_drv/sony_drv_inc/utility_if.h"
#include "ATV/priv_drv/sony_drv_inc/htl_clk_if.h"
#include "ATV/priv_drv/sony_drv_inc/htl_vol_if.h"
#include "ATV/priv_drv/sony_drv_inc/htl_si_if.h"
#include "ATV/priv_drv/sony_drv_inc/sony_tuner_if.h"
#include "ATV/priv_drv/sony_drv_inc/wb_pbm.h"
#include "ATV/priv_drv/sony_drv_inc/pq_gamma_if.h"
#include "ATV/priv_drv/sony_priv_inc/pq_gamma.h"
#endif
#ifdef CC_MSDC_ENABLE
#include "msdc_if.h"
#endif
#include "drvcust_if.h"

#ifdef SYS_MHL_SUPPORT
#ifndef CC_MT5893
#include "cbus_if.h"
#include "mhl_if.h"

#if defined(CC_MT5882) || defined(CC_MT5883)
#include "drv_cbus_cpi_if.h"
#else
#include "drv_cbus_if.h"
#endif
#endif
#endif

#include "drv_edid.h"
#include "hdmi_if.h"
#include "panel_cust.h"
#include "drv_display.h"
#ifdef CC_AUD_ARM_SUPPORT
#include "sakura_aud_aq_data.h"
#endif
#include "cec_if.h"
#if defined(CC_AUD_SX1_FEATURE) || (defined (CC_MAPLE_CUST_DRV))
#include "adac_if.h"
#endif

#if defined(CC_HDMI_EARC_SUPPORT)&&!defined(CC_UBOOT)&&!defined(CC_MTK_LOADER)
#include "hdmi_earc_if.h"
#endif

#include "nim_drvif.h"

//----------------------------------------------------------------------------
// Check direct compile this file
//----------------------------------------------------------------------------
#ifdef IMP_MAPLE_D_CUSTOM_C
#undef NO_IMP
#include "macro_helper.h"
#endif  /* IMP_MAPLE_D_CUSTOM_C */
//No more #include after this point!!

//---------------------------------------------------------------------------
// Constant definitions
//---------------------------------------------------------------------------
#ifdef CC_SONY_GAMMA 
#ifdef IMP_MAPLE_D_CUSTOM_C
BOOL fgPicModeGame_5893 = FALSE;

static UINT32 u4_WB_EDID_Write_return = 0;
static Gamma_RGB_t Current_Gamma_RGB = GAMMA_R;
static Luma_Lvl_t Current_Luma_Lvl = LUMA_LVL_0;
static BOOL fgGammaRefreshFirstcall=TRUE;
static WBS_NVM_ENV_T Current_Wbs_Nvm_Env = {0};
static WB_PBM_PQP_LUT_PRESET_T Current_Pqp_Lut_setting = {0};
#endif  /* IMP_MAPLE_D_CUSTOM_C */
#endif
#ifdef CC_MAPLE_CUST_DRV
extern CUST_PIC_SETTING_T      rApPicSetting;
extern CUST_3D_SETTING_T       rAp3DSetting;
extern E_CUST_PIC_CONTROL_STATE CUST_PIC_CONTROL_STATE;
VAR_MACRO(UINT8 gWFDProtocol, = 0);
VAR_MACRO(D_AP_BT_DELAY_MODE gBTDelay, = 0);

VAR_MACRO(UINT8 gAgingInit, = 0);
VAR_MACRO(UINT8 gServiceInit, = 0);

#endif

VAR_MACRO(UINT32 au4Country, = 0);
VAR_MACRO(BOOL _fg_scart_factory, = FALSE);

#if  defined(SYS_DVBS_SUPPORT) && defined(CC_Factory2K12)//api for dvbs factory
//extern  void TunerDVBSFac_SetLnbVol(UINT8 u1Vol);
extern void TunerDVBSFac_SetLnbVol(UINT8 TunerID, UINT8 u1Vol);
//extern void TunerDVBSFac_GetLnbVol(UINT8 *pu1Vol);
extern void TunerDVBSFac_GetLnbVol(UINT8 TunerID, UINT8 *pu1Vol);
//extern void TunerDVBSFac_GetLnbShortStatus(UINT8 *pbshort);
extern void TunerDVBSFac_GetLnbShortStatus(UINT8 TunerID, UINT8 *pbshort);
//extern void TunerDVBSFac_Set22K(UINT8 u1On);
extern void TunerDVBSFac_Set22K(UINT8 TunerID, UINT8 u1On);
//extern void TunerDVBSFac_GetLnb22KStatus(UINT8 *pb22kOn);
extern void TunerDVBSFac_GetLnb22KStatus(UINT8 TunerID, UINT8 *pb22kOn);
//extern void TunerDVBSFac_SetDemodClock(UINT8 u1ClockOn);
extern void TunerDVBSFac_SetDemodClock(UINT8 TunerID, UINT8 u1ClockOn);
//extern BOOL TunerDVBSFac_GetDemodMountStatus(void);
extern BOOL TunerDVBSFac_GetDemodMountStatus(UINT8 TunerID);
//extern BOOL TunerDVBSFac_GetLNBMountStatus(void);
extern BOOL TunerDVBSFac_GetLNBMountStatus(UINT8 TunerID);
#endif
extern UINT32 QueryICPartNo(void);

#ifndef CC_MTK_LOADER    
extern void vUpdateLedFixPattern(UINT8 u1Fixpattern);
#endif
#ifdef CC_Factory2K12_Debug
extern INT32 c_sprintf (CHAR*        ps_str,
                        const CHAR*  ps_format,
                        ...);
extern CHAR fact_dbg_buf[128];  
extern void fact_show_msg(void);
#define Factory2K12Debug(x)	(x); fact_show_msg();
#else
#define Factory2K12Debug(x) 
#endif

MOD_MACRO UINT8 buf_HDCP2x[880];
//UINT16 hdcp2x_received = 0;
MOD_MACRO CUST_COLOR_ADJUST_T bufColorAdust;
MOD_MACRO CUST_WB_OFFSET_20P_EN_T bufWB_OFFSET_20P_EN;

extern UINT32 eventCode;
#ifdef CC_DUAL_TUNER_SUPPORT
extern uint32_t ui4_factory_agc_s;//Add for factory tune.
extern uint32_t ui4_factory_agc_t;//Add for factory tune.
#endif

extern void APSetCountryValue(AUD_APP_COUNTRY_SEL u4CountryType);
extern void QueryFRCVersion(UINT8 *pOut);
extern UINT8 QueryFRCVersionLength(void);
extern UINT8 IsPanelMode(void);
extern INT32 QueryBEDeviceVersion(UINT8 * pOut);
extern UINT8 QueryBEDeviceVersionNum(void);
//extern void vSetScartYPbPrParamUser(UINT8 u1Param);
//extern UINT8 vGetScartYPbPrParamUser(void);
extern UINT8 u1SonyFactoryMode;

extern void vHDMIEDIDSetHFVSDBFlag(UINT8 *pu1hfvsdbInfo);
extern void vHDMIEDIDGetHFVSDBFlag(UINT8 *pu1hfvsdbInfo);
extern void vHDMIEDIDGetLDDDP(UINT8 *pu1LDDP);
extern void vHDMIEDIDSetLDDDP(UINT8 *pu1LDDP);
#ifndef CC_IGNORE_ANDROID_IR_TRUNCATE
extern void CustomSetPowerKeyScanCode(UINT8 puAdd,UINT8 puNum, UINT32 puScanCode);
#endif

extern UINT32 DRVCUST_Get_InterMemc_type(void);

//---------------------------------------------------------------------------
// Type definitions
//---------------------------------------------------------------------------
#define ENABLE_SOEM_PQ 1
#define ENABLE_SOEM_HDMI 1
//---------------------------------------------------------------------------
// Macro definitions
//---------------------------------------------------------------------------
#define SIZE_CHK(size, target_size)                                   \
          do {                                              \
            if (size != sizeof(target_size)) { \
                LOG(2, "Invalid parameter\n");\
                return RMR_INV_ARG; }     \
          } while (0)

#define PARAM_CHK(ptr, type, limit)  \
          do {                                              \
            if ((ptr == NULL) || ((*(type *)(ptr)) >= limit))\
            {\
                    LOG(2, "Invalid parameter\n");\
                    return RMR_INV_ARG;\
            } } while (0)

#define INPUT_CHK(ptr, size, target_size)                                   \
          do {                                              \
            if ((ptr == NULL) || (size != target_size)) { \
                Printf("Invalid parameter pv_set_info=%x z_size=%d target=%d\n",ptr,size,target_size);\
                return RMR_INV_ARG; }     \
          } while (0)
//---------------------------------------------------------------------------
// Static variables
//---------------------------------------------------------------------------
#ifdef IMP_MAPLE_D_CUSTOM_C
#if 0 
static UINT32 u4_WB_EDID_Write_return = 0;
static Gamma_RGB_t Current_Gamma_RGB = GAMMA_R;
static Luma_Lvl_t Current_Luma_Lvl = LUMA_LVL_0;
static BOOL fgGammaRefreshFirstcall=TRUE;
static WBS_NVM_ENV_T Current_Wbs_Nvm_Env = {0};
static WB_PBM_PQP_LUT_PRESET_T Current_Pqp_Lut_setting = {0};
#endif
static UINT16 gu2Pick_x, gu2Pick_y;

static UINT8 ui1_factory_tune_dtmb_num = 0;
#endif  /* IMP_MAPLE_D_CUSTOM_C */

//---------------------------------------------------------------------------
// Global variables
//---------------------------------------------------------------------------
extern UINT32 _u4gModelType;
extern UINT8  _u1gModelRegion;


MOD_MACRO CHAR szTagStr[DRV_CUSTOM_TAG_TYPE_MAX][20]
#ifdef IMP_MAPLE_D_CUSTOM_C
={
	"load",
	"firm", 
	"pqda", 
	"pnel", 
	"aqda",
	"ueep",
	"uimg",
	"nvrm",
	"edid",
	"upbt",
	"mhl"
  }
#endif  /* IMP_MAPLE_D_CUSTOM_C */
;
        
//---------------------------------------------------------------------------
// Internal functions
//---------------------------------------------------------------------------
extern void vGetTagVersion(CHAR* ucTagName, CHAR * szVerStr);
//#ifdef CC_SONY_GAMMA
#if 0//def CC_SONY_GAMMA
FUN_MACRO(UINT16 WB_PBM_CoefGet(UINT32 u4_rgb_idx,UINT32 u4_pt_idx))
#ifdef IMP_MAPLE_D_CUSTOM_C
{
    UINT16 u2Val=0;

    u2Val = (UINT16)(u4_rgb_idx + u4_pt_idx);
	//u2Val = 0;
    return u2Val;
}
#endif  /* IMP_MAPLE_D_CUSTOM_C */
#endif

#if ENABLE_SOEM_PQ
//extern void DRVCUST_DBC_DEBUG_MODE(UINT8 bDBC_MAGIC, UINT8 bBrightLevel);//Weibin mark, dynamic backlight related no need on Sakura, it controlled by Sony lib
extern UINT16 bDrvGetTVDADCDGain(void);
#endif
#if ENABLE_SOEM_HDMI
#define SIF_HDCPWithSerialNum		340
//extern UINT8 SifEDIDRead(UINT8 u1EDID_ID, UINT16 u2Count, UINT8 u1Dev, UINT8 u1Addr, UINT8 * pbData);  // allen add  marked by wangle for build pass
#ifdef IMP_MAPLE_D_CUSTOM_C
static UINT8 SifHDCPWrite(UINT16 u2_offset, UINT8 *pBuf, UINT16 u2_length)  // jiewen.hdcp
{
	INT32 fgSet;

    fgSet = EEPHDCP_Write(0, (UINT32)pBuf, SIF_HDCPWithSerialNum);
	if (fgSet)
	{
		Printf("EEPHDCP_Write fail.\n");
		return 1;
	}

	Printf("write successfully !\n");
	return 0;
}
#endif  /* IMP_MAPLE_D_CUSTOM_C */

#ifdef IMP_MAPLE_D_CUSTOM_C
static UINT8 SifHDCPRead(UINT16 u2_offset, UINT8 *pBuf, UINT16 u2_length)  // jiewen.hdcp
{
	INT32 fgSet;

	fgSet = EEPHDCP_Read(u2_offset, (UINT32)pBuf, u2_length);
	if (fgSet)
	{
		Printf("read fail.\n");
		return 1;
	}
	return 0;
}
#endif  /* IMP_MAPLE_D_CUSTOM_C */

#endif

#ifdef IMP_MAPLE_D_CUSTOM_C
static UINT8 count(UINT8 bksv)
{
    int n = 0;
    if(bksv == 0)
       n=0;
    else if(bksv == 1)
       n = 1;
    else if((bksv+1)%2==0)
       n=count(bksv/2)+1;
    else if(bksv%2==0)
       n=count(bksv+1)-1;
    return n;
}
#endif  /* IMP_MAPLE_D_CUSTOM_C */

#ifdef IMP_MAPLE_D_CUSTOM_C
static void HdmiCec_Sendcmd(void)
{
    Printf("[D-Interface]HdmiCec_Sendcmd.\n");
    UINT8 errcode;
    CEC_FRAME_DESCRIPTION prFrame;

    UINT32 u4CECTxTag = 0;

    prFrame.size = 5;
    prFrame.sendidx = 0;
    prFrame.reTXcnt = 0;
    prFrame.txtag = (void*)u4CECTxTag++;
    prFrame.blocks.header.initiator = 0x00; // TV
    prFrame.blocks.header.destination = 0x0F; //JIG
    prFrame.blocks.opcode = 0x87;
    prFrame.blocks.operand[0] = 0x08;
    prFrame.blocks.operand[1] = 0x00;
    prFrame.blocks.operand[2] = 0x46;
    
    do
    {
        errcode = CEC_EnqueueTx(&prFrame);
        if (errcode)
        {
            // wait for a while and retry.
            x_thread_delay(100);

            Printf("[D-Interface]CEC_EnqueueTx retry.\n");
        }
    }while(errcode);

    Printf("[D-Interface]HdmiCec_Sendcmd finished.\n");
}
#endif  /* IMP_MAPLE_D_CUSTOM_C */

#ifdef IMP_MAPLE_D_CUSTOM_C
static void HdmiCec_RxResult(CEC_FRAME_DESCRIPTION* frame)
{
    UINT32 i;
    
    Printf("[D-Interface]Rx frame size=%d, txtag=0x%08X.\n", 
        frame->size, (UINT32)frame->txtag);
    Printf("[D-Interface]Rx initiator=0x%X, destination=0x%X.\n", 
        frame->blocks.header.initiator, frame->blocks.header.destination);
    if (frame->size > 1)
    {
        Printf("[D-Interface]Rx opcode=0x%X.\n", frame->blocks.opcode);

        if ((frame->size > 2) && (frame->size <= 16))
        {
            Printf("[D-Interface]Rx operand= ");
            for (i=0;i<(frame->size-2); i++)
            {
                Printf("0x%02X, ", frame->blocks.operand[i]);
            }
            Printf("\n\n");
        }
        
        if ( frame->blocks.opcode == 0x8C )
        {
            HdmiCec_Sendcmd();
            Printf("Finished Tx\n");
        }
    } 
}
#endif  /* IMP_MAPLE_D_CUSTOM_C */

#ifdef IMP_MAPLE_D_CUSTOM_C
static void HdmiCec_TxResult(UINT8 result, CEC_FRAME_DESCRIPTION *frame,void* txtag)
{
    Printf("[D-Interface]Tx result=%d, frame size=%d, txtag=0x%08X.\n", result, frame->size, (UINT32)txtag);
    Printf("[D-Interface]Tx initiator=0x%X, destination=0x%X.\n", frame->blocks.header.initiator, frame->blocks.header.destination);
    Printf("[D-Interface]Tx opcode=0x%02X.\n", frame->blocks.opcode);
    Printf("[D-Interface]Tx operand = 0x%02X, 0x%02X, 0x%02X.\n", frame->blocks.operand[0], frame->blocks.operand[1], frame->blocks.operand[2]);
}
#endif  /* IMP_MAPLE_D_CUSTOM_C */

//---------------------------------------------------------------------------
// Global functions
//---------------------------------------------------------------------------
FUN_MACRO(INT32 d_maple_cust_spec_set (
    DRV_CUSTOM_CUST_SPEC_TYPE_T    e_cust_spec_type,
    VOID*                          pv_set_info,
    SIZE_T                         z_size,
    BOOL                           b_store
))
#ifdef IMP_MAPLE_D_CUSTOM_C
{
    INT32 i4_ret = RMR_OK;

    if ( e_cust_spec_type >= DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R00 && e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B56 )
    {
        if ( e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R56)
        {
            WB_PBM_CoefSet(0, e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R00, *(UINT16*)pv_set_info);
        }
        else if ( e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G56 )
        {
            WB_PBM_CoefSet(1, e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G00, *(UINT16*)pv_set_info);
        }
        else
        {
            WB_PBM_CoefSet(2, e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B00, *(UINT16*)pv_set_info);
        }
        return i4_ret;
    }
    if ( e_cust_spec_type >= DRV_CUSTOM_CUST_SPEC_TYPE_WB_GAM0_R_00 && e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_WB_GAM0_B_10 )
    {
        if (e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_WB_GAM0_R_10)
        {
            WB_TRACK_GAM0_RGB_SET(0, e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_WB_GAM0_R_00, *(UINT8*)pv_set_info);
        }
        else if (e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_WB_GAM0_G_10)
        {
            WB_TRACK_GAM0_RGB_SET(1, e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_WB_GAM0_G_00, *(UINT8*)pv_set_info);
        }
        else
        {
            WB_TRACK_GAM0_RGB_SET(2, e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_WB_GAM0_B_00, *(UINT8*)pv_set_info);
        }
        return i4_ret;
    }
    if ( e_cust_spec_type >= DRV_CUSTOM_CUST_SPEC_TYPE_INP_LVL_WB_00 && e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_INP_LVL_WB_10 )
    {
        WB_TRACK_INP_LVL_SET(e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_INP_LVL_WB_00, *(UINT16*)pv_set_info);
        return i4_ret;
    }
    if ( e_cust_spec_type >= DRV_CUSTOM_CUST_SPEC_TYPE_WB_GAM_GAIN_00 && e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_WB_GAM_GAIN_10 )
    {
        WB_TRACK_GAM_GAIN_SET(e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_WB_GAM_GAIN_00, *(UINT8*)pv_set_info);
        return i4_ret;
    }
    if ( e_cust_spec_type >= DRV_CUSTOM_CUST_SPEC_TYPE_WB_OFST_R00 && e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_WB_OFST_B10 )
    {
        if ( e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_WB_OFST_R10)
        {
           WB_TRACK_OFST_RGB_SET(0, e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_WB_OFST_R00, *(UINT8*)pv_set_info);
        }
        else if ( e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_WB_OFST_G10 )
        {
           WB_TRACK_OFST_RGB_SET(1, e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_WB_OFST_G00, *(UINT8*)pv_set_info);
        }
        else
        {
           WB_TRACK_OFST_RGB_SET(2, e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_WB_OFST_B00, *(UINT8*)pv_set_info);
        }
        return i4_ret;
    }
    #ifdef CC_MAPLE_CUST_DRV
    //Only for Sakura, Salvia NO need
    if ( e_cust_spec_type >= DRV_CUSTOM_CUST_SPEC_TYPE_GAMMA_UI_OFST_R00 && e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_GAMMA_UI_OFST_B20 )
    {
        if ( e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_GAMMA_UI_OFST_R20)
        {
            DRVCUST_GAMMA_Ofst_ADJ_UI(0, e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_GAMMA_UI_OFST_R00, *(UINT8*)pv_set_info);
        }
        else if ( e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_GAMMA_UI_OFST_G20 )
        {
            DRVCUST_GAMMA_Ofst_ADJ_UI(1, e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_GAMMA_UI_OFST_G00, *(UINT8*)pv_set_info);
        }
        else
        {
            DRVCUST_GAMMA_Ofst_ADJ_UI(2, e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_GAMMA_UI_OFST_B00, *(UINT8*)pv_set_info);
        }
        return i4_ret;
    }
    #endif
		
    switch (e_cust_spec_type)
    {
        case DRV_CUSTOM_CUST_SPEC_TYPE_APP_COUNTRY:
        {
			#ifdef CC_PAA_GET_COUNTRY_SUPPORT
            PFN_SET_PAA_COUNTRY pf_country_sel = NULL;
            
            SIZE_CHK(z_size, UINT32); 
            if (pv_set_info == NULL)
            {
                LOG(2, "Invalid parameter\n");
                return -1;              
            }

            if (DRVCUST_InitQuery(ePaaCountrySetFunc, (UINT32 *)(void *)&( pf_country_sel))==0)
            {
                UINT32 ui4Country;
            
                ui4Country = (UINT32)*((UINT32*)pv_set_info);
                if (pf_country_sel != NULL)
                {
                    pf_country_sel((UINT8)ui4Country);
                }
                else
                {
                    return -1;
                }
            }
            else
            {
                return -1;
            }
            #endif
            break;
       }
#if 1	//wwj_modify_for_input_performance step 1 ignore unnecessary pic mode update	// improve gamma UI offset update
	   case DRV_CUSTOM_CUST_SPEC_TYPE_GAMMA_UI_OFST_UPDATE_ALL:
	   {
			if (z_size != sizeof(DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL))
			{
				return (-1);
			}

			LOG(1,"[INPUT_SPEED] DRV_CUSTOM_CUST_SPEC_TYPE_GAMMA_UI_OFST_UPDATE_ALL begin,time=%d\n", x_os_get_sys_tick() * x_os_get_sys_tick_period());

			//Printf("[INPUT_SPEED] DRV_CUSTOM_CUST_SPEC_TYPE_GAMMA_UI_OFST_UPDATE_ALL ui1_gamma_ui_ofst_r01 = %d \n", ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_r01);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(0, 1, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_r01);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(0, 2, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_r02);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(0, 3, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_r03);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(0, 4, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_r04);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(0, 5, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_r05);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(0, 6, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_r06);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(0, 7, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_r07);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(0, 8, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_r08);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(0, 9, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_r09);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(0, 10, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_r10);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(0, 11, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_r11);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(0, 12, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_r12);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(0, 13, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_r13);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(0, 14, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_r14);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(0, 15, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_r15);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(0, 16, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_r16);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(0, 17, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_r17);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(0, 18, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_r18);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(0, 19, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_r19);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(0, 20, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_r20);

			//Printf("[INPUT_SPEED] DRV_CUSTOM_CUST_SPEC_TYPE_GAMMA_UI_OFST_UPDATE_ALL ui1_gamma_ui_ofst_g01 = %d \n", ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_g01);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(1, 1, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_g01);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(1, 2, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_g02);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(1, 3, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_g03);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(1, 4, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_g04);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(1, 5, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_g05);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(1, 6, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_g06);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(1, 7, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_g07);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(1, 8, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_g08);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(1, 9, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_g09);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(1, 10, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_g10);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(1, 11, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_g11);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(1, 12, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_g12);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(1, 13, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_g13);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(1, 14, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_g14);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(1, 15, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_g15);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(1, 16, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_g16);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(1, 17, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_g17);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(1, 18, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_g18);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(1, 19, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_g19);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(1, 20, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_g20);

			//Printf("[INPUT_SPEED] DRV_CUSTOM_CUST_SPEC_TYPE_GAMMA_UI_OFST_UPDATE_ALL ui1_gamma_ui_ofst_b01 = %d \n", ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_b01);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(2, 1, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_b01);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(2, 2, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_b02);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(2, 3, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_b03);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(2, 4, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_b04);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(2, 5, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_b05);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(2, 6, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_b06);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(2, 7, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_b07);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(2, 8, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_b08);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(2, 9, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_b09);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(2, 10, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_b10);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(2, 11, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_b11);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(2, 12, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_b12);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(2, 13, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_b13);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(2, 14, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_b14);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(2, 15, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_b15);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(2, 16, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_b16);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(2, 17, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_b17);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(2, 18, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_b18);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(2, 19, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_b19);
			DRVCUST_GAMMA_Ofst_ADJ_UI_GLOBLE(2, 20, ((DRV_CUSTOM_GAMMA_UI_OFST_UPDATE_ALL *)pv_set_info)->ui1_gamma_ui_ofst_b20);
			DRVCUST_GAMMA_Ofst_ADJ_UI_Write2EEP();
			LOG(1,"[INPUT_SPEED] DRV_CUSTOM_CUST_SPEC_TYPE_GAMMA_UI_OFST_UPDATE_ALL end,time=%d\n", x_os_get_sys_tick() * x_os_get_sys_tick_period());
			
			break;
	   } 
#endif
		
	   case DRV_CUSTOM_CUST_SPEC_SET_GAMMA_REFRESH:
	   {
			if (z_size != sizeof(DRV_CUSTOM_GAMMA_REFRESH_T))
			{
				return (-1);
			}
			if (((DRV_CUSTOM_GAMMA_REFRESH_T *)pv_set_info)->ui1_OnOff)
			{
				DRVCUST_SET_GAMMA();
			}
			break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_SET_WB_GAMMA_ORIGINAL:
	   {
			if (z_size != sizeof(DRV_CUSTOM_GAMMA_WB_TYPE_T))
			{
				return (-1);
			}
			vDrvGammaOnOff(((DRV_CUSTOM_GAMMA_WB_TYPE_T *)pv_set_info)->ui1_gamma_onoff);
			break;
	   }
	   case DRV_CUSTOM_SPEC_TYPE_DBC_DEBUG:
	   {
			if (z_size != sizeof(DRV_CUSTOM_DBC_DEBUG_T))
				{
					return (-1);
				}
			#if ENABLE_SOEM_PQ
			//DRVCUST_DBC_DEBUG_MODE(((DRV_CUSTOM_DBC_DEBUG_T *)pv_set_info)->ui1DBC_MAGIC,
			//	((DRV_CUSTOM_DBC_DEBUG_T *)pv_set_info)->ui1BrightLevel);		 
            #endif		 		 
			break;
	   }
#if 0
       case DRV_CUSTOM_CUST_SPEC_TYPE_MMP_MODE:
       {
            SIZE_CHK(z_size, UINT8); 
            PARAM_CHK(pv_set_info, UINT8, NUM_OF_MMP_MODE);
            #if ENABLE_SOEM_PQ
            //DRVCUST_USBPHOTO_MODE((*(UINT8 *)pv_set_info));
            #endif           
            break;
       }
       case DRV_CUSTOM_CUST_SPEC_TYPE_MMP_OSD_STATE:
       {
            SIZE_CHK(z_size, UINT8); 
            PARAM_CHK(pv_set_info, UINT8, NUM_OF_MMP_OSD_STATE); 
            #if ENABLE_SOEM_PQ 
            //DRVCUST_USBOSD_MODE((*(UINT8 *)pv_set_info));           
            #endif           
            break;
       }
       case DRV_CUSTOM_CUST_SPEC_TYPE_MMP_PHOTO_FRAME_MODE:    // add for sony, 0x0: out of  photo frame mode,  0x1: in photo frame mode
        {        	
			 //DRVCUST_SetPhotoFrameMode(( *(UINT8*)pv_set_info));
        }
       case DRV_CUSTOM_CUST_SPEC_TYPE_OSD_TYPE:
       {
            SIZE_CHK(z_size, UINT8); 
            PARAM_CHK(pv_set_info, UINT8, NUM_OF_OSD_TYPE);
            #if ENABLE_SOEM_PQ 
            DRVCUST_EPG_FLAG((*(UINT8 *)pv_set_info));
            #endif           
            break;
       }     
       case DRV_CUSTOM_CUST_SPEC_TYPE_FM_RADIO_STATE:
       {
            SIZE_CHK(z_size, UINT8); 
            PARAM_CHK(pv_set_info, UINT8, NUM_OF_FM_RADIO_STATE);
            #if ENABLE_SOEM_PQ 
            //DRVCUST_FMRADIO_FLAG((*(UINT8 *)pv_set_info));
            #endif
            break;
       }
#endif
       case DRV_CUSTOM_CUST_SPEC_INIT_FAC_RESET_TUNER:
	   {		
	   		CLI_Parser("nim.c"); 			// stop video decoder main path
            x_thread_delay(100);         
            CLI_Parser("nim.o");			// disable Vdp main	
            x_thread_delay(500);
			break;					 
	   }
       case DRV_CUSTOM_CUST_SPEC_TYPE_HOTEL_UART_PINMUX_EN:		
	   {
	   		BOOL	bEnableHT_UART = FALSE;
				
	   		SIZE_CHK(z_size, BOOL); 
            if (pv_set_info == NULL)
            {
                LOG(2, "Invalid parameter\n");
                return -1;              
            }

          	bEnableHT_UART = (BOOL)*((BOOL*)pv_set_info);
			if(bEnableHT_UART)
			{
				/* Weijia: if current is hotel mode, Trinity set PIN_OPCTRL21, PIN_OPCTRL22 to fuction 6 for Hotel UART dev/ttyMT4 */
				Printf("DRV_CUSTOM_CUST_SPEC_TYPE_HOTEL_UART_PINMUX_EN TRUE ~~~~~~~~ \n");
				BSP_PinSet(PIN_OPCTRL21, PINMUX_FUNCTION1);
				BSP_PinSet(PIN_OPCTRL22, PINMUX_FUNCTION1);
			}
#if 0		//SAKURA Sony factory also open and use ttyMT4, so remove following code, avoid conflict		
			else
			{
				/* Weijia: if current not hotel mode, set PAD_TCON7, PAD_TCON8 to fuction 0 for GPIO, avoid effect AV2 */
				Printf("DRV_CUSTOM_CUST_SPEC_TYPE_HOTEL_UART_PINMUX_EN FALSE ~~~~~~~~ \n");
				BSP_PinSet(PIN_OPCTRL21, PINMUX_FUNCTION0);
				BSP_PinSet(PIN_OPCTRL22, PINMUX_FUNCTION0);
			}
#endif			
	   		
			break;					 
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_HDMI_HDCP:
	   {
            //for nand flash, write operation must be block based, which means offset must be 0
            //so, read all, modify in RAM, and write all
            MISC_TYPE_HDMI_HDCP_T *param = (MISC_TYPE_HDMI_HDCP_T *)pv_set_info;
            UINT8 buffer[340];
	   
            i4_ret = 0;
            if(param->u2_offset + param->u2_length > 340)
            {
                i4_ret = -1;
            }
            if(i4_ret == 0)
            {
                if(EEPHDMI20HDCP14_Write(param->aui1_hdcp_buf, param->u2_length))  /* Read 320+20 bytes of HDCP key*/
                {
                    return RMR_DRV_ERROR;
                }
            }
            break;
	   }

	   case DRV_CUSTOM_CUST_SPEC_TYPE_HDCP2X_RW:
        {
            MISC_TYPE_HDCP2x_T *param = (MISC_TYPE_HDCP2x_T *)pv_set_info;
            UINT16 Off_s = 0;
            memset(buf_HDCP2x, 0, sizeof(buf_HDCP2x));            
            i4_ret = 0;

            if(param->u2_length > 880)
            {
                i4_ret = -1;
            }
            else
            {
                x_memcpy(buf_HDCP2x, param->aui1_hdcp2x_buf, param->u2_length);

                if((param->u2_offset >= 0x800)&&(param->u2_offset < 0x1000))  //HDMI 
                {
                    if(EEPHDMI20HDCP22_Write((UINT32)buf_HDCP2x, 880))
                    {
                        i4_ret = -1;
                    }
                }
                else if(param->u2_offset >= 0x1000)
                {
                    if(EEPHDCP2x_Write(0x1000,(UINT32)buf_HDCP2x,880))  //WIFI
                    {
                        i4_ret = -1;
                    }
                }
				else
				{

				}
            }
            break;
        }

#ifdef CC_Factory2K12
       case DRV_CUSTOM_CUST_SPEC_TYPE_MOVE_OS_OPTION_POS:
       {
            if (*(UINT16*)pv_set_info)
           {
               //shift to position 0
               vDrvSetOstgOptPos(0x3);
               OSD_Base_SetHStart();
           }
           else
           {
              //restore
             vDrvSetOstgOptPos(DRVCUST_OptGet(eOSOptionPos));
             OSD_Base_SetHStart();
           }
           break;
       }
#endif
   
#ifndef CC_MTK_LOADER    
       case DRV_CUSTOM_CUST_SPEC_UPDATE_LED_FIX_PATTERN:
       {
           UINT8 ui1FixPattern = (*(UINT8*)pv_set_info);  
           vUpdateLedFixPattern(ui1FixPattern);
           Printf("[%s]Update FixPattern %s\n",__FUNCTION__,ui1FixPattern?"TRUE":"FALSE");
       }
       break;
#endif

	   
	   case DRV_CUSTOM_CUST_SPEC_TYPE_HDCP_ENABLE:
	   {
            #if defined(CC_MT5890)
			vHDMIHDCPEN(*(UINT8 *)pv_set_info);
            #endif
			break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_TUNER_LNA_CTRL:
       {
           if ((pv_set_info == NULL) || (z_size != sizeof(UINT8)))
		       {
			       LOG(2, "Invalid parameter (LNA CTRL)\n");
			       return RMR_INV_ARG;
       }
		   UINT8 ui1_lna;
		   ui1_lna = *((UINT8*)(pv_set_info));
           LOG(2, "[D-Interface] LNA %x", ui1_lna);
		   CLI_Parser_Arg("sif.xw 2 0x100 0xC0 0x01 0x85 0x01 0x%x", ui1_lna);
       break;
       }
	   case DRV_CUSTOM_CUST_SPEC_SET_INTERNAL_SIG_PTN:
	   {
				  DRV_CUSTOM_INT_SIG_PTN *sig_ptn_info = NULL;
				  UINT8 tag;
				  UINT8 pattern;
				  UINT8 path;
				  UINT16 gamma_r;
				  UINT16 gamma_g;
				  UINT16 gamma_b;
				  				  
				  sig_ptn_info = (DRV_CUSTOM_INT_SIG_PTN*)pv_set_info;
				  tag = sig_ptn_info->tag;
				  pattern = sig_ptn_info->pattern;
				  path = sig_ptn_info->path;
				  gamma_r = sig_ptn_info->gamma_r;
				  gamma_g = sig_ptn_info->gamma_g;
				  gamma_b = sig_ptn_info->gamma_b;
				 
				  if (tag == 0)
				  {
					  vDrvPreprocEnablePattern(0,0); //off the PreProc pattern first before turn on gamma
					  vDrvGammaMute(gamma_r,gamma_g,gamma_b);
				  }
				  else if (tag == 1)
				  {
					  vDrvGammaUnmute();//off the Gamma pattern first before turn on PreProc
					  // purplearrow mark vDrvSetMatrixUnit(); // use YCbCr 601 matrix and bypass all post-process
					  vDrvPreprocEnablePattern(path, pattern);
				  }
				  else if (tag == 2)
				  {
					  // purplearrow mark vDrvSetMatrixReset(); // reset matrix when exit pattern
					  vDrvPreprocEnablePattern(0, 0);
					  vDrvGammaUnmute();
				  }
				  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_SET_GAMMA_PAT_GEN:
	   {
           Sony_PreSetup(*(BOOL*)pv_set_info);
           Sony_GammaSetPatgen(*(BOOL*)pv_set_info);
		  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_SET_GAMMA_SETUP:
	   {
		  Sony_GammaSetup(*(UINT16*)pv_set_info);
		  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_SET_GAMMA_SAVE:
	   {
            Sony_GammaSave(*(UINT16*)pv_set_info);
		  break;
	   }
       case DRV_CUSTOM_CUST_SPEC_SET_GAMMA_QUIT:
       {
            Sony_GammaQuit(*(UINT16*)pv_set_info);
		  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_SET_GAMMA_EXIT:
	   {
            Sony_GammaExit(*(UINT16*)pv_set_info);
		  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_SET_GAMMA_RESET:
	   {
            Sony_GammaResetNVM();
		  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_SET_GAMMA_SAMPLE:
	   {
            Sony_GammaSetSample(*(UINT16*)pv_set_info);
		  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_SET_WB_SETUP:
	   {
		  Sony_WBSetup(*(UINT16*)pv_set_info);
		  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_SET_WB_SAVE:
	   {
            Sony_WBSave(*(UINT16*)pv_set_info);
		  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_SET_WB_QUIT:
	   {
		  Sony_WBQuit(*(UINT16*)pv_set_info);
		  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_SET_WB_EXIT:
	   {
            Sony_WBExit(*(UINT16*)pv_set_info);
		  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_SET_WB_RESET:
	   {
            Sony_WBResetNVM();
		  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_SET_WB_SETLVL:
	   {
            Sony_WBSetLvl(*(UINT16*)pv_set_info);
		  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_SET_WB_SETCLR:
	   {
            Sony_WBSetColor(*(UINT16*)pv_set_info);
		  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_WBT_IDX:
	   {
	   		Factory2K12Debug(c_sprintf(fact_dbg_buf,"-- sony_d_custom, set(%x) --\n",0));
	   		WB_PBM_ColorTempIdxSet(*(UINT16*)pv_set_info);
		  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_ADJ_METHOD:
	   {
		  WB_PBM_WBAdjustMethodSet(*(UINT16*)pv_set_info);
		  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_EASY_SET_LVL:
	   {
		  WB_PBM_EasySetPatternLevelSet(*(UINT16*)pv_set_info);
		  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_EASY_SET_EN:
	   {
		  WB_PBM_EasySetPatternEnableSet(*(UINT16*)pv_set_info);
		  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_Y_SUM_POS:
	   {
		  WB_PBM_YSumPosSet(*(UINT16*)pv_set_info);
		  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_Y_SUM_MEAS:
	   {
		  WB_PBM_YSumMeasSet(*(UINT16*)pv_set_info);
		  break;
       }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_PIXEL_POS:
	   {
		  WB_PBM_YSumPixelPosSet(*(UINT16*)pv_set_info);
		  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_PIXEL_MEAS_Y:
	   {
		  WB_PBM_PixelMeasYSet(*(UINT16*)pv_set_info);
		  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_PIXEL_MEAS_CB:
	   {
		  WB_PBM_PixelMeasCBSet(*(UINT16*)pv_set_info);
		  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_PIXEL_MEAS_CR:
	   {
		  WB_PBM_PixelMeasCRSet(*(UINT16*)pv_set_info);
		  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_ON:
	   {
		  WB_PBM_LutAdjOnSet(*(UINT16*)pv_set_info);
		  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_WBT_IDX_CHANGE_STS:
	   {
		  WB_PBM_WBTIdxChangeStsSet(*(UINT16*)pv_set_info);
		  break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_INP_EASY_SET_R:
	   {
	       WB_PBM_InpEasySetRSet(*(UINT16*)pv_set_info);
		   break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_INP_EASY_SET_G:
	   {
	       WB_PBM_InpEasySetGSet(*(UINT16*)pv_set_info);
		   break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_INP_EASY_SET_B:
	   {
	   	   WB_PBM_InpEasySetBSet(*(UINT16*)pv_set_info);
		   break;
	   }
	   
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_GAM_SEL:
	   {
           DRVCUST_SET_WB_GAM_SEL(*(UINT8*)pv_set_info);
	       break;
	   }

	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_BASE_GAIN_R:
	   {
           WB_TRACK_BASE_GAIN_RGB_SET(0, *(UINT8*)pv_set_info);
	       break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_BASE_GAIN_G:
	   {
           WB_TRACK_BASE_GAIN_RGB_SET(1, *(UINT8*)pv_set_info);
	       break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_BASE_GAIN_B:
	   {
           WB_TRACK_BASE_GAIN_RGB_SET(2, *(UINT8*)pv_set_info);
	       break;
	   }
	   
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WBADJ_GODID:
	   {
           DRVCUST_SET_WBADJ_GODID_EEP(*(UINT8*)pv_set_info);
	       break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WBADJ_PON_TIME:
	   {
           DRVCUST_SET_WBADJ_PON_TIME_EEP(*(UINT8*)pv_set_info);
	       break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WBADJ_JIG_VER:
	   {
	       DRVCUST_SET_WBADJ_JIG_VER_EEP(*(UINT16*)pv_set_info);
	       break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WBADJ_DS_DATE:
	   {
	       DRVCUST_SET_WBADJ_DS_DATE_EEP(*(UINT16*)pv_set_info);
	       break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WBADJ_ADJ_DATE:
	   {
	       DRVCUST_SET_WBADJ_ADJ_DATE_EEP(*(UINT16*)pv_set_info);
	       break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WBADJ_AGING1:
	   {
	       DRVCUST_SET_WBADJ_AGING1_EEP(*(UINT16*)pv_set_info);
	       break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WBADJ_AGING2:
	   {
	       DRVCUST_SET_WBADJ_AGING2_EEP(*(UINT16*)pv_set_info);
	       break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WBADJ_JIG_INFO1:
	   {
	       DRVCUST_SET_WBADJ_JJG_INFO1_EEP(*(UINT16*)pv_set_info);
	       break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WBADJ_JIG_INFO2:
	   {
	       DRVCUST_SET_WBADJ_JJG_INFO2_EEP(*(UINT16*)pv_set_info);
	       break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_INFO0:
	   {
	       DRVCUST_SET_WB_INFO0_EEP(*(UINT16*)pv_set_info);
	       break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_INFO1:
	   {
	       DRVCUST_SET_WB_INFO1_EEP(*(UINT16*)pv_set_info);
	       break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_INFO2:
	   {
	       DRVCUST_SET_WB_INFO2_EEP(*(UINT16*)pv_set_info);
	       break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_INFO3:
	   {
	       DRVCUST_SET_WB_INFO3_EEP(*(UINT16*)pv_set_info);
	       break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_INFO4:
	   {
	       DRVCUST_SET_WB_INFO4_EEP(*(UINT16*)pv_set_info);
	       break;
	   }
	   case DRV_CUSTMO_CUST_TYPE_MACBETH_PTN:
	   {
           DRVCUST_SetMacbethOnOff(((DRV_MACBETH_PTN*)pv_set_info)->bOnoff, ((DRV_MACBETH_PTN*)pv_set_info)->u2Ylvl,
                                    ((DRV_MACBETH_PTN*)pv_set_info)->u2Ulvl, ((DRV_MACBETH_PTN*)pv_set_info)->u2Vlvl);
           break;
	   }
	   case DRV_CUSTOM_CUST_TYPE_WB_TEST_PTN:
	   {
	        DRVCUST_SetWBTestPtnOnOff(((DRV_WB_TEST_PTN*)pv_set_info)->bOnoff, ((DRV_WB_TEST_PTN*)pv_set_info)->u2Rlvl,
                                    ((DRV_WB_TEST_PTN*)pv_set_info)->u2Glvl, ((DRV_WB_TEST_PTN*)pv_set_info)->u2Blvl);
            break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_EEP_WB_GAM0_RGB:
	   {
           if((pv_set_info == NULL) || (z_size != sizeof(DRV_EEP_WB_GAM0_RGB)))
           {
               LOG(2, "Invalid parameter (DRV_EEP_WB_GAM0_RGB)\n");
			   return RMR_INV_ARG;
           }

           //DRVCUST_SET_WB_GAM(((DRV_EEP_WB_GAM0_RGB*)pv_set_info)->u1Channel,
                                //((DRV_EEP_WB_GAM0_RGB*)pv_set_info)->u1Levle, 
                                //((DRV_EEP_WB_GAM0_RGB*)pv_set_info)->u1Value);
	       break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_EEP_INP_LVL_WB:
	   {
           if((pv_set_info == NULL) || (z_size != sizeof(DRV_EEP_INP_LVL_WB)))
           {
               LOG(2, "Invalid parameter (DRV_EEP_INP_LVL_WB)\n");
			   return RMR_INV_ARG;
           }

           //DRVCUST_SET_INP_LVL_WB(((DRV_EEP_INP_LVL_WB*)pv_set_info)->u1Levle,
                                //((DRV_EEP_INP_LVL_WB*)pv_set_info)->u2Value);
           break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_EEP_WB_GAM_GAIN:
	   {
           if((pv_set_info == NULL) || (z_size != sizeof(DRV_EEP_WB_GAM_GAIN)))
           {
               LOG(2, "Invalid parameter (DRV_EEP_WB_GAM_GAIN)\n");
			   return RMR_INV_ARG;
           }

           //DRVCUST_SET_WB_GAM_GAIN(((DRV_EEP_WB_GAM_GAIN*)pv_set_info)->u1Levle,
                                    //((DRV_EEP_WB_GAM_GAIN*)pv_set_info)->u1Value);
	       break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_EEP_WB_BASE_GAIN_RGB:
	   {
           if((pv_set_info == NULL) || (z_size != sizeof(DRV_EEP_WB_BASE_GAIN_RGB)))
           {
               LOG(2, "Invalid parameter (DRV_EEP_WB_BASE_GAIN_RGB)\n");
			   return RMR_INV_ARG;
           }

           //DRVCUST_SET_WB_BASE_GAIN(((DRV_EEP_WB_BASE_GAIN_RGB*)pv_set_info)->u1ColorTemp,
                                    //((DRV_EEP_WB_BASE_GAIN_RGB*)pv_set_info)->u1Channel,
                                    //((DRV_EEP_WB_BASE_GAIN_RGB*)pv_set_info)->u1Value);
	       break;
	   }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_EEP_WB_OFST_RGB:
	   {
           if((pv_set_info == NULL) || (z_size != sizeof(DRV_EEP_WB_OFST_RGB)))
           {
               LOG(2, "Invalid parameter (DRV_EEP_WB_OFST_RGB)\n");
			   return RMR_INV_ARG;
           }

           //DRVCUST_SET_WB_OFST(((DRV_EEP_WB_OFST_RGB*)pv_set_info)->u1ColorTemp,
                                //((DRV_EEP_WB_OFST_RGB*)pv_set_info)->u1Channel, 
                                //((DRV_EEP_WB_OFST_RGB*)pv_set_info)->u1Levle, 
                                //((DRV_EEP_WB_OFST_RGB*)pv_set_info)->u1Value);
	       break;
	   }
	   
	   case DRV_CUSTOM_CUST_SPEC_TYPE_AGING_LAST_POWER_CONTROL:
	   {
		   //UINT16 ui2_result;
		   //ui2_result = *((UINT16 *)(pv_set_info));
		   //AgingLastPowerControlState_Set(ui2_result);
			break;
		}
		
		case DRV_CUSTOM_CUST_SPEC_TYPE_TUNE_STOP_MONITOR_ANA:
		{
			BOOL b_result;
			if ((pv_set_info == NULL) || (z_size != sizeof(BOOL)))
			{
				LOG(2, "Invalid parameter (STOP_MONITOR_ANA)\n");
				return RMR_INV_ARG;
			}			
			b_result = *((BOOL *)(pv_set_info));
			if(b_result == TRUE)
			{
				CLI_Parser("nim.dm 1");				
			}
		    else
			{
				CLI_Parser("nim.dm 0");
			
			}			
			break;
		}

		case DRV_CUSTOM_CUST_SPEC_TYPE_FREE_ALL_DMX_PID:
		{
		    CLI_Parser("b.scm 0");
            CLI_Parser("d.fpinst");             		
			break;
		}

		case DRV_CUSTOM_CUST_SPEC_TYPE_TUNE_STOP_MONITOR_DIG:
		{
			BOOL b_result;
			if ((pv_set_info == NULL) || (z_size != sizeof(BOOL)))
			{
				LOG(2, "Invalid parameter (STOP_MONITOR_DIG)\n");
				return RMR_INV_ARG;
			}			
			b_result = *((BOOL *)(pv_set_info));
			if(b_result == TRUE)
			{
				CLI_Parser("nim.dm 1");				
			}
		    else
			{
				CLI_Parser("nim.dm 0");
			
			}			
			break;
		}
		
		case DRV_CUSTOM_CUST_SPEC_TYPE_TUNE_DMX_CONNECT:
		{
			//dmx set connect
			break;
		}
		
	    case DRV_CUSTOM_CUST_SPEC_TYPE_TUNE_DMX_DISCONNECT:
		{
			//dmx set disconnect
			break;
		}
		
	    case DRV_CUSTOM_CUST_SPEC_TYPE_TUNE_SET_PID:
	    {
		   //dmx set pid
		   break;
	    }

#if 0		
         case DRV_CUSTOM_CUST_SPEC_TYPE_TUNE_ANALOG:
         {
            UINT8        ui1_antenna = 0;
            UINT32       ui4_freq = 0;
            UINT32       ui4_video_sys = 0;
            UINT32       ui4_video_format = 0;
            UINT32       ui4_audio_sys = 0;
            UINT32       ui4_audio_soud = 0;
            UINT8        ui1_lna = 0;
            TV_AUD_SYS_T eAudSys = 0;
            AUD_SOUND_MODE_T eAudsm = 0;
            UINT8        vid_sys = 0;
#if 1 // wwj		   
		    UINT32		 ui4_begin_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();
		    UINT32		 ui4_end_time = 0;
#endif		   
			VDP_REGION_T rRegion;

            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_TUNE_ANALOG_T)))
            {
                LOG(2, "Invalid parameter (TUNE_ANALOG)\n");
                return RMR_INV_ARG;
            }           

			// initialize rSrcRegion & rOutRegion
		    rRegion.u4Height = 10000;
		    rRegion.u4Width= 10000;
		    rRegion.u4X = 0;
		    rRegion.u4Y= 0;
			
            ui1_antenna = (((DRV_TUNE_ANALOG_T *)pv_set_info)->ui1_antenna);
            ui4_freq = (((DRV_TUNE_ANALOG_T *)pv_set_info)->ui4_freq);
            ui4_video_sys = (((DRV_TUNE_ANALOG_T *)pv_set_info)->ui4_video_sys);
            ui4_audio_sys = (((DRV_TUNE_ANALOG_T *)pv_set_info)->ui4_audio_sys);
            ui4_audio_soud = (((DRV_TUNE_ANALOG_T *)pv_set_info)->ui4_audio_soud);
            ui4_video_format = (((DRV_TUNE_ANALOG_T *)pv_set_info)->ui4_video_format);
            ui1_lna = (((DRV_TUNE_ANALOG_T *)pv_set_info)->ui1_lna);
			
            u1SonyFactoryMode= 1;
			
            CLI_Parser("b.scm 0");
			vDrvVideoMuteOnOff(0, 1);
            //wwj CLI_Parser("n.mute.on 0");      // mute Vdp main path      
            CLI_Parser("aud.stop 0 1");     //stop main audio decoder       
            x_thread_delay(50); 
            CLI_Parser("aud.uop.so.fs 0 1");
            CLI_Parser("aud.uop.so.fs 1 1");
            x_thread_delay(50); 
            CLI_Parser("nim.id 0");         // switch tuner to ATV
            //tuner
            if(ui1_antenna == FACTORY_TUNER_ANTENNA_TERR)
            {   
                CLI_Parser("nim.go t_ana");		//switch to analog air 
            }
            else if(ui1_antenna == FACTORY_TUNER_ANTENNA_CABLE)
            {
                CLI_Parser("nim.go c_ana");		//switch to analog cable
            }           
            CLI_Parser_Arg("sif.xw 4 0x100 0xc0 1 0x85 1 %d",ui1_lna);		// write lna to tuner register
			switch(ui4_video_sys)
           	{
            case FACTORY_TUNER_VIDEO_SYSTEM_M://M
			 	eAudSys = SV_MTS;
                vid_sys = 5;
			 	break;
			case FACTORY_TUNER_VIDEO_SYSTEM_BG://BG
                if(ui4_video_format == 2) {//secam
                    eAudSys = SV_SECAM_BG;
                } else if (ui4_audio_sys == FACTORY_TUNER_AUDIO_SYSTEM_A2) { //A2
                    eAudSys = SV_A2_BG;
                } else {
			    	eAudSys = SV_PAL_BG;
                }
                vid_sys = 0;
			    break;
			case FACTORY_TUNER_VIDEO_SYSTEM_DK://DK
                if(ui4_video_format == 2) {//secam
                    eAudSys = SV_SECAM_DK;
                } else if (ui4_audio_sys == FACTORY_TUNER_AUDIO_SYSTEM_A2) { //A2
                    eAudSys = SV_A2_DK1;
                } else {
                	eAudSys = SV_PAL_DK;
                }
                vid_sys = 1;
			    break;
			case FACTORY_TUNER_VIDEO_SYSTEM_I://I
			    eAudSys = SV_PAL_I;
                vid_sys = 2;
			    break;
   			case FACTORY_TUNER_VIDEO_SYSTEM_L://L
   			    eAudSys = SV_SECAM_L;
                vid_sys = 3;
   			    break;
   			case FACTORY_TUNER_VIDEO_SYSTEM_L_DASH://L_DASH
   			    eAudSys = SV_SECAM_L_PLUM;
                vid_sys = 4;
   			    break;
   			case FACTORY_TUNER_VIDEO_SYSTEM_N://N
			default:
   			    eAudSys = SV_MTS;
                vid_sys = 0;
                break;
           	}
		
           	if(ui4_audio_sys == FACTORY_TUNER_AUDIO_SYSTEM_BTSC) 
		   	{
            	eAudSys = SV_MTS;
           	}
			
            switch(ui4_audio_sys)
            {
            case FACTORY_TUNER_AUDIO_SYSTEM_A2://A2
                ui4_audio_soud = 4; //A2_DUAL1
                break;
            case FACTORY_TUNER_AUDIO_SYSTEM_NICAM://PAL\NICAM
                ui4_audio_soud = 7; //NICAM_stereo
                break;
            case FACTORY_TUNER_AUDIO_SYSTEM_SAP:
                ui4_audio_soud = 3; //SAP
                break;
            default:
                ui4_audio_soud = 2; //STEREO
                break;
            }
            CLI_Parser_Arg("nim.atd s %d",vid_sys);		//set video system
            CLI_Parser_Arg("nim.atd f %d",ui4_freq);	// set frequency
            //vdp
            VDP_SetEnable(0, 1);
            //wwj CLI_Parser("vdp.e 0");   			// enable vdp main path ?
            VDP_SetOutRegion(0, 1, rRegion);
            //wwj CLI_Parser("vdp.s.outr 0 1");   	// set vdp ouput region (ucVdpId; X; Y; W; H)  ?       
            //wwj no need CLI_Parser("vdp.s.i 0 0 0");		// set vdp input region (ucVdpId; ucEsId; ucPort) ?
            VDP_SetSrcRegion(0, 1, rRegion);
            //wwj CLI_Parser("vdp.s.srcr 0 1");   	// set vdp source region (ucVdpId; X; Y; W; H) ? 
            //wwj bApiVideoSetVideoSrc(0, SV_VS_DTV1)
            CLI_Parser("n.ms atd1");        	// main source select ?            
            CLI_Parser("aud.a.rw 0x420 1");            
            CLI_Parser("aud.a.rw 0x421 1");
            CLI_Parser("aud.a.rw 0x422 1");
            CLI_Parser("aud.a.rw 0x425 1");
            CLI_Parser("aud.a.rw 0x427 1");
            CLI_Parser("aud.a.rw 0x429 1"); 
            CLI_Parser_Arg("aud.atv.sys %d",eAudSys);  		// set current channel's audio system
            x_thread_delay(50);  
            CLI_Parser_Arg("aud.atv.sm %d",ui4_audio_soud);    		// set current channel's audio sound mode         
            CLI_Parser("aud.play 0 1");					// play audio decoder
            CLI_Parser("aud.t.aoutg 0 0 0x1000");  
			vDrvVideoMuteOnOff(0, 0);
            //wwj CLI_Parser("n.mute.all 0 0");             	// mute Vdp(ucVdpId; on/off)
            //wwj x_thread_delay(50); 
            //wwj CLI_Parser("n.mute.off 0");					// unmute main Vdp
#if 1 // wwj		   
		    ui4_end_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();

		    LOG(0, "TUNE_ANALOG %d ms ~~ \n", (ui4_end_time - ui4_begin_time));
#endif		   		               
        break;   
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_TUNE_ATSC:
        {
            UINT32   ui4_freq = 0;
            UINT8    ui1_modulation = 0;
            UINT16   ui2_video_pid = 0;
            UINT8    ui1_video_codec = 0;
            UINT16   ui2_audio_pid = 0;
            UINT8    ui1_audio_codec = 0;
            UINT8    ui1_framerate = 0;
            AUD_FMT_T eAudDecFmt = 0;
            ENUM_VDEC_FMT_T    eVideoDecFmt = 0;
#if 1 // wwj		   
		    UINT32		ui4_begin_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();
		    UINT32		ui4_end_time = 0;
#endif			   	
			VDP_REGION_T rRegion;

			if ((pv_set_info == NULL) || (z_size != sizeof(DRV_TUNE_ATSC_T)))
            {
                LOG(2, "Invalid parameter (TUNE_ATSC)\n");
                return RMR_INV_ARG;
            }

		    // initialize rSrcRegion & rOutRegion
		    rRegion.u4Height = 10000;
		    rRegion.u4Width= 10000;
		    rRegion.u4X = 0;
		    rRegion.u4Y= 0;
    
            
            ui4_freq = (((DRV_TUNE_ATSC_T *)pv_set_info)->ui4_freq);
            ui1_modulation = (((DRV_TUNE_ATSC_T *)pv_set_info)->ui1_modulation);
            ui2_video_pid = (((DRV_TUNE_ATSC_T *)pv_set_info)->ui2_video_pid);
            ui1_video_codec = (((DRV_TUNE_ATSC_T *)pv_set_info)->ui1_video_codec);
            ui2_audio_pid = (((DRV_TUNE_ATSC_T *)pv_set_info)->ui2_audio_pid);
            ui1_audio_codec = (((DRV_TUNE_ATSC_T *)pv_set_info)->ui1_audio_codec);
            ui1_framerate = (((DRV_TUNE_ATSC_T *)pv_set_info)->ui1_framerate);

			u1SonyFactoryMode= 1;
			
            CLI_Parser("b.scm 0"); 
            //tuner     
            vDrvVideoMuteOnOff(0, 1);
            //wwj CLI_Parser("n.mute.on 0");  	// mute Vdp main           
            CLI_Parser("aud.stop 0 1");  	// mute audio main decoder
            x_thread_delay(50);
			VDEC_Stop(0);
            //wwj CLI_Parser("vdec.s 0");			// stop video decoder main path
            //wwj x_thread_delay(50);
            CLI_Parser("vdp.d 0");			// disable Vdp main
            x_thread_delay(100);
            bApiVideoSetVideoSrc(0,255);	// set video source ???
            x_thread_delay(100);	
            CLI_Parser("nim.id 1");			// set tuner type to DTV 
            CLI_Parser("nim.go atsc");					// set tuner scan rule ATSC
            CLI_Parser_Arg("nim.freq %d",ui4_freq);		//set ATSC's frequency
            x_thread_delay(100);
            //vdp
            VDP_SetEnable(0, 1);
            //wwj CLI_Parser("vdp.e 0");   		// enable vdp main path ?
            VDP_SetOutRegion(0, 1, rRegion);
            //wwj CLI_Parser("vdp.s.outr 0 1");   // set vdp ouput region (ucVdpId; X; Y; W; H)  ?       
            //wwj no need CLI_Parser("vdp.s.i 0 0 0");	// set vdp input region (ucVdpId; ucEsId; ucPort) ?
            VDP_SetSrcRegion(0, 1, rRegion);
            //wwj CLI_Parser("vdp.s.srcr 0 1");	// set vdp source region (ucVdpId; X; Y; W; H) ?
            //vdec
            switch(ui1_video_codec)
            {
       		case FCTRY_VIDEO_CODEC_MPEG2://MPEG2
                 eVideoDecFmt = VDEC_FMT_MPV;
                 break;
   			case FCTRY_VIDEO_CODEC_AVC://AVC
                 eVideoDecFmt = VDEC_FMT_H264;
                 break;
            case FCTRY_VIDEO_CODEC_AVS://AVS
                 eVideoDecFmt = VDEC_FMT_AVS;
                 break;
            case FCTRY_VIDEO_CODEC_VC1://VC1
                 eVideoDecFmt = VDEC_FMT_WMV;
                 break;
            case FCTRY_VIDEO_CODEC_MPEG4VISUAL://MPEG4VISUAL
                 eVideoDecFmt = VDEC_FMT_MP4;
                 break;
            case FCTRY_VIDEO_CODEC_DIVX://DIVX
                 eVideoDecFmt = VDEC_FMT_MP4;
                 break;          
            default:
                 eVideoDecFmt = VDEC_FMT_MAX;
                 break;
            }    
            CLI_Parser_Arg("vdec.p 0 %d",eVideoDecFmt);		// video decoder play (EsId; Format)
            //dmx
            if(eVideoDecFmt == VDEC_FMT_H264)
            {
            	DMX_SetVideoType(DMX_VIDEO_H264);
                //wwj CLI_Parser("d.svt 1");			// set DMX video type
            }            
            else if(eVideoDecFmt == VDEC_FMT_AVS)
            {
                DMX_SetVideoType(DMX_VIDEO_AVS);
                //wwj CLI_Parser("d.svt 2");			// set DMX video type
            }
            else
            {               
                DMX_SetVideoType(DMX_VIDEO_MPEG);
                //wwj CLI_Parser("d.svt 0");			// set DMX video type
            }
            CLI_Parser_Arg("d.sp 0 0x%x video",ui2_video_pid);		// set video PID(pid_index; PID; PID_type; device_id )
            bApiVideoSetVideoSrc(0, SV_VS_DTV1);
           	//wwj CLI_Parser("n.ms dtv1");
            //Audio
            switch(ui1_audio_codec)
            {
            case FCTRY_AUDIO_CODEC_LPCM://LPCM
                 eAudDecFmt = AUD_FMT_LPCM;
                 break;
            case FCTRY_AUDIO_CODEC_AAC://AAC
                 eAudDecFmt = AUD_FMT_AAC;
                 break;
            case FCTRY_AUDIO_CODEC_AC3://AC3
                 eAudDecFmt = AUD_FMT_AC3;
                 break;
            case FCTRY_AUDIO_CODEC_AC3_PLUS://AC3_PLUS
                 eAudDecFmt = AUD_FMT_AC3;
                 break;
            case FCTRY_AUDIO_CODEC_HEAAC://HEAAC
                 eAudDecFmt = AUD_FMT_AAC;
                 break;
            case FCTRY_AUDIO_CODEC_MPEG_AUDIO://MPEG_AUDIO
                 eAudDecFmt = AUD_FMT_MPEG;
                 break;
            default:
                 eAudDecFmt = AUD_FMT_UNKNOWN;
                 break;
            }            
            CLI_Parser("aud.a.rw 0x420 1");            
            CLI_Parser("aud.a.rw 0x421 1");
            CLI_Parser_Arg("aud.s 0 1 1 %d",eAudDecFmt);		// set audio decoder (decoder_id; stream_from; stream type)
            CLI_Parser("aud.play 0 1");							// play audio sub decoder
            CLI_Parser("aud.s 0 0 1 3");						// set audio decoder (main_decoder; stream_from_digital-tuner; stream_type_is_PCM)
            CLI_Parser("aud.play 0 0");							// play audio main decoder
            CLI_Parser_Arg("d.sp 1 0x%x audio 1",ui2_audio_pid);     	// set audio PID(pid_index; PID; PID_type; device_id )        
            CLI_Parser("aud.t.aoutg 0 0 0x1000");            
#ifndef CC_SAKURA_CUST_DRV
            CLI_Parser("osd.p.en 2 0");				// disable OSD plane 2
#endif
			vDrvVideoMuteOnOff(0, 0);
            //wwj CLI_Parser("n.mute.all 0 0");			// mute Vdp(ucVdpId; on/off) 
            //wwj x_thread_delay(100);
            //wwj CLI_Parser("n.mute.off 0");   			// unmute main Vdp
#if 1 // wwj		   
		   	ui4_end_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();

		   	LOG(0, "TUNE_ATSC %d ms ~~ \n", (ui4_end_time - ui4_begin_time));
#endif		   
            
            break;   
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_TUNE_DTMB:
        {
            UINT32             ui4_freq = 0;
            UINT8              ui1_modulation = 0;
            UINT8              ui1_lna = 0;
            UINT16             ui2_video_pid = 0;
            UINT8              ui1_video_codec = 0;
            UINT16             ui2_audio_pid = 0;
            UINT8              ui1_audio_codec = 0;
            UINT8              ui1_framerate = 0;
            AUD_FMT_T          eAudDecFmt = 0;
            ENUM_VDEC_FMT_T    eVideoDecFmt = 0;
#if 1 // wwj		   
		    UINT32	   ui4_begin_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();
		    UINT32	   ui4_end_time = 0;
#endif	
		    VDP_REGION_T rRegion;

			if ((pv_set_info == NULL) || (z_size != sizeof(DRV_TUNE_DTMB_T)))
            {
                LOG(2, "Invalid parameter (TUNE_DTMB)\n");
                return RMR_INV_ARG;
            }

		    // initialize rSrcRegion & rOutRegion
		    rRegion.u4Height = 10000;
		    rRegion.u4Width= 10000;
		    rRegion.u4X = 0;
		    rRegion.u4Y= 0;
            
            ui4_freq = (((DRV_TUNE_DTMB_T *)pv_set_info)->ui4_freq);
            ui1_modulation = (((DRV_TUNE_DTMB_T *)pv_set_info)->ui1_modulation);
            ui1_lna = (((DRV_TUNE_DTMB_T *)pv_set_info)->ui1_lna);
            ui2_video_pid = (((DRV_TUNE_DTMB_T *)pv_set_info)->ui2_video_pid);
            ui1_video_codec = (((DRV_TUNE_DTMB_T *)pv_set_info)->ui1_video_codec);
            ui2_audio_pid = (((DRV_TUNE_DTMB_T *)pv_set_info)->ui2_audio_pid);
            ui1_audio_codec = (((DRV_TUNE_DTMB_T *)pv_set_info)->ui1_audio_codec);
            ui1_framerate = (((DRV_TUNE_DTMB_T *)pv_set_info)->ui1_framerate);

			u1SonyFactoryMode= 1;
			
			//free DMX pid and stop VDEC
			VDEC_Stop(0);
			//wwj CLI_Parser("vdec.s 0");			// stop video decoder main path
			//wwj x_thread_delay(50);
			if(ui1_factory_tune_dtmb_num != 0)
			{
				CLI_Parser("d.fpinst");			// free all DMX PIDs of instance 0
			}
			else
			{
				ui1_factory_tune_dtmb_num = 1;
			}
			
            CLI_Parser("b.scm 0"); 
            //tuner
            vDrvVideoMuteOnOff(0, 1);
            //wwj CLI_Parser("n.mute.on 0");      	// mute Vdp main path       
            CLI_Parser("aud.stop 0 1");  		// stop audio main decoder
            x_thread_delay(50);    
            CLI_Parser("vdp.d 0");				// disable Vdp main
            x_thread_delay(100);
            bApiVideoSetVideoSrc(0,255);		// set video source ???
            x_thread_delay(100);
            CLI_Parser("nim.id 1");  			// set tuner type to DTV 
            CLI_Parser("nim.go dtmb");          // set tuner scan rule is DTMB 
            CLI_Parser_Arg("sif.xw 4 0x100 0xc0 1 0x85 1 %d",ui1_lna);			//set lna parameter to tuner register
            CLI_Parser_Arg("nim.freq %d",ui4_freq);			//set DTMB's frequency
            x_thread_delay(100);
            //vdp
            VDP_SetEnable(0, 1);
            //wwj CLI_Parser("vdp.e 0");   			// enable vdp main path ?
            VDP_SetOutRegion(0, 1, rRegion);
            //wwj CLI_Parser("vdp.s.outr 0 1");    	// set vdp ouput region (ucVdpId; X; Y; W; H)  ?
            //wwj no need CLI_Parser("vdp.s.i 0 0 0");		// set vdp input region (ucVdpId; ucEsId; ucPort) ?
            VDP_SetSrcRegion(0, 1, rRegion);
            //wwj CLI_Parser("vdp.s.srcr 0 1");		// set vdp source region (ucVdpId; X; Y; W; H) ?
            //vdec
            switch(ui1_video_codec)
            {
            case FCTRY_VIDEO_CODEC_MPEG2://MPEG2
                 eVideoDecFmt = VDEC_FMT_MPV;
                 break;
            case FCTRY_VIDEO_CODEC_AVC://AVC
                 eVideoDecFmt = VDEC_FMT_H264;
                 break;
            case FCTRY_VIDEO_CODEC_AVS://AVS
                 eVideoDecFmt = VDEC_FMT_AVS;
                 break;
            case FCTRY_VIDEO_CODEC_VC1://VC1
                 eVideoDecFmt = VDEC_FMT_WMV;
                 break;
            case FCTRY_VIDEO_CODEC_MPEG4VISUAL://MPEG4VISUAL
                 eVideoDecFmt = VDEC_FMT_MP4;
                 break;
            case FCTRY_VIDEO_CODEC_DIVX://DIVX
                 eVideoDecFmt = VDEC_FMT_MP4;
                 break;          
            default:
                 eVideoDecFmt = VDEC_FMT_MPV;
                 break;
            }    
            CLI_Parser_Arg("vdec.p 0 %d",eVideoDecFmt);			// video decoder play (EsId; Format)
            //dmx
            if(eVideoDecFmt == VDEC_FMT_H264)
            {
            	DMX_SetVideoType(DMX_VIDEO_H264);
                //wwj CLI_Parser("d.svt 1");			// set DMX video type
            }            
            else if(eVideoDecFmt == VDEC_FMT_AVS)
            {
                DMX_SetVideoType(DMX_VIDEO_AVS);
                //wwj CLI_Parser("d.svt 2");			// set DMX video type
            }
            else
            {               
                DMX_SetVideoType(DMX_VIDEO_MPEG);
                //wwj CLI_Parser("d.svt 0");			// set DMX video type
            }
			DMX_SetFrontEndEx(0, 0x10);
            //wwj CLI_Parser("d.sfe 0x10 0");
            CLI_Parser_Arg("d.sp 0 0x%x video",ui2_video_pid);		// set video PID(pid_index; PID; PID_type; device_id )
            bApiVideoSetVideoSrc(0, SV_VS_DTV1);
           	//wwj CLI_Parser("n.ms dtv1");
            //AUDIO
            switch(ui1_audio_codec)
            {
            case FCTRY_AUDIO_CODEC_LPCM://LPCM
                 eAudDecFmt = AUD_FMT_LPCM;
                 break;
            case FCTRY_AUDIO_CODEC_AAC://AAC
                 eAudDecFmt = AUD_FMT_AAC;
                 break;
            case FCTRY_AUDIO_CODEC_AC3://AC3
                 eAudDecFmt = AUD_FMT_AC3;
                 break;
            case FCTRY_AUDIO_CODEC_AC3_PLUS://AC3_PLUS
                 eAudDecFmt = AUD_FMT_AC3;
                 break;
            case FCTRY_AUDIO_CODEC_HEAAC://HEAAC
                 eAudDecFmt = AUD_FMT_AAC;
                 break;
            case FCTRY_AUDIO_CODEC_MPEG_AUDIO://MPEG_AUDIO
                 eAudDecFmt = AUD_FMT_MPEG;
                 break;
            default:
                 eAudDecFmt = AUD_FMT_UNKNOWN;
                 break;
            }            
            CLI_Parser("aud.a.rw 0x420 1");            		
            CLI_Parser("aud.a.rw 0x421 1"); 
            CLI_Parser_Arg("aud.s 0 1 1 %d",eAudDecFmt);		// set audio decoder (decoder_id; stream_from; stream type)
            CLI_Parser("aud.play 0 1");							// play audio sub decoder
            CLI_Parser("aud.s 0 0 1 3");						// set audio decoder (main_decoder; stream_from_digital-tuner; stream_type_is_PCM)
            CLI_Parser("aud.play 0 0");							// play audio main decoder
            CLI_Parser_Arg("d.sp 1 0x%x audio 1",ui2_audio_pid);     	// set audio PID(pid_index; PID; PID_type; device_id )       
            CLI_Parser("aud.t.aoutg 0 0 0x1000");            
            CLI_Parser("aud.t.b 0 0 1");

		  	vDrvVideoMuteOnOff(0, 0);
            //wwj CLI_Parser("n.mute.all 0 0");          // mute Vdp(ucVdpId; on/off)    
            //wwj x_thread_delay(100);
            //wwj CLI_Parser("n.mute.off 0");  			// unmute main Vdp
#if 1 // wwj		   
		    ui4_end_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();

		    LOG(0, "TUNE_DTMB %d ms ~~ \n", (ui4_end_time - ui4_begin_time));
#endif		     
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_TUNE_DVBS:
        {    
            UINT8              ui1_tuner_path = 0;
            UINT8              ui1_standard = 0;
            UINT32             ui4_freq = 0;
            UINT32             ui1_symbol_rate = 0;
            UINT16             ui2_video_pid = 0;
            UINT8              ui1_video_codec = 0;
            UINT16             ui2_audio_pid = 0;
            UINT8              ui1_audio_codec = 0;
            UINT8              ui1_framerate = 0;
            AUD_FMT_T          eAudDecFmt = 0;
            ENUM_VDEC_FMT_T    eVideoDecFmt = 0;
#if 1 // wwj		   
		    UINT32		ui4_begin_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();
		    UINT32		ui4_end_time = 0;
#endif		   	
            VDP_REGION_T rRegion;

			if ((pv_set_info == NULL) || (z_size != sizeof(DRV_TUNE_DVBS_T)))
            {
                LOG(2, "Invalid parameter (TUNE_DVBS)\n");
                return RMR_INV_ARG;
            }

		    // initialize rSrcRegion & rOutRegion
		    rRegion.u4Height = 10000;
		    rRegion.u4Width= 10000;
		    rRegion.u4X = 0;
		    rRegion.u4Y= 0;
            
            
            ui1_tuner_path = (((DRV_TUNE_DVBS_T *)pv_set_info)->ui1_tuner_path);
            ui1_standard = (((DRV_TUNE_DVBS_T *)pv_set_info)->ui1_standard);
            ui4_freq = (((DRV_TUNE_DVBS_T *)pv_set_info)->ui4_freq);
            ui1_symbol_rate = (((DRV_TUNE_DVBS_T *)pv_set_info)->ui1_symbol_rate);
            ui2_video_pid = (((DRV_TUNE_DVBS_T *)pv_set_info)->ui2_video_pid);
            ui1_video_codec = (((DRV_TUNE_DVBS_T *)pv_set_info)->ui1_video_codec);
            ui2_audio_pid = (((DRV_TUNE_DVBS_T *)pv_set_info)->ui2_audio_pid);
            ui1_audio_codec = (((DRV_TUNE_DVBS_T *)pv_set_info)->ui1_audio_codec);
            ui1_framerate = (((DRV_TUNE_DVBS_T *)pv_set_info)->ui1_framerate);
  
            
            CLI_Parser("b.scm 0"); 
            //tuner
            //CLI_Parser("n.mute.on 0");            
            u1SonyFactoryMode= 1;
            CLI_Parser("aud.stop 0 1");  // stop audio main decoder
            x_thread_delay(50);   
			VDEC_Stop(0);
            //wwj CLI_Parser("vdec.s 0");		// stop video decoder main path
            //wwj x_thread_delay(50);
            CLI_Parser("vdp.d 0");		// disable Vdp main 
            x_thread_delay(100);
            bApiVideoSetVideoSrc(0,255);		// set video source ???
            x_thread_delay(100);
            if(ui1_tuner_path == FACTORY_TUNER_PATH_SUB || ui1_tuner_path == 5 )//Sub & Main to Sub -Ivan Keep)
            {
                CLI_Parser("nim.id 2");  
            }
            else if(ui1_tuner_path == FACTORY_TUNER_PATH_MAIN)
            {
                CLI_Parser("nim.id 1");  
            }
            CLI_Parser("nim.go dvbs");   	// set tuner scan rule is DVB-S
            CLI_Parser_Arg("nim.sc %d %d 64",ui4_freq,ui1_symbol_rate);		// set tuner frequency and symbo_rate
            if(ui1_tuner_path == 5 ) //Main to Sub -Ivan Keep
            {
                CLI_Parser("sif.xw 1 0x100 0xc2 1 0x85 1 1");	
            }
            else
            {
                CLI_Parser("sif.xw 1 0x100 0xc2 1 0x85 1 0");
            }
            //vdp
            //vdec
            switch(ui1_video_codec)
            {
            case FCTRY_VIDEO_CODEC_MPEG2://MPEG2
                 eVideoDecFmt = VDEC_FMT_MPV;
                 break;
            case FCTRY_VIDEO_CODEC_AVC://AVC
                 eVideoDecFmt = VDEC_FMT_H264;
                 break;
            case FCTRY_VIDEO_CODEC_AVS://AVS
                 eVideoDecFmt = VDEC_FMT_AVS;
                 break;
            case FCTRY_VIDEO_CODEC_VC1://VC1
                 eVideoDecFmt = VDEC_FMT_WMV;
                 break;
            case FCTRY_VIDEO_CODEC_MPEG4VISUAL://MPEG4VISUAL
                 eVideoDecFmt = VDEC_FMT_MP4;
                 break;
            case FCTRY_VIDEO_CODEC_DIVX://DIVX
                 eVideoDecFmt = VDEC_FMT_MP4;
                 break;          
            default:
                 eVideoDecFmt = VDEC_FMT_MPV;
                 break;
            }               
            if(eVideoDecFmt == VDEC_FMT_H264)
            {
                DMX_SetVideoType(DMX_VIDEO_H264);
                //wwj CLI_Parser("d.svt 1");		// set DMX video type
            }           
            else if(eVideoDecFmt == VDEC_FMT_AVS)
            {
                DMX_SetVideoType(DMX_VIDEO_AVS);
                //wwj CLI_Parser("d.svt 2");		// set DMX video type
            }
            else
            {               
                DMX_SetVideoType(DMX_VIDEO_MPEG);
                //wwj CLI_Parser("d.svt 0");		// set DMX video type
            } 
			VDP_SetEnable(0, 1);
            //wwj CLI_Parser("vdp.e 0");   		// enable vdp main path ?
            VDP_SetOutRegion(0, 1, rRegion);
            //wwj CLI_Parser("vdp.s.outr 0 1"); 		// set vdp ouput region (ucVdpId; X; Y; W; H)  ?    
            //wwj no need CLI_Parser("vdp.s.i 0 0 0");		// set vdp input region (ucVdpId; ucEsId; ucPort) ?
            VDP_SetSrcRegion(0, 1, rRegion);
            //wwj CLI_Parser("vdp.s.srcr 0 1");		// set vdp source region (ucVdpId; X; Y; W; H) ?
            CLI_Parser_Arg("vdec.p 0 %d",eVideoDecFmt);		// video decoder play (EsId; Format)
            //dmx

            if(ui1_tuner_path == FACTORY_TUNER_PATH_SUB || ui1_tuner_path == 5 )//Sub & Main to Sub -Ivan Keep)
            {
                DMX_SetFrontEndEx(0, 0x30);
            	//wwj CLI_Parser("d.sfe 0x30 0");
            }
            else
            {
                DMX_SetFrontEndEx(0, 0x10);
            	//wwj CLI_Parser("d.sfe 0x10 0");
            }
            CLI_Parser_Arg("d.sp 0 0x%x video",ui2_video_pid);		// set video PID(pid_index; PID; PID_type; device_id )
  
            bApiVideoSetVideoSrc(0, SV_VS_DTV1);
           	//wwj CLI_Parser("n.ms dtv1");
            //AUDIO
            switch(ui1_audio_codec)
            {
            case FCTRY_AUDIO_CODEC_LPCM://LPCM
                 eAudDecFmt = AUD_FMT_LPCM;
                 break;
            case FCTRY_AUDIO_CODEC_AAC://AAC
                 eAudDecFmt = AUD_FMT_AAC;
                 break;
            case FCTRY_AUDIO_CODEC_AC3://AC3
                 eAudDecFmt = AUD_FMT_AC3;
                 break;
            case FCTRY_AUDIO_CODEC_AC3_PLUS://AC3_PLUS
                 eAudDecFmt = AUD_FMT_AC3;
                 break;
            case FCTRY_AUDIO_CODEC_HEAAC://HEAAC
                 eAudDecFmt = AUD_FMT_AAC;
                 break;
            case FCTRY_AUDIO_CODEC_MPEG_AUDIO://MPEG_AUDIO
                 eAudDecFmt = AUD_FMT_MPEG;
                 break;
            default:
                 eAudDecFmt = AUD_FMT_MPEG;
                 break;
            }           
            CLI_Parser("aud.a.rw 0x420 1");            
            CLI_Parser("aud.a.rw 0x421 1");
            CLI_Parser("aud.a.rw 0x422 1");
            CLI_Parser("aud.a.rw 0x425 1");
            CLI_Parser("aud.a.rw 0x427 1");
            CLI_Parser("aud.a.rw 0x429 1");
            CLI_Parser_Arg("aud.s 0 1 1 %d",eAudDecFmt);	// set audio decoder (decoder_id; stream_from; stream type)
            CLI_Parser("aud.play 0 1");					// play audio sub decoder
            CLI_Parser("aud.s 0 0 1 3");				// set audio decoder (main_decoder; stream_from_digital-tuner; stream_type_is_PCM)
            CLI_Parser("aud.play 0 0");					// play audio main decoder
            CLI_Parser_Arg("d.sp 1 0x%x audio 1",ui2_audio_pid);		// set video PID(pid_index; PID; PID_type; device_id )
            CLI_Parser("aud.t.aoutg 0 0 0x1000");            
            CLI_Parser("aud.t.b 0 0 1"); 
			vDrvVideoMuteOnOff(0, 0);
            //wwj CLI_Parser("n.mute.all 0 0");    	// mute Vdp(ucVdpId; on/off)          
            //wwj x_thread_delay(100);
            //wwj CLI_Parser("n.mute.off 0");   		// unmute main Vdp
#if 1 // wwj		   
		    ui4_end_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();

		    LOG(0, "TUNE_DVBS %d ms ~~ \n", (ui4_end_time - ui4_begin_time));
#endif            
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_TUNE_DVBT:
        {
           	UINT8              	ui1_tuner_path = 0;
           	UINT8              	ui1_standard = 0;
           	UINT32             	ui4_freq = 0;
           	UINT8              	ui1_bandwith = 0;
           	UINT8              	ui1_modulation = 0;
           	UINT8              	ui1_lna = 0;
           	UINT16             	ui2_video_pid = 0;
           	UINT8              	ui1_video_codec = 0;
           	UINT16             	ui2_audio_pid = 0;
           	UINT8              	ui1_audio_codec = 0;
           	UINT8              	ui1_framerate = 0;
           	UINT8              	tuner_type =0;
           	AUD_FMT_T          	eAudDecFmt = 0;
           	ENUM_VDEC_FMT_T    	eVideoDecFmt = 0;
#if 1 // wwj		   
		   	UINT32	   			ui4_begin_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();
		   	UINT32	   			ui4_end_time = 0;
#endif		   
            VDP_REGION_T rRegion;

			if ((pv_set_info == NULL) || (z_size != sizeof(DRV_TUNE_DVBT_T)))
           	{
               	LOG(2, "Invalid parameter (TUNE_DVBT)\n");
               	return RMR_INV_ARG;
           	}

		    // initialize rSrcRegion & rOutRegion
		    rRegion.u4Height = 10000;
		    rRegion.u4Width= 10000;
		    rRegion.u4X = 0;
		    rRegion.u4Y= 0;
           	
           	ui1_tuner_path = (((DRV_TUNE_DVBT_T *)pv_set_info)->ui1_tuner_path);
           	ui1_standard = (((DRV_TUNE_DVBT_T *)pv_set_info)->ui1_standard);
           	ui4_freq = (((DRV_TUNE_DVBT_T *)pv_set_info)->ui4_freq);
           	ui1_bandwith = (((DRV_TUNE_DVBT_T *)pv_set_info)->ui1_bandwith);
           	ui1_modulation = (((DRV_TUNE_DVBT_T *)pv_set_info)->ui1_modulation);
           	ui1_lna = (((DRV_TUNE_DVBT_T *)pv_set_info)->ui1_lna);
           	ui2_video_pid = (((DRV_TUNE_DVBT_T *)pv_set_info)->ui2_video_pid);
           	ui1_video_codec = (((DRV_TUNE_DVBT_T *)pv_set_info)->ui1_video_codec);
           	ui2_audio_pid = (((DRV_TUNE_DVBT_T *)pv_set_info)->ui2_audio_pid);
           	ui1_audio_codec = (((DRV_TUNE_DVBT_T *)pv_set_info)->ui1_audio_codec);
           	ui1_framerate = (((DRV_TUNE_DVBT_T *)pv_set_info)->ui1_framerate);

		   	u1SonyFactoryMode= 1;
		   
           	CLI_Parser("b.scm 0");
           	//tuner
           	vDrvVideoMuteOnOff(0, 1);
           	//wwj CLI_Parser("n.mute.on 0");    	// mute Vdp main path        
           	CLI_Parser("aud.stop 0 1");  	// stop audio main decoder
           	x_thread_delay(50);  
		   	VDEC_Stop(0);
           	//wwj CLI_Parser("vdec.s 0"); 			// stop video decoder main path
           	x_thread_delay(50);         
           	CLI_Parser("vdp.d 0");			// disable Vdp main
           	x_thread_delay(100);          
           	bApiVideoSetVideoSrc(0,255);		// set video source ???		
           	x_thread_delay(100);
           	if(ui1_tuner_path == FACTORY_TUNER_PATH_SUB)
           	{
               	CLI_Parser("nim.id 2"); 
           	}
           	else if(ui1_tuner_path == FACTORY_TUNER_PATH_MAIN)
           	{
               	CLI_Parser("nim.id 1"); 
           	}
           	CLI_Parser("nim.go dvbt");   	// set tuner scan rule is DVB-T 
           	CLI_Parser_Arg("sif.xw 4 0x100 0xc0 1 0x85 1 %d",ui1_lna);		//set lna parameter to tuner register
           	CLI_Parser_Arg("nim.sbw %d",ui1_bandwith);  		// set tuner bandwith
           	CLI_Parser_Arg("nim.freq %d",ui4_freq);			// set channel frequency
           	x_thread_delay(100);
           	//vdec
           	switch(ui1_video_codec)
           	{
           	case FCTRY_VIDEO_CODEC_MPEG2://MPEG2
                eVideoDecFmt = VDEC_FMT_MPV;
                break;
           	case FCTRY_VIDEO_CODEC_AVC://AVC
                eVideoDecFmt = VDEC_FMT_H264;
                break;
           	case FCTRY_VIDEO_CODEC_AVS://AVS
                eVideoDecFmt = VDEC_FMT_AVS;
                break;
           	case FCTRY_VIDEO_CODEC_VC1://VC1
                eVideoDecFmt = VDEC_FMT_WMV;
                break;
           	case FCTRY_VIDEO_CODEC_MPEG4VISUAL://MPEG4VISUAL
                eVideoDecFmt = VDEC_FMT_MP4;
                break;
           	case FCTRY_VIDEO_CODEC_DIVX://DIVX
                eVideoDecFmt = VDEC_FMT_MP4;
                break;          
           	default:
                eVideoDecFmt = VDEC_FMT_MPV;
                break;
           	}            

  			bApiVideoSetVideoSrc(0, SV_VS_DTV1);
           	//wwj CLI_Parser("n.ms dtv1");  		// select main source to DTV
           	VDP_SetEnable(0, 1);
           	//wwj CLI_Parser("vdp.e 0"); 			// enable vdp main path ?
           	VDP_SetOutRegion(0, 1, rRegion);
           	//wwj CLI_Parser("vdp.s.outr 0 1");    	// set vdp ouput region (ucVdpId; X; Y; W; H)  ?
           	CLI_Parser("vdp.s.i 0 0 0");		// set vdp input region (ucVdpId; ucEsId; ucPort) ?
           	VDP_SetSrcRegion(0, 1, rRegion);
           	//wwj CLI_Parser("vdp.s.srcr 0 1");       // set vdp source region (ucVdpId; X; Y; W; H) ?
           	x_thread_delay(50);            
           	if(ui1_tuner_path == FACTORY_TUNER_PATH_SUB)
           	{
                //DMX_SetFrontEndEx(0, 0x30);
            	CLI_Parser("d.sfe 0x30 0");		// set fe_type ???
           	}
			else
           	{
                 EEPROM_Read((UINT64)0x10011,(UPTR)(VOID *)&tuner_type,1);
                 if(tuner_type == 0x03)
                 {
                     //DMX_SetFrontEndEx(0, 0x0);
            		 CLI_Parser("d.sfe 0x0 0");		// set fe_type ???
                 }
                 else
                 {
                     //DMX_SetFrontEndEx(0, 0x10);
            		 CLI_Parser("d.sfe 0x10 0");	// set fe_type ???
                 }
          	}           
          	if(eVideoDecFmt == VDEC_FMT_H264)
           	{
               	//Printf("VDEC_FMT_H264\n");
               	DMX_SetVideoType(DMX_VIDEO_H264);
               	//wwj CLI_Parser("d.svt 1");			// set DMX video type
           	}
           	else if(eVideoDecFmt == VDEC_FMT_AVS)
           	{
               	//Printf("VDEC_FMT_AVS\n");
               	DMX_SetVideoType(DMX_VIDEO_AVS);
                //wwj CLI_Parser("d.svt 2");			// set DMX video type
           	}
           	else
           	{   
               	//Printf("VDEC_FMT_MPEG\n");
               	DMX_SetVideoType(DMX_VIDEO_MPEG);
                //wwj CLI_Parser("d.svt 0");			// set DMX video type
           	} 
           	CLI_Parser_Arg("vdec.p 0 %d",eVideoDecFmt);
           	CLI_Parser_Arg("d.sp 0 0x%x video",ui2_video_pid);     	// set video PID(pid_index; PID; PID_type; device_id )        
           	x_thread_delay(50);            
           	//AUDIO
           	switch(ui1_audio_codec)
           	{
            case FCTRY_AUDIO_CODEC_LPCM://LPCM
                eAudDecFmt = AUD_FMT_LPCM;
                break;
            case FCTRY_AUDIO_CODEC_AAC://AAC
                eAudDecFmt = AUD_FMT_AAC;
                break;
            case FCTRY_AUDIO_CODEC_AC3://AC3
                eAudDecFmt = AUD_FMT_AC3;
                break;
            case FCTRY_AUDIO_CODEC_AC3_PLUS://AC3_PLUS
                eAudDecFmt = AUD_FMT_AC3;
                break;
            case FCTRY_AUDIO_CODEC_HEAAC://HEAAC
                eAudDecFmt = AUD_FMT_AAC;
                break;
            case FCTRY_AUDIO_CODEC_MPEG_AUDIO://MPEG_AUDIO
                eAudDecFmt = AUD_FMT_MPEG;
                break;
            default:
                eAudDecFmt = AUD_FMT_UNKNOWN;
                break;
           	} 
           	CLI_Parser("aud.a.rw 0x420 1");            
           	CLI_Parser("aud.a.rw 0x421 1");
           	CLI_Parser("aud.a.rw 0x422 1");
           	CLI_Parser("aud.a.rw 0x425 1");
           	CLI_Parser("aud.a.rw 0x427 1");
           	CLI_Parser("aud.a.rw 0x429 1");  
           	CLI_Parser_Arg("aud.s 0 1 1 %d",eAudDecFmt);		// set audio decoder (decoder_id; stream_from; stream type)
           	CLI_Parser("aud.play 0 1");					// play audio sub decoder
           	CLI_Parser("aud.s 0 0 1 3");					// set audio decoder (main_decoder; stream_from_digital-tuner; stream_type_is_PCM)
           	CLI_Parser("aud.play 0 0");					// play audio main decoder
           	CLI_Parser_Arg("d.sp 1 0x%x audio 1",ui2_audio_pid);			// set audio PID(pid_index; PID; PID_type; device_id )
           	CLI_Parser("aud.t.aoutg 0 0 0x1000");            
           	CLI_Parser("aud.t.b 0 0 1"); 
		   	//vDrvVideoMuteOnOff(0, 0);
           	CLI_Parser("n.mute.all 0 0");            	// mute Vdp(ucVdpId; on/off) 	
           	x_thread_delay(100);            
           	CLI_Parser("n.mute.off 0");  				// unmute main Vdp
#if 1 // wwj		   
		   	ui4_end_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();

		   	LOG(0, "TUNE_DVBT %d ms ~~ \n", (ui4_end_time - ui4_begin_time));
#endif			              
           	break;
       	}
        case DRV_CUSTOM_CUST_SPEC_TYPE_TUNE_ISDBT:
        {
            UINT8              ui1_tuner_path = 0;
            UINT32             ui4_freq = 0;
            UINT16             ui2_video_pid = 0;
            UINT8              ui1_video_codec = 0;
            UINT16             ui2_audio_pid = 0;
            UINT8              ui1_audio_codec = 0;
            UINT8              ui1_framerate;
            AUD_FMT_T          eAudDecFmt = 0;
            ENUM_VDEC_FMT_T    eVideoDecFmt = 0;
#if 1 // wwj		   
		    UINT32		ui4_begin_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();
		    UINT32		ui4_end_time = 0;
#endif			               
            VDP_REGION_T rRegion;

			if ((pv_set_info == NULL) || (z_size != sizeof(DRV_TUNE_ISDBT_T)))
            {
                LOG(2, "Invalid parameter (TUNE_ISDBT)\n");
                return RMR_INV_ARG;
            }

		    // initialize rSrcRegion & rOutRegion
		    rRegion.u4Height = 10000;
		    rRegion.u4Width= 10000;
		    rRegion.u4X = 0;
		    rRegion.u4Y= 0;
            
            
            ui1_tuner_path = (((DRV_TUNE_ISDBT_T *)pv_set_info)->ui1_tuner_path);
            ui4_freq = (((DRV_TUNE_ISDBT_T *)pv_set_info)->ui4_freq);
            ui2_video_pid = (((DRV_TUNE_ISDBT_T *)pv_set_info)->ui2_video_pid);
            ui1_video_codec = (((DRV_TUNE_ISDBT_T *)pv_set_info)->ui1_video_codec);
            ui2_audio_pid = (((DRV_TUNE_ISDBT_T *)pv_set_info)->ui2_audio_pid);
            ui1_audio_codec = (((DRV_TUNE_ISDBT_T *)pv_set_info)->ui1_audio_codec);
            ui1_framerate = (((DRV_TUNE_ISDBT_T *)pv_set_info)->ui1_framerate);

			u1SonyFactoryMode= 1;
			
            CLI_Parser("b.scm 0"); 
            //tuner   
            vDrvVideoMuteOnOff(0, 1);
            //wwj CLI_Parser("n.mute.on 0");  	// mute Vdp main path          
            CLI_Parser("aud.stop 0 1");  	// stop audio main decoder
            x_thread_delay(50);
			VDEC_Stop(0);
            //wwj CLI_Parser("vdec.s 0");      // stop video decoder main path //first should stop vdec,then play will ok
            //wwj x_thread_delay(50);          
            CLI_Parser("vdp.d 0");		// disable Vdp main
            x_thread_delay(100);          
            bApiVideoSetVideoSrc(0,255);		// set video source ???
            x_thread_delay(100);
            if(ui1_tuner_path == FACTORY_TUNER_PATH_SUB)
            {
                CLI_Parser("nim.id 2");  
            }
            else if(ui1_tuner_path == FACTORY_TUNER_PATH_MAIN)
            {
                CLI_Parser("nim.id 1");  
            }
            CLI_Parser("nim.go isdbt");  		//switch tuner scan rule to ISDB-T
            CLI_Parser_Arg("nim.freq %d",ui4_freq);			// set channel frequency
            //vdp
            bApiVideoSetVideoSrc(0, SV_VS_DTV1);
           	//wwj CLI_Parser("n.ms dtv1");
			VDP_SetEnable(0, 1);
            //wwj CLI_Parser("vdp.e 0");   		// enable vdp main path ?
            VDP_SetOutRegion(0, 1, rRegion);
            //wwj CLI_Parser("vdp.s.outr 0 1");    	// set vdp ouput region (ucVdpId; X; Y; W; H)  ?	
            //wwj no need CLI_Parser("vdp.s.i 0 0 0");		// set vdp input region (ucVdpId; ucEsId; ucPort) ?
            VDP_SetSrcRegion(0, 1, rRegion);
            //wwj CLI_Parser("vdp.s.srcr 0 1");		// set vdp source region (ucVdpId; X; Y; W; H) ?
            //vdec
            switch(ui1_video_codec)
            {
            case FCTRY_VIDEO_CODEC_MPEG2://MPEG2
                 eVideoDecFmt = VDEC_FMT_MPV;
                 break;
            case FCTRY_VIDEO_CODEC_AVC://AVC
                 eVideoDecFmt = VDEC_FMT_H264;
                 break;
            case FCTRY_VIDEO_CODEC_AVS://AVS
                 eVideoDecFmt = VDEC_FMT_AVS;
                 break;
            case FCTRY_VIDEO_CODEC_VC1://VC1
                 eVideoDecFmt = VDEC_FMT_WMV;
                 break;
            case FCTRY_VIDEO_CODEC_MPEG4VISUAL://MPEG4VISUAL
                 eVideoDecFmt = VDEC_FMT_MP4;
                 break;
            case FCTRY_VIDEO_CODEC_DIVX://DIVX
                 eVideoDecFmt = VDEC_FMT_MP4;
                 break;          
            default:
                 eVideoDecFmt = VDEC_FMT_MAX;
                 break;
            }    
            CLI_Parser_Arg("vdec.p 0 %d",eVideoDecFmt);			// video decoder play (EsId; Format)
            //dmx
            if(ui1_tuner_path == FACTORY_TUNER_PATH_SUB)
            {
                DMX_SetFrontEndEx(0, 0x30);
            	//wwj CLI_Parser("d.sfe 0x30 0");		// set fe_type ???
            }
            else
            {
                DMX_SetFrontEndEx(0, 0x10);
            	//wwj CLI_Parser("d.sfe 0x10 0");		// set fe_type ???
            }
            if(eVideoDecFmt == VDEC_FMT_H264)
            {
                DMX_SetVideoType(DMX_VIDEO_H264);
                //wwj CLI_Parser("d.svt 1");			// set DMX video type
            }           
            else if(eVideoDecFmt == VDEC_FMT_AVS)
            {
                DMX_SetVideoType(DMX_VIDEO_AVS);
                //wwj CLI_Parser("d.svt 2");			// set DMX video type
            }
            else
            {               
                DMX_SetVideoType(DMX_VIDEO_MPEG);
                //wwj CLI_Parser("d.svt 0");			// set DMX video type
            }
            CLI_Parser_Arg("d.sp 0 0x%x video",ui2_video_pid);		// set video PID(pid_index; PID; PID_type; device_id )
            //AUDIO
            switch(ui1_audio_codec)
            {
            case FCTRY_AUDIO_CODEC_LPCM://LPCM
                 eAudDecFmt = AUD_FMT_LPCM;
                 break;
            case FCTRY_AUDIO_CODEC_AAC://AAC
                 eAudDecFmt = AUD_FMT_AAC;
                 break;
            case FCTRY_AUDIO_CODEC_AC3://AC3
                 eAudDecFmt = AUD_FMT_AC3;
                 break;
            case FCTRY_AUDIO_CODEC_AC3_PLUS://AC3_PLUS
                 eAudDecFmt = AUD_FMT_AC3;
                 break;
            case FCTRY_AUDIO_CODEC_HEAAC://HEAAC
                 eAudDecFmt = AUD_FMT_AAC;
                 break;
            case FCTRY_AUDIO_CODEC_MPEG_AUDIO://MPEG_AUDIO
                 eAudDecFmt = AUD_FMT_MPEG;
                 break;
            default:
                 eAudDecFmt = AUD_FMT_UNKNOWN;
                 break;
            }
            CLI_Parser("aud.a.rw 0x420 1");            
            CLI_Parser("aud.a.rw 0x421 1");
            CLI_Parser_Arg("aud.s 0 1 1 %d",eAudDecFmt);		// set audio decoder (decoder_id; stream_from; stream type)
            CLI_Parser("aud.play 0 1");						// play audio sub decoder
            CLI_Parser("aud.s 0 0 1 3");					// set audio decoder (main_decoder; stream_from_digital-tuner; stream_type_is_PCM)
            CLI_Parser("aud.play 0 0");						// play audio main decoder
            CLI_Parser_Arg("d.sp 1 0x%x audio 1",ui2_audio_pid);     	// set audio PID(pid_index; PID; PID_type; device_id )       
            CLI_Parser("aud.t.aoutg 0 0 0x1000");            
            CLI_Parser("aud.t.b 0 0 1"); 
			vDrvVideoMuteOnOff(0, 0);
            //wwj CLI_Parser("n.mute.all 0 0");			// mute Vdp(ucVdpId; on/off)
            //wwj x_thread_delay(100);                    
            //wwj CLI_Parser("n.mute.off 0");           // unmute main Vdp  
#if 1 // wwj		   
		    ui4_end_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();

		    LOG(0, "TUNE_ISDBT %d ms ~~ \n", (ui4_end_time - ui4_begin_time));
#endif		               
            break;
        }
        
        case DRV_CUSTOM_CUST_SPEC_TYPE_TUNE_DVBC:
        {
            UINT8              ui1_tuner_path = 0;
            UINT32             ui4_freq = 0;
            UINT8              ui1_bandwith = 0;
            UINT8              ui1_modulation = 0;
            UINT16             ui2_video_pid = 0;
            UINT8              ui1_video_codec = 0;
            UINT16             ui2_audio_pid = 0;
            UINT8              ui1_audio_codec = 0;
            UINT8              ui1_framerate = 0;
            AUD_FMT_T          eAudDecFmt = 0;
            ENUM_VDEC_FMT_T    eVideoDecFmt = 0;
            UINT8              tuner_type =0;
#if 1 // wwj		   
		    UINT32		ui4_begin_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();
		    UINT32		ui4_end_time = 0;
#endif			   
			VDP_REGION_T rRegion;

			if ((pv_set_info == NULL) || (z_size != sizeof(DRV_TUNE_DVBT_T)))
            {
                LOG(2, "Invalid parameter (TUNE_DVBC)\n");
                return RMR_INV_ARG;
            }

		    // initialize rSrcRegion & rOutRegion
		    rRegion.u4Height = 10000;
		    rRegion.u4Width= 10000;
		    rRegion.u4X = 0;
		    rRegion.u4Y= 0;
                       
            ui1_tuner_path = (((DRV_TUNE_DVBC_T *)pv_set_info)->ui1_tuner_path);
            ui4_freq = (((DRV_TUNE_DVBC_T *)pv_set_info)->ui4_freq);
            ui1_bandwith = (((DRV_TUNE_DVBC_T *)pv_set_info)->ui1_bandwith);
            ui1_modulation = (((DRV_TUNE_DVBC_T *)pv_set_info)->ui1_modulation);
            ui2_video_pid = (((DRV_TUNE_DVBC_T *)pv_set_info)->ui2_video_pid);
            ui1_video_codec = (((DRV_TUNE_DVBC_T *)pv_set_info)->ui1_video_codec);
            ui2_audio_pid = (((DRV_TUNE_DVBC_T *)pv_set_info)->ui2_audio_pid);
            ui1_audio_codec = (((DRV_TUNE_DVBC_T *)pv_set_info)->ui1_audio_codec);
            ui1_framerate = (((DRV_TUNE_DVBC_T *)pv_set_info)->ui1_framerate);

			u1SonyFactoryMode= 1;
			
            CLI_Parser("b.scm 0");   
            //tuner
            vDrvVideoMuteOnOff(0, 1);
            //wwj CLI_Parser("n.mute.on 0");   	// mute Vdp main path         
            CLI_Parser("aud.stop 0 1");  	// stop audio sub decoder
            x_thread_delay(50);
			VDEC_Stop(0);
            //wwj CLI_Parser("vdec.s 0");      // stop video decoder main path //first should stop vdec,then play will ok
            //wwj x_thread_delay(50);          
            CLI_Parser("vdp.d 0");		// disable Vdp main
            x_thread_delay(100);          
            bApiVideoSetVideoSrc(0,255);		// set video source ???
            x_thread_delay(100);
            CLI_Parser("nim.id 1");  
            if(ui1_modulation == 16)
            {
                CLI_Parser("nim.go dvbc16");   	// switch tuner to DVB-C 16 QAM
            }
            else if(ui1_modulation == 32)
            {
                CLI_Parser("nim.go dvbc32");   	// switch tuner to DVB-C 32 QAM
            }           
            else if(ui1_modulation == 64)
            {
                CLI_Parser("nim.go dvbc64");   	// switch tuner to DVB-C 64 QAM
            }                   
            else if(ui1_modulation == 128)		
            {
                CLI_Parser("nim.go dvbc128");   // switch tuner to DVB-C 128 QAM
            }          
            else
            {
                CLI_Parser("nim.go dvbc64");   // switch tuner to DVB-C 64 QAM
            }
            CLI_Parser_Arg("nim.freq %d",ui4_freq);		// set current tuner frequency
            //vdp
            bApiVideoSetVideoSrc(0, SV_VS_DTV1);
           	//wwj CLI_Parser("n.ms dtv1");		// select main source to DTV
            VDP_SetEnable(0, 1);
            //wwj CLI_Parser("vdp.e 0");   		// enable vdp main path ?
            VDP_SetOutRegion(0, 1, rRegion);
            //wwj CLI_Parser("vdp.s.outr 0 1");		// set vdp ouput region (ucVdpId; X; Y; W; H)  ?
            //wwj no need CLI_Parser("vdp.s.i 0 0 0");		// set vdp input region (ucVdpId; ucEsId; ucPort) ?
            VDP_SetSrcRegion(0, 1, rRegion);
            //wwj CLI_Parser("vdp.s.srcr 0 1");		// set vdp source region (ucVdpId; X; Y; W; H) ?
            //vdec
            switch(ui1_video_codec)
            {
            case FCTRY_VIDEO_CODEC_MPEG2://MPEG2
                 eVideoDecFmt = VDEC_FMT_MPV;
                 break;
            case FCTRY_VIDEO_CODEC_AVC://AVC
                 eVideoDecFmt = VDEC_FMT_H264;
                 break;
            case FCTRY_VIDEO_CODEC_AVS://AVS
                 eVideoDecFmt = VDEC_FMT_AVS;
                 break;
            case FCTRY_VIDEO_CODEC_VC1://VC1
                 eVideoDecFmt = VDEC_FMT_WMV;
                 break;
            case FCTRY_VIDEO_CODEC_MPEG4VISUAL://MPEG4VISUAL
                 eVideoDecFmt = VDEC_FMT_MP4;
                 break;
            case FCTRY_VIDEO_CODEC_DIVX://DIVX
                 eVideoDecFmt = VDEC_FMT_MP4;
                 break;          
            default:
                 eVideoDecFmt = VDEC_FMT_MAX;
                 break;
            }    
            CLI_Parser_Arg("vdec.p 0 %d",eVideoDecFmt);		// video decoder play (EsId; Format)
            //dmx
            if(ui1_tuner_path == FACTORY_TUNER_PATH_SUB)
            {
                DMX_SetFrontEndEx(0, 0x30);
            	//wwj CLI_Parser("d.sfe 0x30 0");
            }
            else
            {
                EEPROM_Read((UINT64)0x10011,(UPTR)(VOID *)&tuner_type,1);
                if((tuner_type == 0x00)||(tuner_type == 0x01)||(tuner_type == 0x0b))
                {
                    DMX_SetFrontEndEx(0, 0x10);
            		//wwj CLI_Parser("d.sfe 0x10 0");
                }
                else
                {
                    DMX_SetFrontEndEx(0, 0x0);
            		//wwj CLI_Parser("d.sfe 0x0 0");
                }
            }
            if(eVideoDecFmt == VDEC_FMT_H264)
            {
                DMX_SetVideoType(DMX_VIDEO_H264);
                //wwj CLI_Parser("d.svt 1");		// video decoder play (EsId; Format)
            }           
            else if(eVideoDecFmt == VDEC_FMT_AVS)
            {
                DMX_SetVideoType(DMX_VIDEO_AVS);
                //wwj CLI_Parser("d.svt 2");		// video decoder play (EsId; Format)
            }
            else
            {               
                DMX_SetVideoType(DMX_VIDEO_MPEG);
                //wwj CLI_Parser("d.svt 0");		// video decoder play (EsId; Format)
            }
            CLI_Parser_Arg("d.sp 0 0x%x video",ui2_video_pid);		// set video PID(pid_index; PID; PID_type; device_id )
            //AUDIO
            switch(ui1_audio_codec)
            {
            case FCTRY_AUDIO_CODEC_LPCM://LPCM
                 eAudDecFmt = AUD_FMT_LPCM;
                 break;
            case FCTRY_AUDIO_CODEC_AAC://AAC
                 eAudDecFmt = AUD_FMT_AAC;
                 break;
            case FCTRY_AUDIO_CODEC_AC3://AC3
                 eAudDecFmt = AUD_FMT_AC3;
                 break;
            case FCTRY_AUDIO_CODEC_AC3_PLUS://AC3_PLUS
                 eAudDecFmt = AUD_FMT_AC3;
                 break;
            case FCTRY_AUDIO_CODEC_HEAAC://HEAAC
                 eAudDecFmt = AUD_FMT_AAC;
                 break;
            case FCTRY_AUDIO_CODEC_MPEG_AUDIO://MPEG_AUDIO
                 eAudDecFmt = AUD_FMT_MPEG;
                 break;
            default:
                 eAudDecFmt = AUD_FMT_UNKNOWN;
                 break;
            }  
            CLI_Parser("aud.a.rw 0x420 1");            
            CLI_Parser("aud.a.rw 0x421 1");
            CLI_Parser_Arg("aud.s 0 1 1 %d",eAudDecFmt);		// set audio decoder (decoder_id; stream_from; stream type)
            CLI_Parser("aud.play 0 1");							// play audio sub decoder
            CLI_Parser("aud.s 0 0 1 3");						// set audio decoder (main_decoder; stream_from_digital-tuner; stream_type_is_PCM)
            CLI_Parser("aud.play 0 0");								// play audio main decoder
            CLI_Parser_Arg("d.sp 1 0x%x audio 1",ui2_audio_pid);    // set audio PID(pid_index; PID; PID_type; device_id )        
            CLI_Parser("aud.t.aoutg 0 0 0x1000");            
            CLI_Parser("aud.t.b 0 0 1");
			vDrvVideoMuteOnOff(0, 0);
            //x_thread_delay(100);          
            //CLI_Parser("n.mute.all 0 0"); 		// mute Vdp(ucVdpId; on/off)           
            //CLI_Parser("n.mute.off 0");  		// unmute main Vdp
#if 1 // wwj		   
		    ui4_end_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();
 
		    LOG(0, "TUNE_DVBC %d ms ~~ \n", (ui4_end_time - ui4_begin_time));
#endif		               
            break;
        }
#else		
         case DRV_CUSTOM_CUST_SPEC_TYPE_TUNE_ANALOG:
         {
            UINT8        ui1_antenna = 0;
            UINT32       ui4_freq = 0;
            UINT32       ui4_video_sys = 0;
            UINT32       ui4_video_format = 0;
            UINT32       ui4_audio_sys = 0;
            UINT32       ui4_audio_soud = 0;
            UINT8        ui1_lna = 0;
            TV_AUD_SYS_T eAudSys = 0;
            AUD_SOUND_MODE_T eAudsm = 0;
            UINT8        vid_sys = 0;
#if 1 // wwj		   
		    UINT32		ui4_begin_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();
		    UINT32		ui4_end_time = 0;
#endif		   
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_TUNE_ANALOG_T)))
            {
                LOG(2, "Invalid parameter (TUNE_ANALOG)\n");
                return RMR_INV_ARG;
            }           
            ui1_antenna = (((DRV_TUNE_ANALOG_T *)pv_set_info)->ui1_antenna);
            ui4_freq = (((DRV_TUNE_ANALOG_T *)pv_set_info)->ui4_freq);
            ui4_video_sys = (((DRV_TUNE_ANALOG_T *)pv_set_info)->ui4_video_sys);
            ui4_audio_sys = (((DRV_TUNE_ANALOG_T *)pv_set_info)->ui4_audio_sys);
            ui4_audio_soud = (((DRV_TUNE_ANALOG_T *)pv_set_info)->ui4_audio_soud);
            ui4_video_format = (((DRV_TUNE_ANALOG_T *)pv_set_info)->ui4_video_format);
            ui1_lna = (((DRV_TUNE_ANALOG_T *)pv_set_info)->ui1_lna);
			
            u1SonyFactoryMode= 1;
			
            CLI_Parser("b.scm 0");
            CLI_Parser("n.mute.on 0");      // mute Vdp main path      
            CLI_Parser("aud.stop 0 1");     //stop main audio decoder       
            x_thread_delay(50); 
            CLI_Parser("aud.uop.so.fs 0 1");
            CLI_Parser("aud.uop.so.fs 1 1");
            x_thread_delay(50); 
            CLI_Parser("nim.id 0");         // switch tuner to ATV
            //tuner
            if(ui1_antenna == FACTORY_TUNER_ANTENNA_TERR)
            {   
                CLI_Parser("nim.go t_ana");		//switch to analog air 
            }
            else if(ui1_antenna == FACTORY_TUNER_ANTENNA_CABLE)
            {
                CLI_Parser("nim.go c_ana");		//switch to analog cable
            }           
            CLI_Parser_Arg("sif.xw 4 0x100 0xc0 1 0x85 1 %d",ui1_lna);		// write lna to tuner register
           switch(ui4_video_sys)
           {
             case FACTORY_TUNER_VIDEO_SYSTEM_M://M
			 	eAudSys = SV_MTS;
                vid_sys = 5;
			 	break;
			 case FACTORY_TUNER_VIDEO_SYSTEM_BG://BG
                if(ui4_video_format == 2) {//secam
                    eAudSys = SV_SECAM_BG;
                } else if (ui4_audio_sys == FACTORY_TUNER_AUDIO_SYSTEM_A2) { //A2
                    eAudSys = SV_A2_BG;
                } else {
			    	eAudSys = SV_PAL_BG;
                }
                vid_sys = 0;
			    break;
			 case FACTORY_TUNER_VIDEO_SYSTEM_DK://DK
                if(ui4_video_format == 2) {//secam
                    eAudSys = SV_SECAM_DK;
                } else if (ui4_audio_sys == FACTORY_TUNER_AUDIO_SYSTEM_A2) { //A2
                    eAudSys = SV_A2_DK1;
                } else {
                	eAudSys = SV_PAL_DK;
                }
                vid_sys = 1;
			    break;
			 case FACTORY_TUNER_VIDEO_SYSTEM_I://I
			    eAudSys = SV_PAL_I;
                vid_sys = 2;
			    break;
   			 case FACTORY_TUNER_VIDEO_SYSTEM_L://L
   			    eAudSys = SV_SECAM_L;
                vid_sys = 3;
   			    break;
   			 case FACTORY_TUNER_VIDEO_SYSTEM_L_DASH://L_DASH
   			    eAudSys = SV_SECAM_L_PLUM;
                vid_sys = 4;
   			    break;
   			 case FACTORY_TUNER_VIDEO_SYSTEM_N://N
			 default:
   			    eAudSys = SV_MTS;
                vid_sys = 0;
                break;
           }
           if(ui4_audio_sys == FACTORY_TUNER_AUDIO_SYSTEM_BTSC) {
            eAudSys = SV_MTS;
           }
            switch(ui4_audio_sys)
            {
                case FACTORY_TUNER_AUDIO_SYSTEM_A2://A2
                    ui4_audio_soud = 4; //A2_DUAL1
                    break;
                case FACTORY_TUNER_AUDIO_SYSTEM_NICAM://PAL\NICAM
                    ui4_audio_soud = 7; //NICAM_stereo
                    break;
                case FACTORY_TUNER_AUDIO_SYSTEM_SAP:
                    ui4_audio_soud = 3; //SAP
                    break;
                default:
                    ui4_audio_soud = 2; //STEREO
                    break;
            }
            CLI_Parser_Arg("nim.atd s %d",vid_sys);		//set video system
            CLI_Parser_Arg("nim.atd f %d",ui4_freq);	// set frequency
             //vdp
            CLI_Parser("vdp.e 0");   			// enable vdp main path ?
            CLI_Parser("vdp.s.outr 0 1");   	// set vdp ouput region (ucVdpId; X; Y; W; H)  ?       
            CLI_Parser("vdp.s.i 0 0 0");		// set vdp input region (ucVdpId; ucEsId; ucPort) ?
            CLI_Parser("vdp.s.srcr 0 1");   	// set vdp source region (ucVdpId; X; Y; W; H) ?        
            CLI_Parser("n.ms atd1");        	// main source select ?            
            CLI_Parser("aud.a.rw 0x420 1");            
            CLI_Parser("aud.a.rw 0x421 1");
            CLI_Parser("aud.a.rw 0x422 1");
            CLI_Parser("aud.a.rw 0x425 1");
            CLI_Parser("aud.a.rw 0x427 1");
            CLI_Parser("aud.a.rw 0x429 1"); 
            CLI_Parser_Arg("aud.atv.sys %d",eAudSys);  		// set current channel's audio system
            x_thread_delay(50);  
            CLI_Parser_Arg("aud.atv.sm %d",ui4_audio_soud);    		// set current channel's audio sound mode         
            CLI_Parser("aud.play 0 1");					// play audio decoder
            CLI_Parser("aud.t.aoutg 0 0 0x1000");            
            CLI_Parser("n.mute.all 0 0");             	// mute Vdp(ucVdpId; on/off)
            x_thread_delay(50); 
            CLI_Parser("n.mute.off 0");					// unmute main Vdp
#if 1 // wwj		   
		    ui4_end_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();

		    LOG(0, "TUNE_ANALOG %d ms ~~ \n", (ui4_end_time - ui4_begin_time));
#endif		   		               
        break;   
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_TUNE_ATSC:
        {
            UINT32   ui4_freq = 0;
            UINT8    ui1_modulation = 0;
            UINT16   ui2_video_pid = 0;
            UINT8    ui1_video_codec = 0;
            UINT16   ui2_audio_pid = 0;
            UINT8    ui1_audio_codec = 0;
            UINT8    ui1_framerate = 0;
            AUD_FMT_T eAudDecFmt = 0;
            ENUM_VDEC_FMT_T    eVideoDecFmt = 0;
#if 1 // wwj		   
		    UINT32		ui4_begin_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();
		    UINT32		ui4_end_time = 0;
#endif			   	
    
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_TUNE_ATSC_T)))
            {
                LOG(2, "Invalid parameter (TUNE_ATSC)\n");
                return RMR_INV_ARG;
            }
            ui4_freq = (((DRV_TUNE_ATSC_T *)pv_set_info)->ui4_freq);
            ui1_modulation = (((DRV_TUNE_ATSC_T *)pv_set_info)->ui1_modulation);
            ui2_video_pid = (((DRV_TUNE_ATSC_T *)pv_set_info)->ui2_video_pid);
            ui1_video_codec = (((DRV_TUNE_ATSC_T *)pv_set_info)->ui1_video_codec);
            ui2_audio_pid = (((DRV_TUNE_ATSC_T *)pv_set_info)->ui2_audio_pid);
            ui1_audio_codec = (((DRV_TUNE_ATSC_T *)pv_set_info)->ui1_audio_codec);
            ui1_framerate = (((DRV_TUNE_ATSC_T *)pv_set_info)->ui1_framerate);

			u1SonyFactoryMode= 1;
			
            CLI_Parser("b.scm 0"); 
            //tuner           
            CLI_Parser("n.mute.on 0");  	// mute Vdp main           
            CLI_Parser("aud.stop 0 1");  	// mute audio main decoder
            x_thread_delay(50);
            CLI_Parser("vdec.s 0");			// stop video decoder main path
            x_thread_delay(50);
            CLI_Parser("vdp.d 0");			// disable Vdp main
            x_thread_delay(100);
            bApiVideoSetVideoSrc(0,255);	// set video source ???
            x_thread_delay(100);	
            CLI_Parser("nim.id 1");			// set tuner type to DTV 
            CLI_Parser("nim.go atsc");					// set tuner scan rule ATSC
            CLI_Parser_Arg("nim.freq %d",ui4_freq);		//set ATSC's frequency
            x_thread_delay(100);
            //vdp
            CLI_Parser("vdp.e 0");   		// enable vdp main path ?
            CLI_Parser("vdp.s.outr 0 1");   // set vdp ouput region (ucVdpId; X; Y; W; H)  ?       
            CLI_Parser("vdp.s.i 0 0 0");	// set vdp input region (ucVdpId; ucEsId; ucPort) ?
            CLI_Parser("vdp.s.srcr 0 1");	// set vdp source region (ucVdpId; X; Y; W; H) ?
            //vdec
            switch(ui1_video_codec)
            {
              case FCTRY_VIDEO_CODEC_MPEG2://MPEG2
                 eVideoDecFmt = VDEC_FMT_MPV;
                 break;
              case FCTRY_VIDEO_CODEC_AVC://AVC
                 eVideoDecFmt = VDEC_FMT_H264;
                 break;
              case FCTRY_VIDEO_CODEC_AVS://AVS
                 eVideoDecFmt = VDEC_FMT_AVS;
                 break;
              case FCTRY_VIDEO_CODEC_VC1://VC1
                 eVideoDecFmt = VDEC_FMT_WMV;
                 break;
              case FCTRY_VIDEO_CODEC_MPEG4VISUAL://MPEG4VISUAL
                 eVideoDecFmt = VDEC_FMT_MP4;
                 break;
              case FCTRY_VIDEO_CODEC_DIVX://DIVX
                 eVideoDecFmt = VDEC_FMT_MP4;
                 break;          
              default:
                 eVideoDecFmt = VDEC_FMT_MAX;
                 break;
            }    
            CLI_Parser_Arg("vdec.p 0 %d",eVideoDecFmt);		// video decoder play (EsId; Format)
            //dmx
            if(eVideoDecFmt == VDEC_FMT_H264)
            {
                CLI_Parser("d.svt 1");			// set DMX video type
            }            
            else if(eVideoDecFmt == VDEC_FMT_AVS)
            {
                CLI_Parser("d.svt 2");			// set DMX video type
            }
            else
            {               
                CLI_Parser("d.svt 0");			// set DMX video type
            }
            CLI_Parser_Arg("d.sp 0 0x%x video",ui2_video_pid);		// set video PID(pid_index; PID; PID_type; device_id )
            CLI_Parser("n.ms dtv1");
            //Audio
            switch(ui1_audio_codec)
            {
              case FCTRY_AUDIO_CODEC_LPCM://LPCM
                 eAudDecFmt = AUD_FMT_LPCM;
                 break;
              case FCTRY_AUDIO_CODEC_AAC://AAC
                 eAudDecFmt = AUD_FMT_AAC;
                 break;
              case FCTRY_AUDIO_CODEC_AC3://AC3
                 eAudDecFmt = AUD_FMT_AC3;
                 break;
              case FCTRY_AUDIO_CODEC_AC3_PLUS://AC3_PLUS
                 eAudDecFmt = AUD_FMT_AC3;
                 break;
              case FCTRY_AUDIO_CODEC_HEAAC://HEAAC
                 eAudDecFmt = AUD_FMT_AAC;
                 break;
              case FCTRY_AUDIO_CODEC_MPEG_AUDIO://MPEG_AUDIO
                 eAudDecFmt = AUD_FMT_MPEG;
                 break;
              default:
                 eAudDecFmt = AUD_FMT_UNKNOWN;
                 break;
            }            
            CLI_Parser("aud.a.rw 0x420 1");            
            CLI_Parser("aud.a.rw 0x421 1");
            CLI_Parser_Arg("aud.s 0 1 1 %d",eAudDecFmt);		// set audio decoder (decoder_id; stream_from; stream type)
            CLI_Parser("aud.play 0 1");							// play audio sub decoder
            CLI_Parser("aud.s 0 0 1 3");						// set audio decoder (main_decoder; stream_from_digital-tuner; stream_type_is_PCM)
            CLI_Parser("aud.play 0 0");							// play audio main decoder
            CLI_Parser_Arg("d.sp 1 0x%x audio 1",ui2_audio_pid);     	// set audio PID(pid_index; PID; PID_type; device_id )        
            CLI_Parser("aud.t.aoutg 0 0 0x1000");            
#ifndef CC_SAKURA_CUST_DRV
            CLI_Parser("osd.p.en 2 0");				// disable OSD plane 2
#endif
            CLI_Parser("n.mute.all 0 0");			// mute Vdp(ucVdpId; on/off) 
            x_thread_delay(100);
            CLI_Parser("n.mute.off 0");   			// unmute main Vdp
#if 1 // wwj		   
		   	ui4_end_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();

		   	LOG(0, "TUNE_ATSC %d ms ~~ \n", (ui4_end_time - ui4_begin_time));
#endif		   
            
            break;   
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_TUNE_DTMB:
        {
            UINT32             ui4_freq = 0;
            UINT8              ui1_modulation = 0;
            UINT8              ui1_lna = 0;
            UINT16             ui2_video_pid = 0;
            UINT8              ui1_video_codec = 0;
            UINT16             ui2_audio_pid = 0;
            UINT8              ui1_audio_codec = 0;
            UINT8              ui1_framerate = 0;
            AUD_FMT_T          eAudDecFmt = 0;
            ENUM_VDEC_FMT_T    eVideoDecFmt = 0;
#if 1 // wwj		   
		    UINT32	   ui4_begin_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();
		    UINT32	   ui4_end_time = 0;
#endif	
		   
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_TUNE_DTMB_T)))
            {
                LOG(2, "Invalid parameter (TUNE_DTMB)\n");
                return RMR_INV_ARG;
            }
            
            ui4_freq = (((DRV_TUNE_DTMB_T *)pv_set_info)->ui4_freq);
            ui1_modulation = (((DRV_TUNE_DTMB_T *)pv_set_info)->ui1_modulation);
            ui1_lna = (((DRV_TUNE_DTMB_T *)pv_set_info)->ui1_lna);
            ui2_video_pid = (((DRV_TUNE_DTMB_T *)pv_set_info)->ui2_video_pid);
            ui1_video_codec = (((DRV_TUNE_DTMB_T *)pv_set_info)->ui1_video_codec);
            ui2_audio_pid = (((DRV_TUNE_DTMB_T *)pv_set_info)->ui2_audio_pid);
            ui1_audio_codec = (((DRV_TUNE_DTMB_T *)pv_set_info)->ui1_audio_codec);
            ui1_framerate = (((DRV_TUNE_DTMB_T *)pv_set_info)->ui1_framerate);

			u1SonyFactoryMode= 1;
			
			//free DMX pid and stop VDEC
			CLI_Parser("vdec.s 0");			// stop video decoder main path
			x_thread_delay(50);
			if(ui1_factory_tune_dtmb_num != 0)
			{
				CLI_Parser("d.fpinst");			// free all DMX PIDs of instance 0
			}
			else
			{
				ui1_factory_tune_dtmb_num = 1;
			}
			
            CLI_Parser("b.scm 0"); 
            //tuner
            CLI_Parser("n.mute.on 0");      	// mute Vdp main path       
            CLI_Parser("aud.stop 0 1");  		// stop audio main decoder
            x_thread_delay(50);    
            CLI_Parser("vdp.d 0");				// disable Vdp main
            x_thread_delay(100);
            bApiVideoSetVideoSrc(0,255);		// set video source ???
            x_thread_delay(100);
            CLI_Parser("nim.id 1");  			// set tuner type to DTV 
            CLI_Parser("nim.go dtmb");          // set tuner scan rule is DTMB 
            CLI_Parser_Arg("sif.xw 4 0x100 0xc0 1 0x85 1 %d",ui1_lna);			//set lna parameter to tuner register
            CLI_Parser_Arg("nim.freq %d",ui4_freq);			//set DTMB's frequency
            x_thread_delay(100);
            //vdp
            CLI_Parser("vdp.e 0");   			// enable vdp main path ?
            CLI_Parser("vdp.s.outr 0 1");    	// set vdp ouput region (ucVdpId; X; Y; W; H)  ?
            CLI_Parser("vdp.s.i 0 0 0");		// set vdp input region (ucVdpId; ucEsId; ucPort) ?
            CLI_Parser("vdp.s.srcr 0 1");		// set vdp source region (ucVdpId; X; Y; W; H) ?
            //vdec
            switch(ui1_video_codec)
            {
              case FCTRY_VIDEO_CODEC_MPEG2://MPEG2
                 eVideoDecFmt = VDEC_FMT_MPV;
                 break;
              case FCTRY_VIDEO_CODEC_AVC://AVC
                 eVideoDecFmt = VDEC_FMT_H264;
                 break;
              case FCTRY_VIDEO_CODEC_AVS://AVS
                 eVideoDecFmt = VDEC_FMT_AVS;
                 break;
              case FCTRY_VIDEO_CODEC_VC1://VC1
                 eVideoDecFmt = VDEC_FMT_WMV;
                 break;
              case FCTRY_VIDEO_CODEC_MPEG4VISUAL://MPEG4VISUAL
                 eVideoDecFmt = VDEC_FMT_MP4;
                 break;
              case FCTRY_VIDEO_CODEC_DIVX://DIVX
                 eVideoDecFmt = VDEC_FMT_MP4;
                 break;          
              default:
                 eVideoDecFmt = VDEC_FMT_MPV;
                 break;
            }    
            CLI_Parser_Arg("vdec.p 0 %d",eVideoDecFmt);			// video decoder play (EsId; Format)
            //dmx
            if(eVideoDecFmt == VDEC_FMT_H264)
            {
                CLI_Parser("d.svt 1");			// set DMX video type
            }            
            else if(eVideoDecFmt == VDEC_FMT_AVS)
            {
                CLI_Parser("d.svt 2");			// set DMX video type
            }
            else
            {               
                CLI_Parser("d.svt 0");			// set DMX video type
            }
            CLI_Parser("d.sfe 0x10 0");
            CLI_Parser_Arg("d.sp 0 0x%x video",ui2_video_pid);		// set video PID(pid_index; PID; PID_type; device_id )
            CLI_Parser("n.ms dtv1");
            //AUDIO
            switch(ui1_audio_codec)
            {
              case FCTRY_AUDIO_CODEC_LPCM://LPCM
                 eAudDecFmt = AUD_FMT_LPCM;
                 break;
              case FCTRY_AUDIO_CODEC_AAC://AAC
                 eAudDecFmt = AUD_FMT_AAC;
                 break;
              case FCTRY_AUDIO_CODEC_AC3://AC3
                 eAudDecFmt = AUD_FMT_AC3;
                 break;
              case FCTRY_AUDIO_CODEC_AC3_PLUS://AC3_PLUS
                 eAudDecFmt = AUD_FMT_AC3;
                 break;
              case FCTRY_AUDIO_CODEC_HEAAC://HEAAC
                 eAudDecFmt = AUD_FMT_AAC;
                 break;
              case FCTRY_AUDIO_CODEC_MPEG_AUDIO://MPEG_AUDIO
                 eAudDecFmt = AUD_FMT_MPEG;
                 break;
              default:
                 eAudDecFmt = AUD_FMT_UNKNOWN;
                 break;
            }            
            CLI_Parser("aud.a.rw 0x420 1");            		
            CLI_Parser("aud.a.rw 0x421 1"); 
            CLI_Parser_Arg("aud.s 0 1 1 %d",eAudDecFmt);		// set audio decoder (decoder_id; stream_from; stream type)
            CLI_Parser("aud.play 0 1");							// play audio sub decoder
            CLI_Parser("aud.s 0 0 1 3");						// set audio decoder (main_decoder; stream_from_digital-tuner; stream_type_is_PCM)
            CLI_Parser("aud.play 0 0");							// play audio main decoder
            CLI_Parser_Arg("d.sp 1 0x%x audio 1",ui2_audio_pid);     	// set audio PID(pid_index; PID; PID_type; device_id )       
            CLI_Parser("aud.t.aoutg 0 0 0x1000");            
            CLI_Parser("aud.t.b 0 0 1");
          
            CLI_Parser("n.mute.all 0 0");          // mute Vdp(ucVdpId; on/off)    
            x_thread_delay(100);
            CLI_Parser("n.mute.off 0");  			// unmute main Vdp
#if 1 // wwj		   
		    ui4_end_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();

		    LOG(0, "TUNE_DTMB %d ms ~~ \n", (ui4_end_time - ui4_begin_time));
#endif		     
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_TUNE_DVBS:
        {    
            UINT8              ui1_tuner_path = 0;
            UINT8              ui1_standard = 0;
            UINT32             ui4_freq = 0;
            UINT32             ui1_symbol_rate = 0;
            UINT16             ui2_video_pid = 0;
            UINT8              ui1_video_codec = 0;
            UINT16             ui2_audio_pid = 0;
            UINT8              ui1_audio_codec = 0;
            UINT8              ui1_framerate = 0;
            AUD_FMT_T          eAudDecFmt = 0;
            ENUM_VDEC_FMT_T    eVideoDecFmt = 0;
#if 1 // wwj		   
		    UINT32		ui4_begin_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();
		    UINT32		ui4_end_time = 0;
#endif		   	
            
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_TUNE_DVBS_T)))
            {
                LOG(2, "Invalid parameter (TUNE_DVBS)\n");
                return RMR_INV_ARG;
            }
            
            ui1_tuner_path = (((DRV_TUNE_DVBS_T *)pv_set_info)->ui1_tuner_path);
            ui1_standard = (((DRV_TUNE_DVBS_T *)pv_set_info)->ui1_standard);
            ui4_freq = (((DRV_TUNE_DVBS_T *)pv_set_info)->ui4_freq);
            ui1_symbol_rate = (((DRV_TUNE_DVBS_T *)pv_set_info)->ui1_symbol_rate);
            ui2_video_pid = (((DRV_TUNE_DVBS_T *)pv_set_info)->ui2_video_pid);
            ui1_video_codec = (((DRV_TUNE_DVBS_T *)pv_set_info)->ui1_video_codec);
            ui2_audio_pid = (((DRV_TUNE_DVBS_T *)pv_set_info)->ui2_audio_pid);
            ui1_audio_codec = (((DRV_TUNE_DVBS_T *)pv_set_info)->ui1_audio_codec);
            ui1_framerate = (((DRV_TUNE_DVBS_T *)pv_set_info)->ui1_framerate);
  
            
            CLI_Parser("b.scm 0"); 
            //tuner
            //CLI_Parser("n.mute.on 0");            
            u1SonyFactoryMode= 1;
            CLI_Parser("aud.stop 0 1");  // stop audio main decoder
            x_thread_delay(50);         
            CLI_Parser("vdec.s 0");		// stop video decoder main path
            x_thread_delay(50);
            CLI_Parser("vdp.d 0");		// disable Vdp main 
            x_thread_delay(100);
            bApiVideoSetVideoSrc(0,255);		// set video source ???
            x_thread_delay(100);
            if(ui1_tuner_path == FACTORY_TUNER_PATH_SUB || ui1_tuner_path == 5 )//Sub & Main to Sub -Ivan Keep)
            {
                CLI_Parser("nim.id 2");  
            }
            else if(ui1_tuner_path == FACTORY_TUNER_PATH_MAIN)
            {
                CLI_Parser("nim.id 1");  
            }
            CLI_Parser("nim.go dvbs");   	// set tuner scan rule is DVB-S
            CLI_Parser_Arg("nim.sc %d %d 64",ui4_freq,ui1_symbol_rate);		// set tuner frequency and symbo_rate
            if(ui1_tuner_path == 5 ) //Main to Sub -Ivan Keep
            {
                CLI_Parser("sif.xw 1 0x100 0xc2 1 0x85 1 1");	
            }
            else
            {
                CLI_Parser("sif.xw 1 0x100 0xc2 1 0x85 1 0");
            }
            //vdp
            //vdec
            switch(ui1_video_codec)
            {
              case FCTRY_VIDEO_CODEC_MPEG2://MPEG2
                 eVideoDecFmt = VDEC_FMT_MPV;
                 break;
              case FCTRY_VIDEO_CODEC_AVC://AVC
                 eVideoDecFmt = VDEC_FMT_H264;
                 break;
              case FCTRY_VIDEO_CODEC_AVS://AVS
                 eVideoDecFmt = VDEC_FMT_AVS;
                 break;
              case FCTRY_VIDEO_CODEC_VC1://VC1
                 eVideoDecFmt = VDEC_FMT_WMV;
                 break;
              case FCTRY_VIDEO_CODEC_MPEG4VISUAL://MPEG4VISUAL
                 eVideoDecFmt = VDEC_FMT_MP4;
                 break;
              case FCTRY_VIDEO_CODEC_DIVX://DIVX
                 eVideoDecFmt = VDEC_FMT_MP4;
                 break;          
              default:
                 eVideoDecFmt = VDEC_FMT_MPV;
                 break;
            }               
            if(eVideoDecFmt == VDEC_FMT_H264)
            {
                CLI_Parser("d.svt 1");		// set DMX video type
            }           
            else if(eVideoDecFmt == VDEC_FMT_AVS)
            {
                CLI_Parser("d.svt 2");		// set DMX video type
            }
            else
            {               
                CLI_Parser("d.svt 0");		// set DMX video type
            } 
            CLI_Parser("vdp.e 0");   		// enable vdp main path ?
            CLI_Parser("vdp.s.outr 0 1"); 		// set vdp ouput region (ucVdpId; X; Y; W; H)  ?    
            CLI_Parser("vdp.s.i 0 0 0");		// set vdp input region (ucVdpId; ucEsId; ucPort) ?
            CLI_Parser("vdp.s.srcr 0 1");		// set vdp source region (ucVdpId; X; Y; W; H) ?
            CLI_Parser_Arg("vdec.p 0 %d",eVideoDecFmt);		// video decoder play (EsId; Format)
            //dmx

            if(ui1_tuner_path == FACTORY_TUNER_PATH_SUB || ui1_tuner_path == 5 )//Sub & Main to Sub -Ivan Keep)
            {
                 CLI_Parser("d.sfe 0x30 0");
            }
            else
            {
                 CLI_Parser("d.sfe 0x10 0");
            }
            CLI_Parser_Arg("d.sp 0 0x%x video",ui2_video_pid);		// set video PID(pid_index; PID; PID_type; device_id )
  
            CLI_Parser("n.ms dtv1");
            //AUDIO
            switch(ui1_audio_codec)
            {
              case FCTRY_AUDIO_CODEC_LPCM://LPCM
                 eAudDecFmt = AUD_FMT_LPCM;
                 break;
              case FCTRY_AUDIO_CODEC_AAC://AAC
                 eAudDecFmt = AUD_FMT_AAC;
                 break;
              case FCTRY_AUDIO_CODEC_AC3://AC3
                 eAudDecFmt = AUD_FMT_AC3;
                 break;
              case FCTRY_AUDIO_CODEC_AC3_PLUS://AC3_PLUS
                 eAudDecFmt = AUD_FMT_AC3;
                 break;
              case FCTRY_AUDIO_CODEC_HEAAC://HEAAC
                 eAudDecFmt = AUD_FMT_AAC;
                 break;
              case FCTRY_AUDIO_CODEC_MPEG_AUDIO://MPEG_AUDIO
                 eAudDecFmt = AUD_FMT_MPEG;
                 break;
              default:
                 eAudDecFmt = AUD_FMT_MPEG;
                 break;
            }           
            CLI_Parser("aud.a.rw 0x420 1");            
            CLI_Parser("aud.a.rw 0x421 1");
            CLI_Parser("aud.a.rw 0x422 1");
            CLI_Parser("aud.a.rw 0x425 1");
            CLI_Parser("aud.a.rw 0x427 1");
            CLI_Parser("aud.a.rw 0x429 1");
            CLI_Parser_Arg("aud.s 0 1 1 %d",eAudDecFmt);	// set audio decoder (decoder_id; stream_from; stream type)
            CLI_Parser("aud.play 0 1");					// play audio sub decoder
            CLI_Parser("aud.s 0 0 1 3");				// set audio decoder (main_decoder; stream_from_digital-tuner; stream_type_is_PCM)
            CLI_Parser("aud.play 0 0");					// play audio main decoder
            CLI_Parser_Arg("d.sp 1 0x%x audio 1",ui2_audio_pid);		// set video PID(pid_index; PID; PID_type; device_id )
            CLI_Parser("aud.t.aoutg 0 0 0x1000");            
            CLI_Parser("aud.t.b 0 0 1");                          
            CLI_Parser("n.mute.all 0 0");    	// mute Vdp(ucVdpId; on/off)          
            x_thread_delay(100);
            CLI_Parser("n.mute.off 0");   		// unmute main Vdp
#if 1 // wwj		   
		    ui4_end_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();

		    LOG(0, "TUNE_DVBS %d ms ~~ \n", (ui4_end_time - ui4_begin_time));
#endif            
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_TUNE_DVBT:
        {
           UINT8              ui1_tuner_path = 0;
           UINT8              ui1_standard = 0;
           UINT32             ui4_freq = 0;
           UINT8              ui1_bandwith = 0;
           UINT8              ui1_modulation = 0;
           UINT8              ui1_lna = 0;
           UINT16             ui2_video_pid = 0;
           UINT8              ui1_video_codec = 0;
           UINT16             ui2_audio_pid = 0;
           UINT8              ui1_audio_codec = 0;
           UINT8              ui1_framerate = 0;
           UINT8              tuner_type =0;
           AUD_FMT_T          eAudDecFmt = 0;
           ENUM_VDEC_FMT_T    eVideoDecFmt = 0;
#if 1 // wwj		   
		   UINT32	   ui4_begin_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();
		   UINT32	   ui4_end_time = 0;
#endif		   
           
           if ((pv_set_info == NULL) || (z_size != sizeof(DRV_TUNE_DVBT_T)))
           {
               LOG(2, "Invalid parameter (TUNE_DVBT)\n");
               return RMR_INV_ARG;
           }
           ui1_tuner_path = (((DRV_TUNE_DVBT_T *)pv_set_info)->ui1_tuner_path);
           ui1_standard = (((DRV_TUNE_DVBT_T *)pv_set_info)->ui1_standard);
           ui4_freq = (((DRV_TUNE_DVBT_T *)pv_set_info)->ui4_freq);
           ui1_bandwith = (((DRV_TUNE_DVBT_T *)pv_set_info)->ui1_bandwith);
           ui1_modulation = (((DRV_TUNE_DVBT_T *)pv_set_info)->ui1_modulation);
           ui1_lna = (((DRV_TUNE_DVBT_T *)pv_set_info)->ui1_lna);
           ui2_video_pid = (((DRV_TUNE_DVBT_T *)pv_set_info)->ui2_video_pid);
           ui1_video_codec = (((DRV_TUNE_DVBT_T *)pv_set_info)->ui1_video_codec);
           ui2_audio_pid = (((DRV_TUNE_DVBT_T *)pv_set_info)->ui2_audio_pid);
           ui1_audio_codec = (((DRV_TUNE_DVBT_T *)pv_set_info)->ui1_audio_codec);
           ui1_framerate = (((DRV_TUNE_DVBT_T *)pv_set_info)->ui1_framerate);

		   u1SonyFactoryMode= 1;
		   
           CLI_Parser("b.scm 0");
           //tuner
           CLI_Parser("n.mute.on 0");    	// mute Vdp main path        
           CLI_Parser("aud.stop 0 1");  	// stop audio main decoder
            x_thread_delay(50);       
           CLI_Parser("vdec.s 0"); 			// stop video decoder main path
           x_thread_delay(50);         
           CLI_Parser("vdp.d 0");			// disable Vdp main
           x_thread_delay(100);          
           bApiVideoSetVideoSrc(0,255);		// set video source ???		
           x_thread_delay(100);
           if(ui1_tuner_path == FACTORY_TUNER_PATH_SUB)
           {
               CLI_Parser("nim.id 2"); 
           }
            else if(ui1_tuner_path == FACTORY_TUNER_PATH_MAIN)
           {
               CLI_Parser("nim.id 1"); 
           }
           CLI_Parser("nim.go dvbt");   	// set tuner scan rule is DVB-T 
           CLI_Parser_Arg("sif.xw 4 0x100 0xc0 1 0x85 1 %d",ui1_lna);		//set lna parameter to tuner register
           CLI_Parser_Arg("nim.sbw %d",ui1_bandwith);  		// set tuner bandwith
           CLI_Parser_Arg("nim.freq %d",ui4_freq);			// set channel frequency
           x_thread_delay(100);
           //vdec
           
           switch(ui1_video_codec)
           {
             case FCTRY_VIDEO_CODEC_MPEG2://MPEG2
                eVideoDecFmt = VDEC_FMT_MPV;
                break;
             case FCTRY_VIDEO_CODEC_AVC://AVC
                eVideoDecFmt = VDEC_FMT_H264;
                break;
             case FCTRY_VIDEO_CODEC_AVS://AVS
                eVideoDecFmt = VDEC_FMT_AVS;
                break;
             case FCTRY_VIDEO_CODEC_VC1://VC1
                eVideoDecFmt = VDEC_FMT_WMV;
                break;
             case FCTRY_VIDEO_CODEC_MPEG4VISUAL://MPEG4VISUAL
                eVideoDecFmt = VDEC_FMT_MP4;
                break;
             case FCTRY_VIDEO_CODEC_DIVX://DIVX
                eVideoDecFmt = VDEC_FMT_MP4;
                break;          
             default:
                eVideoDecFmt = VDEC_FMT_MPV;
                break;
           }            
  
            CLI_Parser("n.ms dtv1");  		// select main source to DTV
            CLI_Parser("vdp.e 0"); 			// enable vdp main path ?
            CLI_Parser("vdp.s.outr 0 1");    	// set vdp ouput region (ucVdpId; X; Y; W; H)  ?
            CLI_Parser("vdp.s.i 0 0 0");		// set vdp input region (ucVdpId; ucEsId; ucPort) ?
            CLI_Parser("vdp.s.srcr 0 1");       // set vdp source region (ucVdpId; X; Y; W; H) ?
           x_thread_delay(50);            
          if(ui1_tuner_path == FACTORY_TUNER_PATH_SUB)
          {
                 CLI_Parser("d.sfe 0x30 0");		// set fe_type ???
          }
          else
          {
                 EEPROM_Read((UINT64)0x10011,(UPTR)(VOID *)&tuner_type,1);
                 if(tuner_type == 0x03)
                 {
                     CLI_Parser("d.sfe 0x0 0");		// set fe_type ???
                 }
                 else
                 {
                     CLI_Parser("d.sfe 0x10 0");	// set fe_type ???
                 }
          }           
          if(eVideoDecFmt == VDEC_FMT_H264)
           {
               Printf("VDEC_FMT_H264\n");
               CLI_Parser("d.svt 1");			// set DMX video type
           }
           else if(eVideoDecFmt == VDEC_FMT_AVS)
           {
               Printf("VDEC_FMT_AVS\n");
               CLI_Parser("d.svt 2");			// set DMX video type
           }
           else
           {   
               Printf("VDEC_FMT_MPEG\n");
               CLI_Parser("d.svt 0");			// set DMX video type
           } 
           CLI_Parser_Arg("vdec.p 0 %d",eVideoDecFmt);
           CLI_Parser_Arg("d.sp 0 0x%x video",ui2_video_pid);     	// set video PID(pid_index; PID; PID_type; device_id )        
           x_thread_delay(50);            
           //AUDIO
           switch(ui1_audio_codec)
           {
             case FCTRY_AUDIO_CODEC_LPCM://LPCM
                eAudDecFmt = AUD_FMT_LPCM;
                break;
             case FCTRY_AUDIO_CODEC_AAC://AAC
                eAudDecFmt = AUD_FMT_AAC;
                break;
             case FCTRY_AUDIO_CODEC_AC3://AC3
                eAudDecFmt = AUD_FMT_AC3;
                break;
             case FCTRY_AUDIO_CODEC_AC3_PLUS://AC3_PLUS
                eAudDecFmt = AUD_FMT_AC3;
                break;
             case FCTRY_AUDIO_CODEC_HEAAC://HEAAC
                eAudDecFmt = AUD_FMT_AAC;
                break;
             case FCTRY_AUDIO_CODEC_MPEG_AUDIO://MPEG_AUDIO
                eAudDecFmt = AUD_FMT_MPEG;
                break;
             default:
                eAudDecFmt = AUD_FMT_UNKNOWN;
                break;
           } 
           CLI_Parser("aud.a.rw 0x420 1");            
           CLI_Parser("aud.a.rw 0x421 1");
           CLI_Parser("aud.a.rw 0x422 1");
           CLI_Parser("aud.a.rw 0x425 1");
           CLI_Parser("aud.a.rw 0x427 1");
           CLI_Parser("aud.a.rw 0x429 1");  
           CLI_Parser_Arg("aud.s 0 1 1 %d",eAudDecFmt);		// set audio decoder (decoder_id; stream_from; stream type)
           CLI_Parser("aud.play 0 1");					// play audio sub decoder
           CLI_Parser("aud.s 0 0 1 3");					// set audio decoder (main_decoder; stream_from_digital-tuner; stream_type_is_PCM)
           CLI_Parser("aud.play 0 0");					// play audio main decoder
           CLI_Parser_Arg("d.sp 1 0x%x audio 1",ui2_audio_pid);			// set audio PID(pid_index; PID; PID_type; device_id )
           CLI_Parser("aud.t.aoutg 0 0 0x1000");            
           CLI_Parser("aud.t.b 0 0 1");           
           CLI_Parser("n.mute.all 0 0");            	// mute Vdp(ucVdpId; on/off) 	
           x_thread_delay(100);            
           CLI_Parser("n.mute.off 0");  				// unmute main Vdp
#if 1 // wwj		   
		   ui4_end_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();

		   LOG(0, "TUNE_DVBT %d ms ~~ \n", (ui4_end_time - ui4_begin_time));
#endif			              
           break;
       }
        case DRV_CUSTOM_CUST_SPEC_TYPE_TUNE_ISDBT:
        {
            UINT8              ui1_tuner_path = 0;
            UINT32             ui4_freq = 0;
            UINT16             ui2_video_pid = 0;
            UINT8              ui1_video_codec = 0;
            UINT16             ui2_audio_pid = 0;
            UINT8              ui1_audio_codec = 0;
            UINT8              ui1_framerate;
            AUD_FMT_T          eAudDecFmt = 0;
            ENUM_VDEC_FMT_T    eVideoDecFmt = 0;
#if 1 // wwj		   
		    UINT32		ui4_begin_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();
		    UINT32		ui4_end_time = 0;
#endif			               
            
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_TUNE_ISDBT_T)))
            {
                LOG(2, "Invalid parameter (TUNE_ISDBT)\n");
                return RMR_INV_ARG;
            }
            
            ui1_tuner_path = (((DRV_TUNE_ISDBT_T *)pv_set_info)->ui1_tuner_path);
            ui4_freq = (((DRV_TUNE_ISDBT_T *)pv_set_info)->ui4_freq);
            ui2_video_pid = (((DRV_TUNE_ISDBT_T *)pv_set_info)->ui2_video_pid);
            ui1_video_codec = (((DRV_TUNE_ISDBT_T *)pv_set_info)->ui1_video_codec);
            ui2_audio_pid = (((DRV_TUNE_ISDBT_T *)pv_set_info)->ui2_audio_pid);
            ui1_audio_codec = (((DRV_TUNE_ISDBT_T *)pv_set_info)->ui1_audio_codec);
            ui1_framerate = (((DRV_TUNE_ISDBT_T *)pv_set_info)->ui1_framerate);

			u1SonyFactoryMode= 1;
			
            CLI_Parser("b.scm 0"); 
            //tuner          
            CLI_Parser("n.mute.on 0");  	// mute Vdp main path          
            CLI_Parser("aud.stop 0 1");  	// stop audio main decoder
            x_thread_delay(50);
            CLI_Parser("vdec.s 0");      // stop video decoder main path //first should stop vdec,then play will ok
            x_thread_delay(50);          
            CLI_Parser("vdp.d 0");		// disable Vdp main
            x_thread_delay(100);          
            bApiVideoSetVideoSrc(0,255);		// set video source ???
            x_thread_delay(100);
            if(ui1_tuner_path == FACTORY_TUNER_PATH_SUB)
            {
                CLI_Parser("nim.id 2");  
            }
            else if(ui1_tuner_path == FACTORY_TUNER_PATH_MAIN)
            {
                CLI_Parser("nim.id 1");  
            }
            CLI_Parser("nim.go isdbt");  		//switch tuner scan rule to ISDB-T
            CLI_Parser_Arg("nim.freq %d",ui4_freq);			// set channel frequency
            //vdp
            CLI_Parser("n.ms dtv1");
            CLI_Parser("vdp.e 0");   		// enable vdp main path ?
            CLI_Parser("vdp.s.outr 0 1");    	// set vdp ouput region (ucVdpId; X; Y; W; H)  ?	
            CLI_Parser("vdp.s.i 0 0 0");		// set vdp input region (ucVdpId; ucEsId; ucPort) ?
            CLI_Parser("vdp.s.srcr 0 1");		// set vdp source region (ucVdpId; X; Y; W; H) ?
            //vdec
            switch(ui1_video_codec)
            {
              case FCTRY_VIDEO_CODEC_MPEG2://MPEG2
                 eVideoDecFmt = VDEC_FMT_MPV;
                 break;
              case FCTRY_VIDEO_CODEC_AVC://AVC
                 eVideoDecFmt = VDEC_FMT_H264;
                 break;
              case FCTRY_VIDEO_CODEC_AVS://AVS
                 eVideoDecFmt = VDEC_FMT_AVS;
                 break;
              case FCTRY_VIDEO_CODEC_VC1://VC1
                 eVideoDecFmt = VDEC_FMT_WMV;
                 break;
              case FCTRY_VIDEO_CODEC_MPEG4VISUAL://MPEG4VISUAL
                 eVideoDecFmt = VDEC_FMT_MP4;
                 break;
              case FCTRY_VIDEO_CODEC_DIVX://DIVX
                 eVideoDecFmt = VDEC_FMT_MP4;
                 break;          
              default:
                 eVideoDecFmt = VDEC_FMT_MAX;
                 break;
            }    
            CLI_Parser_Arg("vdec.p 0 %d",eVideoDecFmt);			// video decoder play (EsId; Format)
            //dmx
            if(ui1_tuner_path == FACTORY_TUNER_PATH_SUB)
            {
                 CLI_Parser("d.sfe 0x30 0");		// set fe_type ???
            }
            else
            {
                 CLI_Parser("d.sfe 0x10 0");		// set fe_type ???
            }
            if(eVideoDecFmt == VDEC_FMT_H264)
            {
                CLI_Parser("d.svt 1");			// set DMX video type
            }           
            else if(eVideoDecFmt == VDEC_FMT_AVS)
            {
                CLI_Parser("d.svt 2");			// set DMX video type
            }
            else
            {               
                CLI_Parser("d.svt 0");			// set DMX video type
            }
            CLI_Parser_Arg("d.sp 0 0x%x video",ui2_video_pid);		// set video PID(pid_index; PID; PID_type; device_id )
            //AUDIO
            switch(ui1_audio_codec)
            {
              case FCTRY_AUDIO_CODEC_LPCM://LPCM
                 eAudDecFmt = AUD_FMT_LPCM;
                 break;
              case FCTRY_AUDIO_CODEC_AAC://AAC
                 eAudDecFmt = AUD_FMT_AAC;
                 break;
              case FCTRY_AUDIO_CODEC_AC3://AC3
                 eAudDecFmt = AUD_FMT_AC3;
                 break;
              case FCTRY_AUDIO_CODEC_AC3_PLUS://AC3_PLUS
                 eAudDecFmt = AUD_FMT_AC3;
                 break;
              case FCTRY_AUDIO_CODEC_HEAAC://HEAAC
                 eAudDecFmt = AUD_FMT_AAC;
                 break;
              case FCTRY_AUDIO_CODEC_MPEG_AUDIO://MPEG_AUDIO
                 eAudDecFmt = AUD_FMT_MPEG;
                 break;
              default:
                 eAudDecFmt = AUD_FMT_UNKNOWN;
                 break;
            }
            CLI_Parser("aud.a.rw 0x420 1");            
            CLI_Parser("aud.a.rw 0x421 1");
            CLI_Parser_Arg("aud.s 0 1 1 %d",eAudDecFmt);		// set audio decoder (decoder_id; stream_from; stream type)
            CLI_Parser("aud.play 0 1");						// play audio sub decoder
            CLI_Parser("aud.s 0 0 1 3");					// set audio decoder (main_decoder; stream_from_digital-tuner; stream_type_is_PCM)
            CLI_Parser("aud.play 0 0");						// play audio main decoder
            CLI_Parser_Arg("d.sp 1 0x%x audio 1",ui2_audio_pid);     	// set audio PID(pid_index; PID; PID_type; device_id )       
            CLI_Parser("aud.t.aoutg 0 0 0x1000");            
            CLI_Parser("aud.t.b 0 0 1");            
            CLI_Parser("n.mute.all 0 0");			// mute Vdp(ucVdpId; on/off)
            x_thread_delay(100);                    
            CLI_Parser("n.mute.off 0");           // unmute main Vdp  
#if 1 // wwj		   
		    ui4_end_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();

		    LOG(0, "TUNE_ISDBT %d ms ~~ \n", (ui4_end_time - ui4_begin_time));
#endif		               
            break;
        }
        
        case DRV_CUSTOM_CUST_SPEC_TYPE_TUNE_DVBC:
        {
            UINT8              ui1_tuner_path = 0;
            UINT32             ui4_freq = 0;
            UINT8              ui1_bandwith = 0;
            UINT8              ui1_modulation = 0;
            UINT16             ui2_video_pid = 0;
            UINT8              ui1_video_codec = 0;
            UINT16             ui2_audio_pid = 0;
            UINT8              ui1_audio_codec = 0;
            UINT8              ui1_framerate = 0;
            AUD_FMT_T          eAudDecFmt = 0;
            ENUM_VDEC_FMT_T    eVideoDecFmt = 0;
            UINT8              tuner_type =0;
#if 1 // wwj		   
		    UINT32		ui4_begin_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();
		    UINT32		ui4_end_time = 0;
#endif			   
			
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_TUNE_DVBT_T)))
            {
                LOG(2, "Invalid parameter (TUNE_DVBC)\n");
                return RMR_INV_ARG;
            }           
            ui1_tuner_path = (((DRV_TUNE_DVBC_T *)pv_set_info)->ui1_tuner_path);
            ui4_freq = (((DRV_TUNE_DVBC_T *)pv_set_info)->ui4_freq);
            ui1_bandwith = (((DRV_TUNE_DVBC_T *)pv_set_info)->ui1_bandwith);
            ui1_modulation = (((DRV_TUNE_DVBC_T *)pv_set_info)->ui1_modulation);
            ui2_video_pid = (((DRV_TUNE_DVBC_T *)pv_set_info)->ui2_video_pid);
            ui1_video_codec = (((DRV_TUNE_DVBC_T *)pv_set_info)->ui1_video_codec);
            ui2_audio_pid = (((DRV_TUNE_DVBC_T *)pv_set_info)->ui2_audio_pid);
            ui1_audio_codec = (((DRV_TUNE_DVBC_T *)pv_set_info)->ui1_audio_codec);
            ui1_framerate = (((DRV_TUNE_DVBC_T *)pv_set_info)->ui1_framerate);

			u1SonyFactoryMode= 1;
			
            CLI_Parser("b.scm 0");   
            //tuner
            CLI_Parser("n.mute.on 0");   	// mute Vdp main path         
            CLI_Parser("aud.stop 0 1");  	// stop audio sub decoder
            x_thread_delay(50);
            CLI_Parser("vdec.s 0");      // stop video decoder main path //first should stop vdec,then play will ok
            x_thread_delay(50);          
            CLI_Parser("vdp.d 0");		// disable Vdp main
            x_thread_delay(100);          
            bApiVideoSetVideoSrc(0,255);		// set video source ???
            x_thread_delay(100);
            CLI_Parser("nim.id 1");  
            if(ui1_modulation == 16)
            {
                CLI_Parser("nim.go dvbc16");   	// switch tuner to DVB-C 16 QAM
            }
            else if(ui1_modulation == 32)
            {
                CLI_Parser("nim.go dvbc32");   	// switch tuner to DVB-C 32 QAM
            }           
            else if(ui1_modulation == 64)
            {
                CLI_Parser("nim.go dvbc64");   	// switch tuner to DVB-C 64 QAM
            }                   
            else if(ui1_modulation == 128)		
            {
                CLI_Parser("nim.go dvbc128");   // switch tuner to DVB-C 128 QAM
            }          
            else
            {
                CLI_Parser("nim.go dvbc64");   // switch tuner to DVB-C 64 QAM
            }
            CLI_Parser_Arg("nim.freq %d",ui4_freq);		// set current tuner frequency
            //vdp
            CLI_Parser("n.ms dtv1");		// select main source to DTV
            CLI_Parser("vdp.e 0");   		// enable vdp main path ?
            CLI_Parser("vdp.s.outr 0 1");		// set vdp ouput region (ucVdpId; X; Y; W; H)  ?
            CLI_Parser("vdp.s.i 0 0 0");		// set vdp input region (ucVdpId; ucEsId; ucPort) ?
            CLI_Parser("vdp.s.srcr 0 1");		// set vdp source region (ucVdpId; X; Y; W; H) ?
            //vdec
            switch(ui1_video_codec)
            {
              case FCTRY_VIDEO_CODEC_MPEG2://MPEG2
                 eVideoDecFmt = VDEC_FMT_MPV;
                 break;
              case FCTRY_VIDEO_CODEC_AVC://AVC
                 eVideoDecFmt = VDEC_FMT_H264;
                 break;
              case FCTRY_VIDEO_CODEC_AVS://AVS
                 eVideoDecFmt = VDEC_FMT_AVS;
                 break;
              case FCTRY_VIDEO_CODEC_VC1://VC1
                 eVideoDecFmt = VDEC_FMT_WMV;
                 break;
              case FCTRY_VIDEO_CODEC_MPEG4VISUAL://MPEG4VISUAL
                 eVideoDecFmt = VDEC_FMT_MP4;
                 break;
              case FCTRY_VIDEO_CODEC_DIVX://DIVX
                 eVideoDecFmt = VDEC_FMT_MP4;
                 break;          
              default:
                 eVideoDecFmt = VDEC_FMT_MAX;
                 break;
            }    
            CLI_Parser_Arg("vdec.p 0 %d",eVideoDecFmt);		// video decoder play (EsId; Format)
            //dmx
            if(ui1_tuner_path == FACTORY_TUNER_PATH_SUB)
            {
                 CLI_Parser("d.sfe 0x30 0");
            }
            else
            {
                EEPROM_Read((UINT64)0x10011,(UPTR)(VOID *)&tuner_type,1);
                if((tuner_type == 0x00)||(tuner_type == 0x01)||(tuner_type == 0x0b))
                {
                    CLI_Parser("d.sfe 0x10 0");
                }
                else
                {
                    CLI_Parser("d.sfe 0x0 0");
                }
            }
            if(eVideoDecFmt == VDEC_FMT_H264)
            {
                CLI_Parser("d.svt 1");		// video decoder play (EsId; Format)
            }           
            else if(eVideoDecFmt == VDEC_FMT_AVS)
            {
                CLI_Parser("d.svt 2");		// video decoder play (EsId; Format)
            }
            else
            {               
                CLI_Parser("d.svt 0");		// video decoder play (EsId; Format)
            }
            CLI_Parser_Arg("d.sp 0 0x%x video",ui2_video_pid);		// set video PID(pid_index; PID; PID_type; device_id )
            //AUDIO
            switch(ui1_audio_codec)
            {
              case FCTRY_AUDIO_CODEC_LPCM://LPCM
                 eAudDecFmt = AUD_FMT_LPCM;
                 break;
              case FCTRY_AUDIO_CODEC_AAC://AAC
                 eAudDecFmt = AUD_FMT_AAC;
                 break;
              case FCTRY_AUDIO_CODEC_AC3://AC3
                 eAudDecFmt = AUD_FMT_AC3;
                 break;
              case FCTRY_AUDIO_CODEC_AC3_PLUS://AC3_PLUS
                 eAudDecFmt = AUD_FMT_AC3;
                 break;
              case FCTRY_AUDIO_CODEC_HEAAC://HEAAC
                 eAudDecFmt = AUD_FMT_AAC;
                 break;
              case FCTRY_AUDIO_CODEC_MPEG_AUDIO://MPEG_AUDIO
                 eAudDecFmt = AUD_FMT_MPEG;
                 break;
              default:
                 eAudDecFmt = AUD_FMT_UNKNOWN;
                 break;
            }  
            CLI_Parser("aud.a.rw 0x420 1");            
            CLI_Parser("aud.a.rw 0x421 1");
            CLI_Parser_Arg("aud.s 0 1 1 %d",eAudDecFmt);		// set audio decoder (decoder_id; stream_from; stream type)
            CLI_Parser("aud.play 0 1");							// play audio sub decoder
            CLI_Parser("aud.s 0 0 1 3");						// set audio decoder (main_decoder; stream_from_digital-tuner; stream_type_is_PCM)
            CLI_Parser("aud.play 0 0");								// play audio main decoder
            CLI_Parser_Arg("d.sp 1 0x%x audio 1",ui2_audio_pid);    // set audio PID(pid_index; PID; PID_type; device_id )        
            CLI_Parser("aud.t.aoutg 0 0 0x1000");            
            CLI_Parser("aud.t.b 0 0 1");         
            x_thread_delay(100);          
            CLI_Parser("n.mute.all 0 0"); 		// mute Vdp(ucVdpId; on/off)           
            CLI_Parser("n.mute.off 0");  		// unmute main Vdp
#if 1 // wwj		   
		    ui4_end_time = x_os_get_sys_tick() * x_os_get_sys_tick_period();
 
		    LOG(0, "TUNE_DVBC %d ms ~~ \n", (ui4_end_time - ui4_begin_time));
#endif		               
            break;
        }
#endif		

		case DRV_CUSTOM_CUST_SPEC_TYPE_TUNE_SET_TUNER_PATH:
		{
			UINT8	ui1_tuner_path = 0;
				
	   		SIZE_CHK(z_size, UINT8);
			
            if (pv_set_info == NULL)
            {
                LOG(2, "Invalid parameter\n");
                return -1;              
            }

          	ui1_tuner_path = (UINT8)*((UINT8*)pv_set_info);

			if(ui1_tuner_path == FACTORY_TUNER_PATH_SUB)
            {
                CLI_Parser("nim.id 2");  
            }
            else if(ui1_tuner_path == FACTORY_TUNER_PATH_MAIN)
            {
                CLI_Parser("nim.id 1");  
            }
			
			break;
		}

        case DRV_CUSTOM_CUST_SPEC_TYPE_DISPLAY_AUDIO_JP:
	    {
		   UINT8			  ui1_tuner_path = 0;
		   UINT16			  ui2_audio_pid = 0;
		   UINT8			  ui1_audio_codec = 0;
		   UINT8			  ui1_framerate;
           AUD_FMT_T          eAudDecFmt = 0;
		   
		   if ((pv_set_info == NULL) || (z_size != sizeof(DRV_DISPLAY_AUDIO_JP_T)))
		   {
			   LOG(2, "Invalid parameter (TUNE_ISDBT)\n");
			   return RMR_INV_ARG;
		   }
		   
		   ui1_tuner_path = (((DRV_DISPLAY_AUDIO_JP_T *)pv_set_info)->ui1_tuner_path);
		   ui2_audio_pid = (((DRV_DISPLAY_AUDIO_JP_T *)pv_set_info)->ui2_audio_pid);
		   ui1_audio_codec = (((DRV_DISPLAY_AUDIO_JP_T *)pv_set_info)->ui1_audio_codec);
           CLI_Parser("aud.stop 0 1");
           x_thread_delay(50);
           switch(ui1_audio_codec)
           {
             case FCTRY_AUDIO_CODEC_LPCM://LPCM
			 	eAudDecFmt = AUD_FMT_LPCM;
			 	break;
			 case FCTRY_AUDIO_CODEC_AAC://AAC
			    eAudDecFmt = AUD_FMT_AAC;
			    break;
			 case FCTRY_AUDIO_CODEC_AC3://AC3
			    eAudDecFmt = AUD_FMT_AC3;
			    break;
			 case FCTRY_AUDIO_CODEC_AC3_PLUS://AC3_PLUS
			    eAudDecFmt = AUD_FMT_AC3;
			    break;
   			 case FCTRY_AUDIO_CODEC_HEAAC://HEAAC
   			    eAudDecFmt = AUD_FMT_AAC;
   			    break;
   			 case FCTRY_AUDIO_CODEC_MPEG_AUDIO://MPEG_AUDIO
   			    eAudDecFmt = AUD_FMT_MPEG;
   			    break;
   			 default:
			 	eAudDecFmt = AUD_FMT_UNKNOWN;
   			    break;
           }
           CLI_Parser_Arg("aud.s 0 1 1 %d",eAudDecFmt);
		   CLI_Parser("aud.play 0 1");
		   CLI_Parser("aud.s 0 0 1 3");
		   CLI_Parser("aud.play 0 0");
		   CLI_Parser_Arg("d.sp 1 0x%x audio 1",ui2_audio_pid);
		   CLI_Parser("aud.t.b 0 0 1");
           CLI_Parser("aud.a.rw 0x420 1");
           CLI_Parser("aud.a.rw 0x421 1");           
           CLI_Parser("aud.t.aoutg 0 0 0x1000");            
#ifndef CC_SAKURA_CUST_DRV
           CLI_Parser("osd.p.en 2 0");
#endif
           CLI_Parser("n.mute.all 0 0");
           CLI_Parser("n.mute.off 0");
		   
		   break;
        }
	   case DRV_CUSTOM_CUST_SPEC_TYPE_DISPLAY_VIDEO_JP:
	   {
		   UINT8			  ui1_tuner_path = 0;
		   UINT16			  ui2_video_pid = 0;
		   UINT8			  ui1_video_codec = 0;
		   ENUM_VDEC_FMT_T    eVideoDecFmt = 0;
		   
		   if ((pv_set_info == NULL) || (z_size != sizeof(DRV_DISPLAY_VIDEO_JP_T)))
		   {
			   LOG(2, "Invalid parameter (TUNE_ISDBT)\n");
			   return RMR_INV_ARG;
		   }
		   
		   ui1_tuner_path = (((DRV_DISPLAY_VIDEO_JP_T *)pv_set_info)->ui1_tuner_path);
		   ui2_video_pid = (((DRV_DISPLAY_VIDEO_JP_T *)pv_set_info)->ui2_video_pid);
		   ui1_video_codec = (((DRV_DISPLAY_VIDEO_JP_T *)pv_set_info)->ui1_video_codec);
		   
           CLI_Parser("b.scm 0");
           CLI_Parser("n.mute.on 0");
           x_thread_delay(100);
           CLI_Parser("vdec.s 0");
           x_thread_delay(50);
           CLI_Parser("vdp.d 0");
           x_thread_delay(100);
           bApiVideoSetVideoSrc(0,255);
           x_thread_delay(200);
		   CLI_Parser("n.ms dtv1");
		   CLI_Parser("vdp.e 0");	
		   CLI_Parser("vdp.s.outr 0 1");	
		   CLI_Parser("vdp.s.i 0 0 0");
		   CLI_Parser("vdp.s.srcr 0 1");
		   
           switch(ui1_video_codec)
           {
             case FCTRY_VIDEO_CODEC_MPEG2://MPEG2
			 	eVideoDecFmt = VDEC_FMT_MPV;
			 	break;
			 case FCTRY_VIDEO_CODEC_AVC://AVC
			    eVideoDecFmt = VDEC_FMT_H264;
			    break;
			 case FCTRY_VIDEO_CODEC_AVS://AVS
			    eVideoDecFmt = VDEC_FMT_AVS;
			    break;
			 case FCTRY_VIDEO_CODEC_VC1://VC1
			    eVideoDecFmt = VDEC_FMT_WMV;
			    break;
   			 case FCTRY_VIDEO_CODEC_MPEG4VISUAL://MPEG4VISUAL
   			    eVideoDecFmt = VDEC_FMT_MP4;
   			    break;
   			 case FCTRY_VIDEO_CODEC_DIVX://DIVX
   			    eVideoDecFmt = VDEC_FMT_MP4;
   			    break;			
   			 default:
			 	eVideoDecFmt = VDEC_FMT_MAX;
   			    break;
           }	
		   
		   CLI_Parser_Arg("vdec.p 0 %d",eVideoDecFmt);
		   if(eVideoDecFmt == VDEC_FMT_H264)
		   {
               CLI_Parser("d.svt 1");
		   }            
		   else if(eVideoDecFmt == VDEC_FMT_AVS)
            {
                CLI_Parser("d.svt 2");
            }
		   else
		   {               
               CLI_Parser("d.svt 0");
		   }
		   if(ui1_tuner_path == FACTORY_TUNER_PATH_SUB)
		   {
		        CLI_Parser("d.sfe 0x70 0");
		   }
		   else if(ui1_tuner_path == 7)             //SKP path
		   {
				CLI_Parser("d.sfe 0x40 0");
		   }
           else if(ui1_tuner_path == 8)             //opticast path
           {
                CLI_Parser("d.sfe 0x0 0");
           }
           else
           {
                CLI_Parser("d.sfe 0x10 0");
           }
		   CLI_Parser_Arg("d.sp 0 0x%x video",ui2_video_pid);
           CLI_Parser("nim.dm 1");
		   break;
	   }
	   
	   
	   case DRV_CUSTOM_CUST_SPEC_TYPE_WB_CLR_TEMP_IDX_SET:
	   {
		   UINT16 ui2_idx;
		   ui2_idx = *((UINT16 *)(pv_set_info));
		   WB_PBM_ColorTemp_Idx_Set(ui2_idx);
		   break;
	   }

       case DRV_CUSTOM_CUST_SPEC_TYPE_LED_MODE:
        {
			#if 0
            D_LED_DISPLAY *prLEDInfo = (D_LED_DISPLAY *)pv_set_info;

            if ((pv_set_info == NULL) || (z_size != sizeof(D_LED_DISPLAY)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
            
            LOG(3, "[d_maple_cust_spec_set] Set led %d as %d\n", prLEDInfo->eLedType, prLEDInfo->eLedState);

            CustomLEDCtrlFunc(prLEDInfo->eLedType, prLEDInfo->eLedState);
			#endif
            break;
        }

#ifndef CC_MTK_LOADER    
#if 1//def STELLAR_LED_SPEC
	   case DRV_CUSTOM_CUST_SPEC_LED_MODE:
	   {
	   	   #if 0
		   UINT16 u2LedMode = (*(UINT16*)pv_set_info);
		   DTVCFG_T rDtvCfg;
		   EEPDTV_GetCfg(&rDtvCfg);
		   if(((rDtvCfg.u1Flags & DTVCFG_FLAG_POWER_LEDOFF) && (0==u2LedMode)) || \
			  ((!(rDtvCfg.u1Flags & DTVCFG_FLAG_POWER_LEDOFF)) && (1==u2LedMode)))
		   {
			   Printf("[D-Interface] LED Mode unchanged");
			   break;
		   }
		   Printf("[%s]Set LED Mode as %s\n",__FUNCTION__,u2LedMode?"ON":"OFF");
		   if(u2LedMode == 0)//LED OFF
		   {
			  rDtvCfg.u1Flags |= DTVCFG_FLAG_POWER_LEDOFF;
		   }
		   else
		   {
			   rDtvCfg.u1Flags &= (~DTVCFG_FLAG_POWER_LEDOFF);//LED on
		   }
		   EEPDTV_SetCfg(&rDtvCfg);
		   vSonyLedModeChg(u2LedMode);
		   #endif
		   break;
	   }
#endif/* STELLAR_LED_SPEC */
#endif
        case DRV_CUSTOM_CUST_SPEC_TYPE_STANDBY_LED_DISABLE_MODE:
        {
			#if 0
            if ((pv_set_info == NULL) || (z_size != sizeof(UINT8)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
            
            CustomDisableStandbyLEDCtrl((*(UINT8 *)pv_set_info));
			#endif
            break;
        }
       
        case DRV_CUSTOM_CUST_SPEC_SET_AUDIO_INTERDAC_MUTE:
        {
//            ADAC_GpioInterDecMute((*(UINT8 *)pv_set_info));
            break;
        }        
        
        case DRV_CUSTOM_CUST_SPEC_TYPE_LOGO_STATE:
        {

            DTVCFG_T rDtvCfg;
            UINT8 u1LogoMusic = 0;
            UINT8 u1ActiveFlag = 0;
            UINT8 u1value = 0;

            if ((pv_set_info == NULL) || (z_size != sizeof(UINT8)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }

            u1ActiveFlag = (*(UINT8 *)pv_set_info);
#if 0
            if (EEPDTV_GetCfg(&rDtvCfg) == 0)
            {
                if (u1ActiveFlag & DRV_CUSTOM_LOGO_ACTIVE)
                {
                    rDtvCfg.u1Flags2 &= ~DTVCFG_FLAG2_DISABLE_LOGO;
                 //   Printf("[DRV_CUSTOM_CUST_SPEC_TYPE_LOGO_STATE]Enable LOGO (%d)\n", u1ActiveFlag);
                }
                else
                {
                    rDtvCfg.u1Flags2 |= DTVCFG_FLAG2_DISABLE_LOGO;
                 //   Printf("[DRV_CUSTOM_CUST_SPEC_TYPE_LOGO_STATE]Disable LOGO (%d)\n", u1ActiveFlag);
                }
                
                UNUSED(EEPDTV_SetCfg(&rDtvCfg));
            }
#endif
			u1value = (u1ActiveFlag & DRV_CUSTOM_LOGO_ACTIVE) ? 0 : DTVCFG_FLAG2_DISABLE_LOGO;
			UNUSED(EEPDTV_SetCfg_New(EEPDTV_DTVCFG_FLAGS2, DTVCFG_FLAG2_DISABLE_LOGO, u1value));
			EEPDTV_GetCfg(&rDtvCfg);
			if((rDtvCfg.u1Flags2 & DTVCFG_FLAG2_DISABLE_LOGO) != u1value)
			{
				Printf("[DTV_CFG] DTVCFG_FLAG2_DISABLE_LOGO %s(L:%d) ERROR!!!\n", __FUNCTION__, __LINE__);
			}
#ifdef CC_AUD_SETUP_MELODY             
            u1LogoMusic = bApiEepromReadByte(EEP_BOOT_MUSIC_ONOFF);
            if (u1ActiveFlag & DRV_CUSTOM_LOGO_MUSIC_ACTIVE)
            {
                u1LogoMusic |= AUD_POWER_ON_MUSIC_MASK;
            }
            else
            {
                u1LogoMusic &= ~AUD_POWER_ON_MUSIC_MASK;
            }
            UNUSED(fgApiEepromWriteByte(EEP_BOOT_MUSIC_ONOFF, u1LogoMusic));
#else
            u1LogoMusic &= ~AUD_POWER_ON_MUSIC_MASK;
            UNUSED(fgApiEepromWriteByte(EEP_BOOT_MUSIC_ONOFF, u1LogoMusic));
#endif            
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_LOGO_DISPLAY:
        {
#ifdef CC_AUD_SETUP_MELODY 
            UINT32 i = 0;
#endif           
            //CustomDisplayLogo();
            x_thread_delay(1000);
#ifdef CC_AUD_SETUP_MELODY 
            while (!AUD_IsSetupMelodyFinish()) 
            { 
                x_thread_delay(500); 
                i++;
                if(i==6)
                {
                    i=0;
                    Printf("Start Up Aud timeout!\n");
                    break;          
                }
            } 
            AUD_StopSetupMelody(AUD_DEC_MAIN);    
#endif
            break;
        }

#ifdef CUSTOM_SELF_DIAG_ENABLE        
        case DRV_CUSTOM_CUST_SPEC_TYPE_SELF_DIAG_MODE:
        {
            UNUSED(SelfDiagResetCounter());
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_SELF_DIAG_MODE_V2:
        {
            UNUSED(SelfDiagResetCounter());
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_BOOT_COUNT_MODE:
        {
            UNUSED(SelfDiagResetBootCount());
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_CLEAR_COUNTER:
        {
            UNUSED(SelfDiagResetCounterInServiceMode());
            break;
        }
		case DRV_CUSTOM_CUST_SPEC_TYPE_CLEAR_STDWNCNT_ERRORLOG:
		{//FY16 selfdiagnosis spec ,page 20
			UNUSED(SelfDiagResetErrorLog());
			UNUSED(SelfDiagResetStdwnOnOffCnt());
			break;
		}
#endif /* CUSTOM_SELF_DIAG_ENABLE */
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_SCART_YPBPR_PARAM:
        {
            if ((pv_set_info == NULL) || (z_size != sizeof(UINT8)))
            {
                LOG(2, "[DRV_CUSTOM_CUST_SPEC_TYPE_SET_SCART_YPBPR_PARAM] Invalid parameter\n");
                return RMR_INV_ARG;
            }          
            //vSetScartYPbPrParamUser(*(UINT8 *)pv_set_info);
            break;
        }

        case DRV_CUSTOM_CUST_SPEC_TYPE_LOADER_UPGRADE_MODE:
        {
			#if 0
            BOOL bEnable = TRUE;
            if ((pv_set_info == NULL) || (z_size != sizeof(UINT8)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }

            bEnable = ((*(UINT8 *)pv_set_info) == 1) ? TRUE : FALSE;
            CustomSetLoaderUsbUpgrade(bEnable);
			#endif
            break;
        }

		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_COLOR_PICKUP:
		{
	#ifdef CC_MAPLE_CUST_DRV
			UINT32 u4Val, u4BeType=0;
			UINT8 u1HasBE=SV_FALSE;
			
			if ((pv_set_info == NULL) || (z_size != sizeof(DRV_CUSTOM_COLOR_PICKUP)))
			{
				LOG(2, "Invalid parameter\n");
				return RMR_INV_ARG;
			}

			UNUSED(DRVCUST_InitQuery(eGet2KModelSupport, &u4Val));
			UNUSED(DRVCUST_InitQuery(eGet4KModelBEType, &u4BeType));
			//BIT0: (0/1) (2K/4K)
			if (((u4Val&0x00000003) == 0x00000000) || (u4BeType==0))
			{
                u1HasBE = SV_FALSE;
			}
			else
			{
                u1HasBE = SV_TRUE;
			}
			
			//please implement be related function here
			if (!u1HasBE)
			{
				gu2Pick_x = (((DRV_CUSTOM_COLOR_PICKUP *)pv_set_info)->set.ui2_x);
				gu2Pick_y = (((DRV_CUSTOM_COLOR_PICKUP *)pv_set_info)->set.ui2_y);
			}
			else
			{
				DRVCUST_SetColorPickData((((DRV_CUSTOM_COLOR_PICKUP *)pv_set_info)->set.ui2_x),
										(((DRV_CUSTOM_COLOR_PICKUP *)pv_set_info)->set.ui2_y));
			}
			
	#endif
			break;				
		}

        case DRV_CUSTOM_CUST_SPEC_TYPE_MONITOR_OUT:
        {
#if 0//ndef DEMO_BOARD
            /* default Value is CVBS In */
            INT32 i4GPIOValue = DRV_CUSTOM_CVBS_IN_POLARITY;
            
            if ((pv_set_info == NULL) || (z_size != sizeof(BOOL)))
            {
                LOG(2, "[DRV_CUSTOM_CUST_SPEC_TYPE_MONITOR_OUT] Invalid parameter\n");
                return RMR_INV_ARG;
            }            
            
            i4GPIOValue = ((*(BOOL *)pv_set_info) == TRUE) ? DRV_CUSTOM_MONITOR_OUT_POLARITY : DRV_CUSTOM_CVBS_IN_POLARITY;
            GPIO_Output(DRV_CUSTOM_MONITOR_OUT_GPIO, &i4GPIOValue);
#endif /* DEMO_BOARD */
            break;
        }
        case DRV_CUSTOM_VID_TYPE_LED_MOTION:
        {
			vHalVideoLEDMotion((UINT8) ((UINT32) pv_set_info));
			//DRVCUST_SendEvent(E_CUST_PIC_SETTING_CHANGE, 0);
         //Printf("Set DRV_CUSTOM_VID_TYPE_LED_MOTION (%d)\n", (UINT8) ((UINT32) pv_set_info));
            break;
        }
		case DRV_CUSTOM_CUST_SPEC_TYPE_LED_BLINK_CONTROL:
		{
            #if 0
            /* FIXME !!!! */
            IRRC_LedBlinkConfig((BOOL) ((UINT32) pv_set_info));
            #endif

			Printf("Set DRV_CUSTOM_CUST_SPEC_TYPE_LED_BLINK_CONTROL (%d)\n", (BOOL) ((UINT32) pv_set_info));
			break;
		}

		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_MPEG_NR:
		{
			PE_SetArg(VDP_1, PE_ARG_MPEG_NR, *((INT16*)pv_set_info));
			break;
		}
		case DRV_CUSTOM_CUST_SPEC_TYPE_POP_CVBS_COMP_NOTIFY:
		{
            #if 0
            /* FIXME !!!! */
			vDrvPOPModeYPBPRAV();
            #endif

			Printf("Set DRV_CUSTOM_CUST_SPEC_TYPE_POP_CVBS_COMP_NOTIFY \n");
			break;
		}		
		case DRV_CUSTOM_CUST_SPEC_TYPE_GPIO_OUTPUT_STATUS:
		{
			#if 0
			if (z_size != sizeof(DRV_CUSTOM_GPIO_OUTPUT_TYPE_T))
			{
				return (-1);
			}
			GPIO_Output((INT32)(((DRV_CUSTOM_GPIO_OUTPUT_TYPE_T *)pv_set_info)->ui1_gpio_output_id),
						(INT32 *)(((DRV_CUSTOM_GPIO_OUTPUT_TYPE_T *)pv_set_info)->ui1_gpio_output_status));
					return 0;
			#endif
		}
        case DRV_CUSTOM_CUST_SPEC_TYPE_TEST_PTN_RAMP:
        {
            if(*((UINT16*)pv_set_info))
            {
                //Sony_PreSetup(TRUE);
                //DRVCUST_TurnOnRamp(*((UINT16 *)pv_set_info));
            }
            else
            {
                //Sony_PreSetup(FALSE);
                //DRVCUST_TurnOnRamp(*((UINT16 *)pv_set_info));
            }
            break;
        }
		
        case DRV_CUSTOM_CUST_SPEC_DISP_REG_WB_R_GAIN:
            vDrvSetRGain1(SV_VP_MAIN, ((UINT16)((UINT32)pv_set_info)));
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_REG_WB_G_GAIN:
            vDrvSetGGain1(SV_VP_MAIN, ((UINT16)((UINT32)pv_set_info)));
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_REG_WB_B_GAIN:
            vDrvSetBGain1(SV_VP_MAIN, ((UINT16)((UINT32)pv_set_info)));
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_REG_WB_R_OFFSET:
            vDrvSetROffset11(SV_VP_MAIN, ((UINT16)((UINT32)pv_set_info)));
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_REG_WB_G_OFFSET:
            vDrvSetGOffset11(SV_VP_MAIN, ((UINT16)((UINT32)pv_set_info)));
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_REG_WB_B_OFFSET:
            vDrvSetBOffset11(SV_VP_MAIN, ((UINT16)((UINT32)pv_set_info)));
            break;
#if 0
        case DRV_CUSTOM_CUST_SPEC_DISP_EEP_WB_MAGIC:
            {
                UINT8   ui1_m0, ui1_m1;

                ui1_m0 = (((WB_T *) pv_set_info)->ui1_magic[0]);
                ui1_m1 = (((WB_T *) pv_set_info)->ui1_magic[1]);
                fgApiEepromWriteByte( EEP_DISP_WB_MAGIC00,    ui1_m0);
                fgApiEepromWriteByte( EEP_DISP_WB_MAGIC00+1,  ui1_m1);
            }
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_EEP_WB_R_GAIN:
            {
                UINT8   ui1_hi, ui1_lo, ui1_clr_temp;
                UINT16  ui2_tmp;

                ui1_clr_temp = (((WB_T *) pv_set_info)->ui1_color_temp);
                ui2_tmp = (((WB_T *) pv_set_info)->ui2_val);
                ui1_hi = (ui2_tmp & 0xFF00) >> 8;
                ui1_lo =  ui2_tmp & 0x00FF;
                fgApiEepromWriteByte( EEP_DISP_WB_COOL_R_GAIN_LO+(ui1_clr_temp*6),   ui1_lo);
                fgApiEepromWriteByte( EEP_DISP_WB_COOL_R_GAIN_LO+(ui1_clr_temp*6)+1, ui1_hi);
            }
            break;

        case DRV_CUSTOM_CUST_SPEC_DISP_EEP_WB_G_GAIN:
            {
                UINT8   ui1_hi, ui1_lo, ui1_clr_temp;
                UINT16  ui2_tmp;

                ui1_clr_temp = (((WB_T *) pv_set_info)->ui1_color_temp);
                ui2_tmp = (((WB_T *) pv_set_info)->ui2_val);
                ui1_hi = (ui2_tmp & 0xFF00) >> 8;
                ui1_lo =  ui2_tmp & 0x00FF;
                fgApiEepromWriteByte( EEP_DISP_WB_COOL_R_GAIN_LO+2+(ui1_clr_temp*6),   ui1_lo);
                fgApiEepromWriteByte( EEP_DISP_WB_COOL_R_GAIN_LO+2+(ui1_clr_temp*6)+1, ui1_hi);
            }
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_EEP_WB_B_GAIN:
            {
                UINT8   ui1_hi, ui1_lo, ui1_clr_temp;
                UINT16  ui2_tmp;

                ui1_clr_temp = (((WB_T *) pv_set_info)->ui1_color_temp);
                ui2_tmp = (((WB_T *) pv_set_info)->ui2_val);
                ui1_hi = (ui2_tmp & 0xFF00) >> 8;
                ui1_lo =  ui2_tmp & 0x00FF;
                fgApiEepromWriteByte( EEP_DISP_WB_COOL_R_GAIN_LO+4+(ui1_clr_temp*6),   ui1_lo);
                fgApiEepromWriteByte( EEP_DISP_WB_COOL_R_GAIN_LO+4+(ui1_clr_temp*6)+1, ui1_hi);
            }
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_EEP_WB_R_OFFSET:
            {
                UINT8   ui1_hi, ui1_lo, ui1_clr_temp;
                UINT16  ui2_tmp;

                ui1_clr_temp = (((WB_T *) pv_set_info)->ui1_color_temp);
                ui2_tmp = (((WB_T *) pv_set_info)->ui2_val);
                ui1_hi = (ui2_tmp & 0xFF00) >> 8;
                ui1_lo =  ui2_tmp & 0x00FF;
                fgApiEepromWriteByte( EEP_DISP_WB_COOL_R_GAIN_LO+24+(ui1_clr_temp*6),   ui1_lo);
                fgApiEepromWriteByte( EEP_DISP_WB_COOL_R_GAIN_LO+24+(ui1_clr_temp*6)+1, ui1_hi);
            }
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_EEP_WB_G_OFFSET:
            {
                UINT8   ui1_hi, ui1_lo, ui1_clr_temp;
                UINT16  ui2_tmp;

                ui1_clr_temp = (((WB_T *) pv_set_info)->ui1_color_temp);
                ui2_tmp = (((WB_T *) pv_set_info)->ui2_val);
                ui1_hi = (ui2_tmp & 0xFF00) >> 8;
                ui1_lo =  ui2_tmp & 0x00FF;
                fgApiEepromWriteByte( EEP_DISP_WB_COOL_R_GAIN_LO+26+(ui1_clr_temp*6),   ui1_lo);
                fgApiEepromWriteByte( EEP_DISP_WB_COOL_R_GAIN_LO+26+(ui1_clr_temp*6)+1, ui1_hi);
            }
            break;
         case DRV_CUSTOM_CUST_SPEC_DISP_EEP_WB_B_OFFSET:
            {
                UINT8   ui1_hi, ui1_lo, ui1_clr_temp;
                UINT16  ui2_tmp;

                ui1_clr_temp = (((WB_T *) pv_set_info)->ui1_color_temp);
                ui2_tmp = (((WB_T *) pv_set_info)->ui2_val);
                ui1_hi = (ui2_tmp & 0xFF00) >> 8;
                ui1_lo =  ui2_tmp & 0x00FF;
                fgApiEepromWriteByte( EEP_DISP_WB_COOL_R_GAIN_LO+28+(ui1_clr_temp*6),   ui1_lo);
                fgApiEepromWriteByte( EEP_DISP_WB_COOL_R_GAIN_LO+28+(ui1_clr_temp*6)+1, ui1_hi);
            }
            break;
#endif
		case DRV_CUSTOM_CUST_SPEC_DISP_DYN_GAMMA_MAGIC_NUM:
			 {
			 	#if 0 
                UINT8   ui1_i, ui1_tmp;
                for(ui1_i=0; ui1_i<8; ui1_i++)
                {
                    ui1_tmp = (((DYN_GAMMA_T *) pv_set_info)->ui1_magic_num[ui1_i]);
                    fgApiEepromWriteByte( (EEP_DYN_GAMMA_MAGIC00 + ui1_i), ui1_tmp );
                }
				#endif
			 }
			 break;
		 case DRV_CUSTOM_CUST_SPEC_DISP_DYN_GAMMA:
			 {
			 	 #if 0
				 UINT8	 ui1_point = (((DYN_GAMMA_T *) pv_set_info)->ui1_gamma_point),
						 ui1_hi, ui1_lo, ui1_i;
				 UINT16  ui2_offset, ui2_val[3];
		
				 ui2_val[0] = (((DYN_GAMMA_T *) pv_set_info)->ui2_r);
				 ui2_val[1] = (((DYN_GAMMA_T *) pv_set_info)->ui2_g);
				 ui2_val[2] = (((DYN_GAMMA_T *) pv_set_info)->ui2_b);
				 for(ui1_i=0; ui1_i<3; ui1_i++)
				 {
					 ui2_offset = (EEP_DYN_GAMMA_MAGIC07+1) + (UINT16)ui1_i*22 + (UINT16)ui1_point*2;
					 ui1_lo = ( ui2_val[ui1_i] & 0x00FF );
					 ui1_hi = ( ui2_val[ui1_i] & 0xFF00 ) >> 8;
					 fgApiEepromWriteByte( ui2_offset,	 ui1_lo);
					 fgApiEepromWriteByte( ui2_offset+1, ui1_hi);
				 }
				 #endif
			 }
			 break;
		 case DRV_CUSTOM_CUST_SPEC_DISP_DYN_GAMMA_RELOAD:
            DRVCUST_SET_GAMMA();
			 break;
		 case DRV_CUSTOM_CUST_SPEC_DISP_DYN_GAMMA_REMAP:
            vDrvGammaProc();
            #if 0//ENABLE_SOEM_PQ wangle for build pass
            vDrvSetGammaRemap(SV_ON);
            #endif
			 break;
		 case DRV_CUSTOM_CUST_SPEC_DISP_DYN_GAMMA_LINEAR:
		     DRVCUST_SET_DEFAULT_GAMMA_REMAP();
             //vIO32WriteFldAlign(ADAPTIVE_RGB_GAMMA_REG, 0x30, ADAPTIVE_RGB_GAMMA_SEL);
			 break;
		 case DRV_CUSTOM_CUST_SPEC_DISP_BLUE_STRETCH:
			 vDrvSetBlueStretchOnOff( SV_VP_MAIN, ((UINT8)((UINT32)pv_set_info)) );
			 break;
		 case DRV_CUSTOM_CUST_SPEC_DISP_SCE_ON_OFF:
            #if ENABLE_SOEM_PQ 
			 if((UINT8)pv_set_info)
			 {
				 //vDrvMainSCEOnOff(TRUE);
				 vDrvSCEAllOnOff(TRUE);
			 }
			 else
			 {
				 vDrvSCEAllOnOff(FALSE);
			 }
			 #endif
			 break;
		 case DRV_CUSTOM_CUST_SPEC_DISP_DCR_ON_OFF:
            #if 0 //ENABLE_SOEM_PQ  //Weibin mark
			 if(((FAC_DCR_T *) pv_set_info)->b_onoff)
			 /* On */
				 //DRVCUST_DBC_DEBUG_MODE( 0xFF, PANEL_GetBacklightHigh());
			 else
			 /* Off */
			 {
				 if(((FAC_DCR_T *) pv_set_info)->b_get_bl_max)
					 //DRVCUST_DBC_DEBUG_MODE( 0x30, PANEL_GetBacklightHigh());
				 else
				 {
					 //DRVCUST_DBC_DEBUG_MODE( 0x30, (((FAC_DCR_T *) pv_set_info)->ui1_bl_level));
				 }
			 }
			 #endif
			 break;

		
		case DRV_CUSTOM_CUST_SPEC_GAMMA_BUF:
		{
			#if 0
			if (z_size != sizeof(DRV_GAMMA_BUF_T))
        	{
            	return (-1);
        	}

				vDrvWriteGammaBuf(((DRV_GAMMA_BUF_T *)pv_set_info)->ui1_Index,
										   ((DRV_GAMMA_BUF_T *)pv_set_info)->ui2_rx,
								  ((DRV_GAMMA_BUF_T *)pv_set_info)->ui2_gx,
								  ((DRV_GAMMA_BUF_T *)pv_set_info)->ui2_bx);
         
					return 0;
			#endif
			break;
		}
        case DRV_CUSTOM_CUST_SPEC_TYPE_AGING_PTN:
		{
		    AgingShowPattern(*(UINT16 *)pv_set_info);
			break;
        }
		
        case DRV_CUSTOM_CUST_SPEC_V_COM_DRV:
        {
			
			#if 0     
			DRV_CUSTOM_VCOM_ST *pVcomParam = (DRV_CUSTOM_VCOM_ST *)pv_set_info;  

			if(pVcomParam->vcom_type == SDCVCOM)
			{
				UINT8	u1DataSet,u1DataSave;

				GPIO_SetOut(85,1);//PANEL_CTRL1
				u1DataSet = (UINT8) *((UINT16*)pVcomParam->vcom_value)<< 1;  // shift 1 bit for v-com spec
				SIF_X_Write(1, 0x100, 0x9e, 0, 0,&u1DataSet, 1);
				u1DataSave = u1DataSet + 1; //(UINT8) *((UINT16*)pv_set_info);  // shift 1 bit for v-com spec
				SIF_X_Write(1, 0x100, 0x9e, 0, 0,&u1DataSave, 1);     
				x_thread_delay(100); 
				GPIO_SetOut(85,0);            
			}            

			if(pVcomParam->vcom_type == LGDVCOM)            
			{    		  
				UINT8	u1Data;              
				GPIO_SetOut(85,1);//PANEL_CTRL1              
				u1Data = (UINT8) *((UINT16*)pVcomParam->vcom_value)>> 8;  // shift 1 bit for v-com spec 
				SIF_X_Write(1, 0x100, 0x40, 1, 0x15,&u1Data, 1);
				u1Data = (UINT8) *((UINT16*)pVcomParam->vcom_value) & 0xff;  // shift 1 bit for v-com spec 
				SIF_X_Write(1, 0x100, 0x40, 1, 0x16,&u1Data, 1);  
				u1Data = 0x40;              
				SIF_X_Write(1, 0x100, 0x40, 1, 0xff,&u1Data, 1);              
				x_thread_delay(100);            
			}
//           	 Factory2K12Debug(c_sprintf(fact_dbg_buf,"-- DRV_CUSTOM_CUST_SPEC_V_COM_DRV, set(%x) --\n",(*((UINT16*)pv_set_info))));          
            #endif
            break;
			//Wai Kit,Azu LGD V_COM 4 May 2013 - End
			
        }
        case DRV_CUSTOM_CUST_SPEC_SET_HTL_IR_PASS_THROUGH:
        {
            #ifdef CC_MAPLE_CUST_DRV           
            INT32 i4GPIOValue;

            if ((pv_set_info == NULL) || (z_size != sizeof(BOOL)))
            {
                LOG(2, "[DRV_CUSTOM_CUST_SPEC_SET_HTL_IR_PASS_THROUGH] Invalid parameter\n");
                return RMR_INV_ARG;
            }          
            i4GPIOValue = ((*(BOOL *)pv_set_info) == TRUE) ? DRV_CUSTOM_IR_PASS_THROUGH_GPIO_ON : DRV_CUSTOM_IR_PASS_THROUGH_GPIO_OFF;
            GPIO_Output(DRV_CUSTOM_IR_PASS_THROUGH_GPIO, &i4GPIOValue);
            #endif
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_WB_EDID_WRITE:
        {
            u4_WB_EDID_Write_return = 0;
            if (0 != Sony_PQ_GAMMA_EDID_Write(*(UINT16*)pv_set_info) ||
                0 != Sony_PBM_EDID_Write(*(UINT16*)pv_set_info))
            {
            u4_WB_EDID_Write_return = 1;
            }
            Factory2K12Debug(c_sprintf(fact_dbg_buf,"dint(%d)\n", u4_WB_EDID_Write_return));
            break;
        }

		case DRV_CUSTOM_CUST_SPEC_EEP_UPDATE:
		{
			UINT16 Aging_EEP = (*(UINT16*)pv_set_info);
			EEPROM_Write((UINT64) 0x1e80,(UPTR)&Aging_EEP,1);
			break;
		}
		
		case DRV_CUSTOM_CUST_SPEC_TYPE_GAMMA_PTN_PRESET_BEFORE_GET_LVL:
		{
			UINT16 ui2RGBLVL;
			UINT8 ui1GRgb;
			UINT8 ui1GLvl;

            ui2RGBLVL= *(UINT16 *)pv_set_info;

            ui1GRgb = (UINT8)((ui2RGBLVL&0xFF00)>>8);
            ui1GLvl = (UINT8)(ui2RGBLVL&0x00FF);
			
			switch(ui1GRgb)
			{
			   case 0x00:
			   	Current_Gamma_RGB = GAMMA_R;
			   	break;
			   case 0x01:
			   	Current_Gamma_RGB = GAMMA_G;
				break;
			   case 0x02:
			   	Current_Gamma_RGB = GAMMA_B;
				break;
			   default:
			   	break;
			}            

			switch(ui1GLvl)
			{
			   case 0x00:
			   	Current_Luma_Lvl = LUMA_LVL_0;
			   	break;
			   case 0x01:
			   	Current_Luma_Lvl = LUMA_LVL_1;
				break;
			   case 0x02:
			   	Current_Luma_Lvl = LUMA_LVL_2;
				break;
			   case 0x03:
			   	Current_Luma_Lvl = LUMA_LVL_3;
			   	break;
			   case 0x04:
			   	Current_Luma_Lvl = LUMA_LVL_4;
				break;
			   case 0x05:
			   	Current_Luma_Lvl = LUMA_LVL_5;
				break;
			   case 0x06:
			   	Current_Luma_Lvl = LUMA_LVL_6;
			   	break;
			   case 0x07:
			   	Current_Luma_Lvl = LUMA_LVL_7;
				break;
			   case 0x08:
			   	Current_Luma_Lvl = LUMA_LVL_8;
				break;
			   case 0x09:
			   	Current_Luma_Lvl = LUMA_LVL_9;
			   	break;
			   case 0x0a:
			   	Current_Luma_Lvl = LUMA_LVL_10;
				break;
			   default:
			   	break;
			} 			
			break;
		}
		
		case DRV_CUSTOM_CUST_SPEC_TYPE_GAMMA_PTN_SET_LVL:
		{
			UINT16 Val;

			Val = (*(UINT16 *)pv_set_info);		
			Sony_GammaSetLvl(Current_Gamma_RGB,Current_Luma_Lvl,Val);
			
			break;
		}
		
		case DRV_CUSTOM_CUST_SPEC_TYPE_GAMMA_SET_SELECT_LVL:
		{
			UINT16 ui2GLvl;

			ui2GLvl = (*(UINT16 *)pv_set_info);
			Sony_GammaSelectLvl(ui2GLvl);
			
			break;
		}	
		
		case DRV_CUSTOM_CUST_SPEC_TYPE_GAMMA_VID_PRESET:
		{
			Sony_Video_PreSetup(*(UINT16 *)pv_set_info);
			break;
		}

		case DRV_CUSTOM_CUST_SPEC_TYPE_WBS_TO_NVM_PRESET:
		{
			#if 1
			UINT16 ui2WbsNvmEnv;
			UINT8 ui1ColorIdx;
			UINT8 ui1WbLevel;
			UINT8 ui1Gamma;

            ui2WbsNvmEnv= *(UINT16 *)pv_set_info;

            ui1ColorIdx = (UINT8)((ui2WbsNvmEnv & 0xFF00)>>8);
            ui1WbLevel = (UINT8)((ui2WbsNvmEnv&0x00F0)>>4);
            ui1Gamma = (UINT8)(ui2WbsNvmEnv&0x000F);
			
			switch(ui1ColorIdx)
			{
			   case 0x00:
			   	Current_Wbs_Nvm_Env.CLRIDX = WB_COOL;
			   	break;
			   case 0x01:
			   	Current_Wbs_Nvm_Env.CLRIDX = WB_NEUTRAL;
				break;
			   case 0x02:
			   	Current_Wbs_Nvm_Env.CLRIDX = WB_WARM1;
				break;
			   case 0x03:
			   	Current_Wbs_Nvm_Env.CLRIDX = WB_WARM2;
				break;			   
			   case 0x04:
			   	Current_Wbs_Nvm_Env.CLRIDX = WB_PHOTO;
				break;
			   default:
			   	break;
			} 
			switch(ui1WbLevel)
			{
			   case 0x00:
				Current_Wbs_Nvm_Env.WBLVL = WB_HIGHLIGHT;
				break;
			   case 0x01:
			   	Current_Wbs_Nvm_Env.WBLVL = WB_CUTOFF;
				break;
			   default:
			   	break;
			}
			switch(ui1Gamma)
			{
			   case 0x00:
				Current_Wbs_Nvm_Env.GAMMA = GAMMA_R;
				break;
			   case 0x01:
			   	Current_Wbs_Nvm_Env.GAMMA = GAMMA_G;
				break;
			   case 0x02:
			   	Current_Wbs_Nvm_Env.GAMMA = GAMMA_B;
				break;
			   default:
			   	break;
			}
			#endif
			break;
		}		
		case DRV_CUSTOM_CUST_SPEC_TYPE_WBS_TO_NVM_SET:
		{
			#if 1
			UINT16 Val;

			Val = (*(UINT16 *)pv_set_info);
			Sony_WBSetData(Current_Wbs_Nvm_Env.CLRIDX, Current_Wbs_Nvm_Env.WBLVL, Current_Wbs_Nvm_Env.GAMMA, Val);
            #endif
			break;
		}		
		case DRV_CUSTOM_CUST_SPEC_TYPE_GAMMA_PTN_REFRESH:
		{
			#if 1
			Luma_RGB_T LUMA_RGB;
			UINT8 uiFgRgb;
			
            LUMA_RGB = Sony_GammaPatternRGB_Read();
            uiFgRgb = (((GAMMA_SET_PTN_RGB_T *)pv_set_info)->ui1Rgb);

            if(fgGammaRefreshFirstcall)
            {
			   	LUMA_RGB.Luma_R = 0;
				LUMA_RGB.Luma_G = 0;
				LUMA_RGB.Luma_B = 0;
				fgGammaRefreshFirstcall = FALSE;
            }
			
			switch(uiFgRgb)
			{
			   case 0x00:
			   	LUMA_RGB.Luma_R = (((GAMMA_SET_PTN_RGB_T *)pv_set_info)->ui4Val);
			   	break;
			   case 0x01:
			   	LUMA_RGB.Luma_G = (((GAMMA_SET_PTN_RGB_T *)pv_set_info)->ui4Val);
				break;
			   case 0x02:
			   	LUMA_RGB.Luma_B = (((GAMMA_SET_PTN_RGB_T *)pv_set_info)->ui4Val);
				break;
			   default:
			   	break;
			}
			
			Sony_GammaPatternRefresh(&LUMA_RGB);
			#endif
			break;
		}
		case DRV_CUSTOM_CUST_SPEC_TYPE_WB_PBM_PQP_PGRAM_LUT_SET:
		{
            UINT16 * ptrpqp_lut;
			UINT16 ui2Idx;

			ptrpqp_lut = (((WB_PBM_PQP_LUT_SET_T *)pv_set_info)->aui2PqpLut);
			ui2Idx = (((WB_PBM_PQP_LUT_SET_T *)pv_set_info)->ui2WbIndex);
			WB_PBM_PQP_PGAM_LUT_Set(ptrpqp_lut, ui2Idx);
			break;
		}
	    case DRV_CUSTOM_CUST_SPEC_TYPE_WB_PBM_PQP_PGRAM_LUT_GET_PRESET:
		{
			Current_Pqp_Lut_setting.ui1RgbIdx   = (((WB_PBM_PQP_LUT_PRESET_T *)pv_set_info)->ui1RgbIdx);
			Current_Pqp_Lut_setting.ui1WbIndex  = (((WB_PBM_PQP_LUT_PRESET_T *)pv_set_info)->ui1WbIndex);
			Current_Pqp_Lut_setting.ui1WblvlIdx = (((WB_PBM_PQP_LUT_PRESET_T *)pv_set_info)->ui1WblvlIdx);
			break;
		}
		case DRV_CUSTOM_CUST_SPEC_TYPE_BACKLIGHT_CONTROL:
		{
			#if 0
            UINT8 OperationMode,ui1Set;
			UINT16 OperationParameter;

			OperationMode = (((BL_CTRL_OPERATION_T *)pv_set_info)->uiOpMode);
			OperationParameter = (((BL_CTRL_OPERATION_T *)pv_set_info)->ui2OpParameter);
			
			switch(OperationMode)
			{
			   case 0x01:
                if(OperationParameter == 0x0000) {
			        ui1Set = 1;
                } else {
                    ui1Set = 0;
                }			   	
			   	DRVCUST_WriteDynamicBacklight(ui1Set);
			   	break;
			   case 0x03:
			   	ui1Set = (UINT8)OperationParameter;
			   	DRVCUST_WritePMX(ui1Set);
				break;
			   default:
			   	break;
			}
			#endif
			break;
		}
		case DRV_CUSTOM_CUST_SPEC_TYPE_WB_ACFG_UPDATE_SET:
		{
			UINT16 Val;

			Val = (*(UINT16 *)pv_set_info);			
			Sony_WB_Acfg_Update_Set(Val);
			break;
		}
		case DRV_CUSTOM_CUST_SPEC_TYPE_TUNER_SWITCH:
		{
			INT32 ret = 0;
			UINT16 control = 0;

			control = (*(UINT16 *)pv_set_info);
			if (control == 0) {
				ret = NIM_Close();
			} else {
				ret = NIM_Open();
			}
			if (ret != 0) {
				LOG(2, "Tuner swtich %s ret=%d\n", (control)?"OFF":"ON", ret);
  				return ret;
			}
			break;
		}
		case DRV_CUSTOM_CUST_SPEC_TYPE_DVBS_LNB_VOL_CTRL:
		{
	#if  defined(SYS_DVBS_SUPPORT) && defined(CC_Factory2K12)
			if(pv_set_info)TunerDVBSFac_SetLnbVol(1,(*(UINT8 *)pv_set_info)); 
	#endif
		}
		break;
		
		case DRV_CUSTOM_CUST_SPEC_TYPE_DVBS_LNB_VOL_CTRL_SUB:
		{
    #if  defined(SYS_DVBS_SUPPORT) && defined(CC_Factory2K12)
			if(pv_set_info)TunerDVBSFac_SetLnbVol(2,(*(UINT8 *)pv_set_info)); 
    #endif
		}
		break;
		
		case DRV_CUSTOM_CUST_SPEC_TYPE_DVBS_LNB_TONE_CTRL:
		{
	#if  defined(SYS_DVBS_SUPPORT) && defined(CC_Factory2K12)
			if(pv_set_info)TunerDVBSFac_Set22K(1,(*(UINT8 *)pv_set_info));  
	#endif
		}
		break;
		
		case DRV_CUSTOM_CUST_SPEC_TYPE_DVBS_LNB_TONE_CTRL_SUB:
		{
    #if  defined(SYS_DVBS_SUPPORT) && defined(CC_Factory2K12)
			if(pv_set_info)TunerDVBSFac_Set22K(2,(*(UINT8 *)pv_set_info));	
    #endif
		}
		break;
		
		case DRV_CUSTOM_CUST_SPEC_TYPE_DVBS_DEMOD_CLK_CTRL:
		{
	#if  defined(SYS_DVBS_SUPPORT) && defined(CC_Factory2K12)
			if(pv_set_info)TunerDVBSFac_SetDemodClock(1,(*(UINT8 *)pv_set_info)); 
	#endif
		}
		break;

		case DRV_CUSTOM_CUST_SPEC_TYPE_DVBS_DEMOD_CLK_CTRL_SUB:
		{
    #if  defined(SYS_DVBS_SUPPORT) && defined(CC_Factory2K12)
			if(pv_set_info)TunerDVBSFac_SetDemodClock(2,(*(UINT8 *)pv_set_info)); 
    #endif
		}
		break;

		case DRV_CUSTOM_CUST_SPEC_TYPE_CINE_MOTION_MODE:
        {
            #ifdef CC_MAPLE_CUST_DRV
            if ((pv_set_info == NULL) || (z_size != sizeof(E_CUST_FILM_MODE)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			/* size = sizeof(UINT8), pv_set_info = (UINT8*) */
			
            rApPicSetting.eFilmMode = (E_CUST_FILM_MODE)(*(E_CUST_FILM_MODE *)pv_set_info);
            PE_SetArg(SV_VP_MAIN, PE_ARG_DI_FILM_MODE,(INT16)(*(E_CUST_FILM_MODE *)pv_set_info));
            //PE_SetArg(SV_VP_MAIN, PE_ARG_MJC_EFFECT,(INT16)(*(E_CUST_FILM_MODE *)pv_set_info));
            #endif
        }
        break;

		case DRV_CUSTOM_CUST_SPEC_TYPE_MOTIONFLOW_MODE:
        {
            #ifdef CC_MAPLE_CUST_DRV
            if ((pv_set_info == NULL) || (z_size != sizeof(E_CUST_MOTION_FLOW)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			/* size = sizeof(UINT8), pv_set_info = (UINT8*) */
			if(rApPicSetting.eMotionFlow != (E_CUST_MOTION_FLOW)(*(E_CUST_MOTION_FLOW *)pv_set_info))
			{
	            rApPicSetting.eMotionFlow = (E_CUST_MOTION_FLOW)(*(E_CUST_MOTION_FLOW *)pv_set_info);
				DRVCUST_SendEvent(E_CUST_PIC_SETTING_CHANGE, 0);
			}
            vDrvSetMotionFlow((UINT8)rApPicSetting.eMotionFlow);
			
            #endif
        }
        break;
        case DRV_CUSTOM_CUST_SPEC_TYPE_4KSCALING_ONOFF:
        {
#ifdef CC_S_PLATFORM
            if ((pv_set_info == NULL) || (z_size != sizeof(UINT8)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
            vDrvSet4KScalingOnOff((UINT8)(*(UINT8 *)pv_set_info));
#endif
        }
        break;
		#ifdef CC_MAPLE_CUST_DRV
		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_VP9_HDR_TYPE:
		{
            if ((pv_set_info == NULL) || (z_size != sizeof(D_VP9_HDR_TYPE)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			
			DRCUST_SetVP9HDRType(*((D_VP9_HDR_TYPE *)pv_set_info));
			DRVCUST_SendEvent(E_CUST_SIGNAL_FMT_CHANGE, 0);
		}
		break;
		
		case DRV_CUSTOM_CUST_SPEC_SET_PQ_MODULE_ONOFF:
		{			
            if ((pv_set_info == NULL) || (z_size != sizeof(D_OSTG_PQ_ENABLE_T)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			DRVCUST_SetOSTGModuleOnOff((UINT8)(((D_OSTG_PQ_ENABLE_T *)pv_set_info)->eModule), (UINT8)(((D_OSTG_PQ_ENABLE_T *)pv_set_info)->bOnOff));
		}
		break;
		#endif
		
		case DRV_CUSTOM_CUST_SPEC_SET_BEPQ_PIC_INFO_FROM_AP:
		{
			#ifdef CC_MAPLE_CUST_DRV
            CUST_PIC_SETTING_T rPicInfoFromAP;

			
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_AP_PIC_SETTING_T)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			rPicInfoFromAP.ePicMode = (E_CUST_PIC_MODE)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->ePicMode);
			rPicInfoFromAP.u1Backlight = (UINT8)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->u1Backlight);
			rPicInfoFromAP.u1Contrast= (UINT8)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->u1Contrast);
			rPicInfoFromAP.u1Brightness = (UINT8)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->u1Brightness);
			rPicInfoFromAP.u1Color = (UINT8)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->u1Color);
			rPicInfoFromAP.u1Hue = (UINT8)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->u1Hue);
			rPicInfoFromAP.u1Sharpness = (UINT8)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->u1Sharpness);
			rPicInfoFromAP.eColTmp = (E_CUST_COL_TMP)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->eColTmp);
			rPicInfoFromAP.eNoiseReduction = (E_CUST_NOISE_REDUCTION)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->eNoiseReduction);
			rPicInfoFromAP.eMpegNoiseReduction = (E_CUST_MPEG_NOISE_REDUCTION)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->eMpegNoiseReduction);
			rPicInfoFromAP.eRealityCreation = (E_CUST_REALITY_CREATION)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->eRealityCreation);
			rPicInfoFromAP.eMasteredIn4K = (E_CUST_MASTERED_IN_4K)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->eMasteredIn4K);
			rPicInfoFromAP.i2Resolution = (INT16)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->i2Resolution);
			rPicInfoFromAP.i2NoiseFiltering = (INT16)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->i2NoiseFiltering);
			rPicInfoFromAP.eMotionFlow = (E_CUST_MOTION_FLOW)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->eMotionFlow);
			rPicInfoFromAP.i2MotionFlowSmoothness = (INT16)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->i2MotionFlowSmoothness);
			rPicInfoFromAP.i2MotionFlowClearness = (INT16)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->i2MotionFlowClearness);
			rPicInfoFromAP.eFilmMode = (E_CUST_FILM_MODE)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->eFilmMode);
			rPicInfoFromAP.eAdvContrastEnhancer = (E_CUST_ADV_CONTRAST_ENHANCER)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->eAdvContrastEnhancer);
			rPicInfoFromAP.eBlackCorrector = (E_CUST_BLACK_CORRECTOR)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->eBlackCorrector);
			rPicInfoFromAP.i2Gamma = (INT16)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->i2Gamma);
			rPicInfoFromAP.eLedDynamicCtrl = (E_CUST_LED_DYNAMIC_CTRL)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->eLedDynamicCtrl);
			rPicInfoFromAP.eLiveColor = (E_CUST_LIVE_COLOR)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->eLiveColor);
			rPicInfoFromAP.i2RGain = (INT16)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->i2RGain);
			rPicInfoFromAP.i2GGain = (INT16)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->i2GGain);
			rPicInfoFromAP.i2BGain = (INT16)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->i2BGain);
			rPicInfoFromAP.i2RBias = (INT16)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->i2RBias);
			rPicInfoFromAP.i2GBias = (INT16)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->i2GBias);
			rPicInfoFromAP.i2BBias = (INT16)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->i2BBias);
			rPicInfoFromAP.eSpeedPreference = (E_CUST_SPEED_PREFERENCE)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->eSpeedPreference);
			rPicInfoFromAP.eLedMotionMode = (E_CUST_LED_MOTION_MODE)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->eLedMotionMode);
			rPicInfoFromAP.eXdr = (E_CUST_XDR)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->eXdr);
			rPicInfoFromAP.eDrange = (E_CUST_DRANGE_UI)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->eDrange);
			rPicInfoFromAP.eColorSpace = (E_CUST_COL_SPACE_UI)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->eColorSpace);
			rPicInfoFromAP.eSmoothGradation= (E_CUST_SMOOTH_GRADATION_UI)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->eSmoothGradation);			
			rPicInfoFromAP.eTransFunc= (E_CUST_TRANSFER_FUNC_UI)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->eTransferFunc);
			//rPicInfoFromAP.eWbOfst20pEn= (E_CUST_TRANSFER_FUNC_UI)(((DRV_AP_PIC_SETTING_T *)pv_set_info)->eWbOfst20pEn);

            BEPQ_AP_Set_Pic_Setting(rPicInfoFromAP);
			DRVCUST_SendEvent(E_CUST_PIC_SETTING_CHANGE, 0);		
			
			#endif
#ifdef CC_AUD_SAKURA_RENDER
                        if(rPicInfoFromAP.ePicMode == E_CUST_PIC_MODE_GAME || rPicInfoFromAP.ePicMode == E_CUST_PIC_MODE_GRAPHICS)
                        {
                            if(gAqKey.u1PictureMode != AQ_PICTURE_MODE_GAME_GRAPHICS)
                            {
                                gAqKey.u1PictureMode = AQ_PICTURE_MODE_GAME_GRAPHICS;
                                _AUD_UpdateDspConfig(false);
                            }
							fgPicModeGame_5893 = TRUE;
                        }
                        else
                        {
                            if(gAqKey.u1PictureMode != AQ_PICTURE_MODE_OTHER)
                            {
                                gAqKey.u1PictureMode = AQ_PICTURE_MODE_OTHER;
                                _AUD_UpdateDspConfig(false);
                            }
							fgPicModeGame_5893 = FALSE;
                        }
#endif // CC_AUD_SAKURA_RENDER
			return RMR_OK;
		}
		case DRV_CUSTOM_CUST_SPEC_SET_BEPQ_SCREEN_INFO_FROM_AP:
		{
			#ifdef CC_MAPLE_CUST_DRV
            CUST_SCREEN_SETTING_T rScreenInfoFromAP;
			
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_AP_SCREEN_SETTING_T)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			rScreenInfoFromAP.eWideMode = (E_CUST_WIDE_MODE)(((DRV_AP_SCREEN_SETTING_T *)pv_set_info)->eWideMode);
			rScreenInfoFromAP.eDisplayArea = (E_CUST_DISPLAY_AREA)(((DRV_AP_SCREEN_SETTING_T *)pv_set_info)->eDisplayArea);
			rScreenInfoFromAP.i2HCenter = (INT16)(((DRV_AP_SCREEN_SETTING_T *)pv_set_info)->i2HCenter);
			rScreenInfoFromAP.i2VCenter = (INT16)(((DRV_AP_SCREEN_SETTING_T *)pv_set_info)->i2VCenter);
			rScreenInfoFromAP.i2VerticalSize = (INT16)(((DRV_AP_SCREEN_SETTING_T *)pv_set_info)->i2VerticalSize);
			rScreenInfoFromAP.eZoom = (E_CUST_ZOOM)(((DRV_AP_SCREEN_SETTING_T *)pv_set_info)->eZoom);
			rScreenInfoFromAP.ePcWIdeMode = (E_CUST_PC_WIDE_MODE)(((DRV_AP_SCREEN_SETTING_T *)pv_set_info)->ePcWIdeMode);
			rScreenInfoFromAP.i2PcPhase = (INT16)(((DRV_AP_SCREEN_SETTING_T *)pv_set_info)->i2PcPhase);
			rScreenInfoFromAP.i2PcPitch = (INT16)(((DRV_AP_SCREEN_SETTING_T *)pv_set_info)->i2PcPitch);
			rScreenInfoFromAP.i2PcHCenter = (INT16)(((DRV_AP_SCREEN_SETTING_T *)pv_set_info)->i2PcHCenter);
			rScreenInfoFromAP.i2PcVCenter = (INT16)(((DRV_AP_SCREEN_SETTING_T *)pv_set_info)->i2PcVCenter);
			BEPQ_AP_Set_WideMode_Setting(rScreenInfoFromAP);
			DRVCUST_SendEvent(E_CUST_SCR_SETTING_CHANGE, 0);
			
			#endif
			return RMR_OK;
		}
		case DRV_CUSTOM_CUST_SPEC_SET_BEPQ_3D_INFO_FROM_AP:
		{
			#ifdef CC_MAPLE_CUST_DRV
            //CUST_3D_SETTING_T r3DInfoFromAP;
			
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_AP_3D_SETTING_T)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			//r3DInfoFromAP.e3dDisplay = (E_CUST_3D_DISPLAY)(((DRV_AP_3D_SETTING_T *)pv_set_info)->e3dDisplay);
			//r3DInfoFromAP.i23dDepthAdjustment = (UINT8)(((DRV_AP_3D_SETTING_T *)pv_set_info)->i23dDepthAdjustment);
			//r3DInfoFromAP.e3dGlassBrightness = (E_CUST_3D_GLASS_BRIGHTNESS)(((DRV_AP_3D_SETTING_T *)pv_set_info)->e3dGlassBrightness);
			//BEPQ_AP_Set_3D_Setting(r3DInfoFromAP);
			//DRVCUST_SendEvent(E_CUST_3D_SETTING_CHANGE, 0);
			
			#endif
			return RMR_OK;
		}
		case DRV_CUSTOM_CUST_SPEC_SET_BEPQ_ECO_INFO_FROM_AP:
		{
			#ifdef CC_MAPLE_CUST_DRV
            CUST_ECO_SETTING_T rEcoInfoFromAP;
			
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_AP_ECO_SETTING_T)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			rEcoInfoFromAP.ePowerSaving = (E_CUST_POWER_SAVING)(((DRV_AP_ECO_SETTING_T *)pv_set_info)->ePowerSaving);
			rEcoInfoFromAP.eLightSensor = (E_CUST_LIGHT_SENSOR)(((DRV_AP_ECO_SETTING_T *)pv_set_info)->eLightSensor);
			BEPQ_AP_Set_Eco_Setting(rEcoInfoFromAP);
			DRVCUST_SendEvent(E_CUST_ECO_SETTING_CHANGE, 0);

			#endif
			return RMR_OK;
		}
		case DRV_CUSTOM_CUST_SPEC_SET_BEPQ_SERVICE_INFO_FROM_AP:
		{
			#ifdef CC_MAPLE_CUST_DRV
            CUST_SERVICE_SETTING_T rSerivceInfoFromAP;
			
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_AP_SERVICE_SETTING_T)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			gServiceInit = 1;
			rSerivceInfoFromAP.u2RGain = (UINT16)(((DRV_AP_SERVICE_SETTING_T *)pv_set_info)->u2RGain);
			rSerivceInfoFromAP.u2ROffset = (UINT16)(((DRV_AP_SERVICE_SETTING_T *)pv_set_info)->u2ROffset);
			rSerivceInfoFromAP.u2GGain = (UINT16)(((DRV_AP_SERVICE_SETTING_T *)pv_set_info)->u2GGain);
			rSerivceInfoFromAP.u2GOffset = (UINT16)(((DRV_AP_SERVICE_SETTING_T *)pv_set_info)->u2GOffset);
			rSerivceInfoFromAP.u2BGain = (UINT16)(((DRV_AP_SERVICE_SETTING_T *)pv_set_info)->u2BGain);
			rSerivceInfoFromAP.u2BOffset = (UINT16)(((DRV_AP_SERVICE_SETTING_T *)pv_set_info)->u2BOffset);
			BEPQ_AP_Set_CustService_Setting(rSerivceInfoFromAP);
			DRVCUST_SendEvent(E_CUST_SERVICE_SETTING_CHANGE, 0);

			LOG(2, "rSerivceInfoFromAP.u2RGain = %d \n", rSerivceInfoFromAP.u2RGain);
			LOG(2, "rSerivceInfoFromAP.u2GGain = %d \n", rSerivceInfoFromAP.u2GGain);
			LOG(2, "rSerivceInfoFromAP.u2BGain = %d \n", rSerivceInfoFromAP.u2BGain);
			LOG(2, "rSerivceInfoFromAP.u2ROffset = %d \n", rSerivceInfoFromAP.u2ROffset);
			LOG(2, "rSerivceInfoFromAP.u2GOffset = %d \n", rSerivceInfoFromAP.u2GOffset);
			LOG(2, "rSerivceInfoFromAP.u2BOffset = %d \n", rSerivceInfoFromAP.u2BOffset);
			
			
			#endif
			return RMR_OK;
		}
		case DRV_CUSTOM_CUST_SPEC_SET_BESYS_HISTORY_INFO_FROM_AP:
		{
			#ifdef CC_MAPLE_CUST_DRV
            CUST_HISTORY_DATA_T rHistoryInfoFromAP;
			
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_AP_HISTORY_DATA_T)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			rHistoryInfoFromAP.u4TotalOpTime = (UINT32)(((DRV_AP_HISTORY_DATA_T *)pv_set_info)->u4TotalOpTime);
			rHistoryInfoFromAP.u4PanelOpTime = (UINT32)(((DRV_AP_HISTORY_DATA_T *)pv_set_info)->u4PanelOpTime);
			BESYS_AP_Set_History_Data(rHistoryInfoFromAP);

			#endif
			return RMR_OK;
		}
		case DRV_CUSTOM_CUST_SPEC_SET_BESYS_POWER_STATE_INFO_FROM_AP:
		{
			#ifdef CC_MAPLE_CUST_DRV
            CUST_POWER_STATE_T rPowerStateInfoFromAP;
			
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_AP_POWER_STATE_T)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			rPowerStateInfoFromAP.ePanelState = (E_CUST_PANEL_STATE)(((DRV_AP_POWER_STATE_T *)pv_set_info)->ePanelState);
			BESYS_AP_Set_Power_State(rPowerStateInfoFromAP);
			DRVCUST_SendEvent(E_CUST_POWER_STATE_CHANGE, 0);

			#endif
			return RMR_OK;
		}
		case DRV_CUSTOM_CUST_SPEC_SET_BEPQ_INP_SRC_INFO_FROM_AP:
		{
			#ifdef CC_MAPLE_CUST_DRV
            DRV_AP_INPUT_TYPE_T rInpSrcInfoFromAP;
			BOOL bFlagMainTriger=FALSE,bFlagSubTriger=FALSE,bFlagUITriger=FALSE;
			
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_AP_INPUT_TYPE_T)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }

            LOG(2, "Source type %d %d \n", 
                (((DRV_AP_INPUT_TYPE_T *)pv_set_info)->eMainInputType), 
                (((DRV_AP_INPUT_TYPE_T *)pv_set_info)->eSubInputType));
            
			rInpSrcInfoFromAP.eMainInputType = BEPQ_AP_Get_Input_Type(SV_VP_MAIN);
			rInpSrcInfoFromAP.eSubInputType = BEPQ_AP_Get_Input_Type(SV_VP_PIP);
			if(rInpSrcInfoFromAP.eMainInputType != (D_AP_INPUT_TYPE)(((DRV_AP_INPUT_TYPE_T *)pv_set_info)->eMainInputType))
			{
				if((rInpSrcInfoFromAP.eMainInputType > D_AP_INPUT_TYPE_HDMI) || ((D_AP_INPUT_TYPE)(((DRV_AP_INPUT_TYPE_T *)pv_set_info)->eMainInputType)> D_AP_INPUT_TYPE_HDMI))
					{
						bFlagUITriger=TRUE;
					}
                bFlagMainTriger=TRUE;
                rInpSrcInfoFromAP.eMainInputType = (D_AP_INPUT_TYPE)(((DRV_AP_INPUT_TYPE_T *)pv_set_info)->eMainInputType);
			}
			if(rInpSrcInfoFromAP.eSubInputType  != (D_AP_INPUT_TYPE)(((DRV_AP_INPUT_TYPE_T *)pv_set_info)->eSubInputType))
			{
                bFlagSubTriger=TRUE;
                rInpSrcInfoFromAP.eSubInputType  = (D_AP_INPUT_TYPE)(((DRV_AP_INPUT_TYPE_T *)pv_set_info)->eSubInputType);
			}
			if(bFlagMainTriger || bFlagSubTriger)
			{
			    BEPQ_AP_Set_Input_Type(rInpSrcInfoFromAP);
			}

            if(bFlagMainTriger)
            {          
                DRVCUST_SendEvent(E_CUST_SOURCE_CHANGE, SV_VP_MAIN);
            }
            if(bFlagSubTriger)
            {           
                DRVCUST_SendEvent(E_CUST_SOURCE_CHANGE, SV_VP_PIP);
            }
			if(bFlagUITriger)
            {          
                DRVCUST_SendEvent(E_CUST_UI_INPUT_TARGET_CHANGE, 0);
            }
			
			#endif
			return RMR_OK;
		}		
		case DRV_CUSTOM_CUST_SPEC_FORMAT_PARTITION:
		{
//temp solution, MsdcEraseCard is not defined in kernel
#if 0
			#ifdef CC_MAPLE_CUST_DRV
			UINT32 u4PartitionIdx=0;
			UINT32 u4Offset,u4EreaseSize;
			UINT64 u8ByteOffset;
			INT32 i4Ret;
			
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_PARTITION_ID_T)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
            u4PartitionIdx = (((DRV_PARTITION_ID_T *)pv_set_info)->PartID);
            u4EreaseSize = (UINT32)(((DRV_PARTITION_ID_T *)pv_set_info)->EreaseLen);
			
            u4Offset = DRVCUST_OptGet((QUERY_TYPE_T)(eNANDFlashPartOffset0+u4PartitionIdx));
			u8ByteOffset = (UINT64)u4Offset;
			Printf("DRV_CUSTOM_CUST_SPEC_FORMAT_PARTITION ID(%d) = 0x%08x , Size = 0x%04x",
				   u4PartitionIdx,u8ByteOffset,u4EreaseSize);
            i4Ret = MsdcEraseCard(u8ByteOffset,u4EreaseSize,0);
			if(!i4Ret)
			{
			  (((DRV_PARTITION_ID_T *)pv_set_info)->fgEreaseDone) = FALSE;
			}
			else
			{
			  (((DRV_PARTITION_ID_T *)pv_set_info)->fgEreaseDone) = TRUE;
			}	
#endif
			#endif
			return RMR_OK;
		}		

        case DRV_CUSTOM_CUST_SPEC_TYPE_SCREEN_SAVER:
        {
			#ifdef CC_MAPLE_CUST_DRV
			CUST_SCREEN_SAVER_T rScreenSaverInfoFromAP;

            if ((pv_set_info == NULL) || (z_size != sizeof(UINT8)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }

            rScreenSaverInfoFromAP.eScreenSaverMode = (E_CUST_SCREEN_SAVER_MODE)(*(UINT8 *)pv_set_info);

            Printf("DRV_CUSTOM_CUST_SPEC_TYPE_SCREEN_SAVER bScreenSaver=%d \n", rScreenSaverInfoFromAP.eScreenSaverMode);

            /* Fixme: PQ team to pass this information to KO */
			
			BESYS_AP_Set_Screen_Saver(rScreenSaverInfoFromAP);
			DRVCUST_SendEvent(E_CUST_SCREEN_SAVER_CHANGE, 0);
			
			#endif
			
			return RMR_OK;
        }
        break;
		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_REALITY_CREATION_SETTING:
		{
			#ifdef CC_MAPLE_CUST_DRV

			
            if ((pv_set_info == NULL) || (z_size != sizeof(D_AP_PIC_REALITY_CREATION)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }

			if(rApPicSetting.eRealityCreation != (E_CUST_REALITY_CREATION)(*(D_AP_PIC_REALITY_CREATION *)pv_set_info))
			{
				rApPicSetting.eRealityCreation = (E_CUST_REALITY_CREATION)(*(D_AP_PIC_REALITY_CREATION *)pv_set_info);
				DRVCUST_SendEvent(E_CUST_PIC_SETTING_CHANGE, 0);
			}
           
			#endif
            return RMR_OK;
		}
		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_RESOLUTION_SETTING:
		{
            #ifdef CC_MAPLE_CUST_DRV

			
            if ((pv_set_info == NULL) || (z_size != sizeof(UINT8)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }

			if(rApPicSetting.i2Resolution != (INT16)(*(UINT8 *)pv_set_info))
			{
				rApPicSetting.i2Resolution = (INT16)(*(UINT8 *)pv_set_info);
				DRVCUST_SendEvent(E_CUST_PIC_SETTING_CHANGE, 0);
			}
            		
			#endif			
            return RMR_OK;		
		}
		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_3D_DISPLAY_SETTING:
		{
			#ifdef CC_MAPLE_CUST_DRV

			
            if ((pv_set_info == NULL) || (z_size != sizeof(D_AP_3D_DISPLAY)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }

			//rAp3DSetting.e3dDisplay = (E_CUST_3D_DISPLAY)(*(D_AP_3D_DISPLAY *)pv_set_info);
			switch((*(D_AP_3D_DISPLAY *)pv_set_info))
		    {
		        case D_AP_3D_DISP_OFF:
		            rAp3DSetting.e3dDisplay = E_CUST_3D_DISP_OFF;
		            break;
				case D_AP_3D_DISP_ON:
		            rAp3DSetting.e3dDisplay = E_CUST_3D_DISP_ON;
					break;
				case D_AP_3D_DISP_SBS:
		            rAp3DSetting.e3dDisplay = E_CUST_3D_DISP_SBS;
		            break;
				case D_AP_3D_DISP_TAB:
					rAp3DSetting.e3dDisplay = E_CUST_3D_DISP_TAB;
		            break;
				default:
		            rAp3DSetting.e3dDisplay = E_CUST_3D_DISP_OFF;
		            break;
		    }			
			DRVCUST_SendEvent(E_CUST_3D_SETTING_CHANGE, 0);
			
           
			#endif
            return RMR_OK;
		}
		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_3D_DEPTH_ADJUSTMENT_SETTING:
		{
			#ifdef CC_MAPLE_CUST_DRV

			
            if ((pv_set_info == NULL) || (z_size != sizeof(INT8)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }

			rAp3DSetting.i23dDepthAdjustment= (INT16)(*(INT8 *)pv_set_info);
			
			DRVCUST_SendEvent(E_CUST_3D_SETTING_CHANGE, 0);
			
           
			#endif
            return RMR_OK;
		}
		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_3D_GLASS_BRIGHTNESS_SETTING:
		{
			#ifdef CC_MAPLE_CUST_DRV

			
            if ((pv_set_info == NULL) || (z_size != sizeof(D_AP_3D_GLASS_BRIGHTNESS)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }

			rAp3DSetting.e3dGlassBrightness= (E_CUST_3D_GLASS_BRIGHTNESS)(*(D_AP_3D_GLASS_BRIGHTNESS *)pv_set_info);
			DRVCUST_SendEvent(E_CUST_3D_SETTING_CHANGE, 0);
			
           
			#endif
            return RMR_OK;
		}
		
		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_DEMO_MODE:
		{
			#ifdef CC_MAPLE_CUST_DRV
			CUST_DEMO_MODE_T rDemoModeInfoFromAP;
			
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_DEMO_MODE_SETTING_T)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }

			rDemoModeInfoFromAP.eDemoMode = (E_CUST_DEMO_MODE)(((DRV_DEMO_MODE_SETTING_T *)pv_set_info)->eDemoMode);
			rDemoModeInfoFromAP.eDemoPattern = (E_CUST_DEMO_PATTERN)(((DRV_DEMO_MODE_SETTING_T *)pv_set_info)->eDemoPattern);
			rDemoModeInfoFromAP.u4DemoOption = (UINT32)(((DRV_DEMO_MODE_SETTING_T *)pv_set_info)->u4DemoOption);

			BESYS_AP_Set_Demo_Mode(rDemoModeInfoFromAP);
			DRVCUST_SetDemoMode(rDemoModeInfoFromAP.eDemoMode, rDemoModeInfoFromAP.eDemoPattern, rDemoModeInfoFromAP.u4DemoOption);
			DRVCUST_SendEvent(E_CUST_DEMO_SETTING_CHANGE, 0);
			
			
			#endif
            return RMR_OK;				
		}
		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_DEMO_MASK_AREA:
		{

			#ifdef CC_MAPLE_CUST_DRV
			//CUST_DEMO_OSD_MASK_T rDemoOSDMaskInfoFromAP;
			
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_DEMO_MASK_AREA_SETTING_T)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }

			BESYS_AP_Set_Demo_OSD_Mask(pv_set_info);
			DRVCUST_SendEvent(E_CUST_DEMO_OSD_MASK_CHANGE, 0);
			
			#endif
            return RMR_OK;				
		}
		
		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_SERVICE_TRANS:
		{
			#ifdef CC_MAPLE_CUST_DRV
			CUST_SERVICE_TRANS_T rServiceTransInfoFromAP;
			
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_AP_SERVICE_TRANS_T)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }

			rServiceTransInfoFromAP.eWBTransferMode = (E_CUST_SERVICE_TRANS)(((DRV_AP_SERVICE_TRANS_T *)pv_set_info)->eWBTransferMode);
			rServiceTransInfoFromAP.eMuraTransferMode = (E_CUST_SERVICE_TRANS)(((DRV_AP_SERVICE_TRANS_T *)pv_set_info)->eMuraTransferMode);
			rServiceTransInfoFromAP.eCUCTransferMode = (E_CUST_SERVICE_TRANS)(((DRV_AP_SERVICE_TRANS_T *)pv_set_info)->eCUCTransferMode);

			BESYS_AP_Set_Service_Trans(rServiceTransInfoFromAP);

			switch(rServiceTransInfoFromAP.eWBTransferMode)	
			{
				UINT16 u2TrackingIndex, u2PBMIndex;
				
				case E_CUST_SERVICE_TRANS_SOC_TO_TCON:					
					u4_WB_EDID_Write_return = 0;
					u2TrackingIndex = 1;
					u2PBMIndex = 0;
					if (0 != Sony_PBM_EDID_Write(u2PBMIndex)) 
					{
						u4_WB_EDID_Write_return = 1;
					}
					
					if (0 != Sony_PQ_GAMMA_EDID_Write(u2TrackingIndex))						
					{
						u4_WB_EDID_Write_return = 1;
					}
					Factory2K12Debug(c_sprintf(fact_dbg_buf,"dint(%d)\n", u4_WB_EDID_Write_return));
					break;
				case E_CUST_SERVICE_TRANS_TCON_TO_SOC:					
					u4_WB_EDID_Write_return = 0;
					u2TrackingIndex = 3;
					u2PBMIndex = 2;
					if (0 != Sony_PBM_EDID_Write(u2PBMIndex)) 
					{
						u4_WB_EDID_Write_return = 1;
					}
					
					if (0 != Sony_PQ_GAMMA_EDID_Write(u2TrackingIndex)) 						
					{
						u4_WB_EDID_Write_return = 1;
					}
					Factory2K12Debug(c_sprintf(fact_dbg_buf,"dint(%d)\n", u4_WB_EDID_Write_return));
					break;
				default:
					break;
			}
			
			DRVCUST_SendEvent(E_CUST_SERVICE_TRANS_START, 0);
			#endif
            return RMR_OK;				
		}

		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_SERVICE_VCOM:
		{
			#ifdef CC_MAPLE_CUST_DRV
			CUST_SERVICE_VCOM_T rServiceVComInfoFromAP;
			
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_AP_SERVICE_VCOM_T)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }

			rServiceVComInfoFromAP.bMode = (UINT8)(((DRV_AP_SERVICE_VCOM_T *)pv_set_info)->bMode);
			rServiceVComInfoFromAP.u2Data = (UINT16)(((DRV_AP_SERVICE_VCOM_T *)pv_set_info)->u2Data);

			BESYS_AP_Set_Service_VCom(rServiceVComInfoFromAP);
			DRVCUST_SendEvent(E_CUST_SERVICE_VCOM_CHANGE, 0);
			
			
			#endif
            return RMR_OK;				
		}
		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_ECS_CMD_TO_KO:
		{
			#ifdef CC_MAPLE_CUST_DRV
			UINT8* u1EcsCmd;
			UINT32 u4RspCmdSize;
			
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_ECS_CMD_TO_KO_T)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }

			u1EcsCmd = (((DRV_ECS_CMD_TO_KO_T *)pv_set_info)->u1ECSCmd);
			u4RspCmdSize = (((DRV_ECS_CMD_TO_KO_T *)pv_set_info)->u1ECSCmdSize);
			
			DRVCUST_SendEcsCommand(u1EcsCmd,u4RspCmdSize);			

			#endif
			return RMR_OK;			
		}
		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_CMD_TO_BEIC:
		{
			#ifdef CC_MAPLE_CUST_DRV

			UINT8 u1Size;
			UINT8* u1Data;
			
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_CMD_TO_BE_IC_T)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			
			u1Size = (UINT8)(((DRV_CMD_TO_BE_IC_T *)pv_set_info)->u4Len);
			u1Data = (((DRV_CMD_TO_BE_IC_T *)pv_set_info)->aui1Cmd);
            //please implement be related function here
            DRVCUST_SetBEGeneralData(u1Data,u1Size);
			#endif
            break;				
		}		
		
#ifdef CC_MAPLE_CUST_DRV           
		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_GEN_PARAM_TO_BEIC_KO:
		{
            UINT8 i, u1size;
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_GEN_PARAM_BE_KO_T)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
            u1size = ((DRV_GEN_PARAM_BE_KO_T *)pv_set_info)->u1Size;
            LOG(0, "u4Type =%x, u1Size=%x ---\n", ((DRV_GEN_PARAM_BE_KO_T *)pv_set_info)->u4Type,((DRV_GEN_PARAM_BE_KO_T *)pv_set_info)->u1Size);
            for(i=0;i<u1size;i++)
            {
                LOG(1, "Data[%d] = %x \n", i,((DRV_GEN_PARAM_BE_KO_T *)pv_set_info)->u1Data[i]);
            }

			DRVCUST_SetBEGenParam(((DRV_GEN_PARAM_BE_KO_T *)pv_set_info)->u4Type,((DRV_GEN_PARAM_BE_KO_T *)pv_set_info)->u1Data,((DRV_GEN_PARAM_BE_KO_T *)pv_set_info)->u1Size);
			DRVCUST_SetPQGenParam(((DRV_GEN_PARAM_BE_KO_T *)pv_set_info)->u4Type,((DRV_GEN_PARAM_BE_KO_T *)pv_set_info)->u1Data,((DRV_GEN_PARAM_BE_KO_T *)pv_set_info)->u1Size);
		}
		break;
#endif
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_PIC_MASTERIN4K_TO_KO:
        {
#ifdef CC_MAPLE_CUST_DRV             
            if ((pv_set_info == NULL) || (z_size != sizeof(D_AP_PIC_MASTERED_IN_4K)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			/* size = sizeof(D_AP_PIC_MASTERED_IN_4K), pv_set_info = (D_AP_PIC_MASTERED_IN_4K*) */
			if(rApPicSetting.eMasteredIn4K != (E_CUST_MASTERED_IN_4K)(*(D_AP_PIC_MASTERED_IN_4K *)pv_set_info))
			{
				rApPicSetting.eMasteredIn4K = (E_CUST_MASTERED_IN_4K)(*(D_AP_PIC_MASTERED_IN_4K *)pv_set_info);
				DRVCUST_SendEvent(E_CUST_PIC_SETTING_CHANGE, 0);
			}
			
#endif            
            return RMR_OK;				
        }        

		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_PIC_NOISEFLTR_TO_KO:
        {
#ifdef CC_MAPLE_CUST_DRV             
            if ((pv_set_info == NULL) || (z_size != sizeof(UINT8)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			/* size = sizeof(UINT8), pv_set_info = (UINT8*) */
			if(rApPicSetting.i2NoiseFiltering != (INT16)(*(UINT8 *)pv_set_info))
			{
				rApPicSetting.i2NoiseFiltering = (INT16)(*(UINT8 *)pv_set_info);
				DRVCUST_SendEvent(E_CUST_PIC_SETTING_CHANGE, 0);
			}
#endif            
            return RMR_OK;				
        }		

		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_PIC_LEDCTRL_TO_KO:
        {
#ifdef CC_MAPLE_CUST_DRV             
            if ((pv_set_info == NULL) || (z_size != sizeof(D_AP_PIC_LED_DYNAMIC_CTRL)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			/* size = sizeof(D_AP_PIC_LED_DYNAMIC_CTRL), pv_get_info = (D_AP_PIC_LED_DYNAMIC_CTRL*) */
			if(rApPicSetting.eLedDynamicCtrl != (E_CUST_LED_DYNAMIC_CTRL)(*(D_AP_PIC_LED_DYNAMIC_CTRL *)pv_set_info))
			{
				rApPicSetting.eLedDynamicCtrl = (E_CUST_LED_DYNAMIC_CTRL)(*(D_AP_PIC_LED_DYNAMIC_CTRL *)pv_set_info);
				DRVCUST_SendEvent(E_CUST_PIC_SETTING_CHANGE, 0);
			}
#endif            
            return RMR_OK;				
        }		

		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_PIC_XDR_TO_KO:
        {
#ifdef CC_MAPLE_CUST_DRV             
            if ((pv_set_info == NULL) || (z_size != sizeof(D_AP_XDR)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			/* size = sizeof(D_AP_XDR), pv_set_info = (D_AP_XDR*) */
			if(rApPicSetting.eXdr != (E_CUST_XDR)(*(D_AP_XDR *)pv_set_info))
			{
				rApPicSetting.eXdr = (E_CUST_XDR)(*(D_AP_XDR *)pv_set_info);
				DRVCUST_SendEvent(E_CUST_PIC_SETTING_CHANGE, 0);
			}
#endif            
            return RMR_OK;				
        }		

		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_PIC_SMOOTHNESS_TO_KO:
        {
#ifdef CC_MAPLE_CUST_DRV             
            if ((pv_set_info == NULL) || (z_size != sizeof(UINT8)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			/* size = sizeof(UINT8), pv_set_info = (UINT8*) */
			if(rApPicSetting.i2MotionFlowSmoothness != (INT16)(*(UINT8 *)pv_set_info))
			{
				rApPicSetting.i2MotionFlowSmoothness = (INT16)(*(UINT8 *)pv_set_info);
				DRVCUST_SendEvent(E_CUST_PIC_SETTING_CHANGE, 0);
			}
			
#endif            
            return RMR_OK;				
        }		

		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_PIC_CLEARNESS_TO_KO:
        {
#ifdef CC_MAPLE_CUST_DRV             
            if ((pv_set_info == NULL) || (z_size != sizeof(UINT8)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			 /* size = sizeof(UINT8), pv_get_info = (UINT8*) */
			 if(rApPicSetting.i2MotionFlowClearness != (INT16)(*(UINT8 *)pv_set_info))
			 {
				 rApPicSetting.i2MotionFlowClearness = (INT16)(*(UINT8 *)pv_set_info);
				 DRVCUST_SendEvent(E_CUST_PIC_SETTING_CHANGE, 0);
			 }
#endif            
            return RMR_OK;				
        }		

		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_PIC_DYNAMICRANGE_TO_KO:
        {
			D_AP_INPUT_TYPE	eMainInputType = BEPQ_AP_Get_Input_Type(SV_VP_MAIN);
#ifdef CC_MAPLE_CUST_DRV             
            if ((pv_set_info == NULL) || (z_size != sizeof(D_AP_DRANGE_UI)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			 /* size = sizeof(D_AP_DRANGE_UI), pv_get_info = (D_AP_DRANGE_UI*) */

				rApPicSetting.eDrange = (E_CUST_DRANGE_UI)(*(D_AP_DRANGE_UI *)pv_set_info);
				switch(rApPicSetting.eDrange)
		        {
		            default:
		            case E_CUST_DRANGE_UI_AUTO:
						if(D_AP_INPUT_TYPE_HDMI == eMainInputType)
						{
	                		vSetHDMIRangeMode((UINT8)SV_HDMI_RANGE_FORCE_AUTO);
						}
						DRVCUST_SetVideoRange((UINT8)SV_HDMI_RANGE_FORCE_AUTO);
						break;
		            case E_CUST_DRANGE_UI_LIMITED:
						if(D_AP_INPUT_TYPE_HDMI == eMainInputType)
						{
	                		vSetHDMIRangeMode((UINT8)SV_HDMI_RANGE_FORCE_LIMIT);
						}
						DRVCUST_SetVideoRange((UINT8)SV_HDMI_RANGE_FORCE_LIMIT);
						break;
					case E_CUST_DRANGE_UI_FULL:
						if(D_AP_INPUT_TYPE_HDMI == eMainInputType)
						{
	                		vSetHDMIRangeMode((UINT8)SV_HDMI_RANGE_FORCE_FULL);
						}
						DRVCUST_SetVideoRange((UINT8)SV_HDMI_RANGE_FORCE_FULL);
						break;
		        } 
	            
				vVdoSetColorTransform(SV_VP_MAIN);
				
		//	if(rApPicSetting.eDrange != (E_CUST_DRANGE_UI)(*(D_AP_DRANGE_UI *)pv_set_info))
			{
				DRVCUST_SendEvent(E_CUST_SIGNAL_FMT_CHANGE, 0);
			}
			
			
#endif            
            return RMR_OK;				
        }

		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_PIC_COLORSPACE_TO_KO:
        {
#ifdef CC_MAPLE_CUST_DRV             
            if ((pv_set_info == NULL) || (z_size != sizeof(D_AP_PHOTO_COL_SPACE_UI)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			 /* size = sizeof(D_AP_PHOTO_COL_SPACE_UI), pv_get_info = (D_AP_PHOTO_COL_SPACE_UI*) */
			if(rApPicSetting.eColorSpace != (E_CUST_COL_SPACE_UI)(*(D_AP_PHOTO_COL_SPACE_UI *)pv_set_info))
			{
				rApPicSetting.eColorSpace = (E_CUST_COL_SPACE_UI)(*(D_AP_PHOTO_COL_SPACE_UI *)pv_set_info);				
				bApiFlashPqUpdateSCE();				
				vApiRegisterVideoEvent(PE_EVENT_SCE, VDP_1, SV_ON);
				DRVCUST_SendEvent(E_CUST_PIC_SETTING_CHANGE, 0);
			}
#endif            
            return RMR_OK;	
        }

		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_PIC_R_GAIN_TO_KO:
        {
#ifdef CC_MAPLE_CUST_DRV             
            if ((pv_set_info == NULL) || (z_size != sizeof(INT8)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			 /* size = sizeof(INT8), pv_get_info = (INT8*) */
			if(rApPicSetting.i2RGain != (INT16)(*(INT8 *)pv_set_info))
			{
				rApPicSetting.i2RGain = (INT16)(*(INT8 *)pv_set_info);
				DRVCUST_SendEvent(E_CUST_PIC_SETTING_CHANGE, 0);
			}
#endif            
            return RMR_OK;	
        }
		
		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_PIC_G_GAIN_TO_KO:
        {
#ifdef CC_MAPLE_CUST_DRV             
            if ((pv_set_info == NULL) || (z_size != sizeof(INT8)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			 /* size = sizeof(INT8), pv_get_info = (INT8*) */

			if(rApPicSetting.i2GGain != (INT16)(*(INT8 *)pv_set_info))
			{
				rApPicSetting.i2GGain = (INT16)(*(INT8 *)pv_set_info);
				DRVCUST_SendEvent(E_CUST_PIC_SETTING_CHANGE, 0);
			}
#endif            
            return RMR_OK;	
        }
		
		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_PIC_B_GAIN_TO_KO:
        {
#ifdef CC_MAPLE_CUST_DRV             
            if ((pv_set_info == NULL) || (z_size != sizeof(INT8)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			 /* size = sizeof(INT8), pv_get_info = (INT8*) */

			if(rApPicSetting.i2BGain != (INT16)(*(INT8 *)pv_set_info))
			{
				rApPicSetting.i2BGain = (INT16)(*(INT8 *)pv_set_info);
				DRVCUST_SendEvent(E_CUST_PIC_SETTING_CHANGE, 0);
			}
#endif            
            return RMR_OK;	
        }
		
		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_PIC_R_BIAS_TO_KO:
        {
#ifdef CC_MAPLE_CUST_DRV             
            if ((pv_set_info == NULL) || (z_size != sizeof(INT8)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			 /* size = sizeof(INT8), pv_get_info = (INT8*) */

			if(rApPicSetting.i2RBias!= (INT16)(*(INT8 *)pv_set_info))
			{
				rApPicSetting.i2RBias = (INT16)(*(INT8 *)pv_set_info);
				DRVCUST_SendEvent(E_CUST_PIC_SETTING_CHANGE, 0);
			}
#endif            
            return RMR_OK;	
        }
		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_PIC_G_BIAS_TO_KO:
        {
#ifdef CC_MAPLE_CUST_DRV             
            if ((pv_set_info == NULL) || (z_size != sizeof(INT8)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			 /* size = sizeof(INT8), pv_get_info = (INT8*) */

			if(rApPicSetting.i2GBias!= (INT16)(*(INT8 *)pv_set_info))
			{
				rApPicSetting.i2GBias = (INT16)(*(INT8 *)pv_set_info);
				DRVCUST_SendEvent(E_CUST_PIC_SETTING_CHANGE, 0);
			}
#endif            
            return RMR_OK;	
        }
		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_PIC_B_BIAS_TO_KO:
        {
#ifdef CC_MAPLE_CUST_DRV             
            if ((pv_set_info == NULL) || (z_size != sizeof(INT8)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			 /* size = sizeof(INT8), pv_get_info = (INT8*) */

			if(rApPicSetting.i2BBias!= (INT16)(*(INT8 *)pv_set_info))
			{
				rApPicSetting.i2BBias = (INT16)(*(INT8 *)pv_set_info);
				DRVCUST_SendEvent(E_CUST_PIC_SETTING_CHANGE, 0);
			}
#endif            
            return RMR_OK;	
        }

		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_WFD_PROTOCOL_TO_KO:
        {
#ifdef CC_MAPLE_CUST_DRV             
            if ((pv_set_info == NULL) || (z_size != sizeof(UINT8)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			 /* size = sizeof(INT8), pv_get_info = (INT8*) */

			 gWFDProtocol = (*(UINT8 *)pv_set_info);
			 DRVCUST_SendEvent(E_CUST_SCR_MIRROR_CONFIG_CHANGE, 0);
#endif            
            return RMR_OK;	
        }
		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_BT_DELAY_TO_KO:
        {
#ifdef CC_MAPLE_CUST_DRV             
            if ((pv_set_info == NULL) || (z_size != sizeof(D_AP_BT_DELAY_MODE)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			 /* size = sizeof(INT8), pv_get_info = (INT8*) */

             gBTDelay = (E_CUST_DELAY_MODE)(*(D_AP_BT_DELAY_MODE *)pv_set_info);
			 DRVCUST_SendEvent(E_CUST_BT_SETTING_CHANGE, 0);
#ifdef CC_AUD_SAKURA_RENDER
            gSoundSetting.bBtDelayMode = (E_CUST_DELAY_MODE)(*(D_AP_BT_DELAY_MODE *)pv_set_info);
            _AUD_UpdateDspConfig(false);
#endif // CC_AUD_SAKURA_RENDER
#endif            
            return RMR_OK;	
        }
		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_PIC_SMOOTH_GRADATION_TO_KO:
		{
#ifdef CC_MAPLE_CUST_DRV 
			if (pv_set_info == NULL)
			{
				LOG(2, "Invalid parameter\n");
				return RMR_INV_ARG;
			}
			rApPicSetting.eSmoothGradation = (E_CUST_SMOOTH_GRADATION_UI)(*(D_AP_SMOOTH_GRADATION_UI *)pv_set_info);
			DRVCUST_SendEvent(E_CUST_PIC_SETTING_CHANGE, 0);
#endif
			return RMR_OK;				
		}


		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_PIC_TRANSFR_FUNC_TO_KO:
		{
#ifdef CC_MAPLE_CUST_DRV 
			if(pv_set_info == NULL) 
			{
				LOG(2, "Invalid parameter\n");
				return RMR_INV_ARG;
			}
			rApPicSetting.eTransFunc = (E_CUST_TRANSFER_FUNC_UI)(*(D_AP_TRANSFER_FUNC_UI *)pv_set_info);
			//DRVCUST_SetOSDHDRMatrixCoeff();
			DRVCUST_SendEvent(E_CUST_PIC_SETTING_CHANGE, 0);
#endif
			return RMR_OK;				
		}
		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_PIC_WB_OFFSET_20P:
		{
#ifdef CC_MAPLE_CUST_DRV 
			if(pv_set_info == NULL) 
			{
				LOG(2, "Invalid parameter\n");
				return RMR_INV_ARG;
			}
			bufWB_OFFSET_20P_EN.eWbOfst20pEn= (E_CUST_WB_OFFSET_20P)(*(D_AP_WB_OFFSET_20P *)pv_set_info);
			DRVCUST_SetWhiteBalanceOffset20pEnable(&bufWB_OFFSET_20P_EN);
			DRVCUST_SendEvent(E_CUST_WB_OFFSET_20P_EN_CHANGE, 0);
#endif
			return RMR_OK;				
		}

		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_PQ_DYNAMIC_CONTROL_TO_KO:
		{
#ifdef CC_MAPLE_CUST_DRV 
			if(pv_set_info == NULL) 
			{
				LOG(2, "Invalid parameter\n");
				return RMR_INV_ARG;
			}
			CUST_PIC_CONTROL_STATE = *((E_CUST_PIC_CONTROL_STATE*)pv_set_info);
			DRVCUST_SendEvent(E_CUST_PIC_CONTROL_STATE_CHANGE, 0);
			DRVCUST_SendEvent(E_CUST_PIC_CONTROL_STATE_CHANGE, 1);
#endif
			return RMR_OK;
		}

        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_WSW_LVL:
        {
#ifdef CC_MAPLE_CUST_DRV             
            INPUT_CHK(pv_set_info, z_size, sizeof(INT8));
#ifdef CC_AUD_SAKURA_RENDER
            if(gSoundSetting.i1SubwooferVolume == (*(INT8 *)pv_set_info))
            {
                break;
            }
#endif // CC_AUD_SAKURA_RENDER
            gSoundSetting.i1SubwooferVolume = (*(INT8 *)pv_set_info);            
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            gSAPostGenConfig.m_wooferLevel = (char)gSoundSetting.i1SubwooferVolume;
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_GEN_CONFIG, 0);            
#ifdef CC_AUD_SAKURA_RENDER
            _AUD_UpdateDspConfig(false);
#endif // CC_AUD_SAKURA_RENDER
#endif            
            break;				
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_WSW_FREQ:
        {
#ifdef CC_MAPLE_CUST_DRV                  
            INPUT_CHK(pv_set_info, z_size, sizeof(INT8));
#ifdef CC_AUD_SAKURA_RENDER
            if(gSoundSetting.u1SubwooferCutoff == (*(UINT8 *)pv_set_info))
            {
                break;
            }
#endif // CC_AUD_SAKURA_RENDER
            gSoundSetting.u1SubwooferCutoff = (*(UINT8 *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
#ifdef CC_AUD_SAKURA_RENDER
            gSAPostConfig.m_wooferCutoffFrequency = (unsigned char)gSoundSetting.u1SubwooferCutoff;
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_POST_CONFIG, 0);            
#endif // CC_AUD_SAKURA_RENDER
#endif            
            break;				
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_WSW_PHASE:
        {
#ifdef CC_MAPLE_CUST_DRV                  
            INPUT_CHK(pv_set_info, z_size, sizeof(E_CUST_SUBWOOFER_PHASE));
            gSoundSetting.eSubwooferPhase = (*(E_CUST_SUBWOOFER_PHASE *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
#ifdef CC_AUD_SAKURA_RENDER_AQ
            vAprocReg_Write (APROC_ASM_ADDR(APROC_ASM_ID_POSTPROC_D, APROC_REG_SW_PHASE), gSoundSetting.eSubwooferPhase);
#endif // CC_AUD_SAKURA_RENDER_AQ
#endif           
            break;				
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_WSW_OUTPUT:
        {
            if ((pv_set_info == NULL) || (z_size != sizeof(UINT8)))
            {
                LOG(2, "Invalid parameter (WSW output type)\n");
                return RMR_INV_ARG;
            }
            break;				
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_WSW_ENABLE:
        {
            if ((pv_set_info == NULL) || (z_size != sizeof(UINT8)))
            {
                LOG(2, "Invalid parameter (WSW output type)\n");
                return RMR_INV_ARG;
            }
#ifdef CC_MAPLE_CUST_DRV
            INPUT_CHK(pv_set_info, z_size, sizeof(UINT8));
#ifdef CC_AUD_SAKURA_RENDER
            if(gSoundSetting.u1SubwooferEnable == (*(UINT8 *)pv_set_info))
            {
                break;
            }
            gSoundSetting.u1SubwooferEnable = (*(UINT8 *)pv_set_info);
#else
            gSoundSetting.u1SubwooferEnable = (*(UINT8 *)pv_set_info);
#endif // CC_AUD_SAKURA_RENDER
#ifdef CC_AUD_SAKURA_RENDER_AQ
            if(gSoundSetting.eHpAudioOut == E_CUST_AUD_HP_AUD_OUT_SUBWOOFER)
            {
                if(gSoundSetting.u1SubwooferEnable)
                {
                    gAqKey.u1WirelessWoofer = AQ_WIRELESS_SUBWOOFER_MODE_ON;                    
                    gSAPostGenConfig.m_analogOut = (unsigned char)SAPOST_ANALOG_OUT_WIRELESS_SUBWOOFER;                    
                }
                else
                {
                        gAqKey.u1WirelessWoofer = AQ_WIRELESS_SUBWOOFER_MODE_OFF;                
                        gSAPostGenConfig.m_analogOut = (unsigned char)SAPOST_ANALOG_OUT_SUBWOOFER;
                }

                DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_GEN_CONFIG, 0);
                DRVCUST_SendAudEvent(E_CUST_AUD_SUBWOOFER_STATE_CHANGE, 0);
                _AUD_UpdateDspConfig(false);
            }
#endif // CC_AUD_SAKURA_RENDER_AQ
#endif            
            break;				
        }

        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_LED_ON_OFF:
        {
			BOOL  b_LED_RED_ON_OFF;
			BOOL  b_LED_GREEN_ON_OFF;
			BOOL  b_LED_BLUE_ON_OFF;
			BOOL  b_LED_WHITE_ON_OFF;
			BOOL  b_LED_AMBER_ON_OFF;
           	if ((pv_set_info == NULL) || (z_size != sizeof(DRV_LED_ON_OFF_T)))
            {
                LOG(2, "Invalid parameter (SET_LED_ON_OFF)\n");
                return RMR_INV_ARG;
            }

		    b_LED_RED_ON_OFF = (((DRV_LED_ON_OFF_T *)pv_set_info)->b_LED_RED_ON_OFF);
            b_LED_GREEN_ON_OFF = (((DRV_LED_ON_OFF_T *)pv_set_info)->b_LED_GREEN_ON_OFF);
			b_LED_BLUE_ON_OFF = (((DRV_LED_ON_OFF_T *)pv_set_info)->b_LED_BLUE_ON_OFF);
			b_LED_WHITE_ON_OFF = (((DRV_LED_ON_OFF_T *)pv_set_info)->b_LED_WHITE_ON_OFF);
			b_LED_AMBER_ON_OFF = (((DRV_LED_ON_OFF_T *)pv_set_info)->b_LED_AMBER_ON_OFF);

	        //To -Do Smith 
			
            break;	 
		}

		case DRV_CUSTOM_CUST_SPEC_TYPE_SET_AGING_MODE:
		{
			if ((pv_set_info == NULL) || (z_size != sizeof(UINT16)))
            {
                LOG(2, "Invalid parameter (SET_AGING_MODE)\n");
                return RMR_INV_ARG;
            }
			UINT16 u1Mode = (UINT16)(*((UINT32 *) pv_set_info));
            Printf("u1Mode is %d\n",u1Mode);
			CUST_AGING_MODE_T rAgingModeInfoFromAP;
			gAgingInit = 1;
			
            if(u1Mode==0)//ading mode off
            {
            	rAgingModeInfoFromAP.bAgingMode = 0;
            }
			else //aging mode on
			{
			 	rAgingModeInfoFromAP.bAgingMode = 1;
			}
			BESYS_AP_Set_Aging_Mode(rAgingModeInfoFromAP);
			DRVCUST_SendEvent(E_CUST_AGING_MODE_CHANGE, 0);
            break;	
		}

		case DRV_CUSTOM_CUST_AUDIO_VOLUME_CTRL:
		{
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_AUDIO_OUTPUT_VOLUME_CTRL_T)))
            {
                LOG(2, "Invalid parameter (audio output control)\n");
                return RMR_INV_ARG;
            }
            D_AP_AUDIO_OUTPUT_ID eOutId;
			UINT16 level;
            eOutId = (D_AP_AUDIO_OUTPUT_ID)(((DRV_AUDIO_OUTPUT_VOLUME_CTRL_T *)pv_set_info)->eOutputId);
            level  = (UINT16)(((DRV_AUDIO_OUTPUT_VOLUME_CTRL_T *)pv_set_info)->level);
            switch(eOutId)
            {
                case D_AP_AUDIO_OUTPUT_SPK:
                    _AUD_DspChannelVolume(AUD_DSP0, AUD_DEC_MAIN, AUD_CH_FRONT_LEFT, level);
                    break;
                case D_AP_AUDIO_OUTPUT_HP:
                    _AUD_DspChannelVolume(AUD_DSP0, AUD_DEC_MAIN, AUD_CH_DMX_LEFT, level);
                    break;
                    case D_AP_AUDIO_OUTPUT_SPDIF:
                case D_AP_AUDIO_OUTPUT_ARC:
                    _AUD_DspChannelVolume(AUD_DSP0, AUD_DEC_MAIN, AUD_CH_IEC_LEFT, level);
                    break;
                case D_AP_AUDIO_OUTPUT_SCART:
                    _AUD_DspChannelVolume(AUD_DSP0, AUD_DEC_MAIN, AUD_CH_AUX_FRONT_LEFT, level);
                    break;
                default:
                    break;
            }
            break;
        }
        case DRV_CUSTOM_CUST_AUDIO_OUTPUT_CTRL:
        {
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_AUDIO_OUTPUT_CTRL_T)))
            {
                LOG(2, "Invalid parameter (audio output control)\n");
                return RMR_INV_ARG;
            }
            D_AP_AUDIO_OUTPUT_ID eOutId;
            BOOL bEnable;
            UINT16 u2Gain;
            UINT32 u4Vol;
            UINT16 scart_sel;

            eOutId = (D_AP_AUDIO_OUTPUT_ID)(((DRV_AUDIO_OUTPUT_CTRL_T *)pv_set_info)->eOutputId);
            bEnable = (BOOL)(((DRV_AUDIO_OUTPUT_CTRL_T *)pv_set_info)->fgEnable);
            u2Gain = (bEnable)?0x1000:0;
            scart_sel = (bEnable)?0x1:0x0;

            switch(eOutId)
            {
            case D_AP_AUDIO_OUTPUT_SPK:
                AudAoutGainCtrl(AUD_DEC_MAIN, AUD_CH_FRONT_LEFT+1,u2Gain,AOUT_VOL_SETP_4DB);
                AudAoutGainCtrl(AUD_DEC_MAIN, AUD_CH_FRONT_RIGHT+1,u2Gain,AOUT_VOL_SETP_4DB);                    
                AudAoutGainCtrl(AUD_DEC_MAIN, AUD_CH_REAR_LEFT+1,u2Gain,AOUT_VOL_SETP_4DB);
                AudAoutGainCtrl(AUD_DEC_MAIN, AUD_CH_REAR_RIGHT+1,u2Gain,AOUT_VOL_SETP_4DB);                    
                AudAoutGainCtrl(AUD_DEC_MAIN, AUD_CH_CENTER+1,u2Gain,AOUT_VOL_SETP_4DB);                                                    
                AudAoutGainCtrl(AUD_DEC_MAIN, AUD_CH_SUB_WOOFER+1,u2Gain,AOUT_VOL_SETP_4DB);
                break;
            case D_AP_AUDIO_OUTPUT_HP:                
                AudAoutGainCtrl(AUD_DEC_MAIN, AUD_CH_DMX_LEFT+1,u2Gain,AOUT_VOL_SETP_4DB);
                AudAoutGainCtrl(AUD_DEC_MAIN, AUD_CH_DMX_RIGHT+1,u2Gain,AOUT_VOL_SETP_4DB);                    
                break;
            case D_AP_AUDIO_OUTPUT_SPDIF:
                AudAoutGainCtrl(AUD_DEC_MAIN, AUD_CH_IEC_LEFT+1, u2Gain, AOUT_VOL_SETP_4DB);
                AudAoutGainCtrl(AUD_DEC_MAIN, AUD_CH_IEC_RIGHT+1, u2Gain, AOUT_VOL_SETP_4DB);
                break;
            case D_AP_AUDIO_OUTPUT_ARC:
                break;
            case D_AP_AUDIO_OUTPUT_SCART:
                u4Vol = 0x7fffff;
                _fg_scart_factory = TRUE;
#ifdef CC_AUD_UNICORN_CUST
				vAprocReg_Write (APROC_ASM_ADDR (APROC_ASM_ID_POSTPROC_D, APROC_REG_SP_OUT_SEL), scart_sel);
#endif
                _vAUD_Aproc_Set (APROC_CONTROL_TYPE_VOL, APROC_IOCTRL_VOL_SCART , (UINT32 *)&u4Vol, 1);            
                AudAoutGainCtrl(AUD_DEC_MAIN, AUD_CH_CH1314_LEFT+1,u2Gain,AOUT_VOL_SETP_4DB);
                AudAoutGainCtrl(AUD_DEC_MAIN, AUD_CH_CH1314_RIGHT+1,u2Gain,AOUT_VOL_SETP_4DB);                    
                break;
            case D_AP_AUDIO_OUTPUT_OTHERS:
            default:  
                break;
            }
            break;
        }   
        case DRV_CUSTOM_CUST_SCART_OUT_VIDEO_CTRL:
        {
            if ((pv_set_info == NULL) || (z_size != sizeof(UINT16)))
            {
                LOG(2, "Invalid parameter (audio output control)\n");
                return RMR_INV_ARG;
            }
            UINT16 tv_type = *(UINT16 *)pv_set_info;
			UINT32 u4Vol;

            Printf("tv_type is :%d\n",tv_type);
            
            switch(tv_type)
            {
                case 0:     //dtv
                    CLI_Parser("b.scm 0");
                    CLI_Parser("tve.cs 0 dtv1");

#ifdef S_AUD_FEATURE  
					u4Vol=0x7fffff;
	                _vAUD_Aproc_Set (APROC_CONTROL_TYPE_VOL, APROC_IOCTRL_VOL_SCART , (UINT32 *) &u4Vol, 1);
#endif                    
                break;
                case 1:     //atv
                    CLI_Parser("b.scm 0");
                    CLI_Parser("tve.cs 0 atd");
                break;
                default:
                    Printf("wrong input value,please send again\n");   
                break;
            }           
            CLI_Parser("aud.a.rw 0x422 1");
            CLI_Parser("aud.a.rw 0x425 1");
            CLI_Parser("aud.a.rw 0x427 1");
            CLI_Parser("aud.a.rw 0x429 1");
            break;
        }
        case DRV_CUSTOM_CUST_TEST_AUDIO:
        {
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_TEST_AUDIO_T)))
            {
                LOG(2, "Invalid parameter (test audio)\n");
                return RMR_INV_ARG;
            }
            UINT16 i4LeftFreq;
            UINT16 i4RightFreq;
            i4LeftFreq = (UINT16)(((DRV_TEST_AUDIO_T *)pv_set_info)->leftFreq);
            i4RightFreq = (UINT16)(((DRV_TEST_AUDIO_T *)pv_set_info)->rightFreq);          
			if((0 == i4LeftFreq) && (0 == i4RightFreq))
			{
				_fg_scart_factory = FALSE;
				CLI_Parser("aud.stop 0 0");
				break;
			}

			x_thread_delay(100);
            CLI_Parser("aud.a.rw 0x420 0");
            CLI_Parser("aud.a.rw 0x421 0"); 
            CLI_Parser("aud.a.rw 0x425 0"); 
            CLI_Parser_Arg("aud.t.utone %d %d",i4LeftFreq,i4RightFreq);
            break;
        }
        case DRV_CUSTOM_CUST_TEST_AUDIO_MUTE:
        {
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_TEST_AUDIO_T)))
            {
                LOG(2, "Invalid parameter (test audio)\n");
                return RMR_INV_ARG;
            }
            UINT16 i4LeftFreq;
            UINT16 i4RightFreq;
            i4LeftFreq = (UINT16)(((DRV_TEST_AUDIO_T *)pv_set_info)->leftFreq);
            i4RightFreq = (UINT16)(((DRV_TEST_AUDIO_T *)pv_set_info)->rightFreq);          
            x_thread_delay(100);
            CLI_Parser("aud.t.aoutg 0 0 0");
            CLI_Parser("aud.a.rw 0x420 0");
            CLI_Parser("aud.a.rw 0x421 0");
            CLI_Parser("aud.a.rw 0x425 0");             
            CLI_Parser_Arg("aud.t.utone %d %d",i4LeftFreq,i4RightFreq);
            x_thread_delay(1000);   
            break;
        }
        case DRV_CUSTOM_CUST_AUDIO_DB_LEVEL:
        {
            #if defined(CC_AUD_ARM_SUPPORT)
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_AUDIO_DB_LEVEL_T)))
            {
                LOG(2, "Invalid parameter (dB level)\n");
                return RMR_INV_ARG;
            }            
            UINT8 u1SpkType;
            UINT8 u1Lvl;
            UINT32 u4type;           
            UINT32 dBVol [129] = 
            {
                0x7fffff, 0x721482, 0x65ac8b, 0x5a9df7, 0x50c335, 0x47facc, 0x4026e7, 0x392ced,
                0x32f52d, 0x2d6a86, 0x287a26, 0x241347, 0x2026f3, 0x1ca7d7, 0x198a13, 0x16c311,
                0x144961, 0x12149a, 0x101d3f, 0x0e5ca1, 0x0ccccd, 0x0b6873, 0x0a2adb, 0x090fcc,
                0x081385, 0x0732ae, 0x066a4a, 0x05b7b1, 0x051884, 0x048aa7, 0x040c37, 0x039b87,
                0x033718, 0x02dd96, 0x028dcf, 0x0246b5, 0x020756, 0x01cedc, 0x019c86, 0x016faa,
                0x0147ae, 0x01240c, 0x010449, 0x00e7fb, 0x00cec1, 0x00b845, 0x00a43b, 0x00925f,
                0x008274, 0x007444, 0x00679f, 0x005c5a, 0x00524f, 0x00495c, 0x004161, 0x003a45,
                0x0033ef, 0x002e49, 0x002941, 0x0024c4, 0x0020c5, 0x001d34, 0x001a07, 0x001733,
                0x0014ad, 0x00126d, 0x00106c, 0x000ea3, 0x000d0c, 0x000ba0, 0x000a5d, 0x00093c,
                0x00083b, 0x000756, 0x00068a, 0x0005d4, 0x000532, 0x0004a1, 0x000420, 0x0003ad,
                0x000347, 0x0002ec, 0x00029a, 0x000252, 0x000211, 0x0001d8, 0x0001a4, 0x000177,
                0x00014e, 0x00012a, 0x000109, 0x0000ec, 0x0000d3, 0x0000bc, 0x0000a7, 0x000095,
                0x000085, 0x000076, 0x00006a, 0x00005e, 0x000054, 0x00004b, 0x000043, 0x00003b,
                0x000035, 0x00002f, 0x00002a, 0x000025, 0x000021, 0x00001e, 0x00001b, 0x000018,
                0x000015, 0x000013, 0x000011, 0x00000f, 0x00000d, 0x00000c, 0x00000b, 0x000009,
                0x000008, 0x000007, 0x000007, 0x000006, 0x000005, 0x000005, 0x000004, 0x000004,
                0x000000
            };            
            u1SpkType = (UINT8)(UINT8)(((DRV_AUDIO_DB_LEVEL_T *)pv_set_info)->u1SpkType);
            u1Lvl = (UINT8)(UINT8)(((DRV_AUDIO_DB_LEVEL_T *)pv_set_info)->u1Lvl);

            if(u1Lvl > 128)
            {
                return RMR_INV_ARG;
            }
            switch(u1SpkType)
            {
                case 1:
                    u4type = APROC_IOCTRL_VOL_SP;
                    break;
                case 2:
                    u4type = APROC_IOCTRL_VOL_SPSW;
                    break; 
                case 3:
                    u4type = APROC_IOCTRL_VOL_SP_LSRS;                
                    break;    
                default:
                    return RMR_INV_ARG;

            }                  
            _vAUD_Aproc_Set (APROC_CONTROL_TYPE_VOL, u4type , (UINT32 *) &dBVol[u1Lvl], 1);            
            CLI_Parser("aud.t.aoutg 0 0 0x1000");                        
            #endif
            break;
        }           
        case DRV_CUSTOM_CUST_AUDIO_SOFT_MUTE:
        {
            #if defined(CC_AUD_ARM_SUPPORT)
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_AUDIO_SOFT_MUTE_T)))
            {
                LOG(2, "Invalid parameter (soft mute)\n");
                return RMR_INV_ARG;
            }
            UINT8 u1SpkType;
            UINT8 u1LchMute;
            UINT8 u1RchMute;
            UINT32 u4Idx;
            UINT32 u4v0=0x7fffff, u4v1 = 0x7fffff;
            u1SpkType = (UINT8)(UINT8)(((DRV_AUDIO_SOFT_MUTE_T *)pv_set_info)->u1SpkType);
            u1LchMute = (UINT8)(UINT8)(((DRV_AUDIO_SOFT_MUTE_T *)pv_set_info)->u1LchMute);
            u1RchMute = (UINT8)(UINT8)(((DRV_AUDIO_SOFT_MUTE_T *)pv_set_info)->u1RchMute);
            u4v0 = u1LchMute?0:0x7fffff;
            u4v1 = u1RchMute?0:0x7fffff;
            if(u1SpkType == 2) //woofer
            {
               vAprocReg_Write (APROC_ASM_ADDR (APROC_ASM_ID_POSTPROC_0, APROC_REG_SPSW_VOL), u4v0);
               break;
            }
            else if(u1SpkType == 1)
            {
                u4Idx = APROC_REG_SP_BALANCE_0;
            }
            else if(u1SpkType == 3)
            {
                u4Idx = APROC_REG_LSRS_BALANCE_0;
            }
            else
            {
                return RMR_INV_ARG;
            }
            vAprocReg_Write (APROC_ASM_ADDR (APROC_ASM_ID_POSTPROC_1, u4Idx), u4v0);
            vAprocReg_Write (APROC_ASM_ADDR (APROC_ASM_ID_POSTPROC_1, u4Idx+1), u4v1);
            #endif
            break;
        }           
        case DRV_CUSTOM_AUD_BT_VOL: //  0~100
        {
            #ifdef CC_MAPLE_CUST_DRV     
            if ((pv_set_info == NULL) || (z_size != sizeof(INT8)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }            
            #endif            
            break;
        }  
        case DRV_CUSTOM_AUD_BT_LNK: 
        {
            #ifdef CC_MAPLE_CUST_DRV     
            if ((pv_set_info == NULL) || (z_size != sizeof(UINT8)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
            //(*(E_CUST_AUD_BT_LNK *)pv_set_info);
            #endif            
            break;
        }
        case DRV_CUSTOM_AUD_BT_CONNECT:
        {
            #ifdef CC_MAPLE_CUST_DRV
            if ((pv_set_info == NULL) || (z_size != sizeof(UINT8)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
            #ifdef CC_AUD_SAKURA_RENDER_AQ
            UINT8 isConnect = (*(UINT8 *)pv_set_info);
            AUD_DspSoSetBtConnected(isConnect);
            #endif //CC_AUD_SAKURA_RENDER_AQ
            #endif
            break;
        }
        case DRV_CUSTOM_AUD_SPDIF_DELAY:
        {
#ifdef CC_MAPLE_CUST_DRV
            if ((pv_set_info == NULL) || (z_size != sizeof(UINT8)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
#ifdef CC_AUD_SAKURA_RENDER_AQ
            UINT8 u1OnOff = (*(UINT8 *)pv_set_info);
            _AUD_DspSetBypassSPDIFDly(u1OnOff);
#endif //CC_AUD_SAKURA_RENDER_AQ
#endif
            break;
        }
        case DRV_CUSTOM_AUD_SOUND_MODE:
        {
            #ifdef CC_MAPLE_CUST_DRV
            INPUT_CHK(pv_set_info, z_size, sizeof(E_CUST_AUD_SOUND_MODE));
#ifdef CC_AUD_SAKURA_RENDER
            E_CUST_AUD_SOUND_MODE notified_eSoundMode = (*(E_CUST_AUD_SOUND_MODE *)pv_set_info);

            if (notified_eSoundMode == E_CUST_AUD_SOUND_MODE_DOLBY)
            {
                AUD_PostTypeSet(E_CUST_AUD_POST_MODE_DOLBY);
            }
            else
            {
                AUD_PostTypeSet(E_CUST_AUD_POST_MODE_SONY);
            }
            if(gSoundSetting.eSoundMode == notified_eSoundMode)
            {
                break;
            }
            gSoundSetting.eSoundMode = notified_eSoundMode;
#endif // CC_AUD_SAKURA_RENDER
			DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);

            switch(gSoundSetting.eSoundMode)
            {
            case E_CUST_AUD_SOUND_MODE_STANDARD:
                gSAPostConfig.m_soundMode = (unsigned char)SAPOST_SOUND_MODE_STANDARD;
                gAqKey.u1SoundMode = (UINT8)AQ_SOUND_MODE_STANDARD;
                break;
            case E_CUST_AUD_SOUND_MODE_CINEMA:
                gSAPostConfig.m_soundMode = (unsigned char)SAPOST_SOUND_MODE_CINEMA;
                gAqKey.u1SoundMode = (UINT8)AQ_SOUND_MODE_CINEMA;
                break;
            case E_CUST_AUD_SOUND_MODE_LIVE_FOOTBALL:
                gSAPostConfig.m_soundMode = (unsigned char)SAPOST_SOUND_MODE_LIVE_FOOTBALL;
                gAqKey.u1SoundMode = (UINT8)AQ_SOUND_MODE_FOOTBALL;
                break;
            case E_CUST_AUD_SOUND_MODE_LIVE_MUSIC:
                gSAPostConfig.m_soundMode = (unsigned char)SAPOST_SOUND_MODE_LIVE_MUSIC;
                gAqKey.u1SoundMode = (UINT8)AQ_SOUND_MODE_MUSIC;
                break;
            case E_CUST_AUD_SOUND_MODE_DEMO:
                gSAPostConfig.m_soundMode = (unsigned char)SAPOST_SOUND_MODE_DEMO;
                gAqKey.u1SoundMode = (UINT8)AQ_SOUND_MODE_DEMO;
                break;
            case E_CUST_AUD_SOUND_MODE_NEWS:
                gSAPostConfig.m_soundMode = (unsigned char)SAPOST_SOUND_MODE_NEWS;
                gAqKey.u1SoundMode = (UINT8)AQ_SOUND_MODE_NEWS;
                break;
            default:
                gSAPostConfig.m_soundMode = (unsigned char)SAPOST_SOUND_MODE_UNKNOWN;
                gAqKey.u1SoundMode = (UINT8)AQ_SOUND_MODE_STANDARD;
                break;
            }
#ifdef CC_AUD_SAKURA_RENDER_AQ
            _AudChangeSoundConfigMute();
#endif //CC_AUD_SAKURA_RENDER_AQ



            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_POST_CONFIG, 0);
#ifndef CC_AUD_SAKURA_RENDER
            DrvCust_AQ_SetGet(AUD_DrvCust_AQ_Gen_Key, (VOID*)&gAqKey, (VOID*)&_gu4CurrentAqKey, 0, 0);
#else // CC_AUD_SAKURA_RENDER
#ifdef CC_AUD_SAKURA_RENDER
            _AUD_UpdateSpkDelay(true);
            _AUD_UpdateDspConfig(false);
#endif
#endif // CC_AUD_SAKURA_RENDER
            #endif
            break;
        }
        case DRV_CUSTOM_AUD_SURROUND_MODE:
        {
            #ifdef CC_MAPLE_CUST_DRV     			 
            INPUT_CHK(pv_set_info, z_size, sizeof(E_CUST_AUD_AUTO_SURROUND));
#ifdef CC_AUD_SAKURA_RENDER
            if(gSoundSetting.eAutoSurround == (*(E_CUST_AUD_AUTO_SURROUND *)pv_set_info))
            {
                break;
            }
#endif // CC_AUD_SAKURA_RENDER
			gSoundSetting.eAutoSurround = (*(E_CUST_AUD_AUTO_SURROUND *)pv_set_info);
			DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            gSAPostConfig.m_surround= (unsigned char)gSoundSetting.eAutoSurround;
#ifdef CC_AUD_SAKURA_RENDER_AQ
            _AudChangeSoundConfigMute();
#endif //CC_AUD_SAKURA_RENDER_AQ

            
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_POST_CONFIG, 0);
            gAqKey.u1SurroundOnOff = (AQ_SURROUND)(gSoundSetting.eAutoSurround+AQ_SURROUND_OFF);
#ifndef CC_AUD_SAKURA_RENDER
            DrvCust_AQ_SetGet(AUD_DrvCust_AQ_Gen_Key, (VOID*)&gAqKey, (VOID*)&_gu4CurrentAqKey, 0, 0);            
#else // CC_AUD_SAKURA_RENDER
#ifdef CC_AUD_SAKURA_RENDER
            _AUD_UpdateSpkDelay(true);
            _AUD_UpdateDspConfig(false);
#endif            
#endif // CC_AUD_SAKURA_RENDER
            #endif
            break;
        }
        case DRV_CUSTOM_AUD_SURROUND_EFFECT:
        {
    #ifdef CC_MAPLE_CUST_DRV     
            INPUT_CHK(pv_set_info, z_size, sizeof(INT8));
#ifdef CC_AUD_SAKURA_RENDER
            if(gSoundSetting.i1SurroundEffect == (*(INT8 *)pv_set_info))
            {
                break;
            }
#endif // CC_AUD_SAKURA_RENDER
			gSoundSetting.i1SurroundEffect = (*(INT8 *)pv_set_info);
			DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            gSAPostConfig.m_surroundEffect = (unsigned char)gSoundSetting.i1SurroundEffect;
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_POST_CONFIG, 0);
    #endif
	#ifdef CC_AUD_SAKURA_RENDER
            _AUD_UpdateDspConfig(false);
    #endif // CC_AUD_SAKURA_RENDER    
            break;
        }    
        case DRV_CUSTOM_AUD_UP_SCL:
        {
#ifdef CC_MAPLE_CUST_DRV                  
            INPUT_CHK(pv_set_info, z_size, sizeof(E_CUST_AUD_UP_SCL));
#ifdef CC_AUD_SAKURA_RENDER
            if(gSoundSetting.eSoundUpScaling == (*(E_CUST_AUD_UP_SCL *)pv_set_info))
            {
                break;
            }
#endif // CC_AUD_SAKURA_RENDER
            gSoundSetting.eSoundUpScaling = (*(E_CUST_AUD_UP_SCL *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            gSAPostConfig.m_soundUpScaling = (unsigned char)gSoundSetting.eSoundUpScaling;
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_POST_CONFIG, 0);
#ifdef CC_AUD_SAKURA_RENDER
            _AUD_UpdateDspConfig(false);
#endif // CC_AUD_SAKURA_RENDER
#endif
            break;
        }
        case DRV_CUSTOM_AUD_VOICE_ZOOM:
        {
#ifdef CC_MAPLE_CUST_DRV     
            INPUT_CHK(pv_set_info, z_size, sizeof(INT8));
#ifdef CC_AUD_SAKURA_RENDER
            if(gSoundSetting.i1VoiceZoom == (*(INT8 *)pv_set_info))
            {
                break;
            }
#endif // CC_AUD_SAKURA_RENDER
            gSoundSetting.i1VoiceZoom = (*(INT8 *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            gSAPostConfig.m_voiceZoom = (char)gSoundSetting.i1VoiceZoom;
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_POST_CONFIG, 0);            
#endif
            break;
        }
        case DRV_CUSTOM_AUD_SCENE_SEL: //ClearAudio+
        {
#ifdef CC_MAPLE_CUST_DRV                            
#ifndef CC_AUD_SAKURA_RENDER // DRV_CUSTOM_AUD_SCENE_SEL not used in GN4. Move to DRV_CUSTOM_AUD_AUTO_SOUND_MODE.
            INPUT_CHK(pv_set_info, z_size, sizeof(E_CUST_AUD_SCENE_SELECT_AUTO));
            gSoundSetting.eSceneSelectAuto = (*(E_CUST_AUD_SCENE_SELECT_AUTO *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
#endif // CC_AUD_SAKURA_RENDER
#endif
            break;
        }
        case DRV_CUSTOM_AUD_NIGHT_MODE:
        {
#ifdef CC_MAPLE_CUST_DRV     
            INPUT_CHK(pv_set_info, z_size, sizeof(E_CUST_AUD_NIGHT_MODE));
#ifdef CC_AUD_SAKURA_RENDER
            if(gSoundSetting.eNightMode == (*(E_CUST_AUD_NIGHT_MODE *)pv_set_info))
            {
                break;
            }
#endif // CC_AUD_SAKURA_RENDER
            gSoundSetting.eNightMode = (*(E_CUST_AUD_NIGHT_MODE *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            gSAPostConfig.m_nightMode = (unsigned char)gSoundSetting.eNightMode;
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_POST_CONFIG, 0);      
#endif
#ifdef CC_AUD_SAKURA_RENDER
            _AUD_UpdateDspConfig(false);
#endif // CC_AUD_SAKURA_RENDER
            break;
        }
        case DRV_CUSTOM_AUD_WSW_POWER:
        {
#ifdef CC_MAPLE_CUST_DRV     
            INPUT_CHK(pv_set_info, z_size, sizeof(E_CUST_AUD_SUBWOOFER_POWER));
            gSoundSetting.eSubwooferPowerSetting = (*(E_CUST_AUD_SUBWOOFER_POWER *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
#endif
            break;
        }
        case DRV_CUSTOM_AUD_ADV_AUTO_VOLUME:
        {
#ifdef CC_MAPLE_CUST_DRV     
            INPUT_CHK(pv_set_info, z_size, sizeof(E_CUST_AUD_AUTO_VOLUME));
#ifdef CC_AUD_SAKURA_RENDER
            if(gSoundSetting.eAutoVolume == (*(E_CUST_AUD_AUTO_VOLUME *)pv_set_info))
            {
                break;
            }
#endif // CC_AUD_SAKURA_RENDER
            gSoundSetting.eAutoVolume = (*(E_CUST_AUD_AUTO_VOLUME *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            gSAPostConfig.m_advancedAutoVolume = (unsigned char)gSoundSetting.eAutoVolume;
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_POST_CONFIG, 0);   
#ifndef CC_AUD_SAKURA_RENDER
            gAqKey.u1AutoOnOff = (AQ_AUTO_VOL)(gSoundSetting.eAutoVolume+AQ_AUTO_VOL_OFF);
            DrvCust_AQ_SetGet(AUD_DrvCust_AQ_Gen_Key, (VOID*)&gAqKey, (VOID*)&_gu4CurrentAqKey, 0, 0); 
#endif // CC_AUD_SAKURA_RENDER
#endif
#ifdef CC_AUD_SAKURA_RENDER
            _AUD_UpdateDspConfig(false);
#endif // CC_AUD_SAKURA_RENDER

            break;
        }
        case DRV_CUSTOM_AUD_INP_LVL_OFFSET: //Volume offset no use
        {
#ifdef CC_MAPLE_CUST_DRV     
            INPUT_CHK(pv_set_info, z_size, sizeof(INT8));
#ifdef CC_AUD_SAKURA_RENDER
            if(gSoundSetting.i1InputLevelOffset == (*(INT8 *)pv_set_info))
            {
                break;
            }
#endif // CC_AUD_SAKURA_RENDER
            gSoundSetting.i1InputLevelOffset = (*(INT8 *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            gSAPostGenConfig.m_inputLevelOffset = (char)gSoundSetting.i1InputLevelOffset;
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_GEN_CONFIG, 0);              
#ifdef CC_AUD_SAKURA_RENDER
            _AUD_UpdateDspConfig(false);
#endif // CC_AUD_SAKURA_RENDER
#endif
            break;
        }
        case DRV_CUSTOM_AUD_DOLBY_DR:
        {
#ifdef CC_MAPLE_CUST_DRV     
            INPUT_CHK(pv_set_info, z_size, sizeof(E_CUST_AUD_DOLBY_DRANGE));
            gSoundSetting.eDolbyDynamicRange = (*(E_CUST_AUD_DOLBY_DRANGE *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
#ifndef CC_AUD_SAKURA_RENDER
            if(gSoundSetting.eDolbyDynamicRange == E_CUST_AUD_DOLBY_DRANGE_COMPRESSED)
               gSAPostGenConfig.m_dolbyDigitalDynamicRange = (unsigned char)SAPOST_DOLBY_DIGITAL_DYNAMIC_RANGE_COMPRESSED;     
            else if(gSoundSetting.eDolbyDynamicRange == E_CUST_AUD_DOLBY_DRANGE_STANDARD)
               gSAPostGenConfig.m_dolbyDigitalDynamicRange = (unsigned char)SAPOST_DOLBY_DIGITAL_DYNAMIC_RANGE_STANDARD;     
            else 
               gSAPostGenConfig.m_dolbyDigitalDynamicRange = (unsigned char)SAPOST_DOLBY_DIGITAL_DYNAMIC_RANGE_UNKNOWN;
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_GEN_CONFIG, 0);                   
#else // CC_AUD_SAKURA_RENDER
            if(gSoundSetting.eDolbyDynamicRange == E_CUST_AUD_DOLBY_DRANGE_COMPRESSED)
               gSAPostGenConfig.m_dolbyDigitalDynamicRange = (unsigned char)SAPOST_DOLBY_DIGITAL_DYNAMIC_RANGE_COMPRESSED;     
            else if(gSoundSetting.eDolbyDynamicRange == E_CUST_AUD_DOLBY_DRANGE_STANDARD)
               gSAPostGenConfig.m_dolbyDigitalDynamicRange = (unsigned char)SAPOST_DOLBY_DIGITAL_DYNAMIC_RANGE_STANDARD;     
            else 
               gSAPostGenConfig.m_dolbyDigitalDynamicRange = (unsigned char)SAPOST_DOLBY_DIGITAL_DYNAMIC_RANGE_UNKNOWN;
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_GEN_CONFIG, 0);                   
#ifdef CC_AUD_M3_FEATURE
            AUD_Update_MS12_PCMR_DRC_MODE(false);
#endif // CC_AUD_M3_FEATURE
#ifdef CC_AUD_SAKURA_RENDER
            _AUD_UpdateDspConfig(false);
#endif
#endif // CC_AUD_SAKURA_RENDER
    UINT8 u1cmprssMode = 0;    
    if(gSoundSetting.eDolbyDynamicRange == E_CUST_AUD_DOLBY_DRANGE_COMPRESSED)
    {
        u1cmprssMode = 3; //AUD_DEC_CMPSS_MODE_RF
    }
    else //E_CUST_AUD_DOLBY_DRANGE_STANDARD
    {
        u1cmprssMode = 2; //AC3_COMP_LINE
    }
    AUD_DspAC3CompMode(u1cmprssMode, AUD_DEC_MAIN);
    AUD_DspAC3CompMode(u1cmprssMode, AUD_DEC_AUX);
    AUD_DspAC3CompMode(u1cmprssMode, AUD_DEC_THIRD);// for AD output level
#endif
            break;
        }
        case DRV_CUSTOM_AUD_MPEG_AUDIO_LVL:
        {
#ifdef CC_MAPLE_CUST_DRV     
            INPUT_CHK(pv_set_info, z_size, sizeof(INT8));
#ifdef CC_AUD_SAKURA_RENDER
            if(gSoundSetting.i1MpegAudioLevel == (*(INT8 *)pv_set_info))
            {
                break;
            }
#endif // CC_AUD_SAKURA_RENDER
            gSoundSetting.i1MpegAudioLevel = (*(INT8 *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            gSAPostGenConfig.m_mpegAudioLevel= (char)gSoundSetting.i1MpegAudioLevel;
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_GEN_CONFIG, 0);            
#ifdef CC_AUD_SAKURA_RENDER
            _AUD_UpdateDspConfig(false);
#endif // CC_AUD_SAKURA_RENDER
#endif
            break;
        }
        case DRV_CUSTOM_AUD_HEAAC_AUDIO_LVL:
        {
#ifdef CC_MAPLE_CUST_DRV     
            INPUT_CHK(pv_set_info, z_size, sizeof(INT8));
#ifdef CC_AUD_SAKURA_RENDER
            if(gSoundSetting.i1HeAacAudioLevel == (*(INT8 *)pv_set_info))
            {
                break;
            }
#endif // CC_AUD_SAKURA_RENDER
            gSoundSetting.i1HeAacAudioLevel = (*(INT8 *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            gSAPostGenConfig.m_heAacAudioLevel = (char)gSoundSetting.i1HeAacAudioLevel;
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_GEN_CONFIG, 0);            
#ifdef CC_AUD_SAKURA_RENDER
            _AUD_UpdateDspConfig(false);
#endif // CC_AUD_SAKURA_RENDER
#endif
            break;
        }
        case DRV_CUSTOM_AUD_HEAAC_DR:
        {
            //Printf("DRV_CUSTOM_AUD_HEAAC_DR gSoundSetting.eDynamicRang z_size = %d, sizeof(E_CUST_AUD_DYNAMIC_RANGE) = %d ~~~~~~~~~~~~~~~~~ \n", z_size, sizeof(E_CUST_AUD_DYNAMIC_RANGE));
#ifdef CC_MAPLE_CUST_DRV     
            INPUT_CHK(pv_set_info, z_size, sizeof(E_CUST_AUD_DYNAMIC_RANGE));
            gSoundSetting.eDynamicRange = (*(E_CUST_AUD_DYNAMIC_RANGE *)pv_set_info);

            //Printf("DRV_CUSTOM_AUD_HEAAC_DR gSoundSetting.eDynamicRange = %d ~~~~~~~~~~~ \n", gSoundSetting.eDynamicRange);
			
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            if(gSoundSetting.eDynamicRange == E_CUST_AUD_DYNAMIC_RANGE_COMPRESSED)
            {
                //Printf("DRV_CUSTOM_AUD_HEAAC_DR E_CUST_AUD_DYNAMIC_RANGE_COMPRESSED ~~~~~~~~~~~ \n");
                gSAPostGenConfig.m_heAacDynamicRange = (unsigned char)SAPOST_HE_AAC_DYNAMIC_RANGE_COMPRESSED;     
            }
            else if(gSoundSetting.eDynamicRange == E_CUST_AUD_DYNAMIC_RANGE_STANDARD)
            {
                //Printf("DRV_CUSTOM_AUD_HEAAC_DR SAPOST_HE_AAC_DYNAMIC_RANGE_STANDARD ~~~~~~~~~~~ \n");
                gSAPostGenConfig.m_heAacDynamicRange = (unsigned char)SAPOST_HE_AAC_DYNAMIC_RANGE_STANDARD;     
            }
            else 
            {
                //Printf("DRV_CUSTOM_AUD_HEAAC_DR SAPOST_HE_AAC_DYNAMIC_RANGE_UNKNOWN ~~~~~~~~~~~ \n");
                gSAPostGenConfig.m_heAacDynamicRange = (unsigned char)SAPOST_HE_AAC_DYNAMIC_RANGE_UNKNOWN;
            }
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_GEN_CONFIG, 0);            
#ifdef CC_AUD_M3_FEATURE
            AUD_Update_MS12_PCMR_DRC_MODE(false);
#endif // CC_AUD_M3_FEATURE
#ifdef CC_AUD_SAKURA_RENDER
            _AUD_UpdateDspConfig(false);
#endif // CC_AUD_SAKURA_RENDER
    UINT8 u1cmprssMode = 0;    
    if(gSoundSetting.eDynamicRange == E_CUST_AUD_DYNAMIC_RANGE_COMPRESSED)
    {
        //Printf("DRV_CUSTOM_AUD_HEAAC_DR u1cmprssMode = 1 ~~~~~~~~~~~ \n");
        u1cmprssMode = 1; //AUD_DEC_CMPSS_MODE_RF
    }
    else //E_CUST_AUD_DYNAMIC_RANGE_STANDARD
    {
        //Printf("DRV_CUSTOM_AUD_HEAAC_DR u1cmprssMode = 0 ~~~~~~~~~~~ \n");
        u1cmprssMode = 0; //AUD_DEC_CMPSS_MODE_LINE
    }
#ifdef  CC_AUD_SUPPORT_MS10
    AUD_DspDdtDmxRfMode(u1cmprssMode, AUD_DEC_MAIN, FALSE);
    AUD_DspDdtDmxRfMode(u1cmprssMode, AUD_DEC_AUX, FALSE);
    AUD_DspDdtDmxRfMode(u1cmprssMode, AUD_DEC_THIRD, FALSE);
#endif
#endif
            break;
        }       
        case DRV_CUSTOM_AUD_GEQ_BAND1:
        {
#ifdef CC_MAPLE_CUST_DRV     
            INPUT_CHK(pv_set_info, z_size, sizeof(INT8));
#ifdef CC_AUD_SAKURA_RENDER
            if(gSoundSetting.i1Eq100 == (*(INT8 *)pv_set_info))
            {
                break;
            }
#endif // CC_AUD_SAKURA_RENDER
            gSoundSetting.i1Eq100 = (*(INT8 *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            gSAPostConfig.m_equalizer125Hz = (char)gSoundSetting.i1Eq100;
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_POST_CONFIG, 0);               
            {
                AQDataDdGeq rGetDdGeqData = { 0 };
                DrvCust_AQ_SetGet( AUD_DrvCust_AQ_Get_DD_GEQ, &rGetDdGeqData, 0, _gu4CurrentAqKey, 0 );
                if(rGetDdGeqData.m_DdGeqEnable == 1){
                    _AUD_UpdateDspConfig(false);
                }
            }
#endif
            break;
        }
        case DRV_CUSTOM_AUD_GEQ_BAND2:
        {
#ifdef CC_MAPLE_CUST_DRV     
            INPUT_CHK(pv_set_info, z_size, sizeof(INT8));
#ifdef CC_AUD_SAKURA_RENDER
            if(gSoundSetting.i1Eq200 == (*(INT8 *)pv_set_info))
            {
                break;
            }
#endif // CC_AUD_SAKURA_RENDER
            gSoundSetting.i1Eq200 = (*(INT8 *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            gSAPostConfig.m_equalizer250Hz = (char)gSoundSetting.i1Eq200;
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_POST_CONFIG, 0);      
            {
                AQDataDdGeq rGetDdGeqData = { 0 };
                DrvCust_AQ_SetGet( AUD_DrvCust_AQ_Get_DD_GEQ, &rGetDdGeqData, 0, _gu4CurrentAqKey, 0 );
                if(rGetDdGeqData.m_DdGeqEnable == 1){
                    _AUD_UpdateDspConfig(false);
                }
            }
#endif
            break;
        }
        case DRV_CUSTOM_AUD_GEQ_BAND3:
        {
#ifdef CC_MAPLE_CUST_DRV     
            INPUT_CHK(pv_set_info, z_size, sizeof(INT8));
#ifdef CC_AUD_SAKURA_RENDER
            if(gSoundSetting.i1Eq500 == (*(INT8 *)pv_set_info))
            {
                break;
            }
#endif // CC_AUD_SAKURA_RENDER
            gSoundSetting.i1Eq500 = (*(INT8 *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            gSAPostConfig.m_equalizer500Hz = (char)gSoundSetting.i1Eq500;
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_POST_CONFIG, 0);      
            {
                AQDataDdGeq rGetDdGeqData = { 0 };
                DrvCust_AQ_SetGet( AUD_DrvCust_AQ_Get_DD_GEQ, &rGetDdGeqData, 0, _gu4CurrentAqKey, 0 );
                if(rGetDdGeqData.m_DdGeqEnable == 1){
                    _AUD_UpdateDspConfig(false);
                }
            }
#endif
            break;
        }
        case DRV_CUSTOM_AUD_GEQ_BAND4:
        {
#ifdef CC_MAPLE_CUST_DRV     
            INPUT_CHK(pv_set_info, z_size, sizeof(INT8));
#ifdef CC_AUD_SAKURA_RENDER
            if(gSoundSetting.i1Eq1K == (*(INT8 *)pv_set_info))
            {
                break;
            }
#endif // CC_AUD_SAKURA_RENDER
            gSoundSetting.i1Eq1K= (*(INT8 *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            gSAPostConfig.m_equalizer1KHz = (char)gSoundSetting.i1Eq1K;
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_POST_CONFIG, 0);      
            {
                AQDataDdGeq rGetDdGeqData = { 0 };
                DrvCust_AQ_SetGet( AUD_DrvCust_AQ_Get_DD_GEQ, &rGetDdGeqData, 0, _gu4CurrentAqKey, 0 );
                if(rGetDdGeqData.m_DdGeqEnable == 1){
                    _AUD_UpdateDspConfig(false);
                }
            }
#endif
            break;
        }
        case DRV_CUSTOM_AUD_GEQ_BAND5:
        {
#ifdef CC_MAPLE_CUST_DRV     
            INPUT_CHK(pv_set_info, z_size, sizeof(INT8));
#ifdef CC_AUD_SAKURA_RENDER
            if(gSoundSetting.i1Eq2K == (*(INT8 *)pv_set_info))
            {
                break;
            }
#endif // CC_AUD_SAKURA_RENDER
            gSoundSetting.i1Eq2K= (*(INT8 *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            gSAPostConfig.m_equalizer2KHz = (char)gSoundSetting.i1Eq2K;
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_POST_CONFIG, 0);                  
            {
                AQDataDdGeq rGetDdGeqData = { 0 };
                DrvCust_AQ_SetGet( AUD_DrvCust_AQ_Get_DD_GEQ, &rGetDdGeqData, 0, _gu4CurrentAqKey, 0 );
                if(rGetDdGeqData.m_DdGeqEnable == 1){
                    _AUD_UpdateDspConfig(false);
                }
            }
#endif
            break;
        }
        case DRV_CUSTOM_AUD_GEQ_BAND6:
        {
#ifdef CC_MAPLE_CUST_DRV     
            INPUT_CHK(pv_set_info, z_size, sizeof(INT8));
#ifdef CC_AUD_SAKURA_RENDER
            if(gSoundSetting.i1Eq5K == (*(INT8 *)pv_set_info))
            {
                break;
            }
#endif // CC_AUD_SAKURA_RENDER
            gSoundSetting.i1Eq5K= (*(INT8 *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            gSAPostConfig.m_equalizer4KHz = (char)gSoundSetting.i1Eq5K;
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_POST_CONFIG, 0);                  
            {
                AQDataDdGeq rGetDdGeqData = { 0 };
                DrvCust_AQ_SetGet( AUD_DrvCust_AQ_Get_DD_GEQ, &rGetDdGeqData, 0, _gu4CurrentAqKey, 0 );
                if(rGetDdGeqData.m_DdGeqEnable == 1){
                    _AUD_UpdateDspConfig(false);
                }
            }
#endif
            break;
        }
        case DRV_CUSTOM_AUD_GEQ_BAND7:
        {
#ifdef CC_MAPLE_CUST_DRV     
            INPUT_CHK(pv_set_info, z_size, sizeof(INT8));
#ifdef CC_AUD_SAKURA_RENDER
            if(gSoundSetting.i1Eq10K == (*(INT8 *)pv_set_info))
            {
                break;
            }
#endif // CC_AUD_SAKURA_RENDER
            gSoundSetting.i1Eq10K= (*(INT8 *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            gSAPostConfig.m_equalizer8KHz = (char)gSoundSetting.i1Eq10K;
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_POST_CONFIG, 0);                  
            {
                AQDataDdGeq rGetDdGeqData = { 0 };
                DrvCust_AQ_SetGet( AUD_DrvCust_AQ_Get_DD_GEQ, &rGetDdGeqData, 0, _gu4CurrentAqKey, 0 );
                if(rGetDdGeqData.m_DdGeqEnable == 1){
                    _AUD_UpdateDspConfig(false);
                }
            }
#endif
            break;
        }
        case DRV_CUSTOM_AUD_LFM_NC:
        {
#ifdef CC_MAPLE_CUST_DRV     
            INPUT_CHK(pv_set_info, z_size, sizeof(E_CUST_AUD_LFM_NC));
#ifdef CC_AUD_SAKURA_RENDER
            if(gSoundSetting.eLfmNarrationCancel == (*(E_CUST_AUD_LFM_NC *)pv_set_info))
            {
                break;
            }
#endif // CC_AUD_SAKURA_RENDER
            gSoundSetting.eLfmNarrationCancel = (*(E_CUST_AUD_LFM_NC *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            gSAPostConfig.m_narration = (unsigned char)gSoundSetting.eLfmNarrationCancel;
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_POST_CONFIG, 0);     
#ifdef CC_AUD_SAKURA_RENDER
            _AUD_UpdateDspConfig(false);
#endif // CC_AUD_SAKURA_RENDER
#endif
            break;
        }
        case DRV_CUSTOM_AUD_WSW_DELAY:
        {
#ifdef CC_MAPLE_CUST_DRV     
            INPUT_CHK(pv_set_info, z_size, sizeof(INT8));
            gSoundSetting.i1SubwooferDelay = (*(INT8 *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
#endif
#ifdef CC_AUD_SAKURA_RENDER
            _AUD_UpdateDspConfig(false);
#endif // CC_AUD_SAKURA_RENDER
            break;
        }        
        case DRV_CUSTOM_AUD_HP_AUD_OUT:
        {
#ifdef CC_MAPLE_CUST_DRV_AUD     
           INPUT_CHK(pv_set_info, z_size, sizeof(E_CUST_AUD_HP_AUD_OUT));
#ifdef CC_AUD_SAKURA_RENDER
            if(gSoundSetting.eHpAudioOut == (*(E_CUST_AUD_HP_AUD_OUT *)pv_set_info))
            {
                break;
            }
#endif // CC_AUD_SAKURA_RENDER
            gSoundSetting.eHpAudioOut = (*(E_CUST_AUD_HP_AUD_OUT *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            switch(gSoundSetting.eHpAudioOut)
            {
            case E_CUST_AUD_HP_AUD_OUT_HP:
                gSAPostGenConfig.m_analogOut = (unsigned char)SAPOST_ANALOG_OUT_HEADPHONE;
                gAqKey.u1WirelessWoofer = AQ_WIRELESS_SUBWOOFER_MODE_OFF;
                vAprocReg_Write (APROC_ASM_ADDR (APROC_ASM_ID_POSTPROC_D, APROC_REG_AUDIO_OUT_SEL), APROC_HP_OUTPUT_HP);
                break;
            case E_CUST_AUD_HP_AUD_OUT_FIXED:
                gSAPostGenConfig.m_analogOut = (unsigned char)SAPOST_ANALOG_OUT_LINE_OUT_FIXED;
                gAqKey.u1WirelessWoofer = AQ_WIRELESS_SUBWOOFER_MODE_OFF;
#ifdef CC_AUD_SAKURA_RENDER
                vAprocReg_Write (APROC_ASM_ADDR (APROC_ASM_ID_POSTPROC_D, APROC_REG_AUDIO_OUT_SEL), APROC_HP_OUTPUT_HP); // For render, it's the same as HP.
#else // CC_AUD_SAKURA_RENDER
                vAprocReg_Write (APROC_ASM_ADDR (APROC_ASM_ID_POSTPROC_D, APROC_REG_AUDIO_OUT_SEL), APROC_HP_OUTPUT_LINE);
#endif // CC_AUD_SAKURA_RENDER
                break;
            case E_CUST_AUD_HP_AUD_OUT_VARIABLE:
                gSAPostGenConfig.m_analogOut = (unsigned char)SAPOST_ANALOG_OUT_LINE_OUT_VARIABLE;
                gAqKey.u1WirelessWoofer = AQ_WIRELESS_SUBWOOFER_MODE_OFF;
#ifdef CC_AUD_SAKURA_RENDER
                vAprocReg_Write (APROC_ASM_ADDR (APROC_ASM_ID_POSTPROC_D, APROC_REG_AUDIO_OUT_SEL), APROC_HP_OUTPUT_HP); // For render, it's the same as HP.
#else // CC_AUD_SAKURA_RENDER
                vAprocReg_Write (APROC_ASM_ADDR (APROC_ASM_ID_POSTPROC_D, APROC_REG_AUDIO_OUT_SEL), APROC_HP_OUTPUT_LINE);
#endif // CC_AUD_SAKURA_RENDER
                break;
            case E_CUST_AUD_HP_AUD_OUT_SUBWOOFER:
                gSAPostGenConfig.m_analogOut = (unsigned char)SAPOST_ANALOG_OUT_SUBWOOFER;
                //SAPOST_ANALOG_OUT_WIRELESS_SUBWOOFER

#ifdef CC_AUD_SAKURA_RENDER
               if(gSoundSetting.u1SubwooferEnable)
               {
                   gSAPostGenConfig.m_analogOut = (unsigned char)SAPOST_ANALOG_OUT_WIRELESS_SUBWOOFER;
                   gAqKey.u1WirelessWoofer = AQ_WIRELESS_SUBWOOFER_MODE_ON;
               }
               else
               {
                   gAqKey.u1WirelessWoofer = AQ_WIRELESS_SUBWOOFER_MODE_OFF;
               }
#else // CC_AUD_SAKURA_RENDER
                gAqKey.u1WirelessWoofer = AQ_WIRELESS_SUBWOOFER_MODE_OFF;
                //if(wireless)
                    //gAqKey.u1WirelessWoofer = AQ_WIRELESS_SUBWOOFER_MODE_ON;
#endif // CC_AUD_SAKURA_RENDER
                vAprocReg_Write (APROC_ASM_ADDR (APROC_ASM_ID_POSTPROC_D, APROC_REG_AUDIO_OUT_SEL), APROC_HP_OUTPUT_WOOFER);
                break;
            default:
                gSAPostGenConfig.m_analogOut = (unsigned char)SAPOST_ANALOG_OUT_UNKNOWN;
                gAqKey.u1WirelessWoofer = AQ_WIRELESS_SUBWOOFER_MODE_OFF;
                break;
            }            
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_GEN_CONFIG, 0);                                    
#ifndef CC_AUD_SAKURA_RENDER
            DrvCust_AQ_SetGet(AUD_DrvCust_AQ_Gen_Key, (VOID*)&gAqKey, (VOID*)&_gu4CurrentAqKey, 0, 0);
#else // CC_AUD_SAKURA_RENDER
            DRVCUST_SendAudEvent(E_CUST_AUD_SUBWOOFER_STATE_CHANGE, 0);
#ifdef CC_AUD_SAKURA_RENDER
            _AUD_UpdateDspConfig(false);
#endif
#endif // CC_AUD_SAKURA_RENDER
#endif //CC_MAPLE_CUST_DRV_AUD
            break;
        }
        case DRV_CUSTOM_AUD_DIGI_OUT:
        {
            INPUT_CHK(pv_set_info, z_size, sizeof(E_CUST_AUD_DIGI_OUT));
            if(gSoundSetting.eDigitalAudioOut == (*(E_CUST_AUD_DIGI_OUT *)pv_set_info))
            {
                break;
            }
            gSoundSetting.eDigitalAudioOut = (*(E_CUST_AUD_DIGI_OUT *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            gSAPostGenConfig.m_digitalOut = (unsigned char)gSoundSetting.eDigitalAudioOut;
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_GEN_CONFIG, 0);
            _AUD_DspSetIEC(AUD_DEC_MAIN);
            _AUD_DspSetDTSDmxConfig();
#ifdef CC_AUD_M3_FEATURE
            AUD_Update_MS12_PCMR_DRC_MODE(false);
#endif
#ifdef CC_AUD_SAKURA_RENDER
            _AUD_UpdateDspConfig(false);
#endif
            break;
        }
        case DRV_CUSTOM_AUD_DDP_OUT:
        {
            INPUT_CHK(pv_set_info, z_size, sizeof(E_CUST_AUD_DDP_OUT));
#if defined(CC_HDMI_EARC_SUPPORT)&&!defined(CC_UBOOT)&&!defined(CC_MTK_LOADER)
#if SUPPORT_ATMOS_UPDATE
            u1HDMIEARCMenuSetDDPOut(*(UINT8 *)pv_set_info);
#endif
#endif
            if(gDDPSetting.eDDPMode == (*(E_CUST_AUD_DDP_OUT *)pv_set_info))
            {
                break;
            }
            gDDPSetting.eDDPMode = (*(E_CUST_AUD_DDP_OUT *)pv_set_info);
            _AUD_DspSetIEC(AUD_DEC_MAIN);
            break;
        }
        case DRV_CUSTOM_AUD_DDP_CAPABILITY:
        {
            INPUT_CHK(pv_set_info, z_size, sizeof(E_CUST_AUD_DDP_CAPABILITY));
#if defined(CC_HDMI_EARC_SUPPORT)&&!defined(CC_UBOOT)&&!defined(CC_MTK_LOADER)
#if SUPPORT_ATMOS_UPDATE
            u1HDMIEARCMenuSetDDPCap(*(UINT8 *)pv_set_info);
#endif
#endif
            if(gDDPSetting.eDDPCapabilityARC == (*(E_CUST_AUD_DDP_CAPABILITY *)pv_set_info))
            {
                break;
            }
            gDDPSetting.eDDPCapabilityARC = *(E_CUST_AUD_DDP_CAPABILITY *)pv_set_info;
            if(gDDPSetting.eDDPCapability == (gDDPSetting.eDDPCapabilityARC | gDDPSetting.eDDPCapabilityEARC))
            {
                break;
            }
            gDDPSetting.eDDPCapability = gDDPSetting.eDDPCapabilityARC | gDDPSetting.eDDPCapabilityEARC;
            _AUD_DspSetIEC(AUD_DEC_MAIN);
            _AUD_UpdateDspConfig(FALSE);
            break;
        }
        case DRV_CUSTOM_AUD_AAC_CAPABILITY:
        {
            INPUT_CHK(pv_set_info, z_size, sizeof(E_CUST_AUD_MPEG4_AAC_CAPABILITY));
            if(gAACSetting.eMpeg4AacCapabilityARC == (*(E_CUST_AUD_MPEG4_AAC_CAPABILITY *)pv_set_info))
            {
                break;
            }
            gAACSetting.eMpeg4AacCapabilityARC = *(E_CUST_AUD_MPEG4_AAC_CAPABILITY *)pv_set_info;
            if (gAACSetting.eMpeg4AacCapability != _AUD_CalAacCap())
            {
                gAACSetting.eMpeg4AacCapability = _AUD_CalAacCap();
                _AUD_DspSetIEC(AUD_DEC_MAIN);
                _AUD_UpdateDspConfig(FALSE);
            }
            break;
        }
        case DRV_CUSTOM_AUD_POST_ENABLE:
        {
            INPUT_CHK(pv_set_info, z_size, sizeof(UINT32));
            AUD_CPUPOST_SET_CTRL_STATUS(*(UINT32*)pv_set_info);
            break;
        }
        case DRV_CUSTOM_AUD_SET_NETFLIX_STATUS:
        {
            INPUT_CHK(pv_set_info, z_size, sizeof(UINT8));
            if (AUD_GetDamSupport() == 0)
            {
                LOG(2, "DRV_CUSTOM_AUD_SET_NETFLIX_STATUS:%d\n", *(UINT8*)pv_set_info);
                AUD_SetNetflixStatus(*(UINT8*)pv_set_info);
            }
            break;
        }
        case DRV_CUSTOM_AUD_KEY_TONE:
        {
#ifdef CC_MAPLE_CUST_DRV     
            INPUT_CHK(pv_set_info, z_size, sizeof(E_CUST_AUD_KEY_TONE));
            gSoundSetting.eKeyTone = (*(E_CUST_AUD_KEY_TONE *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
#endif
            break;
        }
        case DRV_CUSTOM_AUD_BALANCE:
        {
#ifdef CC_MAPLE_CUST_DRV     
        INPUT_CHK(pv_set_info, z_size, sizeof(INT8));
        gSoundSetting.i1LRBalance = (*(INT8 *)pv_set_info);
        DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
#ifdef CC_AUD_SAKURA_RENDER
        gSAPostConfig.m_balance = (char)gSoundSetting.i1LRBalance;
        DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_POST_CONFIG, 0);
#endif /* CC_AUD_SAKURA_RENDER */
#endif
        break;
        }
        case DRV_CUSTOM_AUD_SPK_OUT:
        {
            INPUT_CHK(pv_set_info, z_size, sizeof(E_CUST_AUD_SPEAKERS));
            if(gSoundSetting.eSpeakers == (*(E_CUST_AUD_SPEAKERS *)pv_set_info))
            {
                break;
            }
            gSoundSetting.eSpeakers = (*(E_CUST_AUD_SPEAKERS *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            gSAPostGenConfig.m_speakers = (unsigned char)gSoundSetting.eSpeakers;
            DRVCUST_SendSAPostEvent(E_CUST_AUD_SAPOST_GEN_CONFIG, 0);

            _AUD_DspSetIEC(AUD_DEC_MAIN);
            _AUD_DspSetDTSDmxConfig();
#ifdef CC_AUD_M3_FEATURE
            AUD_Update_MS12_PCMR_DRC_MODE(false);
#endif
#ifdef CC_AUD_SAKURA_RENDER
            _AUD_UpdateDspConfig(false);
#endif
        break;
        }
        case DRV_CUSTOM_AUD_DVI_IN:
        {
#ifdef CC_MAPLE_CUST_DRV     
        INPUT_CHK(pv_set_info, z_size, sizeof(E_CUST_AUD_HDMI_SRC));
        gSoundSetting.eHdmiDviAudioSource = (*(E_CUST_AUD_HDMI_SRC *)pv_set_info);
        DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
#endif
        break;
        }
        case DRV_CUSTOM_AUD_TV_STORE_DISP_MODE:
        {
#ifdef CC_MAPLE_CUST_DRV
#ifdef CC_MAPLE_CUST_DRV_AUD     
            INPUT_CHK(pv_set_info, z_size, sizeof(INT8));
            _AUD_DspSetStoreDispMode(*(BOOL *)pv_set_info);
#endif
#endif
        break;
        }
        case DRV_CUSTOM_AUD_SET_POST_MODE:
        {
            INPUT_CHK(pv_set_info, z_size, sizeof(E_CUST_AUD_POST_MODE));
            gSoundSetting.ePostMode = (*(E_CUST_AUD_POST_MODE *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            break;
        }
        case DRV_CUSTOM_AUD_EXT_CENTER_SP_MODE:
        {
            INPUT_CHK(pv_set_info, z_size, sizeof(E_CUST_AUD_EXT_CENTER_SP_MODE));
            gSoundSetting.eExtCenterSpMode = (*(E_CUST_AUD_EXT_CENTER_SP_MODE *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            break;
        }
        case DRV_CUSTOM_AUD_EARC_MODE:
        {
            INPUT_CHK(pv_set_info, z_size, sizeof(E_CUST_AUD_EARC_MODE));
            break;
        }
        case DRV_CUSTOM_AUD_OUT_VOLUME: //0~100
        {
            INPUT_CHK(pv_set_info, z_size, sizeof(INT8));
#ifdef CC_AUD_SAKURA_RENDER
            INT8 volume;
            volume = (*(INT8 *)pv_set_info);
            if((volume >= 0) && (volume <= 100)){
                _AUD_DspChannelVolume(AUD_DSP0, AUD_DEC_MAIN, AUD_CH_IEC_LEFT, volume);
            }
#endif
            break;
        }
        case DRV_CUSTOM_AUD_BITSTREAM_OUT_MODE:
        {
            INPUT_CHK(pv_set_info, z_size, sizeof(E_CUST_AUD_BITSTREAM_OUT_MODE));
            gSoundSetting.eBitstreamOutMode = (*(E_CUST_AUD_BITSTREAM_OUT_MODE *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
            _AUD_DspSetIEC(AUD_DEC_MAIN);
            _AUD_DspSetDTSDmxConfig();
#ifdef CC_AUD_SAKURA_RENDER
            _AUD_UpdateDspConfig(false);
#endif
            break;
        }
        case DRV_CUSTOM_AUD_AUTO_SOUND_MODE:
        {
            INPUT_CHK(pv_set_info, z_size, sizeof(E_CUST_AUD_AUTO_SOUND_MODE));
#ifdef CC_AUD_SAKURA_RENDER
            // Only save the value.
            if(gSoundSetting.eSceneSelectAuto == (*(E_CUST_AUD_AUTO_SOUND_MODE *)pv_set_info))
            {
                break;
            }
            gSoundSetting.eSceneSelectAuto = (*(E_CUST_AUD_AUTO_SOUND_MODE *)pv_set_info);
#endif // CC_AUD_SAKURA_RENDER
            break;
        }
        case DRV_CUSTOM_AUD_DIALONG_ENHANCER: //0~6
        {
            INPUT_CHK(pv_set_info, z_size, sizeof(INT8));
            gSoundSetting.eDialogEnhancer = (*(INT8 *)pv_set_info);
            DRVCUST_SendAudEvent(E_CUST_AUD_SOUND_SETTING_CHANGE, 0);
#ifdef CC_AUD_SAKURA_RENDER
            _AUD_UpdateDspConfig(false);
#endif // CC_AUD_SAKURA_RENDER
            break;
        }
		case DRV_CUSTOM_CUST_SPEC_TYPE_PGAM_EN:
		{
			//Param: UINT8 bOnOff
			//1: Set PGAM_EN enable; 0: Set PGAM_EN disable.
			DRVCUST_SetPGAM_EN(*(UINT8 *)pv_set_info);
			break;
		}
		
		case DRV_CUSTOM_CUST_SPEC_TYPE_U_WB_FLAT:
		{
			//Param: UINT8 bOnOff
			//1: Set U_WB_FLAT enable; 0: Set U_WB_FLAT disable.
			DRVCUST_SetUWBFLAT(*(UINT8 *)pv_set_info);
			break;
		}	
        case DRV_CUSTOM_CUST_SPEC_TYPE_PWM_BACKLIGHT_CONTROL:
        {
            BL_PWM_CTRL_T* d_BlPwmCtrl = (BL_PWM_CTRL_T*)pv_set_info;
            DRVCUST_SetBLPwmFrequency(d_BlPwmCtrl->chnlFreq, d_BlPwmCtrl->timeBase);
            DRVCUST_SetBLPwmDuty(d_BlPwmCtrl->chnlDuty, d_BlPwmCtrl->duty);
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_UI_RANGE:
        {
            UINT32 u4SrcType;
            PE_ARG_TYPE u4PeArg;
            PE_UI_RANGE_T UiRange;

            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_UI_RANGE)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }

            u4PeArg = (PE_ARG_TYPE)(((DRV_UI_RANGE*)pv_set_info)->u4PeArg);
            UiRange.i4Min = ((DRV_UI_RANGE*)pv_set_info)->i4Min;
            UiRange.i4Max = ((DRV_UI_RANGE*)pv_set_info)->i4Max;
            UiRange.i4Dft = ((DRV_UI_RANGE*)pv_set_info)->i4Dft;

            for (u4SrcType = 0; u4SrcType < EVDP_VIS_MAX; u4SrcType++)
            {
                PE_SetUiRange(u4SrcType, u4PeArg, &UiRange);
            }
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_SET_RGB_GAISOU:
        {
            if ((pv_set_info == NULL) || (z_size != sizeof(UINT8)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
            eventCode = 0;
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_CLI_PARSER:
        {
            if (pv_set_info == NULL)
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
            DRV_CLI_MESSAGE* cliCommand = (DRV_CLI_MESSAGE*)pv_set_info;
            CLI_Parser(cliCommand->buffer);
            break;
        }
		case DRV_CUSTOM_CUST_SPEC_TYPE_PQ_BL_LEVEL:
		{
			UINT16 blLevel = (*(UINT16 *)pv_set_info);
            UINT32* BL_AGING_REQ = (UINT32*)(u4SWReg(0xBA00));
            *BL_AGING_REQ = *BL_AGING_REQ | 0x1; // 0:Aging OFF   1:Aging On

            UINT32* BL_AGING_GAIN = (UINT32*)(u4SWReg(0xB004));
            if (blLevel > 1024){
                blLevel = 1024; // blLevel: 0-1024(max)
            }
            *BL_AGING_GAIN = (*BL_AGING_GAIN | 0x7FF) & (blLevel | 0xFFFFF800);
            LOG(0, "blLevel=%d *BL_AGING_REQ=%d *BL_AGING_GAIN=%d\n", blLevel, *BL_AGING_REQ, *BL_AGING_GAIN);
			break;
		}
        case DRV_CUSTOM_CUST_SPEC_TYPE_PQ_MURA_BKUP:
        {
            UINT8 data = (*(UINT8 *)pv_set_info);
            UINT32* MURA_BKUP = (UINT32*)(u4SWReg(0xba20));
            UINT32 temp = *MURA_BKUP;
            
            temp = temp & ~(1<<4);
            temp = temp & ~(1<<3);
            *MURA_BKUP = temp | 0x8;
            Printf("MURA_BKUP=%u  data=%d\n", *MURA_BKUP,data);
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_PQ_CUC_BKUP:
        {
            UINT8 data = (*(UINT8 *)pv_set_info);
            UINT32* CUC_BKUP = (UINT32*)(u4SWReg(0xba10));
            UINT32 temp = *CUC_BKUP;
            
            temp = temp & ~(1<<4);
            temp = temp & ~(1<<3);
            *CUC_BKUP = temp | 0x8;
            Printf("CUC_BKUP=%u  data=%d\n", *CUC_BKUP,data);
            break;
        }
		case DRV_CUSTOM_CUST_SPEC_TYPE_PQ_MURA_TRANS:
		{
            UINT8 data = (*(UINT8 *)pv_set_info);
            UINT32* MURA_TRANS = (UINT32*)(u4SWReg(0xba20));
            UINT32 temp = *MURA_TRANS;

            temp = temp & ~(1<<2);
            temp = temp & ~(1<<1);
            temp = temp & ~(1);
            *MURA_TRANS = temp | 0x1;
            Printf("MURA_TRANS=%u  data=%d\n", *MURA_TRANS,data);
            break;
		}
		case DRV_CUSTOM_CUST_SPEC_TYPE_PQ_CUC_TRANS:
		{
            UINT8 data = (*(UINT8 *)pv_set_info);
            UINT32* CUC_TRANS = (UINT32*)(u4SWReg(0xba10));
            UINT32 temp = *CUC_TRANS;

            temp = temp & ~(1<<2);
            temp = temp & ~(1<<1);
            temp = temp & ~(1);
            *CUC_TRANS = temp | 0x1;
            Printf("CUC_TRANS=%u  data=%d\n", *CUC_TRANS,data);
            break;
		}
        case DRV_CUSTOM_CUST_SPEC_TYPE_PQ_BU_FLASH:
        {
            UINT32* BU_FLASH = (UINT32*)(u4SWReg(0xba60));
            UINT32 temp = *BU_FLASH;
            Printf("Before: BU_FLASH=%u", *BU_FLASH);

            temp = temp & ~(1<<1);
            temp = temp & ~(1);
            *BU_FLASH = temp | 0x1;
            Printf("After: BU_FLASH=%u", *BU_FLASH);
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_PQ_BU_TRANS:
        {
            UINT32* BU_TRANS = (UINT32*)(u4SWReg(0xba60));
            UINT32 temp = *BU_TRANS;
            Printf("Before: BU_TRANS=%u", *BU_TRANS);

            temp = temp & ~(1<<3);
            temp = temp & ~(1<<2);
            *BU_TRANS = temp | 0x4;
            Printf("After: BU_TRANS=%u", *BU_TRANS);
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_VDP_COLOR_MODE:
            {
               SV_VDP_COLOR_MODE_T eVDPMode; 
               DRV_CUSTOM_VDP_COLOR_MODE_T eInMode;
               
	        if (z_size != sizeof(DRV_CUSTOM_VDP_COLOR_MODE_T))
	        {
		    return (-1);
	        }
	        eInMode = (*(DRV_CUSTOM_VDP_COLOR_MODE_T *)pv_set_info);
	
	        switch (eInMode)
	        {
	            case DRV_CUSTOM_VDP_COLOR_444:
	                eVDPMode = SV_COLOR_MODE_444;
	                break;
	            case DRV_CUSTOM_VDP_COLOR_422:
	                eVDPMode = SV_COLOR_MODE_422;
	                break;
	            default:
	            case DRV_CUSTOM_VDP_COLOR_AUTO:
	                eVDPMode = SV_COLOR_MODE_AUTO;
	                break;
	        }
	        vSetVDPColorMode(eVDPMode);
		 break;
             }


		
        case DRV_CUSTOM_AUDIO_FILTER_COUNTRY_TYPE:
        {
            au4Country = (*(INT32 *)pv_set_info);
            APSetCountryValue(au4Country);
            break;
        }
#ifdef CC_SAKURA_LED_ILLUMINATION
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_LED_ILLUMINATION_PATTERN:
        {
            if ((pv_set_info == NULL) || (z_size != sizeof(LED_PATTERN_IDX_T)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_SET_LED_ILLUMINATION_PATTERN: Invalid parameter\n");
                return RMR_INV_ARG;
            }
        #ifndef CC_MTK_LOADER
            GPIO_CustomLedCtrlFunc((*(LED_PATTERN_IDX_T*)pv_set_info));
        #endif
        }
            break;

        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_LED_ILLUMINATION_PARAM:
        {
            LED_ID_T tLedId;
            UINT32 u4Rgb;
            UINT32 u4OnMs;
            UINT32 u4OffMs;
            BOOL   fgRepeat;
            UINT32 u4WindowMs;

            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_LED_ILLUMINATION_PARAM_T)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_SET_LED_ILLUMINATION_PARAM: Invalid parameter\n");
                return RMR_INV_ARG;
            }

            tLedId     = (LED_ID_T)((DRV_LED_ILLUMINATION_PARAM_T*)pv_set_info)->tLedId;
            u4Rgb      =           ((DRV_LED_ILLUMINATION_PARAM_T*)pv_set_info)->u4Rgb;
            u4OnMs     =           ((DRV_LED_ILLUMINATION_PARAM_T*)pv_set_info)->u4OnMs;
            u4OffMs    =           ((DRV_LED_ILLUMINATION_PARAM_T*)pv_set_info)->u4OffMs;
            fgRepeat   =           ((DRV_LED_ILLUMINATION_PARAM_T*)pv_set_info)->fgRepeat;
            u4WindowMs =           ((DRV_LED_ILLUMINATION_PARAM_T*)pv_set_info)->u4WindowMs;

        #ifndef CC_MTK_LOADER
            CustomLed_Set_LED_Param(tLedId, u4Rgb, u4OnMs, u4OffMs, fgRepeat, u4WindowMs);
        #endif
        }
            break;

        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_LED_BRIGHTNESS:
        {
            if ((pv_set_info == NULL) || (z_size != sizeof(LED_U_BRIGHTNESS_T)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_SET_LED_BRIGHTNESS: Invalid parameter\n");
                return RMR_INV_ARG;
            }
            CustomLed_Set_U_Brightness((*(LED_U_BRIGHTNESS_T*)pv_set_info));
        }
            break;

        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_LED_ONOFFMS:
        {
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_LED_ONOFF_PARAM_T)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_SET_LED_ONOFFMS: Invalid parameter\n");
                return RMR_INV_ARG;
            }
            #ifndef CC_MTK_LOADER
            CustomLed_SetOnOffParam((DRV_LED_ONOFF_PARAM_T*)pv_set_info);
            #endif
        }
        break;

        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_LED_POWERON_PATTERN:  /* size = sizeof(LED_PATTERN_IDX_T), pv_set_info = (LED_PATTERN_IDX_T *) */
        {
            if ((pv_set_info == NULL) || (z_size != sizeof(LED_PATTERN_IDX_T)))
            {
                LOG(2, "%s:%d: Invalid parameter\n", __FUNCTION__, __LINE__);
                return RMR_INV_ARG;
            }
            
            #ifndef CC_MTK_LOADER
            CustomLed_SetLedPWRONPattern(*(LED_PATTERN_IDX_T *)pv_set_info);
            #endif
        }
        break;
        
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_LED_STANDBY_PATTERN:  /* size = sizeof(LED_PATTERN_IDX_T), pv_set_info = (LED_PATTERN_IDX_T *) */
        {
            if ((pv_set_info == NULL) || (z_size != sizeof(LED_PATTERN_IDX_T)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_SET_LED_ONOFFMS: Invalid parameter\n");
                return RMR_INV_ARG;
            }
            
            #ifndef CC_MTK_LOADER
            CustomLed_SetLedSTBYPattern(*(LED_PATTERN_IDX_T *)pv_set_info);
            #endif
        }
        break;
#endif
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_LED_RGB_COLOR:
        {
            if ((pv_set_info == NULL) || (z_size != sizeof(uint32_t)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_SET_LED_RGB_COLOR: Invalid parameter\n");
                return RMR_INV_ARG;
            }
            UINT32 u4ledColor = (*(UINT32 *)pv_set_info);
            UINT8 i1redBrightness = (UINT8)(u4ledColor >> 16);
            UINT8 i1greenBrightness = (UINT8)(u4ledColor >> 8);
            UINT8 i1blueBrightness = (UINT8)(u4ledColor);
            CustomLed_SetLedRgbColor(i1redBrightness, i1greenBrightness, i1blueBrightness);
        }
        break;
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_LED_PWM:
        {
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_LED_PWM_CONTROL))) 
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_SET_LED_PWM: Invalid parameter\n");
                return RMR_INV_ARG;
            }
            DRV_LED_PWM_CONTROL ledLevel = (*(DRV_LED_PWM_CONTROL *)pv_set_info);
            //Red
            PDWNC_PwmSetPwm(0, 1, 500, (ledLevel.red * 255));
            //Green
            PDWNC_PwmSetPwm(1, 1, 500, (ledLevel.green * 255));
            //Blue
            PDWNC_PwmSetPwm(2, 1, 500, (ledLevel.blue * 255));
        }
            break;

        case DRV_CUSTOM_CUST_SPEC_TYPE_FSW_ENABLE_HDMI_CEC:
        {
            if ((pv_set_info == NULL) || (z_size != sizeof(BOOL))) 
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_FSW_ENABLE_HDMI_CEC\n");
                return RMR_INV_ARG;
            }
            BOOL enable = (*(BOOL *)pv_set_info);

            // Init Cec 
#ifdef SYS_ANDROID_TV_TIF_SUPPORT
            CEC_HALSetMWReady(1);
#endif
            CEC_Init();
             
            //Enable Cec
            CEC_SetEnable(enable);
             
            // Set Rx result function.
            CEC_SetRxCallback(HdmiCec_RxResult,(void*)0);
            
            // Set Tx result function.
            CEC_SetTxCallback(HdmiCec_TxResult,(void*)0);
             break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_DSP_CHANNEL_MUTE:
        {
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_AUDIO_DSP_CHANNEL_MUTE_T)))
            {
                LOG(2, "Invalid parameter (DSP Channel Mute)\n");
                return RMR_INV_ARG;
            }
            UINT16 u1DecId = ((DRV_AUDIO_DSP_CHANNEL_MUTE_T*)pv_set_info)->u1DecId;
            AUD_CH_T eChannel = (AUD_CH_T)(((DRV_AUDIO_DSP_CHANNEL_MUTE_T*)pv_set_info)->eChannel);
            BOOL fgMute = ((DRV_AUDIO_DSP_CHANNEL_MUTE_T*)pv_set_info)->fgMute;

            AUD_DspChannelMute(AUD_DSP0, u1DecId, eChannel, fgMute);
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_CUST_AMP_MUTE:
        {
            if ((pv_set_info == NULL) || (z_size != sizeof(UINT8)))
            {
                LOG(2, "Invalid parameter (CUST AMP Mute)\n");
                return RMR_INV_ARG;
            }
            UINT8 mute = *((UINT8 *)pv_set_info);

            AUD_CUST_AMP_Mute((AUD_CUST_AMP_MUTE_T)mute);
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_CUST_AUDIO_STOP:
        {
            if ((pv_set_info == NULL) || (z_size != sizeof(DRV_AUDIO_STOP_T)))
            {
                LOG(2, "Invalid parameter (CUST AUD Stop)\n");
                return RMR_INV_ARG;
            }
            UINT8 u1DspId = ((DRV_AUDIO_STOP_T *)pv_set_info)->u1DspId;
            UINT8 u1DecId = ((DRV_AUDIO_STOP_T *)pv_set_info)->u1DecId;

            AUD_DSPCmdStop(u1DspId, u1DecId);
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_CUST_AUDIO_32BAND_ENABLE:
        {
            if ((pv_set_info == NULL) || (z_size != sizeof(UINT32)))
            {
                LOG(2, "Invalid parameter (CUST AUD 32Band)\n");
                return RMR_INV_ARG;
            }
            UINT32 control = *((UINT32 *)pv_set_info);

            vAprocReg_Write (APROC_ASM_ADDR (APORC_ASM_ID_DECINFO, APROC_REG_32BANDENABLE), control);
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_SPHP_FORCE_OUTPUT:
        {
            #if defined(CC_AUD_SX1_FEATURE) || defined (CC_MAPLE_CUST_DRV)
			if ((pv_set_info == NULL) || (z_size != sizeof(BOOL)))
			{
				LOG(2, "Invalid parameter (force SPHP output)\n");
				return RMR_INV_ARG;
			}			
			BOOL status = *((BOOL *)(pv_set_info));
		    ADAC_SpkHpLinkEnable(status);
            #endif
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_HDMI_HF_VSDB_INFO:
        {
            UINT8 u1HFVsdbInfo = 0;
            if ((pv_set_info == NULL) || (z_size != sizeof(UINT8)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_SET_HDMI_HF_VSDB_INFO invalid parameter\n");
                return RMR_INV_ARG;
            }
            u1HFVsdbInfo = (*(UINT8 *)pv_set_info);
            vHDMIEDIDSetHFVSDBFlag(&u1HFVsdbInfo);
            vHDMI_INTERNAL_EDID_Init();
            vHDMI2SetStateMachine(HDMI_SWITCH_1,HDMI_NOSIGNAL_STATE);
            vHDMI2SetStateMachine(HDMI_SWITCH_2,HDMI_NOSIGNAL_STATE);
            vHDMI2SetStateMachine(HDMI_SWITCH_3,HDMI_NOSIGNAL_STATE);
            vHDMI2SetStateMachine(HDMI_SWITCH_4,HDMI_NOSIGNAL_STATE);
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_POWER_TRIGGER_EX:
        {
            if ((pv_set_info == NULL) || (z_size != sizeof(UINT32)))
            {
                return RMR_INV_ARG;
            }
            UNUSED(CustomExtraWakeupTriggerEvent((UINT32 *)pv_set_info));
            break;
        }
		
		case DRV_CUSTOM_CUST_SPEC_SET_POWER_KEY:
        {
			DRV_CUSTOM_SET_POWER_KEY *sig_ptn_info = NULL;
		    UINT8 badd;
		    UINT32 bScanCode;
		    UINT32 bSircdCode;
		    UINT8 bSlotNum;
		    if ((pv_set_info == NULL) || (z_size != sizeof(DRV_CUSTOM_SET_POWER_KEY)))
            {
                return RMR_INV_ARG;
            }
			sig_ptn_info = (DRV_CUSTOM_SET_POWER_KEY *)pv_set_info;
		    badd = sig_ptn_info->badd;
		    bScanCode = sig_ptn_info->bScanCode;
		    bSircdCode = sig_ptn_info->bSircdCode;
		    bSlotNum = sig_ptn_info->bSlotNum;
			if(bSlotNum>16)
			{
                return RMR_INV_ARG; //1~16
			}
            UNUSED(CustomSetPowerKey(badd,bSlotNum,bSircdCode));
#ifndef CC_IGNORE_ANDROID_IR_TRUNCATE
			UNUSED(CustomSetPowerKeyScanCode(badd,bSlotNum,bScanCode));
#endif
            break;
        }
		case DRV_CUSTOM_CUST_SPEC_PH_EWBS_ON:
        {
            BOOL bEn = 0;
            if ((pv_set_info == NULL) || (z_size != sizeof(BOOL)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_PH_EWBS_ON invalid parameter\n");
                return RMR_INV_ARG;
            }
            bEn = (*(BOOL *)pv_set_info);
			CustomSetPhEwbsOn(bEn);
            break;
        }
#if defined(CC_HDMI_EARC_SUPPORT)&&!defined(CC_UBOOT)&&!defined(CC_MTK_LOADER)
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_EARC_ENABLE:
        {
            BOOL bEn = 0;
            if ((pv_set_info == NULL) || (z_size != sizeof(BOOL)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_SET_EARC_ENABLE invalid parameter\n");
                return RMR_INV_ARG;
            }
            bEn = (*(BOOL *)pv_set_info);
            u1HDMIEARCSetEnable(bEn);
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_EARC_TV_STATUS:
        {
            BOOL bTVStatus = 0;
            if ((pv_set_info == NULL) || (z_size != sizeof(BOOL)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_SET_EARC_TV_STATUS invalid parameter\n");
                return RMR_INV_ARG;
            }
            bTVStatus = (*(BOOL *)pv_set_info);
            u1HDMIEARCMenuSetTVStatus(bTVStatus);
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_EARC_BTHP_STATUS:
        {
            BOOL bBtHpStatus = 0;
            if ((pv_set_info == NULL) || (z_size != sizeof(BOOL)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_SET_EARC_BTHP_STATUS invalid parameter\n");
                return RMR_INV_ARG;
            }
            bBtHpStatus = (*(BOOL *)pv_set_info);
            u1HDMIEARCSetBtHpStatus(bBtHpStatus);
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_ARC_DD_PLUS_DDDP:
        {
            break;
        }
#else
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_ARC_DD_PLUS_DDDP:
        {
            UINT8 u1DDDP = 0;
            UINT8 u1LDDDP = 0;
            if ((pv_set_info == NULL) || (z_size != sizeof(UINT8)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_SET_ARC_DD_PLUS_DDDP invalid parameter\n");
                return RMR_INV_ARG;
            }
            u1DDDP = (*(UINT8 *)pv_set_info);
            vHDMIEDIDGetLDDDP(&u1LDDDP);
            if(u1DDDP != u1LDDDP)
            {
                vHDMIEDIDSetLDDDP(&u1DDDP);
                vHDMI_INTERNAL_EDID_Init();
                vHDMI2SetStateMachine(HDMI_SWITCH_1,HDMI_NOSIGNAL_STATE);
                vHDMI2SetStateMachine(HDMI_SWITCH_2,HDMI_NOSIGNAL_STATE);
                vHDMI2SetStateMachine(HDMI_SWITCH_3,HDMI_NOSIGNAL_STATE);
                vHDMI2SetStateMachine(HDMI_SWITCH_4,HDMI_NOSIGNAL_STATE);
            }
            break;
        }
#endif
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_HDMI_HPD_RTC_FLAG:
        {
            UINT8 u1HPDRTCFlag = 0;
            UINT32 u4Addr = 0;
            if ((pv_set_info == NULL) || (z_size != sizeof(UINT8)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_SET_HDMI_HPD_RTC_FLAG invalid parameter\n");
                return RMR_INV_ARG;
            }
            u1HPDRTCFlag = (*(UINT8 *)pv_set_info);
            if ((u4Addr = DRVCUST_InitGet(eHdmiHpdRTCToggle)) != 0x00)
            {
                EEPROM_Write((UINT64)u4Addr, (UPTR)(&u1HPDRTCFlag), 1);
                LOG(0,"SET_HDMI_HPD_RTC_FLAG, Addr:0x%x, Data:0x%x\n", u4Addr, u1HPDRTCFlag);
            }
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_CUST_AMP_TOGGLE_REFRESH:
        {
            if ((pv_set_info == NULL) || (z_size != sizeof(BOOL)))
            {
                LOG(2, "Invalid parameter (CUST AMP Toggle Refresh)\n");
                return RMR_INV_ARG;
            }
            BOOL status = *((BOOL *)pv_set_info);
            if(status){
                AUD_CUST_AMP_StartRefresh();
            }else{
                AUD_CUST_AMP_StopRefresh();
            }
            break;
        }
		////////////////////////////////////////////////////////////////////
		case DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_RHUE:
		{
			 if ((pv_set_info == NULL) || (z_size != sizeof(INT16)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_RHUE invalid parameter\n");
                return RMR_INV_ARG;
            }
			bufColorAdust.i2RHue= *(INT16*) pv_set_info;
			DRVCUST_SendEvent(E_CUST_COLOR_ADJUST_CHANGE, 0);
			break;
		}
		case DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_RSATURATION:
		{
			 if ((pv_set_info == NULL) || (z_size != sizeof(INT16)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_RSATURATION invalid parameter\n");
                return RMR_INV_ARG;
            }
			bufColorAdust.i2RSaturation= *(INT16*) pv_set_info;
			DRVCUST_SendEvent(E_CUST_COLOR_ADJUST_CHANGE, 0);
			break;
		}
		case DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_RBRIGHTNESS:
		{
			 if ((pv_set_info == NULL) || (z_size != sizeof(INT16)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_RBRIGHTNESS invalid parameter\n");
                return RMR_INV_ARG;
            }
			bufColorAdust.i2RBrightness= *(INT16*) pv_set_info;
			DRVCUST_SendEvent(E_CUST_COLOR_ADJUST_CHANGE, 0);
			break;
		}
		
		//////////////////////////////////////////////////////////////////////
		case DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_YEHUE:
		{
			 if ((pv_set_info == NULL) || (z_size != sizeof(INT16)))
			{
				LOG(2, "DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_YEHUE invalid parameter\n");
				return RMR_INV_ARG;
			}
			bufColorAdust.i2YeHue= *(INT16*) pv_set_info;
			DRVCUST_SendEvent(E_CUST_COLOR_ADJUST_CHANGE, 0);
			break;
		}
		case DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_YESATURATION:
		{
			 if ((pv_set_info == NULL) || (z_size != sizeof(INT16)))
			{
				LOG(2, "DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_YESATURATION invalid parameter\n");
				return RMR_INV_ARG;
			}
			bufColorAdust.i2YeSaturation= *(INT16*) pv_set_info;
			DRVCUST_SendEvent(E_CUST_COLOR_ADJUST_CHANGE, 0);
			break;
		}
		case DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_YEBRIGHTNESS:
		{
			 if ((pv_set_info == NULL) || (z_size != sizeof(INT16)))
			{
				LOG(2, "DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_YEBRIGHTNESS invalid parameter\n");
				return RMR_INV_ARG;
			}
			bufColorAdust.i2YeBrightness= *(INT16*) pv_set_info;
			DRVCUST_SendEvent(E_CUST_COLOR_ADJUST_CHANGE, 0);
			break;
		}

		//////////////////////////////////////////////////////////////////////
		case DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_GHUE:
		{
			 if ((pv_set_info == NULL) || (z_size != sizeof(INT16)))
			{
				LOG(2, "DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_GHUE invalid parameter\n");
				return RMR_INV_ARG;
			}
			bufColorAdust.i2GHue= *(INT16*) pv_set_info;
			DRVCUST_SendEvent(E_CUST_COLOR_ADJUST_CHANGE, 0);
			break;
		}
		case DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_GSATURATION:
		{
			 if ((pv_set_info == NULL) || (z_size != sizeof(INT16)))
			{
				LOG(2, "DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_GSATURATION invalid parameter\n");
				return RMR_INV_ARG;
			}
			bufColorAdust.i2GSaturation= *(INT16*) pv_set_info;
			DRVCUST_SendEvent(E_CUST_COLOR_ADJUST_CHANGE, 0);
			break;
		}
		case DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_GBRIGHTNESS:
		{
			 if ((pv_set_info == NULL) || (z_size != sizeof(INT16)))
			{
				LOG(2, "DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_GBRIGHTNESS invalid parameter\n");
				return RMR_INV_ARG;
			}
			bufColorAdust.i2GBrightness= *(INT16*) pv_set_info;
			DRVCUST_SendEvent(E_CUST_COLOR_ADJUST_CHANGE, 0);
			break;
		}

		//////////////////////////////////////////////////////////////////////
		case DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_CYHUE:
		{
			 if ((pv_set_info == NULL) || (z_size != sizeof(INT16)))
			{
				LOG(2, "DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_CYHUE invalid parameter\n");
				return RMR_INV_ARG;
			}
			bufColorAdust.i2CyHue= *(INT16*) pv_set_info;
			DRVCUST_SendEvent(E_CUST_COLOR_ADJUST_CHANGE, 0);
			break;
		}
		case DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_CYSATURATION:
		{
			 if ((pv_set_info == NULL) || (z_size != sizeof(INT16)))
			{
				LOG(2, "DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_CYSATURATION invalid parameter\n");
				return RMR_INV_ARG;
			}
			bufColorAdust.i2CySaturation= *(INT16*) pv_set_info;
			DRVCUST_SendEvent(E_CUST_COLOR_ADJUST_CHANGE, 0);
			break;
		}
		case DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_CYBRIGHTNESS:
		{
			 if ((pv_set_info == NULL) || (z_size != sizeof(INT16)))
			{
				LOG(2, "DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_CYBRIGHTNESS invalid parameter\n");
				return RMR_INV_ARG;
			}
			bufColorAdust.i2CyBrightness= *(INT16*) pv_set_info;
			DRVCUST_SendEvent(E_CUST_COLOR_ADJUST_CHANGE, 0);
			break;
		}

		//////////////////////////////////////////////////////////////////////
		case DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_BHUE:
		{
			 if ((pv_set_info == NULL) || (z_size != sizeof(INT16)))
			{
				LOG(2, "DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_BHUE invalid parameter\n");
				return RMR_INV_ARG;
			}
			bufColorAdust.i2BHue= *(INT16*) pv_set_info;
			DRVCUST_SendEvent(E_CUST_COLOR_ADJUST_CHANGE, 0);
			break;
		}
		case DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_BSATURATION:
		{
			 if ((pv_set_info == NULL) || (z_size != sizeof(INT16)))
			{
				LOG(2, "DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_BSATURATION invalid parameter\n");
				return RMR_INV_ARG;
			}
			bufColorAdust.i2BSaturation=*(INT16*) pv_set_info;
			DRVCUST_SendEvent(E_CUST_COLOR_ADJUST_CHANGE, 0);
			break;
		}
		case DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_BBRIGHTNESS:
		{
			 if ((pv_set_info == NULL) || (z_size != sizeof(INT16)))
			{
				LOG(2, "DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_BBRIGHTNESS invalid parameter\n");
				return RMR_INV_ARG;
			}
			bufColorAdust.i2BBrightness= *(INT16*) pv_set_info;
			DRVCUST_SendEvent(E_CUST_COLOR_ADJUST_CHANGE, 0);
			break;
		}

		//////////////////////////////////////////////////////////////////////
		case DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_MGHUE:
		{
			 if ((pv_set_info == NULL) || (z_size != sizeof(INT16)))
			{
				LOG(2, "DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_MGHUE invalid parameter\n");
				return RMR_INV_ARG;
			}
			bufColorAdust.i2MgHue= *(INT16*) pv_set_info;
			DRVCUST_SendEvent(E_CUST_COLOR_ADJUST_CHANGE, 0);
			break;
		}
		case DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_MGSATURATION:
		{
			 if ((pv_set_info == NULL) || (z_size != sizeof(INT16)))
			{
				LOG(2, "DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_MGSATURATION invalid parameter\n");
				return RMR_INV_ARG;
			}
			bufColorAdust.i2MgSaturation= *(INT16*) pv_set_info;
			DRVCUST_SendEvent(E_CUST_COLOR_ADJUST_CHANGE, 0);
			break;
		}
		case DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_MGBRIGHTNESS:
		{
			 if ((pv_set_info == NULL) || (z_size != sizeof(INT16)))
			{
				LOG(2, "DRV_CUSTOM_CUST_SPEC_COLOR_ADJUST_MGBRIGHTNESS invalid parameter\n");
				return RMR_INV_ARG;
			}
			bufColorAdust.i2MgBrightness= *(INT16*) pv_set_info;
			DRVCUST_SendEvent(E_CUST_COLOR_ADJUST_CHANGE, 0);
			break;
		}
        case DRV_CUSTOM_CUST_SPEC_TYPE_SET_MEMC_BYP_SETTING:
        {
            UINT8 u1MemcByp;
            if ((pv_set_info == NULL) || (z_size != sizeof(BOOL)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_SET_MEMC_BYP_SETTING invalid parameter\n");
                return RMR_INV_ARG;
            }

            u1MemcByp = (*(UINT8 *)pv_set_info);
#if 1
            //DRVCUST_SetMemcForceModeEnable(!u1MemcByp);
            DRVCUST_SetMemcBypassWithPath(u1MemcByp,E_CUST_D_INTF);
#else
            if(rApPicSetting.i2MotionFlowBypass != u1MemcByp)
            {
                rApPicSetting.i2MotionFlowBypass = u1MemcByp;
                DRVCUST_SendEvent(E_CUST_PIC_SETTING_CHANGE, 0);
            }
#endif
            LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_SET_MEMC_BYP_SETTING \n");

            break;
        }
        default:
            #ifdef DRV_3RD_PARTY_CUSTOM_CUST_SPEC_SET
            return DRV_3RD_PARTY_CUSTOM_CUST_SPEC_SET(e_cust_spec_type,
                                                      pv_set_info,
                                                      z_size,
                                                      b_store);
            #else
            i4_ret = RMR_INV_ARG;
            break;
            #endif
            
    }

    return i4_ret;
}
#endif  /* IMP_MAPLE_D_CUSTOM_C */

FUN_MACRO(INT32 d_maple_cust_spec_get (
    DRV_CUSTOM_CUST_SPEC_TYPE_T    e_cust_spec_type,
    VOID*                          pv_get_info,
    SIZE_T*                        pz_size
))
#ifdef IMP_MAPLE_D_CUSTOM_C
{
	//INT32 i4_val;
	//UINT16 i4_ret = 0;
	//UINT8 buff=0;

	INT32 i4_ret = RMR_OK;

	if ( e_cust_spec_type >= DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R00 && e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B56 )
    {
        UINT16 ui2_result = 0;
        if ( e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R56)
        {
            ui2_result = WB_PBM_CoefGet(0, e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R00);
            *((UINT16 *)(pv_get_info)) = ui2_result;
        }
        else if ( e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G56 )
        {
            ui2_result = WB_PBM_CoefGet(1, e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G00);
            *((UINT16 *)(pv_get_info)) = ui2_result;
        }
        else
        {
            ui2_result = WB_PBM_CoefGet(2, e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B00);
            *((UINT16 *)(pv_get_info)) = ui2_result;
        }
        return i4_ret;
    }
    if ( e_cust_spec_type >= DRV_CUSTOM_CUST_SPEC_TYPE_WB_GAM0_R_00 && e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_WB_GAM0_B_10 )
    {
        if ( e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_WB_GAM0_R_10)
        {
            *(UINT8*)(pv_get_info) = WB_TRACK_GAM0_RGB_GET(0, e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_WB_GAM0_R_00);
        }
        else if ( e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_WB_GAM0_G_10 )
        {
            *(UINT8*)(pv_get_info) = WB_TRACK_GAM0_RGB_GET(1, e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_WB_GAM0_G_00);
        }
        else
        {
            *(UINT8*)(pv_get_info) = WB_TRACK_GAM0_RGB_GET(2, e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_WB_GAM0_B_00);
        }
        return i4_ret;
    }
    if ( e_cust_spec_type >= DRV_CUSTOM_CUST_SPEC_TYPE_INP_LVL_WB_00 && e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_INP_LVL_WB_10 )
    {
        *(UINT16*)(pv_get_info) = WB_TRACK_INP_LVL_GET(e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_INP_LVL_WB_00);
        return i4_ret;
    }
    if ( e_cust_spec_type >= DRV_CUSTOM_CUST_SPEC_TYPE_WB_GAM_GAIN_00 && e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_WB_GAM_GAIN_10 )
    {
        *(UINT8*)(pv_get_info) = WB_TRACK_GAM_GAIN_GET(e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_WB_GAM_GAIN_00);
        return i4_ret;
    }
    if ( e_cust_spec_type >= DRV_CUSTOM_CUST_SPEC_TYPE_WB_OFST_R00 && e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_WB_OFST_B10 )
    {
        UINT16 ui2_result = 0;
        if ( e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_WB_OFST_R10)
        {
            *(UINT8*)(pv_get_info) = WB_TRACK_OFST_RGB_GET(0, e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_WB_OFST_R00);
        }
        else if ( e_cust_spec_type <= DRV_CUSTOM_CUST_SPEC_TYPE_WB_OFST_G10 )
        {
            *(UINT8*)(pv_get_info) = WB_TRACK_OFST_RGB_GET(1, e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_WB_OFST_G00);
        }
        else
        {
            *(UINT8*)(pv_get_info) = WB_TRACK_OFST_RGB_GET(2, e_cust_spec_type-DRV_CUSTOM_CUST_SPEC_TYPE_WB_OFST_B00);
        }
        return i4_ret;
    }
	
    switch (e_cust_spec_type)
    {
        case DRV_CUSTOM_CUST_SPEC_TYPE_GPIO_INPUT_STATUS:
        {			
          //((DRV_CUSTOM_GPIO_INPUT_TYPE_T *)pv_get_info)->ui1_gpio_input_status=GPIO_Input((INT32)((DRV_CUSTOM_GPIO_INPUT_TYPE_T *)pv_get_info)->ui1_gpio_input_id);
			break;
        }			        
        case DRV_CUSTOM_CUST_SPEC_GET_PANEL_INCH_SIZE:
        {
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(UINT32)))
            {
                LOG(2, "[DRV_CUSTOM_CUST_SPEC_GET_PANEL_INCH_SIZE] Invalid parameter\n");
                return RMR_DRV_ERROR;
            }
#ifdef CC_PANEL_FROM_FLASH
            *((UINT32 *)pv_get_info) = FlashPanel_GetInchSize();
#else
            *((UINT32 *)pv_get_info) = 40; //default value from flash panel
#endif
            break;      
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_LOGO_STATE:
        {
            DTVCFG_T rDtvCfg;
#ifdef CC_AUD_SETUP_MELODY
            UINT8 u1ActiveFlag = DRV_CUSTOM_LOGO_ACTIVE | DRV_CUSTOM_LOGO_MUSIC_ACTIVE;
#else
            UINT8 u1ActiveFlag = DRV_CUSTOM_LOGO_ACTIVE;            
#endif// MT5396_PORTING
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(UINT8)))
            {
                LOG(2, "[DRV_CUSTOM_CUST_SPEC_TYPE_LOGO_STATE] Invalid parameter\n");
                return RMR_DRV_ERROR;
            }

            if (EEPDTV_GetCfg(&rDtvCfg) == 0)
            {
                if (rDtvCfg.u1Flags2 & DTVCFG_FLAG2_DISABLE_LOGO)
                {
                    u1ActiveFlag &= ~DRV_CUSTOM_LOGO_ACTIVE;
                }
            }
#ifdef CC_AUD_SETUP_MELODY                
            if (!(bApiEepromReadByte(EEP_BOOT_MUSIC_ONOFF) & AUD_POWER_ON_MUSIC_MASK))
            {
                u1ActiveFlag &= ~DRV_CUSTOM_LOGO_MUSIC_ACTIVE;
            }
#endif// MT5396_PORTING            
            *((UINT8 *)pv_get_info) = u1ActiveFlag;
            
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_PQ_MURA_BKUP:
        {
            UINT32* mura_bkup = (UINT32*)(u4SWReg(0xba20));
            *(UINT32*)(pv_get_info) = (*mura_bkup & 0x18) >> 3;
            Printf("MURA_BKUP=%u maskingMura_Bkup=%u  status=%d\n", *mura_bkup,(*mura_bkup & 0x18)>>3,*(UINT32*)(pv_get_info));
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_PQ_CUC_BKUP:
        {
            UINT32* cuc_bkup = (UINT32*)(u4SWReg(0xba10));
            *(UINT32*)(pv_get_info) = (*cuc_bkup & 0x18) >> 3;
            Printf("CUC_BKUP=%u maskingCuc_Bkup=%u  status=%d\n", *cuc_bkup,(*cuc_bkup & 0x18)>>3,*(UINT32*)(pv_get_info));
            break;
        }
		case DRV_CUSTOM_CUST_SPEC_TYPE_PQ_MURA_TRANS:
		{
            UINT32* mura = (UINT32*)(u4SWReg(0xba20));
            *(UINT32*)(pv_get_info) = (*mura & 0x7);
            Printf("MURA_TRANS=%u maskingMura=%u  status=%d\n", *mura,(*mura & 0x7),*(UINT32*)(pv_get_info));
            break;
  
		}
		case DRV_CUSTOM_CUST_SPEC_TYPE_PQ_CUC_TRANS:
		{
            UINT32* cuc = (UINT32*)(u4SWReg(0xba10));
            *(UINT32*)(pv_get_info) = (*cuc & 0x7);
            Printf("CUC_TRANS=%u maskingCUC=%u  status=%d\n", *cuc,(*cuc & 0x7),*(UINT32*)(pv_get_info));
            break;

		}
        case DRV_CUSTOM_CUST_SPEC_TYPE_PQ_BU_FLASH:
        {
            UINT32* data = (UINT32*)(u4SWReg(0xba60));
            *(UINT32*)(pv_get_info) = (*data & 0x3);
            Printf("BU_FLASH:=%u status=%d\n", *data,*(UINT32*)(pv_get_info));
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_PQ_BU_TRANS:
        {
            UINT32* data = (UINT32*)(u4SWReg(0xba60));
            *(UINT32*)(pv_get_info) = (*data & 0xc) >> 2;
            Printf("BU_TRANS=%u status=%d\n", *data, *(UINT32*)(pv_get_info));
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_SOUND_SYSTEM:
	    {
            *(UINT16*)(pv_get_info) = (UINT16)AUD_DspGetTvSrcMode();
		    break;
        }	
        case DRV_CUSTOM_CUST_SPEC_TYPE_SOUND_DET_MODE:
	    {
             *(UINT16*)(pv_get_info) = (UINT16)DSP_GetAudChlInfo(AUD_DEC_AUX);
		    break;
        }	
        case DRV_CUSTOM_CUST_SPEC_TYPE_SOUND_SET_MODE:
        {
             *(UINT16*)(pv_get_info) = (UINT16)AUD_DspGetSoundMode(AUD_DEC_AUX);
		    break;
        }	
        case DRV_CUSTOM_AUD_GET_SURROUND_TYPE:
        {   E_CUST_AUD_SURROUND_TYPE eSurroundType;
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(E_CUST_AUD_SURROUND_TYPE)))
            {
                return RMR_INV_ARG;
            }
            if (gSoundSetting.eAutoSurround == E_CUST_AUD_AUTO_SURROUND_OFF)
            {
                eSurroundType = E_CUST_AUD_SURROUND_NONE;
            }
            else
            {
                //surround auto/on
                if (gSoundSetting.eSoundMode == E_CUST_AUD_SOUND_MODE_DOLBY)
                {
                    eSurroundType = E_CUST_AUD_SURROUND_DOLBY;
                }
                else
                {
                    eSurroundType = E_CUST_AUD_SURROUND_SONY;
                }
            }
            LOG(2, "set surround type:%d with soundmode:%d sound mode:%d\n",
                    eSurroundType, gSoundSetting.eAutoSurround, gSoundSetting.eSoundMode);
            *(E_CUST_AUD_SURROUND_TYPE *)pv_get_info = eSurroundType;
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_SOUND_MAIN_CARR_LVL:
	    {
		*(INT16*)(pv_get_info) = AudAtvMainCarrierLvlQuery();
		    break;
        }	
        case DRV_CUSTOM_CUST_SPEC_TYPE_SOUND_SUB_CARR_LVL:
	    {
		  *(INT16*)(pv_get_info) = AudAtvSubCarrierLvlQuery();
		    break;
        }		
        case DRV_CUSTOM_CUST_SPEC_TYPE_SOUND_CUE_LVL:
        {
		*(INT16*)(pv_get_info) = AudAtvPilotLvlQuery();
		    break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_SOUND_MAIN_NOISE_LVL:
	    {
		*(INT16*)(pv_get_info) = AudAtvMainNoiseLvlQuery();
		    break;
        }	
        case DRV_CUSTOM_CUST_SPEC_TYPE_SOUND_SUB_NOISE_LVL:
	    {
		  *(INT16*)(pv_get_info) = AudAtvSubNoiseLvlQuery();
		    break;
        }	
        case DRV_CUSTOM_CUST_SPEC_TYPE_SOUND_NICAM_ERROR:
        {
	      *(UINT32*)(pv_get_info) = AudAtvNicamErrorQuery();	  	
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_GET_TEMP_SENSOR_VALUE:
        {
            #ifdef CC_SAKURA_CUST_DRV
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(UINT32)))
            {
                LOG(2, "[DRV_CUSTOM_CUST_SPEC_GET_TEMP_SENSOR_VALUE] Invalid parameter\n");
                return RMR_INV_ARG;
            }
            
            *(UINT32 *)pv_get_info = CustomQueryTempRawData();
			#endif
            break;
        }

        case DRV_CUSTOM_CUST_SPEC_GET_LIGHT_SENSOR_VALUE:
        {
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(UINT32)))
            {
                LOG(2, "[DRV_CUSTOM_CUST_SPEC_GET_LIGHT_SENSOR_VALUE] Invalid parameter\n");
                return RMR_INV_ARG;
            }

            *(UINT32 *)pv_get_info = DRVCUST_GetIlluminance();
            break;
        }

        case DRV_CUSTOM_CUST_SPEC_TYPE_GET_ECS_CMD_FROM_KO:
        {
	#ifdef CC_MAPLE_CUST_DRV
					//DRV_CMD_TO_BE_IC_T rCmdFromBeIC;
					
					if ((pv_get_info == NULL) || (*(pz_size) != sizeof(DRV_ECS_CMD_TO_KO_T)))
					{
						LOG(2, "Invalid parameter\n");
						return RMR_INV_ARG;
					}
					//please implement be related function here
					((DRV_ECS_CMD_TO_KO_T *)pv_get_info)->u1ECSCmdSize = gu4EcsCommandReplySize;
					
					x_memcpy(((DRV_ECS_CMD_TO_KO_T *)pv_get_info)->u1ECSCmd, gu1EcsCommandReply, gu4EcsCommandReplySize);
			
	#endif
					break;				
			}	
		
        case DRV_CUSTOM_CUST_SPEC_WB_EDID_WRITE_STATUS:
        {
		#ifdef CC_MAPLE_CUST_DRV
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(UINT32)))
            {
                LOG(2, "[DRV_CUSTOM_CUST_SPEC_WB_EDID_WRITE_STATUS] Invalid parameter\n");
                return RMR_INV_ARG;
            }
            
            *(UINT32 *)pv_get_info = u4_WB_EDID_Write_return;
            break;
		#endif
        }

		case DRV_CUSTOM_CUST_SPEC_TYPE_GET_CMD_FROM_BEIC:
		{
	#ifdef CC_MAPLE_CUST_DRV
			UINT8 u1Size;
           // DRV_CMD_TO_BE_IC_T rCmdFromBeIC;
			
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(DRV_CMD_TO_BE_IC_T)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
            //please implement be related function here
            DRVCUST_GetBEGeneralData(((DRV_CMD_TO_BE_IC_T *)pv_get_info)->aui1Cmd,&u1Size);
			
			((DRV_CMD_TO_BE_IC_T *)pv_get_info)->u4Len = u1Size;
	#endif
            break;				
		}	

        case DRV_CUSTOM_CUST_SPEC_TYPE_GET_BT_DELAY_FROM_KO:
        {
#ifdef CC_MAPLE_CUST_DRV
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(D_AP_BT_DELAY_MODE)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
            (*(D_AP_BT_DELAY_MODE *)pv_get_info) = gBTDelay;
#endif
            break;
        }
#ifdef CC_MAPLE_CUST_DRV
        case DRV_CUSTOM_CUST_SPEC_TYPE_GET_GEN_PARAM_FROM_BEIC_KO:
        {
            UINT8 u1BeData[255] = {0};
            UINT8 u1PqData[255] = {0};
            UINT8 u1BeSize = 0;
            UINT8 u1PqSize = 0;

            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(DRV_GEN_PARAM_BE_KO_T)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }

            LOG(2, "rDataFromBeKO.u4Type0000 = %x---\n", ((DRV_GEN_PARAM_BE_KO_T *)pv_get_info)->u4Type);

            DRVCUST_GetBEGenParam(((DRV_GEN_PARAM_BE_KO_T *)pv_get_info)->u4Type, u1BeData, &u1BeSize);
            DRVCUST_GetPQGenParam(((DRV_GEN_PARAM_BE_KO_T *)pv_get_info)->u4Type, u1PqData, &u1PqSize);
            if ((u1BeSize == 0) && (u1PqSize == 0)) {
                LOG(1, "get gen param data NULL!!\n");
            } else if ((u1BeSize != 0) && (u1PqSize != 0)) {
                LOG(1, "get gen param type conflict!!\n");
            } else {
                if (u1BeSize != 0) {
                    LOG(1, "get BE--\n");
                    x_memcpy(((DRV_GEN_PARAM_BE_KO_T *)pv_get_info)->u1Data, u1BeData, u1BeSize);
                    ((DRV_GEN_PARAM_BE_KO_T *)pv_get_info)->u1Size = u1BeSize;
                }

                if (u1PqSize != 0) {
                    LOG(1, "get PQ---\n");
                    x_memcpy(((DRV_GEN_PARAM_BE_KO_T *)pv_get_info)->u1Data, u1PqData, u1PqSize);
                    ((DRV_GEN_PARAM_BE_KO_T *)pv_get_info)->u1Size = u1PqSize;
                }
                LOG(1, "u1Size is %d---\n", ((DRV_GEN_PARAM_BE_KO_T *)pv_get_info)->u1Size);
            }
        }
        break;
#endif

        case DRV_CUSTOM_CUST_SPEC_TYPE_GET_4K_TYPE:
		{
			UINT8 u1Is4KVideo;
			if((wDrvVideoInputHeight(SV_VP_MAIN) <= 1080) && (wDrvVideoInputWidth(SV_VP_MAIN) <= 1920)
				&&(wDrvVideoInputHeight(SV_VP_PIP) <= 1080) && (wDrvVideoInputWidth(SV_VP_PIP) <= 1920))
			{
				u1Is4KVideo = 0; 
			}
			else
			{
				u1Is4KVideo = 1; 
			}
            LOG(1,"\n get DRV_CUSTOM_CUST_SPEC_TYPE_GET_4K_TYPE Done(%d)!\n",u1Is4KVideo);
            *((UINT8 *)(pv_get_info)) = u1Is4KVideo;

			break;
		}

        case DRV_CUSTOM_CUST_SPEC_GET_BEPQ_SCREEN_INFO_FROM_AP:
		{
			#ifdef CC_MAPLE_CUST_DRV
            CUST_SCREEN_SETTING_T rScreenInfoFromAP;
			
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(DRV_AP_SCREEN_SETTING_T)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
            BEPQ_AP_Get_WideMode_Setting(&rScreenInfoFromAP);
            LOG(1,"Set DRV_CUSTOM_CUST_SPEC_GET_BEPQ_SCREEN_INFO_FROM_AP Done!\n");

            ((DRV_AP_SCREEN_SETTING_T *)pv_get_info)->eWideMode = (D_AP_WIDE_MODE)(rScreenInfoFromAP.eWideMode);
			((DRV_AP_SCREEN_SETTING_T *)pv_get_info)->eDisplayArea = (D_AP_WIDE_DISPLAY_AREA)(rScreenInfoFromAP.eDisplayArea);
			((DRV_AP_SCREEN_SETTING_T *)pv_get_info)->i2HCenter = (INT16)(rScreenInfoFromAP.i2HCenter);
			((DRV_AP_SCREEN_SETTING_T *)pv_get_info)->i2VCenter = (INT16)(rScreenInfoFromAP.i2VCenter);
			((DRV_AP_SCREEN_SETTING_T *)pv_get_info)->i2VerticalSize = (INT16)(rScreenInfoFromAP.i2VerticalSize);
			((DRV_AP_SCREEN_SETTING_T *)pv_get_info)->eZoom = (D_AP_WIDE_ZOOM)(rScreenInfoFromAP.eZoom);	
			((DRV_AP_SCREEN_SETTING_T *)pv_get_info)->ePcWIdeMode = (D_AP_WIDE_PC_WIDE_MODE)(rScreenInfoFromAP.ePcWIdeMode);	
			((DRV_AP_SCREEN_SETTING_T *)pv_get_info)->i2PcPhase = (INT16)(rScreenInfoFromAP.i2PcPhase);
			((DRV_AP_SCREEN_SETTING_T *)pv_get_info)->i2PcPitch = (INT16)(rScreenInfoFromAP.i2PcPitch);
			((DRV_AP_SCREEN_SETTING_T *)pv_get_info)->i2PcHCenter = (INT16)(rScreenInfoFromAP.i2PcHCenter);
			((DRV_AP_SCREEN_SETTING_T *)pv_get_info)->i2PcVCenter = (INT16)(rScreenInfoFromAP.i2PcVCenter);
			#endif
			break;
        }
		
		case DRV_CUSTOM_CUST_SPEC_TYPE_GET_ORI_HDR_TYPE:
		{
		#ifdef CC_MAPLE_CUST_DRV
			D_HDR_TYPE_MODE eHDRType;
		
			if ((pv_get_info == NULL) || (*(pz_size) != sizeof(D_HDR_TYPE_MODE)))
			{
				LOG(2, "Invalid parameter\n");
				return RMR_INV_ARG;
			}
		
			eHDRType = DRVCUST_GetOriHDRType();
			*((D_HDR_TYPE_MODE *)(pv_get_info)) = eHDRType;
			
		#endif
			break;			
		}
#if 1//def CC_Factory2K12
        case DRV_CUSTOM_CUST_SPEC_TYPE_GET_HDMI_HPD_INFOFRAME:
        {
            HDMI_IF_INFOFRAME tHpdInfoData;
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(DRV_HPD_INFOFRAME_T)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
			fgHdmiIf_GetInfoframe(SV_VP_MAX,HDMI_IF_InfoFrame_SPD,&tHpdInfoData);
            if(0 != tHpdInfoData.HDMI_FrameSize)
            {
                x_memcpy(pv_get_info,(void*)&(tHpdInfoData.HDMI_FrameData),sizeof(DRV_HPD_INFOFRAME_T));							
            }
            else
            {
                //error
                return RMR_DRV_ERROR;
            }
            break;							
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_HDMI_EDID:
        {
            #if 0
            INT32 i4_val;
            //Factory2K12Debug(c_sprintf(fact_dbg_buf,"ui1_hdmi_comp_id (%x)\n",(((MISC_TYPE_HDMI_EDID_T *)pv_get_info)->ui1_hdmi_comp_id)));
            i4_val = SifEDIDRead((((MISC_TYPE_HDMI_EDID_T *)pv_get_info)->ui1_hdmi_comp_id), 256, 0xA0, 0, (((MISC_TYPE_HDMI_EDID_T *)pv_get_info)->aui1_edid_buf));
            if ( i4_val < RMR_OK )			  
            {				 
                return -1;			  
            }
            #endif
            break;					 
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_HDMI_HDCP:
        {
            MISC_TYPE_HDMI_HDCP_T *p_hdmi_hdcp = (MISC_TYPE_HDMI_HDCP_T*)pv_get_info;
            if(EEPHDMI20HDCP14_Read(p_hdmi_hdcp->aui1_hdcp_buf, p_hdmi_hdcp->u2_length))  /* Read 320+20 bytes of HDCP key*/
            {
                return RMR_DRV_ERROR;
            }
            break;
        }
        #ifdef SYS_MHL_SUPPORT
        case DRV_CUSTOM_CUST_SPEC_TYPE_GET_MHL_STATUS:
        {
            UINT8 Status;
            #if defined(CC_MT5890)
            Status = (UINT8)fgGetMHLStatus();
            #else
            Status = 0;
            #endif
            *((UINT8 *)(pv_get_info)) = Status;
            break;
        }
        #endif

        case DRV_CUSTOM_CUST_SPEC_TYPE_HDCP2X_RW:
        {
            MISC_TYPE_HDCP2x_T *param = (MISC_TYPE_HDCP2x_T *)pv_get_info;
            UINT16 Off_s = 0; 
            i4_ret = 0;
            memset(buf_HDCP2x, 0, sizeof(buf_HDCP2x));

			if((param->u2_offset >= 0x800)&&(param->u2_offset < 0x1000))  //HDMI 
            {
                if (EEPHDMI20HDCP22_Read((UINT32)buf_HDCP2x, 880))
            	{
            		i4_ret = -1;
                    return RMR_DRV_ERROR;
            	}
                if(i4_ret ==0)
                {
                    x_memcpy(param->aui1_hdcp2x_buf, &buf_HDCP2x, param->u2_length);
                }
            }
            else if(param->u2_offset >= 0x1000) //WIFI
            {
                if(EEPHDCP2x_Read(0x1000,(UINT32)buf_HDCP2x,880))	
                {
                    i4_ret = -1;
                    return RMR_DRV_ERROR;
                } 
                if(i4_ret ==0)
                {
                    x_memcpy(param->aui1_hdcp2x_buf, &buf_HDCP2x, param->u2_length);
                }
            }
			else
			{
                 //
			}
        }
        break;

						case DRV_CUSTOM_CUST_SPEC_TYPE_GET_TUNER_DETECTION_INFO:
						{
			                            #ifdef CC_MAPLE_CUST_DRV
                                                    D_TUNER_DET_INFO rTunerDetInfo;
						    INT32 i4GpioPolarity;
						    UINT32 u4AdPortValue;
						    if ((pv_get_info == NULL) || (*(pz_size) != sizeof(D_TUNER_DET_INFO)))
						    {
                                                      LOG(2, "Invalid parameter\n");
                                                      return RMR_INV_ARG;
                                                    }

						    u4AdPortValue =  PDWNC_ReadServoADCChannelValue(6);
						    i4GpioPolarity= GPIO_GetIn(244);
                                                    Printf("DRV_CUSTOM_CUST_SPEC_TYPE_GET_TUNER_DETECTION_INFO(Gpio/Ad)(%d/%d)!\n",i4GpioPolarity,u4AdPortValue);
						    ((D_TUNER_DET_INFO *)pv_get_info)->i4GPIOStatus = i4GpioPolarity;
						    ((D_TUNER_DET_INFO *)pv_get_info)->u4ADValues = u4AdPortValue;
			                            #endif
						    break;
			                        }
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_WBT_IDX:
						{
							Factory2K12Debug(c_sprintf(fact_dbg_buf,"-- sony_d_custom, get(%x) --\n",0));
							UINT16 ui2_result = WB_PBM_ColorTempIdxGet();
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_ADJ_METHOD:
						{
							UINT16 ui2_result = WB_PBM_WBAdjustMethodGet();
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_EASY_SET_LVL:
						{
							UINT16 ui2_result = WB_PBM_EasySetPatternLevelGet();
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_EASY_SET_EN:
						{
							UINT16 ui2_result = WB_PBM_EasySetPatternEnableGet();
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_Y_SUM_POS:
						{
						    UINT16 ui2_result = WB_PBM_YSumPosGet();
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_Y_SUM_MEAS:
						{
							UINT16 ui2_result = WB_PBM_YSumMeasGet();
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_PIXEL_POS:
						{
							UINT16 ui2_result = WB_PBM_YSumPixelPosGet();
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_PIXEL_MEAS_Y:
						{
							UINT16 ui2_result = WB_PBM_PixelMeasYGet();
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_PIXEL_MEAS_CB:
						{
							UINT16 ui2_result = WB_PBM_PixelMeasCBGet();
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_PIXEL_MEAS_CR:
						{
							UINT16 ui2_result = WB_PBM_PixelMeasCRGet();
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_ON:
						{
							UINT16 ui2_result = WB_PBM_LutAdjOnGet();
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_WBT_IDX_CHANGE_STS:
						{
							UINT16 ui2_result = WB_PBM_WBTIdxChangeStsGet();
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_INP_EASY_SET_R:
						{
							UINT16 ui2_result = WB_PBM_InpEasySetRGet();
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_INP_EASY_SET_G:
						{
							UINT16 ui2_result = WB_PBM_InpEasySetGGet();
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_INP_EASY_SET_B:
						{
							UINT16 ui2_result = WB_PBM_InpEasySetBGet();
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R00:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 0);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R01:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 1);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R02:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 2);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R03:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 3);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R04:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 4);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R05:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 5);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R06:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 6);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R07:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 7);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R08:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 8);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R09:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 9);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R10:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 10);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R11:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 11);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R12:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 12);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R13:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 13);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R14:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 14);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R15:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 15);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R16:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 16);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R17:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 17);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R18:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 18);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R19:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 19);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R20:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 20);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R21:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 21);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R22:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 22);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R23:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 23);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R24:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 24);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R25:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 25);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R26:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 26);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R27:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 27);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R28:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 28);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R29:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 29);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R30:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 30);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R31:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 31);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R32:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 32);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R33:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 33);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R34:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 34);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R35:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 35);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R36:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 36);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R37:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 37);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R38:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 38);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R39:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 39);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R40:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 40);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R41:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 41);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R42:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 42);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R43:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 43);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R44:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 44);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R45:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 45);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R46:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 46);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R47:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 47);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R48:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 48);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R49:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 49);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R50:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 50);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
            case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R51:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 51);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R52:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 52);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R53:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 53);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R54:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 54);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R55:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 55);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_R56:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(0, 56);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G00:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 0);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G01:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 1);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G02:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 2);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G03:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 3);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G04:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 4);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G05:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 5);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G06:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 6);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G07:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 7);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G08:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 8);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G09:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 9);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G10:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 10);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G11:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 11);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G12:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 12);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G13:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 13);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G14:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 14);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G15:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 15);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G16:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 16);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G17:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 17);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G18:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 18);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G19:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 19);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G20:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 20);
							*((UINT32 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G21:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 21);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G22:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 22);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G23:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 23);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G24:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 24);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G25:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 25);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G26:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 26);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G27:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 27);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G28:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 28);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G29:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 29);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G30:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 30);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G31:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 31);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G32:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 32);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G33:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 33);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G34:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 34);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G35:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 35);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G36:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 36);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G37:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 37);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G38:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 38);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G39:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 39);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G40:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 40);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G41:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 41);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G42:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 42);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G43:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 43);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G44:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 44);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G45:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 45);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G46:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 46);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G47:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 47);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G48:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 48);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G49:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 49);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G50:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 50);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G51:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 51);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G52:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 52);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G53:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 53);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
					  case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G54:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 54);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G55:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 55);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
					  case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_G56:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(1, 56);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B00:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 0);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B01:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 1);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B02:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 2);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B03:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 3);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B04:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 4);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B05:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 5);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B06:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 6);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B07:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 7);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B08:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 8);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B09:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 9);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B10:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 10);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B11:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 11);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B12:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 12);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B13:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 13);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B14:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 14);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B15:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 15);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B16:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 16);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B17:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 17);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B18:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 18);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B19:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 19);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B20:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 20);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B21:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 21);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B22:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 22);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B23:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 23);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B24:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 24);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B25:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 25);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B26:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 26);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B27:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 27);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B28:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 28);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B29:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 29);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B30:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 30);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B31:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 31);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B32:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 32);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
            case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B33:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 33);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B34:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 34);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B35:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 35);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B36:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 36);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B37:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 37);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B38:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 38);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B39:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 39);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B40:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 40);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B41:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 41);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B42:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 42);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B43:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 43);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B44:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 44);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B45:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 45);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B46:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 46);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B47:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 47);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B48:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 48);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B49:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 49);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B50:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 50);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B51:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 51);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B52:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 52);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B53:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 53);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B54:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 54);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B55:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 55);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_LUT_ADJ_B56:
						{
							UINT16 ui2_result = WB_PBM_CoefGet(2, 56);
							*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						
                        case DRV_CUSTOM_CUST_SPEC_TYPE_WB_GAM_SEL:
                        {
                           
                           break;
                        }

                        case DRV_CUSTOM_CUST_SPEC_TYPE_WB_BASE_GAIN_R:
                        {
                            *(UINT8*)(pv_get_info) = WB_TRACK_BASE_GAIN_RGB_GET(0);
                            break;
                        }
                        case DRV_CUSTOM_CUST_SPEC_TYPE_WB_BASE_GAIN_G:
                        {
                            *(UINT8*)(pv_get_info) = WB_TRACK_BASE_GAIN_RGB_GET(1);
                            break;
                        }
                        case DRV_CUSTOM_CUST_SPEC_TYPE_WB_BASE_GAIN_B:
                        {
                            *(UINT8*)(pv_get_info) = WB_TRACK_BASE_GAIN_RGB_GET(2);
                            break;
                        }
                        case DRV_CUSTOM_CUST_TYPE_WB_TEST_PTN:
                        {
                            //*(DRV_WB_TEST_PTN*)(pv_get_info) = DRVCUST_GetWBTestPtnOnOff();
                            break;
                        }
                        case DRV_CUSTOM_CUST_SPEC_TYPE_EEP_WB_GAM0_RGB:
                        {
                           //*(UINT8*)(pv_get_info)= DRVCUST_GET_WB_GAM(((DRV_EEP_WB_GAM0_RGB*)pv_get_info)->u1Channel,
                                                                                            //((DRV_EEP_WB_GAM0_RGB*)pv_get_info)->u1Levle);
                            break;
                        }
                        case DRV_CUSTOM_CUST_SPEC_TYPE_EEP_INP_LVL_WB:
                        {
                            //((DRV_EEP_INP_LVL_WB*)pv_get_info)->u2Value = DRVCUST_GET_INP_LVL_WB(((DRV_EEP_INP_LVL_WB*)pv_get_info)->u1Levle);
                            break;
                        }
                        case DRV_CUSTOM_CUST_SPEC_TYPE_EEP_WB_GAM_GAIN:
                        {
                            //((DRV_EEP_WB_GAM_GAIN*)pv_get_info)->u1Value = DRVCUST_GET_INP_LVL_WB(((DRV_EEP_WB_GAM_GAIN*)pv_get_info)->u1Levle);
                            break;
                        }
                        case DRV_CUSTOM_CUST_SPEC_TYPE_EEP_WB_BASE_GAIN_RGB:
                        {
                            //((DRV_EEP_WB_BASE_GAIN_RGB*)pv_get_info)->u1Value = DRVCUST_GET_WB_BASE_GAIN(((DRV_EEP_WB_BASE_GAIN_RGB*)pv_get_info)->u1ColorTemp,
                                                                                                        //((DRV_EEP_WB_BASE_GAIN_RGB*)pv_get_info)->u1Channel);
                            break;
                        }
                        case DRV_CUSTOM_CUST_SPEC_TYPE_EEP_WB_OFST_RGB:
                        {
                            //((DRV_EEP_WB_OFST_RGB*)pv_get_info)->u1Value = DRVCUST_GET_WB_OFST(((DRV_EEP_WB_OFST_RGB*)pv_get_info)->u1ColorTemp,
                                                                                                //((DRV_EEP_WB_OFST_RGB*)pv_get_info)->u1Channel,
                                                                                                //((DRV_EEP_WB_OFST_RGB*)pv_get_info)->u1Levle);
                            break;
                        }

                        case DRV_CUSTOM_CUST_SPEC_TYPE_WBADJ_GODID:
                        {
                           *(UINT8*)(pv_get_info) = DRVCUST_GET_WBADJ_GODID_EEP();
                           break;
                        }
                        case DRV_CUSTOM_CUST_SPEC_TYPE_WBADJ_PON_TIME:
                        {
                           *(UINT8*)(pv_get_info) = DRVCUST_GET_WBADJ_PON_TIME_EEP();
                           break;
                        }
                        case DRV_CUSTOM_CUST_SPEC_TYPE_WBADJ_JIG_VER:
                        {
                           *(UINT16*)(pv_get_info) = DRVCUST_GET_WBADJ_JIG_VER_EEP();
                           break;
                        }
                        case DRV_CUSTOM_CUST_SPEC_TYPE_WBADJ_DS_DATE:
                        {
                           *(UINT16*)(pv_get_info) = DRVCUST_GET_WBADJ_DS_DATE_EEP();
                           break;
                        }
                        case DRV_CUSTOM_CUST_SPEC_TYPE_WBADJ_ADJ_DATE:
                        {
                           *(UINT16*)(pv_get_info) = DRVCUST_GET_WBADJ_ADJ_DATE_EEP();
                           break;
                        }
                        case DRV_CUSTOM_CUST_SPEC_TYPE_WBADJ_AGING1:
                        {
                           *(UINT16*)(pv_get_info) = DRVCUST_GET_WBADJ_AGING1_EEP();
                           break;
                        }
                        case DRV_CUSTOM_CUST_SPEC_TYPE_WBADJ_AGING2:
                        {
                           *(UINT16*)(pv_get_info) = DRVCUST_GET_WBADJ_AGING2_EEP();
                           break;
                        }
                        case DRV_CUSTOM_CUST_SPEC_TYPE_WBADJ_JIG_INFO1:
                        {
                           *(UINT16*)(pv_get_info) = DRVCUST_GET_WBADJ_JJG_INFO1_EEP();
                           break;
                        }
                        case DRV_CUSTOM_CUST_SPEC_TYPE_WBADJ_JIG_INFO2:
                        {
                           *(UINT16*)(pv_get_info) = DRVCUST_GET_WBADJ_JJG_INFO2_EEP();
                           break;
                        }
                        case DRV_CUSTOM_CUST_SPEC_TYPE_WB_INFO0:
                        {
                           *(UINT16*)(pv_get_info) = DRVCUST_GET_WB_INFO0_EEP();
                           break;
                        }
                        case DRV_CUSTOM_CUST_SPEC_TYPE_WB_INFO1:
                        {
                           *(UINT16*)(pv_get_info) = DRVCUST_GET_WB_INFO1_EEP();
                           break;
                        }
                        case DRV_CUSTOM_CUST_SPEC_TYPE_WB_INFO2:
                        {
                           *(UINT16*)(pv_get_info) = DRVCUST_GET_WB_INFO2_EEP();
                           break;
                        }
                        case DRV_CUSTOM_CUST_SPEC_TYPE_WB_INFO3:
                        {
                           *(UINT16*)(pv_get_info) = DRVCUST_GET_WB_INFO3_EEP();
                           break;
                        }
                        case DRV_CUSTOM_CUST_SPEC_TYPE_WB_INFO4:
                        {
                           *(UINT16*)(pv_get_info) = DRVCUST_GET_WB_INFO4_EEP();
                           break;
                        }
                        case DRV_CUSTOM_CUST_SPEC_TYPE_PGAM_EN:
                        {
                        	*(UINT8*)(pv_get_info) = DRVCUST_GetPGAM_EN();
                        	break;
                        }

                        case DRV_CUSTOM_CUST_SPEC_TYPE_U_WB_FLAT:
                        {
                        	*(UINT8*)(pv_get_info) = DRVCUST_GetUWBFLAT();
                        	break;
                        }

						case DRV_CUSTOM_CUST_SPEC_TYPE_AGING_LAST_POWER_CONTROL:
						{
							//UINT16 ui2_result = AgingLastPowerControlState_Get();
							//*((UINT16 *)(pv_get_info)) = ui2_result;
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_ACFG_UPDATE_GET:
						{
							UINT16 ui2_acfg_update = Sony_WB_Acfg_Update_Get(); 
							*((UINT16 *)(pv_get_info)) = ui2_acfg_update;
							//Sony_WB_Acfg_Update_Set(0);
							break;
						}
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_UPDATE_ADJ_CLR_IDX_GET:
						{
							UINT16 ui2_clr_temp_update_idx = Sony_WB_Update_ADJ_CLR_IDX_Get();
							*((UINT16 *)(pv_get_info)) = ui2_clr_temp_update_idx;
							break;
						}				
						case DRV_CUSTOM_CUST_SPEC_TYPE_WB_UPDATE_PARM_GET:
						{
							#if 1
							UINT16 ui2_clr_temp_idx=0;
							WB_CLR_TEMP_DATA_T wb_data;
		
							ui2_clr_temp_idx = ((WB_CLR_TEMP_DATA_GET_T *)pv_get_info)->ui2ClrTempIdx;
												
							wb_data = Sony_WB_Update_PARM_Get(ui2_clr_temp_idx);
		
							((WB_CLR_TEMP_DATA_GET_T *)pv_get_info)->wClrTempData.wRGain = wb_data.wRGain;
							((WB_CLR_TEMP_DATA_GET_T *)pv_get_info)->wClrTempData.wGGain = wb_data.wGGain;
							((WB_CLR_TEMP_DATA_GET_T *)pv_get_info)->wClrTempData.wBGain = wb_data.wBGain;
							((WB_CLR_TEMP_DATA_GET_T *)pv_get_info)->wClrTempData.wROfst = wb_data.wROfst;
							((WB_CLR_TEMP_DATA_GET_T *)pv_get_info)->wClrTempData.wGOfst = wb_data.wGOfst;
							((WB_CLR_TEMP_DATA_GET_T *)pv_get_info)->wClrTempData.wBOfst = wb_data.wBOfst;
							//*((WB_CLR_TEMP_DATA_T *)(pv_get_info)) = ui2_acfg_update;
							//Sony_WB_Acfg_Update_Set(0);
							#endif
							break;
						}
#endif

#if 1//def APP_LCCT_2H //lcct_2H
                case DRV_CUSTOM_CUST_SPEC_TYPE_GET_COLOR_PICKUP:
                {
                    #ifdef CC_MAPLE_CUST_DRV
					UINT16 u2Val[3];
					UINT32 u4Val=0, u4BeType=0;
					UINT8  u1HasBE=SV_FALSE;
					
                    if ((pv_get_info == NULL) || (*(pz_size) != sizeof(DRV_CUSTOM_COLOR_PICKUP)))
                    {
                        LOG(2, "Invalid parameter\n");
                        return RMR_INV_ARG;
                    }
					
                    //please implement be related function here

					UNUSED(DRVCUST_InitQuery(eGet2KModelSupport, &u4Val));
					UNUSED(DRVCUST_InitQuery(eGet4KModelBEType, &u4BeType));
					//BIT0: (0/1) (2K/4K)
					if (((u4Val&0x00000003)==0x00000000) || (u4BeType==0))
					{
                        u1HasBE = SV_FALSE;
					}
					else
					{
                        u1HasBE = SV_TRUE;
					}
					
					if (!u1HasBE)
					{
						vDrvOsDbgInfo(gu2Pick_x, gu2Pick_y, u2Val);

						((DRV_CUSTOM_COLOR_PICKUP *)pv_get_info)->get.ui2_r = u2Val[0];
						((DRV_CUSTOM_COLOR_PICKUP *)pv_get_info)->get.ui2_g = u2Val[1];
						((DRV_CUSTOM_COLOR_PICKUP *)pv_get_info)->get.ui2_b = u2Val[2];
					}
					else
					{
						DRVCUST_GetColorPickData(((DRV_CUSTOM_COLOR_PICKUP *)pv_get_info)->get.ui2_r,
												((DRV_CUSTOM_COLOR_PICKUP *)pv_get_info)->get.ui2_g,
												((DRV_CUSTOM_COLOR_PICKUP *)pv_get_info)->get.ui2_b);
					}
                    #endif
                    break;				
                }			
		
				case DRV_CUSTOM_CUST_SPEC_V_COM_DRV:
				{		
					#if 0					
					DRV_CUSTOM_VCOM_ST *pVcomParam = (DRV_CUSTOM_VCOM_ST *)pv_get_info; 					
					UINT8	u1Data; 				
					UINT16 ui2_result = 0;					

					if(pVcomParam->vcom_type == SDCVCOM)	  
					{						
						ui2_result = 123;						
						GPIO_SetOut(85,1);//DRV_CUSTOM_CUST_SPEC_V_COM_DRV							
						SIF_TunerReadNoSubAddr(0x100,0x9e,&u1Data,1);
						GPIO_SetOut(85,0);							
						ui2_result = (UINT16)u1Data >> 1; //(u1Data & 0xFE) >> 1;						
						*((UINT16 *)(pVcomParam->vcom_value)) = ui2_result; 					
					}					

					if(pVcomParam->vcom_type == LGDVCOM)
					{ 
						GPIO_SetOut(85,1);//DRV_CUSTOM_CUST_SPEC_V_COM_DRV
						SIF_X_Read(1, 0x100, 0x40, 1, 0x15,&u1Data, 1); 
						ui2_result = u1Data << 8;
						SIF_X_Read(1, 0x100, 0x40, 1, 0x16,&u1Data, 1);
						ui2_result |= u1Data;	  
					}					

					*((UINT16 *)(pVcomParam->vcom_value)) = ui2_result;
                    #endif
					break;					
				}		
				
				case DRV_CUSTOM_CUST_SPEC_WB_EDID_WRITE:
				{
					UINT16 ui2_result = 123;
					Factory2K12Debug(c_sprintf(fact_dbg_buf,"-- DRV_CUSTOM_CUST_SPEC_TYPE_TEST_PTN_RAMP, set(%x) --\n",(*((UINT16*)pv_set_info))));
					
					ui2_result = 123;
					*((UINT32 *)(pv_get_info)) = ui2_result;
					break;
				}	
				
				case DRV_CUSTOM_CUST_SPEC_MICRO_OPTION_RMVB:
				{
					//UINT16 ui2_result = 0;
					//ui2_result = (UINT16)IS_SupportRM();
					//*((UINT32 *)(pv_get_info)) = ui2_result;
					break;
				}
		
				case DRV_CUSTOM_CUST_SPEC_GET_GAMMA_SETUP:
				{
					UINT16 Val;
				
					Val = (UINT16)Sony_GammaSetup_Read();
					*((UINT16 *)(pv_get_info)) = Val;
					break;			
				}
						
				case DRV_CUSTOM_CUST_SPEC_TYPE_GAMMA_PTN_REFRESH:
				{
					#if 0
					Luma_RGB_T LUMA_RGB;
					
					LUMA_RGB = Sony_GammaPatternRGB_Read();
					((GAMMA_PTN_RGB_T *)pv_get_info)->LUMA_R = LUMA_RGB.Luma_R;
					((GAMMA_PTN_RGB_T *)pv_get_info)->LUMA_G = LUMA_RGB.Luma_G;
					((GAMMA_PTN_RGB_T *)pv_get_info)->LUMA_B = LUMA_RGB.Luma_B;
		            #endif
					break;
				}				
				case DRV_CUSTOM_CUST_SPEC_TYPE_GAMMA_PTN_GET_LVL:
				{
					#if 1
					UINT16 Val;
				
					Val = Sony_GammaReadLvl(Current_Gamma_RGB,Current_Luma_Lvl);
					*((UINT16 *)(pv_get_info)) = Val;
					#endif
					break;
				}		
				case DRV_CUSTOM_CUST_SPEC_TYPE_WBS_TO_NVM_GET:
				{
					#if 1
					UINT16 Val;
		
					Val= Sony_WBReadData(Current_Wbs_Nvm_Env.CLRIDX, Current_Wbs_Nvm_Env.WBLVL, Current_Wbs_Nvm_Env.GAMMA);
					*((UINT16 *)(pv_get_info)) = Val;
					#endif
					break;
				}		
				case DRV_CUSTOM_CUST_SPEC_TYPE_GAMMA_SETUP_STATUS_GET:
				{
					#if 1
					UINT16 Val;
				
					Val = (UINT16)Sony_GammaSetup_Read();
					*((UINT16 *)(pv_get_info)) = Val;
					#endif
					break;
				}
				case DRV_CUSTOM_CUST_SPEC_TYPE_GAMMA_GET_SELECT_LVL:
				{
					#if 1
					UINT16 Val;
				
					Val = (UINT16)Sony_GammaSelectLvl_Read();
					*((UINT16 *)(pv_get_info)) = Val;
					#endif
					break;
				}
				case DRV_CUSTOM_CUST_SPEC_TYPE_WB_CLRIDX_GET:
				{
					#if 1
					UINT16 Val;
		
					Val = (UINT16)Sony_WBReadColor();
					*((UINT16 *)(pv_get_info)) = Val;
					#endif
					break;
				}
				case DRV_CUSTOM_CUST_SPEC_TYPE_WB_WBLVL_GET:
				{
					#if 1
					UINT16 Val;
		
					Val = (UINT16)Sony_WBReadLvl();
					*((UINT16 *)(pv_get_info)) = Val;
					#endif
					break;
				}
				case DRV_CUSTOM_CUST_SPEC_TYPE_WB_GAIN_GET:
				{
					#if 1
					D_AUTOWB_GAIN_MODE GainMode;
					D_AUTOWB_RGB	   RgbType;
			UINT16 Val=0;
		
					GainMode = (((WB_AUTO_GAIN_T *)pv_get_info)->AutoWbMode);
					RgbType  = (((WB_AUTO_GAIN_T *)pv_get_info)->AutoWbRgb);
		
					switch(RgbType)
					{
						case AUTOWB_R:
							if(GainMode == DELTA_MODE) {
								Val = Sony_AutoWB_GetGain(DELTA_GAIN,GAMMA_R);
							} else {
								Val = Sony_AutoWB_GetGain(FINAL_GAIN,GAMMA_R);
							}
							break;				  
						case AUTOWB_G:
							if(GainMode == DELTA_MODE) {
								Val = Sony_AutoWB_GetGain(DELTA_GAIN,GAMMA_G);
							} else {
								Val = Sony_AutoWB_GetGain(FINAL_GAIN,GAMMA_G);
							}
							break;				  
						case AUTOWB_B:
							if(GainMode == DELTA_MODE) {
								Val = Sony_AutoWB_GetGain(DELTA_GAIN,GAMMA_B);
							} else {
								Val = Sony_AutoWB_GetGain(FINAL_GAIN,GAMMA_B);
							}
							break;
						default:
							break;
					}
					(((WB_AUTO_GAIN_T *)pv_get_info)->ui2Gain) = Val;
					#endif
					break;
				}
				case DRV_CUSTOM_CUST_SPEC_TYPE_WB_SETUP_STATUS_GET:
				{
					#if 1
					UINT16 Val;
		
					Val = (UINT16)Sony_WBSetup_Read();
					*((UINT16 *)(pv_get_info)) = Val;
					#endif
					break;
				}
				case DRV_CUSTOM_CUST_SPEC_TYPE_WB_PBM_PQP_PGRAM_LUT_GET_BY_ELEMENT:
				{
					UINT16 Val;
		
					Val = WB_PBM_PQP_PGAM_LUT_Get(Current_Pqp_Lut_setting.ui1RgbIdx,
												  Current_Pqp_Lut_setting.ui1WblvlIdx,
												  Current_Pqp_Lut_setting.ui1WbIndex);
					*((UINT16 *)(pv_get_info)) = Val;
					break;
				}
				case DRV_CUSTOM_CUST_SPEC_TYPE_BACKLIGHT_CONTROL:
				{
					#if 0
					UINT8 OperationMode,ui1Set;
		
					OperationMode = (((BL_CTRL_OPERATION_T *)pv_get_info)->uiOpMode);
		
					switch(OperationMode)
					{
					   case 0x00:
						if(DRVCUST_ReadDynamicBacklight() == 0) {
							ui1Set = 1;
						} else {
							ui1Set = 0;
						}
						break;
					   case 0x02:
						ui1Set = DRVCUST_ReadPMX();
						break;
					   default:
						break;
					}
					(((BL_CTRL_OPERATION_T *)pv_get_info)->ui2OpParameter) = (UINT16)ui1Set;
					#endif
					break;
				}	
				case DRV_CUSTOM_CUST_SPEC_TYPE_PCB_MODE:
        		{
		            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(UINT32)))
		            {
		                LOG(2, "[DRV_CUSTOM_CUST_SPEC_TYPE_PCB_MODE] Invalid parameter\n");
		                return RMR_INV_ARG;
		            }
		            *((UINT32 *)(pv_get_info)) = _u4gModelType;
		            break;
        		}

				case DRV_CUSTOM_CUST_SPEC_TYPE_PCB_REGION:
        		{
		            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(UINT8)))
		            {
		                LOG(2, "[DRV_CUSTOM_CUST_SPEC_TYPE_PCB_REGION] Invalid parameter\n");
		                return RMR_INV_ARG;
		            }
		            *((UINT8 *)(pv_get_info)) = _u1gModelRegion;
		            break;
        		}
#endif

        case DRV_CUSTOM_CUST_SPEC_TYPE_V_COM_DRV:
        {
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(UINT32)))
            {
                LOG(2, "[DRV_CUSTOM_CUST_SPEC_TYPE_V_COM_DRV] Invalid parameter\n");
                return RMR_INV_ARG;
            }
            *(UINT32 *)pv_get_info = FlashPanel_GetVCOMDRV();
            LOG(0,"[D-Interface] V-COM Type is %d\n",FlashPanel_GetVCOMDRV());
            break;
        }

        case DRV_CUSTOM_CUST_SPEC_TYPE_GET_SERVICE_VIDEO:
        {			
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(DRV_CUSTOM_VIDEO_TYPE)))
            {
                LOG(2, "[DRV_CUSTOM_CUST_SPEC_TYPE_GET_SERVICE_VIDEO] Invalid parameter\n");
                return RMR_INV_ARG;
            }
			UINT8 u1VdecId = 0;
			VDEC_HDR_INFO_T rHdrInfo;
			VDEC_QueryInfo((UCHAR)u1VdecId, &rHdrInfo);	
			(((DRV_CUSTOM_VIDEO_TYPE *) pv_get_info)->eCodecType) = rHdrInfo.eCodecType;
			(((DRV_CUSTOM_VIDEO_TYPE *) pv_get_info)->u4BitRate) = rHdrInfo.u4BitRate;
            break;
        }
#ifdef CUSTOM_SELF_DIAG_ENABLE        
        case DRV_CUSTOM_CUST_SPEC_TYPE_SELF_DIAG_MODE:
        {
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(D_SELF_DIAG_STATE)))
            {
                LOG(2, "[DRV_CUSTOM_CUST_SPEC_TYPE_SELF_DIAG_MODE] Invalid parameter\n");
                return RMR_INV_ARG;
            }
            UNUSED(SelfDiagGetCounter((D_SELF_DIAG_STATE *)pv_get_info));
            break;
        }
		case DRV_CUSTOM_CUST_SPEC_TYPE_SELF_DIAG_MODE_V2:
        {
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(D_SELF_DIAG_STATE_V2)))
            {
                LOG(2, "[DRV_CUSTOM_CUST_SPEC_TYPE_SELF_DIAG_MODE_V2] Invalid parameter\n");
                return RMR_INV_ARG;
            }
            UNUSED(SelfDiagGetInfo((D_SELF_DIAG_STATE_V2 *)pv_get_info));
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_BOOT_COUNT_MODE:
        {
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(UINT32)))
            {
                LOG(2, "[DRV_CUSTOM_CUST_SPEC_TYPE_BOOT_COUNT_MODE] Invalid parameter\n");
                return RMR_INV_ARG;
            }
            
            if (SelfDiagGetBootCounter((UINT32 *)pv_get_info) != 0)
            {
                return RMR_DRV_ERROR;
            }
            break;
        }
#endif /* CUSTOM_SELF_DIAG_ENABLE */    
        case DRV_CUSTOM_CUST_SPEC_TYPE_GET_SCART_YPBPR_PARAM:
        {
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(UINT8)))
            {
                LOG(2, "[DRV_CUSTOM_CUST_SPEC_TYPE_GET_SCART_YPBPR_PARAM] Invalid parameter\n");
                return RMR_INV_ARG;
            }
            //*((UINT8*)pv_get_info) = (UINT8)vGetScartYPbPrParamUser();
            *((UINT8*)pv_get_info) = 0x00;
            break;
        }

#if SUPPORT_SCART
		case DRV_CUSTOM_CUST_SPEC_FB_STATUS:
			*((UINT8*)pv_get_info) = (UINT8)bDrvGetScartAutoModeStatus();
			break;
			
		case DRV_CUSTOM_CUST_SPEC_PIN8_STATUS:
			*((UINT8*)pv_get_info) = (UINT8)bDrvGetScartPin8ASR(SV_VS_SCART1);
			break;
#endif
		case DRV_CUSTOM_CUST_SPEC_GET_DEEPCOLOR:
			//*((UINT8*)pv_get_info) =  bHDMIDeepColorStatus();
			break;
        case DRV_CUSTOM_CUST_SPEC_GET_HDMI_FRL_RATE:
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(UINT8)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_GET_HDMI_FRL_RATE invalid parameter\n");
                return RMR_INV_ARG;
            }
            *(UINT8*)(pv_get_info) = (UINT8)eHdmiIf_GetFRLMode(SV_VP_MAIN);
            break;
		case DRV_CUSTOM_CUST_SPEC_GET_ADC_RGB_GAIN_OFFSET:
			#if 0
				((_DRV_CUSTOM_ADC_RGB_GAIN_OFFSET__T *) pv_get_info)->ui1_r_gain = (UINT16) vCust_R_Gain_Read();
				((_DRV_CUSTOM_ADC_RGB_GAIN_OFFSET__T *) pv_get_info)->ui1_g_gain= (UINT16) vCust_G_Gain_Read();
				((_DRV_CUSTOM_ADC_RGB_GAIN_OFFSET__T *) pv_get_info)->ui1_b_gain = (UINT16) vCust_B_Gain_Read();
				((_DRV_CUSTOM_ADC_RGB_GAIN_OFFSET__T *) pv_get_info)->ui1_r_offset = (UINT16) vCust_R_Offset_Read();
				((_DRV_CUSTOM_ADC_RGB_GAIN_OFFSET__T *) pv_get_info)->ui1_g_offset = (UINT16) vCust_G_Offset_Read();
				((_DRV_CUSTOM_ADC_RGB_GAIN_OFFSET__T *) pv_get_info)->ui1_b_offset = (UINT16) vCust_B_Offset_Read();
            #endif
			break;
			
		case DRV_CUSTOM_CUST_SPEC_DISP_PANEL_BACK_LIGHT_HI:
            *((UINT8 *) pv_get_info) = PANEL_GetBacklightHigh();
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_PANEL_BACK_LIGHT_LOW:
            *((UINT8 *) pv_get_info) = PANEL_GetBacklightLow();
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_REG_WB_R_GAIN:
            *((UINT16 *) pv_get_info) = wDrvGetRGain1(SV_VP_MAIN);
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_REG_WB_G_GAIN:
            *((UINT16 *) pv_get_info) = wDrvGetGGain1(SV_VP_MAIN);
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_REG_WB_B_GAIN:
            *((UINT16 *) pv_get_info) = wDrvGetBGain1(SV_VP_MAIN);
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_REG_WB_R_OFFSET:
            *((UINT16 *) pv_get_info) = (UINT16)dwDrvGetROffset11(SV_VP_MAIN);
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_REG_WB_G_OFFSET:
            *((UINT16 *) pv_get_info) = (UINT16)dwDrvGetGOffset11(SV_VP_MAIN);
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_REG_WB_B_OFFSET:
            *((UINT16 *) pv_get_info) = (UINT16)dwDrvGetBOffset11(SV_VP_MAIN);
            break;  
#if 0
        case DRV_CUSTOM_CUST_SPEC_DISP_EEP_WB_MAGIC:
            {
                (((WB_T *) pv_get_info)->ui1_magic[0]) = bApiEepromReadByte( EEP_DISP_WB_MAGIC00);
                (((WB_T *) pv_get_info)->ui1_magic[1]) = bApiEepromReadByte( EEP_DISP_WB_MAGIC00+1);
            }
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_EEP_WB_R_GAIN:
            {
                UINT8   ui1_hi, ui1_lo, ui1_clr_temp;
                UINT16  ui2_offset, ui2_tmp;

                ui1_clr_temp = (((WB_T *) pv_get_info)->ui1_color_temp);
                ui2_offset = EEP_DISP_WB_COOL_R_GAIN_LO+(ui1_clr_temp*6);
                ui1_lo = bApiEepromReadByte( ui2_offset);
                ui1_hi = bApiEepromReadByte( ui2_offset+1);
                ui2_tmp = ((UINT16)ui1_hi<<8) + ((UINT16)ui1_lo);
                (((WB_T *) pv_get_info)->ui2_val) = ui2_tmp;
            }
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_EEP_WB_G_GAIN:
            {
                UINT8   ui1_hi, ui1_lo, ui1_clr_temp;
                UINT16  ui2_offset, ui2_tmp;

                ui1_clr_temp = (((WB_T *) pv_get_info)->ui1_color_temp);
                ui2_offset = EEP_DISP_WB_COOL_R_GAIN_LO+2+(ui1_clr_temp*6);
                ui1_lo = bApiEepromReadByte( ui2_offset);
                ui1_hi = bApiEepromReadByte( ui2_offset+1);
                ui2_tmp = ((UINT16)ui1_hi<<8) + ((UINT16)ui1_lo);
                (((WB_T *) pv_get_info)->ui2_val) = ui2_tmp;
            }
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_EEP_WB_B_GAIN:
            {
                UINT8   ui1_hi, ui1_lo, ui1_clr_temp;
                UINT16  ui2_offset, ui2_tmp;

                ui1_clr_temp = (((WB_T *) pv_get_info)->ui1_color_temp);
                ui2_offset = EEP_DISP_WB_COOL_R_GAIN_LO+4+(ui1_clr_temp*6);
                ui1_lo = bApiEepromReadByte( ui2_offset);
                ui1_hi = bApiEepromReadByte( ui2_offset+1);
                ui2_tmp = ((UINT16)ui1_hi<<8) + ((UINT16)ui1_lo);
                (((WB_T *) pv_get_info)->ui2_val) = ui2_tmp;
            }
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_EEP_WB_R_OFFSET:
            {
                UINT8   ui1_hi, ui1_lo, ui1_clr_temp;
                UINT16  ui2_offset, ui2_tmp;

                ui1_clr_temp = (((WB_T *) pv_get_info)->ui1_color_temp);
                ui2_offset = EEP_DISP_WB_COOL_R_GAIN_LO+24+(ui1_clr_temp*6);
                ui1_lo = bApiEepromReadByte( ui2_offset);
                ui1_hi = bApiEepromReadByte( ui2_offset+1);
                ui2_tmp = ((UINT16)ui1_hi<<8) + ((UINT16)ui1_lo);
                (((WB_T *) pv_get_info)->ui2_val) = ui2_tmp;
            }
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_EEP_WB_G_OFFSET:
            {
                UINT8   ui1_hi, ui1_lo, ui1_clr_temp;
                UINT16  ui2_offset, ui2_tmp;
			
                ui1_clr_temp = (((WB_T *) pv_get_info)->ui1_color_temp);
                ui2_offset = EEP_DISP_WB_COOL_R_GAIN_LO+26+(ui1_clr_temp*6);
                ui1_lo = bApiEepromReadByte( ui2_offset);
                ui1_hi = bApiEepromReadByte( ui2_offset+1);
                ui2_tmp = ((UINT16)ui1_hi<<8) + ((UINT16)ui1_lo);
                (((WB_T *) pv_get_info)->ui2_val) = ui2_tmp;
            }
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_EEP_WB_B_OFFSET:
            {
                UINT8   ui1_hi, ui1_lo, ui1_clr_temp;
                UINT16  ui2_offset, ui2_tmp;

                ui1_clr_temp = (((WB_T *) pv_get_info)->ui1_color_temp);
                ui2_offset = EEP_DISP_WB_COOL_R_GAIN_LO+28+(ui1_clr_temp*6);
                ui1_lo = bApiEepromReadByte( ui2_offset);
                ui1_hi = bApiEepromReadByte( ui2_offset+1);
                ui2_tmp = ((UINT16)ui1_hi<<8) + ((UINT16)ui1_lo);
                (((WB_T *) pv_get_info)->ui2_val) = ui2_tmp;
            }
            break;
#endif
		case DRV_CUSTOM_CUST_SPEC_DISP_HDCP_KSV0:
            #if defined(CC_MT5890)
            *((UINT8 *) pv_get_info) = u1RegRead1B(SHD_BKSV0_2 + 0xC00);
            #else
            *((UINT8 *) pv_get_info) = 0;
            #endif
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_HDCP_KSV1:
            #if defined(CC_MT5890)
            *((UINT8 *) pv_get_info) = u1RegRead1B(SHD_BKSV0_3 + 0xC00);
            #else
            *((UINT8 *) pv_get_info) = 0;
            #endif
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_HDCP_KSV2:
            #if defined(CC_MT5890)
            *((UINT8 *) pv_get_info) = u1RegRead1B(SHD_BKSV1_0 + 0xC00);
            #else
            *((UINT8 *) pv_get_info) = 0;
            #endif
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_HDCP_KSV3:
            #if defined(CC_MT5890)
            *((UINT8 *) pv_get_info) = u1RegRead1B(SHD_BKSV1_1 + 0xC00);
            #else
            *((UINT8 *) pv_get_info) = 0;
            #endif
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_HDCP_KSV4:
            #if defined(CC_MT5890)
            *((UINT8 *) pv_get_info) = u1RegRead1B(SHD_BKSV1_2 + 0xC00);
            #else
            *((UINT8 *) pv_get_info) = 0;
            #endif
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_DYN_GAMMA_MAGIC_NUM:
            {
                UINT8   ui1_i, ui1_tmp;
                for(ui1_i=0; ui1_i<8; ui1_i++)
                {
                    ui1_tmp = DRVCUST_EepromReadByte( EEP_WB_PBM_MAGIC_NUM00 + ui1_i );
                    (((DYN_GAMMA_T *) pv_get_info)->ui1_magic_num[ui1_i]) = ui1_tmp;
                }
            }
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_DYN_GAMMA:
            {
				//Weibin, have NOT know whether it used, if used, need modify, if unused, mark it.
                UINT8   ui1_point = (((DYN_GAMMA_T *) pv_get_info)->ui1_gamma_point),
                        ui1_lo=0, ui1_hi=0, ui1_i;
                UINT16  ui2_offset, ui2_val[3];

                for(ui1_i=0; ui1_i<3; ui1_i++)
                {
                    ui2_offset = (EEP_WB_PBM_MAGIC_NUM07+1) + (UINT16)ui1_i*22 + (UINT16)ui1_point*2;
                    ui1_lo = DRVCUST_EepromReadByte( ui2_offset);
                    ui1_hi = DRVCUST_EepromReadByte( ui2_offset+1);
                    ui2_val[ui1_i] = ((UINT16)ui1_hi<<8) + ((UINT16)ui1_lo);
                }
                (((DYN_GAMMA_T *) pv_get_info)->ui2_r) = ui2_val[0];
                (((DYN_GAMMA_T *) pv_get_info)->ui2_g) = ui2_val[1];
                (((DYN_GAMMA_T *) pv_get_info)->ui2_b) = ui2_val[2];
            }
            break;

        case DRV_CUSTOM_CUST_SPEC_DISP_BLUE_STRETCH:
            *((UINT8 *) pv_get_info) = bDrvGetBlueStretchOnOff();
            break;

        case DRV_CUSTOM_CUST_SPEC_DISP_CVBS_AUTO_COLOR:
            *((UINT8 *) pv_get_info) = fgApiVideoIsEvtFlgSet(VDO_FLG_TVDAUTO_DOING);
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_CVBS_D_GAIN:
            #if ENABLE_SOEM_PQ
            *((UINT16 *) pv_get_info) = bDrvGetTVDADCDGain();
            #endif            
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_CVBS_A_GAIN:
            #if ENABLE_SOEM_PQ
            *((UINT8 *) pv_get_info) = bDrvGetTVDADCGain();
            #endif            
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_Y_LEVEL:
            {
                UINT16 aui2_YCbCr_buf[3];
                vDrvSceDbgInfo( (PANEL_GetPanelWidth()/2), (PANEL_GetPanelHeight()/2), aui2_YCbCr_buf, NULL);
                *((UINT16 *) pv_get_info) = aui2_YCbCr_buf[0];
            }
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_PQ_VERSION:
            if ((pv_get_info == NULL) || (*(pz_size) < bApiFlashPqGetVersionLength(0, FLASHPQ_XML_VER)))
            {
                LOG(2, "[DRV_CUSTOM_CUST_SPEC_DISP_PQ_VERSION] Invalid parameter\n");
                return RMR_INV_ARG;
            }
            x_memcpy(pv_get_info, bApiFlashPqGetVersion(0, FLASHPQ_XML_VER), bApiFlashPqGetVersionLength(0, FLASHPQ_XML_VER));
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_PQ_GAMMA_VER:
            //x_strncpy((CHAR *)pv_get_info, (CHAR *)bApiFlashPqGetVersion(0, FLASHPQ_GAMMA_VER), strlen((CHAR *)bApiFlashPqGetVersion(0, FLASHPQ_GAMMA_VER)));
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_PQ_SCE_VER:
            //x_strncpy((CHAR *)pv_get_info, (CHAR *)bApiFlashPqGetVersion(0, FLASHPQ_SCE_VER), strlen((CHAR *)bApiFlashPqGetVersion(0, FLASHPQ_SCE_VER)));
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_PQ_QTY_VER:
            //x_strncpy((CHAR *)pv_get_info, (CHAR *)bApiFlashPqGetVersion(0, FLASHPQ_QTY_VER), strlen((CHAR *)bApiFlashPqGetVersion(0, FLASHPQ_QTY_VER)));
            break;

        case DRV_CUSTOM_CUST_SPEC_DISP_PANEL_FLASH_VERSION:
            //x_strncpy((CHAR *)pv_get_info, (CHAR *)FlashPanel_GetVersion(), strlen((CHAR *)FlashPanel_GetVersion()));
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_PANEL_FLASH_NUMBER:
            //*((UINT32 *) pv_get_info) = FlashPanel_GetPanelNumber();
            break;

        case DRV_CUSTOM_CUST_SPEC_DISP_PANEL_FLASH_ID_LIST:
            //FlashPanel_ListAllPanelID( (UINT8 *) pv_get_info );
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_AQ_VERSION:
#ifdef CC_AUD_SAKURA_RENDER
#ifdef CC_AUD_ARM_SUPPORT
            if ((pv_get_info == NULL) || (*(pz_size) < 8))
            {
                LOG(2, "[DRV_CUSTOM_CUST_SPEC_DISP_AQ_VERSION] Invalid parameter\n");
                return RMR_INV_ARG;
            }
            vAprocAqData_Read(AQDATA_ADDRESS_VERSION,  (UINT8*)pv_get_info  ,AQDATA_SIZE_VERSION);
#endif
#endif
            break;

        case DRV_CUSTOM_CUST_SPEC_TYPE_SOUND_OUTPUT_FS:
        {
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(E_CUST_AUD_OUTPUT_FS)))
            {
                LOG(2, "[DRV_CUSTOM_CUST_SPEC_TYPE_SOUND_OUTPUT_FS] Invalid parameter\n");
                return RMR_INV_ARG;
            }
#ifdef CC_SUPPORT_96K_AOUT
            #ifdef CC_MAPLE_CUST_DRV_AUD
            if (_MT5398_PWM_Out_Fs_Query()==FS_96K) 
            {
                *(E_CUST_AUD_OUTPUT_FS*)(pv_get_info) = E_CUST_AUD_OUTPUT_FS_96K;    
            }
            else //96 K
            {
                *(E_CUST_AUD_OUTPUT_FS*)(pv_get_info) = E_CUST_AUD_OUTPUT_FS_48K;
            }
            #endif
#else
            *(E_CUST_AUD_OUTPUT_FS*)(pv_get_info)=E_CUST_AUD_OUTPUT_FS_48K;        
#endif
                
            break;
        }
        case DRV_CUSTOM_AUD_GET_SPDIF_DELAY:
        {
#ifdef CC_MAPLE_CUST_DRV
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(INT8)))
            {
                LOG(2, "Invalid parameter\n");
                return RMR_INV_ARG;
            }
            #ifdef CC_MAPLE_CUST_DRV_AUD
            *(INT8*)(pv_get_info) = (INT8)_AUD_DspGetBypassSPDIFDly();
            #endif
#endif
            return RMR_OK;
        }
        case DRV_CUSTOM_CUST_SPEC_DISP_FRC_VERSION:
            if ((pv_get_info == NULL) || (*(pz_size) < QueryFRCVersionLength()))
            {
                LOG(2, "[DRV_CUSTOM_CUST_SPEC_DISP_FRC_VERSION] Invalid parameter\n");
                return RMR_INV_ARG;
            }
            QueryFRCVersion((UINT8*)pv_get_info);
            break;        
        case DRV_CUSTOM_CUST_SPEC_DISP_4KBE_VERSION_NUMBER:
            if (pv_get_info == NULL)
            {
                LOG(2, "[DRV_CUSTOM_CUST_SPEC_DISP_FRC_VERSION_NUMBER] Invalid parameter\n");
                return RMR_INV_ARG;
            }            
            *((UINT8 *) pv_get_info) = QueryBEDeviceVersionNum();
            break;
        case DRV_CUSTOM_CUST_SPEC_DISP_4KBE_VERSION:
            if (pv_get_info == NULL)
            {
                LOG(0, "[DRV_CUSTOM_CUST_SPEC_DISP_4KBE_VERSION_DATA] Invalid parameter\n");
                return RMR_INV_ARG;
            }
            if (*(pz_size) < QueryBEDeviceVersionNum()*20)
            {
                LOG(0, "[DRV_CUSTOM_CUST_SPEC_DISP_4KBE_VERSION_DATA] parameter size not enough, should be at least %d bytes\n", QueryBEDeviceVersionNum()*20);
                return RMR_INV_ARG;
            }            
            if (0 != QueryBEDeviceVersion((UINT8*) pv_get_info))
            {
                LOG(0, "[DRV_CUSTOM_CUST_SPEC_DISP_4KBE_VERSION] BE version has not yet been set\n");
                return RMR_INV_ARG;
            }
            break;       
        case DRV_CUSTOM_CUST_SPEC_IS_PANEL_MODE:
            *((UINT8 *) pv_get_info) = IsPanelMode();
            break;

        case DRV_CUSTOM_CUST_SPEC_SERVO_ADC:
            {
				#if 0
                UINT32  u4Val = 0, u4Channel = (UINT32)(((FAC_SERVO_ADC_T *) pv_get_info)->ui1_servo_pin);
                if(u4Channel > TOTAL_SERVOADC_NUMBER)
                    return RMR_INV_ARG;
                u4Channel += SERVO0;
                do {
                    u4Val = PDWNC_ReadServoADCChannelValue(u4Channel);
                } while (u4Val != PDWNC_ReadServoADCChannelValue(u4Channel));

                (((FAC_SERVO_ADC_T *) pv_get_info)->i4_val) = (INT32)u4Val;
				#endif
            }
            break;

	     case DRV_CUSTOM_CUST_SPEC_TYPE_PANEL_ID:
				{
#ifdef CC_Factory2K12
            #define PANEL_ID_STRING_LEN            16
					//int i;
					CHAR *prPanelName = NULL;
					DRV_CUSTOM_PANEL_ID_T *p_panel_id = (DRV_CUSTOM_PANEL_ID_T*)pv_get_info;
#ifdef CC_PANEL_FROM_FLASH
					prPanelName = FlashPanel_GetIDString(); // allen add for get panel id
					x_memcpy(&p_panel_id->aui1_panel_id_buf[0], (void *)prPanelName, PANEL_ID_STRING_LEN);
		//			  x_memcpy(pv_get_info, (void *)prPanelName, PANEL_ID_STRING_LEN);			 
#endif
					break;
#else
            #define IRIS_PANEL_ID_STRING_LEN            16
		
					CHAR *prPanelName = NULL;
					if ((pv_get_info == NULL) || (*(pz_size) != IRIS_PANEL_ID_STRING_LEN))
					{
						LOG(2, "[DRV_CUSTOM_CUST_SPEC_TYPE_PANEL_ID] Invalid parameter\n");
						return RMR_DRV_ERROR;
					}
		
					prPanelName = GetCurrentPanelName();
					x_memcpy(pv_get_info, (void *)prPanelName, IRIS_PANEL_ID_STRING_LEN);
					break;
		
#endif
		}

        case DRV_CUSTOM_CUST_SPEC_GET_TAG_VERSION:
        {
        	DRV_CUSTOM_TAG_VERSION_TYPE_T *prTageVer=NULL;
			//MISC_VERSION_ID_T *prTageVer=NULL;

            if (pv_get_info == NULL)
            {
                LOG(0, "[DRV_CUSTOM_CUST_SPEC_GET_TAG_VERSION] Invalid parameter\n");
                return RMR_INV_ARG;
            }
        	prTageVer = (DRV_CUSTOM_TAG_VERSION_TYPE_T *)pv_get_info; 
        	//prTageVer = (MISC_VERSION_ID_T *)pv_get_info;     
            if(prTageVer->ui1_tag_type >= DRV_CUSTOM_TAG_TYPE_MAX)
            {
            	 return RMR_DRV_INV_GET_INFO;
            }
            vGetTagVersion(szTagStr[prTageVer->ui1_tag_type], prTageVer->szVerStr);
			break;
        }   
			
        case DRV_CUSTOM_CUST_SPEC_TYPE_GET_PANEL_WIDTH:
        {
                *((UINT32 *) pv_get_info)=PANEL_GetPanelWidth();
			break;
        }				
		case DRV_CUSTOM_CUST_SPEC_TYPE_GET_PANEL_HEIGHT:
                {
                *((UINT32 *) pv_get_info)=PANEL_GetPanelHeight();
			break;		
                }
        case DRV_CUSTOM_CUST_SPEC_TYPE_GET_PANEL_CONTROLWORD_3:
        {
#ifdef CC_PANEL_FROM_FLASH
            *((UINT32 *) pv_get_info)=FlashPanel_GetControlWord3();
#else
            *((UINT32 *) pv_get_info)=0;
#endif
			break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_QUERY_IC_PART:
        {
            *((UINT32 *) pv_get_info)=QueryICPartNo();
            break;      
        }
		case DRV_CUSTOM_CUST_SPEC_ADC_LIGHT_SENSOR_ADC_VALUE:
        {
            *((UINT16 *) pv_get_info)=(UINT16)PDWNC_ReadServoADCChannelValue(2);				 
			break;
	    }

        #ifdef SYS_MHL_SUPPORT
		case DRV_CUSTOM_SPEC_TYPE_GET_MHL_CABLE_DETECT:
		{
            //extern UINT8 u1FactoryGetCdsenseStatus(VOID);
            //*((BOOL *) pv_get_info) = u1FactoryGetCdsenseStatus();/*MHL_SENSE*/
			break;	
		}			
		case DRV_CUSTOM_SPEC_TYPE_GET_MHL_CBUS_STATUS:
		{
			UINT8 cbusStatus = 0x00;
            #if defined(CC_MT5890)
		    cbusStatus = (UINT8)fgGetMHLStatus();
            #else
            cbusStatus = 0;
            #endif
			*((UINT8 *)(pv_get_info)) = cbusStatus;
			break;
		}			
        #endif /* #ifdef SYS_MHL_SUPPORT */

		case DRV_CUSTOM_SPEC_TYPE_GET_MHL_CBUS_STATUS_BOSTON:
		{
			//To do for MTK HDMI2.0 
			break;
		}
		case DRV_CUSTOM_SPEC_TYPE_GET_HDMI_RECEIVER_BOSTON:
		{
		    //To do for MTK HDMI2.0 						
 			break;
		}
		case DRV_CUSTOM_SPEC_TYPE_GET_HDMI_BKSV_BOSTON:
                {
			//To do for MTK HDMI2.0 
			break;
		}
		case DRV_CUSTOM_SPEC_TYPE_GET_FIRMWARE_VERSION_BOSTON:
		{
            //To do for MTK HDMI2.0 
			break;
		}
        case DRV_CUSTOM_SPEC_TYPE_GET_HDMI_5V_STATUS_BOSTON:
        {   
           //To do for MTK HDMI2.0 
			break;
		}
		case DRV_CUSTOM_SPEC_TYPE_GET_HDMI_HDCP:
		{
            UINT8 hdcp_status=0x0;
            #if defined(CC_MT5890)
		    hdcp_status= u1IsHdcpGood((E_HDMI_SWITCH_NUM)pv_get_info);
            #else
            hdcp_status=0;
            #endif
		    Printf("version_boston is :%d",hdcp_status);							
			*((UINT8*)pv_get_info) = hdcp_status;
			break;
		}

        #ifdef SYS_MHL_SUPPORT
	    case DRV_CUSTOM_SPEC_TYPE_GET_MHL_OCP:
		{
            UINT8 Ocp_status=0x0;
		    //Ocp_status= fgIsOverCurrentHappen();
		    Printf("Ocp_status is :%d",Ocp_status);							
			*((UINT8*)pv_get_info) = Ocp_status;
			break;
		}
        #endif

		case DRV_CUSTOM_CUST_SPEC_TYPE_DTV_PACKET_RX_STATUS:
		{
			UINT32 u4RecvPackets,u4RDropPackets;
			UINT8 u1TsLockStatus=0;
			DMX_GetPacketStatus(0,100,&u4RecvPackets,&u4RDropPackets);
			if(u4RecvPackets>0)
			{
				u1TsLockStatus=1;
			}
			*((UINT8*)pv_get_info) =u1TsLockStatus;
			Printf("DMX Status=%d(%d,%d)\n",u1TsLockStatus,u4RecvPackets,u4RDropPackets);
		}
		break;
		
		case DRV_CUSTOM_CUST_SPEC_TYPE_DTV_PACKET_RX_STATUS_SUB:
		{
			UINT32 u4RecvPackets,u4RDropPackets;
			UINT8 u1TsLockStatus=0;
			DMX_GetPacketStatus(1,100,&u4RecvPackets,&u4RDropPackets);
			if(u4RecvPackets>0)
			{
				u1TsLockStatus=1;
			}
			*((UINT8*)pv_get_info) =u1TsLockStatus;
			Printf("DMX Status=%d(%d,%d)\n",u1TsLockStatus,u4RecvPackets,u4RDropPackets);
		}
		break;
			
#ifndef CC_MTK_LOADER    
#if 1//def STELLAR_LED_SPEC
		case DRV_CUSTOM_CUST_SPEC_LED_MODE:
		{
			#if 0  
			UINT16 u2LedMode = 0;
			DTVCFG_T rDtvCfg;
			EEPDTV_GetCfg(&rDtvCfg);
			if(rDtvCfg.u1Flags & DTVCFG_FLAG_POWER_LEDOFF)
			{
				u2LedMode = 0;
			}
			else
			{
				u2LedMode = 1;
			}
			*((UINT16*)pv_get_info) = u2LedMode;
			Printf("[D-Interface] LED mode is %s\n",u2LedMode?"ON":"OFF");
			#endif
			break;
		}
#endif/* STELLAR_LED_SPEC */
#endif

        //Fariha add 4/7/2014 - KEY_AD_STATUS implementation - Start
        case DRV_CUSTOM_CUST_SPEC_ADC_KEY_AD_STATUS:
        {
            *((UINT16 *) pv_get_info)=(UINT16)PDWNC_ReadServoADCChannelValue(1);
            break;
        }
        //Fariha add 4/7/2014 - KEY_AD_STATUS implementation - End
        //Fariha add 17/7/2014 - SIRCS fix - Start
        case DRV_CUSTOM_CUST_SPEC_GET_RGB_GAISOU:
        {
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(UINT32)))
            {
                LOG(2, "[DRV_CUSTOM_CUST_SPEC_GET_RGB_GAISOU] Invalid parameter\n");
                return RMR_INV_ARG;
            }
            
            *(UINT32 *)pv_get_info = eventCode;
            break;
        }
        //Fariha add 17/7/2014 - SIRCS fix - End
        //Mariam add 21 July 2014 - Tcon NVM Direct Access implementation - Start
		case DRV_CUSTOM_CUST_SPEC_TCON_NVM_R:
		{
			UINT16 ret, i;
			TCON_NVM_T* d_tcon_nvm = (TCON_NVM_T*)pv_get_info;
			ret = SIF_X_Read(2, 0x100, 0xAA, 0x02, d_tcon_nvm->subAddr, d_tcon_nvm->data_buffer, d_tcon_nvm->length);
			d_tcon_nvm->status = ret;
			if ( ret == 0 ){
                return RMR_DRV_ERROR;
            }
			x_thread_delay(100);
			break;
		}
		//Mariam add 21 July 2014 - Tcon NVM Direct Access implementation - End
		//Mariam add 24 July 2014 - Backlight PWM Control implementation - Start
        case DRV_CUSTOM_CUST_SPEC_TYPE_PWM_BACKLIGHT_CONTROL:
        {
            BL_PWM_CTRL_T* d_BlPwmCtrl = (BL_PWM_CTRL_T*)pv_get_info;
            UINT32 timeBase = 0;
            UINT32 duty = 0;
            //set PwmFrequency
            timeBase = DRVCUST_GetBLPwmFrequency(d_BlPwmCtrl->chnlFreq);
			d_BlPwmCtrl->timeBase = timeBase;
            //set PwmDuty
            duty = DRVCUST_GetBLPwmDuty(d_BlPwmCtrl->chnlDuty);
			d_BlPwmCtrl->duty = duty;
            break;
        }
        //Mariam add 24 July 2014 - Backlight PWM Control implementation - End		
    	case DRV_CUSTOM_CUST_SPEC_TYPE_DVBS_LNB_VOL_CTRL:
    	{
     #if  defined(SYS_DVBS_SUPPORT) && defined(CC_Factory2K12)
    		if(pv_get_info) TunerDVBSFac_GetLnbVol(1,(UINT8 *)pv_get_info);
     #endif
    	}
    	break;
		
		case DRV_CUSTOM_CUST_SPEC_TYPE_DVBS_LNB_VOL_CTRL_SUB:
		{
     #if  defined(SYS_DVBS_SUPPORT) && defined(CC_Factory2K12)
			if(pv_get_info) TunerDVBSFac_GetLnbVol(2,(UINT8 *)pv_get_info);
     #endif
		}
		break;
		
    	case DRV_CUSTOM_CUST_SPEC_TYPE_DVBS_LNB_TONE_CTRL:
    	{
     #if defined(SYS_DVBS_SUPPORT) && defined(CC_Factory2K12)
    		if(pv_get_info) TunerDVBSFac_GetLnb22KStatus(1,(UINT8 *)pv_get_info);
     #endif
    	}
    	break;

		case DRV_CUSTOM_CUST_SPEC_TYPE_DVBS_LNB_TONE_CTRL_SUB:
		{
     #if defined(SYS_DVBS_SUPPORT) && defined(CC_Factory2K12)
			if(pv_get_info) TunerDVBSFac_GetLnb22KStatus(2,(UINT8 *)pv_get_info);
     #endif
		}
		break;
		
    	case DRV_CUSTOM_CUST_SPEC_TYPE_DVBS_LNB_SHORT_STATUS:
    	{
     #if  defined(SYS_DVBS_SUPPORT) && defined(CC_Factory2K12)
    		if(pv_get_info) TunerDVBSFac_GetLnbShortStatus(1,(UINT8 *)pv_get_info);
     #endif
    	}
    	break;

		case DRV_CUSTOM_CUST_SPEC_TYPE_DVBS_LNB_SHORT_STATUS_SUB:
		{
    #if  defined(SYS_DVBS_SUPPORT) && defined(CC_Factory2K12)
			if(pv_get_info) TunerDVBSFac_GetLnbShortStatus(2,(UINT8 *)pv_get_info);
    #endif
		}
		break;
		
    	case DRV_CUSTOM_CUST_SPEC_TYPE_DEMOD_MOUNT_STATUS:
    	{
     #if  defined(SYS_DVBS_SUPPORT) && defined(CC_Factory2K12)
    		if(pv_get_info)
    		{
    		    *(UINT8 *)pv_get_info = TunerDVBSFac_GetDemodMountStatus(1);
    		}
     #endif
    	}
    	break;

		case DRV_CUSTOM_CUST_SPEC_TYPE_DEMOD_MOUNT_STATUS_SUB:
		{
#if  defined(SYS_DVBS_SUPPORT) && defined(CC_Factory2K12)
			if(pv_get_info)
			{
				*(UINT8 *)pv_get_info = TunerDVBSFac_GetDemodMountStatus(2);
			}
#endif
		}
		break;
		
    	case DRV_CUSTOM_CUST_SPEC_TYPE_LNB_MOUNT_STATUS:
    	{
     #if defined(SYS_DVBS_SUPPORT) && defined(CC_Factory2K12)
    		if(pv_get_info)
    		{
    		    *(UINT8 *)pv_get_info = TunerDVBSFac_GetLNBMountStatus(1);
    		}
     #endif
    	}
    	break;  

		case DRV_CUSTOM_CUST_SPEC_TYPE_LNB_MOUNT_STATUS_SUB:
		{
    #if defined(SYS_DVBS_SUPPORT) && defined(CC_Factory2K12)
			if(pv_get_info)
			{
				   *(UINT8 *)pv_get_info = TunerDVBSFac_GetLNBMountStatus(2);
			}
    #endif
		}
		break;
		
		case DRV_CUSTOM_CUST_SPEC_TYPE_MODEL_3D_SUPPORT:
		{

#ifdef CC_PANEL_FROM_FLASH

		    UINT32 u4Val=0;
			EEPROM_Read(0x10206, (UPTR)&u4Val, 1);
            if((u4Val & 0x01) == 0x01) //not support 3D 
            {
            	*(UINT8 *)pv_get_info = 0;	
				Printf("From EEPROM and it is no 3D Model\n");
            }
			else //depend on panel
			{
				u4Val=FlashPanel_GetControlWord3();// bit[27:26]  0: no 3D , 1:active 3D 2:Passive 3D 
				Printf("ControlWord 3 u4Val :%x\n",u4Val);
				if((u4Val & 0x0C000000) == 0x00) //no 3D
				{
					*(UINT8 *)pv_get_info = 0;	
					Printf("No 3D Model\n");
				}
				else if(((u4Val & 0x0C000000) >> 26) == 0x01)//active 3D
				{
					*(UINT8 *)pv_get_info = 1;	
					Printf("Active 3D Model\n");
				}
				else if(((u4Val & 0x0C000000)>> 26) == 0x02)//passive 3D
				{
					*(UINT8 *)pv_get_info = 2;	
					Printf("Passive 3D Model\n");
				}
				else//reserved ,default is for active 3D
				{
					*(UINT8 *)pv_get_info = 1;	
					Printf("Other but for reserved Model\n");
				}
				
			}
#else
		    *(UINT8 *)pv_get_info = 0;//alwyas return 2D model
#endif
		
        }
		break; 
#ifdef CC_SAKURA_LED_ILLUMINATION
         case DRV_CUSTOM_CUST_SPEC_TYPE_GET_LED_ILLUMINATION_PATTERN:
         {
             if ((pv_get_info == NULL) || (*(pz_size) != sizeof(LED_PATTERN_IDX_T)))
             {
                 LOG(2, "[DRV_CUSTOM_CUST_SPEC_TYPE_GET_LED_ILLUMINATION_PATTERN] Invalid parameter\n");
                 return RMR_DRV_ERROR;
             }
             CustomLed_Get_CurrentPattern(((LED_PATTERN_IDX_T*)pv_get_info));
         }
             break;

         case DRV_CUSTOM_CUST_SPEC_TYPE_GET_LED_BRIGHTNESS:
         {
             if ((pv_get_info == NULL) || (*(pz_size) != sizeof(LED_PATTERN_IDX_T)))
             {
                 LOG(2, "[DRV_CUSTOM_CUST_SPEC_TYPE_GET_LED_BRIGHTNESS] Invalid parameter\n");
                 return RMR_DRV_ERROR;
             }
             CustomLed_Get_U_Brightness(((LED_U_BRIGHTNESS_T*)pv_get_info));
         }
             break;

        case DRV_CUSTOM_CUST_SPEC_TYPE_GET_LED_ONOFFMS:
        {
			if ((pv_get_info == NULL) || (*(pz_size) != sizeof(DRV_LED_ONOFF_PARAM_T)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_GET_LED_ONOFFMS: Invalid parameter\n");
                return RMR_INV_ARG;
            }
            #ifndef CC_MTK_LOADER
            CustomLed_QueryCurrentOnOffParam((DRV_LED_ONOFF_PARAM_T*)pv_get_info);
            #endif
        }
        break;

        
        case DRV_CUSTOM_CUST_SPEC_TYPE_GET_LED_POWERON_PATTERN:  /* size = sizeof(LED_PATTERN_IDX_T *), pv_set_info = (LED_PATTERN_IDX_T *) */
        {
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(LED_PATTERN_IDX_T *)))
            {
                LOG(2, "%s:%d: Invalid parameter\n", __FUNCTION__, __LINE__);
                return RMR_INV_ARG;
            }
            
            #ifndef CC_MTK_LOADER
            CustomLed_GetLedPWRONPattern((LED_PATTERN_IDX_T *)pv_get_info);
            #endif
        }
        break;
        
        case DRV_CUSTOM_CUST_SPEC_TYPE_GET_LED_STANDBY_PATTERN:  /* size = sizeof(LED_PATTERN_IDX_T *), pv_set_info = (LED_PATTERN_IDX_T *) */
		{
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(LED_PATTERN_IDX_T *)))
            {
                LOG(2, "%s:%d: Invalid parameter\n", __FUNCTION__, __LINE__);
                return RMR_INV_ARG;
            }
            
            #ifndef CC_MTK_LOADER
            CustomLed_GetLedSTBYPattern((LED_PATTERN_IDX_T *)pv_get_info);
            #endif
        }
        break;
#endif
         case DRV_CUSTOM_CUST_SPEC_TYPE_GET_TVD_LOCK:
         {
             UINT8   tv_lock = FALSE;
             if ((pv_get_info == NULL) || (*(pz_size) != sizeof(BOOL)))
             {
                 LOG(2, "[DRV_CUSTOM_CUST_SPEC_TYPE_GET_TVD_LOCK] Invalid parameter\n");
                 return RMR_DRV_ERROR;
             }
             tv_lock = bTvd3dSignalStatus();
             Printf("tvd_lock is :%d\n",tv_lock);
             if(tv_lock > 0)
             {
                *((UINT8 *)pv_get_info) = 1;
             }
             else
             {
                 *((UINT8 *)pv_get_info) = 0;
             }
             Printf("pv_get_info is :%d\n",*((UINT8 *)pv_get_info));
         }
         break;

        case DRV_CUSTOM_CUST_SPEC_TYPE_GET_FACTORY_AGC:
        {
#ifdef CC_DUAL_TUNER_SUPPORT
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(UINT32)))
            {
                LOG(2, "[DRV_CUSTOM_CUST_SPEC_TYPE_GET_TVD_LOCK] Invalid parameter\n");
                return RMR_DRV_ERROR;
            }
            
            if((*((UINT32 *)pv_get_info)) & (0xC0)) //Main path (1100 0000)
            {
                CLI_Parser("nim.id 1");
            }
            else if((*((UINT32 *)pv_get_info)) & (0x30)) //Sub path (0011 0000)
            {
                CLI_Parser("nim.id 2");
            }
            
            CLI_Parser("nim.dtd s");  
            x_thread_delay(100);

            if((*((UINT32 *)pv_get_info)) & (0x0C)) //DVB_T (0000 1100)
            {
        #if 0
                ui4_factory_agc_t = (0 == ui4_factory_agc_t) ? (255) : (ui4_factory_agc_t);
                
                ui4_factory_agc_t=255-(ui4_factory_agc_t>>4);
                
                *((UINT32 *)pv_get_info) = ui4_factory_agc_t;

        #else

                if(0 != ui4_factory_agc_t)
                {
                    ui4_factory_agc_t = 255 - (ui4_factory_agc_t >> 4);
                }
                else
                {
                    ui4_factory_agc_t = 255;
                }

                *((UINT32 *)pv_get_info) = ui4_factory_agc_t;
        #endif
            }
            else if((*((UINT32 *)pv_get_info)) & (0x03)) //DVB_S (0000 0011)
            {
        #if 0
                ui4_factory_agc_s = (0 == ui4_factory_agc_s) ? (255) : (ui4_factory_agc_s);
                
                ui4_factory_agc_s=255-(ui4_factory_agc_s>>5);

                *((UINT32 *)pv_get_info) = ui4_factory_agc_s;

        #else

                if(0 != ui4_factory_agc_s)
                {
                    ui4_factory_agc_s = 255 - (ui4_factory_agc_s >> 5);
                }
                else
                {
                    ui4_factory_agc_s = 255;
                }

                *((UINT32 *)pv_get_info) = ui4_factory_agc_s;
        #endif
            }
#endif
            break;
        }

		case DRV_CUSTOM_CUST_AUDIO_VOLUME_CTRL:
		{
#ifdef S_AUD_FEATURE			
			if ((pv_get_info == NULL) || (pz_size != sizeof(DRV_AUDIO_OUTPUT_VOLUME_CTRL_T)))
			{                
				LOG(2, "Invalid parameter (audio output get volume control)\n");                
				return RMR_INV_ARG;            
			}			
			D_AP_AUDIO_OUTPUT_ID eOutId;
			eOutId = (D_AP_AUDIO_OUTPUT_ID)(((DRV_AUDIO_OUTPUT_VOLUME_CTRL_T *)pv_get_info)->eOutputId);
			switch(eOutId)            
			{            	
				case D_AP_AUDIO_OUTPUT_SPK:
					((DRV_AUDIO_OUTPUT_VOLUME_CTRL_T *)pv_get_info)->level = (UINT16)_AUD_DspGetChannelVolume(AUD_DEC_MAIN, AUD_CH_FRONT_LEFT);
					break;            	
				case D_AP_AUDIO_OUTPUT_HP:					
					((DRV_AUDIO_OUTPUT_VOLUME_CTRL_T *)pv_get_info)->level = (UINT16)_AUD_DspGetChannelVolume(AUD_DEC_MAIN, AUD_CH_DMX_LEFT); 
					break;            	
				case D_AP_AUDIO_OUTPUT_SPDIF:				
				case D_AP_AUDIO_OUTPUT_ARC:					
					((DRV_AUDIO_OUTPUT_VOLUME_CTRL_T *)pv_get_info)->level = (UINT16)_AUD_DspGetChannelVolume(AUD_DEC_MAIN, AUD_CH_IEC_LEFT); 
					break;            	
				case D_AP_AUDIO_OUTPUT_SCART:					
					((DRV_AUDIO_OUTPUT_VOLUME_CTRL_T *)pv_get_info)->level = (UINT16)_AUD_DspGetChannelVolume(AUD_DEC_MAIN, AUD_CH_AUX_FRONT_LEFT); 
					break;            	
				default:                  	
					break;            
			}
#endif
			break;
		}
        case DRV_CUSTOM_CUST_SPEC_TYPE_GET_HDMI_HF_VSDB_INFO:
		{
			UINT8 u1HFVsdbInfo = 0;
			if ((pv_get_info == NULL) || (*(pz_size) != sizeof(UINT8)))
			{
				LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_GET_HDMI_HF_VSDB_INFO invalid parameter\n");
				return RMR_INV_ARG;
			}
			vHDMIEDIDGetHFVSDBFlag(&u1HFVsdbInfo);
			*(UINT8 *)pv_get_info = u1HFVsdbInfo;
			break;
		}

        case DRV_CUSTOM_CUST_SPEC_TYPE_GET_HDMI_SIGNAL_STATUS:
        {
            UINT8 u1Port;
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(DRV_HDMI_SINGAL_STATUS_T)))
            {
            	LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_GET_HDMI_SIGNAL_STATUS invalid parameter\n");
            	return RMR_INV_ARG;
            }
            u1Port = ((DRV_HDMI_SINGAL_STATUS_T *)pv_get_info)->u1Port;
            ((DRV_HDMI_SINGAL_STATUS_T *)pv_get_info)->u1SignalStatus = u1HdmiIf_GetSignalStatus(u1Port,TRUE);
            break;
        }

        case DRV_CUSTOM_CUST_SPEC_PLATFORM_SERIES:
        {
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(UINT32))) 
            {
                return RMR_INV_ARG;
            }
            *(UINT32 *)pv_get_info = CustomPlatformSeries();

            break;
        }
 
        case DRV_CUSTOM_CUST_SPEC_B_BOARD_TYPE:
        {
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(UINT32))) 
            {
                return RMR_INV_ARG;
            }
            *(UINT32 *)pv_get_info = CustomBBoardType();
            break;
        }

        case DRV_CUSTOM_CUST_SPEC_TERMINAL_VARIATION:
        {
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(UINT32)))
            {
                return RMR_INV_ARG;
            }
            *(UINT32 *)pv_get_info = (UINT32)CustomTerminalVariation();
            break;
        }

        case DRV_CUSTOM_CUST_SPEC_POWER_TRIGGER_EX:
        {
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(UINT32)))
            {
                return RMR_INV_ARG;
            }
            *(UINT32 *)pv_get_info = CustomExtraWakeupTriggerEvent(NULL);
            break;
        }
#if defined(CC_HDMI_EARC_SUPPORT)&&!defined(CC_UBOOT)&&!defined(CC_MTK_LOADER)
        case DRV_CUSTOM_CUST_SPEC_TYPE_GET_EARC_AUD_STATUS:
        {
            EARCAudioStatus_t eStatus;
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(EARCAudioStatus_t)))
            {
                return RMR_INV_ARG;
            }
            x_memset((void*)&eStatus, 0, sizeof(EARCAudioStatus_t));
            u1HDMIEARCGetAudioStatus(&eStatus);
            x_memcpy(pv_get_info, (void*)&eStatus, sizeof(EARCAudioStatus_t));
            break;
        }

        case DRV_CUSTOM_CUST_SPEC_TYPE_GET_EARC_HBR_INPUT:
        {
            BOOL u1HbrStatus = FALSE;
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(BOOL)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_GET_HDMI_HF_VSDB_INFO invalid parameter\n");
                return RMR_INV_ARG;
            }
            u1HDMIEARCIsHBRInput(&u1HbrStatus);
            *(BOOL *)pv_get_info = u1HbrStatus;
            break;
        }
#endif
        case DRV_CUSTOM_AUD_AAC_CAPABILITY:
        {
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(E_CUST_AUD_MPEG4_AAC_CAPABILITY)))
            {
                return RMR_INV_ARG;
            }
            *(E_CUST_AUD_MPEG4_AAC_CAPABILITY *)pv_get_info = _AUD_CalAacCap();
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_GET_COLOR_SPACE:
        {
            UINT8 u1Path = SV_VP_MAIN;
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(UINT16)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_GET_COLOR_SPACE invalid parameter\n");
                return RMR_INV_ARG;
            }
            *(UINT16*)(pv_get_info) = (UINT16)eHdmiIf_GetColorSpace(u1Path);
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_ADDTIONAL_RESTRICTION_CONDITION:
        {
            UINT8 u1AddCondition;
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(BOOL)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_GET_HDMI_HF_VSDB_INFO invalid parameter\n");
                return RMR_INV_ARG;
            }

            u1AddCondition = DRVCUST_GetAddtionalRestrictionCondition();
            *(UINT8 *)pv_get_info = u1AddCondition;
            LOG(2, "DRV_CUSTOM_CUST_SPEC_ADDTIONAL_RESTRICTION_CONDITION \n");
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_GET_MEMC_BYP_SETTING:
        {
            UINT8 u1MjcByp;
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(BOOL)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_GET_MEMC_BYP_SETTING invalid parameter\n");
                return RMR_INV_ARG;
            }

            u1MjcByp = DRVCUST_GetMemcForceModeEnable();
            *(UINT8 *)pv_get_info = u1MjcByp;
            LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_GET_MEMC_BYP_SETTING \n");
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TUNERLESS:
        {
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(UINT32)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_TUNERLESS invalid parameter\n");
                return RMR_INV_ARG;
            }
            *(UINT32 *)pv_get_info = (UINT32)(IsHotPlugTunerLessmode());
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_B2B_HOTEL:
        {
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(UINT32)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_B2B_HOTEL invalid parameter\n");
                return RMR_INV_ARG;
            }
            *(UINT32 *)pv_get_info = (UINT32)(IsB2BHotelMode());
            break;
        }
        case DRV_CUSTOM_CUST_SPEC_TYPE_GET_INTR_MEMC_TYPE:
        {
            UINT8 u1IsIntrMemc;
            if ((pv_get_info == NULL) || (*(pz_size) != sizeof(BOOL)))
            {
                LOG(2, "DRV_CUSTOM_CUST_SPEC_TYPE_GET_INTR_MEMC_TYPE invalid parameter\n");
                return RMR_INV_ARG;
            }

            u1IsIntrMemc = (UINT8)DRVCUST_Get_InterMemc_type();
            *(UINT8 *)pv_get_info = u1IsIntrMemc;
            break;
        }
        default:
            #ifdef DRV_3RD_PARTY_CUSTOM_CUST_SPEC_GET
            return DRV_3RD_PARTY_CUSTOM_CUST_SPEC_GET(e_cust_spec_type,
                                                      pv_get_info,
                                                      pz_size);
            #else
            return RMR_INV_ARG;            
            #endif
    }

    return RMR_OK;
}
#endif  /* IMP_MAPLE_D_CUSTOM_C */
