summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2011-04-24 10:36:21 +0200
committerSylvain Munaut <tnt@246tNt.com>2011-05-29 19:51:54 +0200
commit706c3b0db7b897e882e4c1e4b8dd82bd1b77b3c8 (patch)
treed33adc33102bd780a10afbf788f01826f2466e06
parent4684c75a668c7d25a5f6ebf2224a92982fdb500b (diff)
fw/trf6151: Use a #define to enable/disable out-of-spec warnings
We also disable them by default because: - It can operate fine out of spec - Some phone will actually do it (like using the DCS port for PCS) - It's verbose for nothing for most people anyway Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
-rw-r--r--src/target/firmware/rf/trf6151.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/target/firmware/rf/trf6151.c b/src/target/firmware/rf/trf6151.c
index 9191d0cd..94d4d6f5 100644
--- a/src/target/firmware/rf/trf6151.c
+++ b/src/target/firmware/rf/trf6151.c
@@ -35,6 +35,8 @@
#include <rf/trf6151.h>
+/* #define WARN_OUT_OF_SPEC 1 */
+
enum trf6151_reg {
REG_RX = 0, /* RF general settings */
REG_PLL = 1, /* PLL settings */
@@ -183,9 +185,11 @@ static void trf6151_pll_rx(uint32_t freq_khz,
*pll_config = PLL_VAL(a, b);
/* Out-of-spec tuning warning */
+#ifdef WARN_OUT_OF_SPEC
if ((l == 4 && (b < 135 || b > 150)) ||
(l == 2 && (b < 141 || b > 155)))
printf("Frequency %u kHz is out of spec\n", (unsigned int)freq_khz);
+#endif
/* Select band */
if (l==4) {
@@ -197,9 +201,11 @@ static void trf6151_pll_rx(uint32_t freq_khz,
*band = GSM900;
/* Out-of-spec freq check */
+#ifdef WARN_OUT_OF_SPEC
if (!(freq_khz >= 869000 && freq_khz <= 894000) &&
!(freq_khz >= 921000 && freq_khz <= 960000)) /* include GSM-R */
printf("Frequency %u outside normal filter range for selected port\n", (unsigned int)freq_khz);
+#endif
} else {
/* In the high band, different ports for DCS/PCS, so
* take what's best and available */
@@ -215,9 +221,11 @@ static void trf6151_pll_rx(uint32_t freq_khz,
*band = (port & (1 << PORT_DCS1800)) ? GSM1800 : GSM1900;
/* Out-of-spec freq check */
+#ifdef WARN_OUT_OF_SPEC
if ((*band == GSM1800 && (freq_khz < 1805000 || freq_khz > 1880000)) ||
(*band == GSM1900 && (freq_khz < 1930000 || freq_khz > 1990000)))
printf("Frequency %u outside normal filter range for selected port\n", (unsigned int)freq_khz);
+#endif
}
/* Debug */
@@ -299,8 +307,10 @@ static void trf6151_pll_tx(uint32_t freq_khz,
printd("TX Freq %u kHz => A = %u, B = %u, band = %d\n", freq_khz, a, b, *band);
/* Out-of-spec tuning warning */
+#ifdef WARN_OUT_OF_SPEC
if (b < b_min || b > b_max)
printf("Frequency %u kHz is out of spec\n", (unsigned int)freq_khz);
+#endif
/* All done */
return;