V4L/DVB (6500): tda10021: Fix reported signal strength

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>
This commit is contained in:
Hartmut Birr 2007-10-31 01:57:58 -03:00 committed by Mauro Carvalho Chehab
parent 3de0e18b3a
commit 7cccccc33a
1 changed files with 4 additions and 0 deletions

View File

@ -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;