summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorChris Pascoe <c.pascoe@itee.uq.edu.au>2007-11-20 15:49:41 +1000
committerChris Pascoe <c.pascoe@itee.uq.edu.au>2007-11-20 15:49:41 +1000
commit9df8e9ae7eaa584016ee314cb07a4717097a4a64 (patch)
treeb0a6898d6da86d4b0a909771f931c643092625b8 /linux
parent9ab766dfc4a7509e2c313383b8a18a750892f6d1 (diff)
downloadmediapointer-dvb-s2-9df8e9ae7eaa584016ee314cb07a4717097a4a64.tar.gz
mediapointer-dvb-s2-9df8e9ae7eaa584016ee314cb07a4717097a4a64.tar.bz2
mt352: support oversampled IF input
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> Rework the input frequency calculation so that it produces the right values when the ADC oversamples the IF input. This means MT352 devices can now process a near-zero IF (according to the, specs 4.57MHz is supported with the default crystal). Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/dvb/frontends/mt352.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/linux/drivers/media/dvb/frontends/mt352.c b/linux/drivers/media/dvb/frontends/mt352.c
index c9500f58a..f9eb120c0 100644
--- a/linux/drivers/media/dvb/frontends/mt352.c
+++ b/linux/drivers/media/dvb/frontends/mt352.c
@@ -153,7 +153,13 @@ static void mt352_calc_input_freq(struct mt352_state* state,
if (state->config.if2)
if2 = state->config.if2;
- ife = (2*adc_clock - if2);
+ if (adc_clock >= if2 * 2)
+ ife = if2;
+ else {
+ ife = adc_clock - (if2 % adc_clock);
+ if (ife > adc_clock / 2)
+ ife = adc_clock - ife;
+ }
value = -16374 * ife / adc_clock;
dprintk("%s: if2 %d, ife %d, adc_clock %d => %d / 0x%x\n",
__FUNCTION__, if2, ife, adc_clock, value, value & 0x3fff);