aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx88')
-rw-r--r--drivers/media/video/cx88/Kconfig109
-rw-r--r--drivers/media/video/cx88/Makefile7
-rw-r--r--drivers/media/video/cx88/cx88-blackbird.c2
-rw-r--r--drivers/media/video/cx88/cx88-cards.c161
-rw-r--r--drivers/media/video/cx88/cx88-core.c13
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c330
-rw-r--r--drivers/media/video/cx88/cx88-i2c.c13
-rw-r--r--drivers/media/video/cx88/cx88-input.c19
-rw-r--r--drivers/media/video/cx88/cx88-tvaudio.c5
-rw-r--r--drivers/media/video/cx88/cx88-video.c7
-rw-r--r--drivers/media/video/cx88/cx88.h5
11 files changed, 379 insertions, 292 deletions
diff --git a/drivers/media/video/cx88/Kconfig b/drivers/media/video/cx88/Kconfig
index 7a94e6a11927..51d68f32aa06 100644
--- a/drivers/media/video/cx88/Kconfig
+++ b/drivers/media/video/cx88/Kconfig
@@ -1,7 +1,3 @@
1config VIDEO_CX88_VP3054
2 tristate
3 depends on VIDEO_CX88_DVB && DVB_MT352
4
5config VIDEO_CX88 1config VIDEO_CX88
6 tristate "Conexant 2388x (bt878 successor) support" 2 tristate "Conexant 2388x (bt878 successor) support"
7 depends on VIDEO_DEV && PCI && I2C 3 depends on VIDEO_DEV && PCI && I2C
@@ -52,6 +48,14 @@ config VIDEO_CX88_DVB
52 depends on VIDEO_CX88 && DVB_CORE 48 depends on VIDEO_CX88 && DVB_CORE
53 select VIDEO_BUF_DVB 49 select VIDEO_BUF_DVB
54 select DVB_PLL 50 select DVB_PLL
51 select DVB_MT352 if !DVB_FE_CUSTOMISE
52 select DVB_ZL10353 if !DVB_FE_CUSTOMISE
53 select DVB_OR51132 if !DVB_FE_CUSTOMISE
54 select DVB_CX22702 if !DVB_FE_CUSTOMISE
55 select DVB_LGDT330X if !DVB_FE_CUSTOMISE
56 select DVB_NXT200X if !DVB_FE_CUSTOMISE
57 select DVB_CX24123 if !DVB_FE_CUSTOMISE
58 select DVB_ISL6421 if !DVB_FE_CUSTOMISE
55 ---help--- 59 ---help---
56 This adds support for DVB/ATSC cards based on the 60 This adds support for DVB/ATSC cards based on the
57 Conexant 2388x chip. 61 Conexant 2388x chip.
@@ -59,101 +63,12 @@ config VIDEO_CX88_DVB
59 To compile this driver as a module, choose M here: the 63 To compile this driver as a module, choose M here: the
60 module will be called cx88-dvb. 64 module will be called cx88-dvb.
61 65
62 You must also select one or more DVB/ATSC demodulators. 66config VIDEO_CX88_VP3054
63 If you are unsure which you need, choose all of them. 67 tristate "VP-3054 Secondary I2C Bus Support"
64 68 default m
65config VIDEO_CX88_DVB_ALL_FRONTENDS 69 depends on VIDEO_CX88_DVB && DVB_MT352
66 bool "Build all supported frontends for cx2388x based TV cards"
67 default y
68 depends on VIDEO_CX88_DVB
69 select DVB_MT352
70 select VIDEO_CX88_VP3054
71 select DVB_ZL10353
72 select DVB_OR51132
73 select DVB_CX22702
74 select DVB_LGDT330X
75 select DVB_NXT200X
76 select DVB_CX24123
77 select DVB_ISL6421
78 ---help---
79 This builds cx88-dvb with all currently supported frontend
80 demodulators. If you wish to tweak your configuration, and
81 only include support for the hardware that you need, choose N here.
82
83 If you are unsure, choose Y.
84
85config VIDEO_CX88_DVB_MT352
86 bool "Zarlink MT352 DVB-T Support"
87 default y
88 depends on VIDEO_CX88_DVB && !VIDEO_CX88_DVB_ALL_FRONTENDS
89 select DVB_MT352
90 ---help---
91 This adds DVB-T support for cards based on the
92 Connexant 2388x chip and the MT352 demodulator.
93
94config VIDEO_CX88_DVB_VP3054
95 bool "VP-3054 Secondary I2C Bus Support"
96 default y
97 depends on VIDEO_CX88_DVB_MT352
98 select VIDEO_CX88_VP3054
99 ---help--- 70 ---help---
100 This adds DVB-T support for cards based on the 71 This adds DVB-T support for cards based on the
101 Connexant 2388x chip and the MT352 demodulator, 72 Connexant 2388x chip and the MT352 demodulator,
102 which also require support for the VP-3054 73 which also require support for the VP-3054
103 Secondary I2C bus, such at DNTV Live! DVB-T Pro. 74 Secondary I2C bus, such at DNTV Live! DVB-T Pro.
104
105config VIDEO_CX88_DVB_ZL10353
106 bool "Zarlink ZL10353 DVB-T Support"
107 default y
108 depends on VIDEO_CX88_DVB && !VIDEO_CX88_DVB_ALL_FRONTENDS
109 select DVB_ZL10353
110 ---help---
111 This adds DVB-T support for cards based on the
112 Connexant 2388x chip and the ZL10353 demodulator,
113 successor to the Zarlink MT352.
114
115config VIDEO_CX88_DVB_OR51132
116 bool "OR51132 ATSC Support"
117 default y
118 depends on VIDEO_CX88_DVB && !VIDEO_CX88_DVB_ALL_FRONTENDS
119 select DVB_OR51132
120 ---help---
121 This adds ATSC 8VSB and QAM64/256 support for cards based on the
122 Connexant 2388x chip and the OR51132 demodulator.
123
124config VIDEO_CX88_DVB_CX22702
125 bool "Conexant CX22702 DVB-T Support"
126 default y
127 depends on VIDEO_CX88_DVB && !VIDEO_CX88_DVB_ALL_FRONTENDS
128 select DVB_CX22702
129 ---help---
130 This adds DVB-T support for cards based on the
131 Connexant 2388x chip and the CX22702 demodulator.
132
133config VIDEO_CX88_DVB_LGDT330X
134 bool "LG Electronics DT3302/DT3303 ATSC Support"
135 default y
136 depends on VIDEO_CX88_DVB && !VIDEO_CX88_DVB_ALL_FRONTENDS
137 select DVB_LGDT330X
138 ---help---
139 This adds ATSC 8VSB and QAM64/256 support for cards based on the
140 Connexant 2388x chip and the LGDT3302/LGDT3303 demodulator.
141
142config VIDEO_CX88_DVB_NXT200X
143 bool "NXT2002/NXT2004 ATSC Support"
144 default y
145 depends on VIDEO_CX88_DVB && !VIDEO_CX88_DVB_ALL_FRONTENDS
146 select DVB_NXT200X
147 ---help---
148 This adds ATSC 8VSB and QAM64/256 support for cards based on the
149 Connexant 2388x chip and the NXT2002/NXT2004 demodulator.
150
151config VIDEO_CX88_DVB_CX24123
152 bool "Conexant CX24123 DVB-S Support"
153 default y
154 depends on VIDEO_CX88_DVB && !VIDEO_CX88_DVB_ALL_FRONTENDS
155 select DVB_CX24123
156 select DVB_ISL6421
157 ---help---
158 This adds DVB-S support for cards based on the
159 Connexant 2388x chip and the CX24123 demodulator.
diff --git a/drivers/media/video/cx88/Makefile b/drivers/media/video/cx88/Makefile
index 352b919f30c4..639c3b659d0e 100644
--- a/drivers/media/video/cx88/Makefile
+++ b/drivers/media/video/cx88/Makefile
@@ -14,13 +14,6 @@ EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core
14EXTRA_CFLAGS += -Idrivers/media/dvb/frontends 14EXTRA_CFLAGS += -Idrivers/media/dvb/frontends
15 15
16extra-cflags-$(CONFIG_VIDEO_BUF_DVB) += -DHAVE_VIDEO_BUF_DVB=1 16extra-cflags-$(CONFIG_VIDEO_BUF_DVB) += -DHAVE_VIDEO_BUF_DVB=1
17extra-cflags-$(CONFIG_DVB_CX22702) += -DHAVE_CX22702=1
18extra-cflags-$(CONFIG_DVB_OR51132) += -DHAVE_OR51132=1
19extra-cflags-$(CONFIG_DVB_LGDT330X) += -DHAVE_LGDT330X=1
20extra-cflags-$(CONFIG_DVB_MT352) += -DHAVE_MT352=1
21extra-cflags-$(CONFIG_DVB_ZL10353) += -DHAVE_ZL10353=1
22extra-cflags-$(CONFIG_DVB_NXT200X) += -DHAVE_NXT200X=1
23extra-cflags-$(CONFIG_DVB_CX24123) += -DHAVE_CX24123=1
24extra-cflags-$(CONFIG_VIDEO_CX88_VP3054)+= -DHAVE_VP3054_I2C=1 17extra-cflags-$(CONFIG_VIDEO_CX88_VP3054)+= -DHAVE_VP3054_I2C=1
25 18
26EXTRA_CFLAGS += $(extra-cflags-y) $(extra-cflags-m) 19EXTRA_CFLAGS += $(extra-cflags-y) $(extra-cflags-m)
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c
index b60177f173c3..a7921f9d45d8 100644
--- a/drivers/media/video/cx88/cx88-blackbird.c
+++ b/drivers/media/video/cx88/cx88-blackbird.c
@@ -1160,8 +1160,10 @@ static struct pci_driver blackbird_pci_driver = {
1160 .id_table = cx8802_pci_tbl, 1160 .id_table = cx8802_pci_tbl,
1161 .probe = blackbird_probe, 1161 .probe = blackbird_probe,
1162 .remove = __devexit_p(blackbird_remove), 1162 .remove = __devexit_p(blackbird_remove),
1163#ifdef CONFIG_PM
1163 .suspend = cx8802_suspend_common, 1164 .suspend = cx8802_suspend_common,
1164 .resume = cx8802_resume_common, 1165 .resume = cx8802_resume_common,
1166#endif
1165}; 1167};
1166 1168
1167static int blackbird_init(void) 1169static int blackbird_init(void)
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
index 14bd4863d157..6214eb823b29 100644
--- a/drivers/media/video/cx88/cx88-cards.c
+++ b/drivers/media/video/cx88/cx88-cards.c
@@ -1041,11 +1041,11 @@ struct cx88_board cx88_boards[] = {
1041 .input = {{ 1041 .input = {{
1042 .type = CX88_VMUX_COMPOSITE1, 1042 .type = CX88_VMUX_COMPOSITE1,
1043 .vmux = 1, 1043 .vmux = 1,
1044 .gpio0 = 0x000027df, 1044 .gpio0 = 0x000067df,
1045 },{ 1045 },{
1046 .type = CX88_VMUX_SVIDEO, 1046 .type = CX88_VMUX_SVIDEO,
1047 .vmux = 2, 1047 .vmux = 2,
1048 .gpio0 = 0x000027df, 1048 .gpio0 = 0x000067df,
1049 }}, 1049 }},
1050 .dvb = 1, 1050 .dvb = 1,
1051 }, 1051 },
@@ -1209,6 +1209,100 @@ struct cx88_board cx88_boards[] = {
1209 }}, 1209 }},
1210 .dvb = 1, 1210 .dvb = 1,
1211 }, 1211 },
1212 [CX88_BOARD_HAUPPAUGE_HVR3000] = {
1213 /* FIXME: Add dvb & radio support */
1214 .name = "Hauppauge WinTV-HVR3000 TriMode Analog/DVB-S/DVB-T",
1215 .tuner_type = TUNER_PHILIPS_FMD1216ME_MK3,
1216 .radio_type = UNSET,
1217 .tuner_addr = ADDR_UNSET,
1218 .radio_addr = ADDR_UNSET,
1219 .tda9887_conf = TDA9887_PRESENT,
1220 .input = {{
1221 .type = CX88_VMUX_TELEVISION,
1222 .vmux = 0,
1223 .gpio0 = 0x84bf,
1224 },{
1225 .type = CX88_VMUX_COMPOSITE1,
1226 .vmux = 1,
1227 .gpio0 = 0x84bf,
1228 },{
1229 .type = CX88_VMUX_SVIDEO,
1230 .vmux = 2,
1231 .gpio0 = 0x84bf,
1232 }},
1233 },
1234 [CX88_BOARD_NORWOOD_MICRO] = {
1235 .name = "Norwood Micro TV Tuner",
1236 .tuner_type = TUNER_TNF_5335MF,
1237 .radio_type = UNSET,
1238 .tuner_addr = ADDR_UNSET,
1239 .radio_addr = ADDR_UNSET,
1240 .input = {{
1241 .type = CX88_VMUX_TELEVISION,
1242 .vmux = 0,
1243 .gpio0 = 0x0709,
1244 },{
1245 .type = CX88_VMUX_COMPOSITE1,
1246 .vmux = 1,
1247 .gpio0 = 0x070b,
1248 },{
1249 .type = CX88_VMUX_SVIDEO,
1250 .vmux = 2,
1251 .gpio0 = 0x070b,
1252 }},
1253 },
1254 [CX88_BOARD_TE_DTV_250_OEM_SWANN] = {
1255 .name = "Shenzhen Tungsten Ages Tech TE-DTV-250 / Swann OEM",
1256 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1257 .radio_type = UNSET,
1258 .tuner_addr = ADDR_UNSET,
1259 .radio_addr = ADDR_UNSET,
1260 .input = {{
1261 .type = CX88_VMUX_TELEVISION,
1262 .vmux = 0,
1263 .gpio0 = 0x003fffff,
1264 .gpio1 = 0x00e00000,
1265 .gpio2 = 0x003fffff,
1266 .gpio3 = 0x02000000,
1267 },{
1268 .type = CX88_VMUX_COMPOSITE1,
1269 .vmux = 1,
1270 .gpio0 = 0x003fffff,
1271 .gpio1 = 0x00e00000,
1272 .gpio2 = 0x003fffff,
1273 .gpio3 = 0x02000000,
1274 },{
1275 .type = CX88_VMUX_SVIDEO,
1276 .vmux = 2,
1277 .gpio0 = 0x003fffff,
1278 .gpio1 = 0x00e00000,
1279 .gpio2 = 0x003fffff,
1280 .gpio3 = 0x02000000,
1281 }},
1282 },
1283 [CX88_BOARD_HAUPPAUGE_HVR1300] = {
1284 .name = "Hauppauge WinTV-HVR1300 DVB-T/Hybrid MPEG Encoder",
1285 .tuner_type = TUNER_PHILIPS_FMD1216ME_MK3,
1286 .radio_type = UNSET,
1287 .tuner_addr = ADDR_UNSET,
1288 .radio_addr = ADDR_UNSET,
1289 .tda9887_conf = TDA9887_PRESENT,
1290 .input = {{
1291 .type = CX88_VMUX_TELEVISION,
1292 .vmux = 0,
1293 .gpio0 = 0xe780,
1294 },{
1295 .type = CX88_VMUX_COMPOSITE1,
1296 .vmux = 1,
1297 .gpio0 = 0xe780,
1298 },{
1299 .type = CX88_VMUX_SVIDEO,
1300 .vmux = 2,
1301 .gpio0 = 0xe780,
1302 }},
1303 /* fixme: Add radio support */
1304 .dvb = 1,
1305 },
1212}; 1306};
1213const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards); 1307const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards);
1214 1308
@@ -1254,7 +1348,7 @@ struct cx88_subid cx88_subids[] = {
1254 .card = CX88_BOARD_LEADTEK_PVR2000, 1348 .card = CX88_BOARD_LEADTEK_PVR2000,
1255 },{ 1349 },{
1256 .subvendor = 0x107d, 1350 .subvendor = 0x107d,
1257 .subdevice = 0x663C, 1351 .subdevice = 0x663c,
1258 .card = CX88_BOARD_LEADTEK_PVR2000, 1352 .card = CX88_BOARD_LEADTEK_PVR2000,
1259 },{ 1353 },{
1260 .subvendor = 0x1461, 1354 .subvendor = 0x1461,
@@ -1458,6 +1552,35 @@ struct cx88_subid cx88_subids[] = {
1458 .subvendor = 0x14f1, 1552 .subvendor = 0x14f1,
1459 .subdevice = 0x0084, 1553 .subdevice = 0x0084,
1460 .card = CX88_BOARD_GENIATECH_DVBS, 1554 .card = CX88_BOARD_GENIATECH_DVBS,
1555 },{
1556 .subvendor = 0x0070,
1557 .subdevice = 0x1404,
1558 .card = CX88_BOARD_HAUPPAUGE_HVR3000,
1559 },{
1560 .subvendor = 0x1461,
1561 .subdevice = 0xc111, /* AverMedia M150-D */
1562 /* This board is known to work with the ASUS PVR416 config */
1563 .card = CX88_BOARD_ASUS_PVR_416,
1564 },{
1565 .subvendor = 0xc180,
1566 .subdevice = 0xc980,
1567 .card = CX88_BOARD_TE_DTV_250_OEM_SWANN,
1568 },{
1569 .subvendor = 0x0070,
1570 .subdevice = 0x9600,
1571 .card = CX88_BOARD_HAUPPAUGE_HVR1300,
1572 },{
1573 .subvendor = 0x0070,
1574 .subdevice = 0x9601,
1575 .card = CX88_BOARD_HAUPPAUGE_HVR1300,
1576 },{
1577 .subvendor = 0x0070,
1578 .subdevice = 0x9602,
1579 .card = CX88_BOARD_HAUPPAUGE_HVR1300,
1580 },{
1581 .subvendor = 0x107d,
1582 .subdevice = 0x6632,
1583 .card = CX88_BOARD_LEADTEK_PVR2000,
1461 }, 1584 },
1462}; 1585};
1463const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids); 1586const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids);
@@ -1501,6 +1624,7 @@ static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data)
1501 /* Make sure we support the board model */ 1624 /* Make sure we support the board model */
1502 switch (tv.model) 1625 switch (tv.model)
1503 { 1626 {
1627 case 14569: /* WinTV-HVR3000 (OEM, no IR, no back panel video) */
1504 case 28552: /* WinTV-PVR 'Roslyn' (No IR) */ 1628 case 28552: /* WinTV-PVR 'Roslyn' (No IR) */
1505 case 34519: /* WinTV-PCI-FM */ 1629 case 34519: /* WinTV-PCI-FM */
1506 case 90002: /* Nova-T-PCI (9002) */ 1630 case 90002: /* Nova-T-PCI (9002) */
@@ -1512,6 +1636,11 @@ static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data)
1512 case 92000: /* Nova-SE2 (OEM, No Video or IR) */ 1636 case 92000: /* Nova-SE2 (OEM, No Video or IR) */
1513 case 94009: /* WinTV-HVR1100 (Video and IR Retail) */ 1637 case 94009: /* WinTV-HVR1100 (Video and IR Retail) */
1514 case 94501: /* WinTV-HVR1100 (Video and IR OEM) */ 1638 case 94501: /* WinTV-HVR1100 (Video and IR OEM) */
1639 case 96009: /* WinTV-HVR1300 (PAL Video, MPEG Video and IR RX) */
1640 case 96019: /* WinTV-HVR1300 (PAL Video, MPEG Video and IR RX/TX) */
1641 case 96559: /* WinTV-HVR1300 (PAL Video, MPEG Video no IR) */
1642 case 96569: /* WinTV-HVR1300 () */
1643 case 96659: /* WinTV-HVR1300 () */
1515 case 98559: /* WinTV-HVR1100LP (Video no IR, Retail - Low Profile) */ 1644 case 98559: /* WinTV-HVR1100LP (Video no IR, Retail - Low Profile) */
1516 /* known */ 1645 /* known */
1517 break; 1646 break;
@@ -1638,6 +1767,22 @@ void cx88_card_list(struct cx88_core *core, struct pci_dev *pci)
1638 core->name, i, cx88_boards[i].name); 1767 core->name, i, cx88_boards[i].name);
1639} 1768}
1640 1769
1770void cx88_card_setup_pre_i2c(struct cx88_core *core)
1771{
1772 switch (core->board) {
1773 case CX88_BOARD_HAUPPAUGE_HVR1300:
1774 /* Bring the 702 demod up before i2c scanning/attach or devices are hidden */
1775 /* We leave here with the 702 on the bus */
1776 cx_write(MO_GP0_IO, 0x0000e780);
1777 udelay(1000);
1778 cx_clear(MO_GP0_IO, 0x00000080);
1779 udelay(50);
1780 cx_set(MO_GP0_IO, 0x00000080); /* 702 out of reset */
1781 udelay(1000);
1782 break;
1783 }
1784}
1785
1641void cx88_card_setup(struct cx88_core *core) 1786void cx88_card_setup(struct cx88_core *core)
1642{ 1787{
1643 static u8 eeprom[256]; 1788 static u8 eeprom[256];
@@ -1666,6 +1811,8 @@ void cx88_card_setup(struct cx88_core *core)
1666 case CX88_BOARD_HAUPPAUGE_DVB_T1: 1811 case CX88_BOARD_HAUPPAUGE_DVB_T1:
1667 case CX88_BOARD_HAUPPAUGE_HVR1100: 1812 case CX88_BOARD_HAUPPAUGE_HVR1100:
1668 case CX88_BOARD_HAUPPAUGE_HVR1100LP: 1813 case CX88_BOARD_HAUPPAUGE_HVR1100LP:
1814 case CX88_BOARD_HAUPPAUGE_HVR3000:
1815 case CX88_BOARD_HAUPPAUGE_HVR1300:
1669 if (0 == core->i2c_rc) 1816 if (0 == core->i2c_rc)
1670 hauppauge_eeprom(core,eeprom); 1817 hauppauge_eeprom(core,eeprom);
1671 break; 1818 break;
@@ -1673,9 +1820,15 @@ void cx88_card_setup(struct cx88_core *core)
1673 cx_write(MO_GP0_IO, 0x000007f8); 1820 cx_write(MO_GP0_IO, 0x000007f8);
1674 cx_write(MO_GP1_IO, 0x00000001); 1821 cx_write(MO_GP1_IO, 0x00000001);
1675 break; 1822 break;
1823 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL:
1824 /* GPIO0:6 is hooked to FX2 reset pin */
1825 cx_set(MO_GP0_IO, 0x00004040);
1826 cx_clear(MO_GP0_IO, 0x00000040);
1827 msleep(1000);
1828 cx_set(MO_GP0_IO, 0x00004040);
1829 /* FALLTHROUGH */
1676 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1: 1830 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
1677 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS: 1831 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS:
1678 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL:
1679 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID: 1832 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID:
1680 /* GPIO0:0 is hooked to mt352 reset pin */ 1833 /* GPIO0:0 is hooked to mt352 reset pin */
1681 cx_set(MO_GP0_IO, 0x00000101); 1834 cx_set(MO_GP0_IO, 0x00000101);
diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c
index 973d3f39b2d5..f379ede3049a 100644
--- a/drivers/media/video/cx88/cx88-core.c
+++ b/drivers/media/video/cx88/cx88-core.c
@@ -105,7 +105,7 @@ static u32* cx88_risc_field(u32 *rp, struct scatterlist *sglist,
105 *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset); 105 *(rp++)=cpu_to_le32(sg_dma_address(sg)+offset);
106 offset+=bpl; 106 offset+=bpl;
107 } else { 107 } else {
108 /* scanline needs to be splitted */ 108 /* scanline needs to be split */
109 todo = bpl; 109 todo = bpl;
110 *(rp++)=cpu_to_le32(RISC_WRITE|RISC_SOL| 110 *(rp++)=cpu_to_le32(RISC_WRITE|RISC_SOL|
111 (sg_dma_len(sg)-offset)); 111 (sg_dma_len(sg)-offset));
@@ -792,6 +792,11 @@ int cx88_start_audio_dma(struct cx88_core *core)
792{ 792{
793 /* constant 128 made buzz in analog Nicam-stereo for bigger fifo_size */ 793 /* constant 128 made buzz in analog Nicam-stereo for bigger fifo_size */
794 int bpl = cx88_sram_channels[SRAM_CH25].fifo_size/4; 794 int bpl = cx88_sram_channels[SRAM_CH25].fifo_size/4;
795
796 /* If downstream RISC is enabled, bail out; ALSA is managing DMA */
797 if (cx_read(MO_AUD_DMACNTRL) & 0x10)
798 return 0;
799
795 /* setup fifo + format */ 800 /* setup fifo + format */
796 cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH25], bpl, 0); 801 cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH25], bpl, 0);
797 cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH26], bpl, 0); 802 cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH26], bpl, 0);
@@ -801,11 +806,16 @@ int cx88_start_audio_dma(struct cx88_core *core)
801 806
802 /* start dma */ 807 /* start dma */
803 cx_write(MO_AUD_DMACNTRL, 0x0003); /* Up and Down fifo enable */ 808 cx_write(MO_AUD_DMACNTRL, 0x0003); /* Up and Down fifo enable */
809
804 return 0; 810 return 0;
805} 811}
806 812
807int cx88_stop_audio_dma(struct cx88_core *core) 813int cx88_stop_audio_dma(struct cx88_core *core)
808{ 814{
815 /* If downstream RISC is enabled, bail out; ALSA is managing DMA */
816 if (cx_read(MO_AUD_DMACNTRL) & 0x10)
817 return 0;
818
809 /* stop dma */ 819 /* stop dma */
810 cx_write(MO_AUD_DMACNTRL, 0x0000); 820 cx_write(MO_AUD_DMACNTRL, 0x0000);
811 821
@@ -1123,6 +1133,7 @@ struct cx88_core* cx88_core_get(struct pci_dev *pci)
1123 1133
1124 /* init hardware */ 1134 /* init hardware */
1125 cx88_reset(core); 1135 cx88_reset(core);
1136 cx88_card_setup_pre_i2c(core);
1126 cx88_i2c_init(core,pci); 1137 cx88_i2c_init(core,pci);
1127 cx88_call_i2c_clients (core, TUNER_SET_STANDBY, NULL); 1138 cx88_call_i2c_clients (core, TUNER_SET_STANDBY, NULL);
1128 cx88_card_setup(core); 1139 cx88_card_setup(core);
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index afde3789d702..c87041dee21e 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -33,32 +33,18 @@
33#include "dvb-pll.h" 33#include "dvb-pll.h"
34#include <media/v4l2-common.h> 34#include <media/v4l2-common.h>
35 35
36#ifdef HAVE_MT352 36#include "mt352.h"
37# include "mt352.h" 37#include "mt352_priv.h"
38# include "mt352_priv.h" 38#ifdef HAVE_VP3054_I2C
39# ifdef HAVE_VP3054_I2C 39# include "cx88-vp3054-i2c.h"
40# include "cx88-vp3054-i2c.h"
41# endif
42#endif
43#ifdef HAVE_ZL10353
44# include "zl10353.h"
45#endif
46#ifdef HAVE_CX22702
47# include "cx22702.h"
48#endif
49#ifdef HAVE_OR51132
50# include "or51132.h"
51#endif
52#ifdef HAVE_LGDT330X
53# include "lgdt330x.h"
54# include "lg_h06xf.h"
55#endif
56#ifdef HAVE_NXT200X
57# include "nxt200x.h"
58#endif
59#ifdef HAVE_CX24123
60# include "cx24123.h"
61#endif 40#endif
41#include "zl10353.h"
42#include "cx22702.h"
43#include "or51132.h"
44#include "lgdt330x.h"
45#include "lg_h06xf.h"
46#include "nxt200x.h"
47#include "cx24123.h"
62#include "isl6421.h" 48#include "isl6421.h"
63 49
64MODULE_DESCRIPTION("driver for cx2388x based DVB cards"); 50MODULE_DESCRIPTION("driver for cx2388x based DVB cards");
@@ -114,8 +100,6 @@ static struct videobuf_queue_ops dvb_qops = {
114}; 100};
115 101
116/* ------------------------------------------------------------------ */ 102/* ------------------------------------------------------------------ */
117
118#ifdef HAVE_MT352
119static int dvico_fusionhdtv_demod_init(struct dvb_frontend* fe) 103static int dvico_fusionhdtv_demod_init(struct dvb_frontend* fe)
120{ 104{
121 static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x39 }; 105 static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x39 };
@@ -181,7 +165,7 @@ static int dntv_live_dvbt_demod_init(struct dvb_frontend* fe)
181} 165}
182 166
183static struct mt352_config dvico_fusionhdtv = { 167static struct mt352_config dvico_fusionhdtv = {
184 .demod_address = 0x0F, 168 .demod_address = 0x0f,
185 .demod_init = dvico_fusionhdtv_demod_init, 169 .demod_init = dvico_fusionhdtv_demod_init,
186}; 170};
187 171
@@ -191,7 +175,7 @@ static struct mt352_config dntv_live_dvbt_config = {
191}; 175};
192 176
193static struct mt352_config dvico_fusionhdtv_dual = { 177static struct mt352_config dvico_fusionhdtv_dual = {
194 .demod_address = 0x0F, 178 .demod_address = 0x0f,
195 .demod_init = dvico_dual_demod_init, 179 .demod_init = dvico_dual_demod_init,
196}; 180};
197 181
@@ -266,8 +250,8 @@ static int dntv_live_dvbt_pro_tuner_set_params(struct dvb_frontend* fe,
266 if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) { 250 if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) {
267 251
268 printk(KERN_WARNING "cx88-dvb: %s error " 252 printk(KERN_WARNING "cx88-dvb: %s error "
269 "(addr %02x <- %02x, err = %i)\n", 253 "(addr %02x <- %02x, err = %i)\n",
270 __FUNCTION__, dev->core->pll_addr, buf[0], err); 254 __FUNCTION__, dev->core->pll_addr, buf[0], err);
271 if (err < 0) 255 if (err < 0)
272 return err; 256 return err;
273 else 257 else
@@ -283,9 +267,7 @@ static struct mt352_config dntv_live_dvbt_pro_config = {
283 .demod_init = dntv_live_dvbt_pro_demod_init, 267 .demod_init = dntv_live_dvbt_pro_demod_init,
284}; 268};
285#endif 269#endif
286#endif
287 270
288#ifdef HAVE_ZL10353
289static int dvico_hybrid_tuner_set_params(struct dvb_frontend *fe, 271static int dvico_hybrid_tuner_set_params(struct dvb_frontend *fe,
290 struct dvb_frontend_parameters *params) 272 struct dvb_frontend_parameters *params)
291{ 273{
@@ -304,8 +286,8 @@ static int dvico_hybrid_tuner_set_params(struct dvb_frontend *fe,
304 fe->ops.i2c_gate_ctrl(fe, 1); 286 fe->ops.i2c_gate_ctrl(fe, 1);
305 if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) { 287 if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) {
306 printk(KERN_WARNING "cx88-dvb: %s error " 288 printk(KERN_WARNING "cx88-dvb: %s error "
307 "(addr %02x <- %02x, err = %i)\n", 289 "(addr %02x <- %02x, err = %i)\n",
308 __FUNCTION__, pllbuf[0], pllbuf[1], err); 290 __FUNCTION__, pllbuf[0], pllbuf[1], err);
309 if (err < 0) 291 if (err < 0)
310 return err; 292 return err;
311 else 293 else
@@ -316,16 +298,14 @@ static int dvico_hybrid_tuner_set_params(struct dvb_frontend *fe,
316} 298}
317 299
318static struct zl10353_config dvico_fusionhdtv_hybrid = { 300static struct zl10353_config dvico_fusionhdtv_hybrid = {
319 .demod_address = 0x0F, 301 .demod_address = 0x0f,
320 .no_tuner = 1, 302 .no_tuner = 1,
321}; 303};
322 304
323static struct zl10353_config dvico_fusionhdtv_plus_v1_1 = { 305static struct zl10353_config dvico_fusionhdtv_plus_v1_1 = {
324 .demod_address = 0x0F, 306 .demod_address = 0x0f,
325}; 307};
326#endif
327 308
328#ifdef HAVE_CX22702
329static struct cx22702_config connexant_refboard_config = { 309static struct cx22702_config connexant_refboard_config = {
330 .demod_address = 0x43, 310 .demod_address = 0x43,
331 .output_mode = CX22702_SERIAL_OUTPUT, 311 .output_mode = CX22702_SERIAL_OUTPUT,
@@ -339,9 +319,11 @@ static struct cx22702_config hauppauge_hvr1100_config = {
339 .demod_address = 0x63, 319 .demod_address = 0x63,
340 .output_mode = CX22702_SERIAL_OUTPUT, 320 .output_mode = CX22702_SERIAL_OUTPUT,
341}; 321};
342#endif 322static struct cx22702_config hauppauge_hvr1300_config = {
323 .demod_address = 0x63,
324 .output_mode = CX22702_SERIAL_OUTPUT,
325};
343 326
344#ifdef HAVE_OR51132
345static int or51132_set_ts_param(struct dvb_frontend* fe, 327static int or51132_set_ts_param(struct dvb_frontend* fe,
346 int is_punctured) 328 int is_punctured)
347{ 329{
@@ -351,12 +333,10 @@ static int or51132_set_ts_param(struct dvb_frontend* fe,
351} 333}
352 334
353static struct or51132_config pchdtv_hd3000 = { 335static struct or51132_config pchdtv_hd3000 = {
354 .demod_address = 0x15, 336 .demod_address = 0x15,
355 .set_ts_params = or51132_set_ts_param, 337 .set_ts_params = or51132_set_ts_param,
356}; 338};
357#endif
358 339
359#ifdef HAVE_LGDT330X
360static int lgdt3302_tuner_set_params(struct dvb_frontend* fe, 340static int lgdt3302_tuner_set_params(struct dvb_frontend* fe,
361 struct dvb_frontend_parameters* params) 341 struct dvb_frontend_parameters* params)
362{ 342{
@@ -373,14 +353,14 @@ static int lgdt3302_tuner_set_params(struct dvb_frontend* fe,
373 353
374 dvb_pll_configure(core->pll_desc, buf, params->frequency, 0); 354 dvb_pll_configure(core->pll_desc, buf, params->frequency, 0);
375 dprintk(1, "%s: tuner at 0x%02x bytes: 0x%02x 0x%02x 0x%02x 0x%02x\n", 355 dprintk(1, "%s: tuner at 0x%02x bytes: 0x%02x 0x%02x 0x%02x 0x%02x\n",
376 __FUNCTION__, msg.addr, buf[0],buf[1],buf[2],buf[3]); 356 __FUNCTION__, msg.addr, buf[0],buf[1],buf[2],buf[3]);
377 357
378 if (fe->ops.i2c_gate_ctrl) 358 if (fe->ops.i2c_gate_ctrl)
379 fe->ops.i2c_gate_ctrl(fe, 1); 359 fe->ops.i2c_gate_ctrl(fe, 1);
380 if ((err = i2c_transfer(&core->i2c_adap, &msg, 1)) != 1) { 360 if ((err = i2c_transfer(&core->i2c_adap, &msg, 1)) != 1) {
381 printk(KERN_WARNING "cx88-dvb: %s error " 361 printk(KERN_WARNING "cx88-dvb: %s error "
382 "(addr %02x <- %02x, err = %i)\n", 362 "(addr %02x <- %02x, err = %i)\n",
383 __FUNCTION__, buf[0], buf[1], err); 363 __FUNCTION__, buf[0], buf[1], err);
384 if (err < 0) 364 if (err < 0)
385 return err; 365 return err;
386 else 366 else
@@ -425,28 +405,26 @@ static int lgdt330x_set_ts_param(struct dvb_frontend* fe, int is_punctured)
425} 405}
426 406
427static struct lgdt330x_config fusionhdtv_3_gold = { 407static struct lgdt330x_config fusionhdtv_3_gold = {
428 .demod_address = 0x0e, 408 .demod_address = 0x0e,
429 .demod_chip = LGDT3302, 409 .demod_chip = LGDT3302,
430 .serial_mpeg = 0x04, /* TPSERIAL for 3302 in TOP_CONTROL */ 410 .serial_mpeg = 0x04, /* TPSERIAL for 3302 in TOP_CONTROL */
431 .set_ts_params = lgdt330x_set_ts_param, 411 .set_ts_params = lgdt330x_set_ts_param,
432}; 412};
433 413
434static struct lgdt330x_config fusionhdtv_5_gold = { 414static struct lgdt330x_config fusionhdtv_5_gold = {
435 .demod_address = 0x0e, 415 .demod_address = 0x0e,
436 .demod_chip = LGDT3303, 416 .demod_chip = LGDT3303,
437 .serial_mpeg = 0x40, /* TPSERIAL for 3303 in TOP_CONTROL */ 417 .serial_mpeg = 0x40, /* TPSERIAL for 3303 in TOP_CONTROL */
438 .set_ts_params = lgdt330x_set_ts_param, 418 .set_ts_params = lgdt330x_set_ts_param,
439}; 419};
440 420
441static struct lgdt330x_config pchdtv_hd5500 = { 421static struct lgdt330x_config pchdtv_hd5500 = {
442 .demod_address = 0x59, 422 .demod_address = 0x59,
443 .demod_chip = LGDT3303, 423 .demod_chip = LGDT3303,
444 .serial_mpeg = 0x40, /* TPSERIAL for 3303 in TOP_CONTROL */ 424 .serial_mpeg = 0x40, /* TPSERIAL for 3303 in TOP_CONTROL */
445 .set_ts_params = lgdt330x_set_ts_param, 425 .set_ts_params = lgdt330x_set_ts_param,
446}; 426};
447#endif
448 427
449#ifdef HAVE_NXT200X
450static int nxt200x_set_ts_param(struct dvb_frontend* fe, 428static int nxt200x_set_ts_param(struct dvb_frontend* fe,
451 int is_punctured) 429 int is_punctured)
452{ 430{
@@ -465,28 +443,27 @@ static int nxt200x_set_pll_input(u8* buf, int input)
465} 443}
466 444
467static struct nxt200x_config ati_hdtvwonder = { 445static struct nxt200x_config ati_hdtvwonder = {
468 .demod_address = 0x0a, 446 .demod_address = 0x0a,
469 .set_pll_input = nxt200x_set_pll_input, 447 .set_pll_input = nxt200x_set_pll_input,
470 .set_ts_params = nxt200x_set_ts_param, 448 .set_ts_params = nxt200x_set_ts_param,
471}; 449};
472#endif
473 450
474#ifdef HAVE_CX24123
475static int cx24123_set_ts_param(struct dvb_frontend* fe, 451static int cx24123_set_ts_param(struct dvb_frontend* fe,
476 int is_punctured) 452 int is_punctured)
477{ 453{
478 struct cx8802_dev *dev= fe->dvb->priv; 454 struct cx8802_dev *dev= fe->dvb->priv;
479 dev->ts_gen_cntrl = 0x2; 455 dev->ts_gen_cntrl = 0x02;
480 return 0; 456 return 0;
481} 457}
482 458
483static int kworld_dvbs_100_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage) 459static int kworld_dvbs_100_set_voltage(struct dvb_frontend* fe,
460 fe_sec_voltage_t voltage)
484{ 461{
485 struct cx8802_dev *dev= fe->dvb->priv; 462 struct cx8802_dev *dev= fe->dvb->priv;
486 struct cx88_core *core = dev->core; 463 struct cx88_core *core = dev->core;
487 464
488 if (voltage == SEC_VOLTAGE_OFF) { 465 if (voltage == SEC_VOLTAGE_OFF) {
489 cx_write(MO_GP0_IO, 0x000006fB); 466 cx_write(MO_GP0_IO, 0x000006fb);
490 } else { 467 } else {
491 cx_write(MO_GP0_IO, 0x000006f9); 468 cx_write(MO_GP0_IO, 0x000006f9);
492 } 469 }
@@ -496,7 +473,8 @@ static int kworld_dvbs_100_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t
496 return 0; 473 return 0;
497} 474}
498 475
499static int geniatech_dvbs_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) 476static int geniatech_dvbs_set_voltage(struct dvb_frontend *fe,
477 fe_sec_voltage_t voltage)
500{ 478{
501 struct cx8802_dev *dev= fe->dvb->priv; 479 struct cx8802_dev *dev= fe->dvb->priv;
502 struct cx88_core *core = dev->core; 480 struct cx88_core *core = dev->core;
@@ -512,20 +490,20 @@ static int geniatech_dvbs_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t
512} 490}
513 491
514static struct cx24123_config geniatech_dvbs_config = { 492static struct cx24123_config geniatech_dvbs_config = {
515 .demod_address = 0x55, 493 .demod_address = 0x55,
516 .set_ts_params = cx24123_set_ts_param, 494 .set_ts_params = cx24123_set_ts_param,
517}; 495};
518 496
519static struct cx24123_config hauppauge_novas_config = { 497static struct cx24123_config hauppauge_novas_config = {
520 .demod_address = 0x55, 498 .demod_address = 0x55,
521 .set_ts_params = cx24123_set_ts_param, 499 .set_ts_params = cx24123_set_ts_param,
522}; 500};
523 501
524static struct cx24123_config kworld_dvbs_100_config = { 502static struct cx24123_config kworld_dvbs_100_config = {
525 .demod_address = 0x15, 503 .demod_address = 0x15,
526 .set_ts_params = cx24123_set_ts_param, 504 .set_ts_params = cx24123_set_ts_param,
505 .lnb_polarity = 1,
527}; 506};
528#endif
529 507
530static int dvb_register(struct cx8802_dev *dev) 508static int dvb_register(struct cx8802_dev *dev)
531{ 509{
@@ -535,114 +513,114 @@ static int dvb_register(struct cx8802_dev *dev)
535 513
536 /* init frontend */ 514 /* init frontend */
537 switch (dev->core->board) { 515 switch (dev->core->board) {
538#ifdef HAVE_CX22702
539 case CX88_BOARD_HAUPPAUGE_DVB_T1: 516 case CX88_BOARD_HAUPPAUGE_DVB_T1:
540 dev->dvb.frontend = cx22702_attach(&hauppauge_novat_config, 517 dev->dvb.frontend = dvb_attach(cx22702_attach,
541 &dev->core->i2c_adap); 518 &hauppauge_novat_config,
519 &dev->core->i2c_adap);
542 if (dev->dvb.frontend != NULL) { 520 if (dev->dvb.frontend != NULL) {
543 dvb_pll_attach(dev->dvb.frontend, 0x61, 521 dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
544 &dev->core->i2c_adap, 522 &dev->core->i2c_adap,
545 &dvb_pll_thomson_dtt759x); 523 &dvb_pll_thomson_dtt759x);
546 } 524 }
547 break; 525 break;
548 case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1: 526 case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1:
549 case CX88_BOARD_CONEXANT_DVB_T1: 527 case CX88_BOARD_CONEXANT_DVB_T1:
550 case CX88_BOARD_KWORLD_DVB_T_CX22702: 528 case CX88_BOARD_KWORLD_DVB_T_CX22702:
551 case CX88_BOARD_WINFAST_DTV1000: 529 case CX88_BOARD_WINFAST_DTV1000:
552 dev->dvb.frontend = cx22702_attach(&connexant_refboard_config, 530 dev->dvb.frontend = dvb_attach(cx22702_attach,
553 &dev->core->i2c_adap); 531 &connexant_refboard_config,
532 &dev->core->i2c_adap);
554 if (dev->dvb.frontend != NULL) { 533 if (dev->dvb.frontend != NULL) {
555 dvb_pll_attach(dev->dvb.frontend, 0x60, 534 dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x60,
556 &dev->core->i2c_adap, 535 &dev->core->i2c_adap,
557 &dvb_pll_thomson_dtt7579); 536 &dvb_pll_thomson_dtt7579);
558 } 537 }
559 break; 538 break;
560 case CX88_BOARD_WINFAST_DTV2000H: 539 case CX88_BOARD_WINFAST_DTV2000H:
561 case CX88_BOARD_HAUPPAUGE_HVR1100: 540 case CX88_BOARD_HAUPPAUGE_HVR1100:
562 case CX88_BOARD_HAUPPAUGE_HVR1100LP: 541 case CX88_BOARD_HAUPPAUGE_HVR1100LP:
563 dev->dvb.frontend = cx22702_attach(&hauppauge_hvr1100_config, 542 dev->dvb.frontend = dvb_attach(cx22702_attach,
564 &dev->core->i2c_adap); 543 &hauppauge_hvr1100_config,
544 &dev->core->i2c_adap);
565 if (dev->dvb.frontend != NULL) { 545 if (dev->dvb.frontend != NULL) {
566 dvb_pll_attach(dev->dvb.frontend, 0x61, 546 dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
567 &dev->core->i2c_adap, 547 &dev->core->i2c_adap,
568 &dvb_pll_fmd1216me); 548 &dvb_pll_fmd1216me);
549 }
550 break;
551 case CX88_BOARD_HAUPPAUGE_HVR1300:
552 dev->dvb.frontend = dvb_attach(cx22702_attach,
553 &hauppauge_hvr1300_config,
554 &dev->core->i2c_adap);
555 if (dev->dvb.frontend != NULL) {
556 dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
557 &dev->core->i2c_adap,
558 &dvb_pll_fmd1216me);
569 } 559 }
570 break; 560 break;
571#endif
572#if defined(HAVE_MT352) || defined(HAVE_ZL10353)
573 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS: 561 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS:
574#ifdef HAVE_MT352 562 dev->dvb.frontend = dvb_attach(mt352_attach,
575 dev->dvb.frontend = mt352_attach(&dvico_fusionhdtv, 563 &dvico_fusionhdtv,
576 &dev->core->i2c_adap); 564 &dev->core->i2c_adap);
577 if (dev->dvb.frontend != NULL) { 565 if (dev->dvb.frontend != NULL) {
578 dvb_pll_attach(dev->dvb.frontend, 0x60, 566 dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x60,
579 &dev->core->i2c_adap, 567 NULL, &dvb_pll_thomson_dtt7579);
580 &dvb_pll_thomson_dtt7579);
581 break; 568 break;
582 } 569 }
583#endif
584#ifdef HAVE_ZL10353
585 /* ZL10353 replaces MT352 on later cards */ 570 /* ZL10353 replaces MT352 on later cards */
586 dev->dvb.frontend = zl10353_attach(&dvico_fusionhdtv_plus_v1_1, 571 dev->dvb.frontend = dvb_attach(zl10353_attach,
587 &dev->core->i2c_adap); 572 &dvico_fusionhdtv_plus_v1_1,
573 &dev->core->i2c_adap);
588 if (dev->dvb.frontend != NULL) { 574 if (dev->dvb.frontend != NULL) {
589 dvb_pll_attach(dev->dvb.frontend, 0x60, 575 dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x60,
590 &dev->core->i2c_adap, 576 NULL, &dvb_pll_thomson_dtt7579);
591 &dvb_pll_thomson_dtt7579);
592 } 577 }
593#endif
594 break; 578 break;
595 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL: 579 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL:
596#ifdef HAVE_MT352
597 /* The tin box says DEE1601, but it seems to be DTT7579 580 /* The tin box says DEE1601, but it seems to be DTT7579
598 * compatible, with a slightly different MT352 AGC gain. */ 581 * compatible, with a slightly different MT352 AGC gain. */
599 dev->dvb.frontend = mt352_attach(&dvico_fusionhdtv_dual, 582 dev->dvb.frontend = dvb_attach(mt352_attach,
600 &dev->core->i2c_adap); 583 &dvico_fusionhdtv_dual,
584 &dev->core->i2c_adap);
601 if (dev->dvb.frontend != NULL) { 585 if (dev->dvb.frontend != NULL) {
602 dvb_pll_attach(dev->dvb.frontend, 0x61, 586 dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
603 &dev->core->i2c_adap, 587 NULL, &dvb_pll_thomson_dtt7579);
604 &dvb_pll_thomson_dtt7579);
605 break; 588 break;
606 } 589 }
607#endif
608#ifdef HAVE_ZL10353
609 /* ZL10353 replaces MT352 on later cards */ 590 /* ZL10353 replaces MT352 on later cards */
610 dev->dvb.frontend = zl10353_attach(&dvico_fusionhdtv_plus_v1_1, 591 dev->dvb.frontend = dvb_attach(zl10353_attach,
611 &dev->core->i2c_adap); 592 &dvico_fusionhdtv_plus_v1_1,
593 &dev->core->i2c_adap);
612 if (dev->dvb.frontend != NULL) { 594 if (dev->dvb.frontend != NULL) {
613 dvb_pll_attach(dev->dvb.frontend, 0x61, 595 dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
614 &dev->core->i2c_adap, 596 NULL, &dvb_pll_thomson_dtt7579);
615 &dvb_pll_thomson_dtt7579);
616 } 597 }
617#endif
618 break; 598 break;
619#endif /* HAVE_MT352 || HAVE_ZL10353 */
620#ifdef HAVE_MT352
621 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1: 599 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
622 dev->dvb.frontend = mt352_attach(&dvico_fusionhdtv, 600 dev->dvb.frontend = dvb_attach(mt352_attach,
623 &dev->core->i2c_adap); 601 &dvico_fusionhdtv,
602 &dev->core->i2c_adap);
624 if (dev->dvb.frontend != NULL) { 603 if (dev->dvb.frontend != NULL) {
625 dvb_pll_attach(dev->dvb.frontend, 0x61, 604 dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
626 &dev->core->i2c_adap, 605 NULL, &dvb_pll_lg_z201);
627 &dvb_pll_lg_z201);
628 } 606 }
629 break; 607 break;
630 case CX88_BOARD_KWORLD_DVB_T: 608 case CX88_BOARD_KWORLD_DVB_T:
631 case CX88_BOARD_DNTV_LIVE_DVB_T: 609 case CX88_BOARD_DNTV_LIVE_DVB_T:
632 case CX88_BOARD_ADSTECH_DVB_T_PCI: 610 case CX88_BOARD_ADSTECH_DVB_T_PCI:
633 dev->dvb.frontend = mt352_attach(&dntv_live_dvbt_config, 611 dev->dvb.frontend = dvb_attach(mt352_attach,
634 &dev->core->i2c_adap); 612 &dntv_live_dvbt_config,
613 &dev->core->i2c_adap);
635 if (dev->dvb.frontend != NULL) { 614 if (dev->dvb.frontend != NULL) {
636 dvb_pll_attach(dev->dvb.frontend, 0x61, 615 dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
637 &dev->core->i2c_adap, 616 NULL, &dvb_pll_unknown_1);
638 &dvb_pll_unknown_1);
639 } 617 }
640 break; 618 break;
641 case CX88_BOARD_DNTV_LIVE_DVB_T_PRO: 619 case CX88_BOARD_DNTV_LIVE_DVB_T_PRO:
642#ifdef HAVE_VP3054_I2C 620#ifdef HAVE_VP3054_I2C
643 dev->core->pll_addr = 0x61; 621 dev->core->pll_addr = 0x61;
644 dev->core->pll_desc = &dvb_pll_fmd1216me; 622 dev->core->pll_desc = &dvb_pll_fmd1216me;
645 dev->dvb.frontend = mt352_attach(&dntv_live_dvbt_pro_config, 623 dev->dvb.frontend = dvb_attach(mt352_attach, &dntv_live_dvbt_pro_config,
646 &((struct vp3054_i2c_state *)dev->card_priv)->adap); 624 &((struct vp3054_i2c_state *)dev->card_priv)->adap);
647 if (dev->dvb.frontend != NULL) { 625 if (dev->dvb.frontend != NULL) {
648 dev->dvb.frontend->ops.tuner_ops.set_params = dntv_live_dvbt_pro_tuner_set_params; 626 dev->dvb.frontend->ops.tuner_ops.set_params = dntv_live_dvbt_pro_tuner_set_params;
@@ -651,30 +629,26 @@ static int dvb_register(struct cx8802_dev *dev)
651 printk("%s: built without vp3054 support\n", dev->core->name); 629 printk("%s: built without vp3054 support\n", dev->core->name);
652#endif 630#endif
653 break; 631 break;
654#endif
655#ifdef HAVE_ZL10353
656 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID: 632 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID:
657 dev->core->pll_addr = 0x61; 633 dev->core->pll_addr = 0x61;
658 dev->core->pll_desc = &dvb_pll_thomson_fe6600; 634 dev->core->pll_desc = &dvb_pll_thomson_fe6600;
659 dev->dvb.frontend = zl10353_attach(&dvico_fusionhdtv_hybrid, 635 dev->dvb.frontend = dvb_attach(zl10353_attach,
660 &dev->core->i2c_adap); 636 &dvico_fusionhdtv_hybrid,
637 &dev->core->i2c_adap);
661 if (dev->dvb.frontend != NULL) { 638 if (dev->dvb.frontend != NULL) {
662 dev->dvb.frontend->ops.tuner_ops.set_params = dvico_hybrid_tuner_set_params; 639 dev->dvb.frontend->ops.tuner_ops.set_params = dvico_hybrid_tuner_set_params;
663 } 640 }
664 break; 641 break;
665#endif
666#ifdef HAVE_OR51132
667 case CX88_BOARD_PCHDTV_HD3000: 642 case CX88_BOARD_PCHDTV_HD3000:
668 dev->dvb.frontend = or51132_attach(&pchdtv_hd3000, 643 dev->dvb.frontend = dvb_attach(or51132_attach,
669 &dev->core->i2c_adap); 644 &pchdtv_hd3000,
645 &dev->core->i2c_adap);
670 if (dev->dvb.frontend != NULL) { 646 if (dev->dvb.frontend != NULL) {
671 dvb_pll_attach(dev->dvb.frontend, 0x61, 647 dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
672 &dev->core->i2c_adap, 648 &dev->core->i2c_adap,
673 &dvb_pll_thomson_dtt761x); 649 &dvb_pll_thomson_dtt761x);
674 } 650 }
675 break; 651 break;
676#endif
677#ifdef HAVE_LGDT330X
678 case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q: 652 case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q:
679 dev->ts_gen_cntrl = 0x08; 653 dev->ts_gen_cntrl = 0x08;
680 { 654 {
@@ -690,8 +664,9 @@ static int dvb_register(struct cx8802_dev *dev)
690 fusionhdtv_3_gold.pll_rf_set = lgdt330x_pll_rf_set; 664 fusionhdtv_3_gold.pll_rf_set = lgdt330x_pll_rf_set;
691 dev->core->pll_addr = 0x61; 665 dev->core->pll_addr = 0x61;
692 dev->core->pll_desc = &dvb_pll_microtune_4042; 666 dev->core->pll_desc = &dvb_pll_microtune_4042;
693 dev->dvb.frontend = lgdt330x_attach(&fusionhdtv_3_gold, 667 dev->dvb.frontend = dvb_attach(lgdt330x_attach,
694 &dev->core->i2c_adap); 668 &fusionhdtv_3_gold,
669 &dev->core->i2c_adap);
695 if (dev->dvb.frontend != NULL) { 670 if (dev->dvb.frontend != NULL) {
696 dev->dvb.frontend->ops.tuner_ops.set_params = lgdt3302_tuner_set_params; 671 dev->dvb.frontend->ops.tuner_ops.set_params = lgdt3302_tuner_set_params;
697 } 672 }
@@ -709,8 +684,9 @@ static int dvb_register(struct cx8802_dev *dev)
709 mdelay(200); 684 mdelay(200);
710 dev->core->pll_addr = 0x61; 685 dev->core->pll_addr = 0x61;
711 dev->core->pll_desc = &dvb_pll_thomson_dtt761x; 686 dev->core->pll_desc = &dvb_pll_thomson_dtt761x;
712 dev->dvb.frontend = lgdt330x_attach(&fusionhdtv_3_gold, 687 dev->dvb.frontend = dvb_attach(lgdt330x_attach,
713 &dev->core->i2c_adap); 688 &fusionhdtv_3_gold,
689 &dev->core->i2c_adap);
714 if (dev->dvb.frontend != NULL) { 690 if (dev->dvb.frontend != NULL) {
715 dev->dvb.frontend->ops.tuner_ops.set_params = lgdt3302_tuner_set_params; 691 dev->dvb.frontend->ops.tuner_ops.set_params = lgdt3302_tuner_set_params;
716 } 692 }
@@ -726,8 +702,9 @@ static int dvb_register(struct cx8802_dev *dev)
726 mdelay(100); 702 mdelay(100);
727 cx_set(MO_GP0_IO, 1); 703 cx_set(MO_GP0_IO, 1);
728 mdelay(200); 704 mdelay(200);
729 dev->dvb.frontend = lgdt330x_attach(&fusionhdtv_5_gold, 705 dev->dvb.frontend = dvb_attach(lgdt330x_attach,
730 &dev->core->i2c_adap); 706 &fusionhdtv_5_gold,
707 &dev->core->i2c_adap);
731 if (dev->dvb.frontend != NULL) { 708 if (dev->dvb.frontend != NULL) {
732 dev->dvb.frontend->ops.tuner_ops.set_params = lgdt3303_tuner_set_params; 709 dev->dvb.frontend->ops.tuner_ops.set_params = lgdt3303_tuner_set_params;
733 } 710 }
@@ -743,52 +720,51 @@ static int dvb_register(struct cx8802_dev *dev)
743 mdelay(100); 720 mdelay(100);
744 cx_set(MO_GP0_IO, 1); 721 cx_set(MO_GP0_IO, 1);
745 mdelay(200); 722 mdelay(200);
746 dev->dvb.frontend = lgdt330x_attach(&pchdtv_hd5500, 723 dev->dvb.frontend = dvb_attach(lgdt330x_attach,
747 &dev->core->i2c_adap); 724 &pchdtv_hd5500,
725 &dev->core->i2c_adap);
748 if (dev->dvb.frontend != NULL) { 726 if (dev->dvb.frontend != NULL) {
749 dev->dvb.frontend->ops.tuner_ops.set_params = lgdt3303_tuner_set_params; 727 dev->dvb.frontend->ops.tuner_ops.set_params = lgdt3303_tuner_set_params;
750 } 728 }
751 } 729 }
752 break; 730 break;
753#endif
754#ifdef HAVE_NXT200X
755 case CX88_BOARD_ATI_HDTVWONDER: 731 case CX88_BOARD_ATI_HDTVWONDER:
756 dev->dvb.frontend = nxt200x_attach(&ati_hdtvwonder, 732 dev->dvb.frontend = dvb_attach(nxt200x_attach,
757 &dev->core->i2c_adap); 733 &ati_hdtvwonder,
734 &dev->core->i2c_adap);
758 if (dev->dvb.frontend != NULL) { 735 if (dev->dvb.frontend != NULL) {
759 dvb_pll_attach(dev->dvb.frontend, 0x61, 736 dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
760 &dev->core->i2c_adap, 737 NULL, &dvb_pll_tuv1236d);
761 &dvb_pll_tuv1236d);
762 } 738 }
763 break; 739 break;
764#endif
765#ifdef HAVE_CX24123
766 case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1: 740 case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1:
767 case CX88_BOARD_HAUPPAUGE_NOVASE2_S1: 741 case CX88_BOARD_HAUPPAUGE_NOVASE2_S1:
768 dev->dvb.frontend = cx24123_attach(&hauppauge_novas_config, 742 dev->dvb.frontend = dvb_attach(cx24123_attach,
769 &dev->core->i2c_adap); 743 &hauppauge_novas_config,
744 &dev->core->i2c_adap);
770 if (dev->dvb.frontend) { 745 if (dev->dvb.frontend) {
771 isl6421_attach(dev->dvb.frontend, &dev->core->i2c_adap, 746 dvb_attach(isl6421_attach, dev->dvb.frontend,
772 0x08, 0x00, 0x00); 747 &dev->core->i2c_adap, 0x08, 0x00, 0x00);
773 } 748 }
774 break; 749 break;
775 case CX88_BOARD_KWORLD_DVBS_100: 750 case CX88_BOARD_KWORLD_DVBS_100:
776 dev->dvb.frontend = cx24123_attach(&kworld_dvbs_100_config, 751 dev->dvb.frontend = dvb_attach(cx24123_attach,
777 &dev->core->i2c_adap); 752 &kworld_dvbs_100_config,
753 &dev->core->i2c_adap);
778 if (dev->dvb.frontend) { 754 if (dev->dvb.frontend) {
779 dev->core->prev_set_voltage = dev->dvb.frontend->ops.set_voltage; 755 dev->core->prev_set_voltage = dev->dvb.frontend->ops.set_voltage;
780 dev->dvb.frontend->ops.set_voltage = kworld_dvbs_100_set_voltage; 756 dev->dvb.frontend->ops.set_voltage = kworld_dvbs_100_set_voltage;
781 } 757 }
782 break; 758 break;
783 case CX88_BOARD_GENIATECH_DVBS: 759 case CX88_BOARD_GENIATECH_DVBS:
784 dev->dvb.frontend = cx24123_attach(&geniatech_dvbs_config, 760 dev->dvb.frontend = dvb_attach(cx24123_attach,
785 &dev->core->i2c_adap); 761 &geniatech_dvbs_config,
762 &dev->core->i2c_adap);
786 if (dev->dvb.frontend) { 763 if (dev->dvb.frontend) {
787 dev->core->prev_set_voltage = dev->dvb.frontend->ops.set_voltage; 764 dev->core->prev_set_voltage = dev->dvb.frontend->ops.set_voltage;
788 dev->dvb.frontend->ops.set_voltage = geniatech_dvbs_set_voltage; 765 dev->dvb.frontend->ops.set_voltage = geniatech_dvbs_set_voltage;
789 } 766 }
790 break; 767 break;
791#endif
792 default: 768 default:
793 printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n", 769 printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n",
794 dev->core->name); 770 dev->core->name);
@@ -908,8 +884,10 @@ static struct pci_driver dvb_pci_driver = {
908 .id_table = cx8802_pci_tbl, 884 .id_table = cx8802_pci_tbl,
909 .probe = dvb_probe, 885 .probe = dvb_probe,
910 .remove = __devexit_p(dvb_remove), 886 .remove = __devexit_p(dvb_remove),
887#ifdef CONFIG_PM
911 .suspend = cx8802_suspend_common, 888 .suspend = cx8802_suspend_common,
912 .resume = cx8802_resume_common, 889 .resume = cx8802_resume_common,
890#endif
913}; 891};
914 892
915static int dvb_init(void) 893static int dvb_init(void)
diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c
index 7bea34714861..27b5dbb2ca1a 100644
--- a/drivers/media/video/cx88/cx88-i2c.c
+++ b/drivers/media/video/cx88/cx88-i2c.c
@@ -7,6 +7,9 @@
7 (c) 2002 Yurij Sysoev <yurij@naturesoft.net> 7 (c) 2002 Yurij Sysoev <yurij@naturesoft.net>
8 (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org> 8 (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org>
9 9
10 (c) 2005 Mauro Carvalho Chehab <mchehab@infradead.org>
11 - Multituner support and i2c address binding
12
10 This program is free software; you can redistribute it and/or modify 13 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by 14 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or 15 the Free Software Foundation; either version 2 of the License, or
@@ -40,6 +43,11 @@ static unsigned int i2c_scan = 0;
40module_param(i2c_scan, int, 0444); 43module_param(i2c_scan, int, 0444);
41MODULE_PARM_DESC(i2c_scan,"scan i2c bus at insmod time"); 44MODULE_PARM_DESC(i2c_scan,"scan i2c bus at insmod time");
42 45
46static unsigned int i2c_udelay = 5;
47module_param(i2c_udelay, int, 0644);
48MODULE_PARM_DESC(i2c_udelay,"i2c delay at insmod time, in usecs "
49 "(should be 5 or higher). Lower value means higher bus speed.");
50
43#define dprintk(level,fmt, arg...) if (i2c_debug >= level) \ 51#define dprintk(level,fmt, arg...) if (i2c_debug >= level) \
44 printk(KERN_DEBUG "%s: " fmt, core->name , ## arg) 52 printk(KERN_DEBUG "%s: " fmt, core->name , ## arg)
45 53
@@ -198,6 +206,11 @@ static void do_i2c_scan(char *name, struct i2c_client *c)
198/* init + register i2c algo-bit adapter */ 206/* init + register i2c algo-bit adapter */
199int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci) 207int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci)
200{ 208{
209 /* Prevents usage of invalid delay values */
210 if (i2c_udelay<5)
211 i2c_udelay=5;
212 cx8800_i2c_algo_template.udelay=i2c_udelay;
213
201 memcpy(&core->i2c_adap, &cx8800_i2c_adap_template, 214 memcpy(&core->i2c_adap, &cx8800_i2c_adap_template,
202 sizeof(core->i2c_adap)); 215 sizeof(core->i2c_adap));
203 memcpy(&core->i2c_algo, &cx8800_i2c_algo_template, 216 memcpy(&core->i2c_algo, &cx8800_i2c_algo_template,
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c
index c25564648993..83ebf7a3c054 100644
--- a/drivers/media/video/cx88/cx88-input.c
+++ b/drivers/media/video/cx88/cx88-input.c
@@ -107,7 +107,15 @@ static void cx88_ir_handle_key(struct cx88_IR *ir)
107 (gpio & ir->mask_keydown) ? " down" : "", 107 (gpio & ir->mask_keydown) ? " down" : "",
108 (gpio & ir->mask_keyup) ? " up" : ""); 108 (gpio & ir->mask_keyup) ? " up" : "");
109 109
110 if (ir->mask_keydown) { 110 if (ir->core->board == CX88_BOARD_NORWOOD_MICRO) {
111 u32 gpio_key = cx_read(MO_GP0_IO);
112
113 data = (data << 4) | ((gpio_key & 0xf0) >> 4);
114
115 ir_input_keydown(ir->input, &ir->ir, data, data);
116 ir_input_nokey(ir->input, &ir->ir);
117
118 } else if (ir->mask_keydown) {
111 /* bit set on keydown */ 119 /* bit set on keydown */
112 if (gpio & ir->mask_keydown) { 120 if (gpio & ir->mask_keydown) {
113 ir_input_keydown(ir->input, &ir->ir, data, data); 121 ir_input_keydown(ir->input, &ir->ir, data, data);
@@ -187,6 +195,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
187 case CX88_BOARD_HAUPPAUGE_NOVASE2_S1: 195 case CX88_BOARD_HAUPPAUGE_NOVASE2_S1:
188 case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1: 196 case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1:
189 case CX88_BOARD_HAUPPAUGE_HVR1100: 197 case CX88_BOARD_HAUPPAUGE_HVR1100:
198 case CX88_BOARD_HAUPPAUGE_HVR1300:
190 ir_codes = ir_codes_hauppauge_new; 199 ir_codes = ir_codes_hauppauge_new;
191 ir_type = IR_TYPE_RC5; 200 ir_type = IR_TYPE_RC5;
192 ir->sampling = 1; 201 ir->sampling = 1;
@@ -248,6 +257,13 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
248 ir_type = IR_TYPE_PD; 257 ir_type = IR_TYPE_PD;
249 ir->sampling = 0xff00; /* address */ 258 ir->sampling = 0xff00; /* address */
250 break; 259 break;
260 case CX88_BOARD_NORWOOD_MICRO:
261 ir_codes = ir_codes_norwood;
262 ir->gpio_addr = MO_GP1_IO;
263 ir->mask_keycode = 0x0e;
264 ir->mask_keyup = 0x80;
265 ir->polling = 50; /* ms */
266 break;
251 case CX88_BOARD_NPGTECH_REALTV_TOP10FM: 267 case CX88_BOARD_NPGTECH_REALTV_TOP10FM:
252 ir_codes = ir_codes_npgtech; 268 ir_codes = ir_codes_npgtech;
253 ir->gpio_addr = MO_GP0_IO; 269 ir->gpio_addr = MO_GP0_IO;
@@ -402,6 +418,7 @@ void cx88_ir_irq(struct cx88_core *core)
402 case CX88_BOARD_HAUPPAUGE_NOVASE2_S1: 418 case CX88_BOARD_HAUPPAUGE_NOVASE2_S1:
403 case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1: 419 case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1:
404 case CX88_BOARD_HAUPPAUGE_HVR1100: 420 case CX88_BOARD_HAUPPAUGE_HVR1100:
421 case CX88_BOARD_HAUPPAUGE_HVR1300:
405 ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7); 422 ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7);
406 ir_dprintk("biphase decoded: %x\n", ircode); 423 ir_dprintk("biphase decoded: %x\n", ircode);
407 if ((ircode & 0xfffff000) != 0x3000) 424 if ((ircode & 0xfffff000) != 0x3000)
diff --git a/drivers/media/video/cx88/cx88-tvaudio.c b/drivers/media/video/cx88/cx88-tvaudio.c
index 5785c3481579..741e7c5e69ec 100644
--- a/drivers/media/video/cx88/cx88-tvaudio.c
+++ b/drivers/media/video/cx88/cx88-tvaudio.c
@@ -52,7 +52,6 @@
52#include <linux/init.h> 52#include <linux/init.h>
53#include <linux/smp_lock.h> 53#include <linux/smp_lock.h>
54#include <linux/delay.h> 54#include <linux/delay.h>
55#include <linux/config.h>
56#include <linux/kthread.h> 55#include <linux/kthread.h>
57 56
58#include "cx88.h" 57#include "cx88.h"
@@ -138,14 +137,10 @@ static void set_audio_finish(struct cx88_core *core, u32 ctl)
138{ 137{
139 u32 volume; 138 u32 volume;
140 139
141#ifndef CONFIG_VIDEO_CX88_ALSA
142 /* restart dma; This avoids buzz in NICAM and is good in others */ 140 /* restart dma; This avoids buzz in NICAM and is good in others */
143 cx88_stop_audio_dma(core); 141 cx88_stop_audio_dma(core);
144#endif
145 cx_write(AUD_RATE_THRES_DMD, 0x000000C0); 142 cx_write(AUD_RATE_THRES_DMD, 0x000000C0);
146#ifndef CONFIG_VIDEO_CX88_ALSA
147 cx88_start_audio_dma(core); 143 cx88_start_audio_dma(core);
148#endif
149 144
150 if (cx88_boards[core->board].blackbird) { 145 if (cx88_boards[core->board].blackbird) {
151 /* sets sound input from external adc */ 146 /* sets sound input from external adc */
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index 94c92bacc342..fbc79e9842aa 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -497,6 +497,7 @@ static int start_video_dma(struct cx8800_dev *dev,
497 return 0; 497 return 0;
498} 498}
499 499
500#ifdef CONFIG_PM
500static int stop_video_dma(struct cx8800_dev *dev) 501static int stop_video_dma(struct cx8800_dev *dev)
501{ 502{
502 struct cx88_core *core = dev->core; 503 struct cx88_core *core = dev->core;
@@ -512,6 +513,7 @@ static int stop_video_dma(struct cx8800_dev *dev)
512 cx_clear(MO_VID_INTMSK, 0x0f0011); 513 cx_clear(MO_VID_INTMSK, 0x0f0011);
513 return 0; 514 return 0;
514} 515}
516#endif
515 517
516static int restart_video_queue(struct cx8800_dev *dev, 518static int restart_video_queue(struct cx8800_dev *dev,
517 struct cx88_dmaqueue *q) 519 struct cx88_dmaqueue *q)
@@ -2017,6 +2019,7 @@ static void __devexit cx8800_finidev(struct pci_dev *pci_dev)
2017 kfree(dev); 2019 kfree(dev);
2018} 2020}
2019 2021
2022#ifdef CONFIG_PM
2020static int cx8800_suspend(struct pci_dev *pci_dev, pm_message_t state) 2023static int cx8800_suspend(struct pci_dev *pci_dev, pm_message_t state)
2021{ 2024{
2022 struct cx8800_dev *dev = pci_get_drvdata(pci_dev); 2025 struct cx8800_dev *dev = pci_get_drvdata(pci_dev);
@@ -2092,6 +2095,7 @@ static int cx8800_resume(struct pci_dev *pci_dev)
2092 2095
2093 return 0; 2096 return 0;
2094} 2097}
2098#endif
2095 2099
2096/* ----------------------------------------------------------- */ 2100/* ----------------------------------------------------------- */
2097 2101
@@ -2112,9 +2116,10 @@ static struct pci_driver cx8800_pci_driver = {
2112 .id_table = cx8800_pci_tbl, 2116 .id_table = cx8800_pci_tbl,
2113 .probe = cx8800_initdev, 2117 .probe = cx8800_initdev,
2114 .remove = __devexit_p(cx8800_finidev), 2118 .remove = __devexit_p(cx8800_finidev),
2115 2119#ifdef CONFIG_PM
2116 .suspend = cx8800_suspend, 2120 .suspend = cx8800_suspend,
2117 .resume = cx8800_resume, 2121 .resume = cx8800_resume,
2122#endif
2118}; 2123};
2119 2124
2120static int cx8800_init(void) 2125static int cx8800_init(void)
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index e7810955dd4f..89f12e273b7f 100644
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@ -197,6 +197,10 @@ extern struct sram_channel cx88_sram_channels[];
197#define CX88_BOARD_NPGTECH_REALTV_TOP10FM 50 197#define CX88_BOARD_NPGTECH_REALTV_TOP10FM 50
198#define CX88_BOARD_WINFAST_DTV2000H 51 198#define CX88_BOARD_WINFAST_DTV2000H 51
199#define CX88_BOARD_GENIATECH_DVBS 52 199#define CX88_BOARD_GENIATECH_DVBS 52
200#define CX88_BOARD_HAUPPAUGE_HVR3000 53
201#define CX88_BOARD_NORWOOD_MICRO 54
202#define CX88_BOARD_TE_DTV_250_OEM_SWANN 55
203#define CX88_BOARD_HAUPPAUGE_HVR1300 56
200 204
201enum cx88_itype { 205enum cx88_itype {
202 CX88_VMUX_COMPOSITE1 = 1, 206 CX88_VMUX_COMPOSITE1 = 1,
@@ -545,6 +549,7 @@ extern const unsigned int cx88_idcount;
545 549
546extern void cx88_card_list(struct cx88_core *core, struct pci_dev *pci); 550extern void cx88_card_list(struct cx88_core *core, struct pci_dev *pci);
547extern void cx88_card_setup(struct cx88_core *core); 551extern void cx88_card_setup(struct cx88_core *core);
552extern void cx88_card_setup_pre_i2c(struct cx88_core *core);
548 553
549/* ----------------------------------------------------------- */ 554/* ----------------------------------------------------------- */
550/* cx88-tvaudio.c */ 555/* cx88-tvaudio.c */