mirror of https://gitee.com/openkylin/linux.git
[media] rtl2832: wrap DVBv5 BER to DVBv3
Change legacy DVBv3 read BER to return values calculated by DVBv5 statistics. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
parent
f7caf93fb8
commit
084330b746
|
@ -805,20 +805,11 @@ static int rtl2832_read_snr(struct dvb_frontend *fe, u16 *snr)
|
||||||
static int rtl2832_read_ber(struct dvb_frontend *fe, u32 *ber)
|
static int rtl2832_read_ber(struct dvb_frontend *fe, u32 *ber)
|
||||||
{
|
{
|
||||||
struct rtl2832_dev *dev = fe->demodulator_priv;
|
struct rtl2832_dev *dev = fe->demodulator_priv;
|
||||||
struct i2c_client *client = dev->client;
|
|
||||||
int ret;
|
|
||||||
u8 buf[2];
|
|
||||||
|
|
||||||
ret = rtl2832_rd_regs(dev, 0x4e, 3, buf, 2);
|
*ber = (dev->post_bit_error - dev->post_bit_error_prev);
|
||||||
if (ret)
|
dev->post_bit_error_prev = dev->post_bit_error;
|
||||||
goto err;
|
|
||||||
|
|
||||||
*ber = buf[0] << 8 | buf[1];
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
err:
|
|
||||||
dev_dbg(&client->dev, "failed=%d\n", ret);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rtl2832_stat_work(struct work_struct *work)
|
static void rtl2832_stat_work(struct work_struct *work)
|
||||||
|
|
|
@ -36,6 +36,7 @@ struct rtl2832_dev {
|
||||||
struct dvb_frontend fe;
|
struct dvb_frontend fe;
|
||||||
struct delayed_work stat_work;
|
struct delayed_work stat_work;
|
||||||
fe_status_t fe_status;
|
fe_status_t fe_status;
|
||||||
|
u64 post_bit_error_prev; /* for old DVBv3 read_ber() calculation */
|
||||||
u64 post_bit_error;
|
u64 post_bit_error;
|
||||||
u64 post_bit_count;
|
u64 post_bit_count;
|
||||||
bool i2c_gate_state;
|
bool i2c_gate_state;
|
||||||
|
|
Loading…
Reference in New Issue