module_param(verbose, int, 0644);
+/* Prototypes */
+static void MT2063_AddExclZone(struct MT2063_AvoidSpursData_t *pAS_Info,
+ u32 f_min, u32 f_max);
+static u32 MT2063_ReInit(void *h);
+static u32 MT2063_Close(void *hMT2063);
+static u32 MT2063_GetReg(void *h, u8 reg, u8 * val);
+static u32 MT2063_GetParam(void *h, enum MT2063_Param param, u32 * pValue);
+static u32 MT2063_SetReg(void *h, u8 reg, u8 val);
+static u32 MT2063_SetParam(void *h, enum MT2063_Param param, u32 nValue);
+
/*****************/
/* From drivers/media/common/tuners/mt2063_cfg.h */
** N/A 03-25-2004 DAD Original
**
*****************************************************************************/
-u32 MT2063_WriteSub(void *hUserData,
+static u32 MT2063_WriteSub(void *hUserData,
u32 addr,
u8 subAddress, u8 * pData, u32 cnt)
{
** N/A 03-25-2004 DAD Original
**
*****************************************************************************/
-u32 MT2063_ReadSub(void *hUserData,
+static u32 MT2063_ReadSub(void *hUserData,
u32 addr,
u8 subAddress, u8 * pData, u32 cnt)
{
** N/A 03-25-2004 DAD Original
**
*****************************************************************************/
-void MT2063_Sleep(void *hUserData, u32 nMinDelayTime)
+static void MT2063_Sleep(void *hUserData, u32 nMinDelayTime)
{
/*
** ToDo: Add code here to implement a OS blocking
** better describes what this function does.
**
*****************************************************************************/
-u32 MT2060_TunerGain(void *hUserData, s32 * pMeas)
+static u32 MT2060_TunerGain(void *hUserData, s32 * pMeas)
{
u32 status = MT2063_OK; /* Status to be returned */
static u32 TunerCount = 0;
#endif
-u32 MT2063_RegisterTuner(struct MT2063_AvoidSpursData_t *pAS_Info)
+static u32 MT2063_RegisterTuner(struct MT2063_AvoidSpursData_t *pAS_Info)
{
#if MT2063_TUNER_CNT == 1
pAS_Info->nAS_Algorithm = 1;
#endif
}
-void MT2063_UnRegisterTuner(struct MT2063_AvoidSpursData_t *pAS_Info)
+static void MT2063_UnRegisterTuner(struct MT2063_AvoidSpursData_t *pAS_Info)
{
#if MT2063_TUNER_CNT == 1
pAS_Info;
** N/A I 06-17-2008 RSK Ver 1.19: Refactoring avoidance of DECT
** frequencies into MT_ResetExclZones().
*/
-void MT2063_ResetExclZones(struct MT2063_AvoidSpursData_t *pAS_Info)
+static void MT2063_ResetExclZones(struct MT2063_AvoidSpursData_t *pAS_Info)
{
u32 center;
#if MT2063_TUNER_CNT > 1
** (f_min, f_max) < 0, ignore the entry.
**
*****************************************************************************/
-void MT2063_AddExclZone(struct MT2063_AvoidSpursData_t *pAS_Info,
+static void MT2063_AddExclZone(struct MT2063_AvoidSpursData_t *pAS_Info,
u32 f_min, u32 f_max)
{
struct MT2063_ExclZone_t *pNode = pAS_Info->usedZones;
** Added logic to force f_Center within 1/2 f_Step.
**
*****************************************************************************/
-u32 MT2063_ChooseFirstIF(struct MT2063_AvoidSpursData_t *pAS_Info)
+static u32 MT2063_ChooseFirstIF(struct MT2063_AvoidSpursData_t *pAS_Info)
{
/*
** Update "f_Desired" to be the nearest "combinational-multiple" of "f_LO1_Step".
** 096 04-06-2005 DAD Ver 1.11: Fix divide by 0 error if maxH==0.
**
*****************************************************************************/
-u32 MT2063_AvoidSpurs(void *h, struct MT2063_AvoidSpursData_t * pAS_Info)
+static u32 MT2063_AvoidSpurs(void *h, struct MT2063_AvoidSpursData_t * pAS_Info)
{
u32 status = MT2063_OK;
u32 fm, fp; /* restricted range on LO's */
return (status);
}
-u32 MT2063_AvoidSpursVersion(void)
+static u32 MT2063_AvoidSpursVersion(void)
{
return (MT2063_SPUR_VERSION);
}
** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b.
**
******************************************************************************/
-u32 MT2063_Open(u32 MT2063_Addr, void ** hMT2063, void *hUserData)
+static u32 MT2063_Open(u32 MT2063_Addr, void ** hMT2063, void *hUserData)
{
u32 status = MT2063_OK; /* Status to be returned. */
s32 i;
** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b.
**
******************************************************************************/
-u32 MT2063_Close(void *hMT2063)
+static u32 MT2063_Close(void *hMT2063)
{
struct MT2063_Info_t *pInfo = (struct MT2063_Info_t *)hMT2063;
** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b.
**
******************************************************************************/
-u32 MT2063_GetGPIO(void *h, enum MT2063_GPIO_ID gpio_id,
+static u32 MT2063_GetGPIO(void *h, enum MT2063_GPIO_ID gpio_id,
enum MT2063_GPIO_Attr attr, u32 * value)
{
u32 status = MT2063_OK; /* Status to be returned */
** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b.
**
****************************************************************************/
-u32 MT2063_GetLocked(void *h)
+static u32 MT2063_GetLocked(void *h)
{
const u32 nMaxWait = 100; /* wait a maximum of 100 msec */
const u32 nPollRate = 2; /* poll status bits every 2 ms */
(LO1LK | LO2LK)) {
return (status);
}
- MT2063_Sleep(pInfo->hUserData, nPollRate); /* Wait between retries */
+ msleep(nPollRate); /* Wait between retries */
}
while (++nDelays < nMaxLoops);
** 06-24-2008 PINZ Ver 1.18: Add Get/SetParam CTFILT_SW
**
****************************************************************************/
-u32 MT2063_GetParam(void *h, enum MT2063_Param param, u32 * pValue)
+static u32 MT2063_GetParam(void *h, enum MT2063_Param param, u32 * pValue)
{
u32 status = MT2063_OK; /* Status to be returned */
struct MT2063_Info_t *pInfo = (struct MT2063_Info_t *)h;
** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b.
**
****************************************************************************/
-u32 MT2063_GetReg(void *h, u8 reg, u8 * val)
+static u32 MT2063_GetReg(void *h, u8 reg, u8 * val)
{
u32 status = MT2063_OK; /* Status to be returned */
struct MT2063_Info_t *pInfo = (struct MT2063_Info_t *)h;
** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b.
**
******************************************************************************/
-u32 MT2063_GetTemp(void *h, enum MT2063_Temperature * value)
+static u32 MT2063_GetTemp(void *h, enum MT2063_Temperature * value)
{
u32 status = MT2063_OK; /* Status to be returned */
struct MT2063_Info_t *pInfo = (struct MT2063_Info_t *)h;
** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b.
**
****************************************************************************/
-u32 MT2063_GetUserData(void *h, void ** hUserData)
+static u32 MT2063_GetUserData(void *h, void ** hUserData)
{
u32 status = MT2063_OK; /* Status to be returned */
struct MT2063_Info_t *pInfo = (struct MT2063_Info_t *)h;
** 06-24-2008 PINZ Ver 1.18: Add Get/SetParam CTFILT_SW
**
******************************************************************************/
-u32 MT2063_ReInit(void *h)
+static u32 MT2063_ReInit(void *h)
{
u8 all_resets = 0xF0; /* reset/load bits */
u32 status = MT2063_OK; /* Status to be returned */
s32 maxReads = 10;
while (MT2063_NO_ERROR(status) && (FCRUN != 0)
&& (maxReads-- > 0)) {
- MT2063_Sleep(pInfo->hUserData, 2);
+ msleep(2);
status |= MT2063_ReadSub(pInfo->hUserData,
pInfo->address,
MT2063_REG_XO_STATUS,
** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b.
**
******************************************************************************/
-u32 MT2063_SetGPIO(void *h, enum MT2063_GPIO_ID gpio_id,
+static u32 MT2063_SetGPIO(void *h, enum MT2063_GPIO_ID gpio_id,
enum MT2063_GPIO_Attr attr, u32 value)
{
u32 status = MT2063_OK; /* Status to be returned */
** 06-24-2008 PINZ Ver 1.18: Add Get/SetParam CTFILT_SW
**
****************************************************************************/
-u32 MT2063_SetParam(void *h, enum MT2063_Param param, u32 nValue)
+static u32 MT2063_SetParam(void *h, enum MT2063_Param param, u32 nValue)
{
u32 status = MT2063_OK; /* Status to be returned */
u8 val = 0;
** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b.
**
****************************************************************************/
-u32 MT2063_SetPowerMaskBits(void *h, enum MT2063_Mask_Bits Bits)
+static u32 MT2063_SetPowerMaskBits(void *h, enum MT2063_Mask_Bits Bits)
{
u32 status = MT2063_OK; /* Status to be returned */
struct MT2063_Info_t *pInfo = (struct MT2063_Info_t *)h;
** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b.
**
****************************************************************************/
-u32 MT2063_ClearPowerMaskBits(void *h, enum MT2063_Mask_Bits Bits)
+static u32 MT2063_ClearPowerMaskBits(void *h, enum MT2063_Mask_Bits Bits)
{
u32 status = MT2063_OK; /* Status to be returned */
struct MT2063_Info_t *pInfo = (struct MT2063_Info_t *)h;
** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b.
**
****************************************************************************/
-u32 MT2063_GetPowerMaskBits(void *h, enum MT2063_Mask_Bits * Bits)
+static u32 MT2063_GetPowerMaskBits(void *h, enum MT2063_Mask_Bits * Bits)
{
u32 status = MT2063_OK; /* Status to be returned */
struct MT2063_Info_t *pInfo = (struct MT2063_Info_t *)h;
** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b.
**
****************************************************************************/
-u32 MT2063_EnableExternalShutdown(void *h, u8 Enabled)
+static u32 MT2063_EnableExternalShutdown(void *h, u8 Enabled)
{
u32 status = MT2063_OK; /* Status to be returned */
struct MT2063_Info_t *pInfo = (struct MT2063_Info_t *)h;
** correct wakeup of the LNA
**
****************************************************************************/
-u32 MT2063_SoftwareShutdown(void *h, u8 Shutdown)
+static u32 MT2063_SoftwareShutdown(void *h, u8 Shutdown)
{
u32 status = MT2063_OK; /* Status to be returned */
struct MT2063_Info_t *pInfo = (struct MT2063_Info_t *)h;
** 189 S 05-13-2008 RSK Ver 1.16: Correct location for ExtSRO control.
**
****************************************************************************/
-u32 MT2063_SetExtSRO(void *h, enum MT2063_Ext_SRO Ext_SRO_Setting)
+static u32 MT2063_SetExtSRO(void *h, enum MT2063_Ext_SRO Ext_SRO_Setting)
{
u32 status = MT2063_OK; /* Status to be returned */
struct MT2063_Info_t *pInfo = (struct MT2063_Info_t *)h;
** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b.
**
****************************************************************************/
-u32 MT2063_SetReg(void *h, u8 reg, u8 val)
+static u32 MT2063_SetReg(void *h, u8 reg, u8 val)
{
u32 status = MT2063_OK; /* Status to be returned */
struct MT2063_Info_t *pInfo = (struct MT2063_Info_t *)h;
** 06-24-2008 PINZ Ver 1.18: Add Get/SetParam CTFILT_SW
**
****************************************************************************/
-u32 MT2063_Tune(void *h, u32 f_in)
+static u32 MT2063_Tune(void *h, u32 f_in)
{ /* RF input center frequency */
struct MT2063_Info_t *pInfo = (struct MT2063_Info_t *)h;
return (status);
}
-u32 MT_Tune_atv(void *h, u32 f_in, u32 bw_in,
+static u32 MT_Tune_atv(void *h, u32 f_in, u32 bw_in,
enum MTTune_atv_standard tv_type)
{
return 0;
}
-static int mt2063_sleep(struct dvb_frontend *fe)
-{
- /* TODO: power down */
- return 0;
-}
-
static int mt2063_get_status(struct dvb_frontend *fe, u32 * status)
{
int rc = 0;
},
.init = mt2063_init,
- .sleep = mt2063_sleep,
+ .sleep = MT2063_Sleep,
.get_status = mt2063_get_status,
.get_state = mt2063_get_state,
.set_state = mt2063_set_state,
#define MT2063_TUNER_CNT (1) /* total num of MicroTuner tuners */
#define MT2063_I2C (0xC0)
-u32 MT2063_WriteSub(void *hUserData,
- u32 addr,
- u8 subAddress, u8 * pData, u32 cnt);
-
-u32 MT2063_ReadSub(void *hUserData,
- u32 addr,
- u8 subAddress, u8 * pData, u32 cnt);
-
-void MT2063_Sleep(void *hUserData, u32 nMinDelayTime);
-
-u32 MT2060_TunerGain(void *hUserData, s32 * pMeas);
-
/*
* Constant defining the version of the following structure
* and therefore the API for this code.
struct MT2063_ExclZone_t MT2063_ExclZones[MT2063_MAX_ZONES];
};
-u32 MT2063_RegisterTuner(struct MT2063_AvoidSpursData_t *pAS_Info);
-
-void MT2063_UnRegisterTuner(struct MT2063_AvoidSpursData_t *pAS_Info);
-
-void MT2063_ResetExclZones(struct MT2063_AvoidSpursData_t *pAS_Info);
-
-void MT2063_AddExclZone(struct MT2063_AvoidSpursData_t *pAS_Info,
- u32 f_min, u32 f_max);
-
-u32 MT2063_ChooseFirstIF(struct MT2063_AvoidSpursData_t *pAS_Info);
-
-u32 MT2063_AvoidSpurs(void *h, struct MT2063_AvoidSpursData_t *pAS_Info);
-
-u32 MT2063_AvoidSpursVersion(void);
-
-
/*
* Values returned by the MT2063's on-chip temperature sensor
* to be read/written.
MTTUNEA_DVBT
};
-/* ====== Functions which are declared in MT2063.c File ======= */
-
-u32 MT2063_Open(u32 MT2063_Addr,
- void ** hMT2063, void *hUserData);
-
-u32 MT2063_Close(void *hMT2063);
-
-u32 MT2063_Tune(void *h, u32 f_in); /* RF input center frequency */
-
-u32 MT2063_GetGPIO(void *h, enum MT2063_GPIO_ID gpio_id,
- enum MT2063_GPIO_Attr attr, u32 * value);
-
-u32 MT2063_GetLocked(void *h);
-
-u32 MT2063_GetParam(void *h, enum MT2063_Param param, u32 * pValue);
-
-u32 MT2063_GetReg(void *h, u8 reg, u8 * val);
-
-u32 MT2063_GetTemp(void *h, enum MT2063_Temperature *value);
-
-u32 MT2063_GetUserData(void *h, void ** hUserData);
-
-u32 MT2063_ReInit(void *h);
-
-u32 MT2063_SetGPIO(void *h, enum MT2063_GPIO_ID gpio_id,
- enum MT2063_GPIO_Attr attr, u32 value);
-
-u32 MT2063_SetParam(void *h, enum MT2063_Param param, u32 nValue);
-
-u32 MT2063_SetPowerMaskBits(void *h, enum MT2063_Mask_Bits Bits);
-
-u32 MT2063_ClearPowerMaskBits(void *h, enum MT2063_Mask_Bits Bits);
-
-u32 MT2063_GetPowerMaskBits(void *h, enum MT2063_Mask_Bits *Bits);
-
-u32 MT2063_EnableExternalShutdown(void *h, u8 Enabled);
-
-u32 MT2063_SoftwareShutdown(void *h, u8 Shutdown);
-
-u32 MT2063_SetExtSRO(void *h, enum MT2063_Ext_SRO Ext_SRO_Setting);
-
-u32 MT2063_SetReg(void *h, u8 reg, u8 val);
-
-u32 MT_Tune_atv(void *h, u32 f_in, u32 bw_in,
- enum MTTune_atv_standard tv_type);
-
struct mt2063_config {
u8 tuner_address;
u32 refclock;