PageRenderTime 74ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 1ms

/drivers/media/video/bt8xx/bttv-cards.c

https://bitbucket.org/wisechild/galaxy-nexus
C | 4919 lines | 3616 code | 335 blank | 968 comment | 267 complexity | 2cf82df568d82f3fc00a6bea644c353e MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.0, AGPL-1.0
  1. /*
  2. bttv-cards.c
  3. this file has configuration informations - card-specific stuff
  4. like the big tvcards array for the most part
  5. Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
  6. & Marcus Metzler (mocm@thp.uni-koeln.de)
  7. (c) 1999-2001 Gerd Knorr <kraxel@goldbach.in-berlin.de>
  8. This program is free software; you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation; either version 2 of the License, or
  11. (at your option) any later version.
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. GNU General Public License for more details.
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20. #include <linux/delay.h>
  21. #include <linux/module.h>
  22. #include <linux/kmod.h>
  23. #include <linux/init.h>
  24. #include <linux/pci.h>
  25. #include <linux/vmalloc.h>
  26. #include <linux/firmware.h>
  27. #include <net/checksum.h>
  28. #include <asm/unaligned.h>
  29. #include <asm/io.h>
  30. #include "bttvp.h"
  31. #include <media/v4l2-common.h>
  32. #include <media/tvaudio.h>
  33. #include "bttv-audio-hook.h"
  34. /* fwd decl */
  35. static void boot_msp34xx(struct bttv *btv, int pin);
  36. static void hauppauge_eeprom(struct bttv *btv);
  37. static void avermedia_eeprom(struct bttv *btv);
  38. static void osprey_eeprom(struct bttv *btv, const u8 ee[256]);
  39. static void modtec_eeprom(struct bttv *btv);
  40. static void init_PXC200(struct bttv *btv);
  41. static void init_RTV24(struct bttv *btv);
  42. static void rv605_muxsel(struct bttv *btv, unsigned int input);
  43. static void eagle_muxsel(struct bttv *btv, unsigned int input);
  44. static void xguard_muxsel(struct bttv *btv, unsigned int input);
  45. static void ivc120_muxsel(struct bttv *btv, unsigned int input);
  46. static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
  47. static void PXC200_muxsel(struct bttv *btv, unsigned int input);
  48. static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);
  49. static void picolo_tetra_init(struct bttv *btv);
  50. static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
  51. static void tibetCS16_init(struct bttv *btv);
  52. static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
  53. static void kodicom4400r_init(struct bttv *btv);
  54. static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
  55. static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
  56. static void geovision_muxsel(struct bttv *btv, unsigned int input);
  57. static void phytec_muxsel(struct bttv *btv, unsigned int input);
  58. static void gv800s_muxsel(struct bttv *btv, unsigned int input);
  59. static void gv800s_init(struct bttv *btv);
  60. static int terratec_active_radio_upgrade(struct bttv *btv);
  61. static int tea5757_read(struct bttv *btv);
  62. static int tea5757_write(struct bttv *btv, int value);
  63. static void identify_by_eeprom(struct bttv *btv,
  64. unsigned char eeprom_data[256]);
  65. static int __devinit pvr_boot(struct bttv *btv);
  66. /* config variables */
  67. static unsigned int triton1;
  68. static unsigned int vsfx;
  69. static unsigned int latency = UNSET;
  70. int no_overlay=-1;
  71. static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
  72. static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
  73. static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
  74. static unsigned int svhs[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
  75. static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
  76. static unsigned int audiodev[BTTV_MAX];
  77. static unsigned int saa6588[BTTV_MAX];
  78. static struct bttv *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL };
  79. static unsigned int autoload = UNSET;
  80. static unsigned int gpiomask = UNSET;
  81. static unsigned int audioall = UNSET;
  82. static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };
  83. /* insmod options */
  84. module_param(triton1, int, 0444);
  85. module_param(vsfx, int, 0444);
  86. module_param(no_overlay, int, 0444);
  87. module_param(latency, int, 0444);
  88. module_param(gpiomask, int, 0444);
  89. module_param(audioall, int, 0444);
  90. module_param(autoload, int, 0444);
  91. module_param_array(card, int, NULL, 0444);
  92. module_param_array(pll, int, NULL, 0444);
  93. module_param_array(tuner, int, NULL, 0444);
  94. module_param_array(svhs, int, NULL, 0444);
  95. module_param_array(remote, int, NULL, 0444);
  96. module_param_array(audiodev, int, NULL, 0444);
  97. module_param_array(audiomux, int, NULL, 0444);
  98. MODULE_PARM_DESC(triton1,"set ETBF pci config bit "
  99. "[enable bug compatibility for triton1 + others]");
  100. MODULE_PARM_DESC(vsfx,"set VSFX pci config bit "
  101. "[yet another chipset flaw workaround]");
  102. MODULE_PARM_DESC(latency,"pci latency timer");
  103. MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list");
  104. MODULE_PARM_DESC(pll,"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)");
  105. MODULE_PARM_DESC(tuner,"specify installed tuner type");
  106. MODULE_PARM_DESC(autoload, "obsolete option, please do not use anymore");
  107. MODULE_PARM_DESC(audiodev, "specify audio device:\n"
  108. "\t\t-1 = no audio\n"
  109. "\t\t 0 = autodetect (default)\n"
  110. "\t\t 1 = msp3400\n"
  111. "\t\t 2 = tda7432\n"
  112. "\t\t 3 = tvaudio");
  113. MODULE_PARM_DESC(saa6588, "if 1, then load the saa6588 RDS module, default (0) is to use the card definition.");
  114. MODULE_PARM_DESC(no_overlay,"allow override overlay default (0 disables, 1 enables)"
  115. " [some VIA/SIS chipsets are known to have problem with overlay]");
  116. /* ----------------------------------------------------------------------- */
  117. /* list of card IDs for bt878+ cards */
  118. static struct CARD {
  119. unsigned id;
  120. int cardnr;
  121. char *name;
  122. } cards[] __devinitdata = {
  123. { 0x13eb0070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV" },
  124. { 0x39000070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV-D" },
  125. { 0x45000070, BTTV_BOARD_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" },
  126. { 0xff000070, BTTV_BOARD_OSPREY1x0, "Osprey-100" },
  127. { 0xff010070, BTTV_BOARD_OSPREY2x0_SVID,"Osprey-200" },
  128. { 0xff020070, BTTV_BOARD_OSPREY500, "Osprey-500" },
  129. { 0xff030070, BTTV_BOARD_OSPREY2000, "Osprey-2000" },
  130. { 0xff040070, BTTV_BOARD_OSPREY540, "Osprey-540" },
  131. { 0xff070070, BTTV_BOARD_OSPREY440, "Osprey-440" },
  132. { 0x00011002, BTTV_BOARD_ATI_TVWONDER, "ATI TV Wonder" },
  133. { 0x00031002, BTTV_BOARD_ATI_TVWONDERVE,"ATI TV Wonder/VE" },
  134. { 0x6606107d, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
  135. { 0x6607107d, BTTV_BOARD_WINFASTVC100, "Leadtek WinFast VC 100" },
  136. { 0x6609107d, BTTV_BOARD_WINFAST2000, "Leadtek TV 2000 XP" },
  137. { 0x263610b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
  138. { 0x264510b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
  139. { 0x402010fc, BTTV_BOARD_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" },
  140. { 0x405010fc, BTTV_BOARD_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" },
  141. { 0x407010fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
  142. { 0xd01810fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
  143. { 0x001211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
  144. /* some cards ship with byteswapped IDs ... */
  145. { 0x1200bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
  146. { 0xff00bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
  147. /* this seems to happen as well ... */
  148. { 0xff1211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
  149. { 0x3000121a, BTTV_BOARD_VOODOOTV_200, "3Dfx VoodooTV 200" },
  150. { 0x263710b4, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM" },
  151. { 0x3060121a, BTTV_BOARD_STB2, "3Dfx VoodooTV 100/ STB OEM" },
  152. { 0x3000144f, BTTV_BOARD_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" },
  153. { 0xa005144f, BTTV_BOARD_MAGICTVIEW063, "CPH06X TView99-Card" },
  154. { 0x3002144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" },
  155. { 0x3005144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },
  156. { 0x5000144f, BTTV_BOARD_MAGICTVIEW061, "Askey CPH050" },
  157. { 0x300014ff, BTTV_BOARD_MAGICTVIEW061, "TView 99 (CPH061)" },
  158. { 0x300214ff, BTTV_BOARD_PHOEBE_TVMAS, "Phoebe TV Master (CPH060)" },
  159. { 0x00011461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
  160. { 0x00021461, BTTV_BOARD_AVERMEDIA98, "AVermedia TVCapture 98" },
  161. { 0x00031461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
  162. { 0x00041461, BTTV_BOARD_AVERMEDIA98, "AVerMedia TVCapture 98" },
  163. { 0x03001461, BTTV_BOARD_AVERMEDIA98, "VDOMATE TV TUNER CARD" },
  164. { 0x1117153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL B/G)" },
  165. { 0x1118153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" },
  166. { 0x1119153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL I)" },
  167. { 0x111a153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL I)" },
  168. { 0x1123153b, BTTV_BOARD_TERRATVRADIO, "Terratec TV Radio+" },
  169. { 0x1127153b, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.05)" },
  170. /* clashes with FlyVideo
  171. *{ 0x18521852, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.10)" }, */
  172. { 0x1134153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (LR102)" },
  173. { 0x1135153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* LR102 */
  174. { 0x5018153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue" }, /* ?? */
  175. { 0xff3b153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* ?? */
  176. { 0x400015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
  177. { 0x400a15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
  178. { 0x400d15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
  179. { 0x401015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
  180. { 0x401615b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
  181. { 0x1430aa00, BTTV_BOARD_PV143, "Provideo PV143A" },
  182. { 0x1431aa00, BTTV_BOARD_PV143, "Provideo PV143B" },
  183. { 0x1432aa00, BTTV_BOARD_PV143, "Provideo PV143C" },
  184. { 0x1433aa00, BTTV_BOARD_PV143, "Provideo PV143D" },
  185. { 0x1433aa03, BTTV_BOARD_PV143, "Security Eyes" },
  186. { 0x1460aa00, BTTV_BOARD_PV150, "Provideo PV150A-1" },
  187. { 0x1461aa01, BTTV_BOARD_PV150, "Provideo PV150A-2" },
  188. { 0x1462aa02, BTTV_BOARD_PV150, "Provideo PV150A-3" },
  189. { 0x1463aa03, BTTV_BOARD_PV150, "Provideo PV150A-4" },
  190. { 0x1464aa04, BTTV_BOARD_PV150, "Provideo PV150B-1" },
  191. { 0x1465aa05, BTTV_BOARD_PV150, "Provideo PV150B-2" },
  192. { 0x1466aa06, BTTV_BOARD_PV150, "Provideo PV150B-3" },
  193. { 0x1467aa07, BTTV_BOARD_PV150, "Provideo PV150B-4" },
  194. { 0xa132ff00, BTTV_BOARD_IVC100, "IVC-100" },
  195. { 0xa1550000, BTTV_BOARD_IVC200, "IVC-200" },
  196. { 0xa1550001, BTTV_BOARD_IVC200, "IVC-200" },
  197. { 0xa1550002, BTTV_BOARD_IVC200, "IVC-200" },
  198. { 0xa1550003, BTTV_BOARD_IVC200, "IVC-200" },
  199. { 0xa1550100, BTTV_BOARD_IVC200, "IVC-200G" },
  200. { 0xa1550101, BTTV_BOARD_IVC200, "IVC-200G" },
  201. { 0xa1550102, BTTV_BOARD_IVC200, "IVC-200G" },
  202. { 0xa1550103, BTTV_BOARD_IVC200, "IVC-200G" },
  203. { 0xa1550800, BTTV_BOARD_IVC200, "IVC-200" },
  204. { 0xa1550801, BTTV_BOARD_IVC200, "IVC-200" },
  205. { 0xa1550802, BTTV_BOARD_IVC200, "IVC-200" },
  206. { 0xa1550803, BTTV_BOARD_IVC200, "IVC-200" },
  207. { 0xa182ff00, BTTV_BOARD_IVC120, "IVC-120G" },
  208. { 0xa182ff01, BTTV_BOARD_IVC120, "IVC-120G" },
  209. { 0xa182ff02, BTTV_BOARD_IVC120, "IVC-120G" },
  210. { 0xa182ff03, BTTV_BOARD_IVC120, "IVC-120G" },
  211. { 0xa182ff04, BTTV_BOARD_IVC120, "IVC-120G" },
  212. { 0xa182ff05, BTTV_BOARD_IVC120, "IVC-120G" },
  213. { 0xa182ff06, BTTV_BOARD_IVC120, "IVC-120G" },
  214. { 0xa182ff07, BTTV_BOARD_IVC120, "IVC-120G" },
  215. { 0xa182ff08, BTTV_BOARD_IVC120, "IVC-120G" },
  216. { 0xa182ff09, BTTV_BOARD_IVC120, "IVC-120G" },
  217. { 0xa182ff0a, BTTV_BOARD_IVC120, "IVC-120G" },
  218. { 0xa182ff0b, BTTV_BOARD_IVC120, "IVC-120G" },
  219. { 0xa182ff0c, BTTV_BOARD_IVC120, "IVC-120G" },
  220. { 0xa182ff0d, BTTV_BOARD_IVC120, "IVC-120G" },
  221. { 0xa182ff0e, BTTV_BOARD_IVC120, "IVC-120G" },
  222. { 0xa182ff0f, BTTV_BOARD_IVC120, "IVC-120G" },
  223. { 0xf0500000, BTTV_BOARD_IVCE8784, "IVCE-8784" },
  224. { 0xf0500001, BTTV_BOARD_IVCE8784, "IVCE-8784" },
  225. { 0xf0500002, BTTV_BOARD_IVCE8784, "IVCE-8784" },
  226. { 0xf0500003, BTTV_BOARD_IVCE8784, "IVCE-8784" },
  227. { 0x41424344, BTTV_BOARD_GRANDTEC, "GrandTec Multi Capture" },
  228. { 0x01020304, BTTV_BOARD_XGUARD, "Grandtec Grand X-Guard" },
  229. { 0x18501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
  230. { 0xa0501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
  231. { 0x18511851, BTTV_BOARD_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" },
  232. { 0x18521852, BTTV_BOARD_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
  233. { 0x41a0a051, BTTV_BOARD_FLYVIDEO_98FM, "Lifeview FlyVideo 98 LR50 Rev Q" },
  234. { 0x18501f7f, BTTV_BOARD_FLYVIDEO_98, "Lifeview Flyvideo 98" },
  235. { 0x010115cb, BTTV_BOARD_GMV1, "AG GMV1" },
  236. { 0x010114c7, BTTV_BOARD_MODTEC_205, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
  237. { 0x10b42636, BTTV_BOARD_HAUPPAUGE878, "STB ???" },
  238. { 0x217d6606, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
  239. { 0xfff6f6ff, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
  240. { 0x03116000, BTTV_BOARD_SENSORAY311, "Sensoray 311" },
  241. { 0x00790e11, BTTV_BOARD_WINDVR, "Canopus WinDVR PCI" },
  242. { 0xa0fca1a0, BTTV_BOARD_ZOLTRIX, "Face to Face Tvmax" },
  243. { 0x82b2aa6a, BTTV_BOARD_SIMUS_GVC1100, "SIMUS GVC1100" },
  244. { 0x146caa0c, BTTV_BOARD_PV951, "ituner spectra8" },
  245. { 0x200a1295, BTTV_BOARD_PXC200, "ImageNation PXC200A" },
  246. { 0x40111554, BTTV_BOARD_PV_BT878P_9B, "Prolink Pixelview PV-BT" },
  247. { 0x17de0a01, BTTV_BOARD_KWORLD, "Mecer TV/FM/Video Tuner" },
  248. { 0x01051805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #1" },
  249. { 0x01061805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #2" },
  250. { 0x01071805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #3" },
  251. { 0x01081805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #4" },
  252. { 0x15409511, BTTV_BOARD_ACORP_Y878F, "Acorp Y878F" },
  253. { 0x53534149, BTTV_BOARD_SSAI_SECURITY, "SSAI Security Video Interface" },
  254. { 0x5353414a, BTTV_BOARD_SSAI_ULTRASOUND, "SSAI Ultrasound Video Interface" },
  255. /* likely broken, vendor id doesn't match the other magic views ...
  256. * { 0xa0fca04f, BTTV_BOARD_MAGICTVIEW063, "Guillemot Maxi TV Video 3" }, */
  257. /* Duplicate PCI ID, reconfigure for this board during the eeprom read.
  258. * { 0x13eb0070, BTTV_BOARD_HAUPPAUGE_IMPACTVCB, "Hauppauge ImpactVCB" }, */
  259. { 0x109e036e, BTTV_BOARD_CONCEPTRONIC_CTVFMI2, "Conceptronic CTVFMi v2"},
  260. /* DVB cards (using pci function .1 for mpeg data xfer) */
  261. { 0x001c11bd, BTTV_BOARD_PINNACLESAT, "Pinnacle PCTV Sat" },
  262. { 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
  263. { 0x20007063, BTTV_BOARD_PC_HDTV, "pcHDTV HD-2000 TV"},
  264. { 0x002611bd, BTTV_BOARD_TWINHAN_DST, "Pinnacle PCTV SAT CI" },
  265. { 0x00011822, BTTV_BOARD_TWINHAN_DST, "Twinhan VisionPlus DVB" },
  266. { 0xfc00270f, BTTV_BOARD_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" },
  267. { 0x07711461, BTTV_BOARD_AVDVBT_771, "AVermedia AverTV DVB-T 771" },
  268. { 0x07611461, BTTV_BOARD_AVDVBT_761, "AverMedia AverTV DVB-T 761" },
  269. { 0xdb1018ac, BTTV_BOARD_DVICO_DVBT_LITE, "DViCO FusionHDTV DVB-T Lite" },
  270. { 0xdb1118ac, BTTV_BOARD_DVICO_DVBT_LITE, "Ultraview DVB-T Lite" },
  271. { 0xd50018ac, BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE, "DViCO FusionHDTV 5 Lite" },
  272. { 0x00261822, BTTV_BOARD_TWINHAN_DST, "DNTV Live! Mini "},
  273. { 0xd200dbc0, BTTV_BOARD_DVICO_FUSIONHDTV_2, "DViCO FusionHDTV 2" },
  274. { 0x763c008a, BTTV_BOARD_GEOVISION_GV600, "GeoVision GV-600" },
  275. { 0x18011000, BTTV_BOARD_ENLTV_FM_2, "Encore ENL TV-FM-2" },
  276. { 0x763d800a, BTTV_BOARD_GEOVISION_GV800S, "GeoVision GV-800(S) (master)" },
  277. { 0x763d800b, BTTV_BOARD_GEOVISION_GV800S_SL, "GeoVision GV-800(S) (slave)" },
  278. { 0x763d800c, BTTV_BOARD_GEOVISION_GV800S_SL, "GeoVision GV-800(S) (slave)" },
  279. { 0x763d800d, BTTV_BOARD_GEOVISION_GV800S_SL, "GeoVision GV-800(S) (slave)" },
  280. { 0x15401830, BTTV_BOARD_PV183, "Provideo PV183-1" },
  281. { 0x15401831, BTTV_BOARD_PV183, "Provideo PV183-2" },
  282. { 0x15401832, BTTV_BOARD_PV183, "Provideo PV183-3" },
  283. { 0x15401833, BTTV_BOARD_PV183, "Provideo PV183-4" },
  284. { 0x15401834, BTTV_BOARD_PV183, "Provideo PV183-5" },
  285. { 0x15401835, BTTV_BOARD_PV183, "Provideo PV183-6" },
  286. { 0x15401836, BTTV_BOARD_PV183, "Provideo PV183-7" },
  287. { 0x15401837, BTTV_BOARD_PV183, "Provideo PV183-8" },
  288. { 0, -1, NULL }
  289. };
  290. /* ----------------------------------------------------------------------- */
  291. /* array with description for bt848 / bt878 tv/grabber cards */
  292. struct tvcard bttv_tvcards[] = {
  293. /* ---- card 0x00 ---------------------------------- */
  294. [BTTV_BOARD_UNKNOWN] = {
  295. .name = " *** UNKNOWN/GENERIC *** ",
  296. .video_inputs = 4,
  297. .svhs = 2,
  298. .muxsel = MUXSEL(2, 3, 1, 0),
  299. .tuner_type = UNSET,
  300. .tuner_addr = ADDR_UNSET,
  301. },
  302. [BTTV_BOARD_MIRO] = {
  303. .name = "MIRO PCTV",
  304. .video_inputs = 4,
  305. /* .audio_inputs= 1, */
  306. .svhs = 2,
  307. .gpiomask = 15,
  308. .muxsel = MUXSEL(2, 3, 1, 1),
  309. .gpiomux = { 2, 0, 0, 0 },
  310. .gpiomute = 10,
  311. .needs_tvaudio = 1,
  312. .tuner_type = UNSET,
  313. .tuner_addr = ADDR_UNSET,
  314. },
  315. [BTTV_BOARD_HAUPPAUGE] = {
  316. .name = "Hauppauge (bt848)",
  317. .video_inputs = 4,
  318. /* .audio_inputs= 1, */
  319. .svhs = 2,
  320. .gpiomask = 7,
  321. .muxsel = MUXSEL(2, 3, 1, 1),
  322. .gpiomux = { 0, 1, 2, 3 },
  323. .gpiomute = 4,
  324. .needs_tvaudio = 1,
  325. .tuner_type = UNSET,
  326. .tuner_addr = ADDR_UNSET,
  327. },
  328. [BTTV_BOARD_STB] = {
  329. .name = "STB, Gateway P/N 6000699 (bt848)",
  330. .video_inputs = 3,
  331. /* .audio_inputs= 1, */
  332. .svhs = 2,
  333. .gpiomask = 7,
  334. .muxsel = MUXSEL(2, 3, 1, 1),
  335. .gpiomux = { 4, 0, 2, 3 },
  336. .gpiomute = 1,
  337. .no_msp34xx = 1,
  338. .needs_tvaudio = 1,
  339. .tuner_type = TUNER_PHILIPS_NTSC,
  340. .tuner_addr = ADDR_UNSET,
  341. .pll = PLL_28,
  342. .has_radio = 1,
  343. },
  344. /* ---- card 0x04 ---------------------------------- */
  345. [BTTV_BOARD_INTEL] = {
  346. .name = "Intel Create and Share PCI/ Smart Video Recorder III",
  347. .video_inputs = 4,
  348. /* .audio_inputs= 0, */
  349. .svhs = 2,
  350. .gpiomask = 0,
  351. .muxsel = MUXSEL(2, 3, 1, 1),
  352. .gpiomux = { 0 },
  353. .needs_tvaudio = 0,
  354. .tuner_type = TUNER_ABSENT,
  355. .tuner_addr = ADDR_UNSET,
  356. },
  357. [BTTV_BOARD_DIAMOND] = {
  358. .name = "Diamond DTV2000",
  359. .video_inputs = 4,
  360. /* .audio_inputs= 1, */
  361. .svhs = 2,
  362. .gpiomask = 3,
  363. .muxsel = MUXSEL(2, 3, 1, 0),
  364. .gpiomux = { 0, 1, 0, 1 },
  365. .gpiomute = 3,
  366. .needs_tvaudio = 1,
  367. .tuner_type = UNSET,
  368. .tuner_addr = ADDR_UNSET,
  369. },
  370. [BTTV_BOARD_AVERMEDIA] = {
  371. .name = "AVerMedia TVPhone",
  372. .video_inputs = 3,
  373. /* .audio_inputs= 1, */
  374. .svhs = 3,
  375. .muxsel = MUXSEL(2, 3, 1, 1),
  376. .gpiomask = 0x0f,
  377. .gpiomux = { 0x0c, 0x04, 0x08, 0x04 },
  378. /* 0x04 for some cards ?? */
  379. .needs_tvaudio = 1,
  380. .tuner_type = UNSET,
  381. .tuner_addr = ADDR_UNSET,
  382. .audio_mode_gpio= avermedia_tvphone_audio,
  383. .has_remote = 1,
  384. },
  385. [BTTV_BOARD_MATRIX_VISION] = {
  386. .name = "MATRIX-Vision MV-Delta",
  387. .video_inputs = 5,
  388. /* .audio_inputs= 1, */
  389. .svhs = 3,
  390. .gpiomask = 0,
  391. .muxsel = MUXSEL(2, 3, 1, 0, 0),
  392. .gpiomux = { 0 },
  393. .needs_tvaudio = 1,
  394. .tuner_type = TUNER_ABSENT,
  395. .tuner_addr = ADDR_UNSET,
  396. },
  397. /* ---- card 0x08 ---------------------------------- */
  398. [BTTV_BOARD_FLYVIDEO] = {
  399. .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
  400. .video_inputs = 4,
  401. /* .audio_inputs= 1, */
  402. .svhs = 2,
  403. .gpiomask = 0xc00,
  404. .muxsel = MUXSEL(2, 3, 1, 1),
  405. .gpiomux = { 0, 0xc00, 0x800, 0x400 },
  406. .gpiomute = 0xc00,
  407. .needs_tvaudio = 1,
  408. .pll = PLL_28,
  409. .tuner_type = UNSET,
  410. .tuner_addr = ADDR_UNSET,
  411. },
  412. [BTTV_BOARD_TURBOTV] = {
  413. .name = "IMS/IXmicro TurboTV",
  414. .video_inputs = 3,
  415. /* .audio_inputs= 1, */
  416. .svhs = 2,
  417. .gpiomask = 3,
  418. .muxsel = MUXSEL(2, 3, 1, 1),
  419. .gpiomux = { 1, 1, 2, 3 },
  420. .needs_tvaudio = 0,
  421. .pll = PLL_28,
  422. .tuner_type = TUNER_TEMIC_PAL,
  423. .tuner_addr = ADDR_UNSET,
  424. },
  425. [BTTV_BOARD_HAUPPAUGE878] = {
  426. .name = "Hauppauge (bt878)",
  427. .video_inputs = 4,
  428. /* .audio_inputs= 1, */
  429. .svhs = 2,
  430. .gpiomask = 0x0f, /* old: 7 */
  431. .muxsel = MUXSEL(2, 0, 1, 1),
  432. .gpiomux = { 0, 1, 2, 3 },
  433. .gpiomute = 4,
  434. .needs_tvaudio = 1,
  435. .pll = PLL_28,
  436. .tuner_type = UNSET,
  437. .tuner_addr = ADDR_UNSET,
  438. },
  439. [BTTV_BOARD_MIROPRO] = {
  440. .name = "MIRO PCTV pro",
  441. .video_inputs = 3,
  442. /* .audio_inputs= 1, */
  443. .svhs = 2,
  444. .gpiomask = 0x3014f,
  445. .muxsel = MUXSEL(2, 3, 1, 1),
  446. .gpiomux = { 0x20001,0x10001, 0, 0 },
  447. .gpiomute = 10,
  448. .needs_tvaudio = 1,
  449. .tuner_type = UNSET,
  450. .tuner_addr = ADDR_UNSET,
  451. },
  452. /* ---- card 0x0c ---------------------------------- */
  453. [BTTV_BOARD_ADSTECH_TV] = {
  454. .name = "ADS Technologies Channel Surfer TV (bt848)",
  455. .video_inputs = 3,
  456. /* .audio_inputs= 1, */
  457. .svhs = 2,
  458. .gpiomask = 15,
  459. .muxsel = MUXSEL(2, 3, 1, 1),
  460. .gpiomux = { 13, 14, 11, 7 },
  461. .needs_tvaudio = 1,
  462. .tuner_type = UNSET,
  463. .tuner_addr = ADDR_UNSET,
  464. },
  465. [BTTV_BOARD_AVERMEDIA98] = {
  466. .name = "AVerMedia TVCapture 98",
  467. .video_inputs = 3,
  468. /* .audio_inputs= 4, */
  469. .svhs = 2,
  470. .gpiomask = 15,
  471. .muxsel = MUXSEL(2, 3, 1, 1),
  472. .gpiomux = { 13, 14, 11, 7 },
  473. .needs_tvaudio = 1,
  474. .msp34xx_alt = 1,
  475. .pll = PLL_28,
  476. .tuner_type = TUNER_PHILIPS_PAL,
  477. .tuner_addr = ADDR_UNSET,
  478. .audio_mode_gpio= avermedia_tv_stereo_audio,
  479. .no_gpioirq = 1,
  480. },
  481. [BTTV_BOARD_VHX] = {
  482. .name = "Aimslab Video Highway Xtreme (VHX)",
  483. .video_inputs = 3,
  484. /* .audio_inputs= 1, */
  485. .svhs = 2,
  486. .gpiomask = 7,
  487. .muxsel = MUXSEL(2, 3, 1, 1),
  488. .gpiomux = { 0, 2, 1, 3 }, /* old: {0, 1, 2, 3, 4} */
  489. .gpiomute = 4,
  490. .needs_tvaudio = 1,
  491. .pll = PLL_28,
  492. .tuner_type = UNSET,
  493. .tuner_addr = ADDR_UNSET,
  494. },
  495. [BTTV_BOARD_ZOLTRIX] = {
  496. .name = "Zoltrix TV-Max",
  497. .video_inputs = 3,
  498. /* .audio_inputs= 1, */
  499. .svhs = 2,
  500. .gpiomask = 15,
  501. .muxsel = MUXSEL(2, 3, 1, 1),
  502. .gpiomux = { 0, 0, 1, 0 },
  503. .gpiomute = 10,
  504. .needs_tvaudio = 1,
  505. .tuner_type = UNSET,
  506. .tuner_addr = ADDR_UNSET,
  507. },
  508. /* ---- card 0x10 ---------------------------------- */
  509. [BTTV_BOARD_PIXVIEWPLAYTV] = {
  510. .name = "Prolink Pixelview PlayTV (bt878)",
  511. .video_inputs = 3,
  512. /* .audio_inputs= 1, */
  513. .svhs = 2,
  514. .gpiomask = 0x01fe00,
  515. .muxsel = MUXSEL(2, 3, 1, 1),
  516. /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
  517. .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
  518. .gpiomute = 0x002000,
  519. .needs_tvaudio = 1,
  520. .pll = PLL_28,
  521. .tuner_type = UNSET,
  522. .tuner_addr = ADDR_UNSET,
  523. },
  524. [BTTV_BOARD_WINVIEW_601] = {
  525. .name = "Leadtek WinView 601",
  526. .video_inputs = 3,
  527. /* .audio_inputs= 1, */
  528. .svhs = 2,
  529. .gpiomask = 0x8300f8,
  530. .muxsel = MUXSEL(2, 3, 1, 1, 0),
  531. .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 },
  532. .gpiomute = 0xcfa007,
  533. .needs_tvaudio = 1,
  534. .tuner_type = UNSET,
  535. .tuner_addr = ADDR_UNSET,
  536. .volume_gpio = winview_volume,
  537. .has_radio = 1,
  538. },
  539. [BTTV_BOARD_AVEC_INTERCAP] = {
  540. .name = "AVEC Intercapture",
  541. .video_inputs = 3,
  542. /* .audio_inputs= 2, */
  543. .svhs = 2,
  544. .gpiomask = 0,
  545. .muxsel = MUXSEL(2, 3, 1, 1),
  546. .gpiomux = { 1, 0, 0, 0 },
  547. .needs_tvaudio = 1,
  548. .tuner_type = UNSET,
  549. .tuner_addr = ADDR_UNSET,
  550. },
  551. [BTTV_BOARD_LIFE_FLYKIT] = {
  552. .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
  553. .video_inputs = 4,
  554. /* .audio_inputs= 1, */
  555. .svhs = NO_SVHS,
  556. .gpiomask = 0x8dff00,
  557. .muxsel = MUXSEL(2, 3, 1, 1),
  558. .gpiomux = { 0 },
  559. .no_msp34xx = 1,
  560. .tuner_type = TUNER_ABSENT,
  561. .tuner_addr = ADDR_UNSET,
  562. },
  563. /* ---- card 0x14 ---------------------------------- */
  564. [BTTV_BOARD_CEI_RAFFLES] = {
  565. .name = "CEI Raffles Card",
  566. .video_inputs = 3,
  567. /* .audio_inputs= 3, */
  568. .svhs = 2,
  569. .muxsel = MUXSEL(2, 3, 1, 1),
  570. .tuner_type = UNSET,
  571. .tuner_addr = ADDR_UNSET,
  572. },
  573. [BTTV_BOARD_CONFERENCETV] = {
  574. .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
  575. .video_inputs = 4,
  576. /* .audio_inputs= 2, tuner, line in */
  577. .svhs = 2,
  578. .gpiomask = 0x1800,
  579. .muxsel = MUXSEL(2, 3, 1, 1),
  580. .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
  581. .gpiomute = 0x1800,
  582. .pll = PLL_28,
  583. .tuner_type = TUNER_PHILIPS_PAL_I,
  584. .tuner_addr = ADDR_UNSET,
  585. },
  586. [BTTV_BOARD_PHOEBE_TVMAS] = {
  587. .name = "Askey CPH050/ Phoebe Tv Master + FM",
  588. .video_inputs = 3,
  589. /* .audio_inputs= 1, */
  590. .svhs = 2,
  591. .gpiomask = 0xc00,
  592. .muxsel = MUXSEL(2, 3, 1, 1),
  593. .gpiomux = { 0, 1, 0x800, 0x400 },
  594. .gpiomute = 0xc00,
  595. .needs_tvaudio = 1,
  596. .pll = PLL_28,
  597. .tuner_type = UNSET,
  598. .tuner_addr = ADDR_UNSET,
  599. },
  600. [BTTV_BOARD_MODTEC_205] = {
  601. .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
  602. .video_inputs = 3,
  603. /* .audio_inputs= 1, */
  604. .svhs = NO_SVHS,
  605. .has_dig_in = 1,
  606. .gpiomask = 7,
  607. .muxsel = MUXSEL(2, 3, 0), /* input 2 is digital */
  608. /* .digital_mode= DIGITAL_MODE_CAMERA, */
  609. .gpiomux = { 0, 0, 0, 0 },
  610. .no_msp34xx = 1,
  611. .pll = PLL_28,
  612. .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
  613. .tuner_addr = ADDR_UNSET,
  614. },
  615. /* ---- card 0x18 ---------------------------------- */
  616. [BTTV_BOARD_MAGICTVIEW061] = {
  617. .name = "Askey CPH05X/06X (bt878) [many vendors]",
  618. .video_inputs = 3,
  619. /* .audio_inputs= 1, */
  620. .svhs = 2,
  621. .gpiomask = 0xe00,
  622. .muxsel = MUXSEL(2, 3, 1, 1),
  623. .gpiomux = {0x400, 0x400, 0x400, 0x400 },
  624. .gpiomute = 0xc00,
  625. .needs_tvaudio = 1,
  626. .pll = PLL_28,
  627. .tuner_type = UNSET,
  628. .tuner_addr = ADDR_UNSET,
  629. .has_remote = 1,
  630. },
  631. [BTTV_BOARD_VOBIS_BOOSTAR] = {
  632. .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
  633. .video_inputs = 3,
  634. /* .audio_inputs= 1, */
  635. .svhs = 2,
  636. .gpiomask = 0x1f0fff,
  637. .muxsel = MUXSEL(2, 3, 1, 1),
  638. .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
  639. .gpiomute = 0x40000,
  640. .needs_tvaudio = 0,
  641. .tuner_type = TUNER_PHILIPS_PAL,
  642. .tuner_addr = ADDR_UNSET,
  643. .audio_mode_gpio= terratv_audio,
  644. },
  645. [BTTV_BOARD_HAUPPAUG_WCAM] = {
  646. .name = "Hauppauge WinCam newer (bt878)",
  647. .video_inputs = 4,
  648. /* .audio_inputs= 1, */
  649. .svhs = 3,
  650. .gpiomask = 7,
  651. .muxsel = MUXSEL(2, 0, 1, 1),
  652. .gpiomux = { 0, 1, 2, 3 },
  653. .gpiomute = 4,
  654. .needs_tvaudio = 1,
  655. .tuner_type = UNSET,
  656. .tuner_addr = ADDR_UNSET,
  657. },
  658. [BTTV_BOARD_MAXI] = {
  659. .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
  660. .video_inputs = 4,
  661. /* .audio_inputs= 2, */
  662. .svhs = 2,
  663. .gpiomask = 0x1800,
  664. .muxsel = MUXSEL(2, 3, 1, 1),
  665. .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
  666. .gpiomute = 0x1800,
  667. .pll = PLL_28,
  668. .tuner_type = TUNER_PHILIPS_SECAM,
  669. .tuner_addr = ADDR_UNSET,
  670. },
  671. /* ---- card 0x1c ---------------------------------- */
  672. [BTTV_BOARD_TERRATV] = {
  673. .name = "Terratec TerraTV+ Version 1.1 (bt878)",
  674. .video_inputs = 3,
  675. /* .audio_inputs= 1, */
  676. .svhs = 2,
  677. .gpiomask = 0x1f0fff,
  678. .muxsel = MUXSEL(2, 3, 1, 1),
  679. .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 },
  680. .gpiomute = 0x40000,
  681. .needs_tvaudio = 0,
  682. .tuner_type = TUNER_PHILIPS_PAL,
  683. .tuner_addr = ADDR_UNSET,
  684. .audio_mode_gpio= terratv_audio,
  685. /* GPIO wiring:
  686. External 20 pin connector (for Active Radio Upgrade board)
  687. gpio00: i2c-sda
  688. gpio01: i2c-scl
  689. gpio02: om5610-data
  690. gpio03: om5610-clk
  691. gpio04: om5610-wre
  692. gpio05: om5610-stereo
  693. gpio06: rds6588-davn
  694. gpio07: Pin 7 n.c.
  695. gpio08: nIOW
  696. gpio09+10: nIOR, nSEL ?? (bt878)
  697. gpio09: nIOR (bt848)
  698. gpio10: nSEL (bt848)
  699. Sound Routing:
  700. gpio16: u2-A0 (1st 4052bt)
  701. gpio17: u2-A1
  702. gpio18: u2-nEN
  703. gpio19: u4-A0 (2nd 4052)
  704. gpio20: u4-A1
  705. u4-nEN - GND
  706. Btspy:
  707. 00000 : Cdrom (internal audio input)
  708. 10000 : ext. Video audio input
  709. 20000 : TV Mono
  710. a0000 : TV Mono/2
  711. 1a0000 : TV Stereo
  712. 30000 : Radio
  713. 40000 : Mute
  714. */
  715. },
  716. [BTTV_BOARD_PXC200] = {
  717. /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
  718. .name = "Imagenation PXC200",
  719. .video_inputs = 5,
  720. /* .audio_inputs= 1, */
  721. .svhs = 1, /* was: 4 */
  722. .gpiomask = 0,
  723. .muxsel = MUXSEL(2, 3, 1, 0, 0),
  724. .gpiomux = { 0 },
  725. .needs_tvaudio = 1,
  726. .tuner_type = TUNER_ABSENT,
  727. .tuner_addr = ADDR_UNSET,
  728. .muxsel_hook = PXC200_muxsel,
  729. },
  730. [BTTV_BOARD_FLYVIDEO_98] = {
  731. .name = "Lifeview FlyVideo 98 LR50",
  732. .video_inputs = 4,
  733. /* .audio_inputs= 1, */
  734. .svhs = 2,
  735. .gpiomask = 0x1800, /* 0x8dfe00 */
  736. .muxsel = MUXSEL(2, 3, 1, 1),
  737. .gpiomux = { 0, 0x0800, 0x1000, 0x1000 },
  738. .gpiomute = 0x1800,
  739. .pll = PLL_28,
  740. .tuner_type = UNSET,
  741. .tuner_addr = ADDR_UNSET,
  742. },
  743. [BTTV_BOARD_IPROTV] = {
  744. .name = "Formac iProTV, Formac ProTV I (bt848)",
  745. .video_inputs = 4,
  746. /* .audio_inputs= 1, */
  747. .svhs = 3,
  748. .gpiomask = 1,
  749. .muxsel = MUXSEL(2, 3, 1, 1),
  750. .gpiomux = { 1, 0, 0, 0 },
  751. .pll = PLL_28,
  752. .tuner_type = TUNER_PHILIPS_PAL,
  753. .tuner_addr = ADDR_UNSET,
  754. },
  755. /* ---- card 0x20 ---------------------------------- */
  756. [BTTV_BOARD_INTEL_C_S_PCI] = {
  757. .name = "Intel Create and Share PCI/ Smart Video Recorder III",
  758. .video_inputs = 4,
  759. /* .audio_inputs= 0, */
  760. .svhs = 2,
  761. .gpiomask = 0,
  762. .muxsel = MUXSEL(2, 3, 1, 1),
  763. .gpiomux = { 0 },
  764. .needs_tvaudio = 0,
  765. .tuner_type = TUNER_ABSENT,
  766. .tuner_addr = ADDR_UNSET,
  767. },
  768. [BTTV_BOARD_TERRATVALUE] = {
  769. .name = "Terratec TerraTValue Version Bt878",
  770. .video_inputs = 3,
  771. /* .audio_inputs= 1, */
  772. .svhs = 2,
  773. .gpiomask = 0xffff00,
  774. .muxsel = MUXSEL(2, 3, 1, 1),
  775. .gpiomux = { 0x500, 0, 0x300, 0x900 },
  776. .gpiomute = 0x900,
  777. .needs_tvaudio = 1,
  778. .pll = PLL_28,
  779. .tuner_type = TUNER_PHILIPS_PAL,
  780. .tuner_addr = ADDR_UNSET,
  781. },
  782. [BTTV_BOARD_WINFAST2000] = {
  783. .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
  784. .video_inputs = 4,
  785. /* .audio_inputs= 1, */
  786. .svhs = 2,
  787. /* TV, CVid, SVid, CVid over SVid connector */
  788. .muxsel = MUXSEL(2, 3, 1, 1, 0),
  789. /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
  790. .gpiomask = 0xb33000,
  791. .gpiomux = { 0x122000,0x1000,0x0000,0x620000 },
  792. .gpiomute = 0x800000,
  793. /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
  794. gpio23 -- hef4052:nEnable (0x800000)
  795. gpio12 -- hef4052:A1
  796. gpio13 -- hef4052:A0
  797. 0x0000: external audio
  798. 0x1000: FM
  799. 0x2000: TV
  800. 0x3000: n.c.
  801. Note: There exists another variant "Winfast 2000" with tv stereo !?
  802. Note: eeprom only contains FF and pci subsystem id 107d:6606
  803. */
  804. .needs_tvaudio = 0,
  805. .pll = PLL_28,
  806. .has_radio = 1,
  807. .tuner_type = TUNER_PHILIPS_PAL, /* default for now, gpio reads BFFF06 for Pal bg+dk */
  808. .tuner_addr = ADDR_UNSET,
  809. .audio_mode_gpio= winfast2000_audio,
  810. .has_remote = 1,
  811. },
  812. [BTTV_BOARD_CHRONOS_VS2] = {
  813. .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
  814. .video_inputs = 4,
  815. /* .audio_inputs= 3, */
  816. .svhs = 2,
  817. .gpiomask = 0x1800,
  818. .muxsel = MUXSEL(2, 3, 1, 1),
  819. .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
  820. .gpiomute = 0x1800,
  821. .pll = PLL_28,
  822. .tuner_type = UNSET,
  823. .tuner_addr = ADDR_UNSET,
  824. },
  825. /* ---- card 0x24 ---------------------------------- */
  826. [BTTV_BOARD_TYPHOON_TVIEW] = {
  827. .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
  828. .video_inputs = 4,
  829. /* .audio_inputs= 3, */
  830. .svhs = 2,
  831. .gpiomask = 0x1800,
  832. .muxsel = MUXSEL(2, 3, 1, 1),
  833. .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
  834. .gpiomute = 0x1800,
  835. .pll = PLL_28,
  836. .tuner_type = UNSET,
  837. .tuner_addr = ADDR_UNSET,
  838. .has_radio = 1,
  839. },
  840. [BTTV_BOARD_PXELVWPLTVPRO] = {
  841. .name = "Prolink PixelView PlayTV pro",
  842. .video_inputs = 3,
  843. /* .audio_inputs= 1, */
  844. .svhs = 2,
  845. .gpiomask = 0xff,
  846. .muxsel = MUXSEL(2, 3, 1, 1),
  847. .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
  848. .gpiomute = 0x29,
  849. .no_msp34xx = 1,
  850. .pll = PLL_28,
  851. .tuner_type = UNSET,
  852. .tuner_addr = ADDR_UNSET,
  853. },
  854. [BTTV_BOARD_MAGICTVIEW063] = {
  855. .name = "Askey CPH06X TView99",
  856. .video_inputs = 4,
  857. /* .audio_inputs= 1, */
  858. .svhs = 2,
  859. .gpiomask = 0x551e00,
  860. .muxsel = MUXSEL(2, 3, 1, 0),
  861. .gpiomux = { 0x551400, 0x551200, 0, 0 },
  862. .gpiomute = 0x551c00,
  863. .needs_tvaudio = 1,
  864. .pll = PLL_28,
  865. .tuner_type = TUNER_PHILIPS_PAL_I,
  866. .tuner_addr = ADDR_UNSET,
  867. .has_remote = 1,
  868. },
  869. [BTTV_BOARD_PINNACLE] = {
  870. .name = "Pinnacle PCTV Studio/Rave",
  871. .video_inputs = 3,
  872. /* .audio_inputs= 1, */
  873. .svhs = 2,
  874. .gpiomask = 0x03000F,
  875. .muxsel = MUXSEL(2, 3, 1, 1),
  876. .gpiomux = { 2, 0xd0001, 0, 0 },
  877. .gpiomute = 1,
  878. .needs_tvaudio = 0,
  879. .pll = PLL_28,
  880. .tuner_type = UNSET,
  881. .tuner_addr = ADDR_UNSET,
  882. },
  883. /* ---- card 0x28 ---------------------------------- */
  884. [BTTV_BOARD_STB2] = {
  885. .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
  886. .video_inputs = 3,
  887. /* .audio_inputs= 1, */
  888. .svhs = 2,
  889. .gpiomask = 7,
  890. .muxsel = MUXSEL(2, 3, 1, 1),
  891. .gpiomux = { 4, 0, 2, 3 },
  892. .gpiomute = 1,
  893. .no_msp34xx = 1,
  894. .needs_tvaudio = 1,
  895. .tuner_type = TUNER_PHILIPS_NTSC,
  896. .tuner_addr = ADDR_UNSET,
  897. .pll = PLL_28,
  898. .has_radio = 1,
  899. },
  900. [BTTV_BOARD_AVPHONE98] = {
  901. .name = "AVerMedia TVPhone 98",
  902. .video_inputs = 3,
  903. /* .audio_inputs= 4, */
  904. .svhs = 2,
  905. .gpiomask = 15,
  906. .muxsel = MUXSEL(2, 3, 1, 1),
  907. .gpiomux = { 13, 4, 11, 7 },
  908. .needs_tvaudio = 1,
  909. .pll = PLL_28,
  910. .tuner_type = UNSET,
  911. .tuner_addr = ADDR_UNSET,
  912. .has_radio = 1,
  913. .audio_mode_gpio= avermedia_tvphone_audio,
  914. },
  915. [BTTV_BOARD_PV951] = {
  916. .name = "ProVideo PV951", /* pic16c54 */
  917. .video_inputs = 3,
  918. /* .audio_inputs= 1, */
  919. .svhs = 2,
  920. .gpiomask = 0,
  921. .muxsel = MUXSEL(2, 3, 1, 1),
  922. .gpiomux = { 0, 0, 0, 0},
  923. .needs_tvaudio = 1,
  924. .no_msp34xx = 1,
  925. .pll = PLL_28,
  926. .tuner_type = TUNER_PHILIPS_PAL_I,
  927. .tuner_addr = ADDR_UNSET,
  928. },
  929. [BTTV_BOARD_ONAIR_TV] = {
  930. .name = "Little OnAir TV",
  931. .video_inputs = 3,
  932. /* .audio_inputs= 1, */
  933. .svhs = 2,
  934. .gpiomask = 0xe00b,
  935. .muxsel = MUXSEL(2, 3, 1, 1),
  936. .gpiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0 },
  937. .gpiomute = 0xff3ffc,
  938. .no_msp34xx = 1,
  939. .tuner_type = UNSET,
  940. .tuner_addr = ADDR_UNSET,
  941. },
  942. /* ---- card 0x2c ---------------------------------- */
  943. [BTTV_BOARD_SIGMA_TVII_FM] = {
  944. .name = "Sigma TVII-FM",
  945. .video_inputs = 2,
  946. /* .audio_inputs= 1, */
  947. .svhs = NO_SVHS,
  948. .gpiomask = 3,
  949. .muxsel = MUXSEL(2, 3, 1, 1),
  950. .gpiomux = { 1, 1, 0, 2 },
  951. .gpiomute = 3,
  952. .no_msp34xx = 1,
  953. .pll = PLL_NONE,
  954. .tuner_type = UNSET,
  955. .tuner_addr = ADDR_UNSET,
  956. },
  957. [BTTV_BOARD_MATRIX_VISION2] = {
  958. .name = "MATRIX-Vision MV-Delta 2",
  959. .video_inputs = 5,
  960. /* .audio_inputs= 1, */
  961. .svhs = 3,
  962. .gpiomask = 0,
  963. .muxsel = MUXSEL(2, 3, 1, 0, 0),
  964. .gpiomux = { 0 },
  965. .no_msp34xx = 1,
  966. .pll = PLL_28,
  967. .tuner_type = TUNER_ABSENT,
  968. .tuner_addr = ADDR_UNSET,
  969. },
  970. [BTTV_BOARD_ZOLTRIX_GENIE] = {
  971. .name = "Zoltrix Genie TV/FM",
  972. .video_inputs = 3,
  973. /* .audio_inputs= 1, */
  974. .svhs = 2,
  975. .gpiomask = 0xbcf03f,
  976. .muxsel = MUXSEL(2, 3, 1, 1),
  977. .gpiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0 },
  978. .gpiomute = 0xbcb03f,
  979. .no_msp34xx = 1,
  980. .pll = PLL_28,
  981. .tuner_type = TUNER_TEMIC_4039FR5_NTSC,
  982. .tuner_addr = ADDR_UNSET,
  983. },
  984. [BTTV_BOARD_TERRATVRADIO] = {
  985. .name = "Terratec TV/Radio+",
  986. .video_inputs = 3,
  987. /* .audio_inputs= 1, */
  988. .svhs = 2,
  989. .gpiomask = 0x70000,
  990. .muxsel = MUXSEL(2, 3, 1, 1),
  991. .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
  992. .gpiomute = 0x40000,
  993. .needs_tvaudio = 1,
  994. .no_msp34xx = 1,
  995. .pll = PLL_35,
  996. .tuner_type = TUNER_PHILIPS_PAL_I,
  997. .tuner_addr = ADDR_UNSET,
  998. .has_radio = 1,
  999. },
  1000. /* ---- card 0x30 ---------------------------------- */
  1001. [BTTV_BOARD_DYNALINK] = {
  1002. .name = "Askey CPH03x/ Dynalink Magic TView",
  1003. .video_inputs = 3,
  1004. /* .audio_inputs= 1, */
  1005. .svhs = 2,
  1006. .gpiomask = 15,
  1007. .muxsel = MUXSEL(2, 3, 1, 1),
  1008. .gpiomux = {2,0,0,0 },
  1009. .gpiomute = 1,
  1010. .needs_tvaudio = 1,
  1011. .pll = PLL_28,
  1012. .tuner_type = UNSET,
  1013. .tuner_addr = ADDR_UNSET,
  1014. },
  1015. [BTTV_BOARD_GVBCTV3PCI] = {
  1016. .name = "IODATA GV-BCTV3/PCI",
  1017. .video_inputs = 3,
  1018. /* .audio_inputs= 1, */
  1019. .svhs = 2,
  1020. .gpiomask = 0x010f00,
  1021. .muxsel = MUXSEL(2, 3, 0, 0),
  1022. .gpiomux = {0x10000, 0, 0x10000, 0 },
  1023. .no_msp34xx = 1,
  1024. .pll = PLL_28,
  1025. .tuner_type = TUNER_ALPS_TSHC6_NTSC,
  1026. .tuner_addr = ADDR_UNSET,
  1027. .audio_mode_gpio= gvbctv3pci_audio,
  1028. },
  1029. [BTTV_BOARD_PXELVWPLTVPAK] = {
  1030. .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
  1031. .video_inputs = 5,
  1032. /* .audio_inputs= 1, */
  1033. .svhs = 3,
  1034. .has_dig_in = 1,
  1035. .gpiomask = 0xAA0000,
  1036. .muxsel = MUXSEL(2, 3, 1, 1, 0), /* in 4 is digital */
  1037. /* .digital_mode= DIGITAL_MODE_CAMERA, */
  1038. .gpiomux = { 0x20000, 0, 0x80000, 0x80000 },
  1039. .gpiomute = 0xa8000,
  1040. .no_msp34xx = 1,
  1041. .pll = PLL_28,
  1042. .tuner_type = TUNER_PHILIPS_PAL_I,
  1043. .tuner_addr = ADDR_UNSET,
  1044. .has_remote = 1,
  1045. /* GPIO wiring: (different from Rev.4C !)
  1046. GPIO17: U4.A0 (first hef4052bt)
  1047. GPIO19: U4.A1
  1048. GPIO20: U5.A1 (second hef4052bt)
  1049. GPIO21: U4.nEN
  1050. GPIO22: BT832 Reset Line
  1051. GPIO23: A5,A0, U5,nEN
  1052. Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
  1053. */
  1054. },
  1055. [BTTV_BOARD_EAGLE] = {
  1056. .name = "Eagle Wireless Capricorn2 (bt878A)",
  1057. .video_inputs = 4,
  1058. /* .audio_inputs= 1, */
  1059. .svhs = 2,
  1060. .gpiomask = 7,
  1061. .muxsel = MUXSEL(2, 0, 1, 1),
  1062. .gpiomux = { 0, 1, 2, 3 },
  1063. .gpiomute = 4,
  1064. .pll = PLL_28,
  1065. .tuner_type = UNSET /* TUNER_ALPS_TMDH2_NTSC */,
  1066. .tuner_addr = ADDR_UNSET,
  1067. },
  1068. /* ---- card 0x34 ---------------------------------- */
  1069. [BTTV_BOARD_PINNACLEPRO] = {
  1070. /* David Härdeman <david@2gen.com> */
  1071. .name = "Pinnacle PCTV Studio Pro",
  1072. .video_inputs = 4,
  1073. /* .audio_inputs= 1, */
  1074. .svhs = 3,
  1075. .gpiomask = 0x03000F,
  1076. .muxsel = MUXSEL(2, 3, 1, 1),
  1077. .gpiomux = { 1, 0xd0001, 0, 0 },
  1078. .gpiomute = 10,
  1079. /* sound path (5 sources):
  1080. MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
  1081. 0= ext. Audio IN
  1082. 1= from MUX2
  1083. 2= Mono TV sound from Tuner
  1084. 3= not connected
  1085. MUX2 (mask 0x30000):
  1086. 0,2,3= from MSP34xx
  1087. 1= FM stereo Radio from Tuner */
  1088. .needs_tvaudio = 0,
  1089. .pll = PLL_28,
  1090. .tuner_type = UNSET,
  1091. .tuner_addr = ADDR_UNSET,
  1092. },
  1093. [BTTV_BOARD_TVIEW_RDS_FM] = {
  1094. /* Claas Langbehn <claas@bigfoot.com>,
  1095. Sven Grothklags <sven@upb.de> */
  1096. .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
  1097. .video_inputs = 4,
  1098. /* .audio_inputs= 3, */
  1099. .svhs = 2,
  1100. .gpiomask = 0x1c,
  1101. .muxsel = MUXSEL(2, 3, 1, 1),
  1102. .gpiomux = { 0, 0, 0x10, 8 },
  1103. .gpiomute = 4,
  1104. .needs_tvaudio = 1,
  1105. .pll = PLL_28,
  1106. .tuner_type = TUNER_PHILIPS_PAL,
  1107. .tuner_addr = ADDR_UNSET,
  1108. .has_radio = 1,
  1109. },
  1110. [BTTV_BOARD_LIFETEC_9415] = {
  1111. /* Tim Röstermundt <rosterm@uni-muenster.de>
  1112. in de.comp.os.unix.linux.hardware:
  1113. options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
  1114. gpiomux =0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
  1115. options tuner type=5 */
  1116. .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
  1117. .video_inputs = 4,
  1118. /* .audio_inputs= 1, */
  1119. .svhs = 2,
  1120. .gpiomask = 0x18e0,
  1121. .muxsel = MUXSEL(2, 3, 1, 1),
  1122. .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
  1123. .gpiomute = 0x18e0,
  1124. /* For cards with tda9820/tda9821:
  1125. 0x0000: Tuner normal stereo
  1126. 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
  1127. 0x0880: Tuner A2 stereo */
  1128. .pll = PLL_28,
  1129. .tuner_type = UNSET,
  1130. .tuner_addr = ADDR_UNSET,
  1131. },
  1132. [BTTV_BOARD_BESTBUY_EASYTV] = {
  1133. /* Miguel Angel Alvarez <maacruz@navegalia.com>
  1134. old Easy TV BT848 version (model CPH031) */
  1135. .name = "Askey CPH031/ BESTBUY Easy TV",
  1136. .video_inputs = 4,
  1137. /* .audio_inputs= 1, */
  1138. .svhs = 2,
  1139. .gpiomask = 0xF,
  1140. .muxsel = MUXSEL(2, 3, 1, 0),
  1141. .gpiomux = { 2, 0, 0, 0 },
  1142. .gpiomute = 10,
  1143. .needs_tvaudio = 0,
  1144. .pll = PLL_28,
  1145. .tuner_type = TUNER_TEMIC_PAL,
  1146. .tuner_addr = ADDR_UNSET,
  1147. },
  1148. /* ---- card 0x38 ---------------------------------- */
  1149. [BTTV_BOARD_FLYVIDEO_98FM] = {
  1150. /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
  1151. .name = "Lifeview FlyVideo 98FM LR50",
  1152. .video_inputs = 4,
  1153. /* .audio_inputs= 3, */
  1154. .svhs = 2,
  1155. .gpiomask = 0x1800,
  1156. .muxsel = MUXSEL(2, 3, 1, 1),
  1157. .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
  1158. .gpiomute = 0x1800,
  1159. .pll = PLL_28,
  1160. .tuner_type = TUNER_PHILIPS_PAL,
  1161. .tuner_addr = ADDR_UNSET,
  1162. },
  1163. /* This is the ultimate cheapo capture card
  1164. * just a BT848A on a small PCB!
  1165. * Steve Hosgood <steve@equiinet.com> */
  1166. [BTTV_BOARD_GRANDTEC] = {
  1167. .name = "GrandTec 'Grand Video Capture' (Bt848)",
  1168. .video_inputs = 2,
  1169. /* .audio_inputs= 0, */
  1170. .svhs = 1,
  1171. .gpiomask = 0,
  1172. .muxsel = MUXSEL(3, 1),
  1173. .gpiomux = { 0 },
  1174. .needs_tvaudio = 0,
  1175. .no_msp34xx = 1,
  1176. .pll = PLL_35,
  1177. .tuner_type = TUNER_ABSENT,
  1178. .tuner_addr = ADDR_UNSET,
  1179. },
  1180. [BTTV_BOARD_ASKEY_CPH060] = {
  1181. /* Daniel Herrington <daniel.herrington@home.com> */
  1182. .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
  1183. .video_inputs = 3,
  1184. /* .audio_inputs= 1, */
  1185. .svhs = 2,
  1186. .gpiomask = 0xe00,
  1187. .muxsel = MUXSEL(2, 3, 1, 1),
  1188. .gpiomux = { 0x400, 0x400, 0x400, 0x400 },
  1189. .gpiomute = 0x800,
  1190. .needs_tvaudio = 1,
  1191. .pll = PLL_28,
  1192. .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
  1193. .tuner_addr = ADDR_UNSET,
  1194. },
  1195. [BTTV_BOARD_ASKEY_CPH03X] = {
  1196. /* Matti Mottus <mottus@physic.ut.ee> */
  1197. .name = "Askey CPH03x TV Capturer",
  1198. .video_inputs = 4,
  1199. /* .audio_inputs= 1, */
  1200. .svhs = 2,
  1201. .gpiomask = 0x03000F,
  1202. .muxsel = MUXSEL(2, 3, 1, 0),
  1203. .gpiomux = { 2, 0, 0, 0 },
  1204. .gpiomute = 1,
  1205. .pll = PLL_28,
  1206. .tuner_type = TUNER_TEMIC_PAL,
  1207. .tuner_addr = ADDR_UNSET,
  1208. .has_remote = 1,
  1209. },
  1210. /* ---- card 0x3c ---------------------------------- */
  1211. [BTTV_BOARD_MM100PCTV] = {
  1212. /* Philip Blundell <philb@gnu.org> */
  1213. .name = "Modular Technology MM100PCTV",
  1214. .video_inputs = 2,
  1215. /* .audio_inputs= 2, */
  1216. .svhs = NO_SVHS,
  1217. .gpiomask = 11,
  1218. .muxsel = MUXSEL(2, 3, 1, 1),
  1219. .gpiomux = { 2, 0, 0, 1 },
  1220. .gpiomute = 8,
  1221. .pll = PLL_35,
  1222. .tuner_type = TUNER_TEMIC_PAL,
  1223. .tuner_addr = ADDR_UNSET,
  1224. },
  1225. [BTTV_BOARD_GMV1] = {
  1226. /* Adrian Cox <adrian@humboldt.co.uk */
  1227. .name = "AG Electronics GMV1",
  1228. .video_inputs = 2,
  1229. /* .audio_inputs= 0, */
  1230. .svhs = 1,
  1231. .gpiomask = 0xF,
  1232. .muxsel = MUXSEL(2, 2),
  1233. .gpiomux = { },
  1234. .no_msp34xx = 1,
  1235. .needs_tvaudio = 0,
  1236. .pll = PLL_28,
  1237. .tuner_type = TUNER_ABSENT,
  1238. .tuner_addr = ADDR_UNSET,
  1239. },
  1240. [BTTV_BOARD_BESTBUY_EASYTV2] = {
  1241. /* Miguel Angel Alvarez <maacruz@navegalia.com>
  1242. new Easy TV BT878 version (model CPH061)
  1243. special thanks to Informatica Mieres for providing the card */
  1244. .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
  1245. .video_inputs = 3,
  1246. /* .audio_inputs= 2, */
  1247. .svhs = 2,
  1248. .gpiomask = 0xFF,
  1249. .muxsel = MUXSEL(2, 3, 1, 0),
  1250. .gpiomux = { 1, 0, 4, 4 },
  1251. .gpiomute = 9,
  1252. .needs_tvaudio = 0,
  1253. .pll = PLL_28,
  1254. .tuner_type = TUNER_PHILIPS_PAL,
  1255. .tuner_addr = ADDR_UNSET,
  1256. },
  1257. [BTTV_BOARD_ATI_TVWONDER] = {
  1258. /* Lukas Gebauer <geby@volny.cz> */
  1259. .name = "ATI TV-Wonder",
  1260. .video_inputs = 3,
  1261. /* .audio_inputs= 1, */
  1262. .svhs = 2,
  1263. .gpiomask = 0xf03f,
  1264. .muxsel = MUXSEL(2, 3, 1, 0),
  1265. .gpiomux = { 0xbffe, 0, 0xbfff, 0 },
  1266. .gpiomute = 0xbffe,
  1267. .pll = PLL_28,
  1268. .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
  1269. .tuner_addr = ADDR_UNSET,
  1270. },
  1271. /* ---- card 0x40 ---------------------------------- */
  1272. [BTTV_BOARD_ATI_TVWONDERVE] = {
  1273. /* Lukas Gebauer <geby@volny.cz> */
  1274. .name = "ATI TV-Wonder VE",
  1275. .video_inputs = 2,
  1276. /* .audio_inputs= 1, */
  1277. .svhs = NO_SVHS,
  1278. .gpiomask = 1,
  1279. .muxsel = MUXSEL(2, 3, 0, 1),
  1280. .gpiomux = { 0, 0, 1, 0 },
  1281. .no_msp34xx = 1,
  1282. .pll = PLL_28,
  1283. .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
  1284. .tuner_addr = ADDR_UNSET,
  1285. },
  1286. [BTTV_BOARD_FLYVIDEO2000] = {
  1287. /* DeeJay <deejay@westel900.net (2000S) */
  1288. .name = "Lifeview FlyVideo 2000S LR90",
  1289. .video_inputs = 3,
  1290. /* .audio_inputs= 3, */
  1291. .svhs = 2,
  1292. .gpiomask = 0x18e0,
  1293. .muxsel = MUXSEL(2, 3, 0, 1),
  1294. /* Radio changed from 1e80 to 0x800 to make
  1295. FlyVideo2000S in .hu happy (gm)*/
  1296. /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
  1297. .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
  1298. .gpiomute = 0x1800,
  1299. .audio_mode_gpio= fv2000s_audio,
  1300. .no_msp34xx = 1,
  1301. .needs_tvaudio = 1,
  1302. .pll = PLL_28,
  1303. .tuner_type = TUNER_PHILIPS_PAL,
  1304. .tuner_addr = ADDR_UNSET,
  1305. },
  1306. [BTTV_BOARD_TERRATVALUER] = {
  1307. .name = "Terratec TValueRadio",
  1308. .video_inputs = 3,
  1309. /* .audio_inputs= 1, */
  1310. .svhs = 2,
  1311. .gpiomask = 0xffff00,
  1312. .muxsel = MUXSEL(2, 3, 1, 1),
  1313. .gpiomux = { 0x500, 0x500, 0x300, 0x900 },
  1314. .gpiomute = 0x900,
  1315. .needs_tvaudio = 1,
  1316. .pll = PLL_28,
  1317. .tuner_type = TUNER_PHILIPS_PAL,
  1318. .tuner_addr = ADDR_UNSET,
  1319. .has_radio = 1,
  1320. },
  1321. [BTTV_BOARD_GVBCTV4PCI] = {
  1322. /* TANAKA Kei <peg00625@nifty.com> */
  1323. .name = "IODATA GV-BCTV4/PCI",
  1324. .video_inputs = 3,
  1325. /* .audio_inputs= 1, */
  1326. .svhs = 2,
  1327. .gpiomask = 0x010f00,
  1328. .muxsel = MUXSEL(2, 3, 0, 0),
  1329. .gpiomux = {0x10000, 0, 0x10000, 0 },
  1330. .no_msp34xx = 1,
  1331. .pll = PLL_28,
  1332. .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
  1333. .tuner_addr = ADDR_UNSET,
  1334. .audio_mode_gpio= gvbctv3pci_audio,
  1335. },
  1336. /* ---- card 0x44 ---------------------------------- */
  1337. [BTTV_BOARD_VOODOOTV_FM] = {
  1338. .name = "3Dfx VoodooTV FM (Euro)",
  1339. /* try "insmod msp3400 simple=0" if you have
  1340. * sound problems with this card. */
  1341. .video_inputs = 4,
  1342. /* .audio_inputs= 1, */
  1343. .svhs = NO_SVHS,
  1344. .gpiomask = 0x4f8a00,
  1345. /* 0x100000: 1=MSP enabled (0=disable again)
  1346. * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
  1347. .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
  1348. .gpiomute = 0x947fff,
  1349. /* tvtuner, radio, external,internal, mute, stereo
  1350. * tuner, Composit, SVid, Composit-on-Svid-adapter */
  1351. .muxsel = MUXSEL(2, 3, 0, 1),
  1352. .tuner_type = TUNER_MT2032,
  1353. .tuner_addr = ADDR_UNSET,
  1354. .pll = PLL_28,
  1355. .has_radio = 1,
  1356. },
  1357. [BTTV_BOARD_VOODOOTV_200] = {
  1358. .name = "VoodooTV 200 (USA)",
  1359. /* try "insmod msp3400 simple=0" if you have
  1360. * sound problems with this card. */
  1361. .video_inputs = 4,
  1362. /* .audio_inputs= 1, */
  1363. .svhs = NO_SVHS,
  1364. .gpiomask = 0x4f8a00,
  1365. /* 0x100000: 1=MSP enabled (0=disable again)
  1366. * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
  1367. .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
  1368. .gpiomute = 0x947fff,
  1369. /* tvtuner, radio, external,internal, mute, stereo
  1370. * tuner, Composit, SVid, Composit-on-Svid-adapter */
  1371. .muxsel = MUXSEL(2, 3, 0, 1),
  1372. .tuner_type = TUNER_MT2032,
  1373. .tuner_addr = ADDR_UNSET,
  1374. .pll = PLL_28,
  1375. .has_radio = 1,
  1376. },
  1377. [BTTV_BOARD_AIMMS] = {
  1378. /* Philip Blundell <pb@nexus.co.uk> */
  1379. .name = "Active Imaging AIMMS",
  1380. .video_inputs = 1,
  1381. /* .audio_inputs= 0, */
  1382. .tuner_type = TUNER_ABSENT,
  1383. .tuner_addr = ADDR_UNSET,
  1384. .pll = PLL_28,
  1385. .muxsel = MUXSEL(2),
  1386. .gpiomask = 0
  1387. },
  1388. [BTTV_BOARD_PV_BT878P_PLUS] = {
  1389. /* Tomasz Pyra <hellfire@sedez.iq.pl> */
  1390. .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
  1391. .video_inputs = 3,
  1392. /* .audio_inputs= 4, */
  1393. .svhs = 2,
  1394. .gpiomask = 15,
  1395. .muxsel = MUXSEL(2, 3, 1, 1),
  1396. .gpiomux = { 0, 0, 11, 7 }, /* TV and Radio with same GPIO ! */
  1397. .gpiomute = 13,
  1398. .needs_tvaudio = 1,
  1399. .pll = PLL_28,
  1400. .tuner_type = TUNER_LG_PAL_I_FM,
  1401. .tuner_addr = ADDR_UNSET,
  1402. .has_remote = 1,
  1403. /* GPIO wiring:
  1404. GPIO0: U4.A0 (hef4052bt)
  1405. GPIO1: U4.A1
  1406. GPIO2: U4.A1 (second hef4052bt)
  1407. GPIO3: U4.nEN, U5.A0, A5.nEN
  1408. GPIO8-15: vrd866b ?
  1409. */
  1410. },
  1411. [BTTV_BOARD_FLYVIDEO98EZ] = {
  1412. .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
  1413. .video_inputs = 4,
  1414. /* .audio_inputs= 0, */
  1415. .svhs = 2,
  1416. /* AV1, AV2, SVHS, CVid adapter on SVHS */
  1417. .muxsel = MUXSEL(2, 3, 1, 1),
  1418. .pll = PLL_28,
  1419. .no_msp34xx = 1,
  1420. .tuner_type = TUNER_ABSENT,
  1421. .tuner_addr = ADDR_UNSET,
  1422. },
  1423. /* ---- card 0x48 ---------------------------------- */
  1424. [BTTV_BOARD_PV_BT878P_9B] = {
  1425. /* Dariusz Kowalewski <darekk@automex.pl> */
  1426. .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
  1427. .video_inputs = 4,
  1428. /* .audio_inputs= 1, */
  1429. .svhs = 2,
  1430. .gpiomask = 0x3f,
  1431. .muxsel = MUXSEL(2, 3, 1, 1),
  1432. .gpiomux = { 0x01, 0x00, 0x03, 0x03 },
  1433. .gpiomute = 0x09,
  1434. .needs_tvaudio = 1,
  1435. .no_msp34xx = 1,
  1436. .pll = PLL_28,
  1437. .tuner_type = TUNER_PHILIPS_PAL,
  1438. .tuner_addr = ADDR_UNSET,
  1439. .audio_mode_gpio= pvbt878p9b_audio, /* Note: not all cards have stereo */
  1440. .has_radio = 1, /* Note: not all cards have radio */
  1441. .has_remote = 1,
  1442. /* GPIO wiring:
  1443. GPIO0: A0 hef4052
  1444. GPIO1: A1 hef4052
  1445. GPIO3: nEN hef4052
  1446. GPIO8-15: vrd866b
  1447. GPIO20,22,23: R30,R29,R28
  1448. */
  1449. },
  1450. [BTTV_BOARD_SENSORAY311] = {
  1451. /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
  1452. /* you must jumper JP5 for the card to work */
  1453. .name = "Sensoray 311",
  1454. .video_inputs = 5,
  1455. /* .audio_inputs= 0, */
  1456. .svhs = 4,
  1457. .gpiomask = 0,
  1458. .muxsel = MUXSEL(2, 3, 1, 0, 0),
  1459. .gpiomux = { 0 },
  1460. .needs_tvaudio = 0,
  1461. .tuner_type = TUNER_ABSENT,
  1462. .tuner_addr = ADDR_UNSET,
  1463. },
  1464. [BTTV_BOARD_RV605] = {
  1465. /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
  1466. .name = "RemoteVision MX (RV605)",
  1467. .video_inputs = 16,
  1468. /* .audio_inputs= 0, */
  1469. .svhs = NO_SVHS,
  1470. .gpiomask = 0x00,
  1471. .gpiomask2 = 0x07ff,
  1472. .muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
  1473. .no_msp34xx = 1,
  1474. .tuner_type = TUNER_ABSENT,
  1475. .tuner_addr = ADDR_UNSET,
  1476. .muxsel_hook = rv605_muxsel,
  1477. },
  1478. [BTTV_BOARD_POWERCLR_MTV878] = {
  1479. .name = "Powercolor MTV878/ MTV878R/ MTV878F",
  1480. .video_inputs = 3,
  1481. /* .audio_inputs= 2, */
  1482. .svhs = 2,
  1483. .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
  1484. .muxsel = MUXSEL(2, 1, 1),
  1485. .gpiomux = { 0, 1, 2, 2 },
  1486. .gpiomute = 4,
  1487. .needs_tvaudio = 0,
  1488. .tuner_type = TUNER_PHILIPS_PAL,
  1489. .tuner_addr = ADDR_UNSET,
  1490. .pll = PLL_28,
  1491. .has_radio = 1,
  1492. },
  1493. /* ---- card 0x4c ---------------------------------- */
  1494. [BTTV_BOARD_WINDVR] = {
  1495. /* Masaki Suzuki <masaki@btree.org> */
  1496. .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
  1497. .video_inputs = 3,
  1498. /* .audio_inputs= 1, */
  1499. .svhs = 2,
  1500. .gpiomask = 0x140007,
  1501. .muxsel = MUXSEL(2, 3, 1, 1),
  1502. .gpiomux = { 0, 1, 2, 3 },
  1503. .gpiomute = 4,
  1504. .tuner_type = TUNER_PHILIPS_NTSC,
  1505. .tuner_addr = ADDR_UNSET,
  1506. .audio_mode_gpio= windvr_audio,
  1507. },
  1508. [BTTV_BOARD_GRANDTEC_MULTI] = {
  1509. .name = "GrandTec Multi Capture Card (Bt878)",
  1510. .video_inputs = 4,
  1511. /* .audio_inputs= 0, */
  1512. .svhs = NO_SVHS,
  1513. .gpiomask = 0,
  1514. .muxsel = MUXSEL(2, 3, 1, 0),
  1515. .gpiomux = { 0 },
  1516. .needs_tvaudio = 0,
  1517. .no_msp34xx = 1,
  1518. .pll = PLL_28,
  1519. .tuner_type = TUNER_ABSENT,
  1520. .tuner_addr = ADDR_UNSET,
  1521. },
  1522. [BTTV_BOARD_KWORLD] = {
  1523. .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
  1524. .video_inputs = 4,
  1525. /* .audio_inputs= 3, */
  1526. .svhs = 2,
  1527. .gpiomask = 7,
  1528. /* Tuner, SVid, SVHS, SVid to SVHS connector */
  1529. .muxsel = MUXSEL(2, 3, 1, 1),
  1530. .gpiomux = { 0, 0, 4, 4 },/* Yes, this tuner uses the same audio output for TV and FM radio!
  1531. * This card lacks external Audio In, so we mute it on Ext. & Int.
  1532. * The PCB can take a sbx1637/sbx1673, wiring unknown.
  1533. * This card lacks PCI subsystem ID, sigh.
  1534. * gpiomux =1: lower volume, 2+3: mute
  1535. * btwincap uses 0x80000/0x80003
  1536. */
  1537. .gpiomute = 4,
  1538. .needs_tvaudio = 0,
  1539. .no_msp34xx = 1,
  1540. .pll = PLL_28,
  1541. .tuner_type = TUNER_PHILIPS_PAL,
  1542. .tuner_addr = ADDR_UNSET,
  1543. /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
  1544. radio signal strength indicators work fine. */
  1545. .has_radio = 1,
  1546. /* GPIO Info:
  1547. GPIO0,1: HEF4052 A0,A1
  1548. GPIO2: HEF4052 nENABLE
  1549. GPIO3-7: n.c.
  1550. GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
  1551. GPIO14,15: ??
  1552. GPIO16-21: n.c.
  1553. GPIO22,23: ??
  1554. ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
  1555. },
  1556. [BTTV_BOARD_DSP_TCVIDEO] = {
  1557. /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
  1558. .name = "DSP Design TCVIDEO",
  1559. .video_inputs = 4,
  1560. .svhs = NO_SVHS,
  1561. .muxsel = MUXSEL(2, 3, 1, 0),
  1562. .pll = PLL_28,
  1563. .tuner_type = UNSET,
  1564. .tuner_addr = ADDR_UNSET,
  1565. },
  1566. /* ---- card 0x50 ---------------------------------- */
  1567. [BTTV_BOARD_HAUPPAUGEPVR] = {
  1568. .name = "Hauppauge WinTV PVR",
  1569. .video_inputs = 4,
  1570. /* .audio_inputs= 1, */
  1571. .svhs = 2,
  1572. .muxsel = MUXSEL(2, 0, 1, 1),
  1573. .needs_tvaudio = 1,
  1574. .pll = PLL_28,
  1575. .tuner_type = UNSET,
  1576. .tuner_addr = ADDR_UNSET,
  1577. .gpiomask = 7,
  1578. .gpiomux = {7},
  1579. },
  1580. [BTTV_BOARD_GVBCTV5PCI] = {
  1581. .name = "IODATA GV-BCTV5/PCI",
  1582. .video_inputs = 3,
  1583. /* .audio_inputs= 1, */
  1584. .svhs = 2,
  1585. .gpiomask = 0x0f0f80,
  1586. .muxsel = MUXSEL(2, 3, 1, 0),
  1587. .gpiomux = {0x030000, 0x010000, 0, 0 },
  1588. .gpiomute = 0x020000,
  1589. .no_msp34xx = 1,
  1590. .pll = PLL_28,
  1591. .tuner_type = TUNER_PHILIPS_NTSC_M,
  1592. .tuner_addr = ADDR_UNSET,
  1593. .audio_mode_gpio= gvbctv5pci_audio,
  1594. .has_radio = 1,
  1595. },
  1596. [BTTV_BOARD_OSPREY1x0] = {
  1597. .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
  1598. .video_inputs = 4, /* id-inputs-clock */
  1599. /* .audio_inputs= 0, */
  1600. .svhs = 3,
  1601. .muxsel = MUXSEL(3, 2, 0, 1),
  1602. .pll = PLL_28,
  1603. .tuner_type = TUNER_ABSENT,
  1604. .tuner_addr = ADDR_UNSET,
  1605. .no_msp34xx = 1,
  1606. .no_tda7432 = 1,
  1607. },
  1608. [BTTV_BOARD_OSPREY1x0_848] = {
  1609. .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
  1610. .video_inputs = 3,
  1611. /* .audio_inputs= 0, */
  1612. .svhs = 2,
  1613. .muxsel = MUXSEL(2, 3, 1),
  1614. .pll = PLL_28,
  1615. .tuner_type = TUNER_ABSENT,
  1616. .tuner_addr = ADDR_UNSET,
  1617. .no_msp34xx = 1,
  1618. .no_tda7432 = 1,
  1619. },
  1620. /* ---- card 0x54 ---------------------------------- */
  1621. [BTTV_BOARD_OSPREY101_848] = {
  1622. .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */
  1623. .video_inputs = 2,
  1624. /* .audio_inputs= 0, */
  1625. .svhs = 1,
  1626. .muxsel = MUXSEL(3, 1),
  1627. .pll = PLL_28,
  1628. .tuner_type = TUNER_ABSENT,
  1629. .tuner_addr = ADDR_UNSET,
  1630. .no_msp34xx = 1,
  1631. .no_tda7432 = 1,
  1632. },
  1633. [BTTV_BOARD_OSPREY1x1] = {
  1634. .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
  1635. .video_inputs = 1,
  1636. /* .audio_inputs= 0, */
  1637. .svhs = NO_SVHS,
  1638. .muxsel = MUXSEL(0),
  1639. .pll = PLL_28,
  1640. .tuner_type = TUNER_ABSENT,
  1641. .tuner_addr = ADDR_UNSET,
  1642. .no_msp34xx = 1,
  1643. .no_tda7432 = 1,
  1644. },
  1645. [BTTV_BOARD_OSPREY1x1_SVID] = {
  1646. .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
  1647. .video_inputs = 2,
  1648. /* .audio_inputs= 0, */
  1649. .svhs = 1,
  1650. .muxsel = MUXSEL(0, 1),
  1651. .pll = PLL_28,
  1652. .tuner_type = TUNER_ABSENT,
  1653. .tuner_addr = ADDR_UNSET,
  1654. .no_msp34xx = 1,
  1655. .no_tda7432 = 1,
  1656. },
  1657. [BTTV_BOARD_OSPREY2xx] = {
  1658. .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
  1659. .video_inputs = 1,
  1660. /* .audio_inputs= 1, */
  1661. .svhs = NO_SVHS,
  1662. .muxsel = MUXSEL(0),
  1663. .pll = PLL_28,
  1664. .tuner_type = TUNER_ABSENT,
  1665. .tuner_addr = ADDR_UNSET,
  1666. .no_msp34xx = 1,
  1667. .no_tda7432 = 1,
  1668. },
  1669. /* ---- card 0x58 ---------------------------------- */
  1670. [BTTV_BOARD_OSPREY2x0_SVID] = {
  1671. .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
  1672. .video_inputs = 2,
  1673. /* .audio_inputs= 1, */
  1674. .svhs = 1,
  1675. .muxsel = MUXSEL(0, 1),
  1676. .pll = PLL_28,
  1677. .tuner_type = TUNER_ABSENT,
  1678. .tuner_addr = ADDR_UNSET,
  1679. .no_msp34xx = 1,
  1680. .no_tda7432 = 1,
  1681. },
  1682. [BTTV_BOARD_OSPREY2x0] = {
  1683. .name = "Osprey 210/220/230", /* 0x1(A|B)-04C0-C1 */
  1684. .video_inputs = 2,
  1685. /* .audio_inputs= 1, */
  1686. .svhs = 1,
  1687. .muxsel = MUXSEL(2, 3),
  1688. .pll = PLL_28,
  1689. .tuner_type = TUNER_ABSENT,
  1690. .tuner_addr = ADDR_UNSET,
  1691. .no_msp34xx = 1,
  1692. .no_tda7432 = 1,
  1693. },
  1694. [BTTV_BOARD_OSPREY500] = {
  1695. .name = "Osprey 500", /* 500 */
  1696. .video_inputs = 2,
  1697. /* .audio_inputs= 1, */
  1698. .svhs = 1,
  1699. .muxsel = MUXSEL(2, 3),
  1700. .pll = PLL_28,
  1701. .tuner_type = TUNER_ABSENT,
  1702. .tuner_addr = ADDR_UNSET,
  1703. .no_msp34xx = 1,
  1704. .no_tda7432 = 1,
  1705. },
  1706. [BTTV_BOARD_OSPREY540] = {
  1707. .name = "Osprey 540", /* 540 */
  1708. .video_inputs = 4,
  1709. /* .audio_inputs= 1, */
  1710. .pll = PLL_28,
  1711. .tuner_type = TUNER_ABSENT,
  1712. .tuner_addr = ADDR_UNSET,
  1713. .no_msp34xx = 1,
  1714. .no_tda7432 = 1,
  1715. },
  1716. /* ---- card 0x5C ---------------------------------- */
  1717. [BTTV_BOARD_OSPREY2000] = {
  1718. .name = "Osprey 2000", /* 2000 */
  1719. .video_inputs = 2,
  1720. /* .audio_inputs= 1, */
  1721. .svhs = 1,
  1722. .muxsel = MUXSEL(2, 3),
  1723. .pll = PLL_28,
  1724. .tuner_type = TUNER_ABSENT,
  1725. .tuner_addr = ADDR_UNSET,
  1726. .no_msp34xx = 1,
  1727. .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */
  1728. },
  1729. [BTTV_BOARD_IDS_EAGLE] = {
  1730. /* M G Berberich <berberic@forwiss.uni-passau.de> */
  1731. .name = "IDS Eagle",
  1732. .video_inputs = 4,
  1733. /* .audio_inputs= 0, */
  1734. .tuner_type = TUNER_ABSENT,
  1735. .tuner_addr = ADDR_UNSET,
  1736. .svhs = NO_SVHS,
  1737. .gpiomask = 0,
  1738. .muxsel = MUXSEL(2, 2, 2, 2),
  1739. .muxsel_hook = eagle_muxsel,
  1740. .no_msp34xx = 1,
  1741. .pll = PLL_28,
  1742. },
  1743. [BTTV_BOARD_PINNACLESAT] = {
  1744. .name = "Pinnacle PCTV Sat",
  1745. .video_inputs = 2,
  1746. /* .audio_inputs= 0, */
  1747. .svhs = 1,
  1748. .tuner_type = TUNER_ABSENT,
  1749. .tuner_addr = ADDR_UNSET,
  1750. .no_msp34xx = 1,
  1751. .no_tda7432 = 1,
  1752. .muxsel = MUXSEL(3, 1),
  1753. .pll = PLL_28,
  1754. .no_gpioirq = 1,
  1755. .has_dvb = 1,
  1756. },
  1757. [BTTV_BOARD_FORMAC_PROTV] = {
  1758. .name = "Formac ProTV II (bt878)",
  1759. .video_inputs = 4,
  1760. /* .audio_inputs= 1, */
  1761. .svhs = 3,
  1762. .gpiomask = 2,
  1763. /* TV, Comp1, Composite over SVID con, SVID */
  1764. .muxsel = MUXSEL(2, 3, 1, 1),
  1765. .gpiomux = { 2, 2, 0, 0 },
  1766. .pll = PLL_28,
  1767. .has_radio = 1,
  1768. .tuner_type = TUNER_PHILIPS_PAL,
  1769. .tuner_addr = ADDR_UNSET,
  1770. /* sound routing:
  1771. GPIO=0x00,0x01,0x03: mute (?)
  1772. 0x02: both TV and radio (tuner: FM1216/I)
  1773. The card has onboard audio connectors labeled "cdrom" and "board",
  1774. not soldered here, though unknown wiring.
  1775. Card lacks: external audio in, pci subsystem id.
  1776. */
  1777. },
  1778. /* ---- card 0x60 ---------------------------------- */
  1779. [BTTV_BOARD_MACHTV] = {
  1780. .name = "MachTV",
  1781. .video_inputs = 3,
  1782. /* .audio_inputs= 1, */
  1783. .svhs = NO_SVHS,
  1784. .gpiomask = 7,
  1785. .muxsel = MUXSEL(2, 3, 1, 1),
  1786. .gpiomux = { 0, 1, 2, 3},
  1787. .gpiomute = 4,
  1788. .needs_tvaudio = 1,
  1789. .tuner_type = TUNER_PHILIPS_PAL,
  1790. .tuner_addr = ADDR_UNSET,
  1791. .pll = PLL_28,
  1792. },
  1793. [BTTV_BOARD_EURESYS_PICOLO] = {
  1794. .name = "Euresys Picolo",
  1795. .video_inputs = 3,
  1796. /* .audio_inputs= 0, */
  1797. .svhs = 2,
  1798. .gpiomask = 0,
  1799. .no_msp34xx = 1,
  1800. .no_tda7432 = 1,
  1801. .muxsel = MUXSEL(2, 0, 1),
  1802. .pll = PLL_28,
  1803. .tuner_type = TUNER_ABSENT,
  1804. .tuner_addr = ADDR_UNSET,
  1805. },
  1806. [BTTV_BOARD_PV150] = {
  1807. /* Luc Van Hoeylandt <luc@e-magic.be> */
  1808. .name = "ProVideo PV150", /* 0x4f */
  1809. .video_inputs = 2,
  1810. /* .audio_inputs= 0, */
  1811. .svhs = NO_SVHS,
  1812. .gpiomask = 0,
  1813. .muxsel = MUXSEL(2, 3),
  1814. .gpiomux = { 0 },
  1815. .needs_tvaudio = 0,
  1816. .no_msp34xx = 1,
  1817. .pll = PLL_28,
  1818. .tuner_type = TUNER_ABSENT,
  1819. .tuner_addr = ADDR_UNSET,
  1820. },
  1821. [BTTV_BOARD_AD_TVK503] = {
  1822. /* Hiroshi Takekawa <sian@big.or.jp> */
  1823. /* This card lacks subsystem ID */
  1824. .name = "AD-TVK503", /* 0x63 */
  1825. .video_inputs = 4,
  1826. /* .audio_inputs= 1, */
  1827. .svhs = 2,
  1828. .gpiomask = 0x001e8007,
  1829. .muxsel = MUXSEL(2, 3, 1, 0),
  1830. /* Tuner, Radio, external, internal, off, on */
  1831. .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 },
  1832. .gpiomute = 0x0f,
  1833. .needs_tvaudio = 0,
  1834. .no_msp34xx = 1,
  1835. .pll = PLL_28,
  1836. .tuner_type = TUNER_PHILIPS_NTSC,
  1837. .tuner_addr = ADDR_UNSET,
  1838. .audio_mode_gpio= adtvk503_audio,
  1839. },
  1840. /* ---- card 0x64 ---------------------------------- */
  1841. [BTTV_BOARD_HERCULES_SM_TV] = {
  1842. .name = "Hercules Smart TV Stereo",
  1843. .video_inputs = 4,
  1844. /* .audio_inputs= 1, */
  1845. .svhs = 2,
  1846. .gpiomask = 0x00,
  1847. .muxsel = MUXSEL(2, 3, 1, 1),
  1848. .needs_tvaudio = 1,
  1849. .no_msp34xx = 1,
  1850. .pll = PLL_28,
  1851. .tuner_type = TUNER_PHILIPS_PAL,
  1852. .tuner_addr = ADDR_UNSET,
  1853. /* Notes:
  1854. - card lacks subsystem ID
  1855. - stereo variant w/ daughter board with tda9874a @0xb0
  1856. - Audio Routing:
  1857. always from tda9874 independent of GPIO (?)
  1858. external line in: unknown
  1859. - Other chips: em78p156elp @ 0x96 (probably IR remote control)
  1860. hef4053 (instead 4052) for unknown function
  1861. */
  1862. },
  1863. [BTTV_BOARD_PACETV] = {
  1864. .name = "Pace TV & Radio Card",
  1865. .video_inputs = 4,
  1866. /* .audio_inputs= 1, */
  1867. .svhs = 2,
  1868. /* Tuner, CVid, SVid, CVid over SVid connector */
  1869. .muxsel = MUXSEL(2, 3, 1, 1),
  1870. .gpiomask = 0,
  1871. .no_tda7432 = 1,
  1872. .tuner_type = TUNER_PHILIPS_PAL_I,
  1873. .tuner_addr = ADDR_UNSET,
  1874. .has_radio = 1,
  1875. .pll = PLL_28,
  1876. /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
  1877. only internal line out: (4pin header) RGGL
  1878. Radio must be decoded by msp3410d (not routed through)*/
  1879. /*
  1880. .digital_mode = DIGITAL_MODE_CAMERA, todo!
  1881. */
  1882. },
  1883. [BTTV_BOARD_IVC200] = {
  1884. /* Chris Willing <chris@vislab.usyd.edu.au> */
  1885. .name = "IVC-200",
  1886. .video_inputs = 1,
  1887. /* .audio_inputs= 0, */
  1888. .tuner_type = TUNER_ABSENT,
  1889. .tuner_addr = ADDR_UNSET,
  1890. .svhs = NO_SVHS,
  1891. .gpiomask = 0xdf,
  1892. .muxsel = MUXSEL(2),
  1893. .pll = PLL_28,
  1894. },
  1895. [BTTV_BOARD_IVCE8784] = {
  1896. .name = "IVCE-8784",
  1897. .video_inputs = 1,
  1898. /* .audio_inputs= 0, */
  1899. .tuner_type = TUNER_ABSENT,
  1900. .tuner_addr = ADDR_UNSET,
  1901. .svhs = NO_SVHS,
  1902. .gpiomask = 0xdf,
  1903. .muxsel = MUXSEL(2),
  1904. .pll = PLL_28,
  1905. },
  1906. [BTTV_BOARD_XGUARD] = {
  1907. .name = "Grand X-Guard / Trust 814PCI",
  1908. .video_inputs = 16,
  1909. /* .audio_inputs= 0, */
  1910. .svhs = NO_SVHS,
  1911. .tuner_type = TUNER_ABSENT,
  1912. .tuner_addr = ADDR_UNSET,
  1913. .gpiomask2 = 0xff,
  1914. .muxsel = MUXSEL(2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0),
  1915. .muxsel_hook = xguard_muxsel,
  1916. .no_msp34xx = 1,
  1917. .no_tda7432 = 1,
  1918. .pll = PLL_28,
  1919. },
  1920. /* ---- card 0x68 ---------------------------------- */
  1921. [BTTV_BOARD_NEBULA_DIGITV] = {
  1922. .name = "Nebula Electronics DigiTV",
  1923. .video_inputs = 1,
  1924. .svhs = NO_SVHS,
  1925. .muxsel = MUXSEL(2, 3, 1, 0),
  1926. .no_msp34xx = 1,
  1927. .no_tda7432 = 1,
  1928. .pll = PLL_28,
  1929. .tuner_type = TUNER_ABSENT,
  1930. .tuner_addr = ADDR_UNSET,
  1931. .has_dvb = 1,
  1932. .has_remote = 1,
  1933. .gpiomask = 0x1b,
  1934. .no_gpioirq = 1,
  1935. },
  1936. [BTTV_BOARD_PV143] = {
  1937. /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
  1938. .name = "ProVideo PV143",
  1939. .video_inputs = 4,
  1940. /* .audio_inputs= 0, */
  1941. .svhs = NO_SVHS,
  1942. .gpiomask = 0,
  1943. .muxsel = MUXSEL(2, 3, 1, 0),
  1944. .gpiomux = { 0 },
  1945. .needs_tvaudio = 0,
  1946. .no_msp34xx = 1,
  1947. .pll = PLL_28,
  1948. .tuner_type = TUNER_ABSENT,
  1949. .tuner_addr = ADDR_UNSET,
  1950. },
  1951. [BTTV_BOARD_VD009X1_VD011_MINIDIN] = {
  1952. /* M.Klahr@phytec.de */
  1953. .name = "PHYTEC VD-009-X1 VD-011 MiniDIN (bt878)",
  1954. .video_inputs = 4,
  1955. /* .audio_inputs= 0, */
  1956. .svhs = 3,
  1957. .gpiomask = 0x00,
  1958. .muxsel = MUXSEL(2, 3, 1, 0),
  1959. .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
  1960. .needs_tvaudio = 0,
  1961. .pll = PLL_28,
  1962. .tuner_type = TUNER_ABSENT,
  1963. .tuner_addr = ADDR_UNSET,
  1964. },
  1965. [BTTV_BOARD_VD009X1_VD011_COMBI] = {
  1966. .name = "PHYTEC VD-009-X1 VD-011 Combi (bt878)",
  1967. .video_inputs = 4,
  1968. /* .audio_inputs= 0, */
  1969. .svhs = 3,
  1970. .gpiomask = 0x00,
  1971. .muxsel = MUXSEL(2, 3, 1, 1),
  1972. .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
  1973. .needs_tvaudio = 0,
  1974. .pll = PLL_28,
  1975. .tuner_type = TUNER_ABSENT,
  1976. .tuner_addr = ADDR_UNSET,
  1977. },
  1978. /* ---- card 0x6c ---------------------------------- */
  1979. [BTTV_BOARD_VD009_MINIDIN] = {
  1980. .name = "PHYTEC VD-009 MiniDIN (bt878)",
  1981. .video_inputs = 10,
  1982. /* .audio_inputs= 0, */
  1983. .svhs = 9,
  1984. .gpiomask = 0x00,
  1985. .gpiomask2 = 0x03, /* used for external vodeo mux */
  1986. .muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 0),
  1987. .muxsel_hook = phytec_muxsel,
  1988. .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
  1989. .needs_tvaudio = 1,
  1990. .pll = PLL_28,
  1991. .tuner_type = TUNER_ABSENT,
  1992. .tuner_addr = ADDR_UNSET,
  1993. },
  1994. [BTTV_BOARD_VD009_COMBI] = {
  1995. .name = "PHYTEC VD-009 Combi (bt878)",
  1996. .video_inputs = 10,
  1997. /* .audio_inputs= 0, */
  1998. .svhs = 9,
  1999. .gpiomask = 0x00,
  2000. .gpiomask2 = 0x03, /* used for external vodeo mux */
  2001. .muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 1),
  2002. .muxsel_hook = phytec_muxsel,
  2003. .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
  2004. .needs_tvaudio = 1,
  2005. .pll = PLL_28,
  2006. .tuner_type = TUNER_ABSENT,
  2007. .tuner_addr = ADDR_UNSET,
  2008. },
  2009. [BTTV_BOARD_IVC100] = {
  2010. .name = "IVC-100",
  2011. .video_inputs = 4,
  2012. /* .audio_inputs= 0, */
  2013. .tuner_type = TUNER_ABSENT,
  2014. .tuner_addr = ADDR_UNSET,
  2015. .svhs = NO_SVHS,
  2016. .gpiomask = 0xdf,
  2017. .muxsel = MUXSEL(2, 3, 1, 0),
  2018. .pll = PLL_28,
  2019. },
  2020. [BTTV_BOARD_IVC120] = {
  2021. /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
  2022. .name = "IVC-120G",
  2023. .video_inputs = 16,
  2024. /* .audio_inputs= 0, */
  2025. .tuner_type = TUNER_ABSENT,
  2026. .tuner_addr = ADDR_UNSET,
  2027. .svhs = NO_SVHS, /* card has no svhs */
  2028. .needs_tvaudio = 0,
  2029. .no_msp34xx = 1,
  2030. .no_tda7432 = 1,
  2031. .gpiomask = 0x00,
  2032. .muxsel = MUXSEL(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
  2033. .muxsel_hook = ivc120_muxsel,
  2034. .pll = PLL_28,
  2035. },
  2036. /* ---- card 0x70 ---------------------------------- */
  2037. [BTTV_BOARD_PC_HDTV] = {
  2038. .name = "pcHDTV HD-2000 TV",
  2039. .video_inputs = 4,
  2040. /* .audio_inputs= 1, */
  2041. .svhs = 2,
  2042. .muxsel = MUXSEL(2, 3, 1, 0),
  2043. .tuner_type = TUNER_PHILIPS_FCV1236D,
  2044. .tuner_addr = ADDR_UNSET,
  2045. .has_dvb = 1,
  2046. },
  2047. [BTTV_BOARD_TWINHAN_DST] = {
  2048. .name = "Twinhan DST + clones",
  2049. .no_msp34xx = 1,
  2050. .no_tda7432 = 1,
  2051. .tuner_type = TUNER_ABSENT,
  2052. .tuner_addr = ADDR_UNSET,
  2053. .no_video = 1,
  2054. .has_dvb = 1,
  2055. },
  2056. [BTTV_BOARD_WINFASTVC100] = {
  2057. .name = "Winfast VC100",
  2058. .video_inputs = 3,
  2059. /* .audio_inputs= 0, */
  2060. .svhs = 1,
  2061. /* Vid In, SVid In, Vid over SVid in connector */
  2062. .muxsel = MUXSEL(3, 1, 1, 3),
  2063. .no_msp34xx = 1,
  2064. .no_tda7432 = 1,
  2065. .tuner_type = TUNER_ABSENT,
  2066. .tuner_addr = ADDR_UNSET,
  2067. .pll = PLL_28,
  2068. },
  2069. [BTTV_BOARD_TEV560] = {
  2070. .name = "Teppro TEV-560/InterVision IV-560",
  2071. .video_inputs = 3,
  2072. /* .audio_inputs= 1, */
  2073. .svhs = 2,
  2074. .gpiomask = 3,
  2075. .muxsel = MUXSEL(2, 3, 1, 1),
  2076. .gpiomux = { 1, 1, 1, 1 },
  2077. .needs_tvaudio = 1,
  2078. .tuner_type = TUNER_PHILIPS_PAL,
  2079. .tuner_addr = ADDR_UNSET,
  2080. .pll = PLL_35,
  2081. },
  2082. /* ---- card 0x74 ---------------------------------- */
  2083. [BTTV_BOARD_SIMUS_GVC1100] = {
  2084. .name = "SIMUS GVC1100",
  2085. .video_inputs = 4,
  2086. /* .audio_inputs= 0, */
  2087. .svhs = NO_SVHS,
  2088. .tuner_type = TUNER_ABSENT,
  2089. .tuner_addr = ADDR_UNSET,
  2090. .pll = PLL_28,
  2091. .muxsel = MUXSEL(2, 2, 2, 2),
  2092. .gpiomask = 0x3F,
  2093. .muxsel_hook = gvc1100_muxsel,
  2094. },
  2095. [BTTV_BOARD_NGSTV_PLUS] = {
  2096. /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
  2097. .name = "NGS NGSTV+",
  2098. .video_inputs = 3,
  2099. .svhs = 2,
  2100. .gpiomask = 0x008007,
  2101. .muxsel = MUXSEL(2, 3, 0, 0),
  2102. .gpiomux = { 0, 0, 0, 0 },
  2103. .gpiomute = 0x000003,
  2104. .pll = PLL_28,
  2105. .tuner_type = TUNER_PHILIPS_PAL,
  2106. .tuner_addr = ADDR_UNSET,
  2107. .has_remote = 1,
  2108. },
  2109. [BTTV_BOARD_LMLBT4] = {
  2110. /* http://linuxmedialabs.com */
  2111. .name = "LMLBT4",
  2112. .video_inputs = 4, /* IN1,IN2,IN3,IN4 */
  2113. /* .audio_inputs= 0, */
  2114. .svhs = NO_SVHS,
  2115. .muxsel = MUXSEL(2, 3, 1, 0),
  2116. .no_msp34xx = 1,
  2117. .no_tda7432 = 1,
  2118. .needs_tvaudio = 0,
  2119. .tuner_type = TUNER_ABSENT,
  2120. .tuner_addr = ADDR_UNSET,
  2121. },
  2122. [BTTV_BOARD_TEKRAM_M205] = {
  2123. /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
  2124. .name = "Tekram M205 PRO",
  2125. .video_inputs = 3,
  2126. /* .audio_inputs= 1, */
  2127. .tuner_type = TUNER_PHILIPS_PAL,
  2128. .tuner_addr = ADDR_UNSET,
  2129. .svhs = 2,
  2130. .needs_tvaudio = 0,
  2131. .gpiomask = 0x68,
  2132. .muxsel = MUXSEL(2, 3, 1),
  2133. .gpiomux = { 0x68, 0x68, 0x61, 0x61 },
  2134. .pll = PLL_28,
  2135. },
  2136. /* ---- card 0x78 ---------------------------------- */
  2137. [BTTV_BOARD_CONTVFMI] = {
  2138. /* Javier Cendan Ares <jcendan@lycos.es> */
  2139. /* bt878 TV + FM without subsystem ID */
  2140. .name = "Conceptronic CONTVFMi",
  2141. .video_inputs = 3,
  2142. /* .audio_inputs= 1, */
  2143. .svhs = 2,
  2144. .gpiomask = 0x008007,
  2145. .muxsel = MUXSEL(2, 3, 1, 1),
  2146. .gpiomux = { 0, 1, 2, 2 },
  2147. .gpiomute = 3,
  2148. .needs_tvaudio = 0,
  2149. .pll = PLL_28,
  2150. .tuner_type = TUNER_PHILIPS_PAL,
  2151. .tuner_addr = ADDR_UNSET,
  2152. .has_remote = 1,
  2153. .has_radio = 1,
  2154. },
  2155. [BTTV_BOARD_PICOLO_TETRA_CHIP] = {
  2156. /*Eric DEBIEF <debief@telemsa.com>*/
  2157. /*EURESYS Picolo Tetra : 4 Conexant Fusion 878A, no audio, video input set with analog multiplexers GPIO controlled*/
  2158. /* adds picolo_tetra_muxsel(), picolo_tetra_init(), the following declaration strucure, and #define BTTV_BOARD_PICOLO_TETRA_CHIP*/
  2159. /*0x79 in bttv.h*/
  2160. .name = "Euresys Picolo Tetra",
  2161. .video_inputs = 4,
  2162. /* .audio_inputs= 0, */
  2163. .svhs = NO_SVHS,
  2164. .gpiomask = 0,
  2165. .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
  2166. .no_msp34xx = 1,
  2167. .no_tda7432 = 1,
  2168. /*878A input is always MUX0, see above.*/
  2169. .muxsel = MUXSEL(2, 2, 2, 2),
  2170. .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
  2171. .pll = PLL_28,
  2172. .needs_tvaudio = 0,
  2173. .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
  2174. .tuner_type = TUNER_ABSENT,
  2175. .tuner_addr = ADDR_UNSET,
  2176. },
  2177. [BTTV_BOARD_SPIRIT_TV] = {
  2178. /* Spirit TV Tuner from http://spiritmodems.com.au */
  2179. /* Stafford Goodsell <surge@goliath.homeunix.org> */
  2180. .name = "Spirit TV Tuner",
  2181. .video_inputs = 3,
  2182. /* .audio_inputs= 1, */
  2183. .svhs = 2,
  2184. .gpiomask = 0x0000000f,
  2185. .muxsel = MUXSEL(2, 1, 1),
  2186. .gpiomux = { 0x02, 0x00, 0x00, 0x00 },
  2187. .tuner_type = TUNER_TEMIC_PAL,
  2188. .tuner_addr = ADDR_UNSET,
  2189. .no_msp34xx = 1,
  2190. },
  2191. [BTTV_BOARD_AVDVBT_771] = {
  2192. /* Wolfram Joost <wojo@frokaschwei.de> */
  2193. .name = "AVerMedia AVerTV DVB-T 771",
  2194. .video_inputs = 2,
  2195. .svhs = 1,
  2196. .tuner_type = TUNER_ABSENT,
  2197. .tuner_addr = ADDR_UNSET,
  2198. .muxsel = MUXSEL(3, 3),
  2199. .no_msp34xx = 1,
  2200. .no_tda7432 = 1,
  2201. .pll = PLL_28,
  2202. .has_dvb = 1,
  2203. .no_gpioirq = 1,
  2204. .has_remote = 1,
  2205. },
  2206. /* ---- card 0x7c ---------------------------------- */
  2207. [BTTV_BOARD_AVDVBT_761] = {
  2208. /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
  2209. /* Based on the Nebula card data - added remote and new card number - BTTV_BOARD_AVDVBT_761, see also ir-kbd-gpio.c */
  2210. .name = "AverMedia AverTV DVB-T 761",
  2211. .video_inputs = 2,
  2212. .svhs = 1,
  2213. .muxsel = MUXSEL(3, 1, 2, 0), /* Comp0, S-Video, ?, ? */
  2214. .no_msp34xx = 1,
  2215. .no_tda7432 = 1,
  2216. .pll = PLL_28,
  2217. .tuner_type = TUNER_ABSENT,
  2218. .tuner_addr = ADDR_UNSET,
  2219. .has_dvb = 1,
  2220. .no_gpioirq = 1,
  2221. .has_remote = 1,
  2222. },
  2223. [BTTV_BOARD_MATRIX_VISIONSQ] = {
  2224. /* andre.schwarz@matrix-vision.de */
  2225. .name = "MATRIX Vision Sigma-SQ",
  2226. .video_inputs = 16,
  2227. /* .audio_inputs= 0, */
  2228. .svhs = NO_SVHS,
  2229. .gpiomask = 0x0,
  2230. .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3),
  2231. .muxsel_hook = sigmaSQ_muxsel,
  2232. .gpiomux = { 0 },
  2233. .no_msp34xx = 1,
  2234. .pll = PLL_28,
  2235. .tuner_type = TUNER_ABSENT,
  2236. .tuner_addr = ADDR_UNSET,
  2237. },
  2238. [BTTV_BOARD_MATRIX_VISIONSLC] = {
  2239. /* andre.schwarz@matrix-vision.de */
  2240. .name = "MATRIX Vision Sigma-SLC",
  2241. .video_inputs = 4,
  2242. /* .audio_inputs= 0, */
  2243. .svhs = NO_SVHS,
  2244. .gpiomask = 0x0,
  2245. .muxsel = MUXSEL(2, 2, 2, 2),
  2246. .muxsel_hook = sigmaSLC_muxsel,
  2247. .gpiomux = { 0 },
  2248. .no_msp34xx = 1,
  2249. .pll = PLL_28,
  2250. .tuner_type = TUNER_ABSENT,
  2251. .tuner_addr = ADDR_UNSET,
  2252. },
  2253. /* BTTV_BOARD_APAC_VIEWCOMP */
  2254. [BTTV_BOARD_APAC_VIEWCOMP] = {
  2255. /* Attila Kondoros <attila.kondoros@chello.hu> */
  2256. /* bt878 TV + FM 0x00000000 subsystem ID */
  2257. .name = "APAC Viewcomp 878(AMAX)",
  2258. .video_inputs = 2,
  2259. /* .audio_inputs= 1, */
  2260. .svhs = NO_SVHS,
  2261. .gpiomask = 0xFF,
  2262. .muxsel = MUXSEL(2, 3, 1, 1),
  2263. .gpiomux = { 2, 0, 0, 0 },
  2264. .gpiomute = 10,
  2265. .needs_tvaudio = 0,
  2266. .pll = PLL_28,
  2267. .tuner_type = TUNER_PHILIPS_PAL,
  2268. .tuner_addr = ADDR_UNSET,
  2269. .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */
  2270. .has_radio = 1, /* not every card has radio */
  2271. },
  2272. /* ---- card 0x80 ---------------------------------- */
  2273. [BTTV_BOARD_DVICO_DVBT_LITE] = {
  2274. /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
  2275. .name = "DViCO FusionHDTV DVB-T Lite",
  2276. .no_msp34xx = 1,
  2277. .no_tda7432 = 1,
  2278. .pll = PLL_28,
  2279. .no_video = 1,
  2280. .has_dvb = 1,
  2281. .tuner_type = TUNER_ABSENT,
  2282. .tuner_addr = ADDR_UNSET,
  2283. },
  2284. [BTTV_BOARD_VGEAR_MYVCD] = {
  2285. /* Steven <photon38@pchome.com.tw> */
  2286. .name = "V-Gear MyVCD",
  2287. .video_inputs = 3,
  2288. /* .audio_inputs= 1, */
  2289. .svhs = 2,
  2290. .gpiomask = 0x3f,
  2291. .muxsel = MUXSEL(2, 3, 1, 0),
  2292. .gpiomux = {0x31, 0x31, 0x31, 0x31 },
  2293. .gpiomute = 0x31,
  2294. .no_msp34xx = 1,
  2295. .pll = PLL_28,
  2296. .tuner_type = TUNER_PHILIPS_NTSC_M,
  2297. .tuner_addr = ADDR_UNSET,
  2298. .has_radio = 0,
  2299. },
  2300. [BTTV_BOARD_SUPER_TV] = {
  2301. /* Rick C <cryptdragoon@gmail.com> */
  2302. .name = "Super TV Tuner",
  2303. .video_inputs = 4,
  2304. /* .audio_inputs= 1, */
  2305. .svhs = 2,
  2306. .muxsel = MUXSEL(2, 3, 1, 0),
  2307. .tuner_type = TUNER_PHILIPS_NTSC,
  2308. .tuner_addr = ADDR_UNSET,
  2309. .gpiomask = 0x008007,
  2310. .gpiomux = { 0, 0x000001,0,0 },
  2311. .needs_tvaudio = 1,
  2312. .has_radio = 1,
  2313. },
  2314. [BTTV_BOARD_TIBET_CS16] = {
  2315. /* Chris Fanning <video4linux@haydon.net> */
  2316. .name = "Tibet Systems 'Progress DVR' CS16",
  2317. .video_inputs = 16,
  2318. /* .audio_inputs= 0, */
  2319. .svhs = NO_SVHS,
  2320. .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2),
  2321. .pll = PLL_28,
  2322. .no_msp34xx = 1,
  2323. .no_tda7432 = 1,
  2324. .tuner_type = TUNER_ABSENT,
  2325. .tuner_addr = ADDR_UNSET,
  2326. .muxsel_hook = tibetCS16_muxsel,
  2327. },
  2328. [BTTV_BOARD_KODICOM_4400R] = {
  2329. /* Bill Brack <wbrack@mmm.com.hk> */
  2330. /*
  2331. * Note that, because of the card's wiring, the "master"
  2332. * BT878A chip (i.e. the one which controls the analog switch
  2333. * and must use this card type) is the 2nd one detected. The
  2334. * other 3 chips should use card type 0x85, whose description
  2335. * follows this one. There is a EEPROM on the card (which is
  2336. * connected to the I2C of one of those other chips), but is
  2337. * not currently handled. There is also a facility for a
  2338. * "monitor", which is also not currently implemented.
  2339. */
  2340. .name = "Kodicom 4400R (master)",
  2341. .video_inputs = 16,
  2342. /* .audio_inputs= 0, */
  2343. .tuner_type = TUNER_ABSENT,
  2344. .tuner_addr = ADDR_UNSET,
  2345. .svhs = NO_SVHS,
  2346. /* GPIO bits 0-9 used for analog switch:
  2347. * 00 - 03: camera selector
  2348. * 04 - 06: channel (controller) selector
  2349. * 07: data (1->on, 0->off)
  2350. * 08: strobe
  2351. * 09: reset
  2352. * bit 16 is input from sync separator for the channel
  2353. */
  2354. .gpiomask = 0x0003ff,
  2355. .no_gpioirq = 1,
  2356. .muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
  2357. .pll = PLL_28,
  2358. .no_msp34xx = 1,
  2359. .no_tda7432 = 1,
  2360. .muxsel_hook = kodicom4400r_muxsel,
  2361. },
  2362. [BTTV_BOARD_KODICOM_4400R_SL] = {
  2363. /* Bill Brack <wbrack@mmm.com.hk> */
  2364. /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
  2365. * one which controls the analog switch, and must use the card type)
  2366. * is the 2nd one detected. The other 3 chips should use this card
  2367. * type
  2368. */
  2369. .name = "Kodicom 4400R (slave)",
  2370. .video_inputs = 16,
  2371. /* .audio_inputs= 0, */
  2372. .tuner_type = TUNER_ABSENT,
  2373. .tuner_addr = ADDR_UNSET,
  2374. .svhs = NO_SVHS,
  2375. .gpiomask = 0x010000,
  2376. .no_gpioirq = 1,
  2377. .muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
  2378. .pll = PLL_28,
  2379. .no_msp34xx = 1,
  2380. .no_tda7432 = 1,
  2381. .muxsel_hook = kodicom4400r_muxsel,
  2382. },
  2383. /* ---- card 0x86---------------------------------- */
  2384. [BTTV_BOARD_ADLINK_RTV24] = {
  2385. /* Michael Henson <mhenson@clarityvi.com> */
  2386. /* Adlink RTV24 with special unlock codes */
  2387. .name = "Adlink RTV24",
  2388. .video_inputs = 4,
  2389. /* .audio_inputs= 1, */
  2390. .svhs = 2,
  2391. .muxsel = MUXSEL(2, 3, 1, 0),
  2392. .tuner_type = UNSET,
  2393. .tuner_addr = ADDR_UNSET,
  2394. .pll = PLL_28,
  2395. },
  2396. /* ---- card 0x87---------------------------------- */
  2397. [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {
  2398. /* Michael Krufky <mkrufky@m1k.net> */
  2399. .name = "DViCO FusionHDTV 5 Lite",
  2400. .tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */
  2401. .tuner_addr = ADDR_UNSET,
  2402. .video_inputs = 3,
  2403. /* .audio_inputs= 1, */
  2404. .svhs = 2,
  2405. .muxsel = MUXSEL(2, 3, 1),
  2406. .gpiomask = 0x00e00007,
  2407. .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
  2408. .gpiomute = 0x00c00007,
  2409. .no_msp34xx = 1,
  2410. .no_tda7432 = 1,
  2411. .has_dvb = 1,
  2412. },
  2413. /* ---- card 0x88---------------------------------- */
  2414. [BTTV_BOARD_ACORP_Y878F] = {
  2415. /* Mauro Carvalho Chehab <mchehab@infradead.org> */
  2416. .name = "Acorp Y878F",
  2417. .video_inputs = 3,
  2418. /* .audio_inputs= 1, */
  2419. .svhs = 2,
  2420. .gpiomask = 0x01fe00,
  2421. .muxsel = MUXSEL(2, 3, 1, 1),
  2422. .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
  2423. .gpiomute = 0x002000,
  2424. .needs_tvaudio = 1,
  2425. .pll = PLL_28,
  2426. .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
  2427. .tuner_addr = 0xc1 >>1,
  2428. .has_radio = 1,
  2429. },
  2430. /* ---- card 0x89 ---------------------------------- */
  2431. [BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = {
  2432. .name = "Conceptronic CTVFMi v2",
  2433. .video_inputs = 3,
  2434. /* .audio_inputs= 1, */
  2435. .svhs = 2,
  2436. .gpiomask = 0x001c0007,
  2437. .muxsel = MUXSEL(2, 3, 1, 1),
  2438. .gpiomux = { 0, 1, 2, 2 },
  2439. .gpiomute = 3,
  2440. .needs_tvaudio = 0,
  2441. .pll = PLL_28,
  2442. .tuner_type = TUNER_TENA_9533_DI,
  2443. .tuner_addr = ADDR_UNSET,
  2444. .has_remote = 1,
  2445. .has_radio = 1,
  2446. },
  2447. /* ---- card 0x8a ---------------------------------- */
  2448. [BTTV_BOARD_PV_BT878P_2E] = {
  2449. .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)",
  2450. .video_inputs = 5,
  2451. /* .audio_inputs= 1, */
  2452. .svhs = 3,
  2453. .has_dig_in = 1,
  2454. .gpiomask = 0x01fe00,
  2455. .muxsel = MUXSEL(2, 3, 1, 1, 0), /* in 4 is digital */
  2456. /* .digital_mode= DIGITAL_MODE_CAMERA, */
  2457. .gpiomux = { 0x00400, 0x10400, 0x04400, 0x80000 },
  2458. .gpiomute = 0x12400,
  2459. .no_msp34xx = 1,
  2460. .pll = PLL_28,
  2461. .tuner_type = TUNER_LG_PAL_FM,
  2462. .tuner_addr = ADDR_UNSET,
  2463. .has_remote = 1,
  2464. },
  2465. /* ---- card 0x8b ---------------------------------- */
  2466. [BTTV_BOARD_PV_M4900] = {
  2467. /* Sérgio Fortier <sergiofortier@yahoo.com.br> */
  2468. .name = "Prolink PixelView PlayTV MPEG2 PV-M4900",
  2469. .video_inputs = 3,
  2470. /* .audio_inputs= 1, */
  2471. .svhs = 2,
  2472. .gpiomask = 0x3f,
  2473. .muxsel = MUXSEL(2, 3, 1, 1),
  2474. .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
  2475. .gpiomute = 0x29,
  2476. .no_msp34xx = 1,
  2477. .pll = PLL_28,
  2478. .tuner_type = TUNER_YMEC_TVF_5533MF,
  2479. .tuner_addr = ADDR_UNSET,
  2480. .has_radio = 1,
  2481. .has_remote = 1,
  2482. },
  2483. /* ---- card 0x8c ---------------------------------- */
  2484. /* Has four Bt878 chips behind a PCI bridge, each chip has:
  2485. one external BNC composite input (mux 2)
  2486. three internal composite inputs (unknown muxes)
  2487. an 18-bit stereo A/D (CS5331A), which has:
  2488. one external stereo unblanced (RCA) audio connection
  2489. one (or 3?) internal stereo balanced (XLR) audio connection
  2490. input is selected via gpio to a 14052B mux
  2491. (mask=0x300, unbal=0x000, bal=0x100, ??=0x200,0x300)
  2492. gain is controlled via an X9221A chip on the I2C bus @0x28
  2493. sample rate is controlled via gpio to an MK1413S
  2494. (mask=0x3, 32kHz=0x0, 44.1kHz=0x1, 48kHz=0x2, ??=0x3)
  2495. There is neither a tuner nor an svideo input. */
  2496. [BTTV_BOARD_OSPREY440] = {
  2497. .name = "Osprey 440",
  2498. .video_inputs = 4,
  2499. /* .audio_inputs= 2, */
  2500. .svhs = NO_SVHS,
  2501. .muxsel = MUXSEL(2, 3, 0, 1), /* 3,0,1 are guesses */
  2502. .gpiomask = 0x303,
  2503. .gpiomute = 0x000, /* int + 32kHz */
  2504. .gpiomux = { 0, 0, 0x000, 0x100},
  2505. .pll = PLL_28,
  2506. .tuner_type = TUNER_ABSENT,
  2507. .tuner_addr = ADDR_UNSET,
  2508. .no_msp34xx = 1,
  2509. .no_tda7432 = 1,
  2510. },
  2511. /* ---- card 0x8d ---------------------------------- */
  2512. [BTTV_BOARD_ASOUND_SKYEYE] = {
  2513. .name = "Asound Skyeye PCTV",
  2514. .video_inputs = 3,
  2515. /* .audio_inputs= 1, */
  2516. .svhs = 2,
  2517. .gpiomask = 15,
  2518. .muxsel = MUXSEL(2, 3, 1, 1),
  2519. .gpiomux = { 2, 0, 0, 0 },
  2520. .gpiomute = 1,
  2521. .needs_tvaudio = 1,
  2522. .pll = PLL_28,
  2523. .tuner_type = TUNER_PHILIPS_NTSC,
  2524. .tuner_addr = ADDR_UNSET,
  2525. },
  2526. /* ---- card 0x8e ---------------------------------- */
  2527. [BTTV_BOARD_SABRENT_TVFM] = {
  2528. .name = "Sabrent TV-FM (bttv version)",
  2529. .video_inputs = 3,
  2530. /* .audio_inputs= 1, */
  2531. .svhs = 2,
  2532. .gpiomask = 0x108007,
  2533. .muxsel = MUXSEL(2, 3, 1, 1),
  2534. .gpiomux = { 100000, 100002, 100002, 100000 },
  2535. .no_msp34xx = 1,
  2536. .no_tda7432 = 1,
  2537. .pll = PLL_28,
  2538. .tuner_type = TUNER_TNF_5335MF,
  2539. .tuner_addr = ADDR_UNSET,
  2540. .has_radio = 1,
  2541. },
  2542. /* ---- card 0x8f ---------------------------------- */
  2543. [BTTV_BOARD_HAUPPAUGE_IMPACTVCB] = {
  2544. .name = "Hauppauge ImpactVCB (bt878)",
  2545. .video_inputs = 4,
  2546. /* .audio_inputs= 0, */
  2547. .svhs = NO_SVHS,
  2548. .gpiomask = 0x0f, /* old: 7 */
  2549. .muxsel = MUXSEL(0, 1, 3, 2), /* Composite 0-3 */
  2550. .no_msp34xx = 1,
  2551. .no_tda7432 = 1,
  2552. .tuner_type = TUNER_ABSENT,
  2553. .tuner_addr = ADDR_UNSET,
  2554. },
  2555. [BTTV_BOARD_MACHTV_MAGICTV] = {
  2556. /* Julian Calaby <julian.calaby@gmail.com>
  2557. * Slightly different from original MachTV definition (0x60)
  2558. * FIXME: RegSpy says gpiomask should be "0x001c800f", but it
  2559. * stuffs up remote chip. Bug is a pin on the jaecs is not set
  2560. * properly (methinks) causing no keyup bits being set */
  2561. .name = "MagicTV", /* rebranded MachTV */
  2562. .video_inputs = 3,
  2563. /* .audio_inputs= 1, */
  2564. .svhs = 2,
  2565. .gpiomask = 7,
  2566. .muxsel = MUXSEL(2, 3, 1, 1),
  2567. .gpiomux = { 0, 1, 2, 3 },
  2568. .gpiomute = 4,
  2569. .tuner_type = TUNER_TEMIC_4009FR5_PAL,
  2570. .tuner_addr = ADDR_UNSET,
  2571. .pll = PLL_28,
  2572. .has_radio = 1,
  2573. .has_remote = 1,
  2574. },
  2575. [BTTV_BOARD_SSAI_SECURITY] = {
  2576. .name = "SSAI Security Video Interface",
  2577. .video_inputs = 4,
  2578. /* .audio_inputs= 0, */
  2579. .svhs = NO_SVHS,
  2580. .muxsel = MUXSEL(0, 1, 2, 3),
  2581. .tuner_type = TUNER_ABSENT,
  2582. .tuner_addr = ADDR_UNSET,
  2583. },
  2584. [BTTV_BOARD_SSAI_ULTRASOUND] = {
  2585. .name = "SSAI Ultrasound Video Interface",
  2586. .video_inputs = 2,
  2587. /* .audio_inputs= 0, */
  2588. .svhs = 1,
  2589. .muxsel = MUXSEL(2, 0, 1, 3),
  2590. .tuner_type = TUNER_ABSENT,
  2591. .tuner_addr = ADDR_UNSET,
  2592. },
  2593. /* ---- card 0x94---------------------------------- */
  2594. [BTTV_BOARD_DVICO_FUSIONHDTV_2] = {
  2595. .name = "DViCO FusionHDTV 2",
  2596. .tuner_type = TUNER_PHILIPS_FCV1236D,
  2597. .tuner_addr = ADDR_UNSET,
  2598. .video_inputs = 3,
  2599. /* .audio_inputs= 1, */
  2600. .svhs = 2,
  2601. .muxsel = MUXSEL(2, 3, 1),
  2602. .gpiomask = 0x00e00007,
  2603. .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
  2604. .gpiomute = 0x00c00007,
  2605. .no_msp34xx = 1,
  2606. .no_tda7432 = 1,
  2607. },
  2608. /* ---- card 0x95---------------------------------- */
  2609. [BTTV_BOARD_TYPHOON_TVTUNERPCI] = {
  2610. .name = "Typhoon TV-Tuner PCI (50684)",
  2611. .video_inputs = 3,
  2612. /* .audio_inputs= 1, */
  2613. .svhs = 2,
  2614. .gpiomask = 0x3014f,
  2615. .muxsel = MUXSEL(2, 3, 1, 1),
  2616. .gpiomux = { 0x20001,0x10001, 0, 0 },
  2617. .gpiomute = 10,
  2618. .needs_tvaudio = 1,
  2619. .pll = PLL_28,
  2620. .tuner_type = TUNER_PHILIPS_PAL_I,
  2621. .tuner_addr = ADDR_UNSET,
  2622. },
  2623. [BTTV_BOARD_GEOVISION_GV600] = {
  2624. /* emhn@usb.ve */
  2625. .name = "Geovision GV-600",
  2626. .video_inputs = 16,
  2627. /* .audio_inputs= 0, */
  2628. .svhs = NO_SVHS,
  2629. .gpiomask = 0x0,
  2630. .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2),
  2631. .muxsel_hook = geovision_muxsel,
  2632. .gpiomux = { 0 },
  2633. .no_msp34xx = 1,
  2634. .pll = PLL_28,
  2635. .tuner_type = TUNER_ABSENT,
  2636. .tuner_addr = ADDR_UNSET,
  2637. },
  2638. [BTTV_BOARD_KOZUMI_KTV_01C] = {
  2639. /* Mauro Lacy <mauro@lacy.com.ar>
  2640. * Based on MagicTV and Conceptronic CONTVFMi */
  2641. .name = "Kozumi KTV-01C",
  2642. .video_inputs = 3,
  2643. /* .audio_inputs= 1, */
  2644. .svhs = 2,
  2645. .gpiomask = 0x008007,
  2646. .muxsel = MUXSEL(2, 3, 1, 1),
  2647. .gpiomux = { 0, 1, 2, 2 }, /* CONTVFMi */
  2648. .gpiomute = 3, /* CONTVFMi */
  2649. .needs_tvaudio = 0,
  2650. .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, /* TCL MK3 */
  2651. .tuner_addr = ADDR_UNSET,
  2652. .pll = PLL_28,
  2653. .has_radio = 1,
  2654. .has_remote = 1,
  2655. },
  2656. [BTTV_BOARD_ENLTV_FM_2] = {
  2657. /* Encore TV Tuner Pro ENL TV-FM-2
  2658. Mauro Carvalho Chehab <mchehab@infradead.org */
  2659. .name = "Encore ENL TV-FM-2",
  2660. .video_inputs = 3,
  2661. /* .audio_inputs= 1, */
  2662. .svhs = 2,
  2663. /* bit 6 -> IR disabled
  2664. bit 18/17 = 00 -> mute
  2665. 01 -> enable external audio input
  2666. 10 -> internal audio input (mono?)
  2667. 11 -> internal audio input
  2668. */
  2669. .gpiomask = 0x060040,
  2670. .muxsel = MUXSEL(2, 3, 3),
  2671. .gpiomux = { 0x60000, 0x60000, 0x20000, 0x20000 },
  2672. .gpiomute = 0,
  2673. .tuner_type = TUNER_TCL_MF02GIP_5N,
  2674. .tuner_addr = ADDR_UNSET,
  2675. .pll = PLL_28,
  2676. .has_radio = 1,
  2677. .has_remote = 1,
  2678. },
  2679. [BTTV_BOARD_VD012] = {
  2680. /* D.Heer@Phytec.de */
  2681. .name = "PHYTEC VD-012 (bt878)",
  2682. .video_inputs = 4,
  2683. /* .audio_inputs= 0, */
  2684. .svhs = NO_SVHS,
  2685. .gpiomask = 0x00,
  2686. .muxsel = MUXSEL(0, 2, 3, 1),
  2687. .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
  2688. .needs_tvaudio = 0,
  2689. .pll = PLL_28,
  2690. .tuner_type = TUNER_ABSENT,
  2691. .tuner_addr = ADDR_UNSET,
  2692. },
  2693. [BTTV_BOARD_VD012_X1] = {
  2694. /* D.Heer@Phytec.de */
  2695. .name = "PHYTEC VD-012-X1 (bt878)",
  2696. .video_inputs = 4,
  2697. /* .audio_inputs= 0, */
  2698. .svhs = 3,
  2699. .gpiomask = 0x00,
  2700. .muxsel = MUXSEL(2, 3, 1),
  2701. .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
  2702. .needs_tvaudio = 0,
  2703. .pll = PLL_28,
  2704. .tuner_type = TUNER_ABSENT,
  2705. .tuner_addr = ADDR_UNSET,
  2706. },
  2707. [BTTV_BOARD_VD012_X2] = {
  2708. /* D.Heer@Phytec.de */
  2709. .name = "PHYTEC VD-012-X2 (bt878)",
  2710. .video_inputs = 4,
  2711. /* .audio_inputs= 0, */
  2712. .svhs = 3,
  2713. .gpiomask = 0x00,
  2714. .muxsel = MUXSEL(3, 2, 1),
  2715. .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
  2716. .needs_tvaudio = 0,
  2717. .pll = PLL_28,
  2718. .tuner_type = TUNER_ABSENT,
  2719. .tuner_addr = ADDR_UNSET,
  2720. },
  2721. [BTTV_BOARD_GEOVISION_GV800S] = {
  2722. /* Bruno Christo <bchristo@inf.ufsm.br>
  2723. *
  2724. * GeoVision GV-800(S) has 4 Conexant Fusion 878A:
  2725. * 1 audio input per BT878A = 4 audio inputs
  2726. * 4 video inputs per BT878A = 16 video inputs
  2727. * This is the first BT878A chip of the GV-800(S). It's the
  2728. * "master" chip and it controls the video inputs through an
  2729. * analog multiplexer (a CD22M3494) via some GPIO pins. The
  2730. * slaves should use card type 0x9e (following this one).
  2731. * There is a EEPROM on the card which is currently not handled.
  2732. * The audio input is not working yet.
  2733. */
  2734. .name = "Geovision GV-800(S) (master)",
  2735. .video_inputs = 4,
  2736. /* .audio_inputs= 1, */
  2737. .tuner_type = TUNER_ABSENT,
  2738. .tuner_addr = ADDR_UNSET,
  2739. .svhs = NO_SVHS,
  2740. .gpiomask = 0xf107f,
  2741. .no_gpioirq = 1,
  2742. .muxsel = MUXSEL(2, 2, 2, 2),
  2743. .pll = PLL_28,
  2744. .no_msp34xx = 1,
  2745. .no_tda7432 = 1,
  2746. .muxsel_hook = gv800s_muxsel,
  2747. },
  2748. [BTTV_BOARD_GEOVISION_GV800S_SL] = {
  2749. /* Bruno Christo <bchristo@inf.ufsm.br>
  2750. *
  2751. * GeoVision GV-800(S) has 4 Conexant Fusion 878A:
  2752. * 1 audio input per BT878A = 4 audio inputs
  2753. * 4 video inputs per BT878A = 16 video inputs
  2754. * The 3 other BT878A chips are "slave" chips of the GV-800(S)
  2755. * and should use this card type.
  2756. * The audio input is not working yet.
  2757. */
  2758. .name = "Geovision GV-800(S) (slave)",
  2759. .video_inputs = 4,
  2760. /* .audio_inputs= 1, */
  2761. .tuner_type = TUNER_ABSENT,
  2762. .tuner_addr = ADDR_UNSET,
  2763. .svhs = NO_SVHS,
  2764. .gpiomask = 0x00,
  2765. .no_gpioirq = 1,
  2766. .muxsel = MUXSEL(2, 2, 2, 2),
  2767. .pll = PLL_28,
  2768. .no_msp34xx = 1,
  2769. .no_tda7432 = 1,
  2770. .muxsel_hook = gv800s_muxsel,
  2771. },
  2772. [BTTV_BOARD_PV183] = {
  2773. .name = "ProVideo PV183", /* 0x9f */
  2774. .video_inputs = 2,
  2775. /* .audio_inputs= 0, */
  2776. .svhs = NO_SVHS,
  2777. .gpiomask = 0,
  2778. .muxsel = MUXSEL(2, 3),
  2779. .gpiomux = { 0 },
  2780. .needs_tvaudio = 0,
  2781. .no_msp34xx = 1,
  2782. .pll = PLL_28,
  2783. .tuner_type = TUNER_ABSENT,
  2784. .tuner_addr = ADDR_UNSET,
  2785. },
  2786. };
  2787. static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
  2788. /* ----------------------------------------------------------------------- */
  2789. static unsigned char eeprom_data[256];
  2790. /*
  2791. * identify card
  2792. */
  2793. void __devinit bttv_idcard(struct bttv *btv)
  2794. {
  2795. unsigned int gpiobits;
  2796. int i,type;
  2797. unsigned short tmp;
  2798. /* read PCI subsystem ID */
  2799. pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp);
  2800. btv->cardid = tmp << 16;
  2801. pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp);
  2802. btv->cardid |= tmp;
  2803. if (0 != btv->cardid && 0xffffffff != btv->cardid) {
  2804. /* look for the card */
  2805. for (type = -1, i = 0; cards[i].id != 0; i++)
  2806. if (cards[i].id == btv->cardid)
  2807. type = i;
  2808. if (type != -1) {
  2809. /* found it */
  2810. printk(KERN_INFO "bttv%d: detected: %s [card=%d], "
  2811. "PCI subsystem ID is %04x:%04x\n",
  2812. btv->c.nr,cards[type].name,cards[type].cardnr,
  2813. btv->cardid & 0xffff,
  2814. (btv->cardid >> 16) & 0xffff);
  2815. btv->c.type = cards[type].cardnr;
  2816. } else {
  2817. /* 404 */
  2818. printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",
  2819. btv->c.nr, btv->cardid & 0xffff,
  2820. (btv->cardid >> 16) & 0xffff);
  2821. printk(KERN_DEBUG "please mail id, board name and "
  2822. "the correct card= insmod option to linux-media@vger.kernel.org\n");
  2823. }
  2824. }
  2825. /* let the user override the autodetected type */
  2826. if (card[btv->c.nr] < bttv_num_tvcards)
  2827. btv->c.type=card[btv->c.nr];
  2828. /* print which card config we are using */
  2829. printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr,
  2830. bttv_tvcards[btv->c.type].name, btv->c.type,
  2831. card[btv->c.nr] < bttv_num_tvcards
  2832. ? "insmod option" : "autodetected");
  2833. /* overwrite gpio stuff ?? */
  2834. if (UNSET == audioall && UNSET == audiomux[0])
  2835. return;
  2836. if (UNSET != audiomux[0]) {
  2837. gpiobits = 0;
  2838. for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
  2839. bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i];
  2840. gpiobits |= audiomux[i];
  2841. }
  2842. } else {
  2843. gpiobits = audioall;
  2844. for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
  2845. bttv_tvcards[btv->c.type].gpiomux[i] = audioall;
  2846. }
  2847. }
  2848. bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
  2849. printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
  2850. btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
  2851. for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
  2852. printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);
  2853. }
  2854. printk("\n");
  2855. }
  2856. /*
  2857. * (most) board specific initialisations goes here
  2858. */
  2859. /* Some Modular Technology cards have an eeprom, but no subsystem ID */
  2860. static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
  2861. {
  2862. int type = -1;
  2863. if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
  2864. type = BTTV_BOARD_MODTEC_205;
  2865. else if (0 == strncmp(eeprom_data+20,"Picolo",7))
  2866. type = BTTV_BOARD_EURESYS_PICOLO;
  2867. else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
  2868. type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */
  2869. if (-1 != type) {
  2870. btv->c.type = type;
  2871. printk("bttv%d: detected by eeprom: %s [card=%d]\n",
  2872. btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
  2873. }
  2874. }
  2875. static void flyvideo_gpio(struct bttv *btv)
  2876. {
  2877. int gpio, has_remote, has_radio, is_capture_only;
  2878. int is_lr90, has_tda9820_tda9821;
  2879. int tuner_type = UNSET, ttype;
  2880. gpio_inout(0xffffff, 0);
  2881. udelay(8); /* without this we would see the 0x1800 mask */
  2882. gpio = gpio_read();
  2883. /* FIXME: must restore OUR_EN ??? */
  2884. /* all cards provide GPIO info, some have an additional eeprom
  2885. * LR50: GPIO coding can be found lower right CP1 .. CP9
  2886. * CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
  2887. * GPIO14-12: n.c.
  2888. * LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
  2889. * lowest 3 bytes are remote control codes (no handshake needed)
  2890. * xxxFFF: No remote control chip soldered
  2891. * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
  2892. * Note: Some bits are Audio_Mask !
  2893. */
  2894. ttype = (gpio & 0x0f0000) >> 16;
  2895. switch (ttype) {
  2896. case 0x0:
  2897. tuner_type = 2; /* NTSC, e.g. TPI8NSR11P */
  2898. break;
  2899. case 0x2:
  2900. tuner_type = 39; /* LG NTSC (newer TAPC series) TAPC-H701P */
  2901. break;
  2902. case 0x4:
  2903. tuner_type = 5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
  2904. break;
  2905. case 0x6:
  2906. tuner_type = 37; /* LG PAL (newer TAPC series) TAPC-G702P */
  2907. break;
  2908. case 0xC:
  2909. tuner_type = 3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
  2910. break;
  2911. default:
  2912. printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);
  2913. break;
  2914. }
  2915. has_remote = gpio & 0x800000;
  2916. has_radio = gpio & 0x400000;
  2917. /* unknown 0x200000;
  2918. * unknown2 0x100000; */
  2919. is_capture_only = !(gpio & 0x008000); /* GPIO15 */
  2920. has_tda9820_tda9821 = !(gpio & 0x004000);
  2921. is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
  2922. /*
  2923. * gpio & 0x001000 output bit for audio routing */
  2924. if (is_capture_only)
  2925. tuner_type = TUNER_ABSENT; /* No tuner present */
  2926. printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
  2927. btv->c.nr, has_radio ? "yes" : "no ",
  2928. has_remote ? "yes" : "no ", tuner_type, gpio);
  2929. printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
  2930. btv->c.nr, is_lr90 ? "yes" : "no ",
  2931. has_tda9820_tda9821 ? "yes" : "no ",
  2932. is_capture_only ? "yes" : "no ");
  2933. if (tuner_type != UNSET) /* only set if known tuner autodetected, else let insmod option through */
  2934. btv->tuner_type = tuner_type;
  2935. btv->has_radio = has_radio;
  2936. /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
  2937. * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
  2938. * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
  2939. if (has_tda9820_tda9821)
  2940. btv->audio_mode_gpio = lt9415_audio;
  2941. /* todo: if(has_tda9874) btv->audio_mode_gpio = fv2000s_audio; */
  2942. }
  2943. static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
  2944. 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
  2945. static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
  2946. 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
  2947. static void miro_pinnacle_gpio(struct bttv *btv)
  2948. {
  2949. int id,msp,gpio;
  2950. char *info;
  2951. gpio_inout(0xffffff, 0);
  2952. gpio = gpio_read();
  2953. id = ((gpio>>10) & 63) -1;
  2954. msp = bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx");
  2955. if (id < 32) {
  2956. btv->tuner_type = miro_tunermap[id];
  2957. if (0 == (gpio & 0x20)) {
  2958. btv->has_radio = 1;
  2959. if (!miro_fmtuner[id]) {
  2960. btv->has_matchbox = 1;
  2961. btv->mbox_we = (1<<6);
  2962. btv->mbox_most = (1<<7);
  2963. btv->mbox_clk = (1<<8);
  2964. btv->mbox_data = (1<<9);
  2965. btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9);
  2966. }
  2967. } else {
  2968. btv->has_radio = 0;
  2969. }
  2970. if (-1 != msp) {
  2971. if (btv->c.type == BTTV_BOARD_MIRO)
  2972. btv->c.type = BTTV_BOARD_MIROPRO;
  2973. if (btv->c.type == BTTV_BOARD_PINNACLE)
  2974. btv->c.type = BTTV_BOARD_PINNACLEPRO;
  2975. }
  2976. printk(KERN_INFO
  2977. "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
  2978. btv->c.nr, id+1, btv->tuner_type,
  2979. !btv->has_radio ? "no" :
  2980. (btv->has_matchbox ? "matchbox" : "fmtuner"),
  2981. (-1 == msp) ? "no" : "yes");
  2982. } else {
  2983. /* new cards with microtune tuner */
  2984. id = 63 - id;
  2985. btv->has_radio = 0;
  2986. switch (id) {
  2987. case 1:
  2988. info = "PAL / mono";
  2989. btv->tda9887_conf = TDA9887_INTERCARRIER;
  2990. break;
  2991. case 2:
  2992. info = "PAL+SECAM / stereo";
  2993. btv->has_radio = 1;
  2994. btv->tda9887_conf = TDA9887_QSS;
  2995. break;
  2996. case 3:
  2997. info = "NTSC / stereo";
  2998. btv->has_radio = 1;
  2999. btv->tda9887_conf = TDA9887_QSS;
  3000. break;
  3001. case 4:
  3002. info = "PAL+SECAM / mono";
  3003. btv->tda9887_conf = TDA9887_QSS;
  3004. break;
  3005. case 5:
  3006. info = "NTSC / mono";
  3007. btv->tda9887_conf = TDA9887_INTERCARRIER;
  3008. break;
  3009. case 6:
  3010. info = "NTSC / stereo";
  3011. btv->tda9887_conf = TDA9887_INTERCARRIER;
  3012. break;
  3013. case 7:
  3014. info = "PAL / stereo";
  3015. btv->tda9887_conf = TDA9887_INTERCARRIER;
  3016. break;
  3017. default:
  3018. info = "oops: unknown card";
  3019. break;
  3020. }
  3021. if (-1 != msp)
  3022. btv->c.type = BTTV_BOARD_PINNACLEPRO;
  3023. printk(KERN_INFO
  3024. "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
  3025. btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
  3026. btv->tuner_type = TUNER_MT2032;
  3027. }
  3028. }
  3029. /* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
  3030. #define LM1882_SYNC_DRIVE 0x200000L
  3031. static void init_ids_eagle(struct bttv *btv)
  3032. {
  3033. gpio_inout(0xffffff,0xFFFF37);
  3034. gpio_write(0x200020);
  3035. /* flash strobe inverter ?! */
  3036. gpio_write(0x200024);
  3037. /* switch sync drive off */
  3038. gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
  3039. /* set BT848 muxel to 2 */
  3040. btaor((2)<<5, ~(2<<5), BT848_IFORM);
  3041. }
  3042. /* Muxsel helper for the IDS Eagle.
  3043. * the eagles does not use the standard muxsel-bits but
  3044. * has its own multiplexer */
  3045. static void eagle_muxsel(struct bttv *btv, unsigned int input)
  3046. {
  3047. gpio_bits(3, input & 3);
  3048. /* composite */
  3049. /* set chroma ADC to sleep */
  3050. btor(BT848_ADC_C_SLEEP, BT848_ADC);
  3051. /* set to composite video */
  3052. btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
  3053. btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
  3054. /* switch sync drive off */
  3055. gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
  3056. }
  3057. static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
  3058. {
  3059. static const int masks[] = {0x30, 0x01, 0x12, 0x23};
  3060. gpio_write(masks[input%4]);
  3061. }
  3062. /* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
  3063. alarms output
  3064. GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  3065. assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
  3066. IN - sensor inputs, INx - sensor inputs and TI XORed together
  3067. O1,O2,O3 - alarm outputs (relays)
  3068. OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
  3069. */
  3070. static void init_lmlbt4x(struct bttv *btv)
  3071. {
  3072. printk(KERN_DEBUG "LMLBT4x init\n");
  3073. btwrite(0x000000, BT848_GPIO_REG_INP);
  3074. gpio_inout(0xffffff, 0x0006C0);
  3075. gpio_write(0x000000);
  3076. }
  3077. static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
  3078. {
  3079. unsigned int inmux = input % 8;
  3080. gpio_inout( 0xf, 0xf );
  3081. gpio_bits( 0xf, inmux );
  3082. }
  3083. static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
  3084. {
  3085. unsigned int inmux = input % 4;
  3086. gpio_inout( 3<<9, 3<<9 );
  3087. gpio_bits( 3<<9, inmux<<9 );
  3088. }
  3089. static void geovision_muxsel(struct bttv *btv, unsigned int input)
  3090. {
  3091. unsigned int inmux = input % 16;
  3092. gpio_inout(0xf, 0xf);
  3093. gpio_bits(0xf, inmux);
  3094. }
  3095. /* ----------------------------------------------------------------------- */
  3096. static void bttv_reset_audio(struct bttv *btv)
  3097. {
  3098. /*
  3099. * BT878A has a audio-reset register.
  3100. * 1. This register is an audio reset function but it is in
  3101. * function-0 (video capture) address space.
  3102. * 2. It is enough to do this once per power-up of the card.
  3103. * 3. There is a typo in the Conexant doc -- it is not at
  3104. * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
  3105. * --//Shrikumar 030609
  3106. */
  3107. if (btv->id != 878)
  3108. return;
  3109. if (bttv_debug)
  3110. printk("bttv%d: BT878A ARESET\n",btv->c.nr);
  3111. btwrite((1<<7), 0x058);
  3112. udelay(10);
  3113. btwrite( 0, 0x058);
  3114. }
  3115. /* initialization part one -- before registering i2c bus */
  3116. void __devinit bttv_init_card1(struct bttv *btv)
  3117. {
  3118. switch (btv->c.type) {
  3119. case BTTV_BOARD_HAUPPAUGE:
  3120. case BTTV_BOARD_HAUPPAUGE878:
  3121. boot_msp34xx(btv,5);
  3122. break;
  3123. case BTTV_BOARD_VOODOOTV_200:
  3124. case BTTV_BOARD_VOODOOTV_FM:
  3125. boot_msp34xx(btv,20);
  3126. break;
  3127. case BTTV_BOARD_AVERMEDIA98:
  3128. boot_msp34xx(btv,11);
  3129. break;
  3130. case BTTV_BOARD_HAUPPAUGEPVR:
  3131. pvr_boot(btv);
  3132. break;
  3133. case BTTV_BOARD_TWINHAN_DST:
  3134. case BTTV_BOARD_AVDVBT_771:
  3135. case BTTV_BOARD_PINNACLESAT:
  3136. btv->use_i2c_hw = 1;
  3137. break;
  3138. case BTTV_BOARD_ADLINK_RTV24:
  3139. init_RTV24( btv );
  3140. break;
  3141. }
  3142. if (!bttv_tvcards[btv->c.type].has_dvb)
  3143. bttv_reset_audio(btv);
  3144. }
  3145. /* initialization part two -- after registering i2c bus */
  3146. void __devinit bttv_init_card2(struct bttv *btv)
  3147. {
  3148. btv->tuner_type = UNSET;
  3149. if (BTTV_BOARD_UNKNOWN == btv->c.type) {
  3150. bttv_readee(btv,eeprom_data,0xa0);
  3151. identify_by_eeprom(btv,eeprom_data);
  3152. }
  3153. switch (btv->c.type) {
  3154. case BTTV_BOARD_MIRO:
  3155. case BTTV_BOARD_MIROPRO:
  3156. case BTTV_BOARD_PINNACLE:
  3157. case BTTV_BOARD_PINNACLEPRO:
  3158. /* miro/pinnacle */
  3159. miro_pinnacle_gpio(btv);
  3160. break;
  3161. case BTTV_BOARD_FLYVIDEO_98:
  3162. case BTTV_BOARD_MAXI:
  3163. case BTTV_BOARD_LIFE_FLYKIT:
  3164. case BTTV_BOARD_FLYVIDEO:
  3165. case BTTV_BOARD_TYPHOON_TVIEW:
  3166. case BTTV_BOARD_CHRONOS_VS2:
  3167. case BTTV_BOARD_FLYVIDEO_98FM:
  3168. case BTTV_BOARD_FLYVIDEO2000:
  3169. case BTTV_BOARD_FLYVIDEO98EZ:
  3170. case BTTV_BOARD_CONFERENCETV:
  3171. case BTTV_BOARD_LIFETEC_9415:
  3172. flyvideo_gpio(btv);
  3173. break;
  3174. case BTTV_BOARD_HAUPPAUGE:
  3175. case BTTV_BOARD_HAUPPAUGE878:
  3176. case BTTV_BOARD_HAUPPAUGEPVR:
  3177. /* pick up some config infos from the eeprom */
  3178. bttv_readee(btv,eeprom_data,0xa0);
  3179. hauppauge_eeprom(btv);
  3180. break;
  3181. case BTTV_BOARD_AVERMEDIA98:
  3182. case BTTV_BOARD_AVPHONE98:
  3183. bttv_readee(btv,eeprom_data,0xa0);
  3184. avermedia_eeprom(btv);
  3185. break;
  3186. case BTTV_BOARD_PXC200:
  3187. init_PXC200(btv);
  3188. break;
  3189. case BTTV_BOARD_PICOLO_TETRA_CHIP:
  3190. picolo_tetra_init(btv);
  3191. break;
  3192. case BTTV_BOARD_VHX:
  3193. btv->has_radio = 1;
  3194. btv->has_matchbox = 1;
  3195. btv->mbox_we = 0x20;
  3196. btv->mbox_most = 0;
  3197. btv->mbox_clk = 0x08;
  3198. btv->mbox_data = 0x10;
  3199. btv->mbox_mask = 0x38;
  3200. break;
  3201. case BTTV_BOARD_VOBIS_BOOSTAR:
  3202. case BTTV_BOARD_TERRATV:
  3203. terratec_active_radio_upgrade(btv);
  3204. break;
  3205. case BTTV_BOARD_MAGICTVIEW061:
  3206. if (btv->cardid == 0x3002144f) {
  3207. btv->has_radio=1;
  3208. printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr);
  3209. }
  3210. break;
  3211. case BTTV_BOARD_STB2:
  3212. if (btv->cardid == 0x3060121a) {
  3213. /* Fix up entry for 3DFX VoodooTV 100,
  3214. which is an OEM STB card variant. */
  3215. btv->has_radio=0;
  3216. btv->tuner_type=TUNER_TEMIC_NTSC;
  3217. }
  3218. break;
  3219. case BTTV_BOARD_OSPREY1x0:
  3220. case BTTV_BOARD_OSPREY1x0_848:
  3221. case BTTV_BOARD_OSPREY101_848:
  3222. case BTTV_BOARD_OSPREY1x1:
  3223. case BTTV_BOARD_OSPREY1x1_SVID:
  3224. case BTTV_BOARD_OSPREY2xx:
  3225. case BTTV_BOARD_OSPREY2x0_SVID:
  3226. case BTTV_BOARD_OSPREY2x0:
  3227. case BTTV_BOARD_OSPREY440:
  3228. case BTTV_BOARD_OSPREY500:
  3229. case BTTV_BOARD_OSPREY540:
  3230. case BTTV_BOARD_OSPREY2000:
  3231. bttv_readee(btv,eeprom_data,0xa0);
  3232. osprey_eeprom(btv, eeprom_data);
  3233. break;
  3234. case BTTV_BOARD_IDS_EAGLE:
  3235. init_ids_eagle(btv);
  3236. break;
  3237. case BTTV_BOARD_MODTEC_205:
  3238. bttv_readee(btv,eeprom_data,0xa0);
  3239. modtec_eeprom(btv);
  3240. break;
  3241. case BTTV_BOARD_LMLBT4:
  3242. init_lmlbt4x(btv);
  3243. break;
  3244. case BTTV_BOARD_TIBET_CS16:
  3245. tibetCS16_init(btv);
  3246. break;
  3247. case BTTV_BOARD_KODICOM_4400R:
  3248. kodicom4400r_init(btv);
  3249. break;
  3250. case BTTV_BOARD_GEOVISION_GV800S:
  3251. gv800s_init(btv);
  3252. break;
  3253. }
  3254. /* pll configuration */
  3255. if (!(btv->id==848 && btv->revision==0x11)) {
  3256. /* defaults from card list */
  3257. if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
  3258. btv->pll.pll_ifreq=28636363;
  3259. btv->pll.pll_crystal=BT848_IFORM_XT0;
  3260. }
  3261. if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
  3262. btv->pll.pll_ifreq=35468950;
  3263. btv->pll.pll_crystal=BT848_IFORM_XT1;
  3264. }
  3265. /* insmod options can override */
  3266. switch (pll[btv->c.nr]) {
  3267. case 0: /* none */
  3268. btv->pll.pll_crystal = 0;
  3269. btv->pll.pll_ifreq = 0;
  3270. btv->pll.pll_ofreq = 0;
  3271. break;
  3272. case 1: /* 28 MHz */
  3273. case 28:
  3274. btv->pll.pll_ifreq = 28636363;
  3275. btv->pll.pll_ofreq = 0;
  3276. btv->pll.pll_crystal = BT848_IFORM_XT0;
  3277. break;
  3278. case 2: /* 35 MHz */
  3279. case 35:
  3280. btv->pll.pll_ifreq = 35468950;
  3281. btv->pll.pll_ofreq = 0;
  3282. btv->pll.pll_crystal = BT848_IFORM_XT1;
  3283. break;
  3284. }
  3285. }
  3286. btv->pll.pll_current = -1;
  3287. /* tuner configuration (from card list / autodetect / insmod option) */
  3288. if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
  3289. if (UNSET == btv->tuner_type)
  3290. btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
  3291. if (UNSET != tuner[btv->c.nr])
  3292. btv->tuner_type = tuner[btv->c.nr];
  3293. if (btv->tuner_type == TUNER_ABSENT)
  3294. printk(KERN_INFO "bttv%d: tuner absent\n", btv->c.nr);
  3295. else if(btv->tuner_type == UNSET)
  3296. printk(KERN_WARNING "bttv%d: tuner type unset\n", btv->c.nr);
  3297. else
  3298. printk(KERN_INFO "bttv%d: tuner type=%d\n", btv->c.nr,
  3299. btv->tuner_type);
  3300. if (autoload != UNSET) {
  3301. printk(KERN_WARNING "bttv%d: the autoload option is obsolete.\n", btv->c.nr);
  3302. printk(KERN_WARNING "bttv%d: use option msp3400, tda7432 or tvaudio to\n", btv->c.nr);
  3303. printk(KERN_WARNING "bttv%d: override which audio module should be used.\n", btv->c.nr);
  3304. }
  3305. if (UNSET == btv->tuner_type)
  3306. btv->tuner_type = TUNER_ABSENT;
  3307. btv->dig = bttv_tvcards[btv->c.type].has_dig_in ?
  3308. bttv_tvcards[btv->c.type].video_inputs - 1 : UNSET;
  3309. btv->svhs = bttv_tvcards[btv->c.type].svhs == NO_SVHS ?
  3310. UNSET : bttv_tvcards[btv->c.type].svhs;
  3311. if (svhs[btv->c.nr] != UNSET)
  3312. btv->svhs = svhs[btv->c.nr];
  3313. if (remote[btv->c.nr] != UNSET)
  3314. btv->has_remote = remote[btv->c.nr];
  3315. if (bttv_tvcards[btv->c.type].has_radio)
  3316. btv->has_radio = 1;
  3317. if (bttv_tvcards[btv->c.type].has_remote)
  3318. btv->has_remote = 1;
  3319. if (!bttv_tvcards[btv->c.type].no_gpioirq)
  3320. btv->gpioirq = 1;
  3321. if (bttv_tvcards[btv->c.type].volume_gpio)
  3322. btv->volume_gpio = bttv_tvcards[btv->c.type].volume_gpio;
  3323. if (bttv_tvcards[btv->c.type].audio_mode_gpio)
  3324. btv->audio_mode_gpio = bttv_tvcards[btv->c.type].audio_mode_gpio;
  3325. if (btv->tuner_type == TUNER_ABSENT)
  3326. return; /* no tuner or related drivers to load */
  3327. if (btv->has_saa6588 || saa6588[btv->c.nr]) {
  3328. /* Probe for RDS receiver chip */
  3329. static const unsigned short addrs[] = {
  3330. 0x20 >> 1,
  3331. 0x22 >> 1,
  3332. I2C_CLIENT_END
  3333. };
  3334. struct v4l2_subdev *sd;
  3335. sd = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
  3336. &btv->c.i2c_adap, "saa6588", 0, addrs);
  3337. btv->has_saa6588 = (sd != NULL);
  3338. }
  3339. /* try to detect audio/fader chips */
  3340. /* First check if the user specified the audio chip via a module
  3341. option. */
  3342. switch (audiodev[btv->c.nr]) {
  3343. case -1:
  3344. return; /* do not load any audio module */
  3345. case 0: /* autodetect */
  3346. break;
  3347. case 1: {
  3348. /* The user specified that we should probe for msp3400 */
  3349. static const unsigned short addrs[] = {
  3350. I2C_ADDR_MSP3400 >> 1,
  3351. I2C_ADDR_MSP3400_ALT >> 1,
  3352. I2C_CLIENT_END
  3353. };
  3354. btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
  3355. &btv->c.i2c_adap, "msp3400", 0, addrs);
  3356. if (btv->sd_msp34xx)
  3357. return;
  3358. goto no_audio;
  3359. }
  3360. case 2: {
  3361. /* The user specified that we should probe for tda7432 */
  3362. static const unsigned short addrs[] = {
  3363. I2C_ADDR_TDA7432 >> 1,
  3364. I2C_CLIENT_END
  3365. };
  3366. if (v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
  3367. &btv->c.i2c_adap, "tda7432", 0, addrs))
  3368. return;
  3369. goto no_audio;
  3370. }
  3371. case 3: {
  3372. /* The user specified that we should probe for tvaudio */
  3373. btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
  3374. &btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs());
  3375. if (btv->sd_tvaudio)
  3376. return;
  3377. goto no_audio;
  3378. }
  3379. default:
  3380. printk(KERN_WARNING "bttv%d: unknown audiodev value!\n",
  3381. btv->c.nr);
  3382. return;
  3383. }
  3384. /* There were no overrides, so now we try to discover this through the
  3385. card definition */
  3386. /* probe for msp3400 first: this driver can detect whether or not
  3387. it really is a msp3400, so it will return NULL when the device
  3388. found is really something else (e.g. a tea6300). */
  3389. if (!bttv_tvcards[btv->c.type].no_msp34xx) {
  3390. btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
  3391. &btv->c.i2c_adap, "msp3400",
  3392. 0, I2C_ADDRS(I2C_ADDR_MSP3400 >> 1));
  3393. } else if (bttv_tvcards[btv->c.type].msp34xx_alt) {
  3394. btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
  3395. &btv->c.i2c_adap, "msp3400",
  3396. 0, I2C_ADDRS(I2C_ADDR_MSP3400_ALT >> 1));
  3397. }
  3398. /* If we found a msp34xx, then we're done. */
  3399. if (btv->sd_msp34xx)
  3400. return;
  3401. /* it might also be a tda7432. */
  3402. if (!bttv_tvcards[btv->c.type].no_tda7432) {
  3403. static const unsigned short addrs[] = {
  3404. I2C_ADDR_TDA7432 >> 1,
  3405. I2C_CLIENT_END
  3406. };
  3407. if (v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
  3408. &btv->c.i2c_adap, "tda7432", 0, addrs))
  3409. return;
  3410. }
  3411. /* Now see if we can find one of the tvaudio devices. */
  3412. btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
  3413. &btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs());
  3414. if (btv->sd_tvaudio)
  3415. return;
  3416. no_audio:
  3417. printk(KERN_WARNING "bttv%d: audio absent, no audio device found!\n",
  3418. btv->c.nr);
  3419. }
  3420. /* initialize the tuner */
  3421. void __devinit bttv_init_tuner(struct bttv *btv)
  3422. {
  3423. int addr = ADDR_UNSET;
  3424. if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
  3425. addr = bttv_tvcards[btv->c.type].tuner_addr;
  3426. if (btv->tuner_type != TUNER_ABSENT) {
  3427. struct tuner_setup tun_setup;
  3428. /* Load tuner module before issuing tuner config call! */
  3429. if (bttv_tvcards[btv->c.type].has_radio)
  3430. v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
  3431. &btv->c.i2c_adap, "tuner",
  3432. 0, v4l2_i2c_tuner_addrs(ADDRS_RADIO));
  3433. v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
  3434. &btv->c.i2c_adap, "tuner",
  3435. 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
  3436. v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
  3437. &btv->c.i2c_adap, "tuner",
  3438. 0, v4l2_i2c_tuner_addrs(ADDRS_TV_WITH_DEMOD));
  3439. tun_setup.mode_mask = T_ANALOG_TV;
  3440. tun_setup.type = btv->tuner_type;
  3441. tun_setup.addr = addr;
  3442. if (bttv_tvcards[btv->c.type].has_radio)
  3443. tun_setup.mode_mask |= T_RADIO;
  3444. bttv_call_all(btv, tuner, s_type_addr, &tun_setup);
  3445. }
  3446. if (btv->tda9887_conf) {
  3447. struct v4l2_priv_tun_config tda9887_cfg;
  3448. tda9887_cfg.tuner = TUNER_TDA9887;
  3449. tda9887_cfg.priv = &btv->tda9887_conf;
  3450. bttv_call_all(btv, tuner, s_config, &tda9887_cfg);
  3451. }
  3452. }
  3453. /* ----------------------------------------------------------------------- */
  3454. static void modtec_eeprom(struct bttv *btv)
  3455. {
  3456. if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
  3457. btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
  3458. printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
  3459. btv->c.nr,&eeprom_data[0x1e]);
  3460. } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
  3461. btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
  3462. printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
  3463. btv->c.nr,&eeprom_data[0x1e]);
  3464. } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
  3465. btv->tuner_type=TUNER_PHILIPS_NTSC;
  3466. printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
  3467. btv->c.nr,&eeprom_data[0x1e]);
  3468. } else {
  3469. printk("bttv%d: Modtec: Unknown TunerString: %s\n",
  3470. btv->c.nr,&eeprom_data[0x1e]);
  3471. }
  3472. }
  3473. static void __devinit hauppauge_eeprom(struct bttv *btv)
  3474. {
  3475. struct tveeprom tv;
  3476. tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data);
  3477. btv->tuner_type = tv.tuner_type;
  3478. btv->has_radio = tv.has_radio;
  3479. printk("bttv%d: Hauppauge eeprom indicates model#%d\n",
  3480. btv->c.nr, tv.model);
  3481. /*
  3482. * Some of the 878 boards have duplicate PCI IDs. Switch the board
  3483. * type based on model #.
  3484. */
  3485. if(tv.model == 64900) {
  3486. printk("bttv%d: Switching board type from %s to %s\n",
  3487. btv->c.nr,
  3488. bttv_tvcards[btv->c.type].name,
  3489. bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);
  3490. btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB;
  3491. }
  3492. }
  3493. static int terratec_active_radio_upgrade(struct bttv *btv)
  3494. {
  3495. int freq;
  3496. btv->has_radio = 1;
  3497. btv->has_matchbox = 1;
  3498. btv->mbox_we = 0x10;
  3499. btv->mbox_most = 0x20;
  3500. btv->mbox_clk = 0x08;
  3501. btv->mbox_data = 0x04;
  3502. btv->mbox_mask = 0x3c;
  3503. btv->mbox_iow = 1 << 8;
  3504. btv->mbox_ior = 1 << 9;
  3505. btv->mbox_csel = 1 << 10;
  3506. freq=88000/62.5;
  3507. tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */
  3508. if (0x1ed8 == tea5757_read(btv)) {
  3509. printk("bttv%d: Terratec Active Radio Upgrade found.\n",
  3510. btv->c.nr);
  3511. btv->has_radio = 1;
  3512. btv->has_saa6588 = 1;
  3513. btv->has_matchbox = 1;
  3514. } else {
  3515. btv->has_radio = 0;
  3516. btv->has_matchbox = 0;
  3517. }
  3518. return 0;
  3519. }
  3520. /* ----------------------------------------------------------------------- */
  3521. /*
  3522. * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
  3523. *
  3524. * The hcwamc.rbf firmware file is on the Hauppauge driver CD. Have
  3525. * a look at Pvr/pvr45xxx.EXE (self-extracting zip archive, can be
  3526. * unpacked with unzip).
  3527. */
  3528. #define PVR_GPIO_DELAY 10
  3529. #define BTTV_ALT_DATA 0x000001
  3530. #define BTTV_ALT_DCLK 0x100000
  3531. #define BTTV_ALT_NCONFIG 0x800000
  3532. static int __devinit pvr_altera_load(struct bttv *btv, const u8 *micro,
  3533. u32 microlen)
  3534. {
  3535. u32 n;
  3536. u8 bits;
  3537. int i;
  3538. gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
  3539. gpio_write(0);
  3540. udelay(PVR_GPIO_DELAY);
  3541. gpio_write(BTTV_ALT_NCONFIG);
  3542. udelay(PVR_GPIO_DELAY);
  3543. for (n = 0; n < microlen; n++) {
  3544. bits = micro[n];
  3545. for (i = 0 ; i < 8 ; i++) {
  3546. gpio_bits(BTTV_ALT_DCLK,0);
  3547. if (bits & 0x01)
  3548. gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
  3549. else
  3550. gpio_bits(BTTV_ALT_DATA,0);
  3551. gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
  3552. bits >>= 1;
  3553. }
  3554. }
  3555. gpio_bits(BTTV_ALT_DCLK,0);
  3556. udelay(PVR_GPIO_DELAY);
  3557. /* begin Altera init loop (Not necessary,but doesn't hurt) */
  3558. for (i = 0 ; i < 30 ; i++) {
  3559. gpio_bits(BTTV_ALT_DCLK,0);
  3560. gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
  3561. }
  3562. gpio_bits(BTTV_ALT_DCLK,0);
  3563. return 0;
  3564. }
  3565. static int __devinit pvr_boot(struct bttv *btv)
  3566. {
  3567. const struct firmware *fw_entry;
  3568. int rc;
  3569. rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
  3570. if (rc != 0) {
  3571. printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
  3572. btv->c.nr);
  3573. return rc;
  3574. }
  3575. rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
  3576. printk(KERN_INFO "bttv%d: altera firmware upload %s\n",
  3577. btv->c.nr, (rc < 0) ? "failed" : "ok");
  3578. release_firmware(fw_entry);
  3579. return rc;
  3580. }
  3581. /* ----------------------------------------------------------------------- */
  3582. /* some osprey specific stuff */
  3583. static void __devinit osprey_eeprom(struct bttv *btv, const u8 ee[256])
  3584. {
  3585. int i;
  3586. u32 serial = 0;
  3587. int cardid = -1;
  3588. /* This code will nevery actually get called in this case.... */
  3589. if (btv->c.type == BTTV_BOARD_UNKNOWN) {
  3590. /* this might be an antique... check for MMAC label in eeprom */
  3591. if (!strncmp(ee, "MMAC", 4)) {
  3592. u8 checksum = 0;
  3593. for (i = 0; i < 21; i++)
  3594. checksum += ee[i];
  3595. if (checksum != ee[21])
  3596. return;
  3597. cardid = BTTV_BOARD_OSPREY1x0_848;
  3598. for (i = 12; i < 21; i++)
  3599. serial *= 10, serial += ee[i] - '0';
  3600. }
  3601. } else {
  3602. unsigned short type;
  3603. for (i = 4*16; i < 8*16; i += 16) {
  3604. u16 checksum = ip_compute_csum(ee + i, 16);
  3605. if ((checksum&0xff) + (checksum>>8) == 0xff)
  3606. break;
  3607. }
  3608. if (i >= 8*16)
  3609. return;
  3610. ee += i;
  3611. /* found a valid descriptor */
  3612. type = get_unaligned_be16((__be16 *)(ee+4));
  3613. switch(type) {
  3614. /* 848 based */
  3615. case 0x0004:
  3616. cardid = BTTV_BOARD_OSPREY1x0_848;
  3617. break;
  3618. case 0x0005:
  3619. cardid = BTTV_BOARD_OSPREY101_848;
  3620. break;
  3621. /* 878 based */
  3622. case 0x0012:
  3623. case 0x0013:
  3624. cardid = BTTV_BOARD_OSPREY1x0;
  3625. break;
  3626. case 0x0014:
  3627. case 0x0015:
  3628. cardid = BTTV_BOARD_OSPREY1x1;
  3629. break;
  3630. case 0x0016:
  3631. case 0x0017:
  3632. case 0x0020:
  3633. cardid = BTTV_BOARD_OSPREY1x1_SVID;
  3634. break;
  3635. case 0x0018:
  3636. case 0x0019:
  3637. case 0x001E:
  3638. case 0x001F:
  3639. cardid = BTTV_BOARD_OSPREY2xx;
  3640. break;
  3641. case 0x001A:
  3642. case 0x001B:
  3643. cardid = BTTV_BOARD_OSPREY2x0_SVID;
  3644. break;
  3645. case 0x0040:
  3646. cardid = BTTV_BOARD_OSPREY500;
  3647. break;
  3648. case 0x0050:
  3649. case 0x0056:
  3650. cardid = BTTV_BOARD_OSPREY540;
  3651. /* bttv_osprey_540_init(btv); */
  3652. break;
  3653. case 0x0060:
  3654. case 0x0070:
  3655. case 0x00A0:
  3656. cardid = BTTV_BOARD_OSPREY2x0;
  3657. /* enable output on select control lines */
  3658. gpio_inout(0xffffff,0x000303);
  3659. break;
  3660. case 0x00D8:
  3661. cardid = BTTV_BOARD_OSPREY440;
  3662. break;
  3663. default:
  3664. /* unknown...leave generic, but get serial # */
  3665. printk(KERN_INFO "bttv%d: "
  3666. "osprey eeprom: unknown card type 0x%04x\n",
  3667. btv->c.nr, type);
  3668. break;
  3669. }
  3670. serial = get_unaligned_be32((__be32 *)(ee+6));
  3671. }
  3672. printk(KERN_INFO "bttv%d: osprey eeprom: card=%d '%s' serial=%u\n",
  3673. btv->c.nr, cardid,
  3674. cardid>0 ? bttv_tvcards[cardid].name : "Unknown", serial);
  3675. if (cardid<0 || btv->c.type == cardid)
  3676. return;
  3677. /* card type isn't set correctly */
  3678. if (card[btv->c.nr] < bttv_num_tvcards) {
  3679. printk(KERN_WARNING "bttv%d: osprey eeprom: "
  3680. "Not overriding user specified card type\n", btv->c.nr);
  3681. } else {
  3682. printk(KERN_INFO "bttv%d: osprey eeprom: "
  3683. "Changing card type from %d to %d\n", btv->c.nr,
  3684. btv->c.type, cardid);
  3685. btv->c.type = cardid;
  3686. }
  3687. }
  3688. /* ----------------------------------------------------------------------- */
  3689. /* AVermedia specific stuff, from bktr_card.c */
  3690. static int tuner_0_table[] = {
  3691. TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
  3692. TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
  3693. TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
  3694. TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
  3695. TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
  3696. TUNER_PHILIPS_FM1216ME_MK3 };
  3697. static int tuner_1_table[] = {
  3698. TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
  3699. TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
  3700. TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
  3701. TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
  3702. TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
  3703. static void __devinit avermedia_eeprom(struct bttv *btv)
  3704. {
  3705. int tuner_make, tuner_tv_fm, tuner_format, tuner_type = 0;
  3706. tuner_make = (eeprom_data[0x41] & 0x7);
  3707. tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
  3708. tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
  3709. btv->has_remote = (eeprom_data[0x42] & 0x01);
  3710. if (tuner_make == 0 || tuner_make == 2)
  3711. if (tuner_format <= 0x0a)
  3712. tuner_type = tuner_0_table[tuner_format];
  3713. if (tuner_make == 1)
  3714. if (tuner_format <= 9)
  3715. tuner_type = tuner_1_table[tuner_format];
  3716. if (tuner_make == 4)
  3717. if (tuner_format == 0x09)
  3718. tuner_type = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
  3719. printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
  3720. btv->c.nr, eeprom_data[0x41], eeprom_data[0x42]);
  3721. if (tuner_type) {
  3722. btv->tuner_type = tuner_type;
  3723. printk(KERN_CONT "%d", tuner_type);
  3724. } else
  3725. printk(KERN_CONT "Unknown type");
  3726. printk(KERN_CONT " radio:%s remote control:%s\n",
  3727. tuner_tv_fm ? "yes" : "no",
  3728. btv->has_remote ? "yes" : "no");
  3729. }
  3730. /*
  3731. * For Voodoo TV/FM and Voodoo 200. These cards' tuners use a TDA9880
  3732. * analog demod, which is not I2C controlled like the newer and more common
  3733. * TDA9887 series. Instead is has two tri-state input pins, S0 and S1,
  3734. * that control the IF for the video and audio. Apparently, bttv GPIO
  3735. * 0x10000 is connected to S0. S0 low selects a 38.9 MHz VIF for B/G/D/K/I
  3736. * (i.e., PAL) while high selects 45.75 MHz for M/N (i.e., NTSC).
  3737. */
  3738. u32 bttv_tda9880_setnorm(struct bttv *btv, u32 gpiobits)
  3739. {
  3740. if (btv->audio == TVAUDIO_INPUT_TUNER) {
  3741. if (bttv_tvnorms[btv->tvnorm].v4l2_id & V4L2_STD_MN)
  3742. gpiobits |= 0x10000;
  3743. else
  3744. gpiobits &= ~0x10000;
  3745. }
  3746. gpio_bits(bttv_tvcards[btv->c.type].gpiomask, gpiobits);
  3747. return gpiobits;
  3748. }
  3749. /*
  3750. * reset/enable the MSP on some Hauppauge cards
  3751. * Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
  3752. *
  3753. * Hauppauge: pin 5
  3754. * Voodoo: pin 20
  3755. */
  3756. static void __devinit boot_msp34xx(struct bttv *btv, int pin)
  3757. {
  3758. int mask = (1 << pin);
  3759. gpio_inout(mask,mask);
  3760. gpio_bits(mask,0);
  3761. mdelay(2);
  3762. udelay(500);
  3763. gpio_bits(mask,mask);
  3764. if (bttv_gpio)
  3765. bttv_gpio_tracking(btv,"msp34xx");
  3766. if (bttv_verbose)
  3767. printk(KERN_INFO "bttv%d: Hauppauge/Voodoo msp34xx: reset line "
  3768. "init [%d]\n", btv->c.nr, pin);
  3769. }
  3770. /* ----------------------------------------------------------------------- */
  3771. /* Imagenation L-Model PXC200 Framegrabber */
  3772. /* This is basically the same procedure as
  3773. * used by Alessandro Rubini in his pxc200
  3774. * driver, but using BTTV functions */
  3775. static void __devinit init_PXC200(struct bttv *btv)
  3776. {
  3777. static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d,
  3778. 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
  3779. 0x00 };
  3780. unsigned int i;
  3781. int tmp;
  3782. u32 val;
  3783. /* Initialise GPIO-connevted stuff */
  3784. gpio_inout(0xffffff, (1<<13));
  3785. gpio_write(0);
  3786. udelay(3);
  3787. gpio_write(1<<13);
  3788. /* GPIO inputs are pulled up, so no need to drive
  3789. * reset pin any longer */
  3790. gpio_bits(0xffffff, 0);
  3791. if (bttv_gpio)
  3792. bttv_gpio_tracking(btv,"pxc200");
  3793. /* we could/should try and reset/control the AD pots? but
  3794. right now we simply turned off the crushing. Without
  3795. this the AGC drifts drifts
  3796. remember the EN is reverse logic -->
  3797. setting BT848_ADC_AGC_EN disable the AGC
  3798. tboult@eecs.lehigh.edu
  3799. */
  3800. btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
  3801. /* Initialise MAX517 DAC */
  3802. printk(KERN_INFO "Setting DAC reference voltage level ...\n");
  3803. bttv_I2CWrite(btv,0x5E,0,0x80,1);
  3804. /* Initialise 12C508 PIC */
  3805. /* The I2CWrite and I2CRead commmands are actually to the
  3806. * same chips - but the R/W bit is included in the address
  3807. * argument so the numbers are different */
  3808. printk(KERN_INFO "Initialising 12C508 PIC chip ...\n");
  3809. /* First of all, enable the clock line. This is used in the PXC200-F */
  3810. val = btread(BT848_GPIO_DMA_CTL);
  3811. val |= BT848_GPIO_DMA_CTL_GPCLKMODE;
  3812. btwrite(val, BT848_GPIO_DMA_CTL);
  3813. /* Then, push to 0 the reset pin long enough to reset the *
  3814. * device same as above for the reset line, but not the same
  3815. * value sent to the GPIO-connected stuff
  3816. * which one is the good one? */
  3817. gpio_inout(0xffffff,(1<<2));
  3818. gpio_write(0);
  3819. udelay(10);
  3820. gpio_write(1<<2);
  3821. for (i = 0; i < ARRAY_SIZE(vals); i++) {
  3822. tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
  3823. if (tmp != -1) {
  3824. printk(KERN_INFO
  3825. "I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
  3826. vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
  3827. }
  3828. }
  3829. printk(KERN_INFO "PXC200 Initialised.\n");
  3830. }
  3831. /* ----------------------------------------------------------------------- */
  3832. /*
  3833. * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
  3834. * it. This apparently involves the following procedure for each 878 chip:
  3835. *
  3836. * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
  3837. *
  3838. * 2) write to GPIO_DATA
  3839. * - 0x0E
  3840. * - sleep 1ms
  3841. * - 0x10 + 0x0E
  3842. * - sleep 10ms
  3843. * - 0x0E
  3844. * read from GPIO_DATA into buf (uint_32)
  3845. * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
  3846. * error. ERROR_CPLD_Check_Failed stop.
  3847. *
  3848. * 3) write to GPIO_DATA
  3849. * - write 0x4400 + 0x0E
  3850. * - sleep 10ms
  3851. * - write 0x4410 + 0x0E
  3852. * - sleep 1ms
  3853. * - write 0x0E
  3854. * read from GPIO_DATA into buf (uint_32)
  3855. * - if ( buf>>18 & 0x01 ) || ( buf>>19 & 0x01 != 0 )
  3856. * error. ERROR_CPLD_Check_Failed.
  3857. */
  3858. /* ----------------------------------------------------------------------- */
  3859. static void
  3860. init_RTV24 (struct bttv *btv)
  3861. {
  3862. uint32_t dataRead = 0;
  3863. long watchdog_value = 0x0E;
  3864. printk (KERN_INFO
  3865. "bttv%d: Adlink RTV-24 initialisation in progress ...\n",
  3866. btv->c.nr);
  3867. btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
  3868. btwrite (0 + watchdog_value, BT848_GPIO_DATA);
  3869. msleep (1);
  3870. btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
  3871. msleep (10);
  3872. btwrite (0 + watchdog_value, BT848_GPIO_DATA);
  3873. dataRead = btread (BT848_GPIO_DATA);
  3874. if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
  3875. printk (KERN_INFO
  3876. "bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
  3877. btv->c.nr, dataRead);
  3878. }
  3879. btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
  3880. msleep (10);
  3881. btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
  3882. msleep (1);
  3883. btwrite (watchdog_value, BT848_GPIO_DATA);
  3884. msleep (1);
  3885. dataRead = btread (BT848_GPIO_DATA);
  3886. if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
  3887. printk (KERN_INFO
  3888. "bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
  3889. btv->c.nr, dataRead);
  3890. return;
  3891. }
  3892. printk (KERN_INFO
  3893. "bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);
  3894. }
  3895. /* ----------------------------------------------------------------------- */
  3896. /* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */
  3897. /*
  3898. * Copyright (c) 1999 Csaba Halasz <qgehali@uni-miskolc.hu>
  3899. * This code is placed under the terms of the GNU General Public License
  3900. *
  3901. * Brutally hacked by Dan Sheridan <dan.sheridan@contact.org.uk> djs52 8/3/00
  3902. */
  3903. static void bus_low(struct bttv *btv, int bit)
  3904. {
  3905. if (btv->mbox_ior) {
  3906. gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
  3907. btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
  3908. udelay(5);
  3909. }
  3910. gpio_bits(bit,0);
  3911. udelay(5);
  3912. if (btv->mbox_ior) {
  3913. gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
  3914. udelay(5);
  3915. }
  3916. }
  3917. static void bus_high(struct bttv *btv, int bit)
  3918. {
  3919. if (btv->mbox_ior) {
  3920. gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
  3921. btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
  3922. udelay(5);
  3923. }
  3924. gpio_bits(bit,bit);
  3925. udelay(5);
  3926. if (btv->mbox_ior) {
  3927. gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
  3928. udelay(5);
  3929. }
  3930. }
  3931. static int bus_in(struct bttv *btv, int bit)
  3932. {
  3933. if (btv->mbox_ior) {
  3934. gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
  3935. btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
  3936. udelay(5);
  3937. gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
  3938. udelay(5);
  3939. }
  3940. return gpio_read() & (bit);
  3941. }
  3942. /* TEA5757 register bits */
  3943. #define TEA_FREQ 0:14
  3944. #define TEA_BUFFER 15:15
  3945. #define TEA_SIGNAL_STRENGTH 16:17
  3946. #define TEA_PORT1 18:18
  3947. #define TEA_PORT0 19:19
  3948. #define TEA_BAND 20:21
  3949. #define TEA_BAND_FM 0
  3950. #define TEA_BAND_MW 1
  3951. #define TEA_BAND_LW 2
  3952. #define TEA_BAND_SW 3
  3953. #define TEA_MONO 22:22
  3954. #define TEA_ALLOW_STEREO 0
  3955. #define TEA_FORCE_MONO 1
  3956. #define TEA_SEARCH_DIRECTION 23:23
  3957. #define TEA_SEARCH_DOWN 0
  3958. #define TEA_SEARCH_UP 1
  3959. #define TEA_STATUS 24:24
  3960. #define TEA_STATUS_TUNED 0
  3961. #define TEA_STATUS_SEARCHING 1
  3962. /* Low-level stuff */
  3963. static int tea5757_read(struct bttv *btv)
  3964. {
  3965. unsigned long timeout;
  3966. int value = 0;
  3967. int i;
  3968. /* better safe than sorry */
  3969. gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);
  3970. if (btv->mbox_ior) {
  3971. gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
  3972. btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
  3973. udelay(5);
  3974. }
  3975. if (bttv_gpio)
  3976. bttv_gpio_tracking(btv,"tea5757 read");
  3977. bus_low(btv,btv->mbox_we);
  3978. bus_low(btv,btv->mbox_clk);
  3979. udelay(10);
  3980. timeout= jiffies + msecs_to_jiffies(1000);
  3981. /* wait for DATA line to go low; error if it doesn't */
  3982. while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
  3983. schedule();
  3984. if (bus_in(btv,btv->mbox_data)) {
  3985. printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr);
  3986. return -1;
  3987. }
  3988. dprintk("bttv%d: tea5757:",btv->c.nr);
  3989. for (i = 0; i < 24; i++) {
  3990. udelay(5);
  3991. bus_high(btv,btv->mbox_clk);
  3992. udelay(5);
  3993. dprintk("%c",(bus_in(btv,btv->mbox_most) == 0)?'T':'-');
  3994. bus_low(btv,btv->mbox_clk);
  3995. value <<= 1;
  3996. value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */
  3997. dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M');
  3998. }
  3999. dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value);
  4000. return value;
  4001. }
  4002. static int tea5757_write(struct bttv *btv, int value)
  4003. {
  4004. int i;
  4005. int reg = value;
  4006. gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data);
  4007. if (btv->mbox_ior) {
  4008. gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
  4009. btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
  4010. udelay(5);
  4011. }
  4012. if (bttv_gpio)
  4013. bttv_gpio_tracking(btv,"tea5757 write");
  4014. dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);
  4015. bus_low(btv,btv->mbox_clk);
  4016. bus_high(btv,btv->mbox_we);
  4017. for (i = 0; i < 25; i++) {
  4018. if (reg & 0x1000000)
  4019. bus_high(btv,btv->mbox_data);
  4020. else
  4021. bus_low(btv,btv->mbox_data);
  4022. reg <<= 1;
  4023. bus_high(btv,btv->mbox_clk);
  4024. udelay(10);
  4025. bus_low(btv,btv->mbox_clk);
  4026. udelay(10);
  4027. }
  4028. bus_low(btv,btv->mbox_we); /* unmute !!! */
  4029. return 0;
  4030. }
  4031. void tea5757_set_freq(struct bttv *btv, unsigned short freq)
  4032. {
  4033. dprintk("tea5757_set_freq %d\n",freq);
  4034. tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */
  4035. }
  4036. /* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]
  4037. *
  4038. * This is needed because rv605 don't use a normal multiplex, but a crosspoint
  4039. * switch instead (CD22M3494E). This IC can have multiple active connections
  4040. * between Xn (input) and Yn (output) pins. We need to clear any existing
  4041. * connection prior to establish a new one, pulsing the STROBE pin.
  4042. *
  4043. * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
  4044. * GPIO pins are wired as:
  4045. * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroller)
  4046. * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroller)
  4047. * GPIO[7] - DATA (xpoint) - P1[7] (microcontroller)
  4048. * GPIO[8] - - P3[5] (microcontroller)
  4049. * GPIO[9] - RESET (xpoint) - P3[6] (microcontroller)
  4050. * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroller)
  4051. * GPINTR - - P3[4] (microcontroller)
  4052. *
  4053. * The microcontroller is a 80C32 like. It should be possible to change xpoint
  4054. * configuration either directly (as we are doing) or using the microcontroller
  4055. * which is also wired to I2C interface. I have no further info on the
  4056. * microcontroller features, one would need to disassembly the firmware.
  4057. * note: the vendor refused to give any information on this product, all
  4058. * that stuff was found using a multimeter! :)
  4059. */
  4060. static void rv605_muxsel(struct bttv *btv, unsigned int input)
  4061. {
  4062. static const u8 muxgpio[] = { 0x3, 0x1, 0x2, 0x4, 0xf, 0x7, 0xe, 0x0,
  4063. 0xd, 0xb, 0xc, 0x6, 0x9, 0x5, 0x8, 0xa };
  4064. gpio_bits(0x07f, muxgpio[input]);
  4065. /* reset all conections */
  4066. gpio_bits(0x200,0x200);
  4067. mdelay(1);
  4068. gpio_bits(0x200,0x000);
  4069. mdelay(1);
  4070. /* create a new connection */
  4071. gpio_bits(0x480,0x480);
  4072. mdelay(1);
  4073. gpio_bits(0x480,0x080);
  4074. mdelay(1);
  4075. }
  4076. /* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
  4077. *
  4078. * The CS16 (available on eBay cheap) is a PCI board with four Fusion
  4079. * 878A chips, a PCI bridge, an Atmel microcontroller, four sync separator
  4080. * chips, ten eight input analog multiplexors, a not chip and a few
  4081. * other components.
  4082. *
  4083. * 16 inputs on a secondary bracket are provided and can be selected
  4084. * from each of the four capture chips. Two of the eight input
  4085. * multiplexors are used to select from any of the 16 input signals.
  4086. *
  4087. * Unsupported hardware capabilities:
  4088. * . A video output monitor on the secondary bracket can be selected from
  4089. * one of the 878A chips.
  4090. * . Another passthrough but I haven't spent any time investigating it.
  4091. * . Digital I/O (logic level connected to GPIO) is available from an
  4092. * onboard header.
  4093. *
  4094. * The on chip input mux should always be set to 2.
  4095. * GPIO[16:19] - Video input selection
  4096. * GPIO[0:3] - Video output monitor select (only available from one 878A)
  4097. * GPIO[?:?] - Digital I/O.
  4098. *
  4099. * There is an ATMEL microcontroller with an 8031 core on board. I have not
  4100. * determined what function (if any) it provides. With the microcontroller
  4101. * and sync separator chips a guess is that it might have to do with video
  4102. * switching and maybe some digital I/O.
  4103. */
  4104. static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
  4105. {
  4106. /* video mux */
  4107. gpio_bits(0x0f0000, input << 16);
  4108. }
  4109. static void tibetCS16_init(struct bttv *btv)
  4110. {
  4111. /* enable gpio bits, mask obtained via btSpy */
  4112. gpio_inout(0xffffff, 0x0f7fff);
  4113. gpio_write(0x0f7fff);
  4114. }
  4115. /*
  4116. * The following routines for the Kodicom-4400r get a little mind-twisting.
  4117. * There is a "master" controller and three "slave" controllers, together
  4118. * an analog switch which connects any of 16 cameras to any of the BT87A's.
  4119. * The analog switch is controlled by the "master", but the detection order
  4120. * of the four BT878A chips is in an order which I just don't understand.
  4121. * The "master" is actually the second controller to be detected. The
  4122. * logic on the board uses logical numbers for the 4 controllers, but
  4123. * those numbers are different from the detection sequence. When working
  4124. * with the analog switch, we need to "map" from the detection sequence
  4125. * over to the board's logical controller number. This mapping sequence
  4126. * is {3, 0, 2, 1}, i.e. the first controller to be detected is logical
  4127. * unit 3, the second (which is the master) is logical unit 0, etc.
  4128. * We need to maintain the status of the analog switch (which of the 16
  4129. * cameras is connected to which of the 4 controllers). Rather than
  4130. * add to the bttv structure for this, we use the data reserved for
  4131. * the mbox (unused for this card type).
  4132. */
  4133. /*
  4134. * First a routine to set the analog switch, which controls which camera
  4135. * is routed to which controller. The switch comprises an X-address
  4136. * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
  4137. * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
  4138. * A data value (gpio bit 7) of '1' enables the switch, and '0' disables
  4139. * the switch. A STROBE bit (gpio bit 8) latches the data value into the
  4140. * specified address. The idea is to set the address and data, then bring
  4141. * STROBE high, and finally bring STROBE back to low.
  4142. */
  4143. static void kodicom4400r_write(struct bttv *btv,
  4144. unsigned char xaddr,
  4145. unsigned char yaddr,
  4146. unsigned char data) {
  4147. unsigned int udata;
  4148. udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
  4149. gpio_bits(0x1ff, udata); /* write ADDR and DAT */
  4150. gpio_bits(0x1ff, udata | (1 << 8)); /* strobe high */
  4151. gpio_bits(0x1ff, udata); /* strobe low */
  4152. }
  4153. /*
  4154. * Next the mux select. Both the "master" and "slave" 'cards' (controllers)
  4155. * use this routine. The routine finds the "master" for the card, maps
  4156. * the controller number from the detected position over to the logical
  4157. * number, writes the appropriate data to the analog switch, and housekeeps
  4158. * the local copy of the switch information. The parameter 'input' is the
  4159. * requested camera number (0 - 15).
  4160. */
  4161. static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)
  4162. {
  4163. char *sw_status;
  4164. int xaddr, yaddr;
  4165. struct bttv *mctlr;
  4166. static unsigned char map[4] = {3, 0, 2, 1};
  4167. mctlr = master[btv->c.nr];
  4168. if (mctlr == NULL) { /* ignore if master not yet detected */
  4169. return;
  4170. }
  4171. yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */
  4172. yaddr = map[yaddr];
  4173. sw_status = (char *)(&mctlr->mbox_we);
  4174. xaddr = input & 0xf;
  4175. /* Check if the controller/camera pair has changed, else ignore */
  4176. if (sw_status[yaddr] != xaddr)
  4177. {
  4178. /* "open" the old switch, "close" the new one, save the new */
  4179. kodicom4400r_write(mctlr, sw_status[yaddr], yaddr, 0);
  4180. sw_status[yaddr] = xaddr;
  4181. kodicom4400r_write(mctlr, xaddr, yaddr, 1);
  4182. }
  4183. }
  4184. /*
  4185. * During initialisation, we need to reset the analog switch. We
  4186. * also preset the switch to map the 4 connectors on the card to the
  4187. * *user's* (see above description of kodicom4400r_muxsel) channels
  4188. * 0 through 3
  4189. */
  4190. static void kodicom4400r_init(struct bttv *btv)
  4191. {
  4192. char *sw_status = (char *)(&btv->mbox_we);
  4193. int ix;
  4194. gpio_inout(0x0003ff, 0x0003ff);
  4195. gpio_write(1 << 9); /* reset MUX */
  4196. gpio_write(0);
  4197. /* Preset camera 0 to the 4 controllers */
  4198. for (ix = 0; ix < 4; ix++) {
  4199. sw_status[ix] = ix;
  4200. kodicom4400r_write(btv, ix, ix, 1);
  4201. }
  4202. /*
  4203. * Since this is the "master", we need to set up the
  4204. * other three controller chips' pointers to this structure
  4205. * for later use in the muxsel routine.
  4206. */
  4207. if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
  4208. return;
  4209. master[btv->c.nr-1] = btv;
  4210. master[btv->c.nr] = btv;
  4211. master[btv->c.nr+1] = btv;
  4212. master[btv->c.nr+2] = btv;
  4213. }
  4214. /* The Grandtec X-Guard framegrabber card uses two Dual 4-channel
  4215. * video multiplexers to provide up to 16 video inputs. These
  4216. * multiplexers are controlled by the lower 8 GPIO pins of the
  4217. * bt878. The multiplexers probably Pericom PI5V331Q or similar.
  4218. * xxx0 is pin xxx of multiplexer U5,
  4219. * yyy1 is pin yyy of multiplexer U2
  4220. */
  4221. #define ENA0 0x01
  4222. #define ENB0 0x02
  4223. #define ENA1 0x04
  4224. #define ENB1 0x08
  4225. #define IN10 0x10
  4226. #define IN00 0x20
  4227. #define IN11 0x40
  4228. #define IN01 0x80
  4229. static void xguard_muxsel(struct bttv *btv, unsigned int input)
  4230. {
  4231. static const int masks[] = {
  4232. ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
  4233. ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
  4234. ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
  4235. ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
  4236. };
  4237. gpio_write(masks[input%16]);
  4238. }
  4239. static void picolo_tetra_init(struct bttv *btv)
  4240. {
  4241. /*This is the video input redirection fonctionality : I DID NOT USED IT. */
  4242. btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */
  4243. btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A] set to 1*/
  4244. }
  4245. static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
  4246. {
  4247. dprintk (KERN_DEBUG "bttv%d : picolo_tetra_muxsel => input = %d\n",btv->c.nr,input);
  4248. /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
  4249. /*GPIO[20]&GPIO[21] used to choose the right input*/
  4250. btwrite (input<<20,BT848_GPIO_DATA);
  4251. }
  4252. /*
  4253. * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
  4254. *
  4255. * The IVC120G security card has 4 i2c controlled TDA8540 matrix
  4256. * swichers to provide 16 channels to MUX0. The TDA8540's have
  4257. * 4 independent outputs and as such the IVC120G also has the
  4258. * optional "Monitor Out" bus. This allows the card to be looking
  4259. * at one input while the monitor is looking at another.
  4260. *
  4261. * Since I've couldn't be bothered figuring out how to add an
  4262. * independent muxsel for the monitor bus, I've just set it to
  4263. * whatever the card is looking at.
  4264. *
  4265. * OUT0 of the TDA8540's is connected to MUX0 (0x03)
  4266. * OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)
  4267. *
  4268. * TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)
  4269. * TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)
  4270. * TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)
  4271. * TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)
  4272. *
  4273. */
  4274. /* All 7 possible sub-ids for the TDA8540 Matrix Switcher */
  4275. #define I2C_TDA8540 0x90
  4276. #define I2C_TDA8540_ALT1 0x92
  4277. #define I2C_TDA8540_ALT2 0x94
  4278. #define I2C_TDA8540_ALT3 0x96
  4279. #define I2C_TDA8540_ALT4 0x98
  4280. #define I2C_TDA8540_ALT5 0x9a
  4281. #define I2C_TDA8540_ALT6 0x9c
  4282. static void ivc120_muxsel(struct bttv *btv, unsigned int input)
  4283. {
  4284. /* Simple maths */
  4285. int key = input % 4;
  4286. int matrix = input / 4;
  4287. dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
  4288. btv->c.nr, input, matrix, key);
  4289. /* Handles the input selection on the TDA8540's */
  4290. bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
  4291. ((matrix == 3) ? (key | key << 2) : 0x00), 1);
  4292. bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,
  4293. ((matrix == 0) ? (key | key << 2) : 0x00), 1);
  4294. bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,
  4295. ((matrix == 1) ? (key | key << 2) : 0x00), 1);
  4296. bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,
  4297. ((matrix == 2) ? (key | key << 2) : 0x00), 1);
  4298. /* Handles the output enables on the TDA8540's */
  4299. bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,
  4300. ((matrix == 3) ? 0x03 : 0x00), 1); /* 13 - 16 */
  4301. bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,
  4302. ((matrix == 0) ? 0x03 : 0x00), 1); /* 1-4 */
  4303. bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,
  4304. ((matrix == 1) ? 0x03 : 0x00), 1); /* 5-8 */
  4305. bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,
  4306. ((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */
  4307. /* 878's MUX0 is already selected for input via muxsel values */
  4308. }
  4309. /* PXC200 muxsel helper
  4310. * luke@syseng.anu.edu.au
  4311. * another transplant
  4312. * from Alessandro Rubini (rubini@linux.it)
  4313. *
  4314. * There are 4 kinds of cards:
  4315. * PXC200L which is bt848
  4316. * PXC200F which is bt848 with PIC controlling mux
  4317. * PXC200AL which is bt878
  4318. * PXC200AF which is bt878 with PIC controlling mux
  4319. */
  4320. #define PX_CFG_PXC200F 0x01
  4321. #define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */
  4322. #define PX_I2C_PIC 0x0f
  4323. #define PX_PXC200A_CARDID 0x200a1295
  4324. #define PX_I2C_CMD_CFG 0x00
  4325. static void PXC200_muxsel(struct bttv *btv, unsigned int input)
  4326. {
  4327. int rc;
  4328. long mux;
  4329. int bitmask;
  4330. unsigned char buf[2];
  4331. /* Read PIC config to determine if this is a PXC200F */
  4332. /* PX_I2C_CMD_CFG*/
  4333. buf[0]=0;
  4334. buf[1]=0;
  4335. rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
  4336. if (rc) {
  4337. printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc);
  4338. /* not PXC ? do nothing */
  4339. return;
  4340. }
  4341. rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
  4342. if (!(rc & PX_CFG_PXC200F)) {
  4343. printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc);
  4344. return;
  4345. }
  4346. /* The multiplexer in the 200F is handled by the GPIO port */
  4347. /* get correct mapping between inputs */
  4348. /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */
  4349. /* ** not needed!? */
  4350. mux = input;
  4351. /* make sure output pins are enabled */
  4352. /* bitmask=0x30f; */
  4353. bitmask=0x302;
  4354. /* check whether we have a PXC200A */
  4355. if (btv->cardid == PX_PXC200A_CARDID) {
  4356. bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */
  4357. bitmask |= 7<<4; /* the DAC */
  4358. }
  4359. btwrite(bitmask, BT848_GPIO_OUT_EN);
  4360. bitmask = btread(BT848_GPIO_DATA);
  4361. if (btv->cardid == PX_PXC200A_CARDID)
  4362. bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
  4363. else /* older device */
  4364. bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
  4365. btwrite(bitmask,BT848_GPIO_DATA);
  4366. /*
  4367. * Was "to be safe, set the bt848 to input 0"
  4368. * Actually, since it's ok at load time, better not messing
  4369. * with these bits (on PXC200AF you need to set mux 2 here)
  4370. *
  4371. * needed because bttv-driver sets mux before calling this function
  4372. */
  4373. if (btv->cardid == PX_PXC200A_CARDID)
  4374. btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
  4375. else /* older device */
  4376. btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
  4377. printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux);
  4378. }
  4379. static void phytec_muxsel(struct bttv *btv, unsigned int input)
  4380. {
  4381. unsigned int mux = input % 4;
  4382. if (input == btv->svhs)
  4383. mux = 0;
  4384. gpio_bits(0x3, mux);
  4385. }
  4386. /*
  4387. * GeoVision GV-800(S) functions
  4388. * Bruno Christo <bchristo@inf.ufsm.br>
  4389. */
  4390. /* This is a function to control the analog switch, which determines which
  4391. * camera is routed to which controller. The switch comprises an X-address
  4392. * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
  4393. * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
  4394. * A data value (gpio bit 18) of '1' enables the switch, and '0' disables
  4395. * the switch. A STROBE bit (gpio bit 17) latches the data value into the
  4396. * specified address. There is also a chip select (gpio bit 16).
  4397. * The idea is to set the address and chip select together, bring
  4398. * STROBE high, write the data, and finally bring STROBE back to low.
  4399. */
  4400. static void gv800s_write(struct bttv *btv,
  4401. unsigned char xaddr,
  4402. unsigned char yaddr,
  4403. unsigned char data) {
  4404. /* On the "master" 878A:
  4405. * GPIO bits 0-9 are used for the analog switch:
  4406. * 00 - 03: camera selector
  4407. * 04 - 06: 878A (controller) selector
  4408. * 16: cselect
  4409. * 17: strobe
  4410. * 18: data (1->on, 0->off)
  4411. * 19: reset
  4412. */
  4413. const u32 ADDRESS = ((xaddr&0xf) | (yaddr&3)<<4);
  4414. const u32 CSELECT = 1<<16;
  4415. const u32 STROBE = 1<<17;
  4416. const u32 DATA = data<<18;
  4417. gpio_bits(0x1007f, ADDRESS | CSELECT); /* write ADDRESS and CSELECT */
  4418. gpio_bits(0x20000, STROBE); /* STROBE high */
  4419. gpio_bits(0x40000, DATA); /* write DATA */
  4420. gpio_bits(0x20000, ~STROBE); /* STROBE low */
  4421. }
  4422. /*
  4423. * GeoVision GV-800(S) muxsel
  4424. *
  4425. * Each of the 4 cards (controllers) use this function.
  4426. * The controller using this function selects the input through the GPIO pins
  4427. * of the "master" card. A pointer to this card is stored in master[btv->c.nr].
  4428. *
  4429. * The parameter 'input' is the requested camera number (0-4) on the controller.
  4430. * The map array has the address of each input. Note that the addresses in the
  4431. * array are in the sequence the original GeoVision driver uses, that is, set
  4432. * every controller to input 0, then to input 1, 2, 3, repeat. This means that
  4433. * the physical "camera 1" connector corresponds to controller 0 input 0,
  4434. * "camera 2" corresponds to controller 1 input 0, and so on.
  4435. *
  4436. * After getting the input address, the function then writes the appropriate
  4437. * data to the analog switch, and housekeeps the local copy of the switch
  4438. * information.
  4439. */
  4440. static void gv800s_muxsel(struct bttv *btv, unsigned int input)
  4441. {
  4442. struct bttv *mctlr;
  4443. char *sw_status;
  4444. int xaddr, yaddr;
  4445. static unsigned int map[4][4] = { { 0x0, 0x4, 0xa, 0x6 },
  4446. { 0x1, 0x5, 0xb, 0x7 },
  4447. { 0x2, 0x8, 0xc, 0xe },
  4448. { 0x3, 0x9, 0xd, 0xf } };
  4449. input = input%4;
  4450. mctlr = master[btv->c.nr];
  4451. if (mctlr == NULL) {
  4452. /* do nothing until the "master" is detected */
  4453. return;
  4454. }
  4455. yaddr = (btv->c.nr - mctlr->c.nr) & 3;
  4456. sw_status = (char *)(&mctlr->mbox_we);
  4457. xaddr = map[yaddr][input] & 0xf;
  4458. /* Check if the controller/camera pair has changed, ignore otherwise */
  4459. if (sw_status[yaddr] != xaddr) {
  4460. /* disable the old switch, enable the new one and save status */
  4461. gv800s_write(mctlr, sw_status[yaddr], yaddr, 0);
  4462. sw_status[yaddr] = xaddr;
  4463. gv800s_write(mctlr, xaddr, yaddr, 1);
  4464. }
  4465. }
  4466. /* GeoVision GV-800(S) "master" chip init */
  4467. static void gv800s_init(struct bttv *btv)
  4468. {
  4469. char *sw_status = (char *)(&btv->mbox_we);
  4470. int ix;
  4471. gpio_inout(0xf107f, 0xf107f);
  4472. gpio_write(1<<19); /* reset the analog MUX */
  4473. gpio_write(0);
  4474. /* Preset camera 0 to the 4 controllers */
  4475. for (ix = 0; ix < 4; ix++) {
  4476. sw_status[ix] = ix;
  4477. gv800s_write(btv, ix, ix, 1);
  4478. }
  4479. /* Inputs on the "master" controller need this brightness fix */
  4480. bttv_I2CWrite(btv, 0x18, 0x5, 0x90, 1);
  4481. if (btv->c.nr > BTTV_MAX-4)
  4482. return;
  4483. /*
  4484. * Store the "master" controller pointer in the master
  4485. * array for later use in the muxsel function.
  4486. */
  4487. master[btv->c.nr] = btv;
  4488. master[btv->c.nr+1] = btv;
  4489. master[btv->c.nr+2] = btv;
  4490. master[btv->c.nr+3] = btv;
  4491. }
  4492. /* ----------------------------------------------------------------------- */
  4493. /* motherboard chipset specific stuff */
  4494. void __init bttv_check_chipset(void)
  4495. {
  4496. int pcipci_fail = 0;
  4497. struct pci_dev *dev = NULL;
  4498. if (pci_pci_problems & (PCIPCI_FAIL|PCIAGP_FAIL)) /* should check if target is AGP */
  4499. pcipci_fail = 1;
  4500. if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
  4501. triton1 = 1;
  4502. if (pci_pci_problems & PCIPCI_VSFX)
  4503. vsfx = 1;
  4504. #ifdef PCIPCI_ALIMAGIK
  4505. if (pci_pci_problems & PCIPCI_ALIMAGIK)
  4506. latency = 0x0A;
  4507. #endif
  4508. /* print warnings about any quirks found */
  4509. if (triton1)
  4510. printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n");
  4511. if (vsfx)
  4512. printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n");
  4513. if (pcipci_fail) {
  4514. printk(KERN_INFO "bttv: bttv and your chipset may not work "
  4515. "together.\n");
  4516. if (!no_overlay) {
  4517. printk(KERN_INFO "bttv: overlay will be disabled.\n");
  4518. no_overlay = 1;
  4519. } else {
  4520. printk(KERN_INFO "bttv: overlay forced. Use this "
  4521. "option at your own risk.\n");
  4522. }
  4523. }
  4524. if (UNSET != latency)
  4525. printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency);
  4526. while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
  4527. PCI_DEVICE_ID_INTEL_82441, dev))) {
  4528. unsigned char b;
  4529. pci_read_config_byte(dev, 0x53, &b);
  4530. if (bttv_debug)
  4531. printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, "
  4532. "bufcon=0x%02x\n",b);
  4533. }
  4534. }
  4535. int __devinit bttv_handle_chipset(struct bttv *btv)
  4536. {
  4537. unsigned char command;
  4538. if (!triton1 && !vsfx && UNSET == latency)
  4539. return 0;
  4540. if (bttv_verbose) {
  4541. if (triton1)
  4542. printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->c.nr);
  4543. if (vsfx && btv->id >= 878)
  4544. printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->c.nr);
  4545. if (UNSET != latency)
  4546. printk(KERN_INFO "bttv%d: setting pci timer to %d\n",
  4547. btv->c.nr,latency);
  4548. }
  4549. if (btv->id < 878) {
  4550. /* bt848 (mis)uses a bit in the irq mask for etbf */
  4551. if (triton1)
  4552. btv->triton1 = BT848_INT_ETBF;
  4553. } else {
  4554. /* bt878 has a bit in the pci config space for it */
  4555. pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
  4556. if (triton1)
  4557. command |= BT878_EN_TBFX;
  4558. if (vsfx)
  4559. command |= BT878_EN_VSFX;
  4560. pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
  4561. }
  4562. if (UNSET != latency)
  4563. pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);
  4564. return 0;
  4565. }
  4566. /*
  4567. * Local variables:
  4568. * c-basic-offset: 8
  4569. * End:
  4570. */