summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2016-07-01 17:03:14 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-07-16 12:55:30 +0300
commit988bd281d33b2249bf5d67dba0936795f2f9a2f2 (patch)
treefba3f7fc686604abbfcde4cd54d20ca4b89f359e /drivers
parent4216be14be19ef3ca0c0afdb2f5c1a352e688a61 (diff)
downloadlinux-988bd281d33b2249bf5d67dba0936795f2f9a2f2.tar.xz
[media] cxd2841er: provide signal strength for DVB-C
Currently, there's no stats for DVB-C. Let's at least return signal strength. The scale is different than on DVB-T, so let's use a relative scale, for now. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/dvb-frontends/cxd2841er.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/dvb-frontends/cxd2841er.c b/drivers/media/dvb-frontends/cxd2841er.c
index 94de6ba3d0e2..2a698711d25b 100644
--- a/drivers/media/dvb-frontends/cxd2841er.c
+++ b/drivers/media/dvb-frontends/cxd2841er.c
@@ -1750,7 +1750,6 @@ static void cxd2841er_read_signal_strength(struct dvb_frontend *fe)
dev_dbg(&priv->i2c->dev, "%s()\n", __func__);
switch (p->delivery_system) {
- case SYS_DVBC_ANNEX_A:
case SYS_DVBC_ANNEX_B:
case SYS_DVBC_ANNEX_C:
strength = 65535 - cxd2841er_read_agc_gain_c(
@@ -1766,6 +1765,12 @@ static void cxd2841er_read_signal_strength(struct dvb_frontend *fe)
/* Formula was empirically determinated @ 410 MHz */
p->strength.stat[0].uvalue = ((s32)strength) * 366 / 100 - 89520;
break; /* Code moved out of the function */
+ case SYS_DVBC_ANNEX_A:
+ strength = cxd2841er_read_agc_gain_t_t2(priv,
+ p->delivery_system);
+ p->strength.stat[0].scale = FE_SCALE_RELATIVE;
+ p->strength.stat[0].uvalue = strength;
+ break;
case SYS_ISDBT:
strength = 65535 - cxd2841er_read_agc_gain_i(
priv, p->delivery_system);