diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-08-02 19:01:19 +0000 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-08-02 19:01:19 +0000 |
commit | 6a6c67ec6ada8fcc26c4fdbfbee70531fa737bcf (patch) | |
tree | c68c8231dbd1c409f036df5bd276bc98da2773c9 /linux/drivers | |
parent | 6c611aa512f9f31e8880be5aa826b26e31d79cf9 (diff) | |
download | mediapointer-dvb-s2-6a6c67ec6ada8fcc26c4fdbfbee70531fa737bcf.tar.gz mediapointer-dvb-s2-6a6c67ec6ada8fcc26c4fdbfbee70531fa737bcf.tar.bz2 |
zl10353: correct implementation of FE_READ_UNCORRECTED_BLOCKS
From: Aleksandr V. Piskunov <aleksandr.v.piskunov@gmail.com>
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 'linux/drivers')
-rw-r--r-- | linux/drivers/media/dvb/frontends/zl10353.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/linux/drivers/media/dvb/frontends/zl10353.c b/linux/drivers/media/dvb/frontends/zl10353.c index a69e9602c..37a050efd 100644 --- a/linux/drivers/media/dvb/frontends/zl10353.c +++ b/linux/drivers/media/dvb/frontends/zl10353.c @@ -39,6 +39,8 @@ struct zl10353_state { struct zl10353_config config; enum fe_bandwidth bandwidth; + u32 ucblocks; + u32 frequency; }; static int debug; @@ -204,6 +206,8 @@ static int zl10353_set_parameters(struct dvb_frontend *fe, u16 tps = 0; struct dvb_ofdm_parameters *op = ¶m->u.ofdm; + state->frequency = param->frequency; + zl10353_single_write(fe, RESET, 0x80); udelay(200); zl10353_single_write(fe, 0xEA, 0x01); @@ -469,7 +473,7 @@ static int zl10353_get_parameters(struct dvb_frontend *fe, break; } - param->frequency = 0; + param->frequency = state->frequency; op->bandwidth = state->bandwidth; param->inversion = INVERSION_AUTO; @@ -549,9 +553,13 @@ static int zl10353_read_snr(struct dvb_frontend *fe, u16 *snr) static int zl10353_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks) { struct zl10353_state *state = fe->demodulator_priv; + u32 ubl = 0; + + ubl = zl10353_read_register(state, RS_UBC_1) << 8 | + zl10353_read_register(state, RS_UBC_0); - *ucblocks = zl10353_read_register(state, RS_UBC_1) << 8 | - zl10353_read_register(state, RS_UBC_0); + state->ucblocks += ubl; + *ucblocks = state->ucblocks; return 0; } |