aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tda8290.c
diff options
context:
space:
mode:
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 b27cc348d95c..f59d4601cc63 100644
--- a/drivers/media/video/tda8290.c
+++ b/drivers/media/video/tda8290.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: tda8290.c,v 1.7 2005/03/07 12:01:51 kraxel Exp $ 2 * $Id: tda8290.c,v 1.11 2005/06/18 06:09:06 nsh Exp $
3 * 3 *
4 * i2c tv tuner chip device driver 4 * i2c tv tuner chip device driver
5 * controls the philips tda8290+75 tuner chip combo. 5 * controls the philips tda8290+75 tuner chip combo.
@@ -69,7 +69,7 @@ static __u8 get_freq_entry( struct freq_entry* table, __u16 freq)
69static unsigned char i2c_enable_bridge[2] = { 0x21, 0xC0 }; 69static unsigned char i2c_enable_bridge[2] = { 0x21, 0xC0 };
70static unsigned char i2c_disable_bridge[2] = { 0x21, 0x80 }; 70static unsigned char i2c_disable_bridge[2] = { 0x21, 0x80 };
71static unsigned char i2c_init_tda8275[14] = { 0x00, 0x00, 0x00, 0x00, 71static unsigned char i2c_init_tda8275[14] = { 0x00, 0x00, 0x00, 0x00,
72 0x7C, 0x04, 0xA3, 0x3F, 72 0xfC, 0x04, 0xA3, 0x3F,
73 0x2A, 0x04, 0xFF, 0x00, 73 0x2A, 0x04, 0xFF, 0x00,
74 0x00, 0x40 }; 74 0x00, 0x40 };
75static unsigned char i2c_set_VS[2] = { 0x30, 0x6F }; 75static unsigned char i2c_set_VS[2] = { 0x30, 0x6F };
@@ -138,16 +138,24 @@ static int tda8290_tune(struct i2c_client *c)
138 138
139static void set_frequency(struct tuner *t, u16 ifc) 139static void set_frequency(struct tuner *t, u16 ifc)
140{ 140{
141 u32 N = (((t->freq<<3)+ifc)&0x3fffc); 141 u32 freq;
142 u32 N;
142 143
143 N = N >> get_freq_entry(div_table, t->freq); 144 if (t->mode == V4L2_TUNER_RADIO)
145 freq = t->freq / 1000;
146 else
147 freq = t->freq;
148
149 N = (((freq<<3)+ifc)&0x3fffc);
150
151 N = N >> get_freq_entry(div_table, freq);
144 t->i2c_set_freq[0] = 0; 152 t->i2c_set_freq[0] = 0;
145 t->i2c_set_freq[1] = (unsigned char)(N>>8); 153 t->i2c_set_freq[1] = (unsigned char)(N>>8);
146 t->i2c_set_freq[2] = (unsigned char) N; 154 t->i2c_set_freq[2] = (unsigned char) N;
147 t->i2c_set_freq[3] = 0x40; 155 t->i2c_set_freq[3] = 0x40;
148 t->i2c_set_freq[4] = 0x52; 156 t->i2c_set_freq[4] = 0x52;
149 t->i2c_set_freq[5] = get_freq_entry(band_table, t->freq); 157 t->i2c_set_freq[5] = get_freq_entry(band_table, freq);
150 t->i2c_set_freq[6] = get_freq_entry(agc_table, t->freq); 158 t->i2c_set_freq[6] = get_freq_entry(agc_table, freq);
151 t->i2c_set_freq[7] = 0x8f; 159 t->i2c_set_freq[7] = 0x8f;
152} 160}
153 161