5 this file has configuration informations - card-specific stuff
6 like the big tvcards array for the most part
8 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
9 & Marcus Metzler (mocm@thp.uni-koeln.de)
10 (c) 1999-2001 Gerd Knorr <kraxel@goldbach.in-berlin.de>
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #include <linux/config.h>
29 #include <linux/delay.h>
30 #include <linux/module.h>
31 #include <linux/moduleparam.h>
32 #include <linux/kmod.h>
33 #include <linux/init.h>
34 #include <linux/pci.h>
35 #include <linux/vmalloc.h>
36 #include <linux/firmware.h>
41 #include <media/v4l2-common.h>
44 static void boot_msp34xx(struct bttv
*btv
, int pin
);
45 static void boot_bt832(struct bttv
*btv
);
46 static void hauppauge_eeprom(struct bttv
*btv
);
47 static void avermedia_eeprom(struct bttv
*btv
);
48 static void osprey_eeprom(struct bttv
*btv
);
49 static void modtec_eeprom(struct bttv
*btv
);
50 static void init_PXC200(struct bttv
*btv
);
51 static void init_RTV24(struct bttv
*btv
);
53 static void winview_audio(struct bttv
*btv
, struct video_audio
*v
, int set
);
54 static void lt9415_audio(struct bttv
*btv
, struct video_audio
*v
, int set
);
55 static void avermedia_tvphone_audio(struct bttv
*btv
, struct video_audio
*v
,
57 static void avermedia_tv_stereo_audio(struct bttv
*btv
, struct video_audio
*v
,
59 static void terratv_audio(struct bttv
*btv
, struct video_audio
*v
, int set
);
60 static void gvbctv3pci_audio(struct bttv
*btv
, struct video_audio
*v
, int set
);
61 static void gvbctv5pci_audio(struct bttv
*btv
, struct video_audio
*v
, int set
);
62 static void winfast2000_audio(struct bttv
*btv
, struct video_audio
*v
, int set
);
63 static void pvbt878p9b_audio(struct bttv
*btv
, struct video_audio
*v
, int set
);
64 static void fv2000s_audio(struct bttv
*btv
, struct video_audio
*v
, int set
);
65 static void windvr_audio(struct bttv
*btv
, struct video_audio
*v
, int set
);
66 static void adtvk503_audio(struct bttv
*btv
, struct video_audio
*v
, int set
);
67 static void rv605_muxsel(struct bttv
*btv
, unsigned int input
);
68 static void eagle_muxsel(struct bttv
*btv
, unsigned int input
);
69 static void xguard_muxsel(struct bttv
*btv
, unsigned int input
);
70 static void ivc120_muxsel(struct bttv
*btv
, unsigned int input
);
71 static void gvc1100_muxsel(struct bttv
*btv
, unsigned int input
);
73 static void PXC200_muxsel(struct bttv
*btv
, unsigned int input
);
75 static void picolo_tetra_muxsel(struct bttv
*btv
, unsigned int input
);
76 static void picolo_tetra_init(struct bttv
*btv
);
78 static void tibetCS16_muxsel(struct bttv
*btv
, unsigned int input
);
79 static void tibetCS16_init(struct bttv
*btv
);
81 static void kodicom4400r_muxsel(struct bttv
*btv
, unsigned int input
);
82 static void kodicom4400r_init(struct bttv
*btv
);
84 static void sigmaSLC_muxsel(struct bttv
*btv
, unsigned int input
);
85 static void sigmaSQ_muxsel(struct bttv
*btv
, unsigned int input
);
87 static int terratec_active_radio_upgrade(struct bttv
*btv
);
88 static int tea5757_read(struct bttv
*btv
);
89 static int tea5757_write(struct bttv
*btv
, int value
);
90 static void identify_by_eeprom(struct bttv
*btv
,
91 unsigned char eeprom_data
[256]);
92 static int __devinit
pvr_boot(struct bttv
*btv
);
94 /* config variables */
95 static unsigned int triton1
;
96 static unsigned int vsfx
;
97 static unsigned int latency
= UNSET
;
100 static unsigned int card
[BTTV_MAX
] = { [ 0 ... (BTTV_MAX
-1) ] = UNSET
};
101 static unsigned int pll
[BTTV_MAX
] = { [ 0 ... (BTTV_MAX
-1) ] = UNSET
};
102 static unsigned int tuner
[BTTV_MAX
] = { [ 0 ... (BTTV_MAX
-1) ] = UNSET
};
103 static unsigned int svhs
[BTTV_MAX
] = { [ 0 ... (BTTV_MAX
-1) ] = UNSET
};
104 static unsigned int remote
[BTTV_MAX
] = { [ 0 ... (BTTV_MAX
-1) ] = UNSET
};
105 static struct bttv
*master
[BTTV_MAX
] = { [ 0 ... (BTTV_MAX
-1) ] = NULL
};
107 static unsigned int autoload
= 1;
109 static unsigned int autoload
;
111 static unsigned int gpiomask
= UNSET
;
112 static unsigned int audioall
= UNSET
;
113 static unsigned int audiomux
[5] = { [ 0 ... 4 ] = UNSET
};
116 module_param(triton1
, int, 0444);
117 module_param(vsfx
, int, 0444);
118 module_param(no_overlay
, int, 0444);
119 module_param(latency
, int, 0444);
120 module_param(gpiomask
, int, 0444);
121 module_param(audioall
, int, 0444);
122 module_param(autoload
, int, 0444);
124 module_param_array(card
, int, NULL
, 0444);
125 module_param_array(pll
, int, NULL
, 0444);
126 module_param_array(tuner
, int, NULL
, 0444);
127 module_param_array(svhs
, int, NULL
, 0444);
128 module_param_array(remote
, int, NULL
, 0444);
129 module_param_array(audiomux
, int, NULL
, 0444);
131 MODULE_PARM_DESC(triton1
,"set ETBF pci config bit "
132 "[enable bug compatibility for triton1 + others]");
133 MODULE_PARM_DESC(vsfx
,"set VSFX pci config bit "
134 "[yet another chipset flaw workaround]");
135 MODULE_PARM_DESC(latency
,"pci latency timer");
136 MODULE_PARM_DESC(card
,"specify TV/grabber card model, see CARDLIST file for a list");
137 MODULE_PARM_DESC(pll
,"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)");
138 MODULE_PARM_DESC(tuner
,"specify installed tuner type");
139 MODULE_PARM_DESC(autoload
,"automatically load i2c modules like tuner.o, default is 1 (yes)");
140 MODULE_PARM_DESC(no_overlay
,"allow override overlay default (0 disables, 1 enables)"
141 " [some VIA/SIS chipsets are known to have problem with overlay]");
143 /* ----------------------------------------------------------------------- */
144 /* list of card IDs for bt878+ cards */
150 } cards
[] __devinitdata
= {
151 { 0x13eb0070, BTTV_BOARD_HAUPPAUGE878
, "Hauppauge WinTV" },
152 { 0x39000070, BTTV_BOARD_HAUPPAUGE878
, "Hauppauge WinTV-D" },
153 { 0x45000070, BTTV_BOARD_HAUPPAUGEPVR
, "Hauppauge WinTV/PVR" },
154 { 0xff000070, BTTV_BOARD_OSPREY1x0
, "Osprey-100" },
155 { 0xff010070, BTTV_BOARD_OSPREY2x0_SVID
,"Osprey-200" },
156 { 0xff020070, BTTV_BOARD_OSPREY500
, "Osprey-500" },
157 { 0xff030070, BTTV_BOARD_OSPREY2000
, "Osprey-2000" },
158 { 0xff040070, BTTV_BOARD_OSPREY540
, "Osprey-540" },
159 { 0xff070070, BTTV_BOARD_OSPREY440
, "Osprey-440" },
161 { 0x00011002, BTTV_BOARD_ATI_TVWONDER
, "ATI TV Wonder" },
162 { 0x00031002, BTTV_BOARD_ATI_TVWONDERVE
,"ATI TV Wonder/VE" },
164 { 0x6606107d, BTTV_BOARD_WINFAST2000
, "Leadtek WinFast TV 2000" },
165 { 0x6607107d, BTTV_BOARD_WINFASTVC100
, "Leadtek WinFast VC 100" },
166 { 0x6609107d, BTTV_BOARD_WINFAST2000
, "Leadtek TV 2000 XP" },
167 { 0x263610b4, BTTV_BOARD_STB2
, "STB TV PCI FM, Gateway P/N 6000704" },
168 { 0x264510b4, BTTV_BOARD_STB2
, "STB TV PCI FM, Gateway P/N 6000704" },
169 { 0x402010fc, BTTV_BOARD_GVBCTV3PCI
, "I-O Data Co. GV-BCTV3/PCI" },
170 { 0x405010fc, BTTV_BOARD_GVBCTV4PCI
, "I-O Data Co. GV-BCTV4/PCI" },
171 { 0x407010fc, BTTV_BOARD_GVBCTV5PCI
, "I-O Data Co. GV-BCTV5/PCI" },
172 { 0xd01810fc, BTTV_BOARD_GVBCTV5PCI
, "I-O Data Co. GV-BCTV5/PCI" },
174 { 0x001211bd, BTTV_BOARD_PINNACLE
, "Pinnacle PCTV" },
175 /* some cards ship with byteswapped IDs ... */
176 { 0x1200bd11, BTTV_BOARD_PINNACLE
, "Pinnacle PCTV [bswap]" },
177 { 0xff00bd11, BTTV_BOARD_PINNACLE
, "Pinnacle PCTV [bswap]" },
178 /* this seems to happen as well ... */
179 { 0xff1211bd, BTTV_BOARD_PINNACLE
, "Pinnacle PCTV" },
181 { 0x3000121a, BTTV_BOARD_VOODOOTV_FM
, "3Dfx VoodooTV FM/ VoodooTV 200" },
182 { 0x263710b4, BTTV_BOARD_VOODOOTV_FM
, "3Dfx VoodooTV FM/ VoodooTV 200" },
183 { 0x3060121a, BTTV_BOARD_STB2
, "3Dfx VoodooTV 100/ STB OEM" },
185 { 0x3000144f, BTTV_BOARD_MAGICTVIEW063
, "(Askey Magic/others) TView99 CPH06x" },
186 { 0xa005144f, BTTV_BOARD_MAGICTVIEW063
, "CPH06X TView99-Card" },
187 { 0x3002144f, BTTV_BOARD_MAGICTVIEW061
, "(Askey Magic/others) TView99 CPH05x" },
188 { 0x3005144f, BTTV_BOARD_MAGICTVIEW061
, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },
189 { 0x5000144f, BTTV_BOARD_MAGICTVIEW061
, "Askey CPH050" },
190 { 0x300014ff, BTTV_BOARD_MAGICTVIEW061
, "TView 99 (CPH061)" },
191 { 0x300214ff, BTTV_BOARD_PHOEBE_TVMAS
, "Phoebe TV Master (CPH060)" },
193 { 0x00011461, BTTV_BOARD_AVPHONE98
, "AVerMedia TVPhone98" },
194 { 0x00021461, BTTV_BOARD_AVERMEDIA98
, "AVermedia TVCapture 98" },
195 { 0x00031461, BTTV_BOARD_AVPHONE98
, "AVerMedia TVPhone98" },
196 { 0x00041461, BTTV_BOARD_AVERMEDIA98
, "AVerMedia TVCapture 98" },
197 { 0x03001461, BTTV_BOARD_AVERMEDIA98
, "VDOMATE TV TUNER CARD" },
199 { 0x1117153b, BTTV_BOARD_TERRATVALUE
, "Terratec TValue (Philips PAL B/G)" },
200 { 0x1118153b, BTTV_BOARD_TERRATVALUE
, "Terratec TValue (Temic PAL B/G)" },
201 { 0x1119153b, BTTV_BOARD_TERRATVALUE
, "Terratec TValue (Philips PAL I)" },
202 { 0x111a153b, BTTV_BOARD_TERRATVALUE
, "Terratec TValue (Temic PAL I)" },
204 { 0x1123153b, BTTV_BOARD_TERRATVRADIO
, "Terratec TV Radio+" },
205 { 0x1127153b, BTTV_BOARD_TERRATV
, "Terratec TV+ (V1.05)" },
206 /* clashes with FlyVideo
207 *{ 0x18521852, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.10)" }, */
208 { 0x1134153b, BTTV_BOARD_TERRATVALUE
, "Terratec TValue (LR102)" },
209 { 0x1135153b, BTTV_BOARD_TERRATVALUER
, "Terratec TValue Radio" }, /* LR102 */
210 { 0x5018153b, BTTV_BOARD_TERRATVALUE
, "Terratec TValue" }, /* ?? */
211 { 0xff3b153b, BTTV_BOARD_TERRATVALUER
, "Terratec TValue Radio" }, /* ?? */
213 { 0x400015b0, BTTV_BOARD_ZOLTRIX_GENIE
, "Zoltrix Genie TV" },
214 { 0x400a15b0, BTTV_BOARD_ZOLTRIX_GENIE
, "Zoltrix Genie TV" },
215 { 0x400d15b0, BTTV_BOARD_ZOLTRIX_GENIE
, "Zoltrix Genie TV / Radio" },
216 { 0x401015b0, BTTV_BOARD_ZOLTRIX_GENIE
, "Zoltrix Genie TV / Radio" },
217 { 0x401615b0, BTTV_BOARD_ZOLTRIX_GENIE
, "Zoltrix Genie TV / Radio" },
219 { 0x1430aa00, BTTV_BOARD_PV143
, "Provideo PV143A" },
220 { 0x1431aa00, BTTV_BOARD_PV143
, "Provideo PV143B" },
221 { 0x1432aa00, BTTV_BOARD_PV143
, "Provideo PV143C" },
222 { 0x1433aa00, BTTV_BOARD_PV143
, "Provideo PV143D" },
223 { 0x1433aa03, BTTV_BOARD_PV143
, "Security Eyes" },
225 { 0x1460aa00, BTTV_BOARD_PV150
, "Provideo PV150A-1" },
226 { 0x1461aa01, BTTV_BOARD_PV150
, "Provideo PV150A-2" },
227 { 0x1462aa02, BTTV_BOARD_PV150
, "Provideo PV150A-3" },
228 { 0x1463aa03, BTTV_BOARD_PV150
, "Provideo PV150A-4" },
230 { 0x1464aa04, BTTV_BOARD_PV150
, "Provideo PV150B-1" },
231 { 0x1465aa05, BTTV_BOARD_PV150
, "Provideo PV150B-2" },
232 { 0x1466aa06, BTTV_BOARD_PV150
, "Provideo PV150B-3" },
233 { 0x1467aa07, BTTV_BOARD_PV150
, "Provideo PV150B-4" },
235 { 0xa132ff00, BTTV_BOARD_IVC100
, "IVC-100" },
236 { 0xa1550000, BTTV_BOARD_IVC200
, "IVC-200" },
237 { 0xa1550001, BTTV_BOARD_IVC200
, "IVC-200" },
238 { 0xa1550002, BTTV_BOARD_IVC200
, "IVC-200" },
239 { 0xa1550003, BTTV_BOARD_IVC200
, "IVC-200" },
240 { 0xa1550100, BTTV_BOARD_IVC200
, "IVC-200G" },
241 { 0xa1550101, BTTV_BOARD_IVC200
, "IVC-200G" },
242 { 0xa1550102, BTTV_BOARD_IVC200
, "IVC-200G" },
243 { 0xa1550103, BTTV_BOARD_IVC200
, "IVC-200G" },
244 { 0xa182ff00, BTTV_BOARD_IVC120
, "IVC-120G" },
245 { 0xa182ff01, BTTV_BOARD_IVC120
, "IVC-120G" },
246 { 0xa182ff02, BTTV_BOARD_IVC120
, "IVC-120G" },
247 { 0xa182ff03, BTTV_BOARD_IVC120
, "IVC-120G" },
248 { 0xa182ff04, BTTV_BOARD_IVC120
, "IVC-120G" },
249 { 0xa182ff05, BTTV_BOARD_IVC120
, "IVC-120G" },
250 { 0xa182ff06, BTTV_BOARD_IVC120
, "IVC-120G" },
251 { 0xa182ff07, BTTV_BOARD_IVC120
, "IVC-120G" },
252 { 0xa182ff08, BTTV_BOARD_IVC120
, "IVC-120G" },
253 { 0xa182ff09, BTTV_BOARD_IVC120
, "IVC-120G" },
254 { 0xa182ff0a, BTTV_BOARD_IVC120
, "IVC-120G" },
255 { 0xa182ff0b, BTTV_BOARD_IVC120
, "IVC-120G" },
256 { 0xa182ff0c, BTTV_BOARD_IVC120
, "IVC-120G" },
257 { 0xa182ff0d, BTTV_BOARD_IVC120
, "IVC-120G" },
258 { 0xa182ff0e, BTTV_BOARD_IVC120
, "IVC-120G" },
259 { 0xa182ff0f, BTTV_BOARD_IVC120
, "IVC-120G" },
261 { 0x41424344, BTTV_BOARD_GRANDTEC
, "GrandTec Multi Capture" },
262 { 0x01020304, BTTV_BOARD_XGUARD
, "Grandtec Grand X-Guard" },
264 { 0x18501851, BTTV_BOARD_CHRONOS_VS2
, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
265 { 0xa0501851, BTTV_BOARD_CHRONOS_VS2
, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
266 { 0x18511851, BTTV_BOARD_FLYVIDEO98EZ
, "FlyVideo 98EZ (LR51)/ CyberMail AV" },
267 { 0x18521852, BTTV_BOARD_TYPHOON_TVIEW
, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
268 { 0x41a0a051, BTTV_BOARD_FLYVIDEO_98FM
, "Lifeview FlyVideo 98 LR50 Rev Q" },
269 { 0x18501f7f, BTTV_BOARD_FLYVIDEO_98
, "Lifeview Flyvideo 98" },
271 { 0x010115cb, BTTV_BOARD_GMV1
, "AG GMV1" },
272 { 0x010114c7, BTTV_BOARD_MODTEC_205
, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
274 { 0x10b42636, BTTV_BOARD_HAUPPAUGE878
, "STB ???" },
275 { 0x217d6606, BTTV_BOARD_WINFAST2000
, "Leadtek WinFast TV 2000" },
276 { 0xfff6f6ff, BTTV_BOARD_WINFAST2000
, "Leadtek WinFast TV 2000" },
277 { 0x03116000, BTTV_BOARD_SENSORAY311
, "Sensoray 311" },
278 { 0x00790e11, BTTV_BOARD_WINDVR
, "Canopus WinDVR PCI" },
279 { 0xa0fca1a0, BTTV_BOARD_ZOLTRIX
, "Face to Face Tvmax" },
280 { 0x82b2aa6a, BTTV_BOARD_SIMUS_GVC1100
, "SIMUS GVC1100" },
281 { 0x146caa0c, BTTV_BOARD_PV951
, "ituner spectra8" },
282 { 0x200a1295, BTTV_BOARD_PXC200
, "ImageNation PXC200A" },
284 { 0x40111554, BTTV_BOARD_PV_BT878P_9B
, "Prolink Pixelview PV-BT" },
285 { 0x17de0a01, BTTV_BOARD_KWORLD
, "Mecer TV/FM/Video Tuner" },
287 { 0x01051805, BTTV_BOARD_PICOLO_TETRA_CHIP
, "Picolo Tetra Chip #1" },
288 { 0x01061805, BTTV_BOARD_PICOLO_TETRA_CHIP
, "Picolo Tetra Chip #2" },
289 { 0x01071805, BTTV_BOARD_PICOLO_TETRA_CHIP
, "Picolo Tetra Chip #3" },
290 { 0x01081805, BTTV_BOARD_PICOLO_TETRA_CHIP
, "Picolo Tetra Chip #4" },
292 { 0x15409511, BTTV_BOARD_ACORP_Y878F
, "Acorp Y878F" },
294 /* likely broken, vendor id doesn't match the other magic views ...
295 * { 0xa0fca04f, BTTV_BOARD_MAGICTVIEW063, "Guillemot Maxi TV Video 3" }, */
297 /* Duplicate PCI ID, reconfigure for this board during the eeprom read.
298 * { 0x13eb0070, BTTV_BOARD_HAUPPAUGE_IMPACTVCB, "Hauppauge ImpactVCB" }, */
300 /* DVB cards (using pci function .1 for mpeg data xfer) */
301 { 0x001c11bd, BTTV_BOARD_PINNACLESAT
, "Pinnacle PCTV Sat" },
302 { 0x01010071, BTTV_BOARD_NEBULA_DIGITV
, "Nebula Electronics DigiTV" },
303 { 0x20007063, BTTV_BOARD_PC_HDTV
, "pcHDTV HD-2000 TV"},
304 { 0x002611bd, BTTV_BOARD_TWINHAN_DST
, "Pinnacle PCTV SAT CI" },
305 { 0x00011822, BTTV_BOARD_TWINHAN_DST
, "Twinhan VisionPlus DVB" },
306 { 0xfc00270f, BTTV_BOARD_TWINHAN_DST
, "ChainTech digitop DST-1000 DVB-S" },
307 { 0x07711461, BTTV_BOARD_AVDVBT_771
, "AVermedia AverTV DVB-T 771" },
308 { 0x07611461, BTTV_BOARD_AVDVBT_761
, "AverMedia AverTV DVB-T 761" },
309 { 0xdb1018ac, BTTV_BOARD_DVICO_DVBT_LITE
, "DViCO FusionHDTV DVB-T Lite" },
310 { 0xd50018ac, BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE
, "DViCO FusionHDTV 5 Lite" },
315 /* ----------------------------------------------------------------------- */
316 /* array with description for bt848 / bt878 tv/grabber cards */
318 struct tvcard bttv_tvcards
[] = {
319 /* ---- card 0x00 ---------------------------------- */
320 [BTTV_BOARD_UNKNOWN
] = {
321 .name
= " *** UNKNOWN/GENERIC *** ",
326 .muxsel
= { 2, 3, 1, 0 },
328 .tuner_addr
= ADDR_UNSET
,
329 .radio_addr
= ADDR_UNSET
,
331 [BTTV_BOARD_MIRO
] = {
338 .muxsel
= { 2, 3, 1, 1 },
339 .audiomux
= { 2, 0, 0, 0, 10 },
342 .tuner_addr
= ADDR_UNSET
,
343 .radio_addr
= ADDR_UNSET
,
345 [BTTV_BOARD_HAUPPAUGE
] = {
346 .name
= "Hauppauge (bt848)",
352 .muxsel
= { 2, 3, 1, 1 },
353 .audiomux
= { 0, 1, 2, 3, 4 },
356 .tuner_addr
= ADDR_UNSET
,
357 .radio_addr
= ADDR_UNSET
,
360 .name
= "STB, Gateway P/N 6000699 (bt848)",
366 .muxsel
= { 2, 3, 1, 1 },
367 .audiomux
= { 4, 0, 2, 3, 1 },
370 .tuner_type
= TUNER_PHILIPS_NTSC
,
371 .tuner_addr
= ADDR_UNSET
,
372 .radio_addr
= ADDR_UNSET
,
377 /* ---- card 0x04 ---------------------------------- */
378 [BTTV_BOARD_INTEL
] = {
379 .name
= "Intel Create and Share PCI/ Smart Video Recorder III",
385 .muxsel
= { 2, 3, 1, 1 },
389 .tuner_addr
= ADDR_UNSET
,
390 .radio_addr
= ADDR_UNSET
,
392 [BTTV_BOARD_DIAMOND
] = {
393 .name
= "Diamond DTV2000",
399 .muxsel
= { 2, 3, 1, 0 },
400 .audiomux
= { 0, 1, 0, 1, 3 },
403 .tuner_addr
= ADDR_UNSET
,
404 .radio_addr
= ADDR_UNSET
,
406 [BTTV_BOARD_AVERMEDIA
] = {
407 .name
= "AVerMedia TVPhone",
412 .muxsel
= { 2, 3, 1, 1 },
414 .audiomux
= { 0x0c, 0x04, 0x08, 0x04, 0 },
415 /* 0x04 for some cards ?? */
418 .tuner_addr
= ADDR_UNSET
,
419 .radio_addr
= ADDR_UNSET
,
420 .audio_hook
= avermedia_tvphone_audio
,
423 [BTTV_BOARD_MATRIX_VISION
] = {
424 .name
= "MATRIX-Vision MV-Delta",
430 .muxsel
= { 2, 3, 1, 0, 0 },
434 .tuner_addr
= ADDR_UNSET
,
435 .radio_addr
= ADDR_UNSET
,
438 /* ---- card 0x08 ---------------------------------- */
439 [BTTV_BOARD_FLYVIDEO
] = {
440 .name
= "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
446 .muxsel
= { 2, 3, 1, 1 },
447 .audiomux
= { 0, 0xc00, 0x800, 0x400, 0xc00, 0 },
451 .tuner_addr
= ADDR_UNSET
,
452 .radio_addr
= ADDR_UNSET
,
454 [BTTV_BOARD_TURBOTV
] = {
455 .name
= "IMS/IXmicro TurboTV",
461 .muxsel
= { 2, 3, 1, 1 },
462 .audiomux
= { 1, 1, 2, 3, 0 },
465 .tuner_type
= TUNER_TEMIC_PAL
,
466 .tuner_addr
= ADDR_UNSET
,
467 .radio_addr
= ADDR_UNSET
,
469 [BTTV_BOARD_HAUPPAUGE878
] = {
470 .name
= "Hauppauge (bt878)",
475 .gpiomask
= 0x0f, /* old: 7 */
476 .muxsel
= { 2, 0, 1, 1 },
477 .audiomux
= { 0, 1, 2, 3, 4 },
481 .tuner_addr
= ADDR_UNSET
,
482 .radio_addr
= ADDR_UNSET
,
484 [BTTV_BOARD_MIROPRO
] = {
485 .name
= "MIRO PCTV pro",
491 .muxsel
= { 2, 3, 1, 1 },
492 .audiomux
= { 0x20001,0x10001, 0, 0,10 },
495 .tuner_addr
= ADDR_UNSET
,
496 .radio_addr
= ADDR_UNSET
,
499 /* ---- card 0x0c ---------------------------------- */
500 [BTTV_BOARD_ADSTECH_TV
] = {
501 .name
= "ADS Technologies Channel Surfer TV (bt848)",
507 .muxsel
= { 2, 3, 1, 1 },
508 .audiomux
= { 13, 14, 11, 7, 0, 0 },
511 .tuner_addr
= ADDR_UNSET
,
512 .radio_addr
= ADDR_UNSET
,
514 [BTTV_BOARD_AVERMEDIA98
] = {
515 .name
= "AVerMedia TVCapture 98",
521 .muxsel
= { 2, 3, 1, 1 },
522 .audiomux
= { 13, 14, 11, 7, 0, 0 },
526 .tuner_type
= TUNER_PHILIPS_PAL
,
527 .tuner_addr
= ADDR_UNSET
,
528 .radio_addr
= ADDR_UNSET
,
529 .audio_hook
= avermedia_tv_stereo_audio
,
533 .name
= "Aimslab Video Highway Xtreme (VHX)",
539 .muxsel
= { 2, 3, 1, 1 },
540 .audiomux
= { 0, 2, 1, 3, 4 }, /* old: {0, 1, 2, 3, 4} */
544 .tuner_addr
= ADDR_UNSET
,
545 .radio_addr
= ADDR_UNSET
,
547 [BTTV_BOARD_ZOLTRIX
] = {
548 .name
= "Zoltrix TV-Max",
554 .muxsel
= { 2, 3, 1, 1 },
555 .audiomux
= { 0 , 0, 1 , 0, 10 },
558 .tuner_addr
= ADDR_UNSET
,
559 .radio_addr
= ADDR_UNSET
,
562 /* ---- card 0x10 ---------------------------------- */
563 [BTTV_BOARD_PIXVIEWPLAYTV
] = {
564 .name
= "Prolink Pixelview PlayTV (bt878)",
569 .gpiomask
= 0x01fe00,
570 .muxsel
= { 2, 3, 1, 1 },
573 .audiomux
= { 0x01c000, 0, 0x018000, 0x014000, 0x002000, 0 },
575 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
576 .audiomux
= { 0x001e00, 0, 0x018000, 0x014000, 0x002000, 0 },
582 [BTTV_BOARD_WINVIEW_601
] = {
583 .name
= "Leadtek WinView 601",
588 .gpiomask
= 0x8300f8,
589 .muxsel
= { 2, 3, 1, 1,0 },
590 .audiomux
= { 0x4fa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007 },
593 .tuner_addr
= ADDR_UNSET
,
594 .radio_addr
= ADDR_UNSET
,
595 .audio_hook
= winview_audio
,
598 [BTTV_BOARD_AVEC_INTERCAP
] = {
599 .name
= "AVEC Intercapture",
605 .muxsel
= { 2, 3, 1, 1 },
606 .audiomux
= { 1, 0, 0, 0, 0 },
609 .tuner_addr
= ADDR_UNSET
,
610 .radio_addr
= ADDR_UNSET
,
612 [BTTV_BOARD_LIFE_FLYKIT
] = {
613 .name
= "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
618 .gpiomask
= 0x8dff00,
619 .muxsel
= { 2, 3, 1, 1 },
623 .tuner_addr
= ADDR_UNSET
,
624 .radio_addr
= ADDR_UNSET
,
627 /* ---- card 0x14 ---------------------------------- */
628 [BTTV_BOARD_CEI_RAFFLES
] = {
629 .name
= "CEI Raffles Card",
634 .muxsel
= { 2, 3, 1, 1 },
636 .tuner_addr
= ADDR_UNSET
,
637 .radio_addr
= ADDR_UNSET
,
639 [BTTV_BOARD_CONFERENCETV
] = {
640 .name
= "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
642 .audio_inputs
= 2, /* tuner, line in */
646 .muxsel
= { 2, 3, 1, 1 },
647 .audiomux
= { 0, 0x800, 0x1000, 0x1000, 0x1800 },
649 .tuner_type
= TUNER_PHILIPS_PAL_I
,
650 .tuner_addr
= ADDR_UNSET
,
651 .radio_addr
= ADDR_UNSET
,
653 [BTTV_BOARD_PHOEBE_TVMAS
] = {
654 .name
= "Askey CPH050/ Phoebe Tv Master + FM",
660 .muxsel
= { 2, 3, 1, 1 },
661 .audiomux
= { 0, 1, 0x800, 0x400, 0xc00, 0 },
665 .tuner_addr
= ADDR_UNSET
,
666 .radio_addr
= ADDR_UNSET
,
668 [BTTV_BOARD_MODTEC_205
] = {
669 .name
= "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
675 .muxsel
= { 2, 3, -1 },
676 .digital_mode
= DIGITAL_MODE_CAMERA
,
677 .audiomux
= { 0, 0, 0, 0, 0 },
680 .tuner_type
= TUNER_ALPS_TSBB5_PAL_I
,
681 .tuner_addr
= ADDR_UNSET
,
682 .radio_addr
= ADDR_UNSET
,
685 /* ---- card 0x18 ---------------------------------- */
686 [BTTV_BOARD_MAGICTVIEW061
] = {
687 .name
= "Askey CPH05X/06X (bt878) [many vendors]",
693 .muxsel
= { 2, 3, 1, 1 },
694 .audiomux
= {0x400, 0x400, 0x400, 0x400, 0xc00 },
698 .tuner_addr
= ADDR_UNSET
,
699 .radio_addr
= ADDR_UNSET
,
702 [BTTV_BOARD_VOBIS_BOOSTAR
] = {
703 .name
= "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
708 .gpiomask
= 0x1f0fff,
709 .muxsel
= { 2, 3, 1, 1 },
710 .audiomux
= { 0x20000, 0x30000, 0x10000, 0, 0x40000 },
712 .tuner_type
= TUNER_PHILIPS_PAL
,
713 .tuner_addr
= ADDR_UNSET
,
714 .radio_addr
= ADDR_UNSET
,
715 .audio_hook
= terratv_audio
,
717 [BTTV_BOARD_HAUPPAUG_WCAM
] = {
718 .name
= "Hauppauge WinCam newer (bt878)",
724 .muxsel
= { 2, 0, 1, 1 },
725 .audiomux
= { 0, 1, 2, 3, 4 },
728 .tuner_addr
= ADDR_UNSET
,
729 .radio_addr
= ADDR_UNSET
,
731 [BTTV_BOARD_MAXI
] = {
732 .name
= "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
738 .muxsel
= { 2, 3, 1, 1 },
739 .audiomux
= { 0, 0x800, 0x1000, 0x1000, 0x1800 },
741 .tuner_type
= TUNER_PHILIPS_SECAM
,
742 .tuner_addr
= ADDR_UNSET
,
743 .radio_addr
= ADDR_UNSET
,
746 /* ---- card 0x1c ---------------------------------- */
747 [BTTV_BOARD_TERRATV
] = {
748 .name
= "Terratec TerraTV+ Version 1.1 (bt878)",
753 .gpiomask
= 0x1f0fff,
754 .muxsel
= { 2, 3, 1, 1 },
755 .audiomux
= { 0x20000, 0x30000, 0x10000, 0x00000, 0x40000 },
757 .tuner_type
= TUNER_PHILIPS_PAL
,
758 .tuner_addr
= ADDR_UNSET
,
759 .radio_addr
= ADDR_UNSET
,
760 .audio_hook
= terratv_audio
,
762 External 20 pin connector (for Active Radio Upgrade board)
768 gpio05: om5610-stereo
772 gpio09+10: nIOR, nSEL ?? (bt878)
776 gpio16: u2-A0 (1st 4052bt)
779 gpio19: u4-A0 (2nd 4052)
783 00000 : Cdrom (internal audio input)
784 10000 : ext. Video audio input
793 [BTTV_BOARD_PXC200
] = {
794 /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
795 .name
= "Imagenation PXC200",
799 .svhs
= 1, /* was: 4 */
801 .muxsel
= { 2, 3, 1, 0, 0},
805 .tuner_addr
= ADDR_UNSET
,
806 .radio_addr
= ADDR_UNSET
,
807 .muxsel_hook
= PXC200_muxsel
,
810 [BTTV_BOARD_FLYVIDEO_98
] = {
811 .name
= "Lifeview FlyVideo 98 LR50",
816 .gpiomask
= 0x1800, /* 0x8dfe00 */
817 .muxsel
= { 2, 3, 1, 1 },
818 .audiomux
= { 0, 0x0800, 0x1000, 0x1000, 0x1800, 0 },
821 .tuner_addr
= ADDR_UNSET
,
822 .radio_addr
= ADDR_UNSET
,
824 [BTTV_BOARD_IPROTV
] = {
825 .name
= "Formac iProTV, Formac ProTV I (bt848)",
831 .muxsel
= { 2, 3, 1, 1 },
832 .audiomux
= { 1, 0, 0, 0, 0 },
834 .tuner_type
= TUNER_PHILIPS_PAL
,
835 .tuner_addr
= ADDR_UNSET
,
836 .radio_addr
= ADDR_UNSET
,
839 /* ---- card 0x20 ---------------------------------- */
840 [BTTV_BOARD_INTEL_C_S_PCI
] = {
841 .name
= "Intel Create and Share PCI/ Smart Video Recorder III",
847 .muxsel
= { 2, 3, 1, 1 },
851 .tuner_addr
= ADDR_UNSET
,
852 .radio_addr
= ADDR_UNSET
,
854 [BTTV_BOARD_TERRATVALUE
] = {
855 .name
= "Terratec TerraTValue Version Bt878",
860 .gpiomask
= 0xffff00,
861 .muxsel
= { 2, 3, 1, 1 },
862 .audiomux
= { 0x500, 0, 0x300, 0x900, 0x900 },
865 .tuner_type
= TUNER_PHILIPS_PAL
,
866 .tuner_addr
= ADDR_UNSET
,
867 .radio_addr
= ADDR_UNSET
,
869 [BTTV_BOARD_WINFAST2000
] = {
870 .name
= "Leadtek WinFast 2000/ WinFast 2000 XP",
875 .muxsel
= { 2, 3, 1, 1, 0 }, /* TV, CVid, SVid, CVid over SVid connector */
877 .gpiomask
= 0xc33000,
878 .audiomux
= { 0x422000,0x1000,0x0000,0x620000,0x800000 },
880 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
881 .gpiomask
= 0xb33000,
882 .audiomux
= { 0x122000,0x1000,0x0000,0x620000,0x800000 },
884 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
885 gpio23 -- hef4052:nEnable (0x800000)
888 0x0000: external audio
892 Note: There exists another variant "Winfast 2000" with tv stereo !?
893 Note: eeprom only contains FF and pci subsystem id 107d:6606
898 .tuner_type
= 5, /* default for now, gpio reads BFFF06 for Pal bg+dk */
899 .tuner_addr
= ADDR_UNSET
,
900 .radio_addr
= ADDR_UNSET
,
901 .audio_hook
= winfast2000_audio
,
904 [BTTV_BOARD_CHRONOS_VS2
] = {
905 .name
= "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
911 .muxsel
= { 2, 3, 1, 1 },
912 .audiomux
= { 0, 0x800, 0x1000, 0x1000, 0x1800 },
915 .tuner_addr
= ADDR_UNSET
,
916 .radio_addr
= ADDR_UNSET
,
919 /* ---- card 0x24 ---------------------------------- */
920 [BTTV_BOARD_TYPHOON_TVIEW
] = {
921 .name
= "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
927 .muxsel
= { 2, 3, 1, 1 },
928 .audiomux
= { 0, 0x800, 0x1000, 0x1000, 0x1800, 0 },
931 .tuner_addr
= ADDR_UNSET
,
932 .radio_addr
= ADDR_UNSET
,
935 [BTTV_BOARD_PXELVWPLTVPRO
] = {
936 .name
= "Prolink PixelView PlayTV pro",
942 .muxsel
= { 2, 3, 1, 1 },
943 .audiomux
= { 0x21, 0x20, 0x24, 0x2c, 0x29, 0x29 },
947 .tuner_addr
= ADDR_UNSET
,
948 .radio_addr
= ADDR_UNSET
,
950 [BTTV_BOARD_MAGICTVIEW063
] = {
951 .name
= "Askey CPH06X TView99",
956 .gpiomask
= 0x551e00,
957 .muxsel
= { 2, 3, 1, 0 },
958 .audiomux
= { 0x551400, 0x551200, 0, 0, 0x551c00, 0x551200 },
962 .tuner_addr
= ADDR_UNSET
,
963 .radio_addr
= ADDR_UNSET
,
966 [BTTV_BOARD_PINNACLE
] = {
967 .name
= "Pinnacle PCTV Studio/Rave",
972 .gpiomask
= 0x03000F,
973 .muxsel
= { 2, 3, 1, 1 },
974 .audiomux
= { 2, 0xd0001, 0, 0, 1 },
978 .tuner_addr
= ADDR_UNSET
,
979 .radio_addr
= ADDR_UNSET
,
982 /* ---- card 0x28 ---------------------------------- */
983 [BTTV_BOARD_STB2
] = {
984 .name
= "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
990 .muxsel
= { 2, 3, 1, 1 },
991 .audiomux
= { 4, 0, 2, 3, 1 },
994 .tuner_type
= TUNER_PHILIPS_NTSC
,
995 .tuner_addr
= ADDR_UNSET
,
996 .radio_addr
= ADDR_UNSET
,
1000 [BTTV_BOARD_AVPHONE98
] = {
1001 .name
= "AVerMedia TVPhone 98",
1007 .muxsel
= { 2, 3, 1, 1 },
1008 .audiomux
= { 13, 4, 11, 7, 0, 0 },
1012 .tuner_addr
= ADDR_UNSET
,
1013 .radio_addr
= ADDR_UNSET
,
1015 .audio_hook
= avermedia_tvphone_audio
,
1017 [BTTV_BOARD_PV951
] = {
1018 .name
= "ProVideo PV951", /* pic16c54 */
1024 .muxsel
= { 2, 3, 1, 1},
1025 .audiomux
= { 0, 0, 0, 0, 0},
1030 .tuner_addr
= ADDR_UNSET
,
1031 .radio_addr
= ADDR_UNSET
,
1033 [BTTV_BOARD_ONAIR_TV
] = {
1034 .name
= "Little OnAir TV",
1040 .muxsel
= { 2, 3, 1, 1 },
1041 .audiomux
= { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0, 0xff3ffc },
1044 .tuner_addr
= ADDR_UNSET
,
1045 .radio_addr
= ADDR_UNSET
,
1048 /* ---- card 0x2c ---------------------------------- */
1049 [BTTV_BOARD_SIGMA_TVII_FM
] = {
1050 .name
= "Sigma TVII-FM",
1056 .muxsel
= { 2, 3, 1, 1 },
1057 .audiomux
= { 1, 1, 0, 2, 3 },
1061 .tuner_addr
= ADDR_UNSET
,
1062 .radio_addr
= ADDR_UNSET
,
1064 [BTTV_BOARD_MATRIX_VISION2
] = {
1065 .name
= "MATRIX-Vision MV-Delta 2",
1071 .muxsel
= { 2, 3, 1, 0, 0 },
1076 .tuner_addr
= ADDR_UNSET
,
1077 .radio_addr
= ADDR_UNSET
,
1079 [BTTV_BOARD_ZOLTRIX_GENIE
] = {
1080 .name
= "Zoltrix Genie TV/FM",
1085 .gpiomask
= 0xbcf03f,
1086 .muxsel
= { 2, 3, 1, 1 },
1087 .audiomux
= { 0xbc803f, 0xbc903f, 0xbcb03f, 0, 0xbcb03f },
1091 .tuner_addr
= ADDR_UNSET
,
1092 .radio_addr
= ADDR_UNSET
,
1094 [BTTV_BOARD_TERRATVRADIO
] = {
1095 .name
= "Terratec TV/Radio+",
1100 .gpiomask
= 0x70000,
1101 .muxsel
= { 2, 3, 1, 1 },
1102 .audiomux
= { 0x20000, 0x30000, 0x10000, 0, 0x40000, 0x20000 },
1107 .tuner_addr
= ADDR_UNSET
,
1108 .radio_addr
= ADDR_UNSET
,
1112 /* ---- card 0x30 ---------------------------------- */
1113 [BTTV_BOARD_DYNALINK
] = {
1114 .name
= "Askey CPH03x/ Dynalink Magic TView",
1120 .muxsel
= { 2, 3, 1, 1 },
1121 .audiomux
= {2,0,0,0,1 },
1125 .tuner_addr
= ADDR_UNSET
,
1126 .radio_addr
= ADDR_UNSET
,
1128 [BTTV_BOARD_GVBCTV3PCI
] = {
1129 .name
= "IODATA GV-BCTV3/PCI",
1134 .gpiomask
= 0x010f00,
1135 .muxsel
= {2, 3, 0, 0 },
1136 .audiomux
= {0x10000, 0, 0x10000, 0, 0, 0 },
1139 .tuner_type
= TUNER_ALPS_TSHC6_NTSC
,
1140 .tuner_addr
= ADDR_UNSET
,
1141 .radio_addr
= ADDR_UNSET
,
1142 .audio_hook
= gvbctv3pci_audio
,
1144 [BTTV_BOARD_PXELVWPLTVPAK
] = {
1145 .name
= "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
1150 .gpiomask
= 0xAA0000,
1151 .muxsel
= { 2,3,1,1,-1 },
1152 .digital_mode
= DIGITAL_MODE_CAMERA
,
1153 .audiomux
= { 0x20000, 0, 0x80000, 0x80000, 0xa8000, 0x46000 },
1156 .tuner_type
= TUNER_PHILIPS_PAL_I
,
1157 .tuner_addr
= ADDR_UNSET
,
1158 .radio_addr
= ADDR_UNSET
,
1160 /* GPIO wiring: (different from Rev.4C !)
1161 GPIO17: U4.A0 (first hef4052bt)
1163 GPIO20: U5.A1 (second hef4052bt)
1165 GPIO22: BT832 Reset Line
1166 GPIO23: A5,A0, U5,nEN
1167 Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
1170 [BTTV_BOARD_EAGLE
] = {
1171 .name
= "Eagle Wireless Capricorn2 (bt878A)",
1177 .muxsel
= { 2, 0, 1, 1 },
1178 .audiomux
= { 0, 1, 2, 3, 4 },
1180 .tuner_type
= -1 /* TUNER_ALPS_TMDH2_NTSC */,
1181 .tuner_addr
= ADDR_UNSET
,
1182 .radio_addr
= ADDR_UNSET
,
1185 /* ---- card 0x34 ---------------------------------- */
1186 [BTTV_BOARD_PINNACLEPRO
] = {
1187 /* David Härdeman <david@2gen.com> */
1188 .name
= "Pinnacle PCTV Studio Pro",
1193 .gpiomask
= 0x03000F,
1194 .muxsel
= { 2, 3, 1, 1 },
1195 .audiomux
= { 1, 0xd0001, 0, 0, 10 },
1196 /* sound path (5 sources):
1197 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
1200 2= Mono TV sound from Tuner
1202 MUX2 (mask 0x30000):
1204 1= FM stereo Radio from Tuner */
1208 .tuner_addr
= ADDR_UNSET
,
1209 .radio_addr
= ADDR_UNSET
,
1211 [BTTV_BOARD_TVIEW_RDS_FM
] = {
1212 /* Claas Langbehn <claas@bigfoot.com>,
1213 Sven Grothklags <sven@upb.de> */
1214 .name
= "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1220 .muxsel
= { 2, 3, 1, 1 },
1221 .audiomux
= { 0, 0, 0x10, 8, 4 },
1224 .tuner_type
= TUNER_PHILIPS_PAL
,
1225 .tuner_addr
= ADDR_UNSET
,
1226 .radio_addr
= ADDR_UNSET
,
1229 [BTTV_BOARD_LIFETEC_9415
] = {
1230 /* Tim Röstermundt <rosterm@uni-muenster.de>
1231 in de.comp.os.unix.linux.hardware:
1232 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
1233 audiomux=0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
1234 options tuner type=5 */
1235 .name
= "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1241 .muxsel
= { 2, 3, 1, 1 },
1242 .audiomux
= { 0x0000,0x0800,0x1000,0x1000,0x18e0 },
1243 /* For cards with tda9820/tda9821:
1244 0x0000: Tuner normal stereo
1245 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
1246 0x0880: Tuner A2 stereo */
1249 .tuner_addr
= ADDR_UNSET
,
1250 .radio_addr
= ADDR_UNSET
,
1252 [BTTV_BOARD_BESTBUY_EASYTV
] = {
1253 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1254 old Easy TV BT848 version (model CPH031) */
1255 .name
= "Askey CPH031/ BESTBUY Easy TV",
1261 .muxsel
= { 2, 3, 1, 0 },
1262 .audiomux
= { 2, 0, 0, 0, 10 },
1265 .tuner_type
= TUNER_TEMIC_PAL
,
1266 .tuner_addr
= ADDR_UNSET
,
1267 .radio_addr
= ADDR_UNSET
,
1270 /* ---- card 0x38 ---------------------------------- */
1271 [BTTV_BOARD_FLYVIDEO_98FM
] = {
1272 /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
1273 .name
= "Lifeview FlyVideo 98FM LR50",
1279 .muxsel
= { 2, 3, 1, 1 },
1280 .audiomux
= { 0, 0x800, 0x1000, 0x1000, 0x1800, 0 },
1283 .tuner_addr
= ADDR_UNSET
,
1284 .radio_addr
= ADDR_UNSET
,
1286 /* This is the ultimate cheapo capture card
1287 * just a BT848A on a small PCB!
1288 * Steve Hosgood <steve@equiinet.com> */
1289 [BTTV_BOARD_GRANDTEC
] = {
1290 .name
= "GrandTec 'Grand Video Capture' (Bt848)",
1302 .tuner_addr
= ADDR_UNSET
,
1303 .radio_addr
= ADDR_UNSET
,
1305 [BTTV_BOARD_ASKEY_CPH060
] = {
1306 /* Daniel Herrington <daniel.herrington@home.com> */
1307 .name
= "Askey CPH060/ Phoebe TV Master Only (No FM)",
1313 .muxsel
= { 2, 3, 1, 1},
1314 .audiomux
= { 0x400, 0x400, 0x400, 0x400, 0x800, 0x400 },
1317 .tuner_type
= TUNER_TEMIC_4036FY5_NTSC
,
1318 .tuner_addr
= ADDR_UNSET
,
1319 .radio_addr
= ADDR_UNSET
,
1321 [BTTV_BOARD_ASKEY_CPH03X
] = {
1322 /* Matti Mottus <mottus@physic.ut.ee> */
1323 .name
= "Askey CPH03x TV Capturer",
1328 .gpiomask
= 0x03000F,
1329 .muxsel
= { 2, 3, 1, 0 },
1330 .audiomux
= { 2, 0, 0, 0, 1 },
1333 .tuner_addr
= ADDR_UNSET
,
1334 .radio_addr
= ADDR_UNSET
,
1337 /* ---- card 0x3c ---------------------------------- */
1338 [BTTV_BOARD_MM100PCTV
] = {
1339 /* Philip Blundell <philb@gnu.org> */
1340 .name
= "Modular Technology MM100PCTV",
1346 .muxsel
= { 2, 3, 1, 1 },
1347 .audiomux
= { 2, 0, 0, 1, 8 },
1349 .tuner_type
= TUNER_TEMIC_PAL
,
1350 .tuner_addr
= ADDR_UNSET
,
1351 .radio_addr
= ADDR_UNSET
,
1353 [BTTV_BOARD_GMV1
] = {
1354 /* Adrian Cox <adrian@humboldt.co.uk */
1355 .name
= "AG Electronics GMV1",
1367 .tuner_addr
= ADDR_UNSET
,
1368 .radio_addr
= ADDR_UNSET
,
1370 [BTTV_BOARD_BESTBUY_EASYTV2
] = {
1371 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1372 new Easy TV BT878 version (model CPH061)
1373 special thanks to Informatica Mieres for providing the card */
1374 .name
= "Askey CPH061/ BESTBUY Easy TV (bt878)",
1380 .muxsel
= { 2, 3, 1, 0 },
1381 .audiomux
= { 1, 0, 4, 4, 9 },
1384 .tuner_type
= TUNER_PHILIPS_PAL
,
1385 .tuner_addr
= ADDR_UNSET
,
1386 .radio_addr
= ADDR_UNSET
,
1388 [BTTV_BOARD_ATI_TVWONDER
] = {
1389 /* Lukas Gebauer <geby@volny.cz> */
1390 .name
= "ATI TV-Wonder",
1396 .muxsel
= { 2, 3, 1, 0 },
1397 .audiomux
= { 0xbffe, 0, 0xbfff, 0, 0xbffe },
1399 .tuner_type
= TUNER_TEMIC_4006FN5_MULTI_PAL
,
1400 .tuner_addr
= ADDR_UNSET
,
1401 .radio_addr
= ADDR_UNSET
,
1404 /* ---- card 0x40 ---------------------------------- */
1405 [BTTV_BOARD_ATI_TVWONDERVE
] = {
1406 /* Lukas Gebauer <geby@volny.cz> */
1407 .name
= "ATI TV-Wonder VE",
1413 .muxsel
= { 2, 3, 0, 1 },
1414 .audiomux
= { 0, 0, 1, 0, 0 },
1417 .tuner_type
= TUNER_TEMIC_4006FN5_MULTI_PAL
,
1418 .tuner_addr
= ADDR_UNSET
,
1419 .radio_addr
= ADDR_UNSET
,
1421 [BTTV_BOARD_FLYVIDEO2000
] = {
1422 /* DeeJay <deejay@westel900.net (2000S) */
1423 .name
= "Lifeview FlyVideo 2000S LR90",
1429 .muxsel
= { 2, 3, 0, 1 },
1430 /* Radio changed from 1e80 to 0x800 to make
1431 FlyVideo2000S in .hu happy (gm)*/
1432 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
1433 .audiomux
= { 0x0000,0x0800,0x1000,0x1000,0x1800, 0x1080 },
1434 .audio_hook
= fv2000s_audio
,
1440 .tuner_addr
= ADDR_UNSET
,
1441 .radio_addr
= ADDR_UNSET
,
1443 [BTTV_BOARD_TERRATVALUER
] = {
1444 .name
= "Terratec TValueRadio",
1449 .gpiomask
= 0xffff00,
1450 .muxsel
= { 2, 3, 1, 1 },
1451 .audiomux
= { 0x500, 0x500, 0x300, 0x900, 0x900 },
1454 .tuner_type
= TUNER_PHILIPS_PAL
,
1455 .tuner_addr
= ADDR_UNSET
,
1456 .radio_addr
= ADDR_UNSET
,
1459 [BTTV_BOARD_GVBCTV4PCI
] = {
1460 /* TANAKA Kei <peg00625@nifty.com> */
1461 .name
= "IODATA GV-BCTV4/PCI",
1466 .gpiomask
= 0x010f00,
1467 .muxsel
= {2, 3, 0, 0 },
1468 .audiomux
= {0x10000, 0, 0x10000, 0, 0, 0 },
1471 .tuner_type
= TUNER_SHARP_2U5JF5540_NTSC
,
1472 .tuner_addr
= ADDR_UNSET
,
1473 .radio_addr
= ADDR_UNSET
,
1474 .audio_hook
= gvbctv3pci_audio
,
1477 /* ---- card 0x44 ---------------------------------- */
1478 [BTTV_BOARD_VOODOOTV_FM
] = {
1479 .name
= "3Dfx VoodooTV FM (Euro), VoodooTV 200 (USA)",
1480 /* try "insmod msp3400 simple=0" if you have
1481 * sound problems with this card. */
1486 .gpiomask
= 0x4f8a00,
1487 /* 0x100000: 1=MSP enabled (0=disable again)
1488 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1489 .audiomux
= {0x947fff, 0x987fff,0x947fff,0x947fff, 0x947fff},
1490 /* tvtuner, radio, external,internal, mute, stereo
1491 * tuner, Composit, SVid, Composit-on-Svid-adapter */
1492 .muxsel
= { 2, 3 ,0 ,1 },
1493 .tuner_type
= TUNER_MT2032
,
1494 .tuner_addr
= ADDR_UNSET
,
1495 .radio_addr
= ADDR_UNSET
,
1499 [BTTV_BOARD_AIMMS
] = {
1500 /* Philip Blundell <pb@nexus.co.uk> */
1501 .name
= "Active Imaging AIMMS",
1506 .tuner_addr
= ADDR_UNSET
,
1507 .radio_addr
= ADDR_UNSET
,
1512 [BTTV_BOARD_PV_BT878P_PLUS
] = {
1513 /* Tomasz Pyra <hellfire@sedez.iq.pl> */
1514 .name
= "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1520 .muxsel
= { 2, 3, 1, 1 },
1521 .audiomux
= { 0, 0, 11, 7, 13, 0 }, /* TV and Radio with same GPIO ! */
1525 .tuner_addr
= ADDR_UNSET
,
1526 .radio_addr
= ADDR_UNSET
,
1529 GPIO0: U4.A0 (hef4052bt)
1531 GPIO2: U4.A1 (second hef4052bt)
1532 GPIO3: U4.nEN, U5.A0, A5.nEN
1536 [BTTV_BOARD_FLYVIDEO98EZ
] = {
1537 .name
= "Lifeview FlyVideo 98EZ (capture only) LR51",
1542 .muxsel
= { 2, 3, 1, 1 }, /* AV1, AV2, SVHS, CVid adapter on SVHS */
1545 .tuner_type
= UNSET
,
1546 .tuner_addr
= ADDR_UNSET
,
1547 .radio_addr
= ADDR_UNSET
,
1550 /* ---- card 0x48 ---------------------------------- */
1551 [BTTV_BOARD_PV_BT878P_9B
] = {
1552 /* Dariusz Kowalewski <darekk@automex.pl> */
1553 .name
= "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1559 .muxsel
= { 2, 3, 1, 1 },
1560 .audiomux
= { 0x01, 0x00, 0x03, 0x03, 0x09, 0x02 },
1566 .tuner_addr
= ADDR_UNSET
,
1567 .radio_addr
= ADDR_UNSET
,
1568 .audio_hook
= pvbt878p9b_audio
, /* Note: not all cards have stereo */
1569 .has_radio
= 1, /* Note: not all cards have radio */
1576 GPIO20,22,23: R30,R29,R28
1579 [BTTV_BOARD_SENSORAY311
] = {
1580 /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
1581 /* you must jumper JP5 for the card to work */
1582 .name
= "Sensoray 311",
1588 .muxsel
= { 2, 3, 1, 0, 0 },
1592 .tuner_addr
= ADDR_UNSET
,
1593 .radio_addr
= ADDR_UNSET
,
1595 [BTTV_BOARD_RV605
] = {
1596 /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
1597 .name
= "RemoteVision MX (RV605)",
1603 .gpiomask2
= 0x07ff,
1604 .muxsel
= { 0x33, 0x13, 0x23, 0x43, 0xf3, 0x73, 0xe3, 0x03,
1605 0xd3, 0xb3, 0xc3, 0x63, 0x93, 0x53, 0x83, 0xa3 },
1609 .tuner_addr
= ADDR_UNSET
,
1610 .radio_addr
= ADDR_UNSET
,
1611 .muxsel_hook
= rv605_muxsel
,
1613 [BTTV_BOARD_POWERCLR_MTV878
] = {
1614 .name
= "Powercolor MTV878/ MTV878R/ MTV878F",
1619 .gpiomask
= 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
1620 .muxsel
= { 2, 1, 1, },
1621 .audiomux
= { 0, 1, 2, 2, 4 },
1623 .tuner_type
= TUNER_PHILIPS_PAL
,
1624 .tuner_addr
= ADDR_UNSET
,
1625 .radio_addr
= ADDR_UNSET
,
1630 /* ---- card 0x4c ---------------------------------- */
1631 [BTTV_BOARD_WINDVR
] = {
1632 /* Masaki Suzuki <masaki@btree.org> */
1633 .name
= "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1638 .gpiomask
= 0x140007,
1639 .muxsel
= { 2, 3, 1, 1 },
1640 .audiomux
= { 0, 1, 2, 3, 4, 0 },
1641 .tuner_type
= TUNER_PHILIPS_NTSC
,
1642 .tuner_addr
= ADDR_UNSET
,
1643 .radio_addr
= ADDR_UNSET
,
1644 .audio_hook
= windvr_audio
,
1646 [BTTV_BOARD_GRANDTEC_MULTI
] = {
1647 .name
= "GrandTec Multi Capture Card (Bt878)",
1653 .muxsel
= { 2, 3, 1, 0 },
1659 .tuner_addr
= ADDR_UNSET
,
1660 .radio_addr
= ADDR_UNSET
,
1662 [BTTV_BOARD_KWORLD
] = {
1663 .name
= "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1669 .muxsel
= { 2, 3, 1, 1 }, /* Tuner, SVid, SVHS, SVid to SVHS connector */
1670 .audiomux
= { 0 ,0 ,4, 4,4,4},/* Yes, this tuner uses the same audio output for TV and FM radio!
1671 * This card lacks external Audio In, so we mute it on Ext. & Int.
1672 * The PCB can take a sbx1637/sbx1673, wiring unknown.
1673 * This card lacks PCI subsystem ID, sigh.
1674 * audiomux=1: lower volume, 2+3: mute
1675 * btwincap uses 0x80000/0x80003
1681 .tuner_addr
= ADDR_UNSET
,
1682 .radio_addr
= ADDR_UNSET
,
1683 /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
1684 radio signal strength indicators work fine. */
1687 GPIO0,1: HEF4052 A0,A1
1688 GPIO2: HEF4052 nENABLE
1690 GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
1694 ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
1696 [BTTV_BOARD_DSP_TCVIDEO
] = {
1697 /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
1698 .name
= "DSP Design TCVIDEO",
1701 .muxsel
= { 2, 3, 1, 0 },
1704 .tuner_addr
= ADDR_UNSET
,
1705 .radio_addr
= ADDR_UNSET
,
1708 /* ---- card 0x50 ---------------------------------- */
1709 [BTTV_BOARD_HAUPPAUGEPVR
] = {
1710 .name
= "Hauppauge WinTV PVR",
1715 .muxsel
= { 2, 0, 1, 1 },
1719 .tuner_addr
= ADDR_UNSET
,
1720 .radio_addr
= ADDR_UNSET
,
1725 [BTTV_BOARD_GVBCTV5PCI
] = {
1726 .name
= "IODATA GV-BCTV5/PCI",
1731 .gpiomask
= 0x0f0f80,
1732 .muxsel
= {2, 3, 1, 0 },
1733 .audiomux
= {0x030000, 0x010000, 0, 0, 0x020000, 0},
1736 .tuner_type
= TUNER_PHILIPS_NTSC_M
,
1737 .tuner_addr
= ADDR_UNSET
,
1738 .radio_addr
= ADDR_UNSET
,
1739 .audio_hook
= gvbctv5pci_audio
,
1742 [BTTV_BOARD_OSPREY1x0
] = {
1743 .name
= "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
1744 .video_inputs
= 4, /* id-inputs-clock */
1748 .muxsel
= { 3, 2, 0, 1 },
1751 .tuner_addr
= ADDR_UNSET
,
1752 .radio_addr
= ADDR_UNSET
,
1757 [BTTV_BOARD_OSPREY1x0_848
] = {
1758 .name
= "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
1763 .muxsel
= { 2, 3, 1 },
1766 .tuner_addr
= ADDR_UNSET
,
1767 .radio_addr
= ADDR_UNSET
,
1773 /* ---- card 0x54 ---------------------------------- */
1774 [BTTV_BOARD_OSPREY101_848
] = {
1775 .name
= "Osprey 101 (848)", /* 0x05-40C0-C1 */
1783 .tuner_addr
= ADDR_UNSET
,
1784 .radio_addr
= ADDR_UNSET
,
1789 [BTTV_BOARD_OSPREY1x1
] = {
1790 .name
= "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
1798 .tuner_addr
= ADDR_UNSET
,
1799 .radio_addr
= ADDR_UNSET
,
1804 [BTTV_BOARD_OSPREY1x1_SVID
] = {
1805 .name
= "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
1813 .tuner_addr
= ADDR_UNSET
,
1814 .radio_addr
= ADDR_UNSET
,
1819 [BTTV_BOARD_OSPREY2xx
] = {
1820 .name
= "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
1827 .tuner_type
= UNSET
,
1828 .tuner_addr
= ADDR_UNSET
,
1829 .radio_addr
= ADDR_UNSET
,
1835 /* ---- card 0x58 ---------------------------------- */
1836 [BTTV_BOARD_OSPREY2x0_SVID
] = {
1837 .name
= "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
1844 .tuner_type
= UNSET
,
1845 .tuner_addr
= ADDR_UNSET
,
1846 .radio_addr
= ADDR_UNSET
,
1851 [BTTV_BOARD_OSPREY2x0
] = {
1852 .name
= "Osprey 210/220", /* 0x1(A|B)-04C0-C1 */
1859 .tuner_type
= UNSET
,
1860 .tuner_addr
= ADDR_UNSET
,
1861 .radio_addr
= ADDR_UNSET
,
1866 [BTTV_BOARD_OSPREY500
] = {
1867 .name
= "Osprey 500", /* 500 */
1875 .tuner_addr
= ADDR_UNSET
,
1876 .radio_addr
= ADDR_UNSET
,
1881 [BTTV_BOARD_OSPREY540
] = {
1882 .name
= "Osprey 540", /* 540 */
1886 #if 0 /* TODO ... */
1887 .svhs
= OSPREY540_SVID_ANALOG
,
1888 .muxsel
= { [OSPREY540_COMP_ANALOG
] = 2,
1889 [OSPREY540_SVID_ANALOG
] = 3, },
1893 .tuner_addr
= ADDR_UNSET
,
1894 .radio_addr
= ADDR_UNSET
,
1898 #if 0 /* TODO ... */
1899 .muxsel_hook
= osprey_540_muxsel
,
1900 .picture_hook
= osprey_540_set_picture
,
1904 /* ---- card 0x5C ---------------------------------- */
1905 [BTTV_BOARD_OSPREY2000
] = {
1906 .name
= "Osprey 2000", /* 2000 */
1913 .tuner_type
= UNSET
,
1914 .tuner_addr
= ADDR_UNSET
,
1915 .radio_addr
= ADDR_UNSET
,
1918 .no_tda7432
= 1, /* must avoid, conflicts with the bt860 */
1920 [BTTV_BOARD_IDS_EAGLE
] = {
1921 /* M G Berberich <berberic@forwiss.uni-passau.de> */
1922 .name
= "IDS Eagle",
1927 .tuner_addr
= ADDR_UNSET
,
1928 .radio_addr
= ADDR_UNSET
,
1931 .muxsel
= { 0, 1, 2, 3 },
1932 .muxsel_hook
= eagle_muxsel
,
1937 [BTTV_BOARD_PINNACLESAT
] = {
1938 .name
= "Pinnacle PCTV Sat",
1944 .tuner_addr
= ADDR_UNSET
,
1945 .radio_addr
= ADDR_UNSET
,
1949 .muxsel
= { 3, 0, 1, 2 },
1954 [BTTV_BOARD_FORMAC_PROTV
] = {
1955 .name
= "Formac ProTV II (bt878)",
1961 /* TV, Comp1, Composite over SVID con, SVID */
1962 .muxsel
= { 2, 3, 1, 1 },
1963 .audiomux
= { 2, 2, 0, 0, 0 },
1966 .tuner_type
= TUNER_PHILIPS_PAL
,
1967 .tuner_addr
= ADDR_UNSET
,
1968 .radio_addr
= ADDR_UNSET
,
1970 GPIO=0x00,0x01,0x03: mute (?)
1971 0x02: both TV and radio (tuner: FM1216/I)
1972 The card has onboard audio connectors labeled "cdrom" and "board",
1973 not soldered here, though unknown wiring.
1974 Card lacks: external audio in, pci subsystem id.
1978 /* ---- card 0x60 ---------------------------------- */
1979 [BTTV_BOARD_MACHTV
] = {
1986 .muxsel
= { 2, 3, 1, 1},
1987 .audiomux
= { 0, 1, 2, 3, 4},
1990 .tuner_addr
= ADDR_UNSET
,
1991 .radio_addr
= ADDR_UNSET
,
1994 [BTTV_BOARD_EURESYS_PICOLO
] = {
1995 .name
= "Euresys Picolo",
2004 .muxsel
= { 2, 0, 1},
2006 .tuner_type
= UNSET
,
2007 .tuner_addr
= ADDR_UNSET
,
2008 .radio_addr
= ADDR_UNSET
,
2010 [BTTV_BOARD_PV150
] = {
2011 /* Luc Van Hoeylandt <luc@e-magic.be> */
2012 .name
= "ProVideo PV150", /* 0x4f */
2023 .tuner_type
= UNSET
,
2024 .tuner_addr
= ADDR_UNSET
,
2025 .radio_addr
= ADDR_UNSET
,
2027 [BTTV_BOARD_AD_TVK503
] = {
2028 /* Hiroshi Takekawa <sian@big.or.jp> */
2029 /* This card lacks subsystem ID */
2030 .name
= "AD-TVK503", /* 0x63 */
2035 .gpiomask
= 0x001e8007,
2036 .muxsel
= { 2, 3, 1, 0 },
2037 /* Tuner, Radio, external, internal, off, on */
2038 .audiomux
= { 0x08, 0x0f, 0x0a, 0x08, 0x0f, 0x08 },
2043 .tuner_addr
= ADDR_UNSET
,
2044 .radio_addr
= ADDR_UNSET
,
2045 .audio_hook
= adtvk503_audio
,
2048 /* ---- card 0x64 ---------------------------------- */
2049 [BTTV_BOARD_HERCULES_SM_TV
] = {
2050 .name
= "Hercules Smart TV Stereo",
2056 .muxsel
= { 2, 3, 1, 1 },
2061 .tuner_addr
= ADDR_UNSET
,
2062 .radio_addr
= ADDR_UNSET
,
2064 - card lacks subsystem ID
2065 - stereo variant w/ daughter board with tda9874a @0xb0
2067 always from tda9874 independent of GPIO (?)
2068 external line in: unknown
2069 - Other chips: em78p156elp @ 0x96 (probably IR remote control)
2070 hef4053 (instead 4052) for unknown function
2073 [BTTV_BOARD_PACETV
] = {
2074 .name
= "Pace TV & Radio Card",
2079 .muxsel
= { 2, 3, 1, 1 }, /* Tuner, CVid, SVid, CVid over SVid connector */
2084 .tuner_addr
= ADDR_UNSET
,
2085 .radio_addr
= ADDR_UNSET
,
2088 /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
2089 only internal line out: (4pin header) RGGL
2090 Radio must be decoded by msp3410d (not routed through)*/
2092 .digital_mode = DIGITAL_MODE_CAMERA, todo!
2095 [BTTV_BOARD_IVC200
] = {
2096 /* Chris Willing <chris@vislab.usyd.edu.au> */
2102 .tuner_addr
= ADDR_UNSET
,
2103 .radio_addr
= ADDR_UNSET
,
2109 [BTTV_BOARD_XGUARD
] = {
2110 .name
= "Grand X-Guard / Trust 814PCI",
2116 .tuner_addr
= ADDR_UNSET
,
2117 .radio_addr
= ADDR_UNSET
,
2119 .muxsel
= { 2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0 },
2120 .muxsel_hook
= xguard_muxsel
,
2127 /* ---- card 0x68 ---------------------------------- */
2128 [BTTV_BOARD_NEBULA_DIGITV
] = {
2129 .name
= "Nebula Electronics DigiTV",
2133 .muxsel
= { 2, 3, 1, 0 },
2139 .tuner_addr
= ADDR_UNSET
,
2140 .radio_addr
= ADDR_UNSET
,
2146 [BTTV_BOARD_PV143
] = {
2147 /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
2148 .name
= "ProVideo PV143",
2154 .muxsel
= { 2, 3, 1, 0 },
2160 .tuner_addr
= ADDR_UNSET
,
2161 .radio_addr
= ADDR_UNSET
,
2163 [BTTV_BOARD_VD009X1_MINIDIN
] = {
2164 /* M.Klahr@phytec.de */
2165 .name
= "PHYTEC VD-009-X1 MiniDIN (bt878)",
2168 .tuner
= -1, /* card has no tuner */
2171 .muxsel
= { 2, 3, 1, 0 },
2172 .audiomux
= { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2176 .tuner_addr
= ADDR_UNSET
,
2177 .radio_addr
= ADDR_UNSET
,
2179 [BTTV_BOARD_VD009X1_COMBI
] = {
2180 .name
= "PHYTEC VD-009-X1 Combi (bt878)",
2183 .tuner
= -1, /* card has no tuner */
2186 .muxsel
= { 2, 3, 1, 1 },
2187 .audiomux
= { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2191 .tuner_addr
= ADDR_UNSET
,
2192 .radio_addr
= ADDR_UNSET
,
2195 /* ---- card 0x6c ---------------------------------- */
2196 [BTTV_BOARD_VD009_MINIDIN
] = {
2197 .name
= "PHYTEC VD-009 MiniDIN (bt878)",
2200 .tuner
= -1, /* card has no tuner */
2203 .gpiomask2
= 0x03, /* gpiomask2 defines the bits used to switch audio
2204 via the upper nibble of muxsel. here: used for
2205 xternal video-mux */
2206 .muxsel
= { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x00 },
2207 .audiomux
= { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2211 .tuner_addr
= ADDR_UNSET
,
2212 .radio_addr
= ADDR_UNSET
,
2214 [BTTV_BOARD_VD009_COMBI
] = {
2215 .name
= "PHYTEC VD-009 Combi (bt878)",
2218 .tuner
= -1, /* card has no tuner */
2221 .gpiomask2
= 0x03, /* gpiomask2 defines the bits used to switch audio
2222 via the upper nibble of muxsel. here: used for
2223 xternal video-mux */
2224 .muxsel
= { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x01 },
2225 .audiomux
= { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2229 .tuner_addr
= ADDR_UNSET
,
2230 .radio_addr
= ADDR_UNSET
,
2232 [BTTV_BOARD_IVC100
] = {
2238 .tuner_addr
= ADDR_UNSET
,
2239 .radio_addr
= ADDR_UNSET
,
2242 .muxsel
= { 2, 3, 1, 0 },
2245 [BTTV_BOARD_IVC120
] = {
2246 /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
2249 .audio_inputs
= 0, /* card has no audio */
2250 .tuner
= -1, /* card has no tuner */
2252 .tuner_addr
= ADDR_UNSET
,
2253 .radio_addr
= ADDR_UNSET
,
2254 .svhs
= -1, /* card has no svhs */
2260 .muxsel
= { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
2261 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 },
2262 .muxsel_hook
= ivc120_muxsel
,
2266 /* ---- card 0x70 ---------------------------------- */
2267 [BTTV_BOARD_PC_HDTV
] = {
2268 .name
= "pcHDTV HD-2000 TV",
2273 .muxsel
= { 2, 3, 1, 0 },
2274 .tuner_type
= TUNER_PHILIPS_ATSC
,
2275 .tuner_addr
= ADDR_UNSET
,
2276 .radio_addr
= ADDR_UNSET
,
2279 [BTTV_BOARD_TWINHAN_DST
] = {
2280 .name
= "Twinhan DST + clones",
2284 .tuner_type
= TUNER_ABSENT
,
2285 .tuner_addr
= ADDR_UNSET
,
2286 .radio_addr
= ADDR_UNSET
,
2290 [BTTV_BOARD_WINFASTVC100
] = {
2291 .name
= "Winfast VC100",
2296 .muxsel
= { 3, 1, 1, 3 }, /* Vid In, SVid In, Vid over SVid in connector */
2300 .tuner_type
= TUNER_ABSENT
,
2301 .tuner_addr
= ADDR_UNSET
,
2302 .radio_addr
= ADDR_UNSET
,
2305 [BTTV_BOARD_TEV560
] = {
2306 .name
= "Teppro TEV-560/InterVision IV-560",
2312 .muxsel
= { 2, 3, 1, 1 },
2313 .audiomux
= { 1, 1, 1, 1, 0 },
2315 .tuner_type
= TUNER_PHILIPS_PAL
,
2316 .tuner_addr
= ADDR_UNSET
,
2317 .radio_addr
= ADDR_UNSET
,
2321 /* ---- card 0x74 ---------------------------------- */
2322 [BTTV_BOARD_SIMUS_GVC1100
] = {
2323 .name
= "SIMUS GVC1100",
2329 .tuner_addr
= ADDR_UNSET
,
2330 .radio_addr
= ADDR_UNSET
,
2332 .muxsel
= { 2, 2, 2, 2 },
2334 .muxsel_hook
= gvc1100_muxsel
,
2336 [BTTV_BOARD_NGSTV_PLUS
] = {
2337 /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
2338 .name
= "NGS NGSTV+",
2342 .gpiomask
= 0x008007,
2343 .muxsel
= { 2, 3, 0, 0 },
2344 .audiomux
= { 0, 0, 0, 0, 0x000003, 0 },
2346 .tuner_type
= TUNER_PHILIPS_PAL
,
2347 .tuner_addr
= ADDR_UNSET
,
2348 .radio_addr
= ADDR_UNSET
,
2351 [BTTV_BOARD_LMLBT4
] = {
2352 /* http://linuxmedialabs.com */
2354 .video_inputs
= 4, /* IN1,IN2,IN3,IN4 */
2358 .muxsel
= { 2, 3, 1, 0 },
2364 .tuner_addr
= ADDR_UNSET
,
2365 .radio_addr
= ADDR_UNSET
,
2367 [BTTV_BOARD_TEKRAM_M205
] = {
2368 /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
2369 .name
= "Tekram M205 PRO",
2373 .tuner_type
= TUNER_PHILIPS_PAL
,
2374 .tuner_addr
= ADDR_UNSET
,
2375 .radio_addr
= ADDR_UNSET
,
2379 .muxsel
= { 2, 3, 1 },
2380 .audiomux
= { 0x68, 0x68, 0x61, 0x61, 0x00 },
2384 /* ---- card 0x78 ---------------------------------- */
2385 [BTTV_BOARD_CONTVFMI
] = {
2386 /* Javier Cendan Ares <jcendan@lycos.es> */
2387 /* bt878 TV + FM without subsystem ID */
2388 .name
= "Conceptronic CONTVFMi",
2393 .gpiomask
= 0x008007,
2394 .muxsel
= { 2, 3, 1, 1 },
2395 .audiomux
= { 0, 1, 2, 2, 3 },
2398 .tuner_type
= TUNER_PHILIPS_PAL
,
2399 .tuner_addr
= ADDR_UNSET
,
2400 .radio_addr
= ADDR_UNSET
,
2404 [BTTV_BOARD_PICOLO_TETRA_CHIP
] = {
2405 /*Eric DEBIEF <debief@telemsa.com>*/
2406 /*EURESYS Picolo Tetra : 4 Conexant Fusion 878A, no audio, video input set with analog multiplexers GPIO controled*/
2407 /* adds picolo_tetra_muxsel(), picolo_tetra_init(), the folowing declaration strucure, and #define BTTV_BOARD_PICOLO_TETRA_CHIP*/
2409 .name
= "Euresys Picolo Tetra",
2415 .gpiomask2
= 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
2419 .muxsel
= {2,2,2,2},/*878A input is always MUX0, see above.*/
2420 .audiomux
= { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2423 .muxsel_hook
= picolo_tetra_muxsel
,/*Required as it doesn't follow the classic input selection policy*/
2425 .tuner_addr
= ADDR_UNSET
,
2426 .radio_addr
= ADDR_UNSET
,
2428 [BTTV_BOARD_SPIRIT_TV
] = {
2429 /* Spirit TV Tuner from http://spiritmodems.com.au */
2430 /* Stafford Goodsell <surge@goliath.homeunix.org> */
2431 .name
= "Spirit TV Tuner",
2436 .gpiomask
= 0x0000000f,
2437 .muxsel
= { 2, 1, 1 },
2438 .audiomux
= { 0x02, 0x00, 0x00, 0x00, 0x00 },
2439 .tuner_type
= TUNER_TEMIC_PAL
,
2440 .tuner_addr
= ADDR_UNSET
,
2441 .radio_addr
= ADDR_UNSET
,
2445 [BTTV_BOARD_AVDVBT_771
] = {
2446 /* Wolfram Joost <wojo@frokaschwei.de> */
2447 .name
= "AVerMedia AVerTV DVB-T 771",
2451 .tuner_type
= TUNER_ABSENT
,
2452 .tuner_addr
= ADDR_UNSET
,
2453 .radio_addr
= ADDR_UNSET
,
2454 .muxsel
= { 3 , 3 },
2463 /* ---- card 0x7c ---------------------------------- */
2464 [BTTV_BOARD_AVDVBT_761
] = {
2465 /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
2466 /* Based on the Nebula card data - added remote and new card number - BTTV_BOARD_AVDVBT_761, see also ir-kbd-gpio.c */
2467 .name
= "AverMedia AverTV DVB-T 761",
2471 .muxsel
= { 3, 1, 2, 0 }, /* Comp0, S-Video, ?, ? */
2477 .tuner_addr
= ADDR_UNSET
,
2478 .radio_addr
= ADDR_UNSET
,
2483 [BTTV_BOARD_MATRIX_VISIONSQ
] = {
2484 /* andre.schwarz@matrix-vision.de */
2485 .name
= "MATRIX Vision Sigma-SQ",
2491 .muxsel
= { 2, 2, 2, 2, 2, 2, 2, 2,
2492 3, 3, 3, 3, 3, 3, 3, 3 },
2493 .muxsel_hook
= sigmaSQ_muxsel
,
2498 .tuner_addr
= ADDR_UNSET
,
2499 .radio_addr
= ADDR_UNSET
,
2501 [BTTV_BOARD_MATRIX_VISIONSLC
] = {
2502 /* andre.schwarz@matrix-vision.de */
2503 .name
= "MATRIX Vision Sigma-SLC",
2509 .muxsel
= { 2, 2, 2, 2 },
2510 .muxsel_hook
= sigmaSLC_muxsel
,
2515 .tuner_addr
= ADDR_UNSET
,
2516 .radio_addr
= ADDR_UNSET
,
2518 /* BTTV_BOARD_APAC_VIEWCOMP */
2519 [BTTV_BOARD_APAC_VIEWCOMP
] = {
2520 /* Attila Kondoros <attila.kondoros@chello.hu> */
2521 /* bt878 TV + FM 0x00000000 subsystem ID */
2522 .name
= "APAC Viewcomp 878(AMAX)",
2528 .muxsel
= { 2, 3, 1, 1 },
2529 .audiomux
= { 2, 0, 0, 0, 10 },
2532 .tuner_type
= TUNER_PHILIPS_PAL
,
2533 .tuner_addr
= ADDR_UNSET
,
2534 .radio_addr
= ADDR_UNSET
,
2535 .has_remote
= 1, /* miniremote works, see ir-kbd-gpio.c */
2536 .has_radio
= 1, /* not every card has radio */
2539 /* ---- card 0x80 ---------------------------------- */
2540 [BTTV_BOARD_DVICO_DVBT_LITE
] = {
2541 /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
2542 .name
= "DViCO FusionHDTV DVB-T Lite",
2551 .tuner_addr
= ADDR_UNSET
,
2552 .radio_addr
= ADDR_UNSET
,
2554 [BTTV_BOARD_VGEAR_MYVCD
] = {
2555 /* Steven <photon38@pchome.com.tw> */
2556 .name
= "V-Gear MyVCD",
2562 .muxsel
= {2, 3, 1, 0 },
2563 .audiomux
= {0x31, 0x31, 0x31, 0x31, 0x31, 0x31 },
2566 .tuner_type
= TUNER_PHILIPS_NTSC_M
,
2567 .tuner_addr
= ADDR_UNSET
,
2568 .radio_addr
= ADDR_UNSET
,
2574 [BTTV_BOARD_SUPER_TV
] = {
2575 /* Rick C <cryptdragoon@gmail.com> */
2576 .name
= "Super TV Tuner",
2581 .muxsel
= { 2, 3, 1, 0 },
2582 .tuner_type
= TUNER_PHILIPS_NTSC
,
2583 .tuner_addr
= ADDR_UNSET
,
2584 .radio_addr
= ADDR_UNSET
,
2585 .gpiomask
= 0x008007,
2586 .audiomux
= { 0, 0x000001,0,0, 0 },
2590 [BTTV_BOARD_TIBET_CS16
] = {
2591 /* Chris Fanning <video4linux@haydon.net> */
2592 .name
= "Tibet Systems 'Progress DVR' CS16",
2597 .muxsel
= { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
2603 .tuner_addr
= ADDR_UNSET
,
2604 .radio_addr
= ADDR_UNSET
,
2605 .muxsel_hook
= tibetCS16_muxsel
,
2607 [BTTV_BOARD_KODICOM_4400R
] = {
2608 /* Bill Brack <wbrack@mmm.com.hk> */
2610 * Note that, because of the card's wiring, the "master"
2611 * BT878A chip (i.e. the one which controls the analog switch
2612 * and must use this card type) is the 2nd one detected. The
2613 * other 3 chips should use card type 0x85, whose description
2614 * follows this one. There is a EEPROM on the card (which is
2615 * connected to the I2C of one of those other chips), but is
2616 * not currently handled. There is also a facility for a
2617 * "monitor", which is also not currently implemented.
2619 .name
= "Kodicom 4400R (master)",
2624 .tuner_addr
= ADDR_UNSET
,
2625 .radio_addr
= ADDR_UNSET
,
2627 /* GPIO bits 0-9 used for analog switch:
2628 * 00 - 03: camera selector
2629 * 04 - 06: channel (controller) selector
2630 * 07: data (1->on, 0->off)
2633 * bit 16 is input from sync separator for the channel
2635 .gpiomask
= 0x0003ff,
2637 .muxsel
= { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2642 .muxsel_hook
= kodicom4400r_muxsel
,
2644 [BTTV_BOARD_KODICOM_4400R_SL
] = {
2645 /* Bill Brack <wbrack@mmm.com.hk> */
2646 /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
2647 * one which controls the analog switch, and must use the card type)
2648 * is the 2nd one detected. The other 3 chips should use this card
2651 .name
= "Kodicom 4400R (slave)",
2656 .tuner_addr
= ADDR_UNSET
,
2657 .radio_addr
= ADDR_UNSET
,
2659 .gpiomask
= 0x010000,
2661 .muxsel
= { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2666 .muxsel_hook
= kodicom4400r_muxsel
,
2668 /* ---- card 0x86---------------------------------- */
2669 [BTTV_BOARD_ADLINK_RTV24
] = {
2670 /* Michael Henson <mhenson@clarityvi.com> */
2671 /* Adlink RTV24 with special unlock codes */
2672 .name
= "Adlink RTV24",
2677 .muxsel
= { 2, 3, 1, 0 },
2679 .tuner_addr
= ADDR_UNSET
,
2680 .radio_addr
= ADDR_UNSET
,
2683 /* ---- card 0x87---------------------------------- */
2684 [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE
] = {
2685 /* Michael Krufky <mkrufky@m1k.net> */
2686 .name
= "DViCO FusionHDTV 5 Lite",
2688 .tuner_type
= TUNER_LG_TDVS_H062F
,
2689 .tuner_addr
= ADDR_UNSET
,
2690 .radio_addr
= ADDR_UNSET
,
2694 .muxsel
= { 2, 3, 1 },
2695 .gpiomask
= 0x00e00007,
2696 .audiomux
= { 0x00400005, 0, 0x00000001, 0, 0x00c00007, 0 },
2702 /* ---- card 0x88---------------------------------- */
2703 [BTTV_BOARD_ACORP_Y878F
] = {
2704 /* Mauro Carvalho Chehab <mchehab@brturbo.com.br> */
2705 .name
= "Acorp Y878F",
2710 .gpiomask
= 0x01fe00,
2711 .muxsel
= { 2, 3, 1, 1 },
2712 .audiomux
= { 0x001e00, 0, 0x018000, 0x014000, 0x002000, 0 },
2715 .tuner_type
= TUNER_YMEC_TVF66T5_B_DFF
,
2716 .tuner_addr
= 0xc1 >>1,
2717 .radio_addr
= 0xc1 >>1,
2720 /* ---- card 0x89 ---------------------------------- */
2721 [BTTV_BOARD_CONCEPTRONIC_CTVFMI2
] = {
2722 .name
= "Conceptronic CTVFMi v2",
2727 .gpiomask
= 0x001c0007,
2728 .muxsel
= { 2, 3, 1, 1 },
2729 .audiomux
= { 0, 1, 2, 2, 3 },
2732 .tuner_type
= TUNER_TENA_9533_DI
,
2733 .tuner_addr
= ADDR_UNSET
,
2734 .radio_addr
= ADDR_UNSET
,
2738 /* ---- card 0x8a ---------------------------------- */
2739 [BTTV_BOARD_PV_BT878P_2E
] = {
2740 .name
= "Prolink Pixelview PV-BT878P+ (Rev.2E)",
2745 .gpiomask
= 0x01fe00,
2746 .muxsel
= { 2,3,1,1,-1 },
2747 .digital_mode
= DIGITAL_MODE_CAMERA
,
2748 .audiomux
= { 0x00400, 0x10400, 0x04400, 0x80000, 0x12400, 0x46000 },
2751 .tuner_type
= TUNER_LG_PAL_FM
,
2752 .tuner_addr
= ADDR_UNSET
,
2753 .radio_addr
= ADDR_UNSET
,
2756 /* ---- card 0x8b ---------------------------------- */
2757 [BTTV_BOARD_PV_M4900
] = {
2758 /* Sérgio Fortier <sergiofortier@yahoo.com.br> */
2759 .name
= "Prolink PixelView PlayTV MPEG2 PV-M4900",
2765 .muxsel
= { 2, 3, 1, 1 },
2766 .audiomux
= { 0x21, 0x20, 0x24, 0x2c, 0x29, 0x29 },
2769 .tuner_type
= TUNER_YMEC_TVF_5533MF
,
2770 .tuner_addr
= ADDR_UNSET
,
2771 .radio_addr
= ADDR_UNSET
,
2775 /* ---- card 0x8c ---------------------------------- */
2776 [BTTV_BOARD_OSPREY440
] = {
2777 .name
= "Osprey 440",
2784 .tuner_type
= UNSET
,
2785 .tuner_addr
= ADDR_UNSET
,
2786 .radio_addr
= ADDR_UNSET
,
2791 /* ---- card 0x8d ---------------------------------- */
2792 [BTTV_BOARD_ASOUND_SKYEYE
] = {
2793 .name
= "Asound Skyeye PCTV",
2799 .muxsel
= { 2, 3, 1, 1 },
2800 .audiomux
= { 2, 0, 0, 0, 1 },
2804 .tuner_addr
= ADDR_UNSET
,
2805 .radio_addr
= ADDR_UNSET
,
2807 /* ---- card 0x8e ---------------------------------- */
2808 [BTTV_BOARD_SABRENT_TVFM
] = {
2809 .name
= "Sabrent TV-FM (bttv version)",
2814 .gpiomask
= 0x108007,
2815 .muxsel
= { 2, 3, 1, 1 },
2816 .audiomux
= { 100000, 100002, 100002, 100000 },
2821 .tuner_type
= TUNER_TNF_5335MF
,
2822 .tuner_addr
= ADDR_UNSET
,
2825 /* ---- card 0x8f ---------------------------------- */
2826 [BTTV_BOARD_HAUPPAUGE_IMPACTVCB
] = {
2827 .name
= "Hauppauge ImpactVCB (bt878)",
2832 .gpiomask
= 0x0f, /* old: 7 */
2833 .muxsel
= { 0, 1, 3, 2 }, /* Composite 0-3 */
2838 .tuner_addr
= ADDR_UNSET
,
2839 .radio_addr
= ADDR_UNSET
,
2841 [BTTV_BOARD_MACHTV_MAGICTV
] = {
2842 /* Julian Calaby <julian.calaby@gmail.com>
2843 * Slightly different from original MachTV definition (0x60)
2845 * FIXME: RegSpy says gpiomask should be "0x001c800f", but it
2846 * stuffs up remote chip. Bug is a pin on the jaecs is not set
2847 * properly (methinks) causing no keyup bits being set */
2849 .name
= "MagicTV", /* rebranded MachTV */
2855 .muxsel
= { 2, 3, 1, 1 },
2856 .audiomux
= { 0, 1, 2, 3, 4 },
2857 .tuner_type
= TUNER_TEMIC_4009FR5_PAL
,
2858 .tuner_addr
= ADDR_UNSET
,
2859 .radio_addr
= ADDR_UNSET
,
2866 static const unsigned int bttv_num_tvcards
= ARRAY_SIZE(bttv_tvcards
);
2868 /* ----------------------------------------------------------------------- */
2870 static unsigned char eeprom_data
[256];
2875 void __devinit
bttv_idcard(struct bttv
*btv
)
2877 unsigned int gpiobits
;
2881 /* read PCI subsystem ID */
2882 pci_read_config_word(btv
->c
.pci
, PCI_SUBSYSTEM_ID
, &tmp
);
2883 btv
->cardid
= tmp
<< 16;
2884 pci_read_config_word(btv
->c
.pci
, PCI_SUBSYSTEM_VENDOR_ID
, &tmp
);
2887 if (0 != btv
->cardid
&& 0xffffffff != btv
->cardid
) {
2888 /* look for the card */
2889 for (type
= -1, i
= 0; cards
[i
].id
!= 0; i
++)
2890 if (cards
[i
].id
== btv
->cardid
)
2895 printk(KERN_INFO
"bttv%d: detected: %s [card=%d], "
2896 "PCI subsystem ID is %04x:%04x\n",
2897 btv
->c
.nr
,cards
[type
].name
,cards
[type
].cardnr
,
2898 btv
->cardid
& 0xffff,
2899 (btv
->cardid
>> 16) & 0xffff);
2900 btv
->c
.type
= cards
[type
].cardnr
;
2903 printk(KERN_INFO
"bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",
2904 btv
->c
.nr
, btv
->cardid
& 0xffff,
2905 (btv
->cardid
>> 16) & 0xffff);
2906 printk(KERN_DEBUG
"please mail id, board name and "
2907 "the correct card= insmod option to video4linux-list@redhat.com\n");
2911 /* let the user override the autodetected type */
2912 if (card
[btv
->c
.nr
] < bttv_num_tvcards
)
2913 btv
->c
.type
=card
[btv
->c
.nr
];
2915 /* print which card config we are using */
2916 printk(KERN_INFO
"bttv%d: using: %s [card=%d,%s]\n",btv
->c
.nr
,
2917 bttv_tvcards
[btv
->c
.type
].name
, btv
->c
.type
,
2918 card
[btv
->c
.nr
] < bttv_num_tvcards
2919 ? "insmod option" : "autodetected");
2921 /* overwrite gpio stuff ?? */
2922 if (UNSET
== audioall
&& UNSET
== audiomux
[0])
2925 if (UNSET
!= audiomux
[0]) {
2927 for (i
= 0; i
< 5; i
++) {
2928 bttv_tvcards
[btv
->c
.type
].audiomux
[i
] = audiomux
[i
];
2929 gpiobits
|= audiomux
[i
];
2932 gpiobits
= audioall
;
2933 for (i
= 0; i
< 5; i
++) {
2934 bttv_tvcards
[btv
->c
.type
].audiomux
[i
] = audioall
;
2937 bttv_tvcards
[btv
->c
.type
].gpiomask
= (UNSET
!= gpiomask
) ? gpiomask
: gpiobits
;
2938 printk(KERN_INFO
"bttv%d: gpio config override: mask=0x%x, mux=",
2939 btv
->c
.nr
,bttv_tvcards
[btv
->c
.type
].gpiomask
);
2940 for (i
= 0; i
< 5; i
++) {
2941 printk("%s0x%x", i
? "," : "", bttv_tvcards
[btv
->c
.type
].audiomux
[i
]);
2947 * (most) board specific initialisations goes here
2950 /* Some Modular Technology cards have an eeprom, but no subsystem ID */
2951 static void identify_by_eeprom(struct bttv
*btv
, unsigned char eeprom_data
[256])
2955 if (0 == strncmp(eeprom_data
,"GET MM20xPCTV",13))
2956 type
= BTTV_BOARD_MODTEC_205
;
2957 else if (0 == strncmp(eeprom_data
+20,"Picolo",7))
2958 type
= BTTV_BOARD_EURESYS_PICOLO
;
2959 else if (eeprom_data
[0] == 0x84 && eeprom_data
[2]== 0)
2960 type
= BTTV_BOARD_HAUPPAUGE
; /* old bt848 */
2964 printk("bttv%d: detected by eeprom: %s [card=%d]\n",
2965 btv
->c
.nr
, bttv_tvcards
[btv
->c
.type
].name
, btv
->c
.type
);
2969 static void flyvideo_gpio(struct bttv
*btv
)
2971 int gpio
,has_remote
,has_radio
,is_capture_only
,is_lr90
,has_tda9820_tda9821
;
2974 gpio_inout(0xffffff, 0);
2975 udelay(8); /* without this we would see the 0x1800 mask */
2977 /* FIXME: must restore OUR_EN ??? */
2979 /* all cards provide GPIO info, some have an additional eeprom
2980 * LR50: GPIO coding can be found lower right CP1 .. CP9
2981 * CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
2983 * LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
2985 * lowest 3 bytes are remote control codes (no handshake needed)
2986 * xxxFFF: No remote control chip soldered
2987 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
2988 * Note: Some bits are Audio_Mask !
2990 ttype
=(gpio
&0x0f0000)>>16;
2992 case 0x0: tuner
=2; /* NTSC, e.g. TPI8NSR11P */
2994 case 0x2: tuner
=39;/* LG NTSC (newer TAPC series) TAPC-H701P */
2996 case 0x4: tuner
=5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
2998 case 0x6: tuner
=37;/* LG PAL (newer TAPC series) TAPC-G702P */
3000 case 0xC: tuner
=3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
3003 printk(KERN_INFO
"bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv
->c
.nr
);
3006 has_remote
= gpio
& 0x800000;
3007 has_radio
= gpio
& 0x400000;
3008 /* unknown 0x200000;
3009 * unknown2 0x100000; */
3010 is_capture_only
= !(gpio
& 0x008000); /* GPIO15 */
3011 has_tda9820_tda9821
= !(gpio
& 0x004000);
3012 is_lr90
= !(gpio
& 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
3014 * gpio & 0x001000 output bit for audio routing */
3017 tuner
=4; /* No tuner present */
3019 printk(KERN_INFO
"bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
3020 btv
->c
.nr
, has_radio
? "yes":"no ", has_remote
? "yes":"no ", tuner
, gpio
);
3021 printk(KERN_INFO
"bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
3022 btv
->c
.nr
, is_lr90
?"yes":"no ", has_tda9820_tda9821
?"yes":"no ",
3023 is_capture_only
?"yes":"no ");
3025 if(tuner
!= -1) /* only set if known tuner autodetected, else let insmod option through */
3026 btv
->tuner_type
= tuner
;
3027 btv
->has_radio
= has_radio
;
3029 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
3030 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
3031 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
3032 if(has_tda9820_tda9821
) btv
->audio_hook
= lt9415_audio
;
3033 /* todo: if(has_tda9874) btv->audio_hook = fv2000s_audio; */
3036 static int miro_tunermap
[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
3037 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
3038 static int miro_fmtuner
[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
3039 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
3041 static void miro_pinnacle_gpio(struct bttv
*btv
)
3046 gpio_inout(0xffffff, 0);
3048 id
= ((gpio
>>10) & 63) -1;
3049 msp
= bttv_I2CRead(btv
, I2C_MSP3400
, "MSP34xx");
3051 btv
->tuner_type
= miro_tunermap
[id
];
3052 if (0 == (gpio
& 0x20)) {
3054 if (!miro_fmtuner
[id
]) {
3055 btv
->has_matchbox
= 1;
3056 btv
->mbox_we
= (1<<6);
3057 btv
->mbox_most
= (1<<7);
3058 btv
->mbox_clk
= (1<<8);
3059 btv
->mbox_data
= (1<<9);
3060 btv
->mbox_mask
= (1<<6)|(1<<7)|(1<<8)|(1<<9);
3066 if (btv
->c
.type
== BTTV_BOARD_MIRO
)
3067 btv
->c
.type
= BTTV_BOARD_MIROPRO
;
3068 if (btv
->c
.type
== BTTV_BOARD_PINNACLE
)
3069 btv
->c
.type
= BTTV_BOARD_PINNACLEPRO
;
3072 "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
3073 btv
->c
.nr
, id
+1, btv
->tuner_type
,
3074 !btv
->has_radio
? "no" :
3075 (btv
->has_matchbox
? "matchbox" : "fmtuner"),
3076 (-1 == msp
) ? "no" : "yes");
3078 /* new cards with microtune tuner */
3083 info
= "PAL / mono";
3084 btv
->tda9887_conf
= TDA9887_INTERCARRIER
;
3087 info
= "PAL+SECAM / stereo";
3089 btv
->tda9887_conf
= TDA9887_QSS
;
3092 info
= "NTSC / stereo";
3094 btv
->tda9887_conf
= TDA9887_QSS
;
3097 info
= "PAL+SECAM / mono";
3098 btv
->tda9887_conf
= TDA9887_QSS
;
3101 info
= "NTSC / mono";
3102 btv
->tda9887_conf
= TDA9887_INTERCARRIER
;
3105 info
= "NTSC / stereo";
3106 btv
->tda9887_conf
= TDA9887_INTERCARRIER
;
3109 info
= "PAL / stereo";
3110 btv
->tda9887_conf
= TDA9887_INTERCARRIER
;
3113 info
= "oops: unknown card";
3117 btv
->c
.type
= BTTV_BOARD_PINNACLEPRO
;
3119 "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3120 btv
->c
.nr
, id
, info
, btv
->has_radio
? "yes" : "no");
3121 btv
->tuner_type
= TUNER_MT2032
;
3125 /* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
3126 #define LM1882_SYNC_DRIVE 0x200000L
3128 static void init_ids_eagle(struct bttv
*btv
)
3130 gpio_inout(0xffffff,0xFFFF37);
3131 gpio_write(0x200020);
3133 /* flash strobe inverter ?! */
3134 gpio_write(0x200024);
3136 /* switch sync drive off */
3137 gpio_bits(LM1882_SYNC_DRIVE
,LM1882_SYNC_DRIVE
);
3139 /* set BT848 muxel to 2 */
3140 btaor((2)<<5, ~(2<<5), BT848_IFORM
);
3143 /* Muxsel helper for the IDS Eagle.
3144 * the eagles does not use the standard muxsel-bits but
3145 * has its own multiplexer */
3146 static void eagle_muxsel(struct bttv
*btv
, unsigned int input
)
3148 btaor((2)<<5, ~(3<<5), BT848_IFORM
);
3149 gpio_bits(3,bttv_tvcards
[btv
->c
.type
].muxsel
[input
&7]);
3152 /* set chroma ADC to sleep */
3153 btor(BT848_ADC_C_SLEEP
, BT848_ADC
);
3154 /* set to composite video */
3155 btand(~BT848_CONTROL_COMP
, BT848_E_CONTROL
);
3156 btand(~BT848_CONTROL_COMP
, BT848_O_CONTROL
);
3158 /* switch sync drive off */
3159 gpio_bits(LM1882_SYNC_DRIVE
,LM1882_SYNC_DRIVE
);
3162 static void gvc1100_muxsel(struct bttv
*btv
, unsigned int input
)
3164 static const int masks
[] = {0x30, 0x01, 0x12, 0x23};
3165 gpio_write(masks
[input
%4]);
3168 /* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
3171 GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
3172 assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
3174 IN - sensor inputs, INx - sensor inputs and TI XORed together
3175 O1,O2,O3 - alarm outputs (relays)
3177 OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
3181 static void init_lmlbt4x(struct bttv
*btv
)
3183 printk(KERN_DEBUG
"LMLBT4x init\n");
3184 btwrite(0x000000, BT848_GPIO_REG_INP
);
3185 gpio_inout(0xffffff, 0x0006C0);
3186 gpio_write(0x000000);
3189 static void sigmaSQ_muxsel(struct bttv
*btv
, unsigned int input
)
3191 unsigned int inmux
= input
% 8;
3192 gpio_inout( 0xf, 0xf );
3193 gpio_bits( 0xf, inmux
);
3196 static void sigmaSLC_muxsel(struct bttv
*btv
, unsigned int input
)
3198 unsigned int inmux
= input
% 4;
3199 gpio_inout( 3<<9, 3<<9 );
3200 gpio_bits( 3<<9, inmux
<<9 );
3203 /* ----------------------------------------------------------------------- */
3205 static void bttv_reset_audio(struct bttv
*btv
)
3208 * BT878A has a audio-reset register.
3209 * 1. This register is an audio reset function but it is in
3210 * function-0 (video capture) address space.
3211 * 2. It is enough to do this once per power-up of the card.
3212 * 3. There is a typo in the Conexant doc -- it is not at
3213 * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
3214 * --//Shrikumar 030609
3220 printk("bttv%d: BT878A ARESET\n",btv
->c
.nr
);
3221 btwrite((1<<7), 0x058);
3226 /* initialization part one -- before registering i2c bus */
3227 void __devinit
bttv_init_card1(struct bttv
*btv
)
3229 switch (btv
->c
.type
) {
3230 case BTTV_BOARD_HAUPPAUGE
:
3231 case BTTV_BOARD_HAUPPAUGE878
:
3232 boot_msp34xx(btv
,5);
3234 case BTTV_BOARD_VOODOOTV_FM
:
3235 boot_msp34xx(btv
,20);
3237 case BTTV_BOARD_AVERMEDIA98
:
3238 boot_msp34xx(btv
,11);
3240 case BTTV_BOARD_HAUPPAUGEPVR
:
3243 case BTTV_BOARD_TWINHAN_DST
:
3244 case BTTV_BOARD_AVDVBT_771
:
3245 case BTTV_BOARD_PINNACLESAT
:
3246 btv
->use_i2c_hw
= 1;
3248 case BTTV_BOARD_ADLINK_RTV24
:
3253 if (!bttv_tvcards
[btv
->c
.type
].has_dvb
)
3254 bttv_reset_audio(btv
);
3257 /* initialization part two -- after registering i2c bus */
3258 void __devinit
bttv_init_card2(struct bttv
*btv
)
3261 int addr
=ADDR_UNSET
;
3263 btv
->tuner_type
= -1;
3265 if (BTTV_BOARD_UNKNOWN
== btv
->c
.type
) {
3266 bttv_readee(btv
,eeprom_data
,0xa0);
3267 identify_by_eeprom(btv
,eeprom_data
);
3270 switch (btv
->c
.type
) {
3271 case BTTV_BOARD_MIRO
:
3272 case BTTV_BOARD_MIROPRO
:
3273 case BTTV_BOARD_PINNACLE
:
3274 case BTTV_BOARD_PINNACLEPRO
:
3276 miro_pinnacle_gpio(btv
);
3278 case BTTV_BOARD_FLYVIDEO_98
:
3279 case BTTV_BOARD_MAXI
:
3280 case BTTV_BOARD_LIFE_FLYKIT
:
3281 case BTTV_BOARD_FLYVIDEO
:
3282 case BTTV_BOARD_TYPHOON_TVIEW
:
3283 case BTTV_BOARD_CHRONOS_VS2
:
3284 case BTTV_BOARD_FLYVIDEO_98FM
:
3285 case BTTV_BOARD_FLYVIDEO2000
:
3286 case BTTV_BOARD_FLYVIDEO98EZ
:
3287 case BTTV_BOARD_CONFERENCETV
:
3288 case BTTV_BOARD_LIFETEC_9415
:
3291 case BTTV_BOARD_HAUPPAUGE
:
3292 case BTTV_BOARD_HAUPPAUGE878
:
3293 case BTTV_BOARD_HAUPPAUGEPVR
:
3294 /* pick up some config infos from the eeprom */
3295 bttv_readee(btv
,eeprom_data
,0xa0);
3296 hauppauge_eeprom(btv
);
3298 case BTTV_BOARD_AVERMEDIA98
:
3299 case BTTV_BOARD_AVPHONE98
:
3300 bttv_readee(btv
,eeprom_data
,0xa0);
3301 avermedia_eeprom(btv
);
3303 case BTTV_BOARD_PXC200
:
3306 case BTTV_BOARD_PICOLO_TETRA_CHIP
:
3307 picolo_tetra_init(btv
);
3309 case BTTV_BOARD_VHX
:
3311 btv
->has_matchbox
= 1;
3312 btv
->mbox_we
= 0x20;
3314 btv
->mbox_clk
= 0x08;
3315 btv
->mbox_data
= 0x10;
3316 btv
->mbox_mask
= 0x38;
3318 case BTTV_BOARD_VOBIS_BOOSTAR
:
3319 case BTTV_BOARD_TERRATV
:
3320 terratec_active_radio_upgrade(btv
);
3322 case BTTV_BOARD_MAGICTVIEW061
:
3323 if (btv
->cardid
== 0x3002144f) {
3325 printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv
->c
.nr
);
3328 case BTTV_BOARD_STB2
:
3329 if (btv
->cardid
== 0x3060121a) {
3330 /* Fix up entry for 3DFX VoodooTV 100,
3331 which is an OEM STB card variant. */
3333 btv
->tuner_type
=TUNER_TEMIC_NTSC
;
3336 case BTTV_BOARD_OSPREY1x0
:
3337 case BTTV_BOARD_OSPREY1x0_848
:
3338 case BTTV_BOARD_OSPREY101_848
:
3339 case BTTV_BOARD_OSPREY1x1
:
3340 case BTTV_BOARD_OSPREY1x1_SVID
:
3341 case BTTV_BOARD_OSPREY2xx
:
3342 case BTTV_BOARD_OSPREY2x0_SVID
:
3343 case BTTV_BOARD_OSPREY2x0
:
3344 case BTTV_BOARD_OSPREY500
:
3345 case BTTV_BOARD_OSPREY540
:
3346 case BTTV_BOARD_OSPREY2000
:
3347 bttv_readee(btv
,eeprom_data
,0xa0);
3350 case BTTV_BOARD_IDS_EAGLE
:
3351 init_ids_eagle(btv
);
3353 case BTTV_BOARD_MODTEC_205
:
3354 bttv_readee(btv
,eeprom_data
,0xa0);
3357 case BTTV_BOARD_LMLBT4
:
3360 case BTTV_BOARD_TIBET_CS16
:
3361 tibetCS16_init(btv
);
3363 case BTTV_BOARD_KODICOM_4400R
:
3364 kodicom4400r_init(btv
);
3368 /* pll configuration */
3369 if (!(btv
->id
==848 && btv
->revision
==0x11)) {
3370 /* defaults from card list */
3371 if (PLL_28
== bttv_tvcards
[btv
->c
.type
].pll
) {
3372 btv
->pll
.pll_ifreq
=28636363;
3373 btv
->pll
.pll_crystal
=BT848_IFORM_XT0
;
3375 if (PLL_35
== bttv_tvcards
[btv
->c
.type
].pll
) {
3376 btv
->pll
.pll_ifreq
=35468950;
3377 btv
->pll
.pll_crystal
=BT848_IFORM_XT1
;
3379 /* insmod options can override */
3380 switch (pll
[btv
->c
.nr
]) {
3382 btv
->pll
.pll_crystal
= 0;
3383 btv
->pll
.pll_ifreq
= 0;
3384 btv
->pll
.pll_ofreq
= 0;
3386 case 1: /* 28 MHz */
3388 btv
->pll
.pll_ifreq
= 28636363;
3389 btv
->pll
.pll_ofreq
= 0;
3390 btv
->pll
.pll_crystal
= BT848_IFORM_XT0
;
3392 case 2: /* 35 MHz */
3394 btv
->pll
.pll_ifreq
= 35468950;
3395 btv
->pll
.pll_ofreq
= 0;
3396 btv
->pll
.pll_crystal
= BT848_IFORM_XT1
;
3400 btv
->pll
.pll_current
= -1;
3402 /* tuner configuration (from card list / autodetect / insmod option) */
3403 if (ADDR_UNSET
!= bttv_tvcards
[btv
->c
.type
].tuner_addr
)
3404 addr
= bttv_tvcards
[btv
->c
.type
].tuner_addr
;
3406 if (UNSET
!= bttv_tvcards
[btv
->c
.type
].tuner_type
)
3407 if(UNSET
== btv
->tuner_type
)
3408 btv
->tuner_type
= bttv_tvcards
[btv
->c
.type
].tuner_type
;
3409 if (UNSET
!= tuner
[btv
->c
.nr
])
3410 btv
->tuner_type
= tuner
[btv
->c
.nr
];
3411 printk("bttv%d: using tuner=%d\n",btv
->c
.nr
,btv
->tuner_type
);
3413 if (btv
->tuner_type
!= UNSET
) {
3414 struct tuner_setup tun_setup
;
3416 tun_setup
.mode_mask
= T_ANALOG_TV
| T_DIGITAL_TV
;
3417 tun_setup
.type
= btv
->tuner_type
;
3418 tun_setup
.addr
= addr
;
3420 bttv_call_i2c_clients(btv
, TUNER_SET_TYPE_ADDR
, &tun_setup
);
3423 if (btv
->tda9887_conf
) {
3424 bttv_call_i2c_clients(btv
, TDA9887_SET_CONFIG
,
3425 &btv
->tda9887_conf
);
3428 btv
->svhs
= bttv_tvcards
[btv
->c
.type
].svhs
;
3429 if (svhs
[btv
->c
.nr
] != UNSET
)
3430 btv
->svhs
= svhs
[btv
->c
.nr
];
3431 if (remote
[btv
->c
.nr
] != UNSET
)
3432 btv
->has_remote
= remote
[btv
->c
.nr
];
3434 if (bttv_tvcards
[btv
->c
.type
].has_radio
)
3436 if (bttv_tvcards
[btv
->c
.type
].has_remote
)
3438 if (!bttv_tvcards
[btv
->c
.type
].no_gpioirq
)
3440 if (bttv_tvcards
[btv
->c
.type
].audio_hook
)
3441 btv
->audio_hook
=bttv_tvcards
[btv
->c
.type
].audio_hook
;
3443 if (bttv_tvcards
[btv
->c
.type
].digital_mode
== DIGITAL_MODE_CAMERA
) {
3444 /* detect Bt832 chip for quartzsight digital camera */
3445 if ((bttv_I2CRead(btv
, I2C_BT832_ALT1
, "Bt832") >=0) ||
3446 (bttv_I2CRead(btv
, I2C_BT832_ALT2
, "Bt832") >=0))
3453 /* try to detect audio/fader chips */
3454 if (!bttv_tvcards
[btv
->c
.type
].no_msp34xx
&&
3455 bttv_I2CRead(btv
, I2C_MSP3400
, "MSP34xx") >=0)
3456 request_module("msp3400");
3458 if (bttv_tvcards
[btv
->c
.type
].msp34xx_alt
&&
3459 bttv_I2CRead(btv
, I2C_MSP3400_ALT
, "MSP34xx (alternate address)") >=0)
3460 request_module("msp3400");
3462 if (!bttv_tvcards
[btv
->c
.type
].no_tda9875
&&
3463 bttv_I2CRead(btv
, I2C_TDA9875
, "TDA9875") >=0)
3464 request_module("tda9875");
3466 if (!bttv_tvcards
[btv
->c
.type
].no_tda7432
&&
3467 bttv_I2CRead(btv
, I2C_TDA7432
, "TDA7432") >=0)
3468 request_module("tda7432");
3470 if (bttv_tvcards
[btv
->c
.type
].needs_tvaudio
)
3471 request_module("tvaudio");
3475 if (btv
->tda9887_conf
)
3477 if (0 == tda9887
&& 0 == bttv_tvcards
[btv
->c
.type
].has_dvb
&&
3478 bttv_I2CRead(btv
, I2C_TDA9887
, "TDA9887") >=0)
3480 /* Hybrid DVB card, DOES have a tda9887 */
3481 if (btv
->c
.type
== BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE
)
3483 if((btv
->tuner_type
== TUNER_PHILIPS_FM1216ME_MK3
) ||
3484 (btv
->tuner_type
== TUNER_PHILIPS_FM1236_MK3
) ||
3485 (btv
->tuner_type
== TUNER_PHILIPS_FM1256_IH3
) ||
3487 request_module("tda9887");
3488 if (btv
->tuner_type
!= UNSET
)
3489 request_module("tuner");
3493 /* ----------------------------------------------------------------------- */
3495 static void modtec_eeprom(struct bttv
*btv
)
3497 if( strncmp(&(eeprom_data
[0x1e]),"Temic 4066 FY5",14) ==0) {
3498 btv
->tuner_type
=TUNER_TEMIC_4066FY5_PAL_I
;
3499 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3500 btv
->c
.nr
,&eeprom_data
[0x1e]);
3501 } else if (strncmp(&(eeprom_data
[0x1e]),"Alps TSBB5",10) ==0) {
3502 btv
->tuner_type
=TUNER_ALPS_TSBB5_PAL_I
;
3503 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3504 btv
->c
.nr
,&eeprom_data
[0x1e]);
3505 } else if (strncmp(&(eeprom_data
[0x1e]),"Philips FM1246",14) ==0) {
3506 btv
->tuner_type
=TUNER_PHILIPS_NTSC
;
3507 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3508 btv
->c
.nr
,&eeprom_data
[0x1e]);
3510 printk("bttv%d: Modtec: Unknown TunerString: %s\n",
3511 btv
->c
.nr
,&eeprom_data
[0x1e]);
3515 static void __devinit
hauppauge_eeprom(struct bttv
*btv
)
3519 tveeprom_hauppauge_analog(&btv
->i2c_client
, &tv
, eeprom_data
);
3520 btv
->tuner_type
= tv
.tuner_type
;
3521 btv
->has_radio
= tv
.has_radio
;
3523 printk("bttv%d: Hauppauge eeprom indicates model#%d\n",
3524 btv
->c
.nr
, tv
.model
);
3527 * Some of the 878 boards have duplicate PCI IDs. Switch the board
3528 * type based on model #.
3530 if(tv
.model
== 64900) {
3531 printk("bttv%d: Switching board type from %s to %s\n",
3533 bttv_tvcards
[btv
->c
.type
].name
,
3534 bttv_tvcards
[BTTV_BOARD_HAUPPAUGE_IMPACTVCB
].name
);
3535 btv
->c
.type
= BTTV_BOARD_HAUPPAUGE_IMPACTVCB
;
3539 static int terratec_active_radio_upgrade(struct bttv
*btv
)
3544 btv
->has_matchbox
= 1;
3545 btv
->mbox_we
= 0x10;
3546 btv
->mbox_most
= 0x20;
3547 btv
->mbox_clk
= 0x08;
3548 btv
->mbox_data
= 0x04;
3549 btv
->mbox_mask
= 0x3c;
3551 btv
->mbox_iow
= 1 << 8;
3552 btv
->mbox_ior
= 1 << 9;
3553 btv
->mbox_csel
= 1 << 10;
3556 tea5757_write(btv
, 5 * freq
+ 0x358); /* write 0x1ed8 */
3557 if (0x1ed8 == tea5757_read(btv
)) {
3558 printk("bttv%d: Terratec Active Radio Upgrade found.\n",
3561 btv
->has_matchbox
= 1;
3564 btv
->has_matchbox
= 0;
3570 /* ----------------------------------------------------------------------- */
3573 * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
3575 * The hcwamc.rbf firmware file is on the Hauppauge driver CD. Have
3576 * a look at Pvr/pvr45xxx.EXE (self-extracting zip archive, can be
3577 * unpacked with unzip).
3579 #define PVR_GPIO_DELAY 10
3581 #define BTTV_ALT_DATA 0x000001
3582 #define BTTV_ALT_DCLK 0x100000
3583 #define BTTV_ALT_NCONFIG 0x800000
3585 static int __devinit
pvr_altera_load(struct bttv
*btv
, u8
*micro
, u32 microlen
)
3591 gpio_inout(0xffffff,BTTV_ALT_DATA
|BTTV_ALT_DCLK
|BTTV_ALT_NCONFIG
);
3593 udelay(PVR_GPIO_DELAY
);
3595 gpio_write(BTTV_ALT_NCONFIG
);
3596 udelay(PVR_GPIO_DELAY
);
3598 for (n
= 0; n
< microlen
; n
++) {
3600 for ( i
= 0 ; i
< 8 ; i
++ ) {
3601 gpio_bits(BTTV_ALT_DCLK
,0);
3603 gpio_bits(BTTV_ALT_DATA
,BTTV_ALT_DATA
);
3605 gpio_bits(BTTV_ALT_DATA
,0);
3606 gpio_bits(BTTV_ALT_DCLK
,BTTV_ALT_DCLK
);
3610 gpio_bits(BTTV_ALT_DCLK
,0);
3611 udelay(PVR_GPIO_DELAY
);
3613 /* begin Altera init loop (Not necessary,but doesn't hurt) */
3614 for (i
= 0 ; i
< 30 ; i
++) {
3615 gpio_bits(BTTV_ALT_DCLK
,0);
3616 gpio_bits(BTTV_ALT_DCLK
,BTTV_ALT_DCLK
);
3618 gpio_bits(BTTV_ALT_DCLK
,0);
3622 static int __devinit
pvr_boot(struct bttv
*btv
)
3624 const struct firmware
*fw_entry
;
3627 rc
= request_firmware(&fw_entry
, "hcwamc.rbf", &btv
->c
.pci
->dev
);
3629 printk(KERN_WARNING
"bttv%d: no altera firmware [via hotplug]\n",
3633 rc
= pvr_altera_load(btv
, fw_entry
->data
, fw_entry
->size
);
3634 printk(KERN_INFO
"bttv%d: altera firmware upload %s\n",
3635 btv
->c
.nr
, (rc
< 0) ? "failed" : "ok");
3636 release_firmware(fw_entry
);
3640 /* ----------------------------------------------------------------------- */
3641 /* some osprey specific stuff */
3643 static void __devinit
osprey_eeprom(struct bttv
*btv
)
3646 unsigned char *ee
= eeprom_data
;
3647 unsigned long serial
= 0;
3649 if (btv
->c
.type
== 0) {
3650 /* this might be an antique... check for MMAC label in eeprom */
3651 if ((ee
[0]=='M') && (ee
[1]=='M') && (ee
[2]=='A') && (ee
[3]=='C')) {
3652 unsigned char checksum
= 0;
3653 for (i
=0; i
<21; i
++)
3655 if (checksum
!= ee
[21])
3657 btv
->c
.type
= BTTV_BOARD_OSPREY1x0_848
;
3658 for (i
= 12; i
< 21; i
++)
3659 serial
*= 10, serial
+= ee
[i
] - '0';
3662 unsigned short type
;
3665 for(; offset
< 8*16; offset
+= 16) {
3666 unsigned short checksum
= 0;
3667 /* verify the checksum */
3668 for(i
= 0; i
<14; i
++) checksum
+= ee
[i
+offset
];
3669 checksum
= ~checksum
; /* no idea why */
3670 if ((((checksum
>>8)&0x0FF) == ee
[offset
+14]) &&
3671 ((checksum
& 0x0FF) == ee
[offset
+15])) {
3679 /* found a valid descriptor */
3680 type
= (ee
[offset
+4]<<8) | (ee
[offset
+5]);
3686 btv
->c
.type
= BTTV_BOARD_OSPREY1x0_848
;
3689 btv
->c
.type
= BTTV_BOARD_OSPREY101_848
;
3695 btv
->c
.type
= BTTV_BOARD_OSPREY1x0
;
3699 btv
->c
.type
= BTTV_BOARD_OSPREY1x1
;
3704 btv
->c
.type
= BTTV_BOARD_OSPREY1x1_SVID
;
3710 btv
->c
.type
= BTTV_BOARD_OSPREY2xx
;
3714 btv
->c
.type
= BTTV_BOARD_OSPREY2x0_SVID
;
3717 btv
->c
.type
= BTTV_BOARD_OSPREY500
;
3721 btv
->c
.type
= BTTV_BOARD_OSPREY540
;
3722 /* bttv_osprey_540_init(btv); */
3726 btv
->c
.type
= BTTV_BOARD_OSPREY2x0
;
3727 /* enable output on select control lines */
3728 gpio_inout(0xffffff,0x000303);
3731 /* unknown...leave generic, but get serial # */
3734 serial
= (ee
[offset
+6] << 24)
3735 | (ee
[offset
+7] << 16)
3736 | (ee
[offset
+8] << 8)
3740 printk(KERN_INFO
"bttv%d: osprey eeprom: card=%d name=%s serial=%ld\n",
3741 btv
->c
.nr
, btv
->c
.type
, bttv_tvcards
[btv
->c
.type
].name
,serial
);
3744 /* ----------------------------------------------------------------------- */
3745 /* AVermedia specific stuff, from bktr_card.c */
3747 static int tuner_0_table
[] = {
3748 TUNER_PHILIPS_NTSC
, TUNER_PHILIPS_PAL
/* PAL-BG*/,
3749 TUNER_PHILIPS_PAL
, TUNER_PHILIPS_PAL
/* PAL-I*/,
3750 TUNER_PHILIPS_PAL
, TUNER_PHILIPS_PAL
,
3751 TUNER_PHILIPS_SECAM
, TUNER_PHILIPS_SECAM
,
3752 TUNER_PHILIPS_SECAM
, TUNER_PHILIPS_PAL
,
3753 TUNER_PHILIPS_FM1216ME_MK3
};
3755 static int tuner_1_table
[] = {
3756 TUNER_TEMIC_NTSC
, TUNER_TEMIC_PAL
,
3757 TUNER_TEMIC_PAL
, TUNER_TEMIC_PAL
,
3758 TUNER_TEMIC_PAL
, TUNER_TEMIC_PAL
,
3759 TUNER_TEMIC_4012FY5
, TUNER_TEMIC_4012FY5
, /* TUNER_TEMIC_SECAM */
3760 TUNER_TEMIC_4012FY5
, TUNER_TEMIC_PAL
};
3762 static void __devinit
avermedia_eeprom(struct bttv
*btv
)
3764 int tuner_make
,tuner_tv_fm
,tuner_format
,tuner
=0;
3766 tuner_make
= (eeprom_data
[0x41] & 0x7);
3767 tuner_tv_fm
= (eeprom_data
[0x41] & 0x18) >> 3;
3768 tuner_format
= (eeprom_data
[0x42] & 0xf0) >> 4;
3769 btv
->has_remote
= (eeprom_data
[0x42] & 0x01);
3771 if (tuner_make
== 0 || tuner_make
== 2)
3772 if(tuner_format
<=0x0a)
3773 tuner
= tuner_0_table
[tuner_format
];
3774 if (tuner_make
== 1)
3775 if(tuner_format
<=9)
3776 tuner
= tuner_1_table
[tuner_format
];
3778 if (tuner_make
== 4)
3779 if(tuner_format
== 0x09)
3780 tuner
= TUNER_LG_NTSC_NEW_TAPC
; /* TAPC-G702P */
3782 printk(KERN_INFO
"bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
3783 btv
->c
.nr
,eeprom_data
[0x41],eeprom_data
[0x42]);
3785 btv
->tuner_type
=tuner
;
3788 printk("Unknown type");
3789 printk(" radio:%s remote control:%s\n",
3790 tuner_tv_fm
? "yes" : "no",
3791 btv
->has_remote
? "yes" : "no");
3794 /* used on Voodoo TV/FM (Voodoo 200), S0 wired to 0x10000 */
3795 void bttv_tda9880_setnorm(struct bttv
*btv
, int norm
)
3797 /* fix up our card entry */
3798 if(norm
==VIDEO_MODE_NTSC
) {
3799 bttv_tvcards
[BTTV_BOARD_VOODOOTV_FM
].audiomux
[0]=0x957fff;
3800 bttv_tvcards
[BTTV_BOARD_VOODOOTV_FM
].audiomux
[4]=0x957fff;
3801 dprintk("bttv_tda9880_setnorm to NTSC\n");
3804 bttv_tvcards
[BTTV_BOARD_VOODOOTV_FM
].audiomux
[0]=0x947fff;
3805 bttv_tvcards
[BTTV_BOARD_VOODOOTV_FM
].audiomux
[4]=0x947fff;
3806 dprintk("bttv_tda9880_setnorm to PAL\n");
3808 /* set GPIO according */
3809 gpio_bits(bttv_tvcards
[btv
->c
.type
].gpiomask
,
3810 bttv_tvcards
[btv
->c
.type
].audiomux
[btv
->audio
]);
3815 * reset/enable the MSP on some Hauppauge cards
3816 * Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
3821 static void __devinit
boot_msp34xx(struct bttv
*btv
, int pin
)
3823 int mask
= (1 << pin
);
3825 gpio_inout(mask
,mask
);
3828 gpio_bits(mask
,mask
);
3831 bttv_gpio_tracking(btv
,"msp34xx");
3833 printk(KERN_INFO
"bttv%d: Hauppauge/Voodoo msp34xx: reset line "
3834 "init [%d]\n", btv
->c
.nr
, pin
);
3837 static void __devinit
boot_bt832(struct bttv
*btv
)
3841 /* ----------------------------------------------------------------------- */
3842 /* Imagenation L-Model PXC200 Framegrabber */
3843 /* This is basically the same procedure as
3844 * used by Alessandro Rubini in his pxc200
3845 * driver, but using BTTV functions */
3847 static void __devinit
init_PXC200(struct bttv
*btv
)
3849 static int vals
[] __devinitdata
= { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d,
3850 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
3856 /* Initialise GPIO-connevted stuff */
3857 gpio_inout(0xffffff, (1<<13));
3861 /* GPIO inputs are pulled up, so no need to drive
3862 * reset pin any longer */
3863 gpio_bits(0xffffff, 0);
3865 bttv_gpio_tracking(btv
,"pxc200");
3867 /* we could/should try and reset/control the AD pots? but
3868 right now we simply turned off the crushing. Without
3869 this the AGC drifts drifts
3870 remember the EN is reverse logic -->
3871 setting BT848_ADC_AGC_EN disable the AGC
3872 tboult@eecs.lehigh.edu
3875 btwrite(BT848_ADC_RESERVED
|BT848_ADC_AGC_EN
, BT848_ADC
);
3877 /* Initialise MAX517 DAC */
3878 printk(KERN_INFO
"Setting DAC reference voltage level ...\n");
3879 bttv_I2CWrite(btv
,0x5E,0,0x80,1);
3881 /* Initialise 12C508 PIC */
3882 /* The I2CWrite and I2CRead commmands are actually to the
3883 * same chips - but the R/W bit is included in the address
3884 * argument so the numbers are different */
3887 printk(KERN_INFO
"Initialising 12C508 PIC chip ...\n");
3889 /* First of all, enable the clock line. This is used in the PXC200-F */
3890 val
= btread(BT848_GPIO_DMA_CTL
);
3891 val
|= BT848_GPIO_DMA_CTL_GPCLKMODE
;
3892 btwrite(val
, BT848_GPIO_DMA_CTL
);
3894 /* Then, push to 0 the reset pin long enough to reset the *
3895 * device same as above for the reset line, but not the same
3896 * value sent to the GPIO-connected stuff
3897 * which one is the good one? */
3898 gpio_inout(0xffffff,(1<<2));
3903 for (i
= 0; i
< ARRAY_SIZE(vals
); i
++) {
3904 tmp
=bttv_I2CWrite(btv
,0x1E,0,vals
[i
],1);
3907 "I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
3908 vals
[i
],tmp
,bttv_I2CRead(btv
,0x1F,NULL
));
3912 printk(KERN_INFO
"PXC200 Initialised.\n");
3917 /* ----------------------------------------------------------------------- */
3919 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
3920 * it. This apparently involves the following procedure for each 878 chip:
3922 * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
3924 * 2) write to GPIO_DATA
3930 * read from GPIO_DATA into buf (uint_32)
3931 * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
3932 * error. ERROR_CPLD_Check_Failed stop.
3934 * 3) write to GPIO_DATA
3935 * - write 0x4400 + 0x0E
3937 * - write 0x4410 + 0x0E
3940 * read from GPIO_DATA into buf (uint_32)
3941 * - if ( buf>>18 & 0x01 ) || ( buf>>19 && 0x01 != 0 )
3942 * error. ERROR_CPLD_Check_Failed.
3944 /* ----------------------------------------------------------------------- */
3946 init_RTV24 (struct bttv
*btv
)
3948 uint32_t dataRead
= 0;
3949 long watchdog_value
= 0x0E;
3952 "bttv%d: Adlink RTV-24 initialisation in progress ...\n",
3955 btwrite (0x00c3feff, BT848_GPIO_OUT_EN
);
3957 btwrite (0 + watchdog_value
, BT848_GPIO_DATA
);
3959 btwrite (0x10 + watchdog_value
, BT848_GPIO_DATA
);
3961 btwrite (0 + watchdog_value
, BT848_GPIO_DATA
);
3963 dataRead
= btread (BT848_GPIO_DATA
);
3965 if ((((dataRead
>> 18) & 0x01) != 0) || (((dataRead
>> 19) & 0x01) != 1)) {
3967 "bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
3968 btv
->c
.nr
, dataRead
);
3971 btwrite (0x4400 + watchdog_value
, BT848_GPIO_DATA
);
3973 btwrite (0x4410 + watchdog_value
, BT848_GPIO_DATA
);
3975 btwrite (watchdog_value
, BT848_GPIO_DATA
);
3977 dataRead
= btread (BT848_GPIO_DATA
);
3979 if ((((dataRead
>> 18) & 0x01) != 0) || (((dataRead
>> 19) & 0x01) != 0)) {
3981 "bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
3982 btv
->c
.nr
, dataRead
);
3988 "bttv%d: Adlink RTV-24 initialisation complete.\n", btv
->c
.nr
);
3993 /* ----------------------------------------------------------------------- */
3994 /* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */
3996 * Copyright (c) 1999 Csaba Halasz <qgehali@uni-miskolc.hu>
3997 * This code is placed under the terms of the GNU General Public License
3999 * Brutally hacked by Dan Sheridan <dan.sheridan@contact.org.uk> djs52 8/3/00
4002 static void bus_low(struct bttv
*btv
, int bit
)
4004 if (btv
->mbox_ior
) {
4005 gpio_bits(btv
->mbox_ior
| btv
->mbox_iow
| btv
->mbox_csel
,
4006 btv
->mbox_ior
| btv
->mbox_iow
| btv
->mbox_csel
);
4013 if (btv
->mbox_ior
) {
4014 gpio_bits(btv
->mbox_iow
| btv
->mbox_csel
, 0);
4019 static void bus_high(struct bttv
*btv
, int bit
)
4021 if (btv
->mbox_ior
) {
4022 gpio_bits(btv
->mbox_ior
| btv
->mbox_iow
| btv
->mbox_csel
,
4023 btv
->mbox_ior
| btv
->mbox_iow
| btv
->mbox_csel
);
4030 if (btv
->mbox_ior
) {
4031 gpio_bits(btv
->mbox_iow
| btv
->mbox_csel
, 0);
4036 static int bus_in(struct bttv
*btv
, int bit
)
4038 if (btv
->mbox_ior
) {
4039 gpio_bits(btv
->mbox_ior
| btv
->mbox_iow
| btv
->mbox_csel
,
4040 btv
->mbox_ior
| btv
->mbox_iow
| btv
->mbox_csel
);
4043 gpio_bits(btv
->mbox_iow
| btv
->mbox_csel
, 0);
4046 return gpio_read() & (bit
);
4049 /* TEA5757 register bits */
4050 #define TEA_FREQ 0:14
4051 #define TEA_BUFFER 15:15
4053 #define TEA_SIGNAL_STRENGTH 16:17
4055 #define TEA_PORT1 18:18
4056 #define TEA_PORT0 19:19
4058 #define TEA_BAND 20:21
4059 #define TEA_BAND_FM 0
4060 #define TEA_BAND_MW 1
4061 #define TEA_BAND_LW 2
4062 #define TEA_BAND_SW 3
4064 #define TEA_MONO 22:22
4065 #define TEA_ALLOW_STEREO 0
4066 #define TEA_FORCE_MONO 1
4068 #define TEA_SEARCH_DIRECTION 23:23
4069 #define TEA_SEARCH_DOWN 0
4070 #define TEA_SEARCH_UP 1
4072 #define TEA_STATUS 24:24
4073 #define TEA_STATUS_TUNED 0
4074 #define TEA_STATUS_SEARCHING 1
4076 /* Low-level stuff */
4077 static int tea5757_read(struct bttv
*btv
)
4079 unsigned long timeout
;
4083 /* better safe than sorry */
4084 gpio_inout(btv
->mbox_mask
, btv
->mbox_clk
| btv
->mbox_we
);
4086 if (btv
->mbox_ior
) {
4087 gpio_bits(btv
->mbox_ior
| btv
->mbox_iow
| btv
->mbox_csel
,
4088 btv
->mbox_ior
| btv
->mbox_iow
| btv
->mbox_csel
);
4093 bttv_gpio_tracking(btv
,"tea5757 read");
4095 bus_low(btv
,btv
->mbox_we
);
4096 bus_low(btv
,btv
->mbox_clk
);
4099 timeout
= jiffies
+ HZ
;
4101 /* wait for DATA line to go low; error if it doesn't */
4102 while (bus_in(btv
,btv
->mbox_data
) && time_before(jiffies
, timeout
))
4104 if (bus_in(btv
,btv
->mbox_data
)) {
4105 printk(KERN_WARNING
"bttv%d: tea5757: read timeout\n",btv
->c
.nr
);
4109 dprintk("bttv%d: tea5757:",btv
->c
.nr
);
4110 for(i
= 0; i
< 24; i
++)
4113 bus_high(btv
,btv
->mbox_clk
);
4115 dprintk("%c",(bus_in(btv
,btv
->mbox_most
) == 0)?'T':'-');
4116 bus_low(btv
,btv
->mbox_clk
);
4118 value
|= (bus_in(btv
,btv
->mbox_data
) == 0)?0:1; /* MSB first */
4119 dprintk("%c", (bus_in(btv
,btv
->mbox_most
) == 0)?'S':'M');
4121 dprintk("\nbttv%d: tea5757: read 0x%X\n", btv
->c
.nr
, value
);
4125 static int tea5757_write(struct bttv
*btv
, int value
)
4130 gpio_inout(btv
->mbox_mask
, btv
->mbox_clk
| btv
->mbox_we
| btv
->mbox_data
);
4132 if (btv
->mbox_ior
) {
4133 gpio_bits(btv
->mbox_ior
| btv
->mbox_iow
| btv
->mbox_csel
,
4134 btv
->mbox_ior
| btv
->mbox_iow
| btv
->mbox_csel
);
4138 bttv_gpio_tracking(btv
,"tea5757 write");
4140 dprintk("bttv%d: tea5757: write 0x%X\n", btv
->c
.nr
, value
);
4141 bus_low(btv
,btv
->mbox_clk
);
4142 bus_high(btv
,btv
->mbox_we
);
4143 for(i
= 0; i
< 25; i
++)
4145 if (reg
& 0x1000000)
4146 bus_high(btv
,btv
->mbox_data
);
4148 bus_low(btv
,btv
->mbox_data
);
4150 bus_high(btv
,btv
->mbox_clk
);
4152 bus_low(btv
,btv
->mbox_clk
);
4155 bus_low(btv
,btv
->mbox_we
); /* unmute !!! */
4159 void tea5757_set_freq(struct bttv
*btv
, unsigned short freq
)
4161 dprintk("tea5757_set_freq %d\n",freq
);
4162 tea5757_write(btv
, 5 * freq
+ 0x358); /* add 10.7MHz (see docs) */
4166 /* ----------------------------------------------------------------------- */
4169 static void winview_audio(struct bttv
*btv
, struct video_audio
*v
, int set
)
4171 /* PT2254A programming Jon Tombs, jon@gte.esi.us.es */
4172 int bits_out
, loops
, vol
, data
;
4175 /* Fixed by Leandro Lucarella <luca@linuxmendoza.org.ar (07/31/01) */
4176 v
->flags
|= VIDEO_AUDIO_VOLUME
;
4180 /* 32 levels logarithmic */
4181 vol
= 32 - ((v
->volume
>>11));
4183 bits_out
= (PT2254_DBS_IN_2
>>(vol
%5));
4185 bits_out
|= (PT2254_DBS_IN_10
>>(vol
/5));
4186 bits_out
|= PT2254_L_CHANNEL
| PT2254_R_CHANNEL
;
4188 data
&= ~(WINVIEW_PT2254_CLK
| WINVIEW_PT2254_DATA
|
4189 WINVIEW_PT2254_STROBE
);
4190 for (loops
= 17; loops
>= 0 ; loops
--) {
4191 if (bits_out
& (1<<loops
))
4192 data
|= WINVIEW_PT2254_DATA
;
4194 data
&= ~WINVIEW_PT2254_DATA
;
4197 data
|= WINVIEW_PT2254_CLK
;
4200 data
&= ~WINVIEW_PT2254_CLK
;
4203 data
|= WINVIEW_PT2254_STROBE
;
4204 data
&= ~WINVIEW_PT2254_DATA
;
4207 data
&= ~WINVIEW_PT2254_STROBE
;
4211 /* ----------------------------------------------------------------------- */
4212 /* mono/stereo control for various cards (which don't use i2c chips but */
4213 /* connect something to the GPIO pins */
4216 gvbctv3pci_audio(struct bttv
*btv
, struct video_audio
*v
, int set
)
4218 unsigned int con
= 0;
4221 gpio_inout(0x300, 0x300);
4222 if (v
->mode
& VIDEO_SOUND_LANG1
)
4224 if (v
->mode
& VIDEO_SOUND_LANG2
)
4226 if (v
->mode
& VIDEO_SOUND_STEREO
)
4228 /* if (v->mode & VIDEO_SOUND_MONO)
4230 gpio_bits(0x300, con
);
4232 v
->mode
= VIDEO_SOUND_STEREO
|
4233 VIDEO_SOUND_LANG1
| VIDEO_SOUND_LANG2
;
4238 gvbctv5pci_audio(struct bttv
*btv
, struct video_audio
*v
, int set
)
4240 unsigned int val
, con
;
4242 if (btv
->radio_user
)
4248 if (v
->mode
& VIDEO_SOUND_LANG2
) {
4249 if (v
->mode
& VIDEO_SOUND_LANG1
) {
4258 if (con
!= (val
& 0x300)) {
4259 gpio_bits(0x300, con
);
4261 bttv_gpio_tracking(btv
,"gvbctv5pci");
4264 switch (val
& 0x70) {
4266 v
->mode
= VIDEO_SOUND_LANG1
| VIDEO_SOUND_LANG2
;
4269 v
->mode
= VIDEO_SOUND_LANG2
;
4272 v
->mode
= VIDEO_SOUND_LANG1
;
4275 v
->mode
= VIDEO_SOUND_STEREO
;
4278 v
->mode
= VIDEO_SOUND_MONO
;
4281 v
->mode
= VIDEO_SOUND_MONO
| VIDEO_SOUND_STEREO
|
4282 VIDEO_SOUND_LANG1
| VIDEO_SOUND_LANG2
;
4288 * Mario Medina Nussbaum <medisoft@alohabbs.org.mx>
4289 * I discover that on BT848_GPIO_DATA address a byte 0xcce enable stereo,
4290 * 0xdde enables mono and 0xccd enables sap
4292 * Petr Vandrovec <VANDROVE@vc.cvut.cz>
4293 * P.S.: At least mask in line above is wrong - GPIO pins 3,2 select
4294 * input/output sound connection, so both must be set for output mode.
4296 * Looks like it's needed only for the "tvphone", the "tvphone 98"
4297 * handles this with a tda9840
4301 avermedia_tvphone_audio(struct bttv
*btv
, struct video_audio
*v
, int set
)
4306 if (v
->mode
& VIDEO_SOUND_LANG2
) /* SAP */
4308 if (v
->mode
& VIDEO_SOUND_STEREO
)
4311 gpio_bits(0x03,val
);
4313 bttv_gpio_tracking(btv
,"avermedia");
4316 v
->mode
= VIDEO_SOUND_MONO
| VIDEO_SOUND_STEREO
|
4323 avermedia_tv_stereo_audio(struct bttv
*btv
, struct video_audio
*v
, int set
)
4328 if (v
->mode
& VIDEO_SOUND_LANG2
) /* SAP */
4330 if (v
->mode
& VIDEO_SOUND_STEREO
) /* STEREO */
4332 btaor(val
, ~0x03, BT848_GPIO_DATA
);
4334 bttv_gpio_tracking(btv
,"avermedia");
4336 v
->mode
= VIDEO_SOUND_MONO
| VIDEO_SOUND_STEREO
|
4337 VIDEO_SOUND_LANG1
| VIDEO_SOUND_LANG2
;
4342 /* Lifetec 9415 handling */
4344 lt9415_audio(struct bttv
*btv
, struct video_audio
*v
, int set
)
4348 if (gpio_read() & 0x4000) {
4349 v
->mode
= VIDEO_SOUND_MONO
;
4354 if (v
->mode
& VIDEO_SOUND_LANG2
) /* A2 SAP */
4356 if (v
->mode
& VIDEO_SOUND_STEREO
) /* A2 stereo */
4358 if ((v
->mode
& VIDEO_SOUND_LANG1
) ||
4359 (v
->mode
& VIDEO_SOUND_MONO
))
4361 gpio_bits(0x0880, val
);
4363 bttv_gpio_tracking(btv
,"lt9415");
4365 /* autodetect doesn't work with this card :-( */
4366 v
->mode
= VIDEO_SOUND_MONO
| VIDEO_SOUND_STEREO
|
4367 VIDEO_SOUND_LANG1
| VIDEO_SOUND_LANG2
;
4372 /* TDA9821 on TerraTV+ Bt848, Bt878 */
4374 terratv_audio(struct bttv
*btv
, struct video_audio
*v
, int set
)
4376 unsigned int con
= 0;
4379 gpio_inout(0x180000,0x180000);
4380 if (v
->mode
& VIDEO_SOUND_LANG2
)
4382 if (v
->mode
& VIDEO_SOUND_STEREO
)
4384 gpio_bits(0x180000, con
);
4386 bttv_gpio_tracking(btv
,"terratv");
4388 v
->mode
= VIDEO_SOUND_MONO
| VIDEO_SOUND_STEREO
|
4389 VIDEO_SOUND_LANG1
| VIDEO_SOUND_LANG2
;
4394 winfast2000_audio(struct bttv
*btv
, struct video_audio
*v
, int set
)
4396 unsigned long val
= 0;
4399 /*btor (0xc32000, BT848_GPIO_OUT_EN);*/
4400 if (v
->mode
& VIDEO_SOUND_MONO
) /* Mono */
4402 if (v
->mode
& VIDEO_SOUND_LANG1
) /* Mono */
4404 if (v
->mode
& VIDEO_SOUND_LANG2
) /* SAP */
4406 if (v
->mode
& VIDEO_SOUND_STEREO
) /* Stereo */
4409 gpio_bits(0x430000, val
);
4411 bttv_gpio_tracking(btv
,"winfast2000");
4414 v
->mode
= VIDEO_SOUND_MONO
| VIDEO_SOUND_STEREO
|
4415 VIDEO_SOUND_LANG1
| VIDEO_SOUND_LANG2
;
4420 * Dariusz Kowalewski <darekk@automex.pl>
4421 * sound control for Prolink PV-BT878P+9B (PixelView PlayTV Pro FM+NICAM
4422 * revision 9B has on-board TDA9874A sound decoder).
4424 * Note: There are card variants without tda9874a. Forcing the "stereo sound route"
4425 * will mute this cards.
4428 pvbt878p9b_audio(struct bttv
*btv
, struct video_audio
*v
, int set
)
4430 unsigned int val
= 0;
4432 if (btv
->radio_user
)
4436 if (v
->mode
& VIDEO_SOUND_MONO
) {
4439 if ((v
->mode
& (VIDEO_SOUND_LANG1
| VIDEO_SOUND_LANG2
))
4440 || (v
->mode
& VIDEO_SOUND_STEREO
)) {
4444 gpio_bits(0x03,val
);
4446 bttv_gpio_tracking(btv
,"pvbt878p9b");
4449 v
->mode
= VIDEO_SOUND_MONO
| VIDEO_SOUND_STEREO
|
4450 VIDEO_SOUND_LANG1
| VIDEO_SOUND_LANG2
;
4455 * Dariusz Kowalewski <darekk@automex.pl>
4456 * sound control for FlyVideo 2000S (with tda9874 decoder)
4457 * based on pvbt878p9b_audio() - this is not tested, please fix!!!
4460 fv2000s_audio(struct bttv
*btv
, struct video_audio
*v
, int set
)
4462 unsigned int val
= 0xffff;
4464 if (btv
->radio_user
)
4467 if (v
->mode
& VIDEO_SOUND_MONO
) {
4470 if ((v
->mode
& (VIDEO_SOUND_LANG1
| VIDEO_SOUND_LANG2
))
4471 || (v
->mode
& VIDEO_SOUND_STEREO
)) {
4472 val
= 0x1080; /*-dk-???: 0x0880, 0x0080, 0x1800 ... */
4474 if (val
!= 0xffff) {
4475 gpio_bits(0x1800, val
);
4477 bttv_gpio_tracking(btv
,"fv2000s");
4480 v
->mode
= VIDEO_SOUND_MONO
| VIDEO_SOUND_STEREO
|
4481 VIDEO_SOUND_LANG1
| VIDEO_SOUND_LANG2
;
4486 * sound control for Canopus WinDVR PCI
4487 * Masaki Suzuki <masaki@btree.org>
4490 windvr_audio(struct bttv
*btv
, struct video_audio
*v
, int set
)
4492 unsigned long val
= 0;
4495 if (v
->mode
& VIDEO_SOUND_MONO
)
4497 if (v
->mode
& VIDEO_SOUND_LANG1
)
4499 if (v
->mode
& VIDEO_SOUND_LANG2
)
4501 if (v
->mode
& VIDEO_SOUND_STEREO
)
4504 gpio_bits(0x140000, val
);
4506 bttv_gpio_tracking(btv
,"windvr");
4509 v
->mode
= VIDEO_SOUND_MONO
| VIDEO_SOUND_STEREO
|
4510 VIDEO_SOUND_LANG1
| VIDEO_SOUND_LANG2
;
4515 * sound control for AD-TVK503
4516 * Hiroshi Takekawa <sian@big.or.jp>
4519 adtvk503_audio(struct bttv
*btv
, struct video_audio
*v
, int set
)
4521 unsigned int con
= 0xffffff;
4523 /* btaor(0x1e0000, ~0x1e0000, BT848_GPIO_OUT_EN); */
4526 /* btor(***, BT848_GPIO_OUT_EN); */
4527 if (v
->mode
& VIDEO_SOUND_LANG1
)
4529 if (v
->mode
& VIDEO_SOUND_LANG2
)
4531 if (v
->mode
& VIDEO_SOUND_STEREO
)
4533 if (v
->mode
& VIDEO_SOUND_MONO
)
4535 if (con
!= 0xffffff) {
4536 gpio_bits(0x1e0000,con
);
4538 bttv_gpio_tracking(btv
, "adtvk503");
4541 v
->mode
= VIDEO_SOUND_MONO
| VIDEO_SOUND_STEREO
|
4542 VIDEO_SOUND_LANG1
| VIDEO_SOUND_LANG2
;
4546 /* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]
4548 * This is needed because rv605 don't use a normal multiplex, but a crosspoint
4549 * switch instead (CD22M3494E). This IC can have multiple active connections
4550 * between Xn (input) and Yn (output) pins. We need to clear any existing
4551 * connection prior to establish a new one, pulsing the STROBE pin.
4553 * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
4554 * GPIO pins are wired as:
4555 * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroler)
4556 * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroler)
4557 * GPIO[7] - DATA (xpoint) - P1[7] (microcontroler)
4558 * GPIO[8] - - P3[5] (microcontroler)
4559 * GPIO[9] - RESET (xpoint) - P3[6] (microcontroler)
4560 * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroler)
4561 * GPINTR - - P3[4] (microcontroler)
4563 * The microcontroler is a 80C32 like. It should be possible to change xpoint
4564 * configuration either directly (as we are doing) or using the microcontroler
4565 * which is also wired to I2C interface. I have no further info on the
4566 * microcontroler features, one would need to disassembly the firmware.
4567 * note: the vendor refused to give any information on this product, all
4568 * that stuff was found using a multimeter! :)
4570 static void rv605_muxsel(struct bttv
*btv
, unsigned int input
)
4572 /* reset all conections */
4573 gpio_bits(0x200,0x200);
4575 gpio_bits(0x200,0x000);
4578 /* create a new conection */
4579 gpio_bits(0x480,0x080);
4580 gpio_bits(0x480,0x480);
4582 gpio_bits(0x480,0x080);
4586 /* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
4588 * The CS16 (available on eBay cheap) is a PCI board with four Fusion
4589 * 878A chips, a PCI bridge, an Atmel microcontroller, four sync seperator
4590 * chips, ten eight input analog multiplexors, a not chip and a few
4593 * 16 inputs on a secondary bracket are provided and can be selected
4594 * from each of the four capture chips. Two of the eight input
4595 * multiplexors are used to select from any of the 16 input signals.
4597 * Unsupported hardware capabilities:
4598 * . A video output monitor on the secondary bracket can be selected from
4599 * one of the 878A chips.
4600 * . Another passthrough but I haven't spent any time investigating it.
4601 * . Digital I/O (logic level connected to GPIO) is available from an
4604 * The on chip input mux should always be set to 2.
4605 * GPIO[16:19] - Video input selection
4606 * GPIO[0:3] - Video output monitor select (only available from one 878A)
4607 * GPIO[?:?] - Digital I/O.
4609 * There is an ATMEL microcontroller with an 8031 core on board. I have not
4610 * determined what function (if any) it provides. With the microcontroller
4611 * and sync seperator chips a guess is that it might have to do with video
4612 * switching and maybe some digital I/O.
4614 static void tibetCS16_muxsel(struct bttv
*btv
, unsigned int input
)
4617 gpio_bits(0x0f0000, input
<< 16);
4620 static void tibetCS16_init(struct bttv
*btv
)
4622 /* enable gpio bits, mask obtained via btSpy */
4623 gpio_inout(0xffffff, 0x0f7fff);
4624 gpio_write(0x0f7fff);
4628 * The following routines for the Kodicom-4400r get a little mind-twisting.
4629 * There is a "master" controller and three "slave" controllers, together
4630 * an analog switch which connects any of 16 cameras to any of the BT87A's.
4631 * The analog switch is controlled by the "master", but the detection order
4632 * of the four BT878A chips is in an order which I just don't understand.
4633 * The "master" is actually the second controller to be detected. The
4634 * logic on the board uses logical numbers for the 4 controlers, but
4635 * those numbers are different from the detection sequence. When working
4636 * with the analog switch, we need to "map" from the detection sequence
4637 * over to the board's logical controller number. This mapping sequence
4638 * is {3, 0, 2, 1}, i.e. the first controller to be detected is logical
4639 * unit 3, the second (which is the master) is logical unit 0, etc.
4640 * We need to maintain the status of the analog switch (which of the 16
4641 * cameras is connected to which of the 4 controllers). Rather than
4642 * add to the bttv structure for this, we use the data reserved for
4643 * the mbox (unused for this card type).
4647 * First a routine to set the analog switch, which controls which camera
4648 * is routed to which controller. The switch comprises an X-address
4649 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4650 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4651 * A data value (gpio bit 7) of '1' enables the switch, and '0' disables
4652 * the switch. A STROBE bit (gpio bit 8) latches the data value into the
4653 * specified address. The idea is to set the address and data, then bring
4654 * STROBE high, and finally bring STROBE back to low.
4656 static void kodicom4400r_write(struct bttv
*btv
,
4657 unsigned char xaddr
,
4658 unsigned char yaddr
,
4659 unsigned char data
) {
4662 udata
= (data
<< 7) | ((yaddr
&3) << 4) | (xaddr
&0xf);
4663 gpio_bits(0x1ff, udata
); /* write ADDR and DAT */
4664 gpio_bits(0x1ff, udata
| (1 << 8)); /* strobe high */
4665 gpio_bits(0x1ff, udata
); /* strobe low */
4669 * Next the mux select. Both the "master" and "slave" 'cards' (controllers)
4670 * use this routine. The routine finds the "master" for the card, maps
4671 * the controller number from the detected position over to the logical
4672 * number, writes the appropriate data to the analog switch, and housekeeps
4673 * the local copy of the switch information. The parameter 'input' is the
4674 * requested camera number (0 - 15).
4676 static void kodicom4400r_muxsel(struct bttv
*btv
, unsigned int input
)
4681 static unsigned char map
[4] = {3, 0, 2, 1};
4683 mctlr
= master
[btv
->c
.nr
];
4684 if (mctlr
== NULL
) { /* ignore if master not yet detected */
4687 yaddr
= (btv
->c
.nr
- mctlr
->c
.nr
+ 1) & 3; /* the '&' is for safety */
4689 sw_status
= (char *)(&mctlr
->mbox_we
);
4690 xaddr
= input
& 0xf;
4691 /* Check if the controller/camera pair has changed, else ignore */
4692 if (sw_status
[yaddr
] != xaddr
)
4694 /* "open" the old switch, "close" the new one, save the new */
4695 kodicom4400r_write(mctlr
, sw_status
[yaddr
], yaddr
, 0);
4696 sw_status
[yaddr
] = xaddr
;
4697 kodicom4400r_write(mctlr
, xaddr
, yaddr
, 1);
4702 * During initialisation, we need to reset the analog switch. We
4703 * also preset the switch to map the 4 connectors on the card to the
4704 * *user's* (see above description of kodicom4400r_muxsel) channels
4707 static void kodicom4400r_init(struct bttv
*btv
)
4709 char *sw_status
= (char *)(&btv
->mbox_we
);
4712 gpio_inout(0x0003ff, 0x0003ff);
4713 gpio_write(1 << 9); /* reset MUX */
4715 /* Preset camera 0 to the 4 controllers */
4716 for (ix
=0; ix
<4; ix
++) {
4718 kodicom4400r_write(btv
, ix
, ix
, 1);
4721 * Since this is the "master", we need to set up the
4722 * other three controller chips' pointers to this structure
4723 * for later use in the muxsel routine.
4725 if ((btv
->c
.nr
<1) || (btv
->c
.nr
>BTTV_MAX
-3))
4727 master
[btv
->c
.nr
-1] = btv
;
4728 master
[btv
->c
.nr
] = btv
;
4729 master
[btv
->c
.nr
+1] = btv
;
4730 master
[btv
->c
.nr
+2] = btv
;
4733 /* The Grandtec X-Guard framegrabber card uses two Dual 4-channel
4734 * video multiplexers to provide up to 16 video inputs. These
4735 * multiplexers are controlled by the lower 8 GPIO pins of the
4736 * bt878. The multiplexers probably Pericom PI5V331Q or similar.
4738 * xxx0 is pin xxx of multiplexer U5,
4739 * yyy1 is pin yyy of multiplexer U2
4751 static void xguard_muxsel(struct bttv
*btv
, unsigned int input
)
4753 static const int masks
[] = {
4754 ENB0
, ENB0
|IN00
, ENB0
|IN10
, ENB0
|IN00
|IN10
,
4755 ENA0
, ENA0
|IN00
, ENA0
|IN10
, ENA0
|IN00
|IN10
,
4756 ENB1
, ENB1
|IN01
, ENB1
|IN11
, ENB1
|IN01
|IN11
,
4757 ENA1
, ENA1
|IN01
, ENA1
|IN11
, ENA1
|IN01
|IN11
,
4759 gpio_write(masks
[input
%16]);
4761 static void picolo_tetra_init(struct bttv
*btv
)
4763 /*This is the video input redirection fonctionality : I DID NOT USED IT. */
4764 btwrite (0x08<<16,BT848_GPIO_DATA
);/*GPIO[19] [==> 4053 B+C] set to 1 */
4765 btwrite (0x04<<16,BT848_GPIO_DATA
);/*GPIO[18] [==> 4053 A] set to 1*/
4767 static void picolo_tetra_muxsel (struct bttv
* btv
, unsigned int input
)
4770 dprintk (KERN_DEBUG
"bttv%d : picolo_tetra_muxsel => input = %d\n",btv
->c
.nr
,input
);
4771 /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
4772 /*GPIO[20]&GPIO[21] used to choose the right input*/
4773 btwrite (input
<<20,BT848_GPIO_DATA
);
4778 * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
4780 * The IVC120G security card has 4 i2c controlled TDA8540 matrix
4781 * swichers to provide 16 channels to MUX0. The TDA8540's have
4782 * 4 indepedant outputs and as such the IVC120G also has the
4783 * optional "Monitor Out" bus. This allows the card to be looking
4784 * at one input while the monitor is looking at another.
4786 * Since I've couldn't be bothered figuring out how to add an
4787 * independant muxsel for the monitor bus, I've just set it to
4788 * whatever the card is looking at.
4790 * OUT0 of the TDA8540's is connected to MUX0 (0x03)
4791 * OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)
4793 * TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)
4794 * TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)
4795 * TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)
4796 * TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)
4800 /* All 7 possible sub-ids for the TDA8540 Matrix Switcher */
4801 #define I2C_TDA8540 0x90
4802 #define I2C_TDA8540_ALT1 0x92
4803 #define I2C_TDA8540_ALT2 0x94
4804 #define I2C_TDA8540_ALT3 0x96
4805 #define I2C_TDA8540_ALT4 0x98
4806 #define I2C_TDA8540_ALT5 0x9a
4807 #define I2C_TDA8540_ALT6 0x9c
4809 static void ivc120_muxsel(struct bttv
*btv
, unsigned int input
)
4812 int key
= input
% 4;
4813 int matrix
= input
/ 4;
4815 dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4816 btv
->c
.nr
, input
, matrix
, key
);
4818 /* Handles the input selection on the TDA8540's */
4819 bttv_I2CWrite(btv
, I2C_TDA8540_ALT3
, 0x00,
4820 ((matrix
== 3) ? (key
| key
<< 2) : 0x00), 1);
4821 bttv_I2CWrite(btv
, I2C_TDA8540_ALT4
, 0x00,
4822 ((matrix
== 0) ? (key
| key
<< 2) : 0x00), 1);
4823 bttv_I2CWrite(btv
, I2C_TDA8540_ALT5
, 0x00,
4824 ((matrix
== 1) ? (key
| key
<< 2) : 0x00), 1);
4825 bttv_I2CWrite(btv
, I2C_TDA8540_ALT6
, 0x00,
4826 ((matrix
== 2) ? (key
| key
<< 2) : 0x00), 1);
4828 /* Handles the output enables on the TDA8540's */
4829 bttv_I2CWrite(btv
, I2C_TDA8540_ALT3
, 0x02,
4830 ((matrix
== 3) ? 0x03 : 0x00), 1); /* 13 - 16 */
4831 bttv_I2CWrite(btv
, I2C_TDA8540_ALT4
, 0x02,
4832 ((matrix
== 0) ? 0x03 : 0x00), 1); /* 1-4 */
4833 bttv_I2CWrite(btv
, I2C_TDA8540_ALT5
, 0x02,
4834 ((matrix
== 1) ? 0x03 : 0x00), 1); /* 5-8 */
4835 bttv_I2CWrite(btv
, I2C_TDA8540_ALT6
, 0x02,
4836 ((matrix
== 2) ? 0x03 : 0x00), 1); /* 9-12 */
4838 /* Selects MUX0 for input on the 878 */
4839 btaor((0)<<5, ~(3<<5), BT848_IFORM
);
4843 /* PXC200 muxsel helper
4844 * luke@syseng.anu.edu.au
4845 * another transplant
4846 * from Alessandro Rubini (rubini@linux.it)
4848 * There are 4 kinds of cards:
4849 * PXC200L which is bt848
4850 * PXC200F which is bt848 with PIC controlling mux
4851 * PXC200AL which is bt878
4852 * PXC200AF which is bt878 with PIC controlling mux
4854 #define PX_CFG_PXC200F 0x01
4855 #define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */
4856 #define PX_I2C_PIC 0x0f
4857 #define PX_PXC200A_CARDID 0x200a1295
4858 #define PX_I2C_CMD_CFG 0x00
4860 static void PXC200_muxsel(struct bttv
*btv
, unsigned int input
)
4865 unsigned char buf
[2];
4867 /* Read PIC config to determine if this is a PXC200F */
4871 rc
=bttv_I2CWrite(btv
,(PX_I2C_PIC
<<1),buf
[0],buf
[1],1);
4873 printk(KERN_DEBUG
"bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv
->c
.nr
,rc
);
4874 /* not PXC ? do nothing */
4878 rc
=bttv_I2CRead(btv
,(PX_I2C_PIC
<<1),NULL
);
4879 if (!(rc
& PX_CFG_PXC200F
)) {
4880 printk(KERN_DEBUG
"bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv
->c
.nr
,rc
);
4885 /* The multiplexer in the 200F is handled by the GPIO port */
4886 /* get correct mapping between inputs */
4887 /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */
4888 /* ** not needed!? */
4891 /* make sure output pins are enabled */
4892 /* bitmask=0x30f; */
4894 /* check whether we have a PXC200A */
4895 if (btv
->cardid
== PX_PXC200A_CARDID
) {
4896 bitmask
^= 0x180; /* use 7 and 9, not 8 and 9 */
4897 bitmask
|= 7<<4; /* the DAC */
4899 btwrite(bitmask
, BT848_GPIO_OUT_EN
);
4901 bitmask
= btread(BT848_GPIO_DATA
);
4902 if (btv
->cardid
== PX_PXC200A_CARDID
)
4903 bitmask
= (bitmask
& ~0x280) | ((mux
& 2) << 8) | ((mux
& 1) << 7);
4904 else /* older device */
4905 bitmask
= (bitmask
& ~0x300) | ((mux
& 3) << 8);
4906 btwrite(bitmask
,BT848_GPIO_DATA
);
4909 * Was "to be safe, set the bt848 to input 0"
4910 * Actually, since it's ok at load time, better not messing
4911 * with these bits (on PXC200AF you need to set mux 2 here)
4913 * needed because bttv-driver sets mux before calling this function
4915 if (btv
->cardid
== PX_PXC200A_CARDID
)
4916 btaor(2<<5, ~BT848_IFORM_MUXSEL
, BT848_IFORM
);
4917 else /* older device */
4918 btand(~BT848_IFORM_MUXSEL
,BT848_IFORM
);
4920 printk(KERN_DEBUG
"bttv%d: setting input channel to:%d\n", btv
->c
.nr
,(int)mux
);
4923 /* ----------------------------------------------------------------------- */
4924 /* motherboard chipset specific stuff */
4926 void __devinit
bttv_check_chipset(void)
4928 int pcipci_fail
= 0;
4929 struct pci_dev
*dev
= NULL
;
4931 if (pci_pci_problems
& PCIPCI_FAIL
)
4933 if (pci_pci_problems
& (PCIPCI_TRITON
|PCIPCI_NATOMA
|PCIPCI_VIAETBF
))
4935 if (pci_pci_problems
& PCIPCI_VSFX
)
4937 #ifdef PCIPCI_ALIMAGIK
4938 if (pci_pci_problems
& PCIPCI_ALIMAGIK
)
4943 /* print warnings about any quirks found */
4945 printk(KERN_INFO
"bttv: Host bridge needs ETBF enabled.\n");
4947 printk(KERN_INFO
"bttv: Host bridge needs VSFX enabled.\n");
4949 printk(KERN_INFO
"bttv: bttv and your chipset may not work "
4952 printk(KERN_INFO
"bttv: overlay will be disabled.\n");
4955 printk(KERN_INFO
"bttv: overlay forced. Use this "
4956 "option at your own risk.\n");
4959 if (UNSET
!= latency
)
4960 printk(KERN_INFO
"bttv: pci latency fixup [%d]\n",latency
);
4961 while ((dev
= pci_get_device(PCI_VENDOR_ID_INTEL
,
4962 PCI_DEVICE_ID_INTEL_82441
, dev
))) {
4964 pci_read_config_byte(dev
, 0x53, &b
);
4966 printk(KERN_INFO
"bttv: Host bridge: 82441FX Natoma, "
4967 "bufcon=0x%02x\n",b
);
4971 int __devinit
bttv_handle_chipset(struct bttv
*btv
)
4973 unsigned char command
;
4975 if (!triton1
&& !vsfx
&& UNSET
== latency
)
4980 printk(KERN_INFO
"bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv
->c
.nr
);
4981 if (vsfx
&& btv
->id
>= 878)
4982 printk(KERN_INFO
"bttv%d: enabling VSFX\n",btv
->c
.nr
);
4983 if (UNSET
!= latency
)
4984 printk(KERN_INFO
"bttv%d: setting pci timer to %d\n",
4988 if (btv
->id
< 878) {
4989 /* bt848 (mis)uses a bit in the irq mask for etbf */
4991 btv
->triton1
= BT848_INT_ETBF
;
4993 /* bt878 has a bit in the pci config space for it */
4994 pci_read_config_byte(btv
->c
.pci
, BT878_DEVCTRL
, &command
);
4996 command
|= BT878_EN_TBFX
;
4998 command
|= BT878_EN_VSFX
;
4999 pci_write_config_byte(btv
->c
.pci
, BT878_DEVCTRL
, command
);
5001 if (UNSET
!= latency
)
5002 pci_write_config_byte(btv
->c
.pci
, PCI_LATENCY_TIMER
, latency
);