diff options
author | Gerd Knorr <devnull@localhost> | 2005-01-19 13:03:50 +0000 |
---|---|---|
committer | Gerd Knorr <devnull@localhost> | 2005-01-19 13:03:50 +0000 |
commit | 611bb1e5838466373d3ebe7c80d8de3ba5083f8b (patch) | |
tree | a14b05c88c4e7c88c9a374a98e3c440ebca1f312 /v4l | |
parent | 7383883c3f0f6f25ce07a3bfcef7a2453ff4849a (diff) | |
download | mediapointer-dvb-s2-611bb1e5838466373d3ebe7c80d8de3ba5083f8b.tar.gz mediapointer-dvb-s2-611bb1e5838466373d3ebe7c80d8de3ba5083f8b.tar.bz2 |
- don't poll mt352 so much.
Diffstat (limited to 'v4l')
-rw-r--r-- | v4l/mt352.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/v4l/mt352.c b/v4l/mt352.c index 8019db1b8..93510fc28 100644 --- a/v4l/mt352.c +++ b/v4l/mt352.c @@ -437,9 +437,18 @@ static int mt352_read_status(struct dvb_frontend* fe, fe_status_t* status) struct mt352_state* state = (struct mt352_state*) fe->demodulator_priv; int r0,r1,r3; + /* + * try to avoid reading registers, frequent polling seems to + * disturb the mt352 and makes it loose the lock ... + */ r0 = mt352_read_register (state, STATUS_0); - r1 = mt352_read_register (state, STATUS_1); - r3 = mt352_read_register (state, STATUS_3); + r1 = (1 << 1); + r3 = (1 << 6); + if (!(state->status & FE_HAS_LOCK)) + r1 = mt352_read_register (state, STATUS_1); + if (!state->config->no_tuner) + r3 = mt352_read_register (state, STATUS_3); + if (-1 == r0 || -1 == r1 || -1 == r3) { /* hmm, read failure. use last as fallback */ *status = state->status; @@ -463,12 +472,14 @@ static int mt352_read_status(struct dvb_frontend* fe, fe_status_t* status) *status &= ~FE_HAS_LOCK; if (debug && state->status != *status) { - printk("%s:%s%s%s%s%s\n", __FUNCTION__, + printk("%s:%s%s%s%s%s | r0=0x%02x r1=0x%02x r3=0x%02x\n", + __FUNCTION__, *status & FE_HAS_CARRIER ? " CARRIER" : "", *status & FE_HAS_VITERBI ? " VITERBI" : "", *status & FE_HAS_LOCK ? " LOCK" : "", *status & FE_HAS_SYNC ? " SYNC" : "", - *status & FE_HAS_SIGNAL ? " SIGNAL" : ""); + *status & FE_HAS_SIGNAL ? " SIGNAL" : "", + r0, r1, r3); } state->status = *status; |