diff options
author | Mauro Carvalho Chehab <devnull@localhost> | 2005-07-14 03:06:43 +0000 |
---|---|---|
committer | Mauro Carvalho Chehab <devnull@localhost> | 2005-07-14 03:06:43 +0000 |
commit | b239a19dc21542e9e49303f2104c8aa8497da923 (patch) | |
tree | 47ea6b1f57962c0973e5e03ee465d3370fe85df0 /linux/drivers/media | |
parent | 13e6e2193c10032c0c204e8b0809e5488ff2a26e (diff) | |
download | mediapointer-dvb-s2-b239a19dc21542e9e49303f2104c8aa8497da923.tar.gz mediapointer-dvb-s2-b239a19dc21542e9e49303f2104c8aa8497da923.tar.bz2 |
* tea5767.c:
- Newer tea autodetection code is not stable. Restaured old
behavior.
* tuner-core.c:
- new option no_autodetect to disable tuner autodetection codes.
* cx88-cards.c:
- There are newer PixelView Ultra cards without tea chips.
Radio and addresses unset to allow autodetection.
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-cards.c | 8 | ||||
-rw-r--r-- | linux/drivers/media/video/tea5767.c | 29 | ||||
-rw-r--r-- | linux/drivers/media/video/tuner-core.c | 29 |
3 files changed, 23 insertions, 43 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-cards.c b/linux/drivers/media/video/cx88/cx88-cards.c index b0b47c3cd..3d0c784b3 100644 --- a/linux/drivers/media/video/cx88/cx88-cards.c +++ b/linux/drivers/media/video/cx88/cx88-cards.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-cards.c,v 1.85 2005/07/04 19:35:05 mkrufky Exp $ + * $Id: cx88-cards.c,v 1.86 2005/07/14 03:06:43 mchehab Exp $ * * device driver for Conexant 2388x based TV cards * card-specific stuff. @@ -682,9 +682,9 @@ struct cx88_board cx88_boards[] = { .name = "PixelView PlayTV Ultra Pro (Stereo)", /* May be also TUNER_YMEC_TVF_5533MF for NTSC/M or PAL/M */ .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, - .radio_type = TUNER_TEA5767, - .tuner_addr = 0xc2>>1, - .radio_addr = 0xc0>>1, + .radio_type = UNSET, + .tuner_addr = ADDR_UNSET, + .radio_addr = ADDR_UNSET, .input = {{ .type = CX88_VMUX_TELEVISION, .vmux = 0, diff --git a/linux/drivers/media/video/tea5767.c b/linux/drivers/media/video/tea5767.c index 821c9e676..4d27ac1b7 100644 --- a/linux/drivers/media/video/tea5767.c +++ b/linux/drivers/media/video/tea5767.c @@ -2,7 +2,7 @@ * For Philips TEA5767 FM Chip used on some TV Cards like Prolink Pixelview * I2C address is allways 0xC0. * - * $Id: tea5767.c,v 1.20 2005/07/13 10:48:32 mchehab Exp $ + * $Id: tea5767.c,v 1.21 2005/07/14 03:06:43 mchehab Exp $ * * Copyright (c) 2005 Mauro Carvalho Chehab (mchehab@brturbo.com.br) * This code is placed under the terms of the GNU General Public License @@ -294,7 +294,7 @@ static int tea5767_stereo(struct i2c_client *c) int tea5767_autodetection(struct i2c_client *c) { unsigned char buffer[5] = { 0xff, 0xff, 0xff, 0xff, 0xff }; - int rc,div; + int rc; struct tuner *t = i2c_get_clientdata(c); if (5 != (rc = i2c_master_recv(c, buffer, 5))) { @@ -319,31 +319,6 @@ int tea5767_autodetection(struct i2c_client *c) return EINVAL; } - /* Sets tuner at some freq (87.5 MHz) and see if it is ok */ - div = ((87500 * 4000 + 700000 + 225000) + 16768) >> 15; - buffer[0] = ((div >> 8) & 0x3f) | TEA5767_MUTE; - buffer[1] = div & 0xff; - buffer[2] = TEA5767_PORT1_HIGH; - buffer[3] = TEA5767_PORT2_HIGH | TEA5767_HIGH_CUT_CTRL | - TEA5767_ST_NOISE_CTL; - buffer[4] = 0; - - if (5 != (rc = i2c_master_send(c, buffer, 5))) - tuner_warn("i2c i/o error: rc == %d (should be 5)\n", rc); - - if (5 != (rc = i2c_master_recv(c, buffer, 5))) { - tuner_warn("It is not a TEA5767. Received %i bytes.\n", rc); - return EINVAL; - } - - /* Initial freq for 32.768KHz clock */ - if ((buffer[1] != (div & 0xff) ) || ((buffer[0] & 0x3f) != ((div >> 8) & 0x3f))) { - tuner_warn("It is not a TEA5767. div=%d, Return: %02x %02x %02x %02x %02x\n", - div,buffer[0],buffer[1],buffer[2],buffer[3],buffer[4]); - tea5767_status_dump(buffer); - return EINVAL; - } - tuner_warn("TEA5767 detected.\n"); return 0; } diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c index 7a1a7dccf..8c5ffb35d 100644 --- a/linux/drivers/media/video/tuner-core.c +++ b/linux/drivers/media/video/tuner-core.c @@ -1,5 +1,5 @@ /* - * $Id: tuner-core.c,v 1.57 2005/07/13 10:55:27 mchehab Exp $ + * $Id: tuner-core.c,v 1.58 2005/07/14 03:06:43 mchehab Exp $ * * i2c tv tuner chip device driver * core core, i.e. kernel interfaces, registering and so on @@ -43,6 +43,9 @@ I2C_CLIENT_INSMOD; static unsigned int addr = 0; module_param(addr, int, 0444); +static unsigned int no_autodetect = 0; +module_param(no_autodetect, int, 0444); + /* insmod options used at runtime => read/write */ unsigned int tuner_debug = 0; module_param(tuner_debug, int, 0644); @@ -328,17 +331,19 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind) tuner_info("chip found @ 0x%x (%s)\n", addr << 1, adap->name); /* TEA5767 autodetection code - only for addr = 0xc0 */ - if (addr == 0x60) { - if (tea5767_autodetection(&t->i2c) != EINVAL) { - t->type = TUNER_TEA5767; - t->mode_mask = T_RADIO; - t->mode = T_STANDBY; - t->freq = 87.5 * 16; /* Sets freq to FM range */ - default_mode_mask &= ~T_RADIO; - - i2c_attach_client (&t->i2c); - set_type(&t->i2c,t->type, t->mode_mask); - return 0; + if (!no_autodetect) { + if (addr == 0x60) { + if (tea5767_autodetection(&t->i2c) != EINVAL) { + t->type = TUNER_TEA5767; + t->mode_mask = T_RADIO; + t->mode = T_STANDBY; + t->freq = 87.5 * 16; /* Sets freq to FM range */ + default_mode_mask &= ~T_RADIO; + + i2c_attach_client (&t->i2c); + set_type(&t->i2c,t->type, t->mode_mask); + return 0; + } } } |