From 7d87167e58928af2e5d43f9a501b55d7d2f8976f Mon Sep 17 00:00:00 2001 From: Douglas Schilling Landgraf Date: Mon, 1 Oct 2007 00:32:25 -0300 Subject: [PATCH] GemTek Radio card - frequency calculation From: Trent Piepho Frequency calculation to use better math. It's still the same IF offset and step size (which are not the same as the datasheet says) as the code was before. It's just more efficient and accurate. Signed-off-by: Trent Piepho Signed-off-by: Douglas Schilling Landgraf --- linux/drivers/media/radio/radio-gemtek.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'linux') diff --git a/linux/drivers/media/radio/radio-gemtek.c b/linux/drivers/media/radio/radio-gemtek.c index e63ff3a4e..1bc000f15 100644 --- a/linux/drivers/media/radio/radio-gemtek.c +++ b/linux/drivers/media/radio/radio-gemtek.c @@ -90,6 +90,14 @@ module_param(radio_nr, int, 0444); #define GEMTEK_LOWFREQ (87*16000) #define GEMTEK_HIGHFREQ (108*16000) +/* + * Frequency calculation constants. Intermediate frequency 10.52 MHz (nominal + * value 10.7 MHz), reference divisor 6.39 kHz (nominal 6.25 kHz). + */ +#define FSCALE 8 +#define IF_OFFSET ((unsigned int)(10.52 * 16000 * (1<