diff options
author | Chris Pascoe <c.pascoe@itee.uq.edu.au> | 2007-11-20 00:49:41 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 16:02:36 -0500 |
commit | c6e62a3a398d62e8ae366ac1465911db0ac7fc0b (patch) | |
tree | 2b1bafc469d28d1f896cf87a5284d011a31f45d0 /drivers/media/dvb/frontends/mt352.c | |
parent | 5ccaf905015c83a9b28e8496b4504b9b8dc25a80 (diff) |
V4L/DVB (6654): mt352: support oversampled IF input
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 'drivers/media/dvb/frontends/mt352.c')
-rw-r--r-- | drivers/media/dvb/frontends/mt352.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/dvb/frontends/mt352.c b/drivers/media/dvb/frontends/mt352.c index 5dd9b731f6f2..7cd190b6f015 100644 --- a/drivers/media/dvb/frontends/mt352.c +++ b/drivers/media/dvb/frontends/mt352.c | |||
@@ -152,7 +152,13 @@ static void mt352_calc_input_freq(struct mt352_state* state, | |||
152 | if (state->config.if2) | 152 | if (state->config.if2) |
153 | if2 = state->config.if2; | 153 | if2 = state->config.if2; |
154 | 154 | ||
155 | ife = (2*adc_clock - if2); | 155 | if (adc_clock >= if2 * 2) |
156 | ife = if2; | ||
157 | else { | ||
158 | ife = adc_clock - (if2 % adc_clock); | ||
159 | if (ife > adc_clock / 2) | ||
160 | ife = adc_clock - ife; | ||
161 | } | ||
156 | value = -16374 * ife / adc_clock; | 162 | value = -16374 * ife / adc_clock; |
157 | dprintk("%s: if2 %d, ife %d, adc_clock %d => %d / 0x%x\n", | 163 | dprintk("%s: if2 %d, ife %d, adc_clock %d => %d / 0x%x\n", |
158 | __FUNCTION__, if2, ife, adc_clock, value, value & 0x3fff); | 164 | __FUNCTION__, if2, ife, adc_clock, value, value & 0x3fff); |