diff options
author | Antti Palosaari <crope@iki.fi> | 2017-06-12 21:10:08 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-06-20 16:23:14 +0300 |
commit | d029799b2f52e98f4b0920ed9b80b169f522e0cb (patch) | |
tree | 078138be662e3aca8276999c93c69201d5a8e4d7 /drivers/media | |
parent | bf69e07262f69da5893faca8b696d1a561b0dd24 (diff) | |
download | linux-d029799b2f52e98f4b0920ed9b80b169f522e0cb.tar.xz |
[media] af9013: add dvbv5 cnr
Add support for DVBv5 CNR.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb-frontends/af9013.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/dvb-frontends/af9013.c b/drivers/media/dvb-frontends/af9013.c index 84b04ab20d21..2acd9fdd8b39 100644 --- a/drivers/media/dvb-frontends/af9013.c +++ b/drivers/media/dvb-frontends/af9013.c @@ -228,6 +228,7 @@ static int af9013_statistics_snr_result(struct dvb_frontend *fe) { struct af9013_state *state = fe->demodulator_priv; struct i2c_client *client = state->client; + struct dtv_frontend_properties *c = &fe->dtv_property_cache; int ret, i, len; unsigned int utmp; u8 buf[3]; @@ -283,6 +284,9 @@ static int af9013_statistics_snr_result(struct dvb_frontend *fe) } state->snr = utmp * 10; /* dB/10 */ + c->cnr.stat[0].svalue = 1000 * utmp; + c->cnr.stat[0].scale = FE_SCALE_DECIBEL; + return 0; err: dev_dbg(&client->dev, "failed %d\n", ret); @@ -1509,6 +1513,7 @@ static int af9013_probe(struct i2c_client *client, { struct af9013_state *state; struct af9013_platform_data *pdata = client->dev.platform_data; + struct dtv_frontend_properties *c; int ret, i; u8 firmware_version[4]; static const struct regmap_bus regmap_bus = { @@ -1573,6 +1578,10 @@ static int af9013_probe(struct i2c_client *client, /* Setup callbacks */ pdata->get_dvb_frontend = af9013_get_dvb_frontend; + /* Init stats to indicate which stats are supported */ + c = &state->fe.dtv_property_cache; + c->cnr.len = 1; + dev_info(&client->dev, "Afatech AF9013 successfully attached\n"); dev_info(&client->dev, "firmware version: %d.%d.%d.%d\n", firmware_version[0], firmware_version[1], |