diff options
author | Daniel Scheller <d.scheller@gmx.net> | 2017-06-25 08:26:45 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-06-25 09:10:44 -0300 |
commit | 006fe8ee884a70f8014034fe67a8ea70c4bdbcac (patch) | |
tree | 158b56e12c656fe4e56acddc3f6a5b4064721918 /drivers/media | |
parent | 87b467107438423b4dcbcece7ec1bced57992b25 (diff) | |
download | op-kernel-dev-006fe8ee884a70f8014034fe67a8ea70c4bdbcac.zip op-kernel-dev-006fe8ee884a70f8014034fe67a8ea70c4bdbcac.tar.gz |
media: dvb-frontends/stv0367: DVB-C signal strength statistics
Provide QAM/DVB-C signal strength in decibel scale. Values returned from
stv0367cab_get_rf_lvl() are good but need to be multiplied as they're in
1dBm precision.
Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb-frontends/stv0367.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/media/dvb-frontends/stv0367.c b/drivers/media/dvb-frontends/stv0367.c index 1983c87..fab9434 100644 --- a/drivers/media/dvb-frontends/stv0367.c +++ b/drivers/media/dvb-frontends/stv0367.c @@ -2998,6 +2998,25 @@ static int stv0367ddb_set_frontend(struct dvb_frontend *fe) return -EINVAL; } +static void stv0367ddb_read_signal_strength(struct dvb_frontend *fe) +{ + struct stv0367_state *state = fe->demodulator_priv; + struct dtv_frontend_properties *p = &fe->dtv_property_cache; + s32 signalstrength; + + switch (state->activedemod) { + case demod_cab: + signalstrength = stv0367cab_get_rf_lvl(state) * 1000; + break; + default: + p->strength.stat[0].scale = FE_SCALE_NOT_AVAILABLE; + return; + } + + p->strength.stat[0].scale = FE_SCALE_DECIBEL; + p->strength.stat[0].uvalue = signalstrength; +} + static void stv0367ddb_read_snr(struct dvb_frontend *fe) { struct stv0367_state *state = fe->demodulator_priv; @@ -3075,6 +3094,8 @@ static int stv0367ddb_read_status(struct dvb_frontend *fe, if (ret) return ret; + stv0367ddb_read_signal_strength(fe); + /* read carrier/noise when a carrier is detected */ if (*status & FE_HAS_CARRIER) stv0367ddb_read_snr(fe); |