aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/stv0299.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/frontends/stv0299.c')
-rw-r--r--drivers/media/dvb/frontends/stv0299.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/media/dvb/frontends/stv0299.c b/drivers/media/dvb/frontends/stv0299.c
index 17556183e871..35435bef8e79 100644
--- a/drivers/media/dvb/frontends/stv0299.c
+++ b/drivers/media/dvb/frontends/stv0299.c
@@ -63,6 +63,7 @@ struct stv0299_state {
63 u32 symbol_rate; 63 u32 symbol_rate;
64 fe_code_rate_t fec_inner; 64 fe_code_rate_t fec_inner;
65 int errmode; 65 int errmode;
66 u32 ucblocks;
66}; 67};
67 68
68#define STATUS_BER 0 69#define STATUS_BER 0
@@ -501,8 +502,10 @@ static int stv0299_read_ber(struct dvb_frontend* fe, u32* ber)
501{ 502{
502 struct stv0299_state* state = fe->demodulator_priv; 503 struct stv0299_state* state = fe->demodulator_priv;
503 504
504 if (state->errmode != STATUS_BER) return 0; 505 if (state->errmode != STATUS_BER)
505 *ber = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e); 506 return -ENOSYS;
507
508 *ber = stv0299_readreg(state, 0x1e) | (stv0299_readreg(state, 0x1d) << 8);
506 509
507 return 0; 510 return 0;
508} 511}
@@ -540,8 +543,12 @@ static int stv0299_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
540{ 543{
541 struct stv0299_state* state = fe->demodulator_priv; 544 struct stv0299_state* state = fe->demodulator_priv;
542 545
543 if (state->errmode != STATUS_UCBLOCKS) *ucblocks = 0; 546 if (state->errmode != STATUS_UCBLOCKS)
544 else *ucblocks = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e); 547 return -ENOSYS;
548
549 state->ucblocks += stv0299_readreg(state, 0x1e);
550 state->ucblocks += (stv0299_readreg(state, 0x1d) << 8);
551 *ucblocks = state->ucblocks;
545 552
546 return 0; 553 return 0;
547} 554}