Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 306530
b: refs/heads/master
c: 78e7507
h: refs/heads/master
v: v3
  • Loading branch information
Antti Palosaari authored and Mauro Carvalho Chehab committed May 20, 2012
1 parent 0c98363 commit 4094db7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 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: 525ffc19b992f5d6a25413c36ba543a82585ed89
refs/heads/master: 78e750754bf0cc86d36149536bc7f3382710a2ee
23 changes: 22 additions & 1 deletion trunk/drivers/media/dvb/frontends/rtl2830.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,29 @@ static int rtl2830_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)

static int rtl2830_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
{
*strength = 0;
struct rtl2830_priv *priv = fe->demodulator_priv;
int ret;
u8 buf[2];
u16 if_agc_raw, if_agc;

ret = rtl2830_rd_regs(priv, 0x359, buf, 2);
if (ret)
goto err;

if_agc_raw = (buf[0] << 8 | buf[1]) & 0x3fff;

if (if_agc_raw & (1 << 9))
if_agc = -(~(if_agc_raw - 1) & 0x1ff);
else
if_agc = if_agc_raw;

*strength = (u8) (55 - if_agc / 182);
*strength |= *strength << 8;

return 0;
err:
dbg("%s: failed=%d", __func__, ret);
return ret;
}

static struct dvb_frontend_ops rtl2830_ops;
Expand Down

0 comments on commit 4094db7

Please sign in to comment.