Commit db32d74a authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[media] rtl2832: implement .read_ber()

Implementation taken from rtl2830.

Cc: Thomas Mair <thomas.mair86@googlemail.com>
Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 73983497
...@@ -824,6 +824,24 @@ static int rtl2832_read_snr(struct dvb_frontend *fe, u16 *snr) ...@@ -824,6 +824,24 @@ static int rtl2832_read_snr(struct dvb_frontend *fe, u16 *snr)
return ret; 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 struct dvb_frontend_ops rtl2832_ops;
static void rtl2832_release(struct dvb_frontend *fe) static void rtl2832_release(struct dvb_frontend *fe)
...@@ -909,6 +927,7 @@ static struct dvb_frontend_ops rtl2832_ops = { ...@@ -909,6 +927,7 @@ static struct dvb_frontend_ops rtl2832_ops = {
.read_status = rtl2832_read_status, .read_status = rtl2832_read_status,
.read_snr = rtl2832_read_snr, .read_snr = rtl2832_read_snr,
.read_ber = rtl2832_read_ber,
.i2c_gate_ctrl = rtl2832_i2c_gate_ctrl, .i2c_gate_ctrl = rtl2832_i2c_gate_ctrl,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment