aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorAndrew de Quincey <adq_dvb@lidskialf.net>2005-09-09 16:02:32 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-09 16:57:38 -0400
commit78639a3f81d14117d1841476771d7a4736e7b9d1 (patch)
treee3e060a16cb5717ceca478718e7a7df271b45df3 /drivers/media
parenta9d6a80b41c04e8ff4c7442cc35f5df610863841 (diff)
[PATCH] dvb: frontend: stv0299: support reading both BER and UCBLOCKS
Allow the stv0299 to read the BER and UCBLOCKS. Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net> Signed-off-by: Johannes Stezenbach <js@linuxtv.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/frontends/stv0299.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/media/dvb/frontends/stv0299.c b/drivers/media/dvb/frontends/stv0299.c
index db66d417df38..2d62931f20b5 100644
--- a/drivers/media/dvb/frontends/stv0299.c
+++ b/drivers/media/dvb/frontends/stv0299.c
@@ -63,12 +63,8 @@ struct stv0299_state {
63 u32 tuner_frequency; 63 u32 tuner_frequency;
64 u32 symbol_rate; 64 u32 symbol_rate;
65 fe_code_rate_t fec_inner; 65 fe_code_rate_t fec_inner;
66 int errmode;
67}; 66};
68 67
69#define STATUS_BER 0
70#define STATUS_UCBLOCKS 1
71
72static int debug; 68static int debug;
73static int debug_legacy_dish_switch; 69static int debug_legacy_dish_switch;
74#define dprintk(args...) \ 70#define dprintk(args...) \
@@ -520,7 +516,8 @@ static int stv0299_read_ber(struct dvb_frontend* fe, u32* ber)
520{ 516{
521 struct stv0299_state* state = fe->demodulator_priv; 517 struct stv0299_state* state = fe->demodulator_priv;
522 518
523 if (state->errmode != STATUS_BER) return 0; 519 stv0299_writeregI(state, 0x34, (stv0299_readreg(state, 0x34) & 0xcf) | 0x10);
520 msleep(100);
524 *ber = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e); 521 *ber = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e);
525 522
526 return 0; 523 return 0;
@@ -559,8 +556,9 @@ static int stv0299_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
559{ 556{
560 struct stv0299_state* state = fe->demodulator_priv; 557 struct stv0299_state* state = fe->demodulator_priv;
561 558
562 if (state->errmode != STATUS_UCBLOCKS) *ucblocks = 0; 559 stv0299_writeregI(state, 0x34, (stv0299_readreg(state, 0x34) & 0xcf) | 0x30);
563 else *ucblocks = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e); 560 msleep(100);
561 *ucblocks = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e);
564 562
565 return 0; 563 return 0;
566} 564}
@@ -709,7 +707,6 @@ struct dvb_frontend* stv0299_attach(const struct stv0299_config* config,
709 state->tuner_frequency = 0; 707 state->tuner_frequency = 0;
710 state->symbol_rate = 0; 708 state->symbol_rate = 0;
711 state->fec_inner = 0; 709 state->fec_inner = 0;
712 state->errmode = STATUS_BER;
713 710
714 /* check if the demod is there */ 711 /* check if the demod is there */
715 stv0299_writeregI(state, 0x02, 0x34); /* standby off */ 712 stv0299_writeregI(state, 0x02, 0x34); /* standby off */