summaryrefslogtreecommitdiff
path: root/drivers/media/dvb-frontends/af9033.c
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2014-09-03 23:22:53 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-09-21 19:47:03 -0300
commite53c47445bb585f864dd861393691b1346f6ec80 (patch)
treeb5cfcd10316ba3e2eb7b2292d61e504d62bd916f /drivers/media/dvb-frontends/af9033.c
parent1d0ceae4a19d318b443277ea6ac891a2e6e8fdc3 (diff)
[media] af9033: wrap DVBv3 BER to DVBv5 BER
DVBv5 BER is calculated anyway, so just return it for legacy read_ber() API too. 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/af9033.c')
-rw-r--r--drivers/media/dvb-frontends/af9033.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/media/dvb-frontends/af9033.c b/drivers/media/dvb-frontends/af9033.c
index 673d60ef9654..f5267fdad75e 100644
--- a/drivers/media/dvb-frontends/af9033.c
+++ b/drivers/media/dvb-frontends/af9033.c
@@ -38,6 +38,7 @@ struct af9033_dev {
fe_status_t fe_status;
u32 ber;
u32 ucb;
+ u64 post_bit_error_prev; /* for old read_ber we return (curr - prev) */
u64 post_bit_error;
u64 post_bit_count;
u64 error_block_count;
@@ -918,13 +919,9 @@ err:
static int af9033_read_ber(struct dvb_frontend *fe, u32 *ber)
{
struct af9033_dev *dev = fe->demodulator_priv;
- int ret;
-
- ret = af9033_update_ch_stat(dev);
- if (ret < 0)
- return ret;
- *ber = dev->ber;
+ *ber = (dev->post_bit_error - dev->post_bit_error_prev);
+ dev->post_bit_error_prev = dev->post_bit_error;
return 0;
}