diff options
author | Manu Abraham <manu@linuxtv.org> | 2009-04-16 15:40:36 +0400 |
---|---|---|
committer | Manu Abraham <manu@linuxtv.org> | 2009-04-16 15:40:36 +0400 |
commit | d69148350fa7fb334ad5ab1fc2e972a74de82970 (patch) | |
tree | 97d5df6ee6d2f8cc537f0de196bb4afc00cba836 /linux | |
parent | 9cb965cb8b28ed6832410d2b6b5f709f08bb3a47 (diff) | |
download | mediapointer-dvb-s2-d69148350fa7fb334ad5ab1fc2e972a74de82970.tar.gz mediapointer-dvb-s2-d69148350fa7fb334ad5ab1fc2e972a74de82970.tar.bz2 |
Fix Rolloff
From: Andreas Regel <andreas.regel@gmx.de>
Signed-off-by: Andreas Regel <andreas.regel@gmx.de>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/dvb/frontends/stv090x.c | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/linux/drivers/media/dvb/frontends/stv090x.c b/linux/drivers/media/dvb/frontends/stv090x.c index 2c7b5e6e3..b28bb081d 100644 --- a/linux/drivers/media/dvb/frontends/stv090x.c +++ b/linux/drivers/media/dvb/frontends/stv090x.c @@ -1592,9 +1592,24 @@ err: return -1; } -static u32 stv090x_car_width(u32 srate, u32 rolloff) +static u32 stv090x_car_width(u32 srate, enum stv090x_rolloff rolloff) { - return srate + (srate * rolloff) / 100; + u32 ro; + + switch (rolloff) { + case STV090x_RO_20: + ro = 20; + break; + case STV090x_RO_25: + ro = 25; + break; + case STV090x_RO_35: + default: + ro = 35; + break; + } + + return srate + (srate * ro) / 100; } static int stv090x_set_vit_thacq(struct stv090x_state *state) @@ -1933,12 +1948,12 @@ static int stv090x_delivery_search(struct stv090x_state *state) if (STV090x_WRITE_DEMOD(state, DMDCFGMD, reg) < 0) goto err; - if (stv090x_vitclk_ctl(state, 1) < 0) + if (stv090x_vitclk_ctl(state, 0) < 0) goto err; if (STV090x_WRITE_DEMOD(state, ACLC, 0x1a) < 0) goto err; - if (STV090x_WRITE_DEMOD(state, ACLC, 0x09) < 0) + if (STV090x_WRITE_DEMOD(state, BCLC, 0x09) < 0) goto err; if (STV090x_WRITE_DEMOD(state, CAR2CFG, 0x26) < 0) goto err; @@ -3689,7 +3704,7 @@ static enum stv090x_signal_state stv090x_algo(struct stv090x_state *state) enum stv090x_signal_state signal_state = STV090x_NOCARRIER; u32 reg; s32 timeout_dmd = 500, timeout_fec = 50; - int lock = 0, low_sr, no_signal = 0; + int lock = 0, low_sr = 0, no_signal = 0; reg = STV090x_READ_DEMOD(state, TSCFGH); STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 1); /* Stop path 1 stream merger */ @@ -3733,7 +3748,7 @@ static enum stv090x_signal_state stv090x_algo(struct stv090x_state *state) if (STV090x_WRITE_DEMOD(state, KREFTMG, 0x5a) < 0) goto err; if (state->algo == STV090x_COLD_SEARCH) - state->tuner_bw = (15 * (stv090x_car_width(state->srate, state->rolloff) + 1000000)) / 10; + state->tuner_bw = (15 * (stv090x_car_width(state->srate, state->rolloff) + 10000000)) / 10; else if (state->algo == STV090x_WARM_SEARCH) state->tuner_bw = stv090x_car_width(state->srate, state->rolloff) + 10000000; } else { @@ -3748,6 +3763,8 @@ static enum stv090x_signal_state stv090x_algo(struct stv090x_state *state) stv090x_set_min_srate(state, state->mclk, state->srate); if (state->srate >= 10000000) + low_sr = 0; + else low_sr = 1; } @@ -3785,7 +3802,7 @@ static enum stv090x_signal_state stv090x_algo(struct stv090x_state *state) if (STV090x_WRITE_DEMOD(state, DEMOD, reg) < 0) goto err; stv090x_delivery_search(state); - if (state->algo == STV090x_BLIND_SEARCH) + if (state->algo != STV090x_BLIND_SEARCH) stv090x_start_search(state); if (state->dev_ver == 0x12) { @@ -3902,6 +3919,10 @@ static enum dvbfe_search stv090x_search(struct dvb_frontend *fe, struct dvb_fron state->delsys = props->delivery_system; state->frequency = p->frequency; state->srate = p->u.qpsk.symbol_rate; + state->search_mode = STV090x_SEARCH_AUTO; + state->algo = STV090x_COLD_SEARCH; + state->fec = STV090x_PRERR; + state->search_range = 2000000; if (!stv090x_algo(state)) { dprintk(FE_DEBUG, 1, "Search success!"); @@ -4806,7 +4827,7 @@ struct dvb_frontend *stv090x_attach(const struct stv090x_config *config, state->demod = demod; state->demod_mode = config->demod_mode; /* Single or Dual mode */ state->device = config->device; - state->rolloff = 35; /* default */ + state->rolloff = STV090x_RO_35; /* default */ if (state->demod == STV090x_DEMODULATOR_0) mutex_init(&demod_lock); |