aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/tda8290.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <maurochehab@gmail.com>2005-06-28 20:45:21 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-28 21:20:36 -0700
commit586b0cab2516640fec4dffc3049c4d8bca188f89 (patch)
treeafd2bc01527bfccc3dbaf5c2de7ae52c7f18c2d6 /drivers/media/video/tda8290.c
parent96b6aba08762f09e5dfa616854cb80ce054a7bf8 (diff)
[PATCH] v4l: tuner improvements
*tuner-core.c: - some tuner_info msgs will be generated only if insmod opt tuner_debug enabled. - Implemented tuner-core support for VIDIO_S_TUNER to allow changing mono/stereo mode - Remove unneeded config options. - I2C_CLIENT_MULTI option removed. - support for Philips FMD12ME hybrid tuner - allow to initialize with another tuner - Move PHILIPS_FMD initialization code to set_type function, * tda8290: - Fix dumb error in tda8290 tunning. - Radio tuner uses high-precision step instead of 62.5 KHz. *tea5767.c: - tuner_info msgs will be generated only if insmod tuner option tuner_debug enabled. - some cleanups for better reading. - Radio tuner uses high-precision step instead of 62.5 KHz. - Changing radio mode stereo/mono for tea5767 working. *tuner-simple.c: - TNF9533-D/IF UHF fixup. - Radio tuners now uses high-precision step instead of 62.5 KHz. *mt20xx.c: - Radio tuner uses high-precision step instead of 62.5 KHz. *tda9887.c: - tab and blank spaces corrections. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br> Signed-off-by: Gerd Knorr <kraxel@bytesex.org> Signed-off-by: Nickolay V Shmyrev <nshmyrev@yandex.ru> Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de> Signed-off-by: Michael Krufky <mkrufky@m1k.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/video/tda8290.c')
-rw-r--r--drivers/media/video/tda8290.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/media/video/tda8290.c b/drivers/media/video/tda8290.c
index b27cc348d95..f59d4601cc6 100644
--- a/drivers/media/video/tda8290.c
+++ b/drivers/media/video/tda8290.c
@@ -1,5 +1,5 @@
/*
- * $Id: tda8290.c,v 1.7 2005/03/07 12:01:51 kraxel Exp $
+ * $Id: tda8290.c,v 1.11 2005/06/18 06:09:06 nsh Exp $
*
* i2c tv tuner chip device driver
* controls the philips tda8290+75 tuner chip combo.
@@ -69,7 +69,7 @@ static __u8 get_freq_entry( struct freq_entry* table, __u16 freq)
static unsigned char i2c_enable_bridge[2] = { 0x21, 0xC0 };
static unsigned char i2c_disable_bridge[2] = { 0x21, 0x80 };
static unsigned char i2c_init_tda8275[14] = { 0x00, 0x00, 0x00, 0x00,
- 0x7C, 0x04, 0xA3, 0x3F,
+ 0xfC, 0x04, 0xA3, 0x3F,
0x2A, 0x04, 0xFF, 0x00,
0x00, 0x40 };
static unsigned char i2c_set_VS[2] = { 0x30, 0x6F };
@@ -138,16 +138,24 @@ static int tda8290_tune(struct i2c_client *c)
static void set_frequency(struct tuner *t, u16 ifc)
{
- u32 N = (((t->freq<<3)+ifc)&0x3fffc);
+ u32 freq;
+ u32 N;
- N = N >> get_freq_entry(div_table, t->freq);
+ if (t->mode == V4L2_TUNER_RADIO)
+ freq = t->freq / 1000;
+ else
+ freq = t->freq;
+
+ N = (((freq<<3)+ifc)&0x3fffc);
+
+ N = N >> get_freq_entry(div_table, freq);
t->i2c_set_freq[0] = 0;
t->i2c_set_freq[1] = (unsigned char)(N>>8);
t->i2c_set_freq[2] = (unsigned char) N;
t->i2c_set_freq[3] = 0x40;
t->i2c_set_freq[4] = 0x52;
- t->i2c_set_freq[5] = get_freq_entry(band_table, t->freq);
- t->i2c_set_freq[6] = get_freq_entry(agc_table, t->freq);
+ t->i2c_set_freq[5] = get_freq_entry(band_table, freq);
+ t->i2c_set_freq[6] = get_freq_entry(agc_table, freq);
t->i2c_set_freq[7] = 0x8f;
}