Skip to content

Commit

Permalink
V4L/DVB (6500): tda10021: Fix reported signal strength
Browse files Browse the repository at this point in the history
Fix reported signal strength value (higher value = higher signal strength).

Signed-off-by: Hartmut Birr <e9hack@googlemail.com>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Hartmut Birr authored and Mauro Carvalho Chehab committed Nov 4, 2007
1 parent 3de0e18 commit 7cccccc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/media/dvb/frontends/tda10021.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,11 @@ static int tda10021_read_signal_strength(struct dvb_frontend* fe, u16* strength)
{
struct tda10021_state* state = fe->demodulator_priv;

u8 config = tda10021_readreg(state, 0x02);
u8 gain = tda10021_readreg(state, 0x17);
if (config & 0x02)
/* the agc value is inverted */
gain = ~gain;
*strength = (gain << 8) | gain;

return 0;
Expand Down

0 comments on commit 7cccccc

Please sign in to comment.