From: Trent Piepho Date: Mon, 1 Oct 2007 03:32:25 +0000 (-0300) Subject: V4L/DVB (6245): GemTek Radio card - frequency calculation X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=857e594ad5662349d95ad33f987cbf55cc356a90;p=deliverable%2Flinux.git V4L/DVB (6245): GemTek Radio card - frequency calculation 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 Reviewed-by: Pekka Seppänen Signed-off-by: Douglas Schilling Landgraf Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/radio/radio-gemtek.c b/drivers/media/radio/radio-gemtek.c index f959bb71c460..0fcd2b09218d 100644 --- a/drivers/media/radio/radio-gemtek.c +++ b/drivers/media/radio/radio-gemtek.c @@ -89,6 +89,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<