aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/pci
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-18 18:08:02 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-18 18:08:02 -0500
commita310410f616c78f24490de1274487a7b7b137d97 (patch)
treedbc2fc187800e6e7014263bf83e10d0155620029 /drivers/media/pci
parentcdd278db0e3dd714e8076e58f723f3c59547591b (diff)
parent80f93c7b0f4599ffbdac8d964ecd1162b8b618b9 (diff)
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media updates from Mauro Carvalho Chehab: "This series include: - a new Remote Controller driver for ST SoC with the corresponding DT bindings - a new frontend (cx24117) - a new I2C camera flash driver (lm3560) - a new mem2mem driver for TI SoC (ti-vpe) - support for Raphael r828d added to r820t driver - some improvements on buffer allocation at VB2 core - usual driver fixes and improvements PS this time, we have a smaller number of patches. While it is hard to pinpoint to the reasons, I believe that it is mainly due to: 1) there are several patch series ready, but depending on DT review. I decided to grant some extra time for DT maintainers to look on it, as they're expecting to have more time with the changes agreed during ARM mini-summit and KS. If they can't review in time for 3.14, I'll review myself and apply for the next merge window. 2) I suspect that having both LinuxCon EU and LinuxCon NA happening during the same merge window affected the development productivity, as several core media developers participated on both events" * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (151 commits) [media] media: st-rc: Add ST remote control driver [media] gpio-ir-recv: Include linux/of.h header [media] tvp7002: Include linux/of.h header [media] tvp514x: Include linux/of.h header [media] ths8200: Include linux/of.h header [media] adv7343: Include linux/of.h header [media] v4l: Fix typo in v4l2_subdev_get_try_crop() [media] media: i2c: add driver for dual LED Flash, lm3560 [media] rtl28xxu: add 15f4:0131 Astrometa DVB-T2 [media] rtl28xxu: add RTL2832P + R828D support [media] rtl2832: add new tuner R828D [media] r820t: add support for R828D [media] media/i2c: ths8200: fix build failure with gcc 4.5.4 [media] Add support for KWorld UB435-Q V2 [media] staging/media: fix msi3101 build errors [media] ddbridge: Remove casting the return value which is a void pointer [media] ngene: Remove casting the return value which is a void pointer [media] dm1105: remove unneeded not-null test [media] sh_mobile_ceu_camera: remove deprecated IRQF_DISABLED [media] media: rcar_vin: Add preliminary r8a7790 support ...
Diffstat (limited to 'drivers/media/pci')
-rw-r--r--drivers/media/pci/b2c2/flexcop-pci.c2
-rw-r--r--drivers/media/pci/bt8xx/bt878.c4
-rw-r--r--drivers/media/pci/bt8xx/bttv-driver.c2
-rw-r--r--drivers/media/pci/cx18/cx18-driver.c3
-rw-r--r--drivers/media/pci/cx23885/Kconfig1
-rw-r--r--drivers/media/pci/cx23885/cx23885-cards.c108
-rw-r--r--drivers/media/pci/cx23885/cx23885-core.c2
-rw-r--r--drivers/media/pci/cx23885/cx23885-dvb.c24
-rw-r--r--drivers/media/pci/cx23885/cx23885-input.c12
-rw-r--r--drivers/media/pci/cx23885/cx23885-video.c3
-rw-r--r--drivers/media/pci/cx23885/cx23885.h3
-rw-r--r--drivers/media/pci/cx25821/cx25821-cards.c2
-rw-r--r--drivers/media/pci/cx25821/cx25821-medusa-video.c18
-rw-r--r--drivers/media/pci/cx25821/cx25821-medusa-video.h6
-rw-r--r--drivers/media/pci/cx25821/cx25821-video-upstream.c8
-rw-r--r--drivers/media/pci/cx88/cx88-alsa.c29
-rw-r--r--drivers/media/pci/cx88/cx88-mpeg.c17
-rw-r--r--drivers/media/pci/cx88/cx88-video.c18
-rw-r--r--drivers/media/pci/ddbridge/ddbridge-core.c2
-rw-r--r--drivers/media/pci/dm1105/dm1105.c5
-rw-r--r--drivers/media/pci/ivtv/ivtv-driver.c2
-rw-r--r--drivers/media/pci/mantis/mantis_pci.c2
-rw-r--r--drivers/media/pci/meye/meye.c2
-rw-r--r--drivers/media/pci/ngene/ngene-core.c4
-rw-r--r--drivers/media/pci/pluto2/pluto2.c2
-rw-r--r--drivers/media/pci/pt1/pt1.c2
-rw-r--r--drivers/media/pci/saa7134/saa7134-alsa.c2
-rw-r--r--drivers/media/pci/saa7134/saa7134-core.c2
-rw-r--r--drivers/media/pci/saa7164/saa7164-core.c3
-rw-r--r--drivers/media/pci/zoran/zoran_card.c2
30 files changed, 183 insertions, 109 deletions
diff --git a/drivers/media/pci/b2c2/flexcop-pci.c b/drivers/media/pci/b2c2/flexcop-pci.c
index 447afbd904a4..8b5e0b3a92a0 100644
--- a/drivers/media/pci/b2c2/flexcop-pci.c
+++ b/drivers/media/pci/b2c2/flexcop-pci.c
@@ -319,7 +319,6 @@ static int flexcop_pci_init(struct flexcop_pci *fc_pci)
319 319
320err_pci_iounmap: 320err_pci_iounmap:
321 pci_iounmap(fc_pci->pdev, fc_pci->io_mem); 321 pci_iounmap(fc_pci->pdev, fc_pci->io_mem);
322 pci_set_drvdata(fc_pci->pdev, NULL);
323err_pci_release_regions: 322err_pci_release_regions:
324 pci_release_regions(fc_pci->pdev); 323 pci_release_regions(fc_pci->pdev);
325err_pci_disable_device: 324err_pci_disable_device:
@@ -332,7 +331,6 @@ static void flexcop_pci_exit(struct flexcop_pci *fc_pci)
332 if (fc_pci->init_state & FC_PCI_INIT) { 331 if (fc_pci->init_state & FC_PCI_INIT) {
333 free_irq(fc_pci->pdev->irq, fc_pci); 332 free_irq(fc_pci->pdev->irq, fc_pci);
334 pci_iounmap(fc_pci->pdev, fc_pci->io_mem); 333 pci_iounmap(fc_pci->pdev, fc_pci->io_mem);
335 pci_set_drvdata(fc_pci->pdev, NULL);
336 pci_release_regions(fc_pci->pdev); 334 pci_release_regions(fc_pci->pdev);
337 pci_disable_device(fc_pci->pdev); 335 pci_disable_device(fc_pci->pdev);
338 } 336 }
diff --git a/drivers/media/pci/bt8xx/bt878.c b/drivers/media/pci/bt8xx/bt878.c
index 66eb0baab0e9..d0c281f41a0a 100644
--- a/drivers/media/pci/bt8xx/bt878.c
+++ b/drivers/media/pci/bt8xx/bt878.c
@@ -488,8 +488,7 @@ static int bt878_probe(struct pci_dev *dev, const struct pci_device_id *pci_id)
488 btwrite(0, BT848_INT_MASK); 488 btwrite(0, BT848_INT_MASK);
489 489
490 result = request_irq(bt->irq, bt878_irq, 490 result = request_irq(bt->irq, bt878_irq,
491 IRQF_SHARED | IRQF_DISABLED, "bt878", 491 IRQF_SHARED, "bt878", (void *) bt);
492 (void *) bt);
493 if (result == -EINVAL) { 492 if (result == -EINVAL) {
494 printk(KERN_ERR "bt878(%d): Bad irq number or handler\n", 493 printk(KERN_ERR "bt878(%d): Bad irq number or handler\n",
495 bt878_num); 494 bt878_num);
@@ -563,7 +562,6 @@ static void bt878_remove(struct pci_dev *pci_dev)
563 bt->shutdown = 1; 562 bt->shutdown = 1;
564 bt878_mem_free(bt); 563 bt878_mem_free(bt);
565 564
566 pci_set_drvdata(pci_dev, NULL);
567 pci_disable_device(pci_dev); 565 pci_disable_device(pci_dev);
568 return; 566 return;
569} 567}
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c
index c6532de0eac7..a3b1ee9c00d7 100644
--- a/drivers/media/pci/bt8xx/bttv-driver.c
+++ b/drivers/media/pci/bt8xx/bttv-driver.c
@@ -4086,7 +4086,7 @@ static int bttv_probe(struct pci_dev *dev, const struct pci_device_id *pci_id)
4086 /* disable irqs, register irq handler */ 4086 /* disable irqs, register irq handler */
4087 btwrite(0, BT848_INT_MASK); 4087 btwrite(0, BT848_INT_MASK);
4088 result = request_irq(btv->c.pci->irq, bttv_irq, 4088 result = request_irq(btv->c.pci->irq, bttv_irq,
4089 IRQF_SHARED | IRQF_DISABLED, btv->c.v4l2_dev.name, (void *)btv); 4089 IRQF_SHARED, btv->c.v4l2_dev.name, (void *)btv);
4090 if (result < 0) { 4090 if (result < 0) {
4091 pr_err("%d: can't get IRQ %d\n", 4091 pr_err("%d: can't get IRQ %d\n",
4092 bttv_num, btv->c.pci->irq); 4092 bttv_num, btv->c.pci->irq);
diff --git a/drivers/media/pci/cx18/cx18-driver.c b/drivers/media/pci/cx18/cx18-driver.c
index 004d8ace5019..ff7232023f56 100644
--- a/drivers/media/pci/cx18/cx18-driver.c
+++ b/drivers/media/pci/cx18/cx18-driver.c
@@ -1031,8 +1031,7 @@ static int cx18_probe(struct pci_dev *pci_dev,
1031 1031
1032 /* Register IRQ */ 1032 /* Register IRQ */
1033 retval = request_irq(cx->pci_dev->irq, cx18_irq_handler, 1033 retval = request_irq(cx->pci_dev->irq, cx18_irq_handler,
1034 IRQF_SHARED | IRQF_DISABLED, 1034 IRQF_SHARED, cx->v4l2_dev.name, (void *)cx);
1035 cx->v4l2_dev.name, (void *)cx);
1036 if (retval) { 1035 if (retval) {
1037 CX18_ERR("Failed to register irq %d\n", retval); 1036 CX18_ERR("Failed to register irq %d\n", retval);
1038 goto free_i2c; 1037 goto free_i2c;
diff --git a/drivers/media/pci/cx23885/Kconfig b/drivers/media/pci/cx23885/Kconfig
index 5104c802f72f..d1dcb1d2e087 100644
--- a/drivers/media/pci/cx23885/Kconfig
+++ b/drivers/media/pci/cx23885/Kconfig
@@ -23,6 +23,7 @@ config VIDEO_CX23885
23 select DVB_STB6100 if MEDIA_SUBDRV_AUTOSELECT 23 select DVB_STB6100 if MEDIA_SUBDRV_AUTOSELECT
24 select DVB_STV6110 if MEDIA_SUBDRV_AUTOSELECT 24 select DVB_STV6110 if MEDIA_SUBDRV_AUTOSELECT
25 select DVB_CX24116 if MEDIA_SUBDRV_AUTOSELECT 25 select DVB_CX24116 if MEDIA_SUBDRV_AUTOSELECT
26 select DVB_CX24117 if MEDIA_SUBDRV_AUTOSELECT
26 select DVB_STV0900 if MEDIA_SUBDRV_AUTOSELECT 27 select DVB_STV0900 if MEDIA_SUBDRV_AUTOSELECT
27 select DVB_DS3000 if MEDIA_SUBDRV_AUTOSELECT 28 select DVB_DS3000 if MEDIA_SUBDRV_AUTOSELECT
28 select DVB_TS2020 if MEDIA_SUBDRV_AUTOSELECT 29 select DVB_TS2020 if MEDIA_SUBDRV_AUTOSELECT
diff --git a/drivers/media/pci/cx23885/cx23885-cards.c b/drivers/media/pci/cx23885/cx23885-cards.c
index 6a71a965e757..79f20c8c842e 100644
--- a/drivers/media/pci/cx23885/cx23885-cards.c
+++ b/drivers/media/pci/cx23885/cx23885-cards.c
@@ -223,6 +223,39 @@ struct cx23885_board cx23885_boards[] = {
223 .name = "Leadtek Winfast PxDVR3200 H", 223 .name = "Leadtek Winfast PxDVR3200 H",
224 .portc = CX23885_MPEG_DVB, 224 .portc = CX23885_MPEG_DVB,
225 }, 225 },
226 [CX23885_BOARD_LEADTEK_WINFAST_PXPVR2200] = {
227 .name = "Leadtek Winfast PxPVR2200",
228 .porta = CX23885_ANALOG_VIDEO,
229 .tuner_type = TUNER_XC2028,
230 .tuner_addr = 0x61,
231 .tuner_bus = 1,
232 .input = {{
233 .type = CX23885_VMUX_TELEVISION,
234 .vmux = CX25840_VIN2_CH1 |
235 CX25840_VIN5_CH2,
236 .amux = CX25840_AUDIO8,
237 .gpio0 = 0x704040,
238 }, {
239 .type = CX23885_VMUX_COMPOSITE1,
240 .vmux = CX25840_COMPOSITE1,
241 .amux = CX25840_AUDIO7,
242 .gpio0 = 0x704040,
243 }, {
244 .type = CX23885_VMUX_SVIDEO,
245 .vmux = CX25840_SVIDEO_LUMA3 |
246 CX25840_SVIDEO_CHROMA4,
247 .amux = CX25840_AUDIO7,
248 .gpio0 = 0x704040,
249 }, {
250 .type = CX23885_VMUX_COMPONENT,
251 .vmux = CX25840_VIN7_CH1 |
252 CX25840_VIN6_CH2 |
253 CX25840_VIN8_CH3 |
254 CX25840_COMPONENT_ON,
255 .amux = CX25840_AUDIO7,
256 .gpio0 = 0x704040,
257 } },
258 },
226 [CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000] = { 259 [CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000] = {
227 .name = "Leadtek Winfast PxDVR3200 H XC4000", 260 .name = "Leadtek Winfast PxDVR3200 H XC4000",
228 .porta = CX23885_ANALOG_VIDEO, 261 .porta = CX23885_ANALOG_VIDEO,
@@ -259,6 +292,16 @@ struct cx23885_board cx23885_boards[] = {
259 .name = "TurboSight TBS 6920", 292 .name = "TurboSight TBS 6920",
260 .portb = CX23885_MPEG_DVB, 293 .portb = CX23885_MPEG_DVB,
261 }, 294 },
295 [CX23885_BOARD_TBS_6980] = {
296 .name = "TurboSight TBS 6980",
297 .portb = CX23885_MPEG_DVB,
298 .portc = CX23885_MPEG_DVB,
299 },
300 [CX23885_BOARD_TBS_6981] = {
301 .name = "TurboSight TBS 6981",
302 .portb = CX23885_MPEG_DVB,
303 .portc = CX23885_MPEG_DVB,
304 },
262 [CX23885_BOARD_TEVII_S470] = { 305 [CX23885_BOARD_TEVII_S470] = {
263 .name = "TeVii S470", 306 .name = "TeVii S470",
264 .portb = CX23885_MPEG_DVB, 307 .portb = CX23885_MPEG_DVB,
@@ -688,6 +731,10 @@ struct cx23885_subid cx23885_subids[] = {
688 .card = CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H, 731 .card = CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H,
689 }, { 732 }, {
690 .subvendor = 0x107d, 733 .subvendor = 0x107d,
734 .subdevice = 0x6f21,
735 .card = CX23885_BOARD_LEADTEK_WINFAST_PXPVR2200,
736 }, {
737 .subvendor = 0x107d,
691 .subdevice = 0x6f39, 738 .subdevice = 0x6f39,
692 .card = CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000, 739 .card = CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000,
693 }, { 740 }, {
@@ -699,6 +746,14 @@ struct cx23885_subid cx23885_subids[] = {
699 .subdevice = 0x8888, 746 .subdevice = 0x8888,
700 .card = CX23885_BOARD_TBS_6920, 747 .card = CX23885_BOARD_TBS_6920,
701 }, { 748 }, {
749 .subvendor = 0x6980,
750 .subdevice = 0x8888,
751 .card = CX23885_BOARD_TBS_6980,
752 }, {
753 .subvendor = 0x6981,
754 .subdevice = 0x8888,
755 .card = CX23885_BOARD_TBS_6981,
756 }, {
702 .subvendor = 0xd470, 757 .subvendor = 0xd470,
703 .subdevice = 0x9022, 758 .subdevice = 0x9022,
704 .card = CX23885_BOARD_TEVII_S470, 759 .card = CX23885_BOARD_TEVII_S470,
@@ -1023,6 +1078,35 @@ static void hauppauge_eeprom(struct cx23885_dev *dev, u8 *eeprom_data)
1023 dev->name, tv.model); 1078 dev->name, tv.model);
1024} 1079}
1025 1080
1081/* Some TBS cards require initing a chip using a bitbanged SPI attached
1082 to the cx23885 gpio's. If this chip doesn't get init'ed the demod
1083 doesn't respond to any command. */
1084static void tbs_card_init(struct cx23885_dev *dev)
1085{
1086 int i;
1087 const u8 buf[] = {
1088 0xe0, 0x06, 0x66, 0x33, 0x65,
1089 0x01, 0x17, 0x06, 0xde};
1090
1091 switch (dev->board) {
1092 case CX23885_BOARD_TBS_6980:
1093 case CX23885_BOARD_TBS_6981:
1094 cx_set(GP0_IO, 0x00070007);
1095 usleep_range(1000, 10000);
1096 cx_clear(GP0_IO, 2);
1097 usleep_range(1000, 10000);
1098 for (i = 0; i < 9 * 8; i++) {
1099 cx_clear(GP0_IO, 7);
1100 usleep_range(1000, 10000);
1101 cx_set(GP0_IO,
1102 ((buf[i >> 3] >> (7 - (i & 7))) & 1) | 4);
1103 usleep_range(1000, 10000);
1104 }
1105 cx_set(GP0_IO, 7);
1106 break;
1107 }
1108}
1109
1026int cx23885_tuner_callback(void *priv, int component, int command, int arg) 1110int cx23885_tuner_callback(void *priv, int component, int command, int arg)
1027{ 1111{
1028 struct cx23885_tsport *port = priv; 1112 struct cx23885_tsport *port = priv;
@@ -1043,6 +1127,7 @@ int cx23885_tuner_callback(void *priv, int component, int command, int arg)
1043 case CX23885_BOARD_HAUPPAUGE_HVR1500: 1127 case CX23885_BOARD_HAUPPAUGE_HVR1500:
1044 case CX23885_BOARD_HAUPPAUGE_HVR1500Q: 1128 case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
1045 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H: 1129 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H:
1130 case CX23885_BOARD_LEADTEK_WINFAST_PXPVR2200:
1046 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000: 1131 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000:
1047 case CX23885_BOARD_COMPRO_VIDEOMATE_E650F: 1132 case CX23885_BOARD_COMPRO_VIDEOMATE_E650F:
1048 case CX23885_BOARD_COMPRO_VIDEOMATE_E800: 1133 case CX23885_BOARD_COMPRO_VIDEOMATE_E800:
@@ -1208,6 +1293,7 @@ void cx23885_gpio_setup(struct cx23885_dev *dev)
1208 cx_set(GP0_IO, 0x000f000f); 1293 cx_set(GP0_IO, 0x000f000f);
1209 break; 1294 break;
1210 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H: 1295 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H:
1296 case CX23885_BOARD_LEADTEK_WINFAST_PXPVR2200:
1211 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000: 1297 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000:
1212 case CX23885_BOARD_COMPRO_VIDEOMATE_E650F: 1298 case CX23885_BOARD_COMPRO_VIDEOMATE_E650F:
1213 case CX23885_BOARD_COMPRO_VIDEOMATE_E800: 1299 case CX23885_BOARD_COMPRO_VIDEOMATE_E800:
@@ -1225,6 +1311,8 @@ void cx23885_gpio_setup(struct cx23885_dev *dev)
1225 cx_set(GP0_IO, 0x00040004); 1311 cx_set(GP0_IO, 0x00040004);
1226 break; 1312 break;
1227 case CX23885_BOARD_TBS_6920: 1313 case CX23885_BOARD_TBS_6920:
1314 case CX23885_BOARD_TBS_6980:
1315 case CX23885_BOARD_TBS_6981:
1228 case CX23885_BOARD_PROF_8000: 1316 case CX23885_BOARD_PROF_8000:
1229 cx_write(MC417_CTL, 0x00000036); 1317 cx_write(MC417_CTL, 0x00000036);
1230 cx_write(MC417_OEN, 0x00001000); 1318 cx_write(MC417_OEN, 0x00001000);
@@ -1473,6 +1561,8 @@ int cx23885_ir_init(struct cx23885_dev *dev)
1473 case CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL: 1561 case CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL:
1474 case CX23885_BOARD_TEVII_S470: 1562 case CX23885_BOARD_TEVII_S470:
1475 case CX23885_BOARD_MYGICA_X8507: 1563 case CX23885_BOARD_MYGICA_X8507:
1564 case CX23885_BOARD_TBS_6980:
1565 case CX23885_BOARD_TBS_6981:
1476 if (!enable_885_ir) 1566 if (!enable_885_ir)
1477 break; 1567 break;
1478 dev->sd_ir = cx23885_find_hw(dev, CX23885_HW_AV_CORE); 1568 dev->sd_ir = cx23885_find_hw(dev, CX23885_HW_AV_CORE);
@@ -1516,6 +1606,8 @@ void cx23885_ir_fini(struct cx23885_dev *dev)
1516 case CX23885_BOARD_TEVII_S470: 1606 case CX23885_BOARD_TEVII_S470:
1517 case CX23885_BOARD_HAUPPAUGE_HVR1250: 1607 case CX23885_BOARD_HAUPPAUGE_HVR1250:
1518 case CX23885_BOARD_MYGICA_X8507: 1608 case CX23885_BOARD_MYGICA_X8507:
1609 case CX23885_BOARD_TBS_6980:
1610 case CX23885_BOARD_TBS_6981:
1519 cx23885_irq_remove(dev, PCI_MSK_AV_CORE); 1611 cx23885_irq_remove(dev, PCI_MSK_AV_CORE);
1520 /* sd_ir is a duplicate pointer to the AV Core, just clear it */ 1612 /* sd_ir is a duplicate pointer to the AV Core, just clear it */
1521 dev->sd_ir = NULL; 1613 dev->sd_ir = NULL;
@@ -1561,6 +1653,8 @@ void cx23885_ir_pci_int_enable(struct cx23885_dev *dev)
1561 case CX23885_BOARD_TEVII_S470: 1653 case CX23885_BOARD_TEVII_S470:
1562 case CX23885_BOARD_HAUPPAUGE_HVR1250: 1654 case CX23885_BOARD_HAUPPAUGE_HVR1250:
1563 case CX23885_BOARD_MYGICA_X8507: 1655 case CX23885_BOARD_MYGICA_X8507:
1656 case CX23885_BOARD_TBS_6980:
1657 case CX23885_BOARD_TBS_6981:
1564 if (dev->sd_ir) 1658 if (dev->sd_ir)
1565 cx23885_irq_add_enable(dev, PCI_MSK_AV_CORE); 1659 cx23885_irq_add_enable(dev, PCI_MSK_AV_CORE);
1566 break; 1660 break;
@@ -1676,6 +1770,16 @@ void cx23885_card_setup(struct cx23885_dev *dev)
1676 ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */ 1770 ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */
1677 ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; 1771 ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
1678 break; 1772 break;
1773 case CX23885_BOARD_TBS_6980:
1774 case CX23885_BOARD_TBS_6981:
1775 ts1->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */
1776 ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */
1777 ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
1778 ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */
1779 ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */
1780 ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
1781 tbs_card_init(dev);
1782 break;
1679 case CX23885_BOARD_MYGICA_X8506: 1783 case CX23885_BOARD_MYGICA_X8506:
1680 case CX23885_BOARD_MAGICPRO_PROHDTVE2: 1784 case CX23885_BOARD_MAGICPRO_PROHDTVE2:
1681 case CX23885_BOARD_MYGICA_X8507: 1785 case CX23885_BOARD_MYGICA_X8507:
@@ -1704,6 +1808,7 @@ void cx23885_card_setup(struct cx23885_dev *dev)
1704 case CX23885_BOARD_HAUPPAUGE_HVR1700: 1808 case CX23885_BOARD_HAUPPAUGE_HVR1700:
1705 case CX23885_BOARD_HAUPPAUGE_HVR1400: 1809 case CX23885_BOARD_HAUPPAUGE_HVR1400:
1706 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H: 1810 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H:
1811 case CX23885_BOARD_LEADTEK_WINFAST_PXPVR2200:
1707 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000: 1812 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000:
1708 case CX23885_BOARD_COMPRO_VIDEOMATE_E650F: 1813 case CX23885_BOARD_COMPRO_VIDEOMATE_E650F:
1709 case CX23885_BOARD_HAUPPAUGE_HVR1270: 1814 case CX23885_BOARD_HAUPPAUGE_HVR1270:
@@ -1733,6 +1838,7 @@ void cx23885_card_setup(struct cx23885_dev *dev)
1733 case CX23885_BOARD_HAUPPAUGE_HVR1800lp: 1838 case CX23885_BOARD_HAUPPAUGE_HVR1800lp:
1734 case CX23885_BOARD_HAUPPAUGE_HVR1700: 1839 case CX23885_BOARD_HAUPPAUGE_HVR1700:
1735 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H: 1840 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H:
1841 case CX23885_BOARD_LEADTEK_WINFAST_PXPVR2200:
1736 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000: 1842 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000:
1737 case CX23885_BOARD_COMPRO_VIDEOMATE_E650F: 1843 case CX23885_BOARD_COMPRO_VIDEOMATE_E650F:
1738 case CX23885_BOARD_NETUP_DUAL_DVBS2_CI: 1844 case CX23885_BOARD_NETUP_DUAL_DVBS2_CI:
@@ -1752,6 +1858,8 @@ void cx23885_card_setup(struct cx23885_dev *dev)
1752 case CX23885_BOARD_MYGICA_X8507: 1858 case CX23885_BOARD_MYGICA_X8507:
1753 case CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL: 1859 case CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL:
1754 case CX23885_BOARD_AVERMEDIA_HC81R: 1860 case CX23885_BOARD_AVERMEDIA_HC81R:
1861 case CX23885_BOARD_TBS_6980:
1862 case CX23885_BOARD_TBS_6981:
1755 dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev, 1863 dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev,
1756 &dev->i2c_bus[2].i2c_adap, 1864 &dev->i2c_bus[2].i2c_adap,
1757 "cx25840", 0x88 >> 1, NULL); 1865 "cx25840", 0x88 >> 1, NULL);
diff --git a/drivers/media/pci/cx23885/cx23885-core.c b/drivers/media/pci/cx23885/cx23885-core.c
index 9f63d93239ec..edcd79db1e4e 100644
--- a/drivers/media/pci/cx23885/cx23885-core.c
+++ b/drivers/media/pci/cx23885/cx23885-core.c
@@ -2129,7 +2129,7 @@ static int cx23885_initdev(struct pci_dev *pci_dev,
2129 } 2129 }
2130 2130
2131 err = request_irq(pci_dev->irq, cx23885_irq, 2131 err = request_irq(pci_dev->irq, cx23885_irq,
2132 IRQF_SHARED | IRQF_DISABLED, dev->name, dev); 2132 IRQF_SHARED, dev->name, dev);
2133 if (err < 0) { 2133 if (err < 0) {
2134 printk(KERN_ERR "%s: can't get IRQ %d\n", 2134 printk(KERN_ERR "%s: can't get IRQ %d\n",
2135 dev->name, pci_dev->irq); 2135 dev->name, pci_dev->irq);
diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c b/drivers/media/pci/cx23885/cx23885-dvb.c
index 971e4ff1b87f..05492053b473 100644
--- a/drivers/media/pci/cx23885/cx23885-dvb.c
+++ b/drivers/media/pci/cx23885/cx23885-dvb.c
@@ -51,6 +51,7 @@
51#include "stv6110.h" 51#include "stv6110.h"
52#include "lnbh24.h" 52#include "lnbh24.h"
53#include "cx24116.h" 53#include "cx24116.h"
54#include "cx24117.h"
54#include "cimax2.h" 55#include "cimax2.h"
55#include "lgs8gxx.h" 56#include "lgs8gxx.h"
56#include "netup-eeprom.h" 57#include "netup-eeprom.h"
@@ -461,6 +462,10 @@ static struct cx24116_config tbs_cx24116_config = {
461 .demod_address = 0x55, 462 .demod_address = 0x55,
462}; 463};
463 464
465static struct cx24117_config tbs_cx24117_config = {
466 .demod_address = 0x55,
467};
468
464static struct ds3000_config tevii_ds3000_config = { 469static struct ds3000_config tevii_ds3000_config = {
465 .demod_address = 0x68, 470 .demod_address = 0x68,
466}; 471};
@@ -1044,6 +1049,25 @@ static int dvb_register(struct cx23885_tsport *port)
1044 fe0->dvb.frontend->ops.set_voltage = f300_set_voltage; 1049 fe0->dvb.frontend->ops.set_voltage = f300_set_voltage;
1045 1050
1046 break; 1051 break;
1052 case CX23885_BOARD_TBS_6980:
1053 case CX23885_BOARD_TBS_6981:
1054 i2c_bus = &dev->i2c_bus[1];
1055
1056 switch (port->nr) {
1057 /* PORT B */
1058 case 1:
1059 fe0->dvb.frontend = dvb_attach(cx24117_attach,
1060 &tbs_cx24117_config,
1061 &i2c_bus->i2c_adap);
1062 break;
1063 /* PORT C */
1064 case 2:
1065 fe0->dvb.frontend = dvb_attach(cx24117_attach,
1066 &tbs_cx24117_config,
1067 &i2c_bus->i2c_adap);
1068 break;
1069 }
1070 break;
1047 case CX23885_BOARD_TEVII_S470: 1071 case CX23885_BOARD_TEVII_S470:
1048 i2c_bus = &dev->i2c_bus[1]; 1072 i2c_bus = &dev->i2c_bus[1];
1049 1073
diff --git a/drivers/media/pci/cx23885/cx23885-input.c b/drivers/media/pci/cx23885/cx23885-input.c
index 7875dfbe09ff..8a49e7c9eddd 100644
--- a/drivers/media/pci/cx23885/cx23885-input.c
+++ b/drivers/media/pci/cx23885/cx23885-input.c
@@ -90,6 +90,8 @@ void cx23885_input_rx_work_handler(struct cx23885_dev *dev, u32 events)
90 case CX23885_BOARD_TEVII_S470: 90 case CX23885_BOARD_TEVII_S470:
91 case CX23885_BOARD_HAUPPAUGE_HVR1250: 91 case CX23885_BOARD_HAUPPAUGE_HVR1250:
92 case CX23885_BOARD_MYGICA_X8507: 92 case CX23885_BOARD_MYGICA_X8507:
93 case CX23885_BOARD_TBS_6980:
94 case CX23885_BOARD_TBS_6981:
93 /* 95 /*
94 * The only boards we handle right now. However other boards 96 * The only boards we handle right now. However other boards
95 * using the CX2388x integrated IR controller should be similar 97 * using the CX2388x integrated IR controller should be similar
@@ -168,6 +170,8 @@ static int cx23885_input_ir_start(struct cx23885_dev *dev)
168 break; 170 break;
169 case CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL: 171 case CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL:
170 case CX23885_BOARD_TEVII_S470: 172 case CX23885_BOARD_TEVII_S470:
173 case CX23885_BOARD_TBS_6980:
174 case CX23885_BOARD_TBS_6981:
171 /* 175 /*
172 * The IR controller on this board only returns pulse widths. 176 * The IR controller on this board only returns pulse widths.
173 * Any other mode setting will fail to set up the device. 177 * Any other mode setting will fail to set up the device.
@@ -298,6 +302,14 @@ int cx23885_input_init(struct cx23885_dev *dev)
298 /* A guess at the remote */ 302 /* A guess at the remote */
299 rc_map = RC_MAP_TOTAL_MEDIA_IN_HAND_02; 303 rc_map = RC_MAP_TOTAL_MEDIA_IN_HAND_02;
300 break; 304 break;
305 case CX23885_BOARD_TBS_6980:
306 case CX23885_BOARD_TBS_6981:
307 /* Integrated CX23885 IR controller */
308 driver_type = RC_DRIVER_IR_RAW;
309 allowed_protos = RC_BIT_ALL;
310 /* A guess at the remote */
311 rc_map = RC_MAP_TBS_NEC;
312 break;
301 default: 313 default:
302 return -ENODEV; 314 return -ENODEV;
303 } 315 }
diff --git a/drivers/media/pci/cx23885/cx23885-video.c b/drivers/media/pci/cx23885/cx23885-video.c
index 161686832b20..7891f34157d1 100644
--- a/drivers/media/pci/cx23885/cx23885-video.c
+++ b/drivers/media/pci/cx23885/cx23885-video.c
@@ -1865,7 +1865,8 @@ int cx23885_video_register(struct cx23885_dev *dev)
1865 1865
1866 v4l2_subdev_call(sd, tuner, s_type_addr, &tun_setup); 1866 v4l2_subdev_call(sd, tuner, s_type_addr, &tun_setup);
1867 1867
1868 if (dev->board == CX23885_BOARD_LEADTEK_WINFAST_PXTV1200) { 1868 if ((dev->board == CX23885_BOARD_LEADTEK_WINFAST_PXTV1200) ||
1869 (dev->board == CX23885_BOARD_LEADTEK_WINFAST_PXPVR2200)) {
1869 struct xc2028_ctrl ctrl = { 1870 struct xc2028_ctrl ctrl = {
1870 .fname = XC2028_DEFAULT_FIRMWARE, 1871 .fname = XC2028_DEFAULT_FIRMWARE,
1871 .max_len = 64 1872 .max_len = 64
diff --git a/drivers/media/pci/cx23885/cx23885.h b/drivers/media/pci/cx23885/cx23885.h
index 038caf53908b..0fa4048ab872 100644
--- a/drivers/media/pci/cx23885/cx23885.h
+++ b/drivers/media/pci/cx23885/cx23885.h
@@ -93,6 +93,9 @@
93#define CX23885_BOARD_PROF_8000 37 93#define CX23885_BOARD_PROF_8000 37
94#define CX23885_BOARD_HAUPPAUGE_HVR4400 38 94#define CX23885_BOARD_HAUPPAUGE_HVR4400 38
95#define CX23885_BOARD_AVERMEDIA_HC81R 39 95#define CX23885_BOARD_AVERMEDIA_HC81R 39
96#define CX23885_BOARD_TBS_6981 40
97#define CX23885_BOARD_TBS_6980 41
98#define CX23885_BOARD_LEADTEK_WINFAST_PXPVR2200 42
96 99
97#define GPIO_0 0x00000001 100#define GPIO_0 0x00000001
98#define GPIO_1 0x00000002 101#define GPIO_1 0x00000002
diff --git a/drivers/media/pci/cx25821/cx25821-cards.c b/drivers/media/pci/cx25821/cx25821-cards.c
index 3b409feb03d8..f2ebc989b303 100644
--- a/drivers/media/pci/cx25821/cx25821-cards.c
+++ b/drivers/media/pci/cx25821/cx25821-cards.c
@@ -45,5 +45,3 @@ struct cx25821_board cx25821_boards[] = {
45 }, 45 },
46 46
47}; 47};
48
49const unsigned int cx25821_bcount = ARRAY_SIZE(cx25821_boards);
diff --git a/drivers/media/pci/cx25821/cx25821-medusa-video.c b/drivers/media/pci/cx25821/cx25821-medusa-video.c
index 22fa04415ccc..43bdfa4dfba1 100644
--- a/drivers/media/pci/cx25821/cx25821-medusa-video.c
+++ b/drivers/media/pci/cx25821/cx25821-medusa-video.c
@@ -438,7 +438,7 @@ void medusa_set_resolution(struct cx25821_dev *dev, int width,
438 decoder_count = decoder_select + 1; 438 decoder_count = decoder_select + 1;
439 } else { 439 } else {
440 decoder = 0; 440 decoder = 0;
441 decoder_count = _num_decoders; 441 decoder_count = dev->_max_num_decoders;
442 } 442 }
443 443
444 switch (width) { 444 switch (width) {
@@ -506,8 +506,6 @@ static void medusa_set_decoderduration(struct cx25821_dev *dev, int decoder,
506 break; 506 break;
507 } 507 }
508 508
509 _display_field_cnt[decoder] = duration;
510
511 /* update hardware */ 509 /* update hardware */
512 fld_cnt = cx25821_i2c_read(&dev->i2c_bus[0], disp_cnt_reg, &tmp); 510 fld_cnt = cx25821_i2c_read(&dev->i2c_bus[0], disp_cnt_reg, &tmp);
513 511
@@ -667,8 +665,6 @@ int medusa_video_init(struct cx25821_dev *dev)
667 int ret_val = 0; 665 int ret_val = 0;
668 int i = 0; 666 int i = 0;
669 667
670 _num_decoders = dev->_max_num_decoders;
671
672 /* disable Auto source selection on all video decoders */ 668 /* disable Auto source selection on all video decoders */
673 value = cx25821_i2c_read(&dev->i2c_bus[0], MON_A_CTRL, &tmp); 669 value = cx25821_i2c_read(&dev->i2c_bus[0], MON_A_CTRL, &tmp);
674 value &= 0xFFFFF0FF; 670 value &= 0xFFFFF0FF;
@@ -685,8 +681,14 @@ int medusa_video_init(struct cx25821_dev *dev)
685 if (ret_val < 0) 681 if (ret_val < 0)
686 goto error; 682 goto error;
687 683
688 for (i = 0; i < _num_decoders; i++) 684 /*
689 medusa_set_decoderduration(dev, i, _display_field_cnt[i]); 685 * FIXME: due to a coding bug the duration was always 0. It's
686 * likely that it really should be something else, but due to the
687 * lack of documentation I have no idea what it should be. For
688 * now just fill in 0 as the duration.
689 */
690 for (i = 0; i < dev->_max_num_decoders; i++)
691 medusa_set_decoderduration(dev, i, 0);
690 692
691 /* Select monitor as DENC A input, power up the DAC */ 693 /* Select monitor as DENC A input, power up the DAC */
692 value = cx25821_i2c_read(&dev->i2c_bus[0], DENC_AB_CTRL, &tmp); 694 value = cx25821_i2c_read(&dev->i2c_bus[0], DENC_AB_CTRL, &tmp);
@@ -717,7 +719,7 @@ int medusa_video_init(struct cx25821_dev *dev)
717 /* Turn on all of the data out and control output pins. */ 719 /* Turn on all of the data out and control output pins. */
718 value = cx25821_i2c_read(&dev->i2c_bus[0], PIN_OE_CTRL, &tmp); 720 value = cx25821_i2c_read(&dev->i2c_bus[0], PIN_OE_CTRL, &tmp);
719 value &= 0xFEF0FE00; 721 value &= 0xFEF0FE00;
720 if (_num_decoders == MAX_DECODERS) { 722 if (dev->_max_num_decoders == MAX_DECODERS) {
721 /* 723 /*
722 * Note: The octal board does not support control pins(bit16-19) 724 * Note: The octal board does not support control pins(bit16-19)
723 * These bits are ignored in the octal board. 725 * These bits are ignored in the octal board.
diff --git a/drivers/media/pci/cx25821/cx25821-medusa-video.h b/drivers/media/pci/cx25821/cx25821-medusa-video.h
index 6175e0961855..8bf602ff27b1 100644
--- a/drivers/media/pci/cx25821/cx25821-medusa-video.h
+++ b/drivers/media/pci/cx25821/cx25821-medusa-video.h
@@ -40,10 +40,4 @@
40#define CONTRAST_DEFAULT 5000 40#define CONTRAST_DEFAULT 5000
41#define HUE_DEFAULT 5000 41#define HUE_DEFAULT 5000
42 42
43unsigned short _num_decoders;
44unsigned short _num_cameras;
45
46unsigned int _video_standard;
47int _display_field_cnt[MAX_DECODERS];
48
49#endif 43#endif
diff --git a/drivers/media/pci/cx25821/cx25821-video-upstream.c b/drivers/media/pci/cx25821/cx25821-video-upstream.c
index 88ffef410c50..1f43be0b04c8 100644
--- a/drivers/media/pci/cx25821/cx25821-video-upstream.c
+++ b/drivers/media/pci/cx25821/cx25821-video-upstream.c
@@ -159,10 +159,10 @@ static __le32 *cx25821_risc_field_upstream(struct cx25821_channel *chan, __le32
159 * For the upstream video channel, the risc engine will enable 159 * For the upstream video channel, the risc engine will enable
160 * the FIFO. */ 160 * the FIFO. */
161 if (fifo_enable && line == 3) { 161 if (fifo_enable && line == 3) {
162 *(rp++) = RISC_WRITECR; 162 *(rp++) = cpu_to_le32(RISC_WRITECR);
163 *(rp++) = sram_ch->dma_ctl; 163 *(rp++) = cpu_to_le32(sram_ch->dma_ctl);
164 *(rp++) = FLD_VID_FIFO_EN; 164 *(rp++) = cpu_to_le32(FLD_VID_FIFO_EN);
165 *(rp++) = 0x00000001; 165 *(rp++) = cpu_to_le32(0x00000001);
166 } 166 }
167 } 167 }
168 168
diff --git a/drivers/media/pci/cx88/cx88-alsa.c b/drivers/media/pci/cx88/cx88-alsa.c
index aba5b1c649e6..400eb1c42d3f 100644
--- a/drivers/media/pci/cx88/cx88-alsa.c
+++ b/drivers/media/pci/cx88/cx88-alsa.c
@@ -834,7 +834,7 @@ static int snd_cx88_create(struct snd_card *card, struct pci_dev *pci,
834 834
835 /* get irq */ 835 /* get irq */
836 err = request_irq(chip->pci->irq, cx8801_irq, 836 err = request_irq(chip->pci->irq, cx8801_irq,
837 IRQF_SHARED | IRQF_DISABLED, chip->core->name, chip); 837 IRQF_SHARED, chip->core->name, chip);
838 if (err < 0) { 838 if (err < 0) {
839 dprintk(0, "%s: can't get IRQ %d\n", 839 dprintk(0, "%s: can't get IRQ %d\n",
840 chip->core->name, chip->pci->irq); 840 chip->core->name, chip->pci->irq);
@@ -935,8 +935,6 @@ static void cx88_audio_finidev(struct pci_dev *pci)
935 935
936 snd_card_free((void *)card); 936 snd_card_free((void *)card);
937 937
938 pci_set_drvdata(pci, NULL);
939
940 devno--; 938 devno--;
941} 939}
942 940
@@ -951,27 +949,4 @@ static struct pci_driver cx88_audio_pci_driver = {
951 .remove = cx88_audio_finidev, 949 .remove = cx88_audio_finidev,
952}; 950};
953 951
954/**************************************************************************** 952module_pci_driver(cx88_audio_pci_driver);
955 LINUX MODULE INIT
956 ****************************************************************************/
957
958/*
959 * module init
960 */
961static int __init cx88_audio_init(void)
962{
963 printk(KERN_INFO "cx2388x alsa driver version %s loaded\n",
964 CX88_VERSION);
965 return pci_register_driver(&cx88_audio_pci_driver);
966}
967
968/*
969 * module remove
970 */
971static void __exit cx88_audio_fini(void)
972{
973 pci_unregister_driver(&cx88_audio_pci_driver);
974}
975
976module_init(cx88_audio_init);
977module_exit(cx88_audio_fini);
diff --git a/drivers/media/pci/cx88/cx88-mpeg.c b/drivers/media/pci/cx88/cx88-mpeg.c
index 2d3507eb4897..74b7b8614c23 100644
--- a/drivers/media/pci/cx88/cx88-mpeg.c
+++ b/drivers/media/pci/cx88/cx88-mpeg.c
@@ -499,7 +499,7 @@ static int cx8802_init_common(struct cx8802_dev *dev)
499 499
500 /* get irq */ 500 /* get irq */
501 err = request_irq(dev->pci->irq, cx8802_irq, 501 err = request_irq(dev->pci->irq, cx8802_irq,
502 IRQF_SHARED | IRQF_DISABLED, dev->core->name, dev); 502 IRQF_SHARED, dev->core->name, dev);
503 if (err < 0) { 503 if (err < 0) {
504 printk(KERN_ERR "%s: can't get IRQ %d\n", 504 printk(KERN_ERR "%s: can't get IRQ %d\n",
505 dev->core->name, dev->pci->irq); 505 dev->core->name, dev->pci->irq);
@@ -520,7 +520,6 @@ static void cx8802_fini_common(struct cx8802_dev *dev)
520 520
521 /* unregister stuff */ 521 /* unregister stuff */
522 free_irq(dev->pci->irq, dev); 522 free_irq(dev->pci->irq, dev);
523 pci_set_drvdata(dev->pci, NULL);
524 523
525 /* free memory */ 524 /* free memory */
526 btcx_riscmem_free(dev->pci,&dev->mpegq.stopper); 525 btcx_riscmem_free(dev->pci,&dev->mpegq.stopper);
@@ -903,20 +902,8 @@ static struct pci_driver cx8802_pci_driver = {
903 .remove = cx8802_remove, 902 .remove = cx8802_remove,
904}; 903};
905 904
906static int __init cx8802_init(void) 905module_pci_driver(cx8802_pci_driver);
907{
908 printk(KERN_INFO "cx88/2: cx2388x MPEG-TS Driver Manager version %s loaded\n",
909 CX88_VERSION);
910 return pci_register_driver(&cx8802_pci_driver);
911}
912
913static void __exit cx8802_fini(void)
914{
915 pci_unregister_driver(&cx8802_pci_driver);
916}
917 906
918module_init(cx8802_init);
919module_exit(cx8802_fini);
920EXPORT_SYMBOL(cx8802_buf_prepare); 907EXPORT_SYMBOL(cx8802_buf_prepare);
921EXPORT_SYMBOL(cx8802_buf_queue); 908EXPORT_SYMBOL(cx8802_buf_queue);
922EXPORT_SYMBOL(cx8802_cancel_buffers); 909EXPORT_SYMBOL(cx8802_cancel_buffers);
diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c
index ecf21d9f1f34..ed8cb9037b6f 100644
--- a/drivers/media/pci/cx88/cx88-video.c
+++ b/drivers/media/pci/cx88/cx88-video.c
@@ -1738,7 +1738,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
1738 1738
1739 /* get irq */ 1739 /* get irq */
1740 err = request_irq(pci_dev->irq, cx8800_irq, 1740 err = request_irq(pci_dev->irq, cx8800_irq,
1741 IRQF_SHARED | IRQF_DISABLED, core->name, dev); 1741 IRQF_SHARED, core->name, dev);
1742 if (err < 0) { 1742 if (err < 0) {
1743 printk(KERN_ERR "%s/0: can't get IRQ %d\n", 1743 printk(KERN_ERR "%s/0: can't get IRQ %d\n",
1744 core->name,pci_dev->irq); 1744 core->name,pci_dev->irq);
@@ -1922,7 +1922,6 @@ static void cx8800_finidev(struct pci_dev *pci_dev)
1922 1922
1923 free_irq(pci_dev->irq, dev); 1923 free_irq(pci_dev->irq, dev);
1924 cx8800_unregister_video(dev); 1924 cx8800_unregister_video(dev);
1925 pci_set_drvdata(pci_dev, NULL);
1926 1925
1927 /* free memory */ 1926 /* free memory */
1928 btcx_riscmem_free(dev->pci,&dev->vidq.stopper); 1927 btcx_riscmem_free(dev->pci,&dev->vidq.stopper);
@@ -2039,17 +2038,4 @@ static struct pci_driver cx8800_pci_driver = {
2039#endif 2038#endif
2040}; 2039};
2041 2040
2042static int __init cx8800_init(void) 2041module_pci_driver(cx8800_pci_driver);
2043{
2044 printk(KERN_INFO "cx88/0: cx2388x v4l2 driver version %s loaded\n",
2045 CX88_VERSION);
2046 return pci_register_driver(&cx8800_pci_driver);
2047}
2048
2049static void __exit cx8800_fini(void)
2050{
2051 pci_unregister_driver(&cx8800_pci_driver);
2052}
2053
2054module_init(cx8800_init);
2055module_exit(cx8800_fini);
diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c
index 36e34522b9a8..9375f30d9a81 100644
--- a/drivers/media/pci/ddbridge/ddbridge-core.c
+++ b/drivers/media/pci/ddbridge/ddbridge-core.c
@@ -1544,7 +1544,7 @@ static void ddb_unmap(struct ddb *dev)
1544 1544
1545static void ddb_remove(struct pci_dev *pdev) 1545static void ddb_remove(struct pci_dev *pdev)
1546{ 1546{
1547 struct ddb *dev = (struct ddb *) pci_get_drvdata(pdev); 1547 struct ddb *dev = pci_get_drvdata(pdev);
1548 1548
1549 ddb_ports_detach(dev); 1549 ddb_ports_detach(dev);
1550 ddb_i2c_release(dev); 1550 ddb_i2c_release(dev);
diff --git a/drivers/media/pci/dm1105/dm1105.c b/drivers/media/pci/dm1105/dm1105.c
index ab797fe466d2..e60ac35fc10c 100644
--- a/drivers/media/pci/dm1105/dm1105.c
+++ b/drivers/media/pci/dm1105/dm1105.c
@@ -1178,7 +1178,6 @@ err_pci_release_regions:
1178err_pci_disable_device: 1178err_pci_disable_device:
1179 pci_disable_device(pdev); 1179 pci_disable_device(pdev);
1180err_kfree: 1180err_kfree:
1181 pci_set_drvdata(pdev, NULL);
1182 kfree(dev); 1181 kfree(dev);
1183 return ret; 1182 return ret;
1184} 1183}
@@ -1202,8 +1201,7 @@ static void dm1105_remove(struct pci_dev *pdev)
1202 dvb_dmxdev_release(&dev->dmxdev); 1201 dvb_dmxdev_release(&dev->dmxdev);
1203 dvb_dmx_release(dvbdemux); 1202 dvb_dmx_release(dvbdemux);
1204 dvb_unregister_adapter(dvb_adapter); 1203 dvb_unregister_adapter(dvb_adapter);
1205 if (&dev->i2c_adap) 1204 i2c_del_adapter(&dev->i2c_adap);
1206 i2c_del_adapter(&dev->i2c_adap);
1207 1205
1208 dm1105_hw_exit(dev); 1206 dm1105_hw_exit(dev);
1209 synchronize_irq(pdev->irq); 1207 synchronize_irq(pdev->irq);
@@ -1211,7 +1209,6 @@ static void dm1105_remove(struct pci_dev *pdev)
1211 pci_iounmap(pdev, dev->io_mem); 1209 pci_iounmap(pdev, dev->io_mem);
1212 pci_release_regions(pdev); 1210 pci_release_regions(pdev);
1213 pci_disable_device(pdev); 1211 pci_disable_device(pdev);
1214 pci_set_drvdata(pdev, NULL);
1215 dm1105_devcount--; 1212 dm1105_devcount--;
1216 kfree(dev); 1213 kfree(dev);
1217} 1214}
diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c
index c08ae3eb9554..802642d26643 100644
--- a/drivers/media/pci/ivtv/ivtv-driver.c
+++ b/drivers/media/pci/ivtv/ivtv-driver.c
@@ -1261,7 +1261,7 @@ static int ivtv_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
1261 1261
1262 /* Register IRQ */ 1262 /* Register IRQ */
1263 retval = request_irq(itv->pdev->irq, ivtv_irq_handler, 1263 retval = request_irq(itv->pdev->irq, ivtv_irq_handler,
1264 IRQF_SHARED | IRQF_DISABLED, itv->v4l2_dev.name, (void *)itv); 1264 IRQF_SHARED, itv->v4l2_dev.name, (void *)itv);
1265 if (retval) { 1265 if (retval) {
1266 IVTV_ERR("Failed to register irq %d\n", retval); 1266 IVTV_ERR("Failed to register irq %d\n", retval);
1267 goto free_i2c; 1267 goto free_i2c;
diff --git a/drivers/media/pci/mantis/mantis_pci.c b/drivers/media/pci/mantis/mantis_pci.c
index a846036ea022..9e89e045213a 100644
--- a/drivers/media/pci/mantis/mantis_pci.c
+++ b/drivers/media/pci/mantis/mantis_pci.c
@@ -143,7 +143,6 @@ fail1:
143 143
144fail0: 144fail0:
145 dprintk(MANTIS_ERROR, 1, "ERROR: <%d> exiting", ret); 145 dprintk(MANTIS_ERROR, 1, "ERROR: <%d> exiting", ret);
146 pci_set_drvdata(pdev, NULL);
147 return ret; 146 return ret;
148} 147}
149EXPORT_SYMBOL_GPL(mantis_pci_init); 148EXPORT_SYMBOL_GPL(mantis_pci_init);
@@ -161,7 +160,6 @@ void mantis_pci_exit(struct mantis_pci *mantis)
161 } 160 }
162 161
163 pci_disable_device(pdev); 162 pci_disable_device(pdev);
164 pci_set_drvdata(pdev, NULL);
165} 163}
166EXPORT_SYMBOL_GPL(mantis_pci_exit); 164EXPORT_SYMBOL_GPL(mantis_pci_exit);
167 165
diff --git a/drivers/media/pci/meye/meye.c b/drivers/media/pci/meye/meye.c
index 2381b05432e6..54d5c821007c 100644
--- a/drivers/media/pci/meye/meye.c
+++ b/drivers/media/pci/meye/meye.c
@@ -1698,7 +1698,7 @@ static int meye_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
1698 1698
1699 meye.mchip_irq = pcidev->irq; 1699 meye.mchip_irq = pcidev->irq;
1700 if (request_irq(meye.mchip_irq, meye_irq, 1700 if (request_irq(meye.mchip_irq, meye_irq,
1701 IRQF_DISABLED | IRQF_SHARED, "meye", meye_irq)) { 1701 IRQF_SHARED, "meye", meye_irq)) {
1702 v4l2_err(v4l2_dev, "request_irq failed\n"); 1702 v4l2_err(v4l2_dev, "request_irq failed\n");
1703 goto outreqirq; 1703 goto outreqirq;
1704 } 1704 }
diff --git a/drivers/media/pci/ngene/ngene-core.c b/drivers/media/pci/ngene/ngene-core.c
index 37ebc42392ad..970e83308525 100644
--- a/drivers/media/pci/ngene/ngene-core.c
+++ b/drivers/media/pci/ngene/ngene-core.c
@@ -1622,7 +1622,7 @@ static void ngene_unlink(struct ngene *dev)
1622 1622
1623void ngene_shutdown(struct pci_dev *pdev) 1623void ngene_shutdown(struct pci_dev *pdev)
1624{ 1624{
1625 struct ngene *dev = (struct ngene *)pci_get_drvdata(pdev); 1625 struct ngene *dev = pci_get_drvdata(pdev);
1626 1626
1627 if (!dev || !shutdown_workaround) 1627 if (!dev || !shutdown_workaround)
1628 return; 1628 return;
@@ -1648,7 +1648,6 @@ void ngene_remove(struct pci_dev *pdev)
1648 cxd_detach(dev); 1648 cxd_detach(dev);
1649 ngene_stop(dev); 1649 ngene_stop(dev);
1650 ngene_release_buffers(dev); 1650 ngene_release_buffers(dev);
1651 pci_set_drvdata(pdev, NULL);
1652 pci_disable_device(pdev); 1651 pci_disable_device(pdev);
1653} 1652}
1654 1653
@@ -1702,6 +1701,5 @@ fail1:
1702 ngene_release_buffers(dev); 1701 ngene_release_buffers(dev);
1703fail0: 1702fail0:
1704 pci_disable_device(pci_dev); 1703 pci_disable_device(pci_dev);
1705 pci_set_drvdata(pci_dev, NULL);
1706 return stat; 1704 return stat;
1707} 1705}
diff --git a/drivers/media/pci/pluto2/pluto2.c b/drivers/media/pci/pluto2/pluto2.c
index 493828500055..8164d74b46a4 100644
--- a/drivers/media/pci/pluto2/pluto2.c
+++ b/drivers/media/pci/pluto2/pluto2.c
@@ -736,7 +736,6 @@ err_pci_release_regions:
736err_pci_disable_device: 736err_pci_disable_device:
737 pci_disable_device(pdev); 737 pci_disable_device(pdev);
738err_kfree: 738err_kfree:
739 pci_set_drvdata(pdev, NULL);
740 kfree(pluto); 739 kfree(pluto);
741 goto out; 740 goto out;
742} 741}
@@ -765,7 +764,6 @@ static void pluto2_remove(struct pci_dev *pdev)
765 pci_iounmap(pdev, pluto->io_mem); 764 pci_iounmap(pdev, pluto->io_mem);
766 pci_release_regions(pdev); 765 pci_release_regions(pdev);
767 pci_disable_device(pdev); 766 pci_disable_device(pdev);
768 pci_set_drvdata(pdev, NULL);
769 kfree(pluto); 767 kfree(pluto);
770} 768}
771 769
diff --git a/drivers/media/pci/pt1/pt1.c b/drivers/media/pci/pt1/pt1.c
index 75ce14229e03..db887b0c37b1 100644
--- a/drivers/media/pci/pt1/pt1.c
+++ b/drivers/media/pci/pt1/pt1.c
@@ -1076,7 +1076,6 @@ static void pt1_remove(struct pci_dev *pdev)
1076 pt1_update_power(pt1); 1076 pt1_update_power(pt1);
1077 pt1_cleanup_adapters(pt1); 1077 pt1_cleanup_adapters(pt1);
1078 i2c_del_adapter(&pt1->i2c_adap); 1078 i2c_del_adapter(&pt1->i2c_adap);
1079 pci_set_drvdata(pdev, NULL);
1080 kfree(pt1); 1079 kfree(pt1);
1081 pci_iounmap(pdev, regs); 1080 pci_iounmap(pdev, regs);
1082 pci_release_regions(pdev); 1081 pci_release_regions(pdev);
@@ -1198,7 +1197,6 @@ err_i2c_del_adapter:
1198err_pt1_cleanup_adapters: 1197err_pt1_cleanup_adapters:
1199 pt1_cleanup_adapters(pt1); 1198 pt1_cleanup_adapters(pt1);
1200err_kfree: 1199err_kfree:
1201 pci_set_drvdata(pdev, NULL);
1202 kfree(pt1); 1200 kfree(pt1);
1203err_pci_iounmap: 1201err_pci_iounmap:
1204 pci_iounmap(pdev, regs); 1202 pci_iounmap(pdev, regs);
diff --git a/drivers/media/pci/saa7134/saa7134-alsa.c b/drivers/media/pci/saa7134/saa7134-alsa.c
index dbcdfbf8aed0..dd67c8a400cc 100644
--- a/drivers/media/pci/saa7134/saa7134-alsa.c
+++ b/drivers/media/pci/saa7134/saa7134-alsa.c
@@ -1096,7 +1096,7 @@ static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum)
1096 1096
1097 1097
1098 err = request_irq(dev->pci->irq, saa7134_alsa_irq, 1098 err = request_irq(dev->pci->irq, saa7134_alsa_irq,
1099 IRQF_SHARED | IRQF_DISABLED, dev->name, 1099 IRQF_SHARED, dev->name,
1100 (void*) &dev->dmasound); 1100 (void*) &dev->dmasound);
1101 1101
1102 if (err < 0) { 1102 if (err < 0) {
diff --git a/drivers/media/pci/saa7134/saa7134-core.c b/drivers/media/pci/saa7134/saa7134-core.c
index 45f0aca597ae..27d7ee709c58 100644
--- a/drivers/media/pci/saa7134/saa7134-core.c
+++ b/drivers/media/pci/saa7134/saa7134-core.c
@@ -992,7 +992,7 @@ static int saa7134_initdev(struct pci_dev *pci_dev,
992 992
993 /* get irq */ 993 /* get irq */
994 err = request_irq(pci_dev->irq, saa7134_irq, 994 err = request_irq(pci_dev->irq, saa7134_irq,
995 IRQF_SHARED | IRQF_DISABLED, dev->name, dev); 995 IRQF_SHARED, dev->name, dev);
996 if (err < 0) { 996 if (err < 0) {
997 printk(KERN_ERR "%s: can't get IRQ %d\n", 997 printk(KERN_ERR "%s: can't get IRQ %d\n",
998 dev->name,pci_dev->irq); 998 dev->name,pci_dev->irq);
diff --git a/drivers/media/pci/saa7164/saa7164-core.c b/drivers/media/pci/saa7164/saa7164-core.c
index d37ee37aaefe..57ef5456f1e8 100644
--- a/drivers/media/pci/saa7164/saa7164-core.c
+++ b/drivers/media/pci/saa7164/saa7164-core.c
@@ -1232,7 +1232,7 @@ static int saa7164_initdev(struct pci_dev *pci_dev,
1232 } 1232 }
1233 1233
1234 err = request_irq(pci_dev->irq, saa7164_irq, 1234 err = request_irq(pci_dev->irq, saa7164_irq,
1235 IRQF_SHARED | IRQF_DISABLED, dev->name, dev); 1235 IRQF_SHARED, dev->name, dev);
1236 if (err < 0) { 1236 if (err < 0) {
1237 printk(KERN_ERR "%s: can't get IRQ %d\n", dev->name, 1237 printk(KERN_ERR "%s: can't get IRQ %d\n", dev->name,
1238 pci_dev->irq); 1238 pci_dev->irq);
@@ -1439,7 +1439,6 @@ static void saa7164_finidev(struct pci_dev *pci_dev)
1439 1439
1440 /* unregister stuff */ 1440 /* unregister stuff */
1441 free_irq(pci_dev->irq, dev); 1441 free_irq(pci_dev->irq, dev);
1442 pci_set_drvdata(pci_dev, NULL);
1443 1442
1444 mutex_lock(&devlist); 1443 mutex_lock(&devlist);
1445 list_del(&dev->devlist); 1444 list_del(&dev->devlist);
diff --git a/drivers/media/pci/zoran/zoran_card.c b/drivers/media/pci/zoran/zoran_card.c
index 923d59a321f8..cec5b7553f28 100644
--- a/drivers/media/pci/zoran/zoran_card.c
+++ b/drivers/media/pci/zoran/zoran_card.c
@@ -1293,7 +1293,7 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1293 } 1293 }
1294 1294
1295 result = request_irq(zr->pci_dev->irq, zoran_irq, 1295 result = request_irq(zr->pci_dev->irq, zoran_irq,
1296 IRQF_SHARED | IRQF_DISABLED, ZR_DEVNAME(zr), zr); 1296 IRQF_SHARED, ZR_DEVNAME(zr), zr);
1297 if (result < 0) { 1297 if (result < 0) {
1298 if (result == -EINVAL) { 1298 if (result == -EINVAL) {
1299 dprintk(1, 1299 dprintk(1,