diff options
author | Christoph Haubrich <christoph1.haubrich@arcor.de> | 2006-10-30 22:29:30 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-12-10 05:51:08 -0500 |
commit | dbb2e6392b4fe350e549cdc2d42cebf3b3574a6a (patch) | |
tree | bb34219c60ec130ab33e29192e22acbe2008fc10 /drivers/media | |
parent | bf11f5e944b3bb7d310aff041a1664fb80a82078 (diff) |
V4L/DVB (4788): Tda8083: support for uncorrectable blocks and bit error rate
Copied routines for uc blocks and BER from the removed tda80xx.c
into tda8083.c.
Signed-off-by: Christoph Haubrich <christoph1.haubrich@arcor.de>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/frontends/tda8083.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/tda8083.c b/drivers/media/dvb/frontends/tda8083.c index 3aa45ebbac3d..67415c9db6f7 100644 --- a/drivers/media/dvb/frontends/tda8083.c +++ b/drivers/media/dvb/frontends/tda8083.c | |||
@@ -262,12 +262,29 @@ static int tda8083_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
262 | if (sync & 0x10) | 262 | if (sync & 0x10) |
263 | *status |= FE_HAS_SYNC; | 263 | *status |= FE_HAS_SYNC; |
264 | 264 | ||
265 | if (sync & 0x20) /* frontend can not lock */ | ||
266 | *status |= FE_TIMEDOUT; | ||
267 | |||
265 | if ((sync & 0x1f) == 0x1f) | 268 | if ((sync & 0x1f) == 0x1f) |
266 | *status |= FE_HAS_LOCK; | 269 | *status |= FE_HAS_LOCK; |
267 | 270 | ||
268 | return 0; | 271 | return 0; |
269 | } | 272 | } |
270 | 273 | ||
274 | static int tda8083_read_ber(struct dvb_frontend* fe, u32* ber) | ||
275 | { | ||
276 | struct tda8083_state* state = fe->demodulator_priv; | ||
277 | int ret; | ||
278 | u8 buf[3]; | ||
279 | |||
280 | if ((ret = tda8083_readregs(state, 0x0b, buf, sizeof(buf)))) | ||
281 | return ret; | ||
282 | |||
283 | *ber = ((buf[0] & 0x1f) << 16) | (buf[1] << 8) | buf[2]; | ||
284 | |||
285 | return 0; | ||
286 | } | ||
287 | |||
271 | static int tda8083_read_signal_strength(struct dvb_frontend* fe, u16* strength) | 288 | static int tda8083_read_signal_strength(struct dvb_frontend* fe, u16* strength) |
272 | { | 289 | { |
273 | struct tda8083_state* state = fe->demodulator_priv; | 290 | struct tda8083_state* state = fe->demodulator_priv; |
@@ -288,6 +305,17 @@ static int tda8083_read_snr(struct dvb_frontend* fe, u16* snr) | |||
288 | return 0; | 305 | return 0; |
289 | } | 306 | } |
290 | 307 | ||
308 | static int tda8083_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | ||
309 | { | ||
310 | struct tda8083_state* state = fe->demodulator_priv; | ||
311 | |||
312 | *ucblocks = tda8083_readreg(state, 0x0f); | ||
313 | if (*ucblocks == 0xff) | ||
314 | *ucblocks = 0xffffffff; | ||
315 | |||
316 | return 0; | ||
317 | } | ||
318 | |||
291 | static int tda8083_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 319 | static int tda8083_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) |
292 | { | 320 | { |
293 | struct tda8083_state* state = fe->demodulator_priv; | 321 | struct tda8083_state* state = fe->demodulator_priv; |
@@ -440,6 +468,8 @@ static struct dvb_frontend_ops tda8083_ops = { | |||
440 | .read_status = tda8083_read_status, | 468 | .read_status = tda8083_read_status, |
441 | .read_signal_strength = tda8083_read_signal_strength, | 469 | .read_signal_strength = tda8083_read_signal_strength, |
442 | .read_snr = tda8083_read_snr, | 470 | .read_snr = tda8083_read_snr, |
471 | .read_ber = tda8083_read_ber, | ||
472 | .read_ucblocks = tda8083_read_ucblocks, | ||
443 | 473 | ||
444 | .diseqc_send_master_cmd = tda8083_send_diseqc_msg, | 474 | .diseqc_send_master_cmd = tda8083_send_diseqc_msg, |
445 | .diseqc_send_burst = tda8083_diseqc_send_burst, | 475 | .diseqc_send_burst = tda8083_diseqc_send_burst, |