aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/dvb-frontends/rtl2832.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/media/dvb-frontends/rtl2832.c b/drivers/media/dvb-frontends/rtl2832.c
index dad8ab5aba8e..4d40b4f42a1f 100644
--- a/drivers/media/dvb-frontends/rtl2832.c
+++ b/drivers/media/dvb-frontends/rtl2832.c
@@ -824,6 +824,24 @@ err:
824 return ret; 824 return ret;
825} 825}
826 826
827static int rtl2832_read_ber(struct dvb_frontend *fe, u32 *ber)
828{
829 struct rtl2832_priv *priv = fe->demodulator_priv;
830 int ret;
831 u8 buf[2];
832
833 ret = rtl2832_rd_regs(priv, 0x4e, 3, buf, 2);
834 if (ret)
835 goto err;
836
837 *ber = buf[0] << 8 | buf[1];
838
839 return 0;
840err:
841 dbg("%s: failed=%d", __func__, ret);
842 return ret;
843}
844
827static struct dvb_frontend_ops rtl2832_ops; 845static struct dvb_frontend_ops rtl2832_ops;
828 846
829static void rtl2832_release(struct dvb_frontend *fe) 847static void rtl2832_release(struct dvb_frontend *fe)
@@ -909,6 +927,7 @@ static struct dvb_frontend_ops rtl2832_ops = {
909 927
910 .read_status = rtl2832_read_status, 928 .read_status = rtl2832_read_status,
911 .read_snr = rtl2832_read_snr, 929 .read_snr = rtl2832_read_snr,
930 .read_ber = rtl2832_read_ber,
912 931
913 .i2c_gate_ctrl = rtl2832_i2c_gate_ctrl, 932 .i2c_gate_ctrl = rtl2832_i2c_gate_ctrl,
914}; 933};