From: Antti Palosaari Date: Wed, 9 Jul 2014 23:22:27 +0000 (-0300) Subject: [media] si2168: implement CNR statistic X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=88ac8f860640f28ae6fae43ca690adc3f7294b90;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [media] si2168: implement CNR statistic Implement CNR statistic. Signed-off-by: Antti Palosaari Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c index dc8ec9e3df9f..150d8661d1e6 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);