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>
This commit is contained in:
parent
75b697f747
commit
decee2e8a9
|
@ -38,6 +38,8 @@ struct zl10353_state {
|
||||||
struct zl10353_config config;
|
struct zl10353_config config;
|
||||||
|
|
||||||
enum fe_bandwidth bandwidth;
|
enum fe_bandwidth bandwidth;
|
||||||
|
u32 ucblocks;
|
||||||
|
u32 frequency;
|
||||||
};
|
};
|
||||||
|
|
||||||
static int debug;
|
static int debug;
|
||||||
|
@ -199,6 +201,8 @@ static int zl10353_set_parameters(struct dvb_frontend *fe,
|
||||||
u16 tps = 0;
|
u16 tps = 0;
|
||||||
struct dvb_ofdm_parameters *op = ¶m->u.ofdm;
|
struct dvb_ofdm_parameters *op = ¶m->u.ofdm;
|
||||||
|
|
||||||
|
state->frequency = param->frequency;
|
||||||
|
|
||||||
zl10353_single_write(fe, RESET, 0x80);
|
zl10353_single_write(fe, RESET, 0x80);
|
||||||
udelay(200);
|
udelay(200);
|
||||||
zl10353_single_write(fe, 0xEA, 0x01);
|
zl10353_single_write(fe, 0xEA, 0x01);
|
||||||
|
@ -464,7 +468,7 @@ static int zl10353_get_parameters(struct dvb_frontend *fe,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
param->frequency = 0;
|
param->frequency = state->frequency;
|
||||||
op->bandwidth = state->bandwidth;
|
op->bandwidth = state->bandwidth;
|
||||||
param->inversion = INVERSION_AUTO;
|
param->inversion = INVERSION_AUTO;
|
||||||
|
|
||||||
|
@ -542,9 +546,13 @@ static int zl10353_read_snr(struct dvb_frontend *fe, u16 *snr)
|
||||||
static int zl10353_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
|
static int zl10353_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
|
||||||
{
|
{
|
||||||
struct zl10353_state *state = fe->demodulator_priv;
|
struct zl10353_state *state = fe->demodulator_priv;
|
||||||
|
u32 ubl = 0;
|
||||||
|
|
||||||
*ucblocks = zl10353_read_register(state, RS_UBC_1) << 8 |
|
ubl = zl10353_read_register(state, RS_UBC_1) << 8 |
|
||||||
zl10353_read_register(state, RS_UBC_0);
|
zl10353_read_register(state, RS_UBC_0);
|
||||||
|
|
||||||
|
state->ucblocks += ubl;
|
||||||
|
*ucblocks = state->ucblocks;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue