summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-frontends/rtl2830.c
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2014-12-09 10:27:32 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-02-02 17:55:51 -0200
commitf491391cc331921524aed578075e93f622a5e533 (patch)
tree82521abc5462e291e5c2b5f74971b9a583474470 /drivers/media/dvb-frontends/rtl2830.c
parentd512e286512c38e8921317c3a2c772559a91a636 (diff)
downloadlinux-f491391cc331921524aed578075e93f622a5e533.tar.bz2
[media] rtl2830: wrap DVBv5 BER to DVBv3
Change legacy DVBv3 read BER to return values calculated by DVBv5 statistics. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/dvb-frontends/rtl2830.c')
-rw-r--r--drivers/media/dvb-frontends/rtl2830.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/media/dvb-frontends/rtl2830.c b/drivers/media/dvb-frontends/rtl2830.c
index a02ccdf2fda0..0112b3f13a4b 100644
--- a/drivers/media/dvb-frontends/rtl2830.c
+++ b/drivers/media/dvb-frontends/rtl2830.c
@@ -596,22 +596,11 @@ static int rtl2830_read_ber(struct dvb_frontend *fe, u32 *ber)
{
struct i2c_client *client = fe->demodulator_priv;
struct rtl2830_dev *dev = i2c_get_clientdata(client);
- int ret;
- u8 buf[2];
-
- if (dev->sleeping)
- return 0;
-
- ret = rtl2830_rd_regs(client, 0x34e, buf, 2);
- if (ret)
- goto err;
- *ber = buf[0] << 8 | buf[1];
+ *ber = (dev->post_bit_error - dev->post_bit_error_prev);
+ dev->post_bit_error_prev = dev->post_bit_error;
return 0;
-err:
- dev_dbg(&client->dev, "failed=%d\n", ret);
- return ret;
}
static int rtl2830_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)