Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 98506
b: refs/heads/master
c: 7876ad7
h: refs/heads/master
v: v3
  • Loading branch information
Oliver Endriss authored and Mauro Carvalho Chehab committed Jun 26, 2008
1 parent af9ae7e commit 41e3137
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0b915e74ac10b65da930aa430837d4338f5deb65
refs/heads/master: 7876ad75b1a3b7dc3d5d765d0be086d89fd2e663
15 changes: 11 additions & 4 deletions trunk/drivers/media/dvb/frontends/stv0299.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ struct stv0299_state {
u32 symbol_rate;
fe_code_rate_t fec_inner;
int errmode;
u32 ucblocks;
};

#define STATUS_BER 0
Expand Down Expand Up @@ -501,8 +502,10 @@ static int stv0299_read_ber(struct dvb_frontend* fe, u32* ber)
{
struct stv0299_state* state = fe->demodulator_priv;

if (state->errmode != STATUS_BER) return 0;
*ber = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e);
if (state->errmode != STATUS_BER)
return -ENOSYS;

*ber = stv0299_readreg(state, 0x1e) | (stv0299_readreg(state, 0x1d) << 8);

return 0;
}
Expand Down Expand Up @@ -540,8 +543,12 @@ static int stv0299_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
{
struct stv0299_state* state = fe->demodulator_priv;

if (state->errmode != STATUS_UCBLOCKS) *ucblocks = 0;
else *ucblocks = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e);
if (state->errmode != STATUS_UCBLOCKS)
return -ENOSYS;

state->ucblocks += stv0299_readreg(state, 0x1e);
state->ucblocks += (stv0299_readreg(state, 0x1d) << 8);
*ucblocks = state->ucblocks;

return 0;
}
Expand Down

0 comments on commit 41e3137

Please sign in to comment.