diff options
author | Antti Palosaari <crope@iki.fi> | 2012-08-21 19:56:22 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-09-15 09:30:39 -0300 |
commit | db32d74a0e5fa2b25b6bdbd1cb3f69045538c956 (patch) | |
tree | 424189810a31e73df9295e6126e6769b79117d6d | |
parent | 73983497ff816109e2739ad23ace06fd42c552e9 (diff) | |
download | linux-3.10-db32d74a0e5fa2b25b6bdbd1cb3f69045538c956.tar.gz linux-3.10-db32d74a0e5fa2b25b6bdbd1cb3f69045538c956.tar.bz2 linux-3.10-db32d74a0e5fa2b25b6bdbd1cb3f69045538c956.zip |
[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>
-rw-r--r-- | drivers/media/dvb-frontends/rtl2832.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/media/dvb-frontends/rtl2832.c b/drivers/media/dvb-frontends/rtl2832.c index dad8ab5aba8..4d40b4f42a1 100644 --- a/drivers/media/dvb-frontends/rtl2832.c +++ b/drivers/media/dvb-frontends/rtl2832.c @@ -824,6 +824,24 @@ err: return ret; } +static int rtl2832_read_ber(struct dvb_frontend *fe, u32 *ber) +{ + struct rtl2832_priv *priv = fe->demodulator_priv; + int ret; + u8 buf[2]; + + ret = rtl2832_rd_regs(priv, 0x4e, 3, buf, 2); + if (ret) + goto err; + + *ber = buf[0] << 8 | buf[1]; + + return 0; +err: + dbg("%s: failed=%d", __func__, ret); + return ret; +} + static struct dvb_frontend_ops rtl2832_ops; static void rtl2832_release(struct dvb_frontend *fe) @@ -909,6 +927,7 @@ static struct dvb_frontend_ops rtl2832_ops = { .read_status = rtl2832_read_status, .read_snr = rtl2832_read_snr, + .read_ber = rtl2832_read_ber, .i2c_gate_ctrl = rtl2832_i2c_gate_ctrl, }; |