Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73157
b: refs/heads/master
c: 85085ad
h: refs/heads/master
i:
  73155: 21de6c2
v: v3
  • Loading branch information
Hartmut Birr authored and Mauro Carvalho Chehab committed Nov 4, 2007
1 parent 9476506 commit 24ce1b4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 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: 7cccccc33aa9ab7171ca05c0b59c62912509b23e
refs/heads/master: 85085ad7b2cc281a94bb406172ba938870863639
22 changes: 17 additions & 5 deletions trunk/drivers/media/dvb/frontends/stv0297.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,23 @@ static int stv0297_read_ber(struct dvb_frontend *fe, u32 * ber)
static int stv0297_read_signal_strength(struct dvb_frontend *fe, u16 * strength)
{
struct stv0297_state *state = fe->demodulator_priv;
u8 STRENGTH[2];

stv0297_readregs(state, 0x41, STRENGTH, 2);
*strength = (STRENGTH[1] & 0x03) << 8 | STRENGTH[0];

u8 STRENGTH[3];
u16 tmp;

stv0297_readregs(state, 0x41, STRENGTH, 3);
tmp = (STRENGTH[1] & 0x03) << 8 | STRENGTH[0];
if (STRENGTH[2] & 0x20) {
if (tmp < 0x200)
tmp = 0;
else
tmp = tmp - 0x200;
} else {
if (tmp > 0x1ff)
tmp = 0;
else
tmp = 0x1ff - tmp;
}
*strength = (tmp << 7) | (tmp >> 2);
return 0;
}

Expand Down

0 comments on commit 24ce1b4

Please sign in to comment.