aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2016-07-01 10:03:16 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-07-16 05:56:03 -0400
commitd12b791e3db757c42484342a015f26990642fdcb (patch)
tree31438100fc99780df47e27ca2c67a095e14c3fc3
parent988bd281d33b2249bf5d67dba0936795f2f9a2f2 (diff)
[media] cxd2841er: adjust the dB scale for DVB-C
Instead of using a relative frequency range, calibrate it to show the results in dB. The callibration was done getting samples with a signal generated from -50dBm to -12dBm, incremented in steps of 0.5 dB, using 3 frequencies: 175 MHz, 410 MHz and 800 MHz. The modulated signal was using QAM64, and it was used a linear interpolation of all the results. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r--drivers/media/dvb-frontends/cxd2841er.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/media/dvb-frontends/cxd2841er.c b/drivers/media/dvb-frontends/cxd2841er.c
index 2a698711d25b..95d82c4445e2 100644
--- a/drivers/media/dvb-frontends/cxd2841er.c
+++ b/drivers/media/dvb-frontends/cxd2841er.c
@@ -1768,8 +1768,13 @@ static void cxd2841er_read_signal_strength(struct dvb_frontend *fe)
1768 case SYS_DVBC_ANNEX_A: 1768 case SYS_DVBC_ANNEX_A:
1769 strength = cxd2841er_read_agc_gain_t_t2(priv, 1769 strength = cxd2841er_read_agc_gain_t_t2(priv,
1770 p->delivery_system); 1770 p->delivery_system);
1771 p->strength.stat[0].scale = FE_SCALE_RELATIVE; 1771 p->strength.stat[0].scale = FE_SCALE_DECIBEL;
1772 p->strength.stat[0].uvalue = strength; 1772 /*
1773 * Formula was empirically determinated via linear regression,
1774 * using frequencies: 175 MHz, 410 MHz and 800 MHz, and a
1775 * stream modulated with QAM64
1776 */
1777 p->strength.stat[0].uvalue = ((s32)strength) * 4045 / 1000 - 85224;
1773 break; 1778 break;
1774 case SYS_ISDBT: 1779 case SYS_ISDBT:
1775 strength = 65535 - cxd2841er_read_agc_gain_i( 1780 strength = 65535 - cxd2841er_read_agc_gain_i(