diff options
Diffstat (limited to 'drivers/media/dvb/frontends/stv0297.c')
-rw-r--r-- | drivers/media/dvb/frontends/stv0297.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/media/dvb/frontends/stv0297.c b/drivers/media/dvb/frontends/stv0297.c index 17e5cb561cd..7c23775f77d 100644 --- a/drivers/media/dvb/frontends/stv0297.c +++ b/drivers/media/dvb/frontends/stv0297.c | |||
@@ -358,11 +358,23 @@ static int stv0297_read_ber(struct dvb_frontend *fe, u32 * ber) | |||
358 | static int stv0297_read_signal_strength(struct dvb_frontend *fe, u16 * strength) | 358 | static int stv0297_read_signal_strength(struct dvb_frontend *fe, u16 * strength) |
359 | { | 359 | { |
360 | struct stv0297_state *state = fe->demodulator_priv; | 360 | struct stv0297_state *state = fe->demodulator_priv; |
361 | u8 STRENGTH[2]; | 361 | u8 STRENGTH[3]; |
362 | 362 | u16 tmp; | |
363 | stv0297_readregs(state, 0x41, STRENGTH, 2); | 363 | |
364 | *strength = (STRENGTH[1] & 0x03) << 8 | STRENGTH[0]; | 364 | stv0297_readregs(state, 0x41, STRENGTH, 3); |
365 | 365 | tmp = (STRENGTH[1] & 0x03) << 8 | STRENGTH[0]; | |
366 | if (STRENGTH[2] & 0x20) { | ||
367 | if (tmp < 0x200) | ||
368 | tmp = 0; | ||
369 | else | ||
370 | tmp = tmp - 0x200; | ||
371 | } else { | ||
372 | if (tmp > 0x1ff) | ||
373 | tmp = 0; | ||
374 | else | ||
375 | tmp = 0x1ff - tmp; | ||
376 | } | ||
377 | *strength = (tmp << 7) | (tmp >> 2); | ||
366 | return 0; | 378 | return 0; |
367 | } | 379 | } |
368 | 380 | ||