fe->ops.i2c_gate_ctrl(fe, 0);
if (ret < 0)
- printk("mt2063_writeregs error ret=%d\n", ret);
+ printk(KERN_ERR "%s error ret=%d\n", __func__, ret);
return ret;
}
return 0;
}
-
/*
* mt2063_read - Read data from the I2C bus
*/
break;
}
fe->ops.i2c_gate_ctrl(fe, 0);
- return (status);
+ return status;
}
/*
((f_Desired - pAS_Info->f_if1_Center +
f_Step / 2) / f_Step);
- //assert;
- //if (!abs((s32) f_Center - (s32) pAS_Info->f_if1_Center) <= (s32) (f_Step/2))
- // return 0;
-
/* Take MT_ExclZones, center around f_Center and change the resolution to f_Step */
while (pNode != NULL) {
/* floor function */
zones[j - 1].max_ = tmpMax;
else {
/* Add new zone */
- //assert(j<MT2063_MAX_ZONES);
- //if (j>=MT2063_MAX_ZONES)
- //break;
-
zones[j].min_ = tmpMin;
zones[j].max_ = tmpMax;
j++;
delta_IF1 = zfIF1 - pAS_Info->f_if1_Center;
else
delta_IF1 = pAS_Info->f_if1_Center - zfIF1;
- }
+
+ pAS_Info->bSpurPresent = IsSpurInBand(pAS_Info, &fm, &fp);
/*
** Continue while the new 1st IF is still within the 1st IF bandwidth
** and there is a spur in the band (again)
*/
- while ((2 * delta_IF1 + pAS_Info->f_out_bw <=
- pAS_Info->f_if1_bw)
- && (pAS_Info->bSpurPresent =
- IsSpurInBand(pAS_Info, &fm, &fp)));
+ } while ((2 * delta_IF1 + pAS_Info->f_out_bw <= pAS_Info->f_if1_bw) && pAS_Info->bSpurPresent);
/*
** Use the LO-spur free values found. If the search went all the way to
((pAS_Info->
nSpursFound << MT2063_SPUR_SHIFT) & MT2063_SPUR_CNT_MASK);
- return (status);
+ return status;
}
-/*
-** The expected version of MT_AvoidSpursData_t
-** If the version is different, an updated file is needed from Microtune
-*/
-
-typedef enum {
- MT2063_SET_ATTEN,
- MT2063_INCR_ATTEN,
- MT2063_DECR_ATTEN
-} MT2063_ATTEN_CNTL_MODE;
/*
* Constants used by the tuning algorithm
return TUNER_STATUS_LOCKED | TUNER_STATUS_STEREO;
}
msleep(nPollRate); /* Wait between retries */
- }
- while (++nDelays < nMaxLoops);
+ } while (++nDelays < nMaxLoops);
/*
* Got no lock or partial lock
* mt2063_set_dnc_output_enable()
*/
static u32 mt2063_get_dnc_output_enable(struct mt2063_state *state,
- enum MT2063_DNC_Output_Enable *pValue)
+ enum MT2063_DNC_Output_Enable *pValue)
{
if ((state->reg[MT2063_REG_DNC_GAIN] & 0x03) == 0x03) { /* if DNC1 is off */
if ((state->reg[MT2063_REG_VGA_GAIN] & 0x03) == 0x03) /* if DNC2 is off */
* mt2063_set_dnc_output_enable()
*/
static u32 mt2063_set_dnc_output_enable(struct mt2063_state *state,
- enum MT2063_DNC_Output_Enable nValue)
+ enum MT2063_DNC_Output_Enable nValue)
{
u32 status = 0; /* Status to be returned */
u8 val = 0;
break;
}
- return (status);
+ return status;
}
/******************************************************************************
if (status >= 0) {
val =
(state->
- reg[MT2063_REG_PD1_TGT] & (u8) ~ 0x40) | (RFAGCEN[Mode]
+ reg[MT2063_REG_PD1_TGT] & (u8) ~0x40) | (RFAGCEN[Mode]
? 0x40 :
0x00);
- if (state->reg[MT2063_REG_PD1_TGT] != val) {
+ if (state->reg[MT2063_REG_PD1_TGT] != val)
status |= mt2063_setreg(state, MT2063_REG_PD1_TGT, val);
- }
}
/* LNARin */
if (status >= 0) {
- u8 val = (state-> reg[MT2063_REG_CTRL_2C] & (u8) ~ 0x03) |
+ u8 val = (state->reg[MT2063_REG_CTRL_2C] & (u8) ~0x03) |
(LNARIN[Mode] & 0x03);
if (state->reg[MT2063_REG_CTRL_2C] != val)
- status |= mt2063_setreg(state, MT2063_REG_CTRL_2C,
- val);
+ status |= mt2063_setreg(state, MT2063_REG_CTRL_2C, val);
}
/* FIFFQEN and FIFFQ */
if (status >= 0) {
val =
(state->
- reg[MT2063_REG_FIFF_CTRL2] & (u8) ~ 0xF0) |
+ reg[MT2063_REG_FIFF_CTRL2] & (u8) ~0xF0) |
(FIFFQEN[Mode] << 7) | (FIFFQ[Mode] << 4);
if (state->reg[MT2063_REG_FIFF_CTRL2] != val) {
status |=
mt2063_setreg(state, MT2063_REG_FIFF_CTRL, val);
val =
(state->
- reg[MT2063_REG_FIFF_CTRL] & (u8) ~ 0x01);
+ reg[MT2063_REG_FIFF_CTRL] & (u8) ~0x01);
status |=
mt2063_setreg(state, MT2063_REG_FIFF_CTRL, val);
}
/* acLNAmax */
if (status >= 0) {
- u8 val = (state-> reg[MT2063_REG_LNA_OV] & (u8) ~ 0x1F) |
+ u8 val = (state->reg[MT2063_REG_LNA_OV] & (u8) ~0x1F) |
(ACLNAMAX[Mode] & 0x1F);
if (state->reg[MT2063_REG_LNA_OV] != val)
status |= mt2063_setreg(state, MT2063_REG_LNA_OV, val);
/* LNATGT */
if (status >= 0) {
- u8 val = (state-> reg[MT2063_REG_LNA_TGT] & (u8) ~ 0x3F) |
+ u8 val = (state->reg[MT2063_REG_LNA_TGT] & (u8) ~0x3F) |
(LNATGT[Mode] & 0x3F);
if (state->reg[MT2063_REG_LNA_TGT] != val)
status |= mt2063_setreg(state, MT2063_REG_LNA_TGT, val);
/* ACRF */
if (status >= 0) {
- u8 val = (state-> reg[MT2063_REG_RF_OV] & (u8) ~ 0x1F) |
- (ACRFMAX[Mode] & 0x1F);
+ u8 val = (state->reg[MT2063_REG_RF_OV] & (u8) ~0x1F) |
+ (ACRFMAX[Mode] & 0x1F);
if (state->reg[MT2063_REG_RF_OV] != val)
status |= mt2063_setreg(state, MT2063_REG_RF_OV, val);
}
/* PD1TGT */
if (status >= 0) {
- u8 val = (state-> reg[MT2063_REG_PD1_TGT] & (u8) ~ 0x3F) |
+ u8 val = (state->reg[MT2063_REG_PD1_TGT] & (u8) ~0x3F) |
(PD1TGT[Mode] & 0x3F);
if (state->reg[MT2063_REG_PD1_TGT] != val)
status |= mt2063_setreg(state, MT2063_REG_PD1_TGT, val);
u8 val = ACFIFMAX[Mode];
if (state->reg[MT2063_REG_PART_REV] != MT2063_B3 && val > 5)
val = 5;
- val = (state-> reg[MT2063_REG_FIF_OV] & (u8) ~ 0x1F) |
+ val = (state->reg[MT2063_REG_FIF_OV] & (u8) ~0x1F) |
(val & 0x1F);
- if (state->reg[MT2063_REG_FIF_OV] != val) {
+ if (state->reg[MT2063_REG_FIF_OV] != val)
status |= mt2063_setreg(state, MT2063_REG_FIF_OV, val);
- }
}
/* PD2TGT */
if (status >= 0) {
- u8 val = (state-> reg[MT2063_REG_PD2_TGT] & (u8) ~ 0x3F) |
+ u8 val = (state->reg[MT2063_REG_PD2_TGT] & (u8) ~0x3F) |
(PD2TGT[Mode] & 0x3F);
if (state->reg[MT2063_REG_PD2_TGT] != val)
status |= mt2063_setreg(state, MT2063_REG_PD2_TGT, val);
/* Ignore ATN Overload */
if (status >= 0) {
- val =
- (state->
- reg[MT2063_REG_LNA_TGT] & (u8) ~ 0x80) | (RFOVDIS[Mode]
- ? 0x80 :
- 0x00);
- if (state->reg[MT2063_REG_LNA_TGT] != val) {
+ val = (state->reg[MT2063_REG_LNA_TGT] & (u8) ~0x80) |
+ (RFOVDIS[Mode] ? 0x80 : 0x00);
+ if (state->reg[MT2063_REG_LNA_TGT] != val)
status |= mt2063_setreg(state, MT2063_REG_LNA_TGT, val);
- }
}
/* Ignore FIF Overload */
if (status >= 0) {
- val =
- (state->
- reg[MT2063_REG_PD1_TGT] & (u8) ~ 0x80) |
- (FIFOVDIS[Mode] ? 0x80 : 0x00);
- if (state->reg[MT2063_REG_PD1_TGT] != val) {
+ val = (state->reg[MT2063_REG_PD1_TGT] & (u8) ~0x80) |
+ (FIFOVDIS[Mode] ? 0x80 : 0x00);
+ if (state->reg[MT2063_REG_PD1_TGT] != val)
status |= mt2063_setreg(state, MT2063_REG_PD1_TGT, val);
- }
}
if (status >= 0)
state->rcvr_mode = Mode;
- return (status);
+ return status;
}
/****************************************************************************
&state->reg[MT2063_REG_PWR_1], 1);
}
- return (status);
+ return status;
}
/****************************************************************************
u32 loss = t1 % denom;
u32 term2 =
(((f_ref & 0x00003FFF) * num + (loss << 14)) + (denom / 2)) / denom;
- return ((term1 << 14) + term2);
+ return (term1 << 14) + term2;
}
/****************************************************************************
** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b.
**
****************************************************************************/
-static u32 MT2063_CalcLO1Mult(u32 * Div,
- u32 * FracN,
+static u32 MT2063_CalcLO1Mult(u32 *Div,
+ u32 *FracN,
u32 f_LO,
u32 f_LO_Step, u32 f_Ref)
{
** 138 06-19-2007 DAD Ver 1.00: Initial, derived from mt2067_b.
**
****************************************************************************/
-static u32 MT2063_CalcLO2Mult(u32 * Div,
- u32 * FracN,
+static u32 MT2063_CalcLO2Mult(u32 *Div,
+ u32 *FracN,
u32 f_LO,
u32 f_LO_Step, u32 f_Ref)
{
pict2snd1 = 0;
pict2snd2 = 0;
rcvr_mode = 4;
- //f_in -= 2900000;
break;
}
case MTTUNEA_DVBC:{
}
case MTTUNEA_DVBT:{
pict_car = 36125000;
- ch_bw = bw_in; //8000000
+ ch_bw = bw_in;
pict2chanb_vsb = -(ch_bw / 2);
pict2snd1 = 0;
pict2snd2 = 0;
state->AS_Data.f_out_bw = ch_bw + 750000;
status = MT2063_SetReceiverMode(state, rcvr_mode);
if (status < 0)
- return status;
+ return status;
status = MT2063_Tune(state, (f_in + (pict2chanb_vsb + (ch_bw / 2))));
/* Check the part/rev code */
if (((state->reg[MT2063_REG_PART_REV] != MT2063_B0) /* MT2063 B0 */
- &&(state->reg[MT2063_REG_PART_REV] != MT2063_B1) /* MT2063 B1 */
- &&(state->reg[MT2063_REG_PART_REV] != MT2063_B3))) /* MT2063 B3 */
+ && (state->reg[MT2063_REG_PART_REV] != MT2063_B1) /* MT2063 B1 */
+ && (state->reg[MT2063_REG_PART_REV] != MT2063_B3))) /* MT2063 B3 */
return -ENODEV; /* Wrong tuner Part/Rev code */
/* Check the 2nd byte of the Part/Rev code from the tuner */
&state->reg[MT2063_REG_RSVD_3B], 1);
/* b7 != 0 ==> NOT MT2063 */
- if (status < 0 ||((state->reg[MT2063_REG_RSVD_3B] & 0x80) != 0x00))
+ if (status < 0 || ((state->reg[MT2063_REG_RSVD_3B] & 0x80) != 0x00))
return -ENODEV; /* Wrong tuner Part/Rev code */
/* Reset the tuner */
/* Adjust each of the values in the ClearTune filter cross-over table */
for (i = 0; i < 31; i++)
- state->CTFiltMax[i] =(state->CTFiltMax[i] / 768) * (fcu_osc + 640);
+ state->CTFiltMax[i] = (state->CTFiltMax[i] / 768) * (fcu_osc + 640);
status = MT2063_SoftwareShutdown(state, 1);
if (status < 0)
switch (param) {
case DVBFE_TUNER_FREQUENCY:
- //get frequency
+ /* get frequency */
break;
case DVBFE_TUNER_TUNERSTEP:
break;
case DVBFE_TUNER_IFFREQ:
break;
case DVBFE_TUNER_BANDWIDTH:
- //get bandwidth
+ /* get bandwidth */
break;
case DVBFE_TUNER_REFCLOCK:
tunstate->refclock = mt2063_lockStatus(state);
switch (param) {
case DVBFE_TUNER_FREQUENCY:
- //set frequency
+ /* set frequency */
status =
mt2063_setTune(fe,
case DVBFE_TUNER_IFFREQ:
break;
case DVBFE_TUNER_BANDWIDTH:
- //set bandwidth
+ /* set bandwidth */
state->bandwidth = tunstate->bandwidth;
break;
case DVBFE_TUNER_REFCLOCK:
fe->tuner_priv = state;
fe->ops.tuner_ops = mt2063_ops;
- printk("%s: Attaching MT2063 \n", __func__);
+ printk(KERN_INFO "%s: Attaching MT2063\n", __func__);
return fe;
error: