diff options
author | Abylay Ospan <aospan@netup.ru> | 2009-06-08 03:31:26 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-23 02:14:07 -0400 |
commit | ee1ebcfea6ee16491f88e8023554dd214e1ba85c (patch) | |
tree | b2571a6a0c85b66a9a7b5890632a6d27d29a685d /drivers/media/dvb/frontends | |
parent | 68191edeb50773993f4a05651b0a085bd110fbeb (diff) |
V4L/DVB (12097): Implement reading uncorrected blocks for stv0900
Signed-off-by: Abylay Ospan <aospan@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends')
-rw-r--r-- | drivers/media/dvb/frontends/stv0900_core.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/stv0900_core.c b/drivers/media/dvb/frontends/stv0900_core.c index 4daec8ad92c3..9ab4f3014673 100644 --- a/drivers/media/dvb/frontends/stv0900_core.c +++ b/drivers/media/dvb/frontends/stv0900_core.c | |||
@@ -712,6 +712,44 @@ static s32 stv0900_carr_get_quality(struct dvb_frontend *fe, | |||
712 | return c_n; | 712 | return c_n; |
713 | } | 713 | } |
714 | 714 | ||
715 | static int stv0900_read_ucblocks(struct dvb_frontend *fe, u32 * ucblocks) | ||
716 | { | ||
717 | struct stv0900_state *state = fe->demodulator_priv; | ||
718 | struct stv0900_internal *i_params = state->internal; | ||
719 | enum fe_stv0900_demod_num demod = state->demod; | ||
720 | u8 err_val1, err_val0; | ||
721 | s32 err_field1, err_field0; | ||
722 | u32 header_err_val = 0; | ||
723 | |||
724 | *ucblocks = 0x0; | ||
725 | if (stv0900_get_standard(fe, demod) == STV0900_DVBS2_STANDARD) { | ||
726 | /* DVB-S2 delineator errors count */ | ||
727 | |||
728 | /* retreiving number for errnous headers */ | ||
729 | dmd_reg(err_field0, R0900_P1_BBFCRCKO0, | ||
730 | R0900_P2_BBFCRCKO0); | ||
731 | dmd_reg(err_field1, R0900_P1_BBFCRCKO1, | ||
732 | R0900_P2_BBFCRCKO1); | ||
733 | |||
734 | err_val1 = stv0900_read_reg(i_params, err_field1); | ||
735 | err_val0 = stv0900_read_reg(i_params, err_field0); | ||
736 | header_err_val = (err_val1<<8) | err_val0; | ||
737 | |||
738 | /* retreiving number for errnous packets */ | ||
739 | dmd_reg(err_field0, R0900_P1_UPCRCKO0, | ||
740 | R0900_P2_UPCRCKO0); | ||
741 | dmd_reg(err_field1, R0900_P1_UPCRCKO1, | ||
742 | R0900_P2_UPCRCKO1); | ||
743 | |||
744 | err_val1 = stv0900_read_reg(i_params, err_field1); | ||
745 | err_val0 = stv0900_read_reg(i_params, err_field0); | ||
746 | *ucblocks = (err_val1<<8) | err_val0; | ||
747 | *ucblocks += header_err_val; | ||
748 | } | ||
749 | |||
750 | return 0; | ||
751 | } | ||
752 | |||
715 | static int stv0900_read_snr(struct dvb_frontend *fe, u16 *snr) | 753 | static int stv0900_read_snr(struct dvb_frontend *fe, u16 *snr) |
716 | { | 754 | { |
717 | *snr = stv0900_carr_get_quality(fe, | 755 | *snr = stv0900_carr_get_quality(fe, |
@@ -1882,6 +1920,7 @@ static struct dvb_frontend_ops stv0900_ops = { | |||
1882 | .read_ber = stv0900_read_ber, | 1920 | .read_ber = stv0900_read_ber, |
1883 | .read_signal_strength = stv0900_read_signal_strength, | 1921 | .read_signal_strength = stv0900_read_signal_strength, |
1884 | .read_snr = stv0900_read_snr, | 1922 | .read_snr = stv0900_read_snr, |
1923 | .read_ucblocks = stv0900_read_ucblocks, | ||
1885 | }; | 1924 | }; |
1886 | 1925 | ||
1887 | struct dvb_frontend *stv0900_attach(const struct stv0900_config *config, | 1926 | struct dvb_frontend *stv0900_attach(const struct stv0900_config *config, |