diff options
author | Gerd Knorr <devnull@localhost> | 2005-01-20 09:54:59 +0000 |
---|---|---|
committer | Gerd Knorr <devnull@localhost> | 2005-01-20 09:54:59 +0000 |
commit | 31d2c69f1756bd4f691afc3ee78231fb8ca7f3f5 (patch) | |
tree | ac5f9a42a93b508f9672997b0ee7a3424de24416 | |
parent | 611bb1e5838466373d3ebe7c80d8de3ba5083f8b (diff) | |
download | mediapointer-dvb-s2-31d2c69f1756bd4f691afc3ee78231fb8ca7f3f5.tar.gz mediapointer-dvb-s2-31d2c69f1756bd4f691afc3ee78231fb8ca7f3f5.tar.bz2 |
- mt352 fixes.
-rw-r--r-- | v4l/.bp/2.6/dvb-frontends | 4 | ||||
-rw-r--r-- | v4l/mt352.c | 45 | ||||
-rw-r--r-- | v4l/scripts/update | 2 |
3 files changed, 23 insertions, 28 deletions
diff --git a/v4l/.bp/2.6/dvb-frontends b/v4l/.bp/2.6/dvb-frontends index dc62f6294..397aa381c 100644 --- a/v4l/.bp/2.6/dvb-frontends +++ b/v4l/.bp/2.6/dvb-frontends @@ -1,6 +1,6 @@ srcdiff dvb-pll.h drivers/media/dvb/frontends/dvb-pll.h srcdiff dvb-pll.c drivers/media/dvb/frontends/dvb-pll.c - srcdiff cx22702.h drivers/media/dvb/frontends/cx22702.h srcdiff cx22702.c drivers/media/dvb/frontends/cx22702.c - +srcdiff mt352.h drivers/media/dvb/frontends/mt352.h +srcdiff mt352.c drivers/media/dvb/frontends/mt352.c diff --git a/v4l/mt352.c b/v4l/mt352.c index 93510fc28..baa3f67a7 100644 --- a/v4l/mt352.c +++ b/v4l/mt352.c @@ -46,7 +46,7 @@ struct mt352_state { /* configuration settings */ const struct mt352_config* config; - int status; + int status,s0,s1,s3; struct dvb_frontend frontend; }; @@ -435,36 +435,30 @@ static int mt352_get_parameters(struct dvb_frontend* fe, 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 = (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; - return 0; + int val; + + if (0 != mt352_read_register(state, INTERRUPT_0)) { + val = mt352_read_register(state, STATUS_0); + if (-1 != val) + state->s0 = val; + val = mt352_read_register(state, STATUS_1); + if (-1 != val) + state->s1 = val; + val = mt352_read_register(state, STATUS_3); + if (-1 != val) + state->s3 = val; } *status = 0; - if (r0 & (1 << 4)) + if (state->s0 & (1 << 4)) *status |= FE_HAS_CARRIER; - if (r0 & (1 << 1)) + if (state->s0 & (1 << 1)) *status |= FE_HAS_VITERBI; - if (r0 & (1 << 5)) + if (state->s0 & (1 << 5)) *status |= FE_HAS_LOCK; - if (r1 & (1 << 1)) + if (state->s1 & (1 << 1)) *status |= FE_HAS_SYNC; - if (r3 & (1 << 6)) + if (state->s3 & (1 << 6)) *status |= FE_HAS_SIGNAL; if ((*status & (FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC)) != @@ -472,6 +466,7 @@ static int mt352_read_status(struct dvb_frontend* fe, fe_status_t* status) *status &= ~FE_HAS_LOCK; if (debug && state->status != *status) { + /* log status bit changes */ printk("%s:%s%s%s%s%s | r0=0x%02x r1=0x%02x r3=0x%02x\n", __FUNCTION__, *status & FE_HAS_CARRIER ? " CARRIER" : "", @@ -479,7 +474,7 @@ static int mt352_read_status(struct dvb_frontend* fe, fe_status_t* status) *status & FE_HAS_LOCK ? " LOCK" : "", *status & FE_HAS_SYNC ? " SYNC" : "", *status & FE_HAS_SIGNAL ? " SIGNAL" : "", - r0, r1, r3); + state->s0, state->s1, state->s3); } state->status = *status; diff --git a/v4l/scripts/update b/v4l/scripts/update index 050ecb22b..1a9731e47 100644 --- a/v4l/scripts/update +++ b/v4l/scripts/update @@ -97,7 +97,7 @@ xinsmod saa7134-empress # dvb stuff xinsmod cx22702 debug=0 -xinsmod mt352 debug=0 +xinsmod mt352 debug=1 xinsmod video-buf-dvb xinsmod cx88-dvb xinsmod saa7134-dvb |