cx88-cards.c 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102
  1. /*
  2. * $Id: cx88-cards.c,v 1.84 2005/07/02 19:42:09 mkrufky Exp $
  3. *
  4. * device driver for Conexant 2388x based TV cards
  5. * card-specific stuff.
  6. *
  7. * (c) 2003 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  22. */
  23. #include <linux/init.h>
  24. #include <linux/module.h>
  25. #include <linux/pci.h>
  26. #include <linux/delay.h>
  27. #include "cx88.h"
  28. /* ------------------------------------------------------------------ */
  29. /* board config info */
  30. struct cx88_board cx88_boards[] = {
  31. [CX88_BOARD_UNKNOWN] = {
  32. .name = "UNKNOWN/GENERIC",
  33. .tuner_type = UNSET,
  34. .radio_type = UNSET,
  35. .tuner_addr = ADDR_UNSET,
  36. .radio_addr = ADDR_UNSET,
  37. .input = {{
  38. .type = CX88_VMUX_COMPOSITE1,
  39. .vmux = 0,
  40. },{
  41. .type = CX88_VMUX_COMPOSITE2,
  42. .vmux = 1,
  43. },{
  44. .type = CX88_VMUX_COMPOSITE3,
  45. .vmux = 2,
  46. },{
  47. .type = CX88_VMUX_COMPOSITE4,
  48. .vmux = 3,
  49. }},
  50. },
  51. [CX88_BOARD_HAUPPAUGE] = {
  52. .name = "Hauppauge WinTV 34xxx models",
  53. .tuner_type = UNSET,
  54. .radio_type = UNSET,
  55. .tuner_addr = ADDR_UNSET,
  56. .radio_addr = ADDR_UNSET,
  57. .tda9887_conf = TDA9887_PRESENT,
  58. .input = {{
  59. .type = CX88_VMUX_TELEVISION,
  60. .vmux = 0,
  61. .gpio0 = 0xff00, // internal decoder
  62. },{
  63. .type = CX88_VMUX_DEBUG,
  64. .vmux = 0,
  65. .gpio0 = 0xff01, // mono from tuner chip
  66. },{
  67. .type = CX88_VMUX_COMPOSITE1,
  68. .vmux = 1,
  69. .gpio0 = 0xff02,
  70. },{
  71. .type = CX88_VMUX_SVIDEO,
  72. .vmux = 2,
  73. .gpio0 = 0xff02,
  74. }},
  75. .radio = {
  76. .type = CX88_RADIO,
  77. .gpio0 = 0xff01,
  78. },
  79. },
  80. [CX88_BOARD_GDI] = {
  81. .name = "GDI Black Gold",
  82. .tuner_type = UNSET,
  83. .radio_type = UNSET,
  84. .tuner_addr = ADDR_UNSET,
  85. .radio_addr = ADDR_UNSET,
  86. .input = {{
  87. .type = CX88_VMUX_TELEVISION,
  88. .vmux = 0,
  89. }},
  90. },
  91. [CX88_BOARD_PIXELVIEW] = {
  92. .name = "PixelView",
  93. .tuner_type = TUNER_PHILIPS_PAL,
  94. .radio_type = UNSET,
  95. .tuner_addr = ADDR_UNSET,
  96. .radio_addr = ADDR_UNSET,
  97. .input = {{
  98. .type = CX88_VMUX_TELEVISION,
  99. .vmux = 0,
  100. .gpio0 = 0xff00, // internal decoder
  101. },{
  102. .type = CX88_VMUX_COMPOSITE1,
  103. .vmux = 1,
  104. },{
  105. .type = CX88_VMUX_SVIDEO,
  106. .vmux = 2,
  107. }},
  108. .radio = {
  109. .type = CX88_RADIO,
  110. .gpio0 = 0xff10,
  111. },
  112. },
  113. [CX88_BOARD_ATI_WONDER_PRO] = {
  114. .name = "ATI TV Wonder Pro",
  115. .tuner_type = TUNER_PHILIPS_4IN1,
  116. .radio_type = UNSET,
  117. .tuner_addr = ADDR_UNSET,
  118. .radio_addr = ADDR_UNSET,
  119. .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER,
  120. .input = {{
  121. .type = CX88_VMUX_TELEVISION,
  122. .vmux = 0,
  123. .gpio0 = 0x03ff,
  124. },{
  125. .type = CX88_VMUX_COMPOSITE1,
  126. .vmux = 1,
  127. .gpio0 = 0x03fe,
  128. },{
  129. .type = CX88_VMUX_SVIDEO,
  130. .vmux = 2,
  131. .gpio0 = 0x03fe,
  132. }},
  133. },
  134. [CX88_BOARD_WINFAST2000XP_EXPERT] = {
  135. .name = "Leadtek Winfast 2000XP Expert",
  136. .tuner_type = TUNER_PHILIPS_4IN1,
  137. .radio_type = UNSET,
  138. .tuner_addr = ADDR_UNSET,
  139. .radio_addr = ADDR_UNSET,
  140. .tda9887_conf = TDA9887_PRESENT,
  141. .input = {{
  142. .type = CX88_VMUX_TELEVISION,
  143. .vmux = 0,
  144. .gpio0 = 0x00F5e700,
  145. .gpio1 = 0x00003004,
  146. .gpio2 = 0x00F5e700,
  147. .gpio3 = 0x02000000,
  148. },{
  149. .type = CX88_VMUX_COMPOSITE1,
  150. .vmux = 1,
  151. .gpio0 = 0x00F5c700,
  152. .gpio1 = 0x00003004,
  153. .gpio2 = 0x00F5c700,
  154. .gpio3 = 0x02000000,
  155. },{
  156. .type = CX88_VMUX_SVIDEO,
  157. .vmux = 2,
  158. .gpio0 = 0x00F5c700,
  159. .gpio1 = 0x00003004,
  160. .gpio2 = 0x00F5c700,
  161. .gpio3 = 0x02000000,
  162. }},
  163. .radio = {
  164. .type = CX88_RADIO,
  165. .gpio0 = 0x00F5d700,
  166. .gpio1 = 0x00003004,
  167. .gpio2 = 0x00F5d700,
  168. .gpio3 = 0x02000000,
  169. },
  170. },
  171. [CX88_BOARD_AVERTV_303] = {
  172. .name = "AverTV Studio 303 (M126)",
  173. .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
  174. .radio_type = UNSET,
  175. .tuner_addr = ADDR_UNSET,
  176. .radio_addr = ADDR_UNSET,
  177. .tda9887_conf = TDA9887_PRESENT,
  178. .input = {{
  179. .type = CX88_VMUX_TELEVISION,
  180. .vmux = 0,
  181. .gpio1 = 0x309f,
  182. },{
  183. .type = CX88_VMUX_COMPOSITE1,
  184. .vmux = 1,
  185. .gpio1 = 0x305f,
  186. },{
  187. .type = CX88_VMUX_SVIDEO,
  188. .vmux = 2,
  189. .gpio1 = 0x305f,
  190. }},
  191. .radio = {
  192. .type = CX88_RADIO,
  193. },
  194. },
  195. [CX88_BOARD_MSI_TVANYWHERE_MASTER] = {
  196. // added gpio values thanks to Michal
  197. // values for PAL from DScaler
  198. .name = "MSI TV-@nywhere Master",
  199. .tuner_type = TUNER_MT2032,
  200. .radio_type = UNSET,
  201. .tuner_addr = ADDR_UNSET,
  202. .radio_addr = ADDR_UNSET,
  203. .tda9887_conf = TDA9887_PRESENT,
  204. .input = {{
  205. .type = CX88_VMUX_TELEVISION,
  206. .vmux = 0,
  207. .gpio0 = 0x000040bf,
  208. .gpio1 = 0x000080c0,
  209. .gpio2 = 0x0000ff40,
  210. },{
  211. .type = CX88_VMUX_COMPOSITE1,
  212. .vmux = 1,
  213. .gpio0 = 0x000040bf,
  214. .gpio1 = 0x000080c0,
  215. .gpio2 = 0x0000ff40,
  216. },{
  217. .type = CX88_VMUX_SVIDEO,
  218. .vmux = 2,
  219. .gpio0 = 0x000040bf,
  220. .gpio1 = 0x000080c0,
  221. .gpio2 = 0x0000ff40,
  222. }},
  223. .radio = {
  224. .type = CX88_RADIO,
  225. },
  226. },
  227. [CX88_BOARD_WINFAST_DV2000] = {
  228. .name = "Leadtek Winfast DV2000",
  229. .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
  230. .radio_type = UNSET,
  231. .tuner_addr = ADDR_UNSET,
  232. .radio_addr = ADDR_UNSET,
  233. .tda9887_conf = TDA9887_PRESENT,
  234. .input = {{
  235. .type = CX88_VMUX_TELEVISION,
  236. .vmux = 0,
  237. .gpio0 = 0x0035e700,
  238. .gpio1 = 0x00003004,
  239. .gpio2 = 0x0035e700,
  240. .gpio3 = 0x02000000,
  241. },{
  242. .type = CX88_VMUX_COMPOSITE1,
  243. .vmux = 1,
  244. .gpio0 = 0x0035c700,
  245. .gpio1 = 0x00003004,
  246. .gpio2 = 0x0035c700,
  247. .gpio3 = 0x02000000,
  248. },{
  249. .type = CX88_VMUX_SVIDEO,
  250. .vmux = 2,
  251. .gpio0 = 0x0035c700,
  252. .gpio1 = 0x0035c700,
  253. .gpio2 = 0x02000000,
  254. .gpio3 = 0x02000000,
  255. }},
  256. .radio = {
  257. .type = CX88_RADIO,
  258. .gpio0 = 0x0035d700,
  259. .gpio1 = 0x00007004,
  260. .gpio2 = 0x0035d700,
  261. .gpio3 = 0x02000000,
  262. },
  263. },
  264. [CX88_BOARD_LEADTEK_PVR2000] = {
  265. // gpio values for PAL version from regspy by DScaler
  266. .name = "Leadtek PVR 2000",
  267. .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
  268. .radio_type = UNSET,
  269. .tuner_addr = ADDR_UNSET,
  270. .radio_addr = ADDR_UNSET,
  271. .tda9887_conf = TDA9887_PRESENT,
  272. .input = {{
  273. .type = CX88_VMUX_TELEVISION,
  274. .vmux = 0,
  275. .gpio0 = 0x0000bde2,
  276. },{
  277. .type = CX88_VMUX_COMPOSITE1,
  278. .vmux = 1,
  279. .gpio0 = 0x0000bde6,
  280. },{
  281. .type = CX88_VMUX_SVIDEO,
  282. .vmux = 2,
  283. .gpio0 = 0x0000bde6,
  284. }},
  285. .radio = {
  286. .type = CX88_RADIO,
  287. .gpio0 = 0x0000bd62,
  288. },
  289. .blackbird = 1,
  290. },
  291. [CX88_BOARD_IODATA_GVVCP3PCI] = {
  292. .name = "IODATA GV-VCP3/PCI",
  293. .tuner_type = TUNER_ABSENT,
  294. .radio_type = UNSET,
  295. .tuner_addr = ADDR_UNSET,
  296. .radio_addr = ADDR_UNSET,
  297. .input = {{
  298. .type = CX88_VMUX_COMPOSITE1,
  299. .vmux = 0,
  300. },{
  301. .type = CX88_VMUX_COMPOSITE2,
  302. .vmux = 1,
  303. },{
  304. .type = CX88_VMUX_SVIDEO,
  305. .vmux = 2,
  306. }},
  307. },
  308. [CX88_BOARD_PROLINK_PLAYTVPVR] = {
  309. .name = "Prolink PlayTV PVR",
  310. .tuner_type = TUNER_PHILIPS_FM1236_MK3,
  311. .radio_type = UNSET,
  312. .tuner_addr = ADDR_UNSET,
  313. .radio_addr = ADDR_UNSET,
  314. .tda9887_conf = TDA9887_PRESENT,
  315. .input = {{
  316. .type = CX88_VMUX_TELEVISION,
  317. .vmux = 0,
  318. .gpio0 = 0xff00,
  319. },{
  320. .type = CX88_VMUX_COMPOSITE1,
  321. .vmux = 1,
  322. .gpio0 = 0xff03,
  323. },{
  324. .type = CX88_VMUX_SVIDEO,
  325. .vmux = 2,
  326. .gpio0 = 0xff03,
  327. }},
  328. .radio = {
  329. .type = CX88_RADIO,
  330. .gpio0 = 0xff00,
  331. },
  332. },
  333. [CX88_BOARD_ASUS_PVR_416] = {
  334. .name = "ASUS PVR-416",
  335. .tuner_type = TUNER_PHILIPS_FM1236_MK3,
  336. .radio_type = UNSET,
  337. .tuner_addr = ADDR_UNSET,
  338. .radio_addr = ADDR_UNSET,
  339. .tda9887_conf = TDA9887_PRESENT,
  340. .input = {{
  341. .type = CX88_VMUX_TELEVISION,
  342. .vmux = 0,
  343. .gpio0 = 0x0000fde6,
  344. },{
  345. .type = CX88_VMUX_SVIDEO,
  346. .vmux = 2,
  347. .gpio0 = 0x0000fde6, // 0x0000fda6 L,R RCA audio in?
  348. }},
  349. .radio = {
  350. .type = CX88_RADIO,
  351. .gpio0 = 0x0000fde2,
  352. },
  353. .blackbird = 1,
  354. },
  355. [CX88_BOARD_MSI_TVANYWHERE] = {
  356. .name = "MSI TV-@nywhere",
  357. .tuner_type = TUNER_MT2032,
  358. .radio_type = UNSET,
  359. .tuner_addr = ADDR_UNSET,
  360. .radio_addr = ADDR_UNSET,
  361. .tda9887_conf = TDA9887_PRESENT,
  362. .input = {{
  363. .type = CX88_VMUX_TELEVISION,
  364. .vmux = 0,
  365. .gpio0 = 0x00000fbf,
  366. .gpio2 = 0x0000fc08,
  367. },{
  368. .type = CX88_VMUX_COMPOSITE1,
  369. .vmux = 1,
  370. .gpio0 = 0x00000fbf,
  371. .gpio2 = 0x0000fc68,
  372. },{
  373. .type = CX88_VMUX_SVIDEO,
  374. .vmux = 2,
  375. .gpio0 = 0x00000fbf,
  376. .gpio2 = 0x0000fc68,
  377. }},
  378. },
  379. [CX88_BOARD_KWORLD_DVB_T] = {
  380. .name = "KWorld/VStream XPert DVB-T",
  381. .tuner_type = TUNER_ABSENT,
  382. .radio_type = UNSET,
  383. .tuner_addr = ADDR_UNSET,
  384. .radio_addr = ADDR_UNSET,
  385. .input = {{
  386. .type = CX88_VMUX_COMPOSITE1,
  387. .vmux = 1,
  388. .gpio0 = 0x0700,
  389. .gpio2 = 0x0101,
  390. },{
  391. .type = CX88_VMUX_SVIDEO,
  392. .vmux = 2,
  393. .gpio0 = 0x0700,
  394. .gpio2 = 0x0101,
  395. }},
  396. .dvb = 1,
  397. },
  398. [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1] = {
  399. .name = "DViCO FusionHDTV DVB-T1",
  400. .tuner_type = TUNER_ABSENT, /* No analog tuner */
  401. .radio_type = UNSET,
  402. .tuner_addr = ADDR_UNSET,
  403. .radio_addr = ADDR_UNSET,
  404. .input = {{
  405. .type = CX88_VMUX_COMPOSITE1,
  406. .vmux = 1,
  407. .gpio0 = 0x000027df,
  408. },{
  409. .type = CX88_VMUX_SVIDEO,
  410. .vmux = 2,
  411. .gpio0 = 0x000027df,
  412. }},
  413. .dvb = 1,
  414. },
  415. [CX88_BOARD_KWORLD_LTV883] = {
  416. .name = "KWorld LTV883RF",
  417. .tuner_type = TUNER_TNF_8831BGFF,
  418. .radio_type = UNSET,
  419. .tuner_addr = ADDR_UNSET,
  420. .radio_addr = ADDR_UNSET,
  421. .input = {{
  422. .type = CX88_VMUX_TELEVISION,
  423. .vmux = 0,
  424. .gpio0 = 0x07f8,
  425. },{
  426. .type = CX88_VMUX_DEBUG,
  427. .vmux = 0,
  428. .gpio0 = 0x07f9, // mono from tuner chip
  429. },{
  430. .type = CX88_VMUX_COMPOSITE1,
  431. .vmux = 1,
  432. .gpio0 = 0x000007fa,
  433. },{
  434. .type = CX88_VMUX_SVIDEO,
  435. .vmux = 2,
  436. .gpio0 = 0x000007fa,
  437. }},
  438. .radio = {
  439. .type = CX88_RADIO,
  440. .gpio0 = 0x000007f8,
  441. },
  442. },
  443. [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q] = {
  444. .name = "DViCO FusionHDTV 3 Gold-Q",
  445. .tuner_type = TUNER_MICROTUNE_4042FI5,
  446. .radio_type = UNSET,
  447. .tuner_addr = ADDR_UNSET,
  448. .radio_addr = ADDR_UNSET,
  449. /*
  450. GPIO[0] resets DT3302 DTV receiver
  451. 0 - reset asserted
  452. 1 - normal operation
  453. GPIO[1] mutes analog audio output connector
  454. 0 - enable selected source
  455. 1 - mute
  456. GPIO[2] selects source for analog audio output connector
  457. 0 - analog audio input connector on tab
  458. 1 - analog DAC output from CX23881 chip
  459. GPIO[3] selects RF input connector on tuner module
  460. 0 - RF connector labeled CABLE
  461. 1 - RF connector labeled ANT
  462. GPIO[4] selects high RF for QAM256 mode
  463. 0 - normal RF
  464. 1 - high RF
  465. */
  466. .input = {{
  467. .type = CX88_VMUX_TELEVISION,
  468. .vmux = 0,
  469. .gpio0 = 0x0f0d,
  470. },{
  471. .type = CX88_VMUX_CABLE,
  472. .vmux = 0,
  473. .gpio0 = 0x0f05,
  474. },{
  475. .type = CX88_VMUX_COMPOSITE1,
  476. .vmux = 1,
  477. .gpio0 = 0x0f00,
  478. },{
  479. .type = CX88_VMUX_SVIDEO,
  480. .vmux = 2,
  481. .gpio0 = 0x0f00,
  482. }},
  483. .dvb = 1,
  484. },
  485. [CX88_BOARD_HAUPPAUGE_DVB_T1] = {
  486. .name = "Hauppauge Nova-T DVB-T",
  487. .tuner_type = TUNER_ABSENT,
  488. .radio_type = UNSET,
  489. .tuner_addr = ADDR_UNSET,
  490. .radio_addr = ADDR_UNSET,
  491. .input = {{
  492. .type = CX88_VMUX_DVB,
  493. .vmux = 0,
  494. }},
  495. .dvb = 1,
  496. },
  497. [CX88_BOARD_CONEXANT_DVB_T1] = {
  498. .name = "Conexant DVB-T reference design",
  499. .tuner_type = TUNER_ABSENT,
  500. .radio_type = UNSET,
  501. .tuner_addr = ADDR_UNSET,
  502. .radio_addr = ADDR_UNSET,
  503. .input = {{
  504. .type = CX88_VMUX_DVB,
  505. .vmux = 0,
  506. }},
  507. .dvb = 1,
  508. },
  509. [CX88_BOARD_PROVIDEO_PV259] = {
  510. .name = "Provideo PV259",
  511. .tuner_type = TUNER_PHILIPS_FQ1216ME,
  512. .radio_type = UNSET,
  513. .tuner_addr = ADDR_UNSET,
  514. .radio_addr = ADDR_UNSET,
  515. .input = {{
  516. .type = CX88_VMUX_TELEVISION,
  517. .vmux = 0,
  518. }},
  519. .blackbird = 1,
  520. },
  521. [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS] = {
  522. .name = "DViCO FusionHDTV DVB-T Plus",
  523. .tuner_type = TUNER_ABSENT, /* No analog tuner */
  524. .radio_type = UNSET,
  525. .tuner_addr = ADDR_UNSET,
  526. .radio_addr = ADDR_UNSET,
  527. .input = {{
  528. .type = CX88_VMUX_COMPOSITE1,
  529. .vmux = 1,
  530. .gpio0 = 0x000027df,
  531. },{
  532. .type = CX88_VMUX_SVIDEO,
  533. .vmux = 2,
  534. .gpio0 = 0x000027df,
  535. }},
  536. .dvb = 1,
  537. },
  538. [CX88_BOARD_DNTV_LIVE_DVB_T] = {
  539. .name = "digitalnow DNTV Live! DVB-T",
  540. .tuner_type = TUNER_ABSENT,
  541. .radio_type = UNSET,
  542. .tuner_addr = ADDR_UNSET,
  543. .radio_addr = ADDR_UNSET,
  544. .input = {{
  545. .type = CX88_VMUX_COMPOSITE1,
  546. .vmux = 1,
  547. .gpio0 = 0x00000700,
  548. .gpio2 = 0x00000101,
  549. },{
  550. .type = CX88_VMUX_SVIDEO,
  551. .vmux = 2,
  552. .gpio0 = 0x00000700,
  553. .gpio2 = 0x00000101,
  554. }},
  555. .dvb = 1,
  556. },
  557. [CX88_BOARD_PCHDTV_HD3000] = {
  558. .name = "pcHDTV HD3000 HDTV",
  559. .tuner_type = TUNER_THOMSON_DTT7610,
  560. .radio_type = UNSET,
  561. .tuner_addr = ADDR_UNSET,
  562. .radio_addr = ADDR_UNSET,
  563. .input = {{
  564. .type = CX88_VMUX_TELEVISION,
  565. .vmux = 0,
  566. .gpio0 = 0x00008484,
  567. .gpio1 = 0x00000000,
  568. .gpio2 = 0x00000000,
  569. .gpio3 = 0x00000000,
  570. },{
  571. .type = CX88_VMUX_COMPOSITE1,
  572. .vmux = 1,
  573. .gpio0 = 0x00008400,
  574. .gpio1 = 0x00000000,
  575. .gpio2 = 0x00000000,
  576. .gpio3 = 0x00000000,
  577. },{
  578. .type = CX88_VMUX_SVIDEO,
  579. .vmux = 2,
  580. .gpio0 = 0x00008400,
  581. .gpio1 = 0x00000000,
  582. .gpio2 = 0x00000000,
  583. .gpio3 = 0x00000000,
  584. }},
  585. .radio = {
  586. .type = CX88_RADIO,
  587. .vmux = 2,
  588. .gpio0 = 0x00008400,
  589. .gpio1 = 0x00000000,
  590. .gpio2 = 0x00000000,
  591. .gpio3 = 0x00000000,
  592. },
  593. .dvb = 1,
  594. },
  595. [CX88_BOARD_HAUPPAUGE_ROSLYN] = {
  596. // entry added by Kaustubh D. Bhalerao <bhalerao.1@osu.edu>
  597. // GPIO values obtained from regspy, courtesy Sean Covel
  598. .name = "Hauppauge WinTV 28xxx (Roslyn) models",
  599. .tuner_type = UNSET,
  600. .radio_type = UNSET,
  601. .tuner_addr = ADDR_UNSET,
  602. .radio_addr = ADDR_UNSET,
  603. .input = {{
  604. .type = CX88_VMUX_TELEVISION,
  605. .vmux = 0,
  606. .gpio0 = 0xed12, // internal decoder
  607. .gpio2 = 0x00ff,
  608. },{
  609. .type = CX88_VMUX_DEBUG,
  610. .vmux = 0,
  611. .gpio0 = 0xff01, // mono from tuner chip
  612. },{
  613. .type = CX88_VMUX_COMPOSITE1,
  614. .vmux = 1,
  615. .gpio0 = 0xff02,
  616. },{
  617. .type = CX88_VMUX_SVIDEO,
  618. .vmux = 2,
  619. .gpio0 = 0xed92,
  620. .gpio2 = 0x00ff,
  621. }},
  622. .radio = {
  623. .type = CX88_RADIO,
  624. .gpio0 = 0xed96,
  625. .gpio2 = 0x00ff,
  626. },
  627. .blackbird = 1,
  628. },
  629. [CX88_BOARD_DIGITALLOGIC_MEC] = {
  630. .name = "Digital-Logic MICROSPACE Entertainment Center (MEC)",
  631. .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
  632. .radio_type = UNSET,
  633. .tuner_addr = ADDR_UNSET,
  634. .radio_addr = ADDR_UNSET,
  635. .tda9887_conf = TDA9887_PRESENT,
  636. .input = {{
  637. .type = CX88_VMUX_TELEVISION,
  638. .vmux = 0,
  639. .gpio0 = 0x00009d80,
  640. },{
  641. .type = CX88_VMUX_COMPOSITE1,
  642. .vmux = 1,
  643. .gpio0 = 0x00009d76,
  644. },{
  645. .type = CX88_VMUX_SVIDEO,
  646. .vmux = 2,
  647. .gpio0 = 0x00009d76,
  648. }},
  649. .radio = {
  650. .type = CX88_RADIO,
  651. .gpio0 = 0x00009d00,
  652. },
  653. .blackbird = 1,
  654. },
  655. [CX88_BOARD_IODATA_GVBCTV7E] = {
  656. .name = "IODATA GV/BCTV7E",
  657. .tuner_type = TUNER_PHILIPS_FQ1286,
  658. .radio_type = UNSET,
  659. .tuner_addr = ADDR_UNSET,
  660. .radio_addr = ADDR_UNSET,
  661. .tda9887_conf = TDA9887_PRESENT,
  662. .input = {{
  663. .type = CX88_VMUX_TELEVISION,
  664. .vmux = 1,
  665. .gpio1 = 0x0000e03f,
  666. },{
  667. .type = CX88_VMUX_COMPOSITE1,
  668. .vmux = 2,
  669. .gpio1 = 0x0000e07f,
  670. },{
  671. .type = CX88_VMUX_SVIDEO,
  672. .vmux = 3,
  673. .gpio1 = 0x0000e07f,
  674. }}
  675. },
  676. [CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO] = {
  677. .name = "PixelView PlayTV Ultra Pro (Stereo)",
  678. /* May be also TUNER_YMEC_TVF_5533MF for NTSC/M or PAL/M */
  679. .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
  680. .radio_type = TUNER_TEA5767,
  681. .tuner_addr = 0xc2>>1,
  682. .radio_addr = 0xc0>>1,
  683. .input = {{
  684. .type = CX88_VMUX_TELEVISION,
  685. .vmux = 0,
  686. .gpio0 = 0xbf61, /* internal decoder */
  687. },{
  688. .type = CX88_VMUX_COMPOSITE1,
  689. .vmux = 1,
  690. .gpio0 = 0xbf63,
  691. },{
  692. .type = CX88_VMUX_SVIDEO,
  693. .vmux = 2,
  694. .gpio0 = 0xbf63,
  695. }},
  696. .radio = {
  697. .type = CX88_RADIO,
  698. .gpio0 = 0xbf60,
  699. },
  700. },
  701. [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T] = {
  702. .name = "DViCO FusionHDTV 3 Gold-T",
  703. .tuner_type = TUNER_THOMSON_DTT7611,
  704. .radio_type = UNSET,
  705. .tuner_addr = ADDR_UNSET,
  706. .radio_addr = ADDR_UNSET,
  707. /* See DViCO FusionHDTV 3 Gold-Q for GPIO documentation. */
  708. .input = {{
  709. .type = CX88_VMUX_TELEVISION,
  710. .vmux = 0,
  711. .gpio0 = 0x0f0d,
  712. },{
  713. .type = CX88_VMUX_COMPOSITE1,
  714. .vmux = 1,
  715. .gpio0 = 0x0f00,
  716. },{
  717. .type = CX88_VMUX_SVIDEO,
  718. .vmux = 2,
  719. .gpio0 = 0x0f00,
  720. }},
  721. },
  722. [CX88_BOARD_ADSTECH_DVB_T_PCI] = {
  723. .name = "ADS Tech Instant TV DVB-T PCI",
  724. .tuner_type = TUNER_ABSENT,
  725. .radio_type = UNSET,
  726. .tuner_addr = ADDR_UNSET,
  727. .radio_addr = ADDR_UNSET,
  728. .input = {{
  729. .type = CX88_VMUX_COMPOSITE1,
  730. .vmux = 1,
  731. .gpio0 = 0x0700,
  732. .gpio2 = 0x0101,
  733. },{
  734. .type = CX88_VMUX_SVIDEO,
  735. .vmux = 2,
  736. .gpio0 = 0x0700,
  737. .gpio2 = 0x0101,
  738. }},
  739. .dvb = 1,
  740. },
  741. [CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1] = {
  742. .name = "TerraTec Cinergy 1400 DVB-T",
  743. .tuner_type = TUNER_ABSENT,
  744. .input = {{
  745. .type = CX88_VMUX_DVB,
  746. .vmux = 0,
  747. }},
  748. .dvb = 1,
  749. },
  750. };
  751. const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards);
  752. /* ------------------------------------------------------------------ */
  753. /* PCI subsystem IDs */
  754. struct cx88_subid cx88_subids[] = {
  755. {
  756. .subvendor = 0x0070,
  757. .subdevice = 0x3400,
  758. .card = CX88_BOARD_HAUPPAUGE,
  759. },{
  760. .subvendor = 0x0070,
  761. .subdevice = 0x3401,
  762. .card = CX88_BOARD_HAUPPAUGE,
  763. },{
  764. .subvendor = 0x14c7,
  765. .subdevice = 0x0106,
  766. .card = CX88_BOARD_GDI,
  767. },{
  768. .subvendor = 0x14c7,
  769. .subdevice = 0x0107, /* with mpeg encoder */
  770. .card = CX88_BOARD_GDI,
  771. },{
  772. .subvendor = PCI_VENDOR_ID_ATI,
  773. .subdevice = 0x00f8,
  774. .card = CX88_BOARD_ATI_WONDER_PRO,
  775. },{
  776. .subvendor = 0x107d,
  777. .subdevice = 0x6611,
  778. .card = CX88_BOARD_WINFAST2000XP_EXPERT,
  779. },{
  780. .subvendor = 0x107d,
  781. .subdevice = 0x6613, /* NTSC */
  782. .card = CX88_BOARD_WINFAST2000XP_EXPERT,
  783. },{
  784. .subvendor = 0x107d,
  785. .subdevice = 0x6620,
  786. .card = CX88_BOARD_WINFAST_DV2000,
  787. },{
  788. .subvendor = 0x107d,
  789. .subdevice = 0x663b,
  790. .card = CX88_BOARD_LEADTEK_PVR2000,
  791. },{
  792. .subvendor = 0x107d,
  793. .subdevice = 0x663C,
  794. .card = CX88_BOARD_LEADTEK_PVR2000,
  795. },{
  796. .subvendor = 0x1461,
  797. .subdevice = 0x000b,
  798. .card = CX88_BOARD_AVERTV_303,
  799. },{
  800. .subvendor = 0x1462,
  801. .subdevice = 0x8606,
  802. .card = CX88_BOARD_MSI_TVANYWHERE_MASTER,
  803. },{
  804. .subvendor = 0x10fc,
  805. .subdevice = 0xd003,
  806. .card = CX88_BOARD_IODATA_GVVCP3PCI,
  807. },{
  808. .subvendor = 0x1043,
  809. .subdevice = 0x4823, /* with mpeg encoder */
  810. .card = CX88_BOARD_ASUS_PVR_416,
  811. },{
  812. .subvendor = 0x17de,
  813. .subdevice = 0x08a6,
  814. .card = CX88_BOARD_KWORLD_DVB_T,
  815. },{
  816. .subvendor = 0x18ac,
  817. .subdevice = 0xd810,
  818. .card = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q,
  819. },{
  820. .subvendor = 0x18ac,
  821. .subdevice = 0xd820,
  822. .card = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T,
  823. },{
  824. .subvendor = 0x18AC,
  825. .subdevice = 0xDB00,
  826. .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1,
  827. },{
  828. .subvendor = 0x0070,
  829. .subdevice = 0x9002,
  830. .card = CX88_BOARD_HAUPPAUGE_DVB_T1,
  831. },{
  832. .subvendor = 0x14f1,
  833. .subdevice = 0x0187,
  834. .card = CX88_BOARD_CONEXANT_DVB_T1,
  835. },{
  836. .subvendor = 0x1540,
  837. .subdevice = 0x2580,
  838. .card = CX88_BOARD_PROVIDEO_PV259,
  839. },{
  840. .subvendor = 0x18AC,
  841. .subdevice = 0xDB10,
  842. .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS,
  843. },{
  844. .subvendor = 0x1554,
  845. .subdevice = 0x4811,
  846. .card = CX88_BOARD_PIXELVIEW,
  847. },{
  848. .subvendor = 0x7063,
  849. .subdevice = 0x3000, /* HD-3000 card */
  850. .card = CX88_BOARD_PCHDTV_HD3000,
  851. },{
  852. .subvendor = 0x17DE,
  853. .subdevice = 0xA8A6,
  854. .card = CX88_BOARD_DNTV_LIVE_DVB_T,
  855. },{
  856. .subvendor = 0x0070,
  857. .subdevice = 0x2801,
  858. .card = CX88_BOARD_HAUPPAUGE_ROSLYN,
  859. },{
  860. .subvendor = 0x14F1,
  861. .subdevice = 0x0342,
  862. .card = CX88_BOARD_DIGITALLOGIC_MEC,
  863. },{
  864. .subvendor = 0x10fc,
  865. .subdevice = 0xd035,
  866. .card = CX88_BOARD_IODATA_GVBCTV7E,
  867. },{
  868. .subvendor = 0x1421,
  869. .subdevice = 0x0334,
  870. .card = CX88_BOARD_ADSTECH_DVB_T_PCI,
  871. },{
  872. .subvendor = 0x153b,
  873. .subdevice = 0x1166,
  874. .card = CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1,
  875. },
  876. };
  877. const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids);
  878. /* ----------------------------------------------------------------------- */
  879. /* some leadtek specific stuff */
  880. static void __devinit leadtek_eeprom(struct cx88_core *core, u8 *eeprom_data)
  881. {
  882. /* This is just for the "Winfast 2000XP Expert" board ATM; I don't have data on
  883. * any others.
  884. *
  885. * Byte 0 is 1 on the NTSC board.
  886. */
  887. if (eeprom_data[4] != 0x7d ||
  888. eeprom_data[5] != 0x10 ||
  889. eeprom_data[7] != 0x66) {
  890. printk(KERN_WARNING "%s: Leadtek eeprom invalid.\n",
  891. core->name);
  892. return;
  893. }
  894. core->has_radio = 1;
  895. core->tuner_type = (eeprom_data[6] == 0x13) ? 43 : 38;
  896. printk(KERN_INFO "%s: Leadtek Winfast 2000XP Expert config: "
  897. "tuner=%d, eeprom[0]=0x%02x\n",
  898. core->name, core->tuner_type, eeprom_data[0]);
  899. }
  900. /* ----------------------------------------------------------------------- */
  901. static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data)
  902. {
  903. struct tveeprom tv;
  904. tveeprom_hauppauge_analog(&tv, eeprom_data);
  905. core->tuner_type = tv.tuner_type;
  906. core->has_radio = tv.has_radio;
  907. }
  908. static int hauppauge_eeprom_dvb(struct cx88_core *core, u8 *ee)
  909. {
  910. int model;
  911. int tuner;
  912. /* Make sure we support the board model */
  913. model = ee[0x1f] << 24 | ee[0x1e] << 16 | ee[0x1d] << 8 | ee[0x1c];
  914. switch(model) {
  915. case 90002:
  916. case 90500:
  917. case 90501:
  918. /* known */
  919. break;
  920. default:
  921. printk("%s: warning: unknown hauppauge model #%d\n",
  922. core->name, model);
  923. break;
  924. }
  925. /* Make sure we support the tuner */
  926. tuner = ee[0x2d];
  927. switch(tuner) {
  928. case 0x4B: /* dtt 7595 */
  929. case 0x4C: /* dtt 7592 */
  930. break;
  931. default:
  932. printk("%s: error: unknown hauppauge tuner 0x%02x\n",
  933. core->name, tuner);
  934. return -ENODEV;
  935. }
  936. printk(KERN_INFO "%s: hauppauge eeprom: model=%d, tuner=%d\n",
  937. core->name, model, tuner);
  938. return 0;
  939. }
  940. /* ----------------------------------------------------------------------- */
  941. /* some GDI (was: Modular Technology) specific stuff */
  942. static struct {
  943. int id;
  944. int fm;
  945. char *name;
  946. } gdi_tuner[] = {
  947. [ 0x01 ] = { .id = TUNER_ABSENT,
  948. .name = "NTSC_M" },
  949. [ 0x02 ] = { .id = TUNER_ABSENT,
  950. .name = "PAL_B" },
  951. [ 0x03 ] = { .id = TUNER_ABSENT,
  952. .name = "PAL_I" },
  953. [ 0x04 ] = { .id = TUNER_ABSENT,
  954. .name = "PAL_D" },
  955. [ 0x05 ] = { .id = TUNER_ABSENT,
  956. .name = "SECAM" },
  957. [ 0x10 ] = { .id = TUNER_ABSENT,
  958. .fm = 1,
  959. .name = "TEMIC_4049" },
  960. [ 0x11 ] = { .id = TUNER_TEMIC_4136FY5,
  961. .name = "TEMIC_4136" },
  962. [ 0x12 ] = { .id = TUNER_ABSENT,
  963. .name = "TEMIC_4146" },
  964. [ 0x20 ] = { .id = TUNER_PHILIPS_FQ1216ME,
  965. .fm = 1,
  966. .name = "PHILIPS_FQ1216_MK3" },
  967. [ 0x21 ] = { .id = TUNER_ABSENT, .fm = 1,
  968. .name = "PHILIPS_FQ1236_MK3" },
  969. [ 0x22 ] = { .id = TUNER_ABSENT,
  970. .name = "PHILIPS_FI1236_MK3" },
  971. [ 0x23 ] = { .id = TUNER_ABSENT,
  972. .name = "PHILIPS_FI1216_MK3" },
  973. };
  974. static void gdi_eeprom(struct cx88_core *core, u8 *eeprom_data)
  975. {
  976. char *name = (eeprom_data[0x0d] < ARRAY_SIZE(gdi_tuner))
  977. ? gdi_tuner[eeprom_data[0x0d]].name : NULL;
  978. printk(KERN_INFO "%s: GDI: tuner=%s\n", core->name,
  979. name ? name : "unknown");
  980. if (NULL == name)
  981. return;
  982. core->tuner_type = gdi_tuner[eeprom_data[0x0d]].id;
  983. core->has_radio = gdi_tuner[eeprom_data[0x0d]].fm;
  984. }
  985. /* ----------------------------------------------------------------------- */
  986. void cx88_card_list(struct cx88_core *core, struct pci_dev *pci)
  987. {
  988. int i;
  989. if (0 == pci->subsystem_vendor &&
  990. 0 == pci->subsystem_device) {
  991. printk("%s: Your board has no valid PCI Subsystem ID and thus can't\n"
  992. "%s: be autodetected. Please pass card=<n> insmod option to\n"
  993. "%s: workaround that. Redirect complaints to the vendor of\n"
  994. "%s: the TV card. Best regards,\n"
  995. "%s: -- tux\n",
  996. core->name,core->name,core->name,core->name,core->name);
  997. } else {
  998. printk("%s: Your board isn't known (yet) to the driver. You can\n"
  999. "%s: try to pick one of the existing card configs via\n"
  1000. "%s: card=<n> insmod option. Updating to the latest\n"
  1001. "%s: version might help as well.\n",
  1002. core->name,core->name,core->name,core->name);
  1003. }
  1004. printk("%s: Here is a list of valid choices for the card=<n> insmod option:\n",
  1005. core->name);
  1006. for (i = 0; i < cx88_bcount; i++)
  1007. printk("%s: card=%d -> %s\n",
  1008. core->name, i, cx88_boards[i].name);
  1009. }
  1010. void cx88_card_setup(struct cx88_core *core)
  1011. {
  1012. static u8 eeprom[128];
  1013. if (0 == core->i2c_rc) {
  1014. core->i2c_client.addr = 0xa0 >> 1;
  1015. tveeprom_read(&core->i2c_client,eeprom,sizeof(eeprom));
  1016. }
  1017. switch (core->board) {
  1018. case CX88_BOARD_HAUPPAUGE:
  1019. case CX88_BOARD_HAUPPAUGE_ROSLYN:
  1020. if (0 == core->i2c_rc)
  1021. hauppauge_eeprom(core,eeprom+8);
  1022. break;
  1023. case CX88_BOARD_GDI:
  1024. if (0 == core->i2c_rc)
  1025. gdi_eeprom(core,eeprom);
  1026. break;
  1027. case CX88_BOARD_WINFAST2000XP_EXPERT:
  1028. if (0 == core->i2c_rc)
  1029. leadtek_eeprom(core,eeprom);
  1030. break;
  1031. case CX88_BOARD_HAUPPAUGE_DVB_T1:
  1032. if (0 == core->i2c_rc)
  1033. hauppauge_eeprom_dvb(core,eeprom);
  1034. break;
  1035. case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
  1036. case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS:
  1037. /* GPIO0:0 is hooked to mt352 reset pin */
  1038. cx_set(MO_GP0_IO, 0x00000101);
  1039. cx_clear(MO_GP0_IO, 0x00000001);
  1040. msleep(1);
  1041. cx_set(MO_GP0_IO, 0x00000101);
  1042. break;
  1043. case CX88_BOARD_KWORLD_DVB_T:
  1044. case CX88_BOARD_DNTV_LIVE_DVB_T:
  1045. cx_set(MO_GP0_IO, 0x00000707);
  1046. cx_set(MO_GP2_IO, 0x00000101);
  1047. cx_clear(MO_GP2_IO, 0x00000001);
  1048. msleep(1);
  1049. cx_clear(MO_GP0_IO, 0x00000007);
  1050. cx_set(MO_GP2_IO, 0x00000101);
  1051. break;
  1052. }
  1053. if (cx88_boards[core->board].radio.type == CX88_RADIO)
  1054. core->has_radio = 1;
  1055. }
  1056. /* ------------------------------------------------------------------ */
  1057. EXPORT_SYMBOL(cx88_boards);
  1058. EXPORT_SYMBOL(cx88_bcount);
  1059. EXPORT_SYMBOL(cx88_subids);
  1060. EXPORT_SYMBOL(cx88_idcount);
  1061. EXPORT_SYMBOL(cx88_card_list);
  1062. EXPORT_SYMBOL(cx88_card_setup);
  1063. /*
  1064. * Local variables:
  1065. * c-basic-offset: 8
  1066. * End:
  1067. * kate: eol "unix"; indent-width 3; remove-trailing-space on; replace-trailing-space-save on; tab-width 8; replace-tabs off; space-indent off; mixed-indent off
  1068. */