cx88-cards.c 26 KB

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