diff options
Diffstat (limited to 'drivers/media/common')
-rw-r--r-- | drivers/media/common/tuners/mxl5005s.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/media/common/tuners/mxl5005s.c b/drivers/media/common/tuners/mxl5005s.c index 56fe75c94deb..54be9e6faaaf 100644 --- a/drivers/media/common/tuners/mxl5005s.c +++ b/drivers/media/common/tuners/mxl5005s.c | |||
@@ -309,7 +309,6 @@ static u16 MXL_ControlWrite_Group(struct dvb_frontend *fe, u16 controlNum, | |||
309 | static u16 MXL_SetGPIO(struct dvb_frontend *fe, u8 GPIO_Num, u8 GPIO_Val); | 309 | static u16 MXL_SetGPIO(struct dvb_frontend *fe, u8 GPIO_Num, u8 GPIO_Val); |
310 | static u16 MXL_GetInitRegister(struct dvb_frontend *fe, u8 *RegNum, | 310 | static u16 MXL_GetInitRegister(struct dvb_frontend *fe, u8 *RegNum, |
311 | u8 *RegVal, int *count); | 311 | u8 *RegVal, int *count); |
312 | static u32 MXL_GetXtalInt(u32 Xtal_Freq); | ||
313 | static u16 MXL_TuneRF(struct dvb_frontend *fe, u32 RF_Freq); | 312 | static u16 MXL_TuneRF(struct dvb_frontend *fe, u32 RF_Freq); |
314 | static void MXL_SynthIFLO_Calc(struct dvb_frontend *fe); | 313 | static void MXL_SynthIFLO_Calc(struct dvb_frontend *fe); |
315 | static void MXL_SynthRFTGLO_Calc(struct dvb_frontend *fe); | 314 | static void MXL_SynthRFTGLO_Calc(struct dvb_frontend *fe); |
@@ -2307,14 +2306,6 @@ static u16 MXL_IFSynthInit(struct dvb_frontend *fe) | |||
2307 | return status ; | 2306 | return status ; |
2308 | } | 2307 | } |
2309 | 2308 | ||
2310 | static u32 MXL_GetXtalInt(u32 Xtal_Freq) | ||
2311 | { | ||
2312 | if ((Xtal_Freq % 1000000) == 0) | ||
2313 | return (Xtal_Freq / 10000); | ||
2314 | else | ||
2315 | return (((Xtal_Freq / 1000000) + 1)*100); | ||
2316 | } | ||
2317 | |||
2318 | static u16 MXL_TuneRF(struct dvb_frontend *fe, u32 RF_Freq) | 2309 | static u16 MXL_TuneRF(struct dvb_frontend *fe, u32 RF_Freq) |
2319 | { | 2310 | { |
2320 | struct mxl5005s_state *state = fe->tuner_priv; | 2311 | struct mxl5005s_state *state = fe->tuner_priv; |
@@ -2324,13 +2315,10 @@ static u16 MXL_TuneRF(struct dvb_frontend *fe, u32 RF_Freq) | |||
2324 | u32 Kdbl_RF = 2; | 2315 | u32 Kdbl_RF = 2; |
2325 | u32 tg_divval; | 2316 | u32 tg_divval; |
2326 | u32 tg_lo; | 2317 | u32 tg_lo; |
2327 | u32 Xtal_Int; | ||
2328 | 2318 | ||
2329 | u32 Fref_TG; | 2319 | u32 Fref_TG; |
2330 | u32 Fvco; | 2320 | u32 Fvco; |
2331 | 2321 | ||
2332 | Xtal_Int = MXL_GetXtalInt(state->Fxtal); | ||
2333 | |||
2334 | state->RF_IN = RF_Freq; | 2322 | state->RF_IN = RF_Freq; |
2335 | 2323 | ||
2336 | MXL_SynthRFTGLO_Calc(fe); | 2324 | MXL_SynthRFTGLO_Calc(fe); |
@@ -2779,6 +2767,16 @@ static u16 MXL_TuneRF(struct dvb_frontend *fe, u32 RF_Freq) | |||
2779 | tg_lo = (((Fmax/10 - Fvco)/100)*32) / ((Fmax-Fmin)/1000)+8; | 2767 | tg_lo = (((Fmax/10 - Fvco)/100)*32) / ((Fmax-Fmin)/1000)+8; |
2780 | 2768 | ||
2781 | /* below equation is same as above but much harder to debug. | 2769 | /* below equation is same as above but much harder to debug. |
2770 | * | ||
2771 | * static u32 MXL_GetXtalInt(u32 Xtal_Freq) | ||
2772 | * { | ||
2773 | * if ((Xtal_Freq % 1000000) == 0) | ||
2774 | * return (Xtal_Freq / 10000); | ||
2775 | * else | ||
2776 | * return (((Xtal_Freq / 1000000) + 1)*100); | ||
2777 | * } | ||
2778 | * | ||
2779 | * u32 Xtal_Int = MXL_GetXtalInt(state->Fxtal); | ||
2782 | * tg_lo = ( ((Fmax/10000 * Xtal_Int)/100) - | 2780 | * tg_lo = ( ((Fmax/10000 * Xtal_Int)/100) - |
2783 | * ((state->TG_LO/10000)*divider_val * | 2781 | * ((state->TG_LO/10000)*divider_val * |
2784 | * (state->Fxtal/10000)/100) )*32/((Fmax-Fmin)/10000 * | 2782 | * (state->Fxtal/10000)/100) )*32/((Fmax-Fmin)/10000 * |