From: Antti Palosaari Date: Fri, 18 May 2012 15:23:42 +0000 (-0300) Subject: [media] rtl2830: implement .read_ber() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=525ffc19b992f5d6a25413c36ba543a82585ed89;p=openwrt%2Fstaging%2Fblogic.git [media] rtl2830: implement .read_ber() Signed-off-by: Antti Palosaari Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb/frontends/rtl2830.c b/drivers/media/dvb/frontends/rtl2830.c index e6d7c501717a..266098656c48 100644 --- a/drivers/media/dvb/frontends/rtl2830.c +++ b/drivers/media/dvb/frontends/rtl2830.c @@ -450,8 +450,20 @@ err: static int rtl2830_read_ber(struct dvb_frontend *fe, u32 *ber) { - *ber = 0; + struct rtl2830_priv *priv = fe->demodulator_priv; + int ret; + u8 buf[2]; + + ret = rtl2830_rd_regs(priv, 0x34e, buf, 2); + if (ret) + goto err; + + *ber = buf[0] << 8 | buf[1]; + return 0; +err: + dbg("%s: failed=%d", __func__, ret); + return ret; } static int rtl2830_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)