diff options
Diffstat (limited to 'drivers/media/dvb-frontends/dib7000p.c')
-rw-r--r-- | drivers/media/dvb-frontends/dib7000p.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/media/dvb-frontends/dib7000p.c b/drivers/media/dvb-frontends/dib7000p.c index 3e1eefada0e8..effb87f773b0 100644 --- a/drivers/media/dvb-frontends/dib7000p.c +++ b/drivers/media/dvb-frontends/dib7000p.c | |||
@@ -429,6 +429,13 @@ int dib7000p_get_agc_values(struct dvb_frontend *fe, | |||
429 | } | 429 | } |
430 | EXPORT_SYMBOL(dib7000p_get_agc_values); | 430 | EXPORT_SYMBOL(dib7000p_get_agc_values); |
431 | 431 | ||
432 | int dib7000p_set_agc1_min(struct dvb_frontend *fe, u16 v) | ||
433 | { | ||
434 | struct dib7000p_state *state = fe->demodulator_priv; | ||
435 | return dib7000p_write_word(state, 108, v); | ||
436 | } | ||
437 | EXPORT_SYMBOL(dib7000p_set_agc1_min); | ||
438 | |||
432 | static void dib7000p_reset_pll(struct dib7000p_state *state) | 439 | static void dib7000p_reset_pll(struct dib7000p_state *state) |
433 | { | 440 | { |
434 | struct dibx000_bandwidth_config *bw = &state->cfg.bw[0]; | 441 | struct dibx000_bandwidth_config *bw = &state->cfg.bw[0]; |
@@ -821,6 +828,7 @@ static int dib7000p_agc_startup(struct dvb_frontend *demod) | |||
821 | u8 agc_split; | 828 | u8 agc_split; |
822 | u16 reg; | 829 | u16 reg; |
823 | u32 upd_demod_gain_period = 0x1000; | 830 | u32 upd_demod_gain_period = 0x1000; |
831 | s32 frequency_offset = 0; | ||
824 | 832 | ||
825 | switch (state->agc_state) { | 833 | switch (state->agc_state) { |
826 | case 0: | 834 | case 0: |
@@ -841,7 +849,14 @@ static int dib7000p_agc_startup(struct dvb_frontend *demod) | |||
841 | if (dib7000p_set_agc_config(state, BAND_OF_FREQUENCY(ch->frequency / 1000)) != 0) | 849 | if (dib7000p_set_agc_config(state, BAND_OF_FREQUENCY(ch->frequency / 1000)) != 0) |
842 | return -1; | 850 | return -1; |
843 | 851 | ||
844 | dib7000p_set_dds(state, 0); | 852 | if (demod->ops.tuner_ops.get_frequency) { |
853 | u32 frequency_tuner; | ||
854 | |||
855 | demod->ops.tuner_ops.get_frequency(demod, &frequency_tuner); | ||
856 | frequency_offset = (s32)frequency_tuner / 1000 - ch->frequency / 1000; | ||
857 | } | ||
858 | |||
859 | dib7000p_set_dds(state, frequency_offset); | ||
845 | ret = 7; | 860 | ret = 7; |
846 | (*agc_state)++; | 861 | (*agc_state)++; |
847 | break; | 862 | break; |