This patch add support for reading UNC blocks for stv090x frontend. Partially based on stv0900 code by Abylay Ospan <aospan@xxxxxxxx> Signed-off-by: Mariusz Bialonczyk <manio@xxxxxxxxxx> --- drivers/media/dvb/frontends/stv090x.c | 32 +++++++++++++++++++++++++++++++- 1 files changed, 31 insertions(+), 1 deletions(-) diff --git a/drivers/media/dvb/frontends/stv090x.c b/drivers/media/dvb/frontends/stv090x.c index 52d8712..ad6141f 100644 --- a/drivers/media/dvb/frontends/stv090x.c +++ b/drivers/media/dvb/frontends/stv090x.c @@ -3687,6 +3687,35 @@ static int stv090x_read_cnr(struct dvb_frontend *fe, u16 *cnr) return 0; } +static int stv090x_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks) +{ + struct stv090x_state *state = fe->demodulator_priv; + u32 reg_0, reg_1; + u32 val_header_err, val_packet_err; + + switch (state->delsys) { + case STV090x_DVBS2: + /* DVB-S2 delineator error count */ + + /* retrieving number for erronous headers */ + reg_1 = stv090x_read_reg(state, STV090x_P1_BBFCRCKO1); + reg_0 = stv090x_read_reg(state, STV090x_P1_BBFCRCKO0); + val_header_err = MAKEWORD16(reg_1, reg_0); + + /* retrieving number for erronous packets */ + reg_1 = stv090x_read_reg(state, STV090x_P1_UPCRCKO1); + reg_0 = stv090x_read_reg(state, STV090x_P1_UPCRCKO0); + val_packet_err = MAKEWORD16(reg_1, reg_0); + + *ucblocks = val_packet_err + val_header_err; + break; + default: + return -EINVAL; + } + + return 0; +} + static int stv090x_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone) { struct stv090x_state *state = fe->demodulator_priv; @@ -4748,7 +4777,8 @@ static struct dvb_frontend_ops stv090x_ops = { .read_status = stv090x_read_status, .read_ber = stv090x_read_per, .read_signal_strength = stv090x_read_signal_strength, - .read_snr = stv090x_read_cnr + .read_snr = stv090x_read_cnr, + .read_ucblocks = stv090x_read_ucblocks }; -- 1.7.7.3 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html