aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/video4linux/CARDLIST.saa71341
-rw-r--r--drivers/media/Kconfig1
-rw-r--r--drivers/media/dvb/dvb-usb/Kconfig1
-rw-r--r--drivers/media/dvb/dvb-usb/usb-urb.c5
-rw-r--r--drivers/media/radio/radio-gemtek-pci.c2
-rw-r--r--drivers/media/video/saa7134/saa7134-cards.c35
-rw-r--r--drivers/media/video/saa7134/saa7134-dvb.c44
-rw-r--r--drivers/media/video/saa7134/saa7134-tvaudio.c93
-rw-r--r--drivers/media/video/saa7134/saa7134-video.c60
-rw-r--r--drivers/media/video/saa7134/saa7134.h2
-rw-r--r--drivers/media/video/tveeprom.c4
-rw-r--r--drivers/media/video/zoran_card.c10
-rw-r--r--drivers/media/video/zr36120.c21
13 files changed, 202 insertions, 77 deletions
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134
index 6fb82ac3bef0..53ce6a39083c 100644
--- a/Documentation/video4linux/CARDLIST.saa7134
+++ b/Documentation/video4linux/CARDLIST.saa7134
@@ -98,3 +98,4 @@
98 97 -> LifeView FlyDVB-S /Acorp TV134DS [5168:0300,4e42:0300] 98 97 -> LifeView FlyDVB-S /Acorp TV134DS [5168:0300,4e42:0300]
99 98 -> Proteus Pro 2309 [0919:2003] 99 98 -> Proteus Pro 2309 [0919:2003]
100 99 -> AVerMedia TV Hybrid A16AR [1461:2c00] 100 99 -> AVerMedia TV Hybrid A16AR [1461:2c00]
101100 -> Asus Europa2 OEM [1043:4860]
diff --git a/drivers/media/Kconfig b/drivers/media/Kconfig
index ed4aa4e7912c..9f7e1fe8c97e 100644
--- a/drivers/media/Kconfig
+++ b/drivers/media/Kconfig
@@ -54,6 +54,7 @@ config VIDEO_V4L1_COMPAT
54 54
55config VIDEO_V4L2 55config VIDEO_V4L2
56 bool 56 bool
57 depends on VIDEO_DEV
57 default y 58 default y
58 59
59source "drivers/media/video/Kconfig" 60source "drivers/media/video/Kconfig"
diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig
index 67cefdd2334a..2cc5caa26a0a 100644
--- a/drivers/media/dvb/dvb-usb/Kconfig
+++ b/drivers/media/dvb/dvb-usb/Kconfig
@@ -69,7 +69,6 @@ config DVB_USB_DIBUSB_MC
69config DVB_USB_DIB0700 69config DVB_USB_DIB0700
70 tristate "DiBcom DiB0700 USB DVB devices (see help for supported devices)" 70 tristate "DiBcom DiB0700 USB DVB devices (see help for supported devices)"
71 depends on DVB_USB 71 depends on DVB_USB
72 select DVB_DIB7000M
73 select DVB_DIB3000MC 72 select DVB_DIB3000MC
74 select DVB_TUNER_MT2060 73 select DVB_TUNER_MT2060
75 help 74 help
diff --git a/drivers/media/dvb/dvb-usb/usb-urb.c b/drivers/media/dvb/dvb-usb/usb-urb.c
index 8728cf347a71..572b2d9aa66a 100644
--- a/drivers/media/dvb/dvb-usb/usb-urb.c
+++ b/drivers/media/dvb/dvb-usb/usb-urb.c
@@ -122,8 +122,9 @@ static int usb_allocate_stream_buffers(struct usb_data_stream *stream, int num,
122 usb_free_stream_buffers(stream); 122 usb_free_stream_buffers(stream);
123 return -ENOMEM; 123 return -ENOMEM;
124 } 124 }
125 deb_mem("buffer %d: %p (dma: %u)\n", 125 deb_mem("buffer %d: %p (dma: %Lu)\n",
126 stream->buf_num, stream->buf_list[stream->buf_num], stream->dma_addr[stream->buf_num]); 126 stream->buf_num,
127stream->buf_list[stream->buf_num], (long long)stream->dma_addr[stream->buf_num]);
127 memset(stream->buf_list[stream->buf_num],0,size); 128 memset(stream->buf_list[stream->buf_num],0,size);
128 stream->state |= USB_STATE_URB_BUF; 129 stream->state |= USB_STATE_URB_BUF;
129 } 130 }
diff --git a/drivers/media/radio/radio-gemtek-pci.c b/drivers/media/radio/radio-gemtek-pci.c
index cfab57d6bc4a..eb14106f66fa 100644
--- a/drivers/media/radio/radio-gemtek-pci.c
+++ b/drivers/media/radio/radio-gemtek-pci.c
@@ -449,7 +449,7 @@ static int __init gemtek_pci_init_module( void )
449 449
450static void __exit gemtek_pci_cleanup_module( void ) 450static void __exit gemtek_pci_cleanup_module( void )
451{ 451{
452 return pci_unregister_driver( &gemtek_pci_driver ); 452 pci_unregister_driver(&gemtek_pci_driver);
453} 453}
454 454
455MODULE_AUTHOR( "Vladimir Shebordaev <vshebordaev@mail.ru>" ); 455MODULE_AUTHOR( "Vladimir Shebordaev <vshebordaev@mail.ru>" );
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index fe3c83ca3de3..c9d8e3b9cc37 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -2994,6 +2994,34 @@ struct saa7134_board saa7134_boards[] = {
2994 .amux = LINE1, 2994 .amux = LINE1,
2995 }, 2995 },
2996 }, 2996 },
2997 [SAA7134_BOARD_ASUS_EUROPA2_HYBRID] = {
2998 .name = "Asus Europa2 OEM",
2999 .audio_clock = 0x00187de7,
3000 .tuner_type = TUNER_PHILIPS_FMD1216ME_MK3,
3001 .radio_type = UNSET,
3002 .tuner_addr = ADDR_UNSET,
3003 .radio_addr = ADDR_UNSET,
3004 .tda9887_conf = TDA9887_PRESENT| TDA9887_PORT1_ACTIVE | TDA9887_PORT2_ACTIVE,
3005 .mpeg = SAA7134_MPEG_DVB,
3006 .inputs = {{
3007 .name = name_tv,
3008 .vmux = 3,
3009 .amux = TV,
3010 .tv = 1,
3011 },{
3012 .name = name_comp1,
3013 .vmux = 4,
3014 .amux = LINE2,
3015 },{
3016 .name = name_svideo,
3017 .vmux = 8,
3018 .amux = LINE2,
3019 }},
3020 .radio = {
3021 .name = name_radio,
3022 .amux = LINE1,
3023 },
3024 },
2997}; 3025};
2998 3026
2999const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards); 3027const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards);
@@ -3597,6 +3625,12 @@ struct pci_device_id saa7134_pci_tbl[] = {
3597 .subdevice = 0x2c00, 3625 .subdevice = 0x2c00,
3598 .driver_data = SAA7134_BOARD_AVERMEDIA_A16AR, 3626 .driver_data = SAA7134_BOARD_AVERMEDIA_A16AR,
3599 },{ 3627 },{
3628 .vendor = PCI_VENDOR_ID_PHILIPS,
3629 .device = PCI_DEVICE_ID_PHILIPS_SAA7134,
3630 .subvendor = 0x1043,
3631 .subdevice = 0x4860,
3632 .driver_data = SAA7134_BOARD_ASUS_EUROPA2_HYBRID,
3633 },{
3600 /* --- boards without eeprom + subsystem ID --- */ 3634 /* --- boards without eeprom + subsystem ID --- */
3601 .vendor = PCI_VENDOR_ID_PHILIPS, 3635 .vendor = PCI_VENDOR_ID_PHILIPS,
3602 .device = PCI_DEVICE_ID_PHILIPS_SAA7134, 3636 .device = PCI_DEVICE_ID_PHILIPS_SAA7134,
@@ -3871,6 +3905,7 @@ int saa7134_board_init2(struct saa7134_dev *dev)
3871 break; 3905 break;
3872 case SAA7134_BOARD_PHILIPS_EUROPA: 3906 case SAA7134_BOARD_PHILIPS_EUROPA:
3873 case SAA7134_BOARD_VIDEOMATE_DVBT_300: 3907 case SAA7134_BOARD_VIDEOMATE_DVBT_300:
3908 case SAA7134_BOARD_ASUS_EUROPA2_HYBRID:
3874 /* The Philips EUROPA based hybrid boards have the tuner connected through 3909 /* The Philips EUROPA based hybrid boards have the tuner connected through
3875 * the channel decoder. We have to make it transparent to find it 3910 * the channel decoder. We have to make it transparent to find it
3876 */ 3911 */
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index fb741fa465a5..1ba53b525ad2 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -874,6 +874,34 @@ static struct tda1004x_config philips_tiger_config = {
874 874
875/* ------------------------------------------------------------------ */ 875/* ------------------------------------------------------------------ */
876 876
877static int asus_p7131_dual_tuner_init(struct dvb_frontend *fe)
878{
879 struct saa7134_dev *dev = fe->dvb->priv;
880 static u8 data[] = { 0x3c, 0x33, 0x6a};
881 struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)};
882
883 if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1)
884 return -EIO;
885 /* make sure the DVB-T antenna input is set */
886 saa_setl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x0200000);
887 return 0;
888}
889
890static int asus_p7131_dual_tuner_sleep(struct dvb_frontend *fe)
891{
892 struct saa7134_dev *dev = fe->dvb->priv;
893 static u8 data[] = { 0x3c, 0x33, 0x68};
894 struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)};
895
896 i2c_transfer(&dev->i2c_adap, &msg, 1);
897 philips_tda827xa_tuner_sleep( 0x61, fe);
898 /* reset antenna inputs for analog usage */
899 saa_clearl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x0200000);
900 return 0;
901}
902
903/* ------------------------------------------------------------------ */
904
877static int lifeview_trio_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) 905static int lifeview_trio_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
878{ 906{
879 int ret; 907 int ret;
@@ -1148,8 +1176,8 @@ static int dvb_init(struct saa7134_dev *dev)
1148 &philips_tiger_config, 1176 &philips_tiger_config,
1149 &dev->i2c_adap); 1177 &dev->i2c_adap);
1150 if (dev->dvb.frontend) { 1178 if (dev->dvb.frontend) {
1151 dev->dvb.frontend->ops.tuner_ops.init = philips_tiger_tuner_init; 1179 dev->dvb.frontend->ops.tuner_ops.init = asus_p7131_dual_tuner_init;
1152 dev->dvb.frontend->ops.tuner_ops.sleep = philips_tiger_tuner_sleep; 1180 dev->dvb.frontend->ops.tuner_ops.sleep = asus_p7131_dual_tuner_sleep;
1153 dev->dvb.frontend->ops.tuner_ops.set_params = philips_tiger_tuner_set_params; 1181 dev->dvb.frontend->ops.tuner_ops.set_params = philips_tiger_tuner_set_params;
1154 } 1182 }
1155 break; 1183 break;
@@ -1240,6 +1268,18 @@ static int dvb_init(struct saa7134_dev *dev)
1240 } 1268 }
1241 } 1269 }
1242 break; 1270 break;
1271 case SAA7134_BOARD_ASUS_EUROPA2_HYBRID:
1272 dev->dvb.frontend = tda10046_attach(&medion_cardbus,
1273 &dev->i2c_adap);
1274 if (dev->dvb.frontend) {
1275 dev->original_demod_sleep = dev->dvb.frontend->ops.sleep;
1276 dev->dvb.frontend->ops.sleep = philips_europa_demod_sleep;
1277 dev->dvb.frontend->ops.tuner_ops.init = philips_fmd1216_tuner_init;
1278 dev->dvb.frontend->ops.tuner_ops.sleep = philips_fmd1216_tuner_sleep;
1279 dev->dvb.frontend->ops.tuner_ops.set_params = philips_fmd1216_tuner_set_params;
1280 }
1281 break;
1282
1243 default: 1283 default:
1244 printk("%s: Huh? unknown DVB card?\n",dev->name); 1284 printk("%s: Huh? unknown DVB card?\n",dev->name);
1245 break; 1285 break;
diff --git a/drivers/media/video/saa7134/saa7134-tvaudio.c b/drivers/media/video/saa7134/saa7134-tvaudio.c
index d31220d20495..dd759d6d8d25 100644
--- a/drivers/media/video/saa7134/saa7134-tvaudio.c
+++ b/drivers/media/video/saa7134/saa7134-tvaudio.c
@@ -72,12 +72,12 @@ static struct mainscan {
72 int carr; 72 int carr;
73} mainscan[] = { 73} mainscan[] = {
74 { 74 {
75 .name = "M", 75 .name = "MN",
76 .std = V4L2_STD_NTSC | V4L2_STD_PAL_M, 76 .std = V4L2_STD_MN,
77 .carr = 4500, 77 .carr = 4500,
78 },{ 78 },{
79 .name = "BG", 79 .name = "BGH",
80 .std = V4L2_STD_PAL_BG, 80 .std = V4L2_STD_B | V4L2_STD_GH,
81 .carr = 5500, 81 .carr = 5500,
82 },{ 82 },{
83 .name = "I", 83 .name = "I",
@@ -85,7 +85,7 @@ static struct mainscan {
85 .carr = 6000, 85 .carr = 6000,
86 },{ 86 },{
87 .name = "DKL", 87 .name = "DKL",
88 .std = V4L2_STD_PAL_DK | V4L2_STD_SECAM, 88 .std = V4L2_STD_DK | V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC,
89 .carr = 6500, 89 .carr = 6500,
90 } 90 }
91}; 91};
@@ -93,76 +93,70 @@ static struct mainscan {
93static struct saa7134_tvaudio tvaudio[] = { 93static struct saa7134_tvaudio tvaudio[] = {
94 { 94 {
95 .name = "PAL-B/G FM-stereo", 95 .name = "PAL-B/G FM-stereo",
96 .std = V4L2_STD_PAL, 96 .std = V4L2_STD_PAL_BG,
97 .mode = TVAUDIO_FM_BG_STEREO, 97 .mode = TVAUDIO_FM_BG_STEREO,
98 .carr1 = 5500, 98 .carr1 = 5500,
99 .carr2 = 5742, 99 .carr2 = 5742,
100 },{ 100 },{
101 .name = "PAL-D/K1 FM-stereo", 101 .name = "PAL-D/K1 FM-stereo",
102 .std = V4L2_STD_PAL, 102 .std = V4L2_STD_PAL_DK,
103 .carr1 = 6500, 103 .carr1 = 6500,
104 .carr2 = 6258, 104 .carr2 = 6258,
105 .mode = TVAUDIO_FM_BG_STEREO, 105 .mode = TVAUDIO_FM_BG_STEREO,
106 },{ 106 },{
107 .name = "PAL-D/K2 FM-stereo", 107 .name = "PAL-D/K2 FM-stereo",
108 .std = V4L2_STD_PAL, 108 .std = V4L2_STD_PAL_DK,
109 .carr1 = 6500, 109 .carr1 = 6500,
110 .carr2 = 6742, 110 .carr2 = 6742,
111 .mode = TVAUDIO_FM_BG_STEREO, 111 .mode = TVAUDIO_FM_BG_STEREO,
112 },{ 112 },{
113 .name = "PAL-D/K3 FM-stereo", 113 .name = "PAL-D/K3 FM-stereo",
114 .std = V4L2_STD_PAL, 114 .std = V4L2_STD_PAL_DK,
115 .carr1 = 6500, 115 .carr1 = 6500,
116 .carr2 = 5742, 116 .carr2 = 5742,
117 .mode = TVAUDIO_FM_BG_STEREO, 117 .mode = TVAUDIO_FM_BG_STEREO,
118 },{ 118 },{
119 .name = "PAL-B/G NICAM", 119 .name = "PAL-B/G NICAM",
120 .std = V4L2_STD_PAL, 120 .std = V4L2_STD_PAL_BG,
121 .carr1 = 5500, 121 .carr1 = 5500,
122 .carr2 = 5850, 122 .carr2 = 5850,
123 .mode = TVAUDIO_NICAM_FM, 123 .mode = TVAUDIO_NICAM_FM,
124 },{ 124 },{
125 .name = "PAL-I NICAM", 125 .name = "PAL-I NICAM",
126 .std = V4L2_STD_PAL, 126 .std = V4L2_STD_PAL_I,
127 .carr1 = 6000, 127 .carr1 = 6000,
128 .carr2 = 6552, 128 .carr2 = 6552,
129 .mode = TVAUDIO_NICAM_FM, 129 .mode = TVAUDIO_NICAM_FM,
130 },{ 130 },{
131 .name = "PAL-D/K NICAM", 131 .name = "PAL-D/K NICAM",
132 .std = V4L2_STD_PAL, 132 .std = V4L2_STD_PAL_DK,
133 .carr1 = 6500, 133 .carr1 = 6500,
134 .carr2 = 5850, 134 .carr2 = 5850,
135 .mode = TVAUDIO_NICAM_FM, 135 .mode = TVAUDIO_NICAM_FM,
136 },{ 136 },{
137 .name = "SECAM-L NICAM", 137 .name = "SECAM-L NICAM",
138 .std = V4L2_STD_SECAM, 138 .std = V4L2_STD_SECAM_L,
139 .carr1 = 6500, 139 .carr1 = 6500,
140 .carr2 = 5850, 140 .carr2 = 5850,
141 .mode = TVAUDIO_NICAM_AM, 141 .mode = TVAUDIO_NICAM_AM,
142 },{ 142 },{
143 .name = "SECAM-L MONO", 143 .name = "SECAM-D/K NICAM",
144 .std = V4L2_STD_SECAM, 144 .std = V4L2_STD_SECAM_DK,
145 .carr1 = 6500, 145 .carr1 = 6500,
146 .carr2 = -1, 146 .carr2 = 5850,
147 .mode = TVAUDIO_AM_MONO, 147 .mode = TVAUDIO_NICAM_FM,
148 },{ 148 },{
149 .name = "SECAM-D/K", 149 .name = "NTSC-A2 FM-stereo",
150 .std = V4L2_STD_SECAM, 150 .std = V4L2_STD_NTSC,
151 .carr1 = 6500, 151 .carr1 = 4500,
152 .carr2 = -1, 152 .carr2 = 4724,
153 .mode = TVAUDIO_FM_MONO, 153 .mode = TVAUDIO_FM_K_STEREO,
154 },{ 154 },{
155 .name = "NTSC-M", 155 .name = "NTSC-M",
156 .std = V4L2_STD_NTSC, 156 .std = V4L2_STD_NTSC,
157 .carr1 = 4500, 157 .carr1 = 4500,
158 .carr2 = -1, 158 .carr2 = -1,
159 .mode = TVAUDIO_FM_MONO, 159 .mode = TVAUDIO_FM_MONO,
160 },{
161 .name = "NTSC-A2 FM-stereo",
162 .std = V4L2_STD_NTSC,
163 .carr1 = 4500,
164 .carr2 = 4724,
165 .mode = TVAUDIO_FM_K_STEREO,
166 } 160 }
167}; 161};
168#define TVAUDIO (sizeof(tvaudio)/sizeof(struct saa7134_tvaudio)) 162#define TVAUDIO (sizeof(tvaudio)/sizeof(struct saa7134_tvaudio))
@@ -340,12 +334,6 @@ static void tvaudio_setmode(struct saa7134_dev *dev,
340 saa_writeb(SAA7134_STEREO_DAC_OUTPUT_SELECT, 0xa1); 334 saa_writeb(SAA7134_STEREO_DAC_OUTPUT_SELECT, 0xa1);
341 saa_writeb(SAA7134_NICAM_CONFIG, 0x00); 335 saa_writeb(SAA7134_NICAM_CONFIG, 0x00);
342 break; 336 break;
343 case TVAUDIO_AM_MONO:
344 saa_writeb(SAA7134_DEMODULATOR, 0x12);
345 saa_writeb(SAA7134_DCXO_IDENT_CTRL, 0x00);
346 saa_writeb(SAA7134_FM_DEEMPHASIS, 0x44);
347 saa_writeb(SAA7134_STEREO_DAC_OUTPUT_SELECT, 0xa0);
348 break;
349 case TVAUDIO_FM_SAT_STEREO: 337 case TVAUDIO_FM_SAT_STEREO:
350 /* not implemented (yet) */ 338 /* not implemented (yet) */
351 break; 339 break;
@@ -390,7 +378,6 @@ static int tvaudio_checkcarrier(struct saa7134_dev *dev, struct mainscan *scan)
390 } 378 }
391 printk("\n"); 379 printk("\n");
392 } 380 }
393
394 if (dev->tvnorm->id & scan->std) { 381 if (dev->tvnorm->id & scan->std) {
395 tvaudio_setcarrier(dev,scan->carr-90,scan->carr-90); 382 tvaudio_setcarrier(dev,scan->carr-90,scan->carr-90);
396 saa_readl(SAA7134_LEVEL_READOUT1 >> 2); 383 saa_readl(SAA7134_LEVEL_READOUT1 >> 2);
@@ -426,7 +413,6 @@ static int tvaudio_getstereo(struct saa7134_dev *dev, struct saa7134_tvaudio *au
426 413
427 switch (audio->mode) { 414 switch (audio->mode) {
428 case TVAUDIO_FM_MONO: 415 case TVAUDIO_FM_MONO:
429 case TVAUDIO_AM_MONO:
430 return V4L2_TUNER_SUB_MONO; 416 return V4L2_TUNER_SUB_MONO;
431 case TVAUDIO_FM_K_STEREO: 417 case TVAUDIO_FM_K_STEREO:
432 case TVAUDIO_FM_BG_STEREO: 418 case TVAUDIO_FM_BG_STEREO:
@@ -495,7 +481,6 @@ static int tvaudio_setstereo(struct saa7134_dev *dev, struct saa7134_tvaudio *au
495 481
496 switch (audio->mode) { 482 switch (audio->mode) {
497 case TVAUDIO_FM_MONO: 483 case TVAUDIO_FM_MONO:
498 case TVAUDIO_AM_MONO:
499 /* nothing to do ... */ 484 /* nothing to do ... */
500 break; 485 break;
501 case TVAUDIO_FM_K_STEREO: 486 case TVAUDIO_FM_K_STEREO:
@@ -556,6 +541,7 @@ static int tvaudio_thread(void *data)
556 541
557 if (1 == nscan) { 542 if (1 == nscan) {
558 /* only one candidate -- skip scan ;) */ 543 /* only one candidate -- skip scan ;) */
544 dprintk("only one main carrier candidate - skipping scan\n");
559 max1 = 12345; 545 max1 = 12345;
560 carrier = default_carrier; 546 carrier = default_carrier;
561 } else { 547 } else {
@@ -603,7 +589,6 @@ static int tvaudio_thread(void *data)
603 dev->automute = 0; 589 dev->automute = 0;
604 saa_andorb(SAA7134_STEREO_DAC_OUTPUT_SELECT, 0x30, 0x00); 590 saa_andorb(SAA7134_STEREO_DAC_OUTPUT_SELECT, 0x30, 0x00);
605 saa7134_tvaudio_setmute(dev); 591 saa7134_tvaudio_setmute(dev);
606
607 /* find the exact tv audio norm */ 592 /* find the exact tv audio norm */
608 for (audio = UNSET, i = 0; i < TVAUDIO; i++) { 593 for (audio = UNSET, i = 0; i < TVAUDIO; i++) {
609 if (dev->tvnorm->id != UNSET && 594 if (dev->tvnorm->id != UNSET &&
@@ -611,7 +596,7 @@ static int tvaudio_thread(void *data)
611 continue; 596 continue;
612 if (tvaudio[i].carr1 != carrier) 597 if (tvaudio[i].carr1 != carrier)
613 continue; 598 continue;
614 599 /* Note: at least the primary carrier is right here */
615 if (UNSET == audio) 600 if (UNSET == audio)
616 audio = i; 601 audio = i;
617 tvaudio_setmode(dev,&tvaudio[i],"trying"); 602 tvaudio_setmode(dev,&tvaudio[i],"trying");
@@ -626,6 +611,7 @@ static int tvaudio_thread(void *data)
626 if (UNSET == audio) 611 if (UNSET == audio)
627 continue; 612 continue;
628 tvaudio_setmode(dev,&tvaudio[audio],"using"); 613 tvaudio_setmode(dev,&tvaudio[audio],"using");
614
629 tvaudio_setstereo(dev,&tvaudio[audio],V4L2_TUNER_MODE_MONO); 615 tvaudio_setstereo(dev,&tvaudio[audio],V4L2_TUNER_MODE_MONO);
630 dev->tvaudio = &tvaudio[audio]; 616 dev->tvaudio = &tvaudio[audio];
631 617
@@ -750,7 +736,6 @@ static int mute_input_7133(struct saa7134_dev *dev)
750 int mask; 736 int mask;
751 struct saa7134_input *in; 737 struct saa7134_input *in;
752 738
753 /* Hac 0506 route OSS sound simultanously */
754 xbarin = 0x03; 739 xbarin = 0x03;
755 switch (dev->input->amux) { 740 switch (dev->input->amux) {
756 case TV: 741 case TV:
@@ -834,18 +819,16 @@ static int tvaudio_thread_ddep(void *data)
834 } else { 819 } else {
835 /* (let chip) scan for sound carrier */ 820 /* (let chip) scan for sound carrier */
836 norms = 0; 821 norms = 0;
837 if (dev->tvnorm->id & V4L2_STD_PAL) { 822 if (dev->tvnorm->id & (V4L2_STD_B | V4L2_STD_GH))
838 dprintk("PAL scan\n"); 823 norms |= 0x04;
839 norms |= 0x2c; /* B/G + D/K + I */ 824 if (dev->tvnorm->id & V4L2_STD_PAL_I)
840 } 825 norms |= 0x20;
841 if (dev->tvnorm->id & V4L2_STD_NTSC) { 826 if (dev->tvnorm->id & V4L2_STD_DK)
842 dprintk("NTSC scan\n"); 827 norms |= 0x08;
843 norms |= 0x40; /* M */ 828 if (dev->tvnorm->id & V4L2_STD_MN)
844 } 829 norms |= 0x40;
845 if (dev->tvnorm->id & V4L2_STD_SECAM) { 830 if (dev->tvnorm->id & (V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC))
846 dprintk("SECAM scan\n"); 831 norms |= 0x10;
847 norms |= 0x18; /* L + D/K */
848 }
849 if (0 == norms) 832 if (0 == norms)
850 norms = 0x7c; /* all */ 833 norms = 0x7c; /* all */
851 dprintk("scanning:%s%s%s%s%s\n", 834 dprintk("scanning:%s%s%s%s%s\n",
@@ -1034,7 +1017,11 @@ int saa7134_tvaudio_fini(struct saa7134_dev *dev)
1034 1017
1035int saa7134_tvaudio_do_scan(struct saa7134_dev *dev) 1018int saa7134_tvaudio_do_scan(struct saa7134_dev *dev)
1036{ 1019{
1037 if (dev->thread.pid >= 0) { 1020 if (dev->input->amux != TV) {
1021 dprintk("sound IF not in use, skipping scan\n");
1022 dev->automute = 0;
1023 saa7134_tvaudio_setmute(dev);
1024 } else if (dev->thread.pid >= 0) {
1038 dev->thread.mode = UNSET; 1025 dev->thread.mode = UNSET;
1039 dev->thread.scan2++; 1026 dev->thread.scan2++;
1040 wake_up_interruptible(&dev->thread.wq); 1027 wake_up_interruptible(&dev->thread.wq);
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index 2c171af9a9f2..203302f21827 100644
--- a/drivers/media/video/saa7134/saa7134-video.c
+++ b/drivers/media/video/saa7134/saa7134-video.c
@@ -43,12 +43,16 @@ static unsigned int gbuffers = 8;
43static unsigned int noninterlaced = 1; 43static unsigned int noninterlaced = 1;
44static unsigned int gbufsize = 720*576*4; 44static unsigned int gbufsize = 720*576*4;
45static unsigned int gbufsize_max = 720*576*4; 45static unsigned int gbufsize_max = 720*576*4;
46static char secam[] = "--";
46module_param(video_debug, int, 0644); 47module_param(video_debug, int, 0644);
47MODULE_PARM_DESC(video_debug,"enable debug messages [video]"); 48MODULE_PARM_DESC(video_debug,"enable debug messages [video]");
48module_param(gbuffers, int, 0444); 49module_param(gbuffers, int, 0444);
49MODULE_PARM_DESC(gbuffers,"number of capture buffers, range 2-32"); 50MODULE_PARM_DESC(gbuffers,"number of capture buffers, range 2-32");
50module_param(noninterlaced, int, 0644); 51module_param(noninterlaced, int, 0644);
51MODULE_PARM_DESC(noninterlaced,"capture non interlaced video"); 52MODULE_PARM_DESC(noninterlaced,"capture non interlaced video");
53module_param_string(secam, secam, sizeof(secam), 0644);
54MODULE_PARM_DESC(secam, "force SECAM variant, either DK,L or Lc");
55
52 56
53#define dprintk(fmt, arg...) if (video_debug) \ 57#define dprintk(fmt, arg...) if (video_debug) \
54 printk(KERN_DEBUG "%s/video: " fmt, dev->name , ## arg) 58 printk(KERN_DEBUG "%s/video: " fmt, dev->name , ## arg)
@@ -279,7 +283,43 @@ static struct saa7134_tvnorm tvnorms[] = {
279 .id = V4L2_STD_SECAM, 283 .id = V4L2_STD_SECAM,
280 NORM_625_50, 284 NORM_625_50,
281 285
282 .sync_control = 0x18, /* old: 0x58, */ 286 .sync_control = 0x18,
287 .luma_control = 0x1b,
288 .chroma_ctrl1 = 0xd1,
289 .chroma_gain = 0x80,
290 .chroma_ctrl2 = 0x00,
291 .vgate_misc = 0x1c,
292
293 },{
294 .name = "SECAM-DK",
295 .id = V4L2_STD_SECAM_DK,
296 NORM_625_50,
297
298 .sync_control = 0x18,
299 .luma_control = 0x1b,
300 .chroma_ctrl1 = 0xd1,
301 .chroma_gain = 0x80,
302 .chroma_ctrl2 = 0x00,
303 .vgate_misc = 0x1c,
304
305 },{
306 .name = "SECAM-L",
307 .id = V4L2_STD_SECAM_L,
308 NORM_625_50,
309
310 .sync_control = 0x18,
311 .luma_control = 0x1b,
312 .chroma_ctrl1 = 0xd1,
313 .chroma_gain = 0x80,
314 .chroma_ctrl2 = 0x00,
315 .vgate_misc = 0x1c,
316
317 },{
318 .name = "SECAM-Lc",
319 .id = V4L2_STD_SECAM_LC,
320 NORM_625_50,
321
322 .sync_control = 0x18,
283 .luma_control = 0x1b, 323 .luma_control = 0x1b,
284 .chroma_ctrl1 = 0xd1, 324 .chroma_ctrl1 = 0xd1,
285 .chroma_gain = 0x80, 325 .chroma_gain = 0x80,
@@ -1769,6 +1809,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
1769 { 1809 {
1770 v4l2_std_id *id = arg; 1810 v4l2_std_id *id = arg;
1771 unsigned int i; 1811 unsigned int i;
1812 v4l2_std_id fixup;
1772 1813
1773 for (i = 0; i < TVNORMS; i++) 1814 for (i = 0; i < TVNORMS; i++)
1774 if (*id == tvnorms[i].id) 1815 if (*id == tvnorms[i].id)
@@ -1779,7 +1820,22 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
1779 break; 1820 break;
1780 if (i == TVNORMS) 1821 if (i == TVNORMS)
1781 return -EINVAL; 1822 return -EINVAL;
1782 1823 if ((*id & V4L2_STD_SECAM) && (secam[0] != '-')) {
1824 if (secam[0] == 'L' || secam[0] == 'l') {
1825 if (secam[1] == 'C' || secam[1] == 'c')
1826 fixup = V4L2_STD_SECAM_LC;
1827 else
1828 fixup = V4L2_STD_SECAM_L;
1829 } else {
1830 if (secam[0] == 'D' || secam[0] == 'd')
1831 fixup = V4L2_STD_SECAM_DK;
1832 else
1833 fixup = V4L2_STD_SECAM;
1834 }
1835 for (i = 0; i < TVNORMS; i++)
1836 if (fixup == tvnorms[i].id)
1837 break;
1838 }
1783 mutex_lock(&dev->lock); 1839 mutex_lock(&dev->lock);
1784 if (res_check(fh, RESOURCE_OVERLAY)) { 1840 if (res_check(fh, RESOURCE_OVERLAY)) {
1785 spin_lock_irqsave(&dev->slock,flags); 1841 spin_lock_irqsave(&dev->slock,flags);
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h
index 701a90942108..7cf96b430250 100644
--- a/drivers/media/video/saa7134/saa7134.h
+++ b/drivers/media/video/saa7134/saa7134.h
@@ -61,7 +61,6 @@ enum saa7134_tvaudio_mode {
61 TVAUDIO_FM_K_STEREO = 4, 61 TVAUDIO_FM_K_STEREO = 4,
62 TVAUDIO_NICAM_AM = 5, 62 TVAUDIO_NICAM_AM = 5,
63 TVAUDIO_NICAM_FM = 6, 63 TVAUDIO_NICAM_FM = 6,
64 TVAUDIO_AM_MONO = 7
65}; 64};
66 65
67enum saa7134_audio_in { 66enum saa7134_audio_in {
@@ -227,6 +226,7 @@ struct saa7134_format {
227#define SAA7134_BOARD_FLYDVBS_LR300 97 226#define SAA7134_BOARD_FLYDVBS_LR300 97
228#define SAA7134_BOARD_PROTEUS_2309 98 227#define SAA7134_BOARD_PROTEUS_2309 98
229#define SAA7134_BOARD_AVERMEDIA_A16AR 99 228#define SAA7134_BOARD_AVERMEDIA_A16AR 99
229#define SAA7134_BOARD_ASUS_EUROPA2_HYBRID 100
230 230
231#define SAA7134_MAXBOARDS 8 231#define SAA7134_MAXBOARDS 8
232#define SAA7134_INPUT_MAX 8 232#define SAA7134_INPUT_MAX 8
diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c
index cd1502ac9560..e6baaee038bf 100644
--- a/drivers/media/video/tveeprom.c
+++ b/drivers/media/video/tveeprom.c
@@ -222,8 +222,8 @@ hauppauge_tuner[] =
222 { TUNER_TCL_2002MB, "TCL M2523_3DB_E"}, 222 { TUNER_TCL_2002MB, "TCL M2523_3DB_E"},
223 { TUNER_ABSENT, "Philips 8275A"}, 223 { TUNER_ABSENT, "Philips 8275A"},
224 { TUNER_ABSENT, "Microtune MT2060"}, 224 { TUNER_ABSENT, "Microtune MT2060"},
225 { TUNER_ABSENT, "Philips FM1236 MK5"}, 225 { TUNER_PHILIPS_FM1236_MK3, "Philips FM1236 MK5"},
226 { TUNER_ABSENT, "Philips FM1216ME MK5"}, 226 { TUNER_PHILIPS_FM1216ME_MK3, "Philips FM1216ME MK5"},
227 { TUNER_ABSENT, "TCL M2523_3DI_E"}, 227 { TUNER_ABSENT, "TCL M2523_3DI_E"},
228 { TUNER_ABSENT, "Samsung THPD5222FG30A"}, 228 { TUNER_ABSENT, "Samsung THPD5222FG30A"},
229 /* 120-129 */ 229 /* 120-129 */
diff --git a/drivers/media/video/zoran_card.c b/drivers/media/video/zoran_card.c
index 9f21d0ba0f0f..653822ce391c 100644
--- a/drivers/media/video/zoran_card.c
+++ b/drivers/media/video/zoran_card.c
@@ -1278,9 +1278,7 @@ find_zr36057 (void)
1278 1278
1279 zoran_num = 0; 1279 zoran_num = 0;
1280 while (zoran_num < BUZ_MAX && 1280 while (zoran_num < BUZ_MAX &&
1281 (dev = 1281 (dev = pci_get_device(PCI_VENDOR_ID_ZORAN, PCI_DEVICE_ID_ZORAN_36057, dev)) != NULL) {
1282 pci_find_device(PCI_VENDOR_ID_ZORAN,
1283 PCI_DEVICE_ID_ZORAN_36057, dev)) != NULL) {
1284 card_num = card[zoran_num]; 1282 card_num = card[zoran_num];
1285 zr = &zoran[zoran_num]; 1283 zr = &zoran[zoran_num];
1286 memset(zr, 0, sizeof(struct zoran)); // Just in case if previous cycle failed 1284 memset(zr, 0, sizeof(struct zoran)); // Just in case if previous cycle failed
@@ -1541,7 +1539,8 @@ find_zr36057 (void)
1541 goto zr_detach_vfe; 1539 goto zr_detach_vfe;
1542 } 1540 }
1543 } 1541 }
1544 1542 /* Success so keep the pci_dev referenced */
1543 pci_dev_get(zr->pci_dev);
1545 zoran_num++; 1544 zoran_num++;
1546 continue; 1545 continue;
1547 1546
@@ -1563,6 +1562,9 @@ find_zr36057 (void)
1563 iounmap(zr->zr36057_mem); 1562 iounmap(zr->zr36057_mem);
1564 continue; 1563 continue;
1565 } 1564 }
1565 if (dev) /* Clean up ref count on early exit */
1566 pci_dev_put(dev);
1567
1566 if (zoran_num == 0) { 1568 if (zoran_num == 0) {
1567 dprintk(1, KERN_INFO "No known MJPEG cards found.\n"); 1569 dprintk(1, KERN_INFO "No known MJPEG cards found.\n");
1568 } 1570 }
diff --git a/drivers/media/video/zr36120.c b/drivers/media/video/zr36120.c
index 9240638a0134..b5ffe53c40d8 100644
--- a/drivers/media/video/zr36120.c
+++ b/drivers/media/video/zr36120.c
@@ -1840,16 +1840,16 @@ int __init find_zoran(void)
1840 struct zoran *ztv; 1840 struct zoran *ztv;
1841 struct pci_dev *dev = NULL; 1841 struct pci_dev *dev = NULL;
1842 unsigned char revision; 1842 unsigned char revision;
1843 int zoran_num=0; 1843 int zoran_num = 0;
1844 1844
1845 while ((dev = pci_find_device(PCI_VENDOR_ID_ZORAN,PCI_DEVICE_ID_ZORAN_36120, dev))) 1845 while ((dev = pci_get_device(PCI_VENDOR_ID_ZORAN,PCI_DEVICE_ID_ZORAN_36120, dev)))
1846 { 1846 {
1847 /* Ok, a ZR36120/ZR36125 found! */ 1847 /* Ok, a ZR36120/ZR36125 found! */
1848 ztv = &zorans[zoran_num]; 1848 ztv = &zorans[zoran_num];
1849 ztv->dev = dev; 1849 ztv->dev = dev;
1850 1850
1851 if (pci_enable_device(dev)) 1851 if (pci_enable_device(dev))
1852 return -EIO; 1852 continue;
1853 1853
1854 pci_read_config_byte(dev, PCI_CLASS_REVISION, &revision); 1854 pci_read_config_byte(dev, PCI_CLASS_REVISION, &revision);
1855 printk(KERN_INFO "zoran: Zoran %x (rev %d) ", 1855 printk(KERN_INFO "zoran: Zoran %x (rev %d) ",
@@ -1867,17 +1867,18 @@ int __init find_zoran(void)
1867 { 1867 {
1868 iounmap(ztv->zoran_mem); 1868 iounmap(ztv->zoran_mem);
1869 printk(KERN_ERR "zoran: Bad irq number or handler\n"); 1869 printk(KERN_ERR "zoran: Bad irq number or handler\n");
1870 return -EINVAL; 1870 continue;
1871 } 1871 }
1872 if (result==-EBUSY) 1872 if (result==-EBUSY)
1873 printk(KERN_ERR "zoran: IRQ %d busy, change your PnP config in BIOS\n",dev->irq); 1873 printk(KERN_ERR "zoran: IRQ %d busy, change your PnP config in BIOS\n",dev->irq);
1874 if (result < 0) { 1874 if (result < 0) {
1875 iounmap(ztv->zoran_mem); 1875 iounmap(ztv->zoran_mem);
1876 return result; 1876 continue;
1877 } 1877 }
1878 /* Enable bus-mastering */ 1878 /* Enable bus-mastering */
1879 pci_set_master(dev); 1879 pci_set_master(dev);
1880 1880 /* Keep a reference */
1881 pci_dev_get(dev);
1881 zoran_num++; 1882 zoran_num++;
1882 } 1883 }
1883 if(zoran_num) 1884 if(zoran_num)
@@ -2041,6 +2042,9 @@ void release_zoran(int max)
2041 if (ztv->zoran_mem) 2042 if (ztv->zoran_mem)
2042 iounmap(ztv->zoran_mem); 2043 iounmap(ztv->zoran_mem);
2043 2044
2045 /* Drop PCI device */
2046 pci_dev_put(ztv->dev);
2047
2044 video_unregister_device(&ztv->video_dev); 2048 video_unregister_device(&ztv->video_dev);
2045 video_unregister_device(&ztv->vbi_dev); 2049 video_unregister_device(&ztv->vbi_dev);
2046 } 2050 }
@@ -2057,13 +2061,12 @@ int __init zr36120_init(void)
2057 2061
2058 handle_chipset(); 2062 handle_chipset();
2059 zoran_cards = find_zoran(); 2063 zoran_cards = find_zoran();
2060 if (zoran_cards<0) 2064 if (zoran_cards <= 0)
2061 /* no cards found, no need for a driver */
2062 return -EIO; 2065 return -EIO;
2063 2066
2064 /* initialize Zorans */ 2067 /* initialize Zorans */
2065 for (card=0; card<zoran_cards; card++) { 2068 for (card=0; card<zoran_cards; card++) {
2066 if (init_zoran(card)<0) { 2069 if (init_zoran(card) < 0) {
2067 /* only release the zorans we have registered */ 2070 /* only release the zorans we have registered */
2068 release_zoran(card); 2071 release_zoran(card);
2069 return -EIO; 2072 return -EIO;