Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294995
b: refs/heads/master
c: 06302ff
h: refs/heads/master
i:
  294993: 871861b
  294991: de6e998
v: v3
  • Loading branch information
Jean Delvare authored and Mauro Carvalho Chehab committed Mar 8, 2012
1 parent e428965 commit 20e2822
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 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: 6c5637e4eda58292f7d9ee6ee0b1f9aa4b0a7e7f
refs/heads/master: 06302ffbb470359c8cbcf1ee8b057d6930300f90
22 changes: 19 additions & 3 deletions trunk/drivers/media/dvb/frontends/cx22702.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,10 +502,26 @@ static int cx22702_read_signal_strength(struct dvb_frontend *fe,
u16 *signal_strength)
{
struct cx22702_state *state = fe->demodulator_priv;
u8 reg23;

u16 rs_ber;
rs_ber = cx22702_readreg(state, 0x23);
*signal_strength = (rs_ber << 8) | rs_ber;
/*
* Experience suggests that the strength signal register works as
* follows:
* - In the absence of signal, value is 0xff.
* - In the presence of a weak signal, bit 7 is set, not sure what
* the lower 7 bits mean.
* - In the presence of a strong signal, the register holds a 7-bit
* value (bit 7 is cleared), with greater values standing for
* weaker signals.
*/
reg23 = cx22702_readreg(state, 0x23);
if (reg23 & 0x80) {
*signal_strength = 0;
} else {
reg23 = ~reg23 & 0x7f;
/* Scale to 16 bit */
*signal_strength = (reg23 << 9) | (reg23 << 2) | (reg23 >> 5);
}

return 0;
}
Expand Down

0 comments on commit 20e2822

Please sign in to comment.