[PATCH] V4L: Miscellaneous fixes

- Fixed some bttv card numbers.

- BTTV and SAA7134 version numbers incremented to reflect changes.

- pci_dma_supported() is called after pci_set_dma_mask() which
already did check that for us. This patch removes the unneeded call to
pci_dma_supported() at bttv-driver.c

- Ensure a sufficient I2C bus idle time between 2 messages for
saa7134-i2c.c

- It is important to write at first to MO_GP3_IO for cx88-tvaudio.c

- Use try_to_freeze() instead of refrigerator at msp3400.c

- Recognizing the MFPE05-2 Tuner at tveeprom.c

- Add new parameter to help identify radio chipsets at tuner module:
show_i2c=1 will show 16 reading bytes from detected tuners.

- BTTV does generate some Unimplemented IOCTL log at tuner module:
0x40046d11(dir=1,tp=0x6d,nr=17,sz=4) means that it is sending
MSP3400 calls to non-msp3400 tuners. Warning eliminated.
VIDIOSAUDIO is also called, so debug messages updated. It is still
requiring IOCTL implementation.

- Added two more tuners.

- Add support for the SVideo input on the GDI Black Gold.

Signed-off-by: Peter Missel <peter.missel@onlinehome.de>
Signed-off-by: Graham Bevan <graham.bevan@ntlworld.com>
Signed-off-by: Torsten Seeboth <Torsten.Seeboth@t-online.de>
Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t.online.de>
Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>
Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Mauro Carvalho Chehab and committed by Linus Torvalds fd3113e8 cdf32eaa

+68 -30
+2
Documentation/video4linux/CARDLIST.tuner
··· 62 tuner=61 - Tena TNF9533-D/IF/TNF9533-B/DF 63 tuner=62 - Philips TEA5767HN FM Radio 64 tuner=63 - Philips FMD1216ME MK3 Hybrid Tuner
··· 62 tuner=61 - Tena TNF9533-D/IF/TNF9533-B/DF 63 tuner=62 - Philips TEA5767HN FM Radio 64 tuner=63 - Philips FMD1216ME MK3 Hybrid Tuner 65 + tuner=64 - LG TDVS-H062F/TUA6034 66 + tuner=65 - Ymec TVF66T5-B/DFF
+1 -6
drivers/media/video/bttv-driver.c
··· 1 /* 2 - $Id: bttv-driver.c,v 1.42 2005/07/05 17:37:35 nsh Exp $ 3 4 bttv - Bt848 frame grabber driver 5 ··· 3869 pci_set_master(dev); 3870 pci_set_command(dev); 3871 pci_set_drvdata(dev,btv); 3872 - if (!pci_dma_supported(dev,0xffffffff)) { 3873 - printk("bttv%d: Oops: no 32bit PCI DMA ???\n", btv->c.nr); 3874 - result = -EIO; 3875 - goto fail1; 3876 - } 3877 3878 pci_read_config_byte(dev, PCI_CLASS_REVISION, &btv->revision); 3879 pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat);
··· 1 /* 2 + $Id: bttv-driver.c,v 1.45 2005/07/20 19:43:24 mkrufky Exp $ 3 4 bttv - Bt848 frame grabber driver 5 ··· 3869 pci_set_master(dev); 3870 pci_set_command(dev); 3871 pci_set_drvdata(dev,btv); 3872 3873 pci_read_config_byte(dev, PCI_CLASS_REVISION, &btv->revision); 3874 pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat);
+4 -2
drivers/media/video/bttv.h
··· 1 /* 2 - * $Id: bttv.h,v 1.18 2005/05/24 23:41:42 nsh Exp $ 3 * 4 * bttv - Bt848 frame grabber driver 5 * ··· 135 #define BTTV_DVICO_DVBT_LITE 0x80 136 #define BTTV_TIBET_CS16 0x83 137 #define BTTV_KODICOM_4400R 0x84 138 - #define BTTV_ADLINK_RTV24 0x85 139 140 /* i2c address list */ 141 #define I2C_TSA5522 0xc2
··· 1 /* 2 + * $Id: bttv.h,v 1.22 2005/07/28 18:41:21 mchehab Exp $ 3 * 4 * bttv - Bt848 frame grabber driver 5 * ··· 135 #define BTTV_DVICO_DVBT_LITE 0x80 136 #define BTTV_TIBET_CS16 0x83 137 #define BTTV_KODICOM_4400R 0x84 138 + #define BTTV_ADLINK_RTV24 0x86 139 + #define BTTV_DVICO_FUSIONHDTV_5_LITE 0x87 140 + #define BTTV_ACORP_Y878F 0x88 141 142 /* i2c address list */ 143 #define I2C_TSA5522 0xc2
+2 -2
drivers/media/video/bttvp.h
··· 1 /* 2 - $Id: bttvp.h,v 1.19 2005/06/16 21:38:45 nsh Exp $ 3 4 bttv - Bt848 frame grabber driver 5 ··· 27 #define _BTTVP_H_ 28 29 #include <linux/version.h> 30 - #define BTTV_VERSION_CODE KERNEL_VERSION(0,9,15) 31 32 #include <linux/types.h> 33 #include <linux/wait.h>
··· 1 /* 2 + $Id: bttvp.h,v 1.21 2005/07/15 21:44:14 mchehab Exp $ 3 4 bttv - Bt848 frame grabber driver 5 ··· 27 #define _BTTVP_H_ 28 29 #include <linux/version.h> 30 + #define BTTV_VERSION_CODE KERNEL_VERSION(0,9,16) 31 32 #include <linux/types.h> 33 #include <linux/wait.h>
+4 -1
drivers/media/video/cx88/cx88-cards.c
··· 1 /* 2 - * $Id: cx88-cards.c,v 1.86 2005/07/14 03:06:43 mchehab Exp $ 3 * 4 * device driver for Conexant 2388x based TV cards 5 * card-specific stuff. ··· 90 .input = {{ 91 .type = CX88_VMUX_TELEVISION, 92 .vmux = 0, 93 }}, 94 }, 95 [CX88_BOARD_PIXELVIEW] = {
··· 1 /* 2 + * $Id: cx88-cards.c,v 1.90 2005/07/28 02:47:42 mkrufky Exp $ 3 * 4 * device driver for Conexant 2388x based TV cards 5 * card-specific stuff. ··· 90 .input = {{ 91 .type = CX88_VMUX_TELEVISION, 92 .vmux = 0, 93 + },{ 94 + .type = CX88_VMUX_SVIDEO, 95 + .vmux = 2, 96 }}, 97 }, 98 [CX88_BOARD_PIXELVIEW] = {
+2 -2
drivers/media/video/cx88/cx88-video.c
··· 1 /* 2 - * $Id: cx88-video.c,v 1.80 2005/07/13 08:49:08 mchehab Exp $ 3 * 4 * device driver for Conexant 2388x based TV cards 5 * video4linux video interface ··· 758 struct cx88_core *core = dev->core; 759 int board = core->board; 760 dprintk(1,"video_open: setting radio device\n"); 761 cx_write(MO_GP0_IO, cx88_boards[board].radio.gpio0); 762 cx_write(MO_GP1_IO, cx88_boards[board].radio.gpio1); 763 cx_write(MO_GP2_IO, cx88_boards[board].radio.gpio2); 764 - cx_write(MO_GP3_IO, cx88_boards[board].radio.gpio3); 765 dev->core->tvaudio = WW_FM; 766 cx88_set_tvaudio(core); 767 cx88_set_stereo(core,V4L2_TUNER_MODE_STEREO,1);
··· 1 /* 2 + * $Id: cx88-video.c,v 1.82 2005/07/22 05:13:34 mkrufky Exp $ 3 * 4 * device driver for Conexant 2388x based TV cards 5 * video4linux video interface ··· 758 struct cx88_core *core = dev->core; 759 int board = core->board; 760 dprintk(1,"video_open: setting radio device\n"); 761 + cx_write(MO_GP3_IO, cx88_boards[board].radio.gpio3); 762 cx_write(MO_GP0_IO, cx88_boards[board].radio.gpio0); 763 cx_write(MO_GP1_IO, cx88_boards[board].radio.gpio1); 764 cx_write(MO_GP2_IO, cx88_boards[board].radio.gpio2); 765 dev->core->tvaudio = WW_FM; 766 cx88_set_tvaudio(core); 767 cx88_set_stereo(core,V4L2_TUNER_MODE_STEREO,1);
+1 -3
drivers/media/video/msp3400.c
··· 741 schedule_timeout(msecs_to_jiffies(timeout)); 742 } 743 } 744 - if (current->flags & PF_FREEZE) { 745 - refrigerator (); 746 - } 747 748 remove_wait_queue(&msp->wq, &wait); 749 return msp->restart; 750 } 751
··· 741 schedule_timeout(msecs_to_jiffies(timeout)); 742 } 743 } 744 745 remove_wait_queue(&msp->wq, &wait); 746 + try_to_freeze(); 747 return msp->restart; 748 } 749
+3 -1
drivers/media/video/saa7134/saa7134-i2c.c
··· 1 /* 2 - * $Id: saa7134-i2c.c,v 1.19 2005/07/07 01:49:30 mkrufky Exp $ 3 * 4 * device driver for philips saa7134 based TV cards 5 * i2c interface support ··· 300 status = i2c_get_status(dev); 301 if (i2c_is_error(status)) 302 goto err; 303 304 d1printk("\n"); 305 return num;
··· 1 /* 2 + * $Id: saa7134-i2c.c,v 1.22 2005/07/22 04:09:41 mkrufky Exp $ 3 * 4 * device driver for philips saa7134 based TV cards 5 * i2c interface support ··· 300 status = i2c_get_status(dev); 301 if (i2c_is_error(status)) 302 goto err; 303 + /* ensure that the bus is idle for at least one bit slot */ 304 + msleep(1); 305 306 d1printk("\n"); 307 return num;
+2 -2
drivers/media/video/saa7134/saa7134.h
··· 1 /* 2 - * $Id: saa7134.h,v 1.48 2005/07/01 08:22:24 nsh Exp $ 3 * 4 * v4l2 device driver for philips saa7134 based TV cards 5 * ··· 21 */ 22 23 #include <linux/version.h> 24 - #define SAA7134_VERSION_CODE KERNEL_VERSION(0,2,13) 25 26 #include <linux/pci.h> 27 #include <linux/i2c.h>
··· 1 /* 2 + * $Id: saa7134.h,v 1.49 2005/07/13 17:25:25 mchehab Exp $ 3 * 4 * v4l2 device driver for philips saa7134 based TV cards 5 * ··· 21 */ 22 23 #include <linux/version.h> 24 + #define SAA7134_VERSION_CODE KERNEL_VERSION(0,2,14) 25 26 #include <linux/pci.h> 27 #include <linux/i2c.h>
+8 -7
drivers/media/video/tea5767.c
··· 2 * For Philips TEA5767 FM Chip used on some TV Cards like Prolink Pixelview 3 * I2C address is allways 0xC0. 4 * 5 - * $Id: tea5767.c,v 1.21 2005/07/14 03:06:43 mchehab Exp $ 6 * 7 * Copyright (c) 2005 Mauro Carvalho Chehab (mchehab@brturbo.com.br) 8 * This code is placed under the terms of the GNU General Public License ··· 14 #include <linux/i2c.h> 15 #include <linux/videodev.h> 16 #include <linux/delay.h> 17 - #include <media/tuner.h> 18 #include <media/tuner.h> 19 20 #define PREFIX "TEA5767 " ··· 292 293 int tea5767_autodetection(struct i2c_client *c) 294 { 295 - unsigned char buffer[5] = { 0xff, 0xff, 0xff, 0xff, 0xff }; 296 int rc; 297 struct tuner *t = i2c_get_clientdata(c); 298 ··· 301 return EINVAL; 302 } 303 304 - /* If all bytes are the same then it's a TV tuner and not a tea5767 chip. */ 305 if (buffer[0] == buffer[1] && buffer[0] == buffer[2] && 306 buffer[0] == buffer[3] && buffer[0] == buffer[4]) { 307 tuner_warn("All bytes are equal. It is not a TEA5767\n"); ··· 317 tuner_warn("Chip ID is not zero. It is not a TEA5767\n"); 318 return EINVAL; 319 } 320 321 tuner_warn("TEA5767 detected.\n"); 322 return 0; ··· 330 int tea5767_tuner_init(struct i2c_client *c) 331 { 332 struct tuner *t = i2c_get_clientdata(c); 333 - 334 - if (tea5767_autodetection(c) == EINVAL) 335 - return EINVAL; 336 337 tuner_info("type set to %d (%s)\n", t->type, "Philips TEA5767HN FM Radio"); 338 strlcpy(c->name, "tea5767", sizeof(c->name));
··· 2 * For Philips TEA5767 FM Chip used on some TV Cards like Prolink Pixelview 3 * I2C address is allways 0xC0. 4 * 5 + * $Id: tea5767.c,v 1.26 2005/07/27 12:00:36 mkrufky Exp $ 6 * 7 * Copyright (c) 2005 Mauro Carvalho Chehab (mchehab@brturbo.com.br) 8 * This code is placed under the terms of the GNU General Public License ··· 14 #include <linux/i2c.h> 15 #include <linux/videodev.h> 16 #include <linux/delay.h> 17 #include <media/tuner.h> 18 19 #define PREFIX "TEA5767 " ··· 293 294 int tea5767_autodetection(struct i2c_client *c) 295 { 296 + unsigned char buffer[7] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; 297 int rc; 298 struct tuner *t = i2c_get_clientdata(c); 299 ··· 302 return EINVAL; 303 } 304 305 + /* If all bytes are the same then it's a TV tuner and not a tea5767 */ 306 if (buffer[0] == buffer[1] && buffer[0] == buffer[2] && 307 buffer[0] == buffer[3] && buffer[0] == buffer[4]) { 308 tuner_warn("All bytes are equal. It is not a TEA5767\n"); ··· 318 tuner_warn("Chip ID is not zero. It is not a TEA5767\n"); 319 return EINVAL; 320 } 321 + /* It seems that tea5767 returns 0xff after the 5th byte */ 322 + if ((buffer[5] != 0xff) || (buffer[6] != 0xff)) { 323 + tuner_warn("Returned more than 5 bytes. It is not a TEA5767\n"); 324 + return EINVAL; 325 + } 326 327 tuner_warn("TEA5767 detected.\n"); 328 return 0; ··· 326 int tea5767_tuner_init(struct i2c_client *c) 327 { 328 struct tuner *t = i2c_get_clientdata(c); 329 330 tuner_info("type set to %d (%s)\n", t->type, "Philips TEA5767HN FM Radio"); 331 strlcpy(c->name, "tea5767", sizeof(c->name));
+28 -1
drivers/media/video/tuner-core.c
··· 1 /* 2 - * $Id: tuner-core.c,v 1.58 2005/07/14 03:06:43 mchehab Exp $ 3 * 4 * i2c tv tuner chip device driver 5 * core core, i.e. kernel interfaces, registering and so on ··· 23 #include <media/tuner.h> 24 #include <media/audiochip.h> 25 26 #define UNSET (-1U) 27 28 /* standard i2c insmod options */ ··· 43 44 static unsigned int no_autodetect = 0; 45 module_param(no_autodetect, int, 0444); 46 47 /* insmod options used at runtime => read/write */ 48 unsigned int tuner_debug = 0; ··· 325 326 tuner_info("chip found @ 0x%x (%s)\n", addr << 1, adap->name); 327 328 /* TEA5767 autodetection code - only for addr = 0xc0 */ 329 if (!no_autodetect) { 330 if (addr == 0x60) { ··· 467 break; 468 } 469 break; 470 case TDA9887_SET_CONFIG: 471 break; 472 /* --- v4l ioctls --- */
··· 1 /* 2 + * $Id: tuner-core.c,v 1.63 2005/07/28 18:19:55 mchehab Exp $ 3 * 4 * i2c tv tuner chip device driver 5 * core core, i.e. kernel interfaces, registering and so on ··· 23 #include <media/tuner.h> 24 #include <media/audiochip.h> 25 26 + #include "msp3400.h" 27 + 28 #define UNSET (-1U) 29 30 /* standard i2c insmod options */ ··· 41 42 static unsigned int no_autodetect = 0; 43 module_param(no_autodetect, int, 0444); 44 + 45 + static unsigned int show_i2c = 0; 46 + module_param(show_i2c, int, 0444); 47 48 /* insmod options used at runtime => read/write */ 49 unsigned int tuner_debug = 0; ··· 320 321 tuner_info("chip found @ 0x%x (%s)\n", addr << 1, adap->name); 322 323 + if (show_i2c) { 324 + unsigned char buffer[16]; 325 + int i,rc; 326 + 327 + memset(buffer, 0, sizeof(buffer)); 328 + rc = i2c_master_recv(&t->i2c, buffer, sizeof(buffer)); 329 + printk("tuner-%04x I2C RECV = ",addr); 330 + for (i=0;i<rc;i++) 331 + printk("%02x ",buffer[i]); 332 + printk("\n"); 333 + } 334 /* TEA5767 autodetection code - only for addr = 0xc0 */ 335 if (!no_autodetect) { 336 if (addr == 0x60) { ··· 451 break; 452 } 453 break; 454 + case VIDIOCSAUDIO: 455 + if (check_mode(t, "VIDIOCSAUDIO") == EINVAL) 456 + return 0; 457 + if (check_v4l2(t) == EINVAL) 458 + return 0; 459 + 460 + /* Should be implemented, since bttv calls it */ 461 + tuner_dbg("VIDIOCSAUDIO not implemented.\n"); 462 + 463 + break; 464 + case MSP_SET_MATRIX: 465 case TDA9887_SET_CONFIG: 466 break; 467 /* --- v4l ioctls --- */
+7 -1
drivers/media/video/tuner-simple.c
··· 1 /* 2 - * $Id: tuner-simple.c,v 1.39 2005/07/07 01:49:30 mkrufky Exp $ 3 * 4 * i2c tv tuner chip device driver 5 * controls all those simple 4-control-bytes style tuners. ··· 245 /* see tea5767.c for details */}, 246 { "Philips FMD1216ME MK3 Hybrid Tuner", Philips, PAL, 247 16*160.00,16*442.00,0x51,0x52,0x54,0x86,623 }, 248 }; 249 250 unsigned const int tuner_count = ARRAY_SIZE(tuners);
··· 1 /* 2 + * $Id: tuner-simple.c,v 1.43 2005/07/28 18:41:21 mchehab Exp $ 3 * 4 * i2c tv tuner chip device driver 5 * controls all those simple 4-control-bytes style tuners. ··· 245 /* see tea5767.c for details */}, 246 { "Philips FMD1216ME MK3 Hybrid Tuner", Philips, PAL, 247 16*160.00,16*442.00,0x51,0x52,0x54,0x86,623 }, 248 + 249 + { "LG TDVS-H062F/TUA6034", LGINNOTEK, NTSC, 250 + 16*160.00,16*455.00,0x01,0x02,0x04,0x8e,732}, 251 + 252 + { "Ymec TVF66T5-B/DFF", Philips, PAL, 253 + 16*160.25,16*464.25,0x01,0x02,0x08,0x8e,623}, 254 }; 255 256 unsigned const int tuner_count = ARRAY_SIZE(tuners);
+1 -1
drivers/media/video/tveeprom.c
··· 189 { TUNER_ABSENT, "Philips FQ1236 MK3"}, 190 { TUNER_ABSENT, "Samsung TCPN 2121P30A"}, 191 { TUNER_ABSENT, "Samsung TCPE 4121P30A"}, 192 - { TUNER_ABSENT, "TCL MFPE05 2"}, 193 /* 90-99 */ 194 { TUNER_ABSENT, "LG TALN H202T"}, 195 { TUNER_PHILIPS_FQ1216AME_MK4, "Philips FQ1216AME MK4"},
··· 189 { TUNER_ABSENT, "Philips FQ1236 MK3"}, 190 { TUNER_ABSENT, "Samsung TCPN 2121P30A"}, 191 { TUNER_ABSENT, "Samsung TCPE 4121P30A"}, 192 + { TUNER_PHILIPS_FM1216ME_MK3, "TCL MFPE05 2"}, 193 /* 90-99 */ 194 { TUNER_ABSENT, "LG TALN H202T"}, 195 { TUNER_PHILIPS_FQ1216AME_MK4, "Philips FQ1216AME MK4"},
+3 -1
include/media/tuner.h
··· 1 2 - /* $Id: tuner.h,v 1.42 2005/07/06 09:42:19 mchehab Exp $ 3 * 4 tuner.h - definition for different tuners 5 ··· 108 109 #define TUNER_TEA5767 62 /* Only FM Radio Tuner */ 110 #define TUNER_PHILIPS_FMD1216ME_MK3 63 111 112 #define NOTUNER 0 113 #define PAL 1 /* PAL_BG */
··· 1 2 + /* $Id: tuner.h,v 1.45 2005/07/28 18:41:21 mchehab Exp $ 3 * 4 tuner.h - definition for different tuners 5 ··· 108 109 #define TUNER_TEA5767 62 /* Only FM Radio Tuner */ 110 #define TUNER_PHILIPS_FMD1216ME_MK3 63 111 + #define TUNER_LG_TDVS_H062F 64 /* DViCO FusionHDTV 5 */ 112 + #define TUNER_YMEC_TVF66T5_B_DFF 65 /* Acorp Y878F */ 113 114 #define NOTUNER 0 115 #define PAL 1 /* PAL_BG */