aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-frontends/si2168.c
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2014-07-09 23:22:27 (GMT)
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-07-15 00:07:02 (GMT)
commit88ac8f860640f28ae6fae43ca690adc3f7294b90 (patch)
tree1680a8b3a9c3aba19d14fcc9c6e2d4d445f33345 /drivers/media/dvb-frontends/si2168.c
parent888680ff9d2690b64ef7ee3b53d4169a7c4d31b6 (diff)
[media] si2168: implement CNR statistic
Implement CNR statistic. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/dvb-frontends/si2168.c')
-rw-r--r--drivers/media/dvb-frontends/si2168.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c
index dc8ec9e..150d866 100644
--- a/drivers/media/dvb-frontends/si2168.c
+++ b/drivers/media/dvb-frontends/si2168.c
@@ -141,6 +141,15 @@ static int si2168_read_status(struct dvb_frontend *fe, fe_status_t *status)
s->fe_status = *status;
+ if (*status & FE_HAS_LOCK) {
+ c->cnr.len = 1;
+ c->cnr.stat[0].scale = FE_SCALE_DECIBEL;
+ c->cnr.stat[0].svalue = cmd.args[3] * 1000 / 4;
+ } else {
+ c->cnr.len = 1;
+ c->cnr.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
+ }
+
dev_dbg(&s->client->dev, "%s: status=%02x args=%*ph\n",
__func__, *status, cmd.rlen, cmd.args);

Privacy Policy