aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-frontends
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2012-08-21 18:56:22 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-09-15 08:30:39 -0400
commitdb32d74a0e5fa2b25b6bdbd1cb3f69045538c956 (patch)
tree424189810a31e73df9295e6126e6769b79117d6d /drivers/media/dvb-frontends
parent73983497ff816109e2739ad23ace06fd42c552e9 (diff)
[media] rtl2832: implement .read_ber()
Implementation taken from rtl2830. Cc: Thomas Mair <thomas.mair86@googlemail.com> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb-frontends')
-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};