summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-03-05 23:29:48 +0100
committerHarald Welte <laforge@gnumonks.org>2012-03-05 23:29:48 +0100
commitbab0eb62cefdc054f46d0c4f4d5976bdaae8823d (patch)
treef5917d536e0f5ad36624a84285b0889c35e6af48
parentef60309e63b99c5ccafb6b3b4a7835f4f19076c8 (diff)
tuner_e4k: Introduce #define for OUT_OF_SPEC operation
The device can be used from 50..1900 MHz and not only 64..1700
-rw-r--r--firmware/src/tuner_e4k.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/firmware/src/tuner_e4k.c b/firmware/src/tuner_e4k.c
index ed3c4a1..18858bd 100644
--- a/firmware/src/tuner_e4k.c
+++ b/firmware/src/tuner_e4k.c
@@ -28,6 +28,10 @@
#include <tuner_e4k.h>
+/* If this is defined, the limits are somewhat relaxed compared to what the
+ * vendor claims is possible */
+#define OUT_OF_SPEC
+
#define MHZ(x) ((x)*1000*1000)
#define KHZ(x) ((x)*1000)
@@ -323,6 +327,14 @@ int e4k_if_filter_bw_get(struct e4k_state *e4k, enum e4k_if_filter filter)
#define E4K_FVCO_MAX_KHZ 3600000 /* 3.6 GHz */
#define E4K_PLL_Y 65535
+#ifdef OUT_OF_SPEC
+#define E4K_FLO_MIN_MHZ 50
+#define E4K_FLO_MAX_MHZ 1900
+#else
+#define E4K_FLO_MIN_MHZ 64
+#define E4K_FLO_MAX_MHZ 1700
+#endif
+
/* \brief table of R dividers in case 3phase mixing is enabled,
* the values have to be halved if it's 2phase */
static const uint8_t vco_r_table_3ph[] = {
@@ -353,7 +365,7 @@ static int is_fosc_valid(uint32_t fosc)
static int is_flo_valid(uint32_t flo)
{
- if (flo < MHZ(64) || flo > MHZ(1700)) {
+ if (flo < MHZ(E4K_FLO_MIN_MHZ) || flo > MHZ(E4K_FLO_MAX_MHZ)) {
LOGP(DTUN, LOGL_ERROR, "Flo %u invalid\n", flo);
return 0;
}