Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Aleksandr V. Piskunov and committed by
Mauro Carvalho Chehab
decee2e8 75b697f7

+11 -3
+11 -3
drivers/media/dvb/frontends/zl10353.c
··· 38 38 struct zl10353_config config; 39 39 40 40 enum fe_bandwidth bandwidth; 41 + u32 ucblocks; 42 + u32 frequency; 41 43 }; 42 44 43 45 static int debug; ··· 200 198 u8 pllbuf[6] = { 0x67 }, acq_ctl = 0; 201 199 u16 tps = 0; 202 200 struct dvb_ofdm_parameters *op = &param->u.ofdm; 201 + 202 + state->frequency = param->frequency; 203 203 204 204 zl10353_single_write(fe, RESET, 0x80); 205 205 udelay(200); ··· 468 464 break; 469 465 } 470 466 471 - param->frequency = 0; 467 + param->frequency = state->frequency; 472 468 op->bandwidth = state->bandwidth; 473 469 param->inversion = INVERSION_AUTO; 474 470 ··· 546 542 static int zl10353_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks) 547 543 { 548 544 struct zl10353_state *state = fe->demodulator_priv; 545 + u32 ubl = 0; 549 546 550 - *ucblocks = zl10353_read_register(state, RS_UBC_1) << 8 | 551 - zl10353_read_register(state, RS_UBC_0); 547 + ubl = zl10353_read_register(state, RS_UBC_1) << 8 | 548 + zl10353_read_register(state, RS_UBC_0); 549 + 550 + state->ucblocks += ubl; 551 + *ucblocks = state->ucblocks; 552 552 553 553 return 0; 554 554 }