Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 271750
b: refs/heads/master
c: d3bcaf0
h: refs/heads/master
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Sep 6, 2011
1 parent c405aa6 commit 060612a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2122eaf64acd9ca42645b4bf8f222c7d452313f1
refs/heads/master: d3bcaf083bb7a081b280a04898f7c9f68e1253d4
22 changes: 10 additions & 12 deletions trunk/drivers/media/common/tuners/mxl5005s.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ static u16 MXL_ControlWrite_Group(struct dvb_frontend *fe, u16 controlNum,
static u16 MXL_SetGPIO(struct dvb_frontend *fe, u8 GPIO_Num, u8 GPIO_Val);
static u16 MXL_GetInitRegister(struct dvb_frontend *fe, u8 *RegNum,
u8 *RegVal, int *count);
static u32 MXL_GetXtalInt(u32 Xtal_Freq);
static u16 MXL_TuneRF(struct dvb_frontend *fe, u32 RF_Freq);
static void MXL_SynthIFLO_Calc(struct dvb_frontend *fe);
static void MXL_SynthRFTGLO_Calc(struct dvb_frontend *fe);
Expand Down Expand Up @@ -2307,14 +2306,6 @@ static u16 MXL_IFSynthInit(struct dvb_frontend *fe)
return status ;
}

static u32 MXL_GetXtalInt(u32 Xtal_Freq)
{
if ((Xtal_Freq % 1000000) == 0)
return (Xtal_Freq / 10000);
else
return (((Xtal_Freq / 1000000) + 1)*100);
}

static u16 MXL_TuneRF(struct dvb_frontend *fe, u32 RF_Freq)
{
struct mxl5005s_state *state = fe->tuner_priv;
Expand All @@ -2324,13 +2315,10 @@ static u16 MXL_TuneRF(struct dvb_frontend *fe, u32 RF_Freq)
u32 Kdbl_RF = 2;
u32 tg_divval;
u32 tg_lo;
u32 Xtal_Int;

u32 Fref_TG;
u32 Fvco;

Xtal_Int = MXL_GetXtalInt(state->Fxtal);

state->RF_IN = RF_Freq;

MXL_SynthRFTGLO_Calc(fe);
Expand Down Expand Up @@ -2779,6 +2767,16 @@ static u16 MXL_TuneRF(struct dvb_frontend *fe, u32 RF_Freq)
tg_lo = (((Fmax/10 - Fvco)/100)*32) / ((Fmax-Fmin)/1000)+8;

/* below equation is same as above but much harder to debug.
*
* static u32 MXL_GetXtalInt(u32 Xtal_Freq)
* {
* if ((Xtal_Freq % 1000000) == 0)
* return (Xtal_Freq / 10000);
* else
* return (((Xtal_Freq / 1000000) + 1)*100);
* }
*
* u32 Xtal_Int = MXL_GetXtalInt(state->Fxtal);
* tg_lo = ( ((Fmax/10000 * Xtal_Int)/100) -
* ((state->TG_LO/10000)*divider_val *
* (state->Fxtal/10000)/100) )*32/((Fmax-Fmin)/10000 *
Expand Down

0 comments on commit 060612a

Please sign in to comment.