123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348 |
- /******************************************************************************
- ** File Name: drv_tuner_internal.h
- **
- ** File Description: This file implements frontend modules apis.
- **
- ** Copyright(c) 2011 S2 Technologies - All Rights Reserved.
- **
- ** History Information Description
- ** Date Author Modification
- ** -------------------------------------------------------------
- ** 2011/01/24 TonyChung Create
- ******************************************************************************/
- #ifndef _DRV_TUNER_INTERNAL_H_
- #define _DRV_TUNER_INTERNAL_H_
- /******************************************************************************
- * Header include
- *****************************************************************************/
- #include "drv_types.h"
- #include <drv_tuner_external.h> // Weird include
- #ifdef __KERNEL__
- #include <linux/version.h>
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)
- #include <asm/swab.h>
- #include <linux/slab.h> //for new_kernal
- #endif
- #include <linux/kref.h> // kref_init()/kref_put()
- #include <linux/module.h>
- #include <linux/compiler.h>
- #include <linux/init.h>
- #include <linux/ioctl.h> /* needed for the _IOW etc stuff used later */
- #endif
- /******************************************************************************
- * Constant
- *****************************************************************************/
- /******************************************************************************
- * Enumeration
- ******************************************************************************/
- typedef enum {
- ATV_UNKNOW = -1,
- ATV_NTSC,
- ATV_PAL_M,
- ATV_PAL_N,
- ATV_PAL_DK,
- ATV_PAL_BG,
- ATV_PAL_I,
- ATV_SECAM_L,
- ATV_SECAM_L1,
- ATV_SECAM_DK,
- ATV_SECAM_BG,
- ATV_NTSC443,
- ATV_NTSC443_DK,
- ATV_NTSC443_BG,
- ATV_NTSC443_I,
- ATV_NTSC_DK,
- ATV_NTSC_BG,
- ATV_NTSC_I,
- ATV_PAL_UNKNOWN,
- ATV_SECAM_UNKNOWN,
- ATV_END
- }ATVModulationMode;
- /*!
- \enum DRV_Frontend_GPIO_Pin_Def_t
- \brief external tuner/demod gpio pin def
- */
- typedef enum
- {
- DRV_FRONTEND_SI2157_GPIO1, //SI2157 pin 1 , GPIO1
- DRV_FRONTEND_SI2157_GPIO2, //SI2157 pin 1 , GPIO1
- DRV_FRONTEND_SI2158_GPIO1, //SI2158 pin 1 , GPIO1
- DRV_FRONTEND_SI2158_GPIO2, //SI2158 pin 2 , GPIO2
- DRV_FRONTEND_PANASONIC_MN88472_GPIO0, //PANASONIC_MN88472 pin 16 , GPIO0
- } DRV_Frontend_GPIO_Pin_Def_t;
- typedef enum
- {
- DRV_FRONTEND_GPO_LOW = 0, //GPO output low level
- DRV_FRONTEND_GPO_HIGH, //GPO output high level
- } DRV_Frontend_GPO_OutputValue_t;
- typedef struct
- {
- DRV_Frontend_GPIO_Pin_Def_t eGPIO_Pin_Def;
- DRV_Frontend_GPO_OutputValue_t eOutPutValue;
- }sFrontEnd_GPO_Pin_Def_OutputValue;
- /*!
- * @brief Digital TS mode
- */
- typedef enum
- {
- FRONTEND_TS_MODE_Serial = 0,
- FRONTEND_TS_MODE_Parallel,
- FRONTEND_TS_MODE_MAX,
- } DRV_Frontend_TS_Mode_t;
- /*!
- * @brief LNB Power Switch.
- */
- typedef enum
- {
- FRONTEND_LNB_Disable = 0, /**< Disable LNB power */
- FRONTEND_LNB_Enable, /**< Enable LNB power */
- FRONTEND_LNB_MAX,
- }DRV_Frontend_LNB_PowerType_e;
- /*!
- * @brief LNB 22k Tone Switch.
- */
- typedef enum
- {
- FRONTEND_LNB_22kTone_ON = 0, /**< Enable 22k tone */
- FRONTEND_LNB_22kTone_OFF, /**< Disable 22k tone */
- FRONTEND_LNB_22kTone_MAX,
- }DRV_Frontend_LNB_22kTone_e;
- /*!
- * @brief LNB Voltage Type.
- */
- typedef enum
- {
- FRONTEND_LNB_Voltage_13V = 0, /**< LNB polarization voltage: 13V */
- FRONTEND_LNB_Voltage_18V, /**< LNB polarization voltage: 18V */
- FRONTEND_LNB_Voltage_MAX,
- }DRV_Frontend_LNB_VoltageType_e;
- /*!
- * @brief LNB 22k Tone Switch.
- */
- typedef enum
- {
- FRONTEND_LNB_ToneBurst_A = 0, /**< Enable ToneBurst A */
- FRONTEND_LNB_ToneBurst_B, /**< Enable ToneBurst B */
- FRONTEND_LNB_ToneBurst_OFF, /**< Disable ToneBurst */
- FRONTEND_LNB_Tone_MAX,
- }DRV_Frontend_LNB_ToneBurst_e;
- typedef struct _TunerFreqRequest_t
- {
- unsigned int Freq;
- unsigned int ulSymbolRate;
- unsigned char ModulationMode;
- unsigned int BandWidth;
- unsigned int Cmd[20];
- #if defined(CONFIG_ISDB_SYSTEM) //kenny added for ISDB-T need three Dword to store Layer A, B & C parameters 2012/05/25
- unsigned long UccpLockInfo[3];
- #else
- unsigned long UccpLockInfo;
- #endif
- unsigned char ExtDemodFlag; // for external DTV demod
- int PlpId;
- unsigned int CmdLength; // for ATV demod
- int bLock;
- int FreqOffset;
- DRV_RfFrontend_Std_t Std;
- unsigned int RegAddr; // for tunerap
- unsigned int RegAddrStartBit;// for tunerap
- unsigned int RegLength; // for tunerap
- unsigned int RegValue; // for tunerap
- DRV_Frontend_Spectral_Inversion_t invert_spectrum;
- } TunerFreqRequest_t, * PTunerFreqRequest_t;
- //SIF request type
- typedef enum {
- DEMODATV_SifReqNormalSleep,
- DEMODATV_SifReqNormalWakeUp,
- DEMODATV_SifReqForceSleep,
- DEMODATV_SifReqForceWakeUp,
- DEMODATV_SifReqMax
- } demodatv_TypeSifReq, *demodatv_pTypeSifReq;
- typedef enum {
- DEMODATV_SifReqStsOK,
- DEMODATV_SifReqStsFail,
- DEMODATV_SifReqStsMax
- } demodatv_TypeSifReqSts, *demodatv_pTypeSifReqSts;
- typedef struct {
- demodatv_TypeSifReq req;
- demodatv_TypeSifReqSts status;
- } demodatv_TypeSif, *demodatv_pTypeSif;
- //---//
- //Request type
- typedef enum {
- DEMODATV_ReqSetVIFTop,
- DEMODATV_ReqSetAudioSys,
- DEMODATV_ReqSetAFTOn,
- DEMODATV_ReqSetFilter,
- DEMODATV_ReqMax
- } demodatv_TypeReq, *demodatv_pTypeReq;
- typedef enum {
- DEMODATV_ReqStsOK,
- DEMODATV_ReqStsFail,
- DEMODATV_ReqStsMax
- } demodatv_TypeReqSts, *demodatv_pTypeReqSts;
- typedef enum {
- DEMODATV_SetNtscFilter,
- DEMODATV_SetPalFilter,
- DEMODATV_SetSecamFilter,
- DEMODATV_SetMaxFilter
- } demodatv_TypeFilter, *demodatv_pTypeFilter;
- typedef struct {
- demodatv_TypeReq req;
- unsigned char value;
- demodatv_TypeFilter filter;
- PTunerFreqRequest_t pFreqRequest;
- demodatv_TypeReqSts status;
- } tuner_TypeReq, *tuner_pTypeReq;
- typedef enum {
- Ademod_Type_CVBSInverseSts,
- Ademod_Type_GetAudioCarrier,
- Ademod_Type_SetNarrowLPF49MFIR,
- Ademod_Type_SetScanLPF49MFIR,
- Ademod_Type_GetAdemodStatus,
- Ademod_Type_SetStopPolling,
- Ademod_Type_SetInverseNyquist,
- Ademod_Type_ResetPLL,
- Ademod_Type_CheckSpur,
- Ademod_Type_EnClkForCheckSpur,
- Ademod_Type_SetCVBSInverse,
- Ademod_Type_GetORSTStatus,
- Ademod_Type_Max
- } Ademod_Type, *Ademod_pType;
- typedef enum {
- Ademod_CVBS_NonInverse,
- Ademod_CVBS_Inverse
- } Ademod_InverseSts, *Ademod_pInverseSts;
- typedef enum {
- Ademod_NonStdSts_FALSE,
- Ademod_NonStdSts_TRUE
- } Ademod_mode_NonStdSts, *Ademod_pmode_NonStdSts;
- typedef enum {
- Ademod_mode_PLLSts_FALSE,
- Ademod_mode_PLLSts_TRUE
- } Ademod_mode_PLLSts, *Ademod_pmode_PLLSts;
- typedef enum {
- Ademod_ReqStsFail,
- Ademod_ReqStsOK
- } Ademod_ReqSts, *Ademod_pReqSts;
- typedef struct {
- Ademod_Type type;
- Ademod_InverseSts inverseSts;
- Ademod_mode_NonStdSts modeNonStdSts;
- Ademod_mode_PLLSts modePLLSts;
- Ademod_ReqSts status;
- unsigned int value;
- } Ademod_Request_Type, *Ademod_pRequest_Type;
- typedef enum {
- DEMOD_ReqSetTsoClkInvertMode,//Rising-Edge
- DEMOD_ReqSetTsoClkNormalMode,//Falling-Edge
- DEMOD_ReqMax
- } demod_TypeReqCmd, *demod_pTypeReqCmd;
- typedef struct {
- demod_TypeReqCmd req;
- } demod_TypeReq, *demod_pTypeReq;
- //---//
- /*--------------------------------------
- * indicate the request to tuner power on/off
- */
- typedef enum{
- TUNER_PowerOn,
- TUNER_PowerOff,
- TUNER_PowerDefault = TUNER_PowerOff
- } tuner_TypePower, *tuner_pTypePower;
- /*--------------------------------------
- * indicate the status of tuner power on/off
- */
- typedef enum{
- TUNER_PowerStsOn,
- TUNER_PowerStsOff,
- TUNER_PowerStsDefault = TUNER_PowerStsOff
- } tuner_TyPowerSts, *tuner_pTyPowerSts;
- /*--------------------------------------
- * indicate the request for ATV or DTV
- */
- typedef enum{
- TUNER_TvTypeAtv,
- TUNER_TvTypeDtv,
- TUNER_TvTypeMax
- } tuner_TypeTvType, *tuner_pTypeTvType;
- /*--------------------------------------
- * indicate the current input source
- */
- typedef enum{
- TUNER_InputSourceAtv,
- TUNER_InputSourceDtv,
- TUNER_InputSourceAv,
- TUNER_InputSourceAv2,
- TUNER_InputSourceSv,
- TUNER_InputSourceSv2,
- TUNER_InputSourceComponent,
- TUNER_InputSourceScart1Av,
- TUNER_InputSourceScart1Sv,
- TUNER_InputSourceScart1Auto,
- TUNER_InputSourceScart2Av,
- TUNER_InputSourceScart2Sv,
- TUNER_InputSourceScart2Auto,
- TUNER_InputSourceMax
- } tuner_TypeInputSource, *tuner_pTypeInputSource;
- //extern unsigned int kmf_GetProjectTunerID(void);
- extern int DRV_FrontendCtrl(DRV_Frontend_Cmd dCmd, void *pdPara);
- extern int _DRV_Ademod_Request(Ademod_pRequest_Type pRequest);
- extern int DRV_ADEMOD_SetInverseCVBS(UINT8 vaule);
- #endif // _DRV_TUNER_INTERNAL_H_
|