From: Hartmut Birr Date: Wed, 31 Oct 2007 04:57:58 +0000 (-0300) Subject: V4L/DVB (6500): tda10021: Fix reported signal strength X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=7cccccc33aa9ab7171ca05c0b59c62912509b23e;p=openwrt%2Fstaging%2Fblogic.git V4L/DVB (6500): tda10021: Fix reported signal strength Fix reported signal strength value (higher value = higher signal strength). Signed-off-by: Hartmut Birr Signed-off-by: Oliver Endriss Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb/frontends/tda10021.c b/drivers/media/dvb/frontends/tda10021.c index 5ee729846a9f..45137d2ebfb9 100644 --- a/drivers/media/dvb/frontends/tda10021.c +++ b/drivers/media/dvb/frontends/tda10021.c @@ -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;