Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 174071
b: refs/heads/master
c: 502cd96
h: refs/heads/master
i:
  174069: c0a90d4
  174067: a20e115
  174063: c693cca
v: v3
  • Loading branch information
Igor M. Liplianin authored and Mauro Carvalho Chehab committed Dec 5, 2009
1 parent 202340a commit 55ccba5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 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: 29372a8daec4c1dca83e294006488b1d47dd965c
refs/heads/master: 502cd96d5b0714e0ab022766014f58b0684699a8
25 changes: 21 additions & 4 deletions trunk/drivers/media/dvb/frontends/stv0900_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,8 @@ static s32 stv0900_get_rf_level(struct stv0900_internal *i_params,
break;
}

dprintk("%s: AGC Gain = 0x%x\n", __func__, agc_gain);

imin = 0;
imax = lookup->size - 1;
if (INRANGE(lookup->table[imin].regval, agc_gain, lookup->table[imax].regval)) {
Expand Down Expand Up @@ -634,7 +636,14 @@ static int stv0900_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
s32 rflevel = stv0900_get_rf_level(internal, &stv0900_rf,
state->demod);

*strength = (rflevel + 100) * (16383 / 105);
rflevel = (rflevel + 100) * (65535 / 70);
if (rflevel < 0)
rflevel = 0;

if (rflevel > 65535)
rflevel = 65535;

*strength = rflevel;

return 0;
}
Expand Down Expand Up @@ -709,6 +718,8 @@ static s32 stv0900_carr_get_quality(struct dvb_frontend *fe,
}
}

dprintk("%s: Quality = %d\n", __func__, c_n);

return c_n;
}

Expand Down Expand Up @@ -752,10 +763,16 @@ static int stv0900_read_ucblocks(struct dvb_frontend *fe, u32 * ucblocks)

static int stv0900_read_snr(struct dvb_frontend *fe, u16 *snr)
{
*snr = stv0900_carr_get_quality(fe,
s32 snrlcl = stv0900_carr_get_quality(fe,
(const struct stv0900_table *)&stv0900_s2_cn);
*snr += 30;
*snr *= (16383 / 1030);
snrlcl = (snrlcl + 30) * 384;
if (snrlcl < 0)
snrlcl = 0;

if (snrlcl > 65535)
snrlcl = 65535;

*snr = snrlcl;

return 0;
}
Expand Down

0 comments on commit 55ccba5

Please sign in to comment.