Skip to content

Commit

Permalink
[PATCH] v4l: tuner improvements
Browse files Browse the repository at this point in the history
*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>
  • Loading branch information
Mauro Carvalho Chehab authored and Linus Torvalds committed Jun 29, 2005
1 parent 96b6aba commit 586b0ca
Show file tree
Hide file tree
Showing 8 changed files with 471 additions and 116 deletions.
3 changes: 1 addition & 2 deletions drivers/media/video/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ bttv-objs := bttv-driver.o bttv-cards.o bttv-if.o \
zoran-objs := zr36120.o zr36120_i2c.o zr36120_mem.o
zr36067-objs := zoran_procfs.o zoran_device.o \
zoran_driver.o zoran_card.o
tuner-objs := tuner-core.o tuner-simple.o mt20xx.o tda8290.o

tuner-objs := tuner-core.o tuner-simple.o mt20xx.o tda8290.o tea5767.o
obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-common.o v4l1-compat.o

obj-$(CONFIG_VIDEO_BT848) += bttv.o msp3400.o tvaudio.o \
Expand Down
6 changes: 3 additions & 3 deletions drivers/media/video/mt20xx.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $Id: mt20xx.c,v 1.4 2005/03/04 09:24:56 kraxel Exp $
* $Id: mt20xx.c,v 1.5 2005/06/16 08:29:49 nsh Exp $
*
* i2c tv tuner chip device driver
* controls microtune tuners, mt2032 + mt2050 at the moment.
Expand Down Expand Up @@ -295,8 +295,8 @@ static void mt2032_set_radio_freq(struct i2c_client *c, unsigned int freq)
int if2 = t->radio_if2;

// per Manual for FM tuning: first if center freq. 1085 MHz
mt2032_set_if_freq(c, freq*62500 /* freq*1000*1000/16 */,
1085*1000*1000,if2,if2,if2);
mt2032_set_if_freq(c, freq * 1000 / 16,
1085*1000*1000,if2,if2,if2);
}

// Initalization as described in "MT203x Programming Procedures", Rev 1.2, Feb.2001
Expand Down
20 changes: 14 additions & 6 deletions drivers/media/video/tda8290.c
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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 };
Expand Down Expand Up @@ -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;
}

Expand Down
7 changes: 3 additions & 4 deletions drivers/media/video/tda9887.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ static int tda9887_set_tvnorm(struct tda9887 *t, char *buf)
if (t->radio_mode == V4L2_TUNER_MODE_MONO)
norm = &radio_mono;
else
norm = &radio_stereo;
norm = &radio_stereo;
} else {
for (i = 0; i < ARRAY_SIZE(tvnorms); i++) {
if (tvnorms[i].std & t->std) {
Expand Down Expand Up @@ -566,7 +566,6 @@ static int tda9887_configure(struct tda9887 *t)
if (UNSET != t->pinnacle_id) {
tda9887_set_pinnacle(t,buf);
}

tda9887_set_config(t,buf);
tda9887_set_insmod(t,buf);

Expand Down Expand Up @@ -615,8 +614,8 @@ static int tda9887_attach(struct i2c_adapter *adap, int addr, int kind)
t->pinnacle_id = UNSET;
t->radio_mode = V4L2_TUNER_MODE_STEREO;

i2c_set_clientdata(&t->client, t);
i2c_attach_client(&t->client);
i2c_set_clientdata(&t->client, t);
i2c_attach_client(&t->client);

return 0;
}
Expand Down
Loading

0 comments on commit 586b0ca

Please sign in to comment.