diff options
author | Aleksandr V. Piskunov <aleksandr.v.piskunov@gmail.com> | 2009-08-02 15:01:19 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-12 11:19:09 -0400 |
commit | decee2e8a9538ae5476e6cb3f4b7714c92a04a2b (patch) | |
tree | 0543088bc083961575c2a22ff8bba9fcce76638f /drivers/media | |
parent | 75b697f747b14b0c6afae48ee0f5e605abd2df4c (diff) |
V4L/DVB (12485): zl10353: correct implementation of FE_READ_UNCORRECTED_BLOCKS
Makes zl10353 a bit more DVB API compliant:
FE_READ_UNCORRECTED_BLOCKS - keep a counter of UNC blocks
FE_GET_FRONTEND - return last set frequency instead of zero
Signed-off-by: Aleksandr V. Piskunov <alexandr.v.piskunov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/frontends/zl10353.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/media/dvb/frontends/zl10353.c b/drivers/media/dvb/frontends/zl10353.c index 66f5c1fb3074..8c612719adfc 100644 --- a/drivers/media/dvb/frontends/zl10353.c +++ b/drivers/media/dvb/frontends/zl10353.c | |||
@@ -38,6 +38,8 @@ struct zl10353_state { | |||
38 | struct zl10353_config config; | 38 | struct zl10353_config config; |
39 | 39 | ||
40 | enum fe_bandwidth bandwidth; | 40 | enum fe_bandwidth bandwidth; |
41 | u32 ucblocks; | ||
42 | u32 frequency; | ||
41 | }; | 43 | }; |
42 | 44 | ||
43 | static int debug; | 45 | static int debug; |
@@ -199,6 +201,8 @@ static int zl10353_set_parameters(struct dvb_frontend *fe, | |||
199 | u16 tps = 0; | 201 | u16 tps = 0; |
200 | struct dvb_ofdm_parameters *op = ¶m->u.ofdm; | 202 | struct dvb_ofdm_parameters *op = ¶m->u.ofdm; |
201 | 203 | ||
204 | state->frequency = param->frequency; | ||
205 | |||
202 | zl10353_single_write(fe, RESET, 0x80); | 206 | zl10353_single_write(fe, RESET, 0x80); |
203 | udelay(200); | 207 | udelay(200); |
204 | zl10353_single_write(fe, 0xEA, 0x01); | 208 | zl10353_single_write(fe, 0xEA, 0x01); |
@@ -464,7 +468,7 @@ static int zl10353_get_parameters(struct dvb_frontend *fe, | |||
464 | break; | 468 | break; |
465 | } | 469 | } |
466 | 470 | ||
467 | param->frequency = 0; | 471 | param->frequency = state->frequency; |
468 | op->bandwidth = state->bandwidth; | 472 | op->bandwidth = state->bandwidth; |
469 | param->inversion = INVERSION_AUTO; | 473 | param->inversion = INVERSION_AUTO; |
470 | 474 | ||
@@ -542,9 +546,13 @@ static int zl10353_read_snr(struct dvb_frontend *fe, u16 *snr) | |||
542 | static int zl10353_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks) | 546 | static int zl10353_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks) |
543 | { | 547 | { |
544 | struct zl10353_state *state = fe->demodulator_priv; | 548 | struct zl10353_state *state = fe->demodulator_priv; |
549 | u32 ubl = 0; | ||
550 | |||
551 | ubl = zl10353_read_register(state, RS_UBC_1) << 8 | | ||
552 | zl10353_read_register(state, RS_UBC_0); | ||
545 | 553 | ||
546 | *ucblocks = zl10353_read_register(state, RS_UBC_1) << 8 | | 554 | state->ucblocks += ubl; |
547 | zl10353_read_register(state, RS_UBC_0); | 555 | *ucblocks = state->ucblocks; |
548 | 556 | ||
549 | return 0; | 557 | return 0; |
550 | } | 558 | } |