cx88-cards.c 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088
  1. /*
  2. * $Id: cx88-cards.c,v 1.82 2005/06/28 04:33:53 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. },
  484. [CX88_BOARD_HAUPPAUGE_DVB_T1] = {
  485. .name = "Hauppauge Nova-T DVB-T",
  486. .tuner_type = TUNER_ABSENT,
  487. .radio_type = UNSET,
  488. .tuner_addr = ADDR_UNSET,
  489. .radio_addr = ADDR_UNSET,
  490. .input = {{
  491. .type = CX88_VMUX_DVB,
  492. .vmux = 0,
  493. }},
  494. .dvb = 1,
  495. },
  496. [CX88_BOARD_CONEXANT_DVB_T1] = {
  497. .name = "Conexant DVB-T reference design",
  498. .tuner_type = TUNER_ABSENT,
  499. .radio_type = UNSET,
  500. .tuner_addr = ADDR_UNSET,
  501. .radio_addr = ADDR_UNSET,
  502. .input = {{
  503. .type = CX88_VMUX_DVB,
  504. .vmux = 0,
  505. }},
  506. .dvb = 1,
  507. },
  508. [CX88_BOARD_PROVIDEO_PV259] = {
  509. .name = "Provideo PV259",
  510. .tuner_type = TUNER_PHILIPS_FQ1216ME,
  511. .radio_type = UNSET,
  512. .tuner_addr = ADDR_UNSET,
  513. .radio_addr = ADDR_UNSET,
  514. .input = {{
  515. .type = CX88_VMUX_TELEVISION,
  516. .vmux = 0,
  517. }},
  518. .blackbird = 1,
  519. },
  520. [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS] = {
  521. .name = "DViCO FusionHDTV DVB-T Plus",
  522. .tuner_type = TUNER_ABSENT, /* No analog tuner */
  523. .radio_type = UNSET,
  524. .tuner_addr = ADDR_UNSET,
  525. .radio_addr = ADDR_UNSET,
  526. .input = {{
  527. .type = CX88_VMUX_COMPOSITE1,
  528. .vmux = 1,
  529. .gpio0 = 0x000027df,
  530. },{
  531. .type = CX88_VMUX_SVIDEO,
  532. .vmux = 2,
  533. .gpio0 = 0x000027df,
  534. }},
  535. .dvb = 1,
  536. },
  537. [CX88_BOARD_DNTV_LIVE_DVB_T] = {
  538. .name = "digitalnow DNTV Live! DVB-T",
  539. .tuner_type = TUNER_ABSENT,
  540. .radio_type = UNSET,
  541. .tuner_addr = ADDR_UNSET,
  542. .radio_addr = ADDR_UNSET,
  543. .input = {{
  544. .type = CX88_VMUX_COMPOSITE1,
  545. .vmux = 1,
  546. .gpio0 = 0x00000700,
  547. .gpio2 = 0x00000101,
  548. },{
  549. .type = CX88_VMUX_SVIDEO,
  550. .vmux = 2,
  551. .gpio0 = 0x00000700,
  552. .gpio2 = 0x00000101,
  553. }},
  554. .dvb = 1,
  555. },
  556. [CX88_BOARD_PCHDTV_HD3000] = {
  557. .name = "pcHDTV HD3000 HDTV",
  558. .tuner_type = TUNER_THOMSON_DTT7610,
  559. .radio_type = UNSET,
  560. .tuner_addr = ADDR_UNSET,
  561. .radio_addr = ADDR_UNSET,
  562. .input = {{
  563. .type = CX88_VMUX_TELEVISION,
  564. .vmux = 0,
  565. .gpio0 = 0x00008484,
  566. .gpio1 = 0x00000000,
  567. .gpio2 = 0x00000000,
  568. .gpio3 = 0x00000000,
  569. },{
  570. .type = CX88_VMUX_COMPOSITE1,
  571. .vmux = 1,
  572. .gpio0 = 0x00008400,
  573. .gpio1 = 0x00000000,
  574. .gpio2 = 0x00000000,
  575. .gpio3 = 0x00000000,
  576. },{
  577. .type = CX88_VMUX_SVIDEO,
  578. .vmux = 2,
  579. .gpio0 = 0x00008400,
  580. .gpio1 = 0x00000000,
  581. .gpio2 = 0x00000000,
  582. .gpio3 = 0x00000000,
  583. }},
  584. .radio = {
  585. .type = CX88_RADIO,
  586. .vmux = 2,
  587. .gpio0 = 0x00008400,
  588. .gpio1 = 0x00000000,
  589. .gpio2 = 0x00000000,
  590. .gpio3 = 0x00000000,
  591. },
  592. .dvb = 1,
  593. },
  594. [CX88_BOARD_HAUPPAUGE_ROSLYN] = {
  595. // entry added by Kaustubh D. Bhalerao <bhalerao.1@osu.edu>
  596. // GPIO values obtained from regspy, courtesy Sean Covel
  597. .name = "Hauppauge WinTV 28xxx (Roslyn) models",
  598. .tuner_type = UNSET,
  599. .radio_type = UNSET,
  600. .tuner_addr = ADDR_UNSET,
  601. .radio_addr = ADDR_UNSET,
  602. .input = {{
  603. .type = CX88_VMUX_TELEVISION,
  604. .vmux = 0,
  605. .gpio0 = 0xed12, // internal decoder
  606. .gpio2 = 0x00ff,
  607. },{
  608. .type = CX88_VMUX_DEBUG,
  609. .vmux = 0,
  610. .gpio0 = 0xff01, // mono from tuner chip
  611. },{
  612. .type = CX88_VMUX_COMPOSITE1,
  613. .vmux = 1,
  614. .gpio0 = 0xff02,
  615. },{
  616. .type = CX88_VMUX_SVIDEO,
  617. .vmux = 2,
  618. .gpio0 = 0xed92,
  619. .gpio2 = 0x00ff,
  620. }},
  621. .radio = {
  622. .type = CX88_RADIO,
  623. .gpio0 = 0xed96,
  624. .gpio2 = 0x00ff,
  625. },
  626. .blackbird = 1,
  627. },
  628. [CX88_BOARD_DIGITALLOGIC_MEC] = {
  629. .name = "Digital-Logic MICROSPACE Entertainment Center (MEC)",
  630. .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
  631. .radio_type = UNSET,
  632. .tuner_addr = ADDR_UNSET,
  633. .radio_addr = ADDR_UNSET,
  634. .tda9887_conf = TDA9887_PRESENT,
  635. .input = {{
  636. .type = CX88_VMUX_TELEVISION,
  637. .vmux = 0,
  638. .gpio0 = 0x00009d80,
  639. },{
  640. .type = CX88_VMUX_COMPOSITE1,
  641. .vmux = 1,
  642. .gpio0 = 0x00009d76,
  643. },{
  644. .type = CX88_VMUX_SVIDEO,
  645. .vmux = 2,
  646. .gpio0 = 0x00009d76,
  647. }},
  648. .radio = {
  649. .type = CX88_RADIO,
  650. .gpio0 = 0x00009d00,
  651. },
  652. .blackbird = 1,
  653. },
  654. [CX88_BOARD_IODATA_GVBCTV7E] = {
  655. .name = "IODATA GV/BCTV7E",
  656. .tuner_type = TUNER_PHILIPS_FQ1286,
  657. .radio_type = UNSET,
  658. .tuner_addr = ADDR_UNSET,
  659. .radio_addr = ADDR_UNSET,
  660. .tda9887_conf = TDA9887_PRESENT,
  661. .input = {{
  662. .type = CX88_VMUX_TELEVISION,
  663. .vmux = 1,
  664. .gpio1 = 0x0000e03f,
  665. },{
  666. .type = CX88_VMUX_COMPOSITE1,
  667. .vmux = 2,
  668. .gpio1 = 0x0000e07f,
  669. },{
  670. .type = CX88_VMUX_SVIDEO,
  671. .vmux = 3,
  672. .gpio1 = 0x0000e07f,
  673. }}
  674. },
  675. [CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO] = {
  676. .name = "PixelView PlayTV Ultra Pro (Stereo)",
  677. /* May be also TUNER_YMEC_TVF_5533MF for NTSC/M or PAL/M */
  678. .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
  679. .radio_type = TUNER_TEA5767,
  680. .tuner_addr = 0xc2>>1,
  681. .radio_addr = 0xc0>>1,
  682. .input = {{
  683. .type = CX88_VMUX_TELEVISION,
  684. .vmux = 0,
  685. .gpio0 = 0xbf61, /* internal decoder */
  686. },{
  687. .type = CX88_VMUX_COMPOSITE1,
  688. .vmux = 1,
  689. .gpio0 = 0xbf63,
  690. },{
  691. .type = CX88_VMUX_SVIDEO,
  692. .vmux = 2,
  693. .gpio0 = 0xbf63,
  694. }},
  695. .radio = {
  696. .type = CX88_RADIO,
  697. .gpio0 = 0xbf60,
  698. },
  699. },
  700. [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T] = {
  701. .name = "DViCO FusionHDTV 3 Gold-T",
  702. .tuner_type = TUNER_THOMSON_DTT7611,
  703. .radio_type = UNSET,
  704. .tuner_addr = ADDR_UNSET,
  705. .radio_addr = ADDR_UNSET,
  706. /* See DViCO FusionHDTV 3 Gold-Q for GPIO documentation. */
  707. .input = {{
  708. .type = CX88_VMUX_TELEVISION,
  709. .vmux = 0,
  710. .gpio0 = 0x0f0d,
  711. },{
  712. .type = CX88_VMUX_COMPOSITE1,
  713. .vmux = 1,
  714. .gpio0 = 0x0f00,
  715. },{
  716. .type = CX88_VMUX_SVIDEO,
  717. .vmux = 2,
  718. .gpio0 = 0x0f00,
  719. }},
  720. },
  721. [CX88_BOARD_ADSTECH_DVB_T_PCI] = {
  722. .name = "ADS Tech Instant TV DVB-T PCI",
  723. .tuner_type = TUNER_ABSENT,
  724. .radio_type = UNSET,
  725. .tuner_addr = ADDR_UNSET,
  726. .radio_addr = ADDR_UNSET,
  727. .input = {{
  728. .type = CX88_VMUX_COMPOSITE1,
  729. .vmux = 1,
  730. .gpio0 = 0x0700,
  731. .gpio2 = 0x0101,
  732. },{
  733. .type = CX88_VMUX_SVIDEO,
  734. .vmux = 2,
  735. .gpio0 = 0x0700,
  736. .gpio2 = 0x0101,
  737. }},
  738. .dvb = 1,
  739. },
  740. };
  741. const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards);
  742. /* ------------------------------------------------------------------ */
  743. /* PCI subsystem IDs */
  744. struct cx88_subid cx88_subids[] = {
  745. {
  746. .subvendor = 0x0070,
  747. .subdevice = 0x3400,
  748. .card = CX88_BOARD_HAUPPAUGE,
  749. },{
  750. .subvendor = 0x0070,
  751. .subdevice = 0x3401,
  752. .card = CX88_BOARD_HAUPPAUGE,
  753. },{
  754. .subvendor = 0x14c7,
  755. .subdevice = 0x0106,
  756. .card = CX88_BOARD_GDI,
  757. },{
  758. .subvendor = 0x14c7,
  759. .subdevice = 0x0107, /* with mpeg encoder */
  760. .card = CX88_BOARD_GDI,
  761. },{
  762. .subvendor = PCI_VENDOR_ID_ATI,
  763. .subdevice = 0x00f8,
  764. .card = CX88_BOARD_ATI_WONDER_PRO,
  765. },{
  766. .subvendor = 0x107d,
  767. .subdevice = 0x6611,
  768. .card = CX88_BOARD_WINFAST2000XP_EXPERT,
  769. },{
  770. .subvendor = 0x107d,
  771. .subdevice = 0x6613, /* NTSC */
  772. .card = CX88_BOARD_WINFAST2000XP_EXPERT,
  773. },{
  774. .subvendor = 0x107d,
  775. .subdevice = 0x6620,
  776. .card = CX88_BOARD_WINFAST_DV2000,
  777. },{
  778. .subvendor = 0x107d,
  779. .subdevice = 0x663b,
  780. .card = CX88_BOARD_LEADTEK_PVR2000,
  781. },{
  782. .subvendor = 0x107d,
  783. .subdevice = 0x663C,
  784. .card = CX88_BOARD_LEADTEK_PVR2000,
  785. },{
  786. .subvendor = 0x1461,
  787. .subdevice = 0x000b,
  788. .card = CX88_BOARD_AVERTV_303,
  789. },{
  790. .subvendor = 0x1462,
  791. .subdevice = 0x8606,
  792. .card = CX88_BOARD_MSI_TVANYWHERE_MASTER,
  793. },{
  794. .subvendor = 0x10fc,
  795. .subdevice = 0xd003,
  796. .card = CX88_BOARD_IODATA_GVVCP3PCI,
  797. },{
  798. .subvendor = 0x1043,
  799. .subdevice = 0x4823, /* with mpeg encoder */
  800. .card = CX88_BOARD_ASUS_PVR_416,
  801. },{
  802. .subvendor = 0x17de,
  803. .subdevice = 0x08a6,
  804. .card = CX88_BOARD_KWORLD_DVB_T,
  805. },{
  806. .subvendor = 0x18ac,
  807. .subdevice = 0xd810,
  808. .card = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q,
  809. },{
  810. .subvendor = 0x18ac,
  811. .subdevice = 0xd820,
  812. .card = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T,
  813. },{
  814. .subvendor = 0x18AC,
  815. .subdevice = 0xDB00,
  816. .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1,
  817. },{
  818. .subvendor = 0x0070,
  819. .subdevice = 0x9002,
  820. .card = CX88_BOARD_HAUPPAUGE_DVB_T1,
  821. },{
  822. .subvendor = 0x14f1,
  823. .subdevice = 0x0187,
  824. .card = CX88_BOARD_CONEXANT_DVB_T1,
  825. },{
  826. .subvendor = 0x1540,
  827. .subdevice = 0x2580,
  828. .card = CX88_BOARD_PROVIDEO_PV259,
  829. },{
  830. .subvendor = 0x18AC,
  831. .subdevice = 0xDB10,
  832. .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS,
  833. },{
  834. .subvendor = 0x1554,
  835. .subdevice = 0x4811,
  836. .card = CX88_BOARD_PIXELVIEW,
  837. },{
  838. .subvendor = 0x7063,
  839. .subdevice = 0x3000, /* HD-3000 card */
  840. .card = CX88_BOARD_PCHDTV_HD3000,
  841. },{
  842. .subvendor = 0x17DE,
  843. .subdevice = 0xA8A6,
  844. .card = CX88_BOARD_DNTV_LIVE_DVB_T,
  845. },{
  846. .subvendor = 0x0070,
  847. .subdevice = 0x2801,
  848. .card = CX88_BOARD_HAUPPAUGE_ROSLYN,
  849. },{
  850. .subvendor = 0x14F1,
  851. .subdevice = 0x0342,
  852. .card = CX88_BOARD_DIGITALLOGIC_MEC,
  853. },{
  854. .subvendor = 0x10fc,
  855. .subdevice = 0xd035,
  856. .card = CX88_BOARD_IODATA_GVBCTV7E,
  857. },{
  858. .subvendor = 0x1421,
  859. .subdevice = 0x0334,
  860. .card = CX88_BOARD_ADSTECH_DVB_T_PCI,
  861. },
  862. };
  863. const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids);
  864. /* ----------------------------------------------------------------------- */
  865. /* some leadtek specific stuff */
  866. static void __devinit leadtek_eeprom(struct cx88_core *core, u8 *eeprom_data)
  867. {
  868. /* This is just for the "Winfast 2000XP Expert" board ATM; I don't have data on
  869. * any others.
  870. *
  871. * Byte 0 is 1 on the NTSC board.
  872. */
  873. if (eeprom_data[4] != 0x7d ||
  874. eeprom_data[5] != 0x10 ||
  875. eeprom_data[7] != 0x66) {
  876. printk(KERN_WARNING "%s: Leadtek eeprom invalid.\n",
  877. core->name);
  878. return;
  879. }
  880. core->has_radio = 1;
  881. core->tuner_type = (eeprom_data[6] == 0x13) ? 43 : 38;
  882. printk(KERN_INFO "%s: Leadtek Winfast 2000XP Expert config: "
  883. "tuner=%d, eeprom[0]=0x%02x\n",
  884. core->name, core->tuner_type, eeprom_data[0]);
  885. }
  886. /* ----------------------------------------------------------------------- */
  887. static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data)
  888. {
  889. struct tveeprom tv;
  890. tveeprom_hauppauge_analog(&tv, eeprom_data);
  891. core->tuner_type = tv.tuner_type;
  892. core->has_radio = tv.has_radio;
  893. }
  894. static int hauppauge_eeprom_dvb(struct cx88_core *core, u8 *ee)
  895. {
  896. int model;
  897. int tuner;
  898. /* Make sure we support the board model */
  899. model = ee[0x1f] << 24 | ee[0x1e] << 16 | ee[0x1d] << 8 | ee[0x1c];
  900. switch(model) {
  901. case 90002:
  902. case 90500:
  903. case 90501:
  904. /* known */
  905. break;
  906. default:
  907. printk("%s: warning: unknown hauppauge model #%d\n",
  908. core->name, model);
  909. break;
  910. }
  911. /* Make sure we support the tuner */
  912. tuner = ee[0x2d];
  913. switch(tuner) {
  914. case 0x4B: /* dtt 7595 */
  915. case 0x4C: /* dtt 7592 */
  916. break;
  917. default:
  918. printk("%s: error: unknown hauppauge tuner 0x%02x\n",
  919. core->name, tuner);
  920. return -ENODEV;
  921. }
  922. printk(KERN_INFO "%s: hauppauge eeprom: model=%d, tuner=%d\n",
  923. core->name, model, tuner);
  924. return 0;
  925. }
  926. /* ----------------------------------------------------------------------- */
  927. /* some GDI (was: Modular Technology) specific stuff */
  928. static struct {
  929. int id;
  930. int fm;
  931. char *name;
  932. } gdi_tuner[] = {
  933. [ 0x01 ] = { .id = TUNER_ABSENT,
  934. .name = "NTSC_M" },
  935. [ 0x02 ] = { .id = TUNER_ABSENT,
  936. .name = "PAL_B" },
  937. [ 0x03 ] = { .id = TUNER_ABSENT,
  938. .name = "PAL_I" },
  939. [ 0x04 ] = { .id = TUNER_ABSENT,
  940. .name = "PAL_D" },
  941. [ 0x05 ] = { .id = TUNER_ABSENT,
  942. .name = "SECAM" },
  943. [ 0x10 ] = { .id = TUNER_ABSENT,
  944. .fm = 1,
  945. .name = "TEMIC_4049" },
  946. [ 0x11 ] = { .id = TUNER_TEMIC_4136FY5,
  947. .name = "TEMIC_4136" },
  948. [ 0x12 ] = { .id = TUNER_ABSENT,
  949. .name = "TEMIC_4146" },
  950. [ 0x20 ] = { .id = TUNER_PHILIPS_FQ1216ME,
  951. .fm = 1,
  952. .name = "PHILIPS_FQ1216_MK3" },
  953. [ 0x21 ] = { .id = TUNER_ABSENT, .fm = 1,
  954. .name = "PHILIPS_FQ1236_MK3" },
  955. [ 0x22 ] = { .id = TUNER_ABSENT,
  956. .name = "PHILIPS_FI1236_MK3" },
  957. [ 0x23 ] = { .id = TUNER_ABSENT,
  958. .name = "PHILIPS_FI1216_MK3" },
  959. };
  960. static void gdi_eeprom(struct cx88_core *core, u8 *eeprom_data)
  961. {
  962. char *name = (eeprom_data[0x0d] < ARRAY_SIZE(gdi_tuner))
  963. ? gdi_tuner[eeprom_data[0x0d]].name : NULL;
  964. printk(KERN_INFO "%s: GDI: tuner=%s\n", core->name,
  965. name ? name : "unknown");
  966. if (NULL == name)
  967. return;
  968. core->tuner_type = gdi_tuner[eeprom_data[0x0d]].id;
  969. core->has_radio = gdi_tuner[eeprom_data[0x0d]].fm;
  970. }
  971. /* ----------------------------------------------------------------------- */
  972. void cx88_card_list(struct cx88_core *core, struct pci_dev *pci)
  973. {
  974. int i;
  975. if (0 == pci->subsystem_vendor &&
  976. 0 == pci->subsystem_device) {
  977. printk("%s: Your board has no valid PCI Subsystem ID and thus can't\n"
  978. "%s: be autodetected. Please pass card=<n> insmod option to\n"
  979. "%s: workaround that. Redirect complaints to the vendor of\n"
  980. "%s: the TV card. Best regards,\n"
  981. "%s: -- tux\n",
  982. core->name,core->name,core->name,core->name,core->name);
  983. } else {
  984. printk("%s: Your board isn't known (yet) to the driver. You can\n"
  985. "%s: try to pick one of the existing card configs via\n"
  986. "%s: card=<n> insmod option. Updating to the latest\n"
  987. "%s: version might help as well.\n",
  988. core->name,core->name,core->name,core->name);
  989. }
  990. printk("%s: Here is a list of valid choices for the card=<n> insmod option:\n",
  991. core->name);
  992. for (i = 0; i < cx88_bcount; i++)
  993. printk("%s: card=%d -> %s\n",
  994. core->name, i, cx88_boards[i].name);
  995. }
  996. void cx88_card_setup(struct cx88_core *core)
  997. {
  998. static u8 eeprom[128];
  999. if (0 == core->i2c_rc) {
  1000. core->i2c_client.addr = 0xa0 >> 1;
  1001. tveeprom_read(&core->i2c_client,eeprom,sizeof(eeprom));
  1002. }
  1003. switch (core->board) {
  1004. case CX88_BOARD_HAUPPAUGE:
  1005. case CX88_BOARD_HAUPPAUGE_ROSLYN:
  1006. if (0 == core->i2c_rc)
  1007. hauppauge_eeprom(core,eeprom+8);
  1008. break;
  1009. case CX88_BOARD_GDI:
  1010. if (0 == core->i2c_rc)
  1011. gdi_eeprom(core,eeprom);
  1012. break;
  1013. case CX88_BOARD_WINFAST2000XP_EXPERT:
  1014. if (0 == core->i2c_rc)
  1015. leadtek_eeprom(core,eeprom);
  1016. break;
  1017. case CX88_BOARD_HAUPPAUGE_DVB_T1:
  1018. if (0 == core->i2c_rc)
  1019. hauppauge_eeprom_dvb(core,eeprom);
  1020. break;
  1021. case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
  1022. case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS:
  1023. /* GPIO0:0 is hooked to mt352 reset pin */
  1024. cx_set(MO_GP0_IO, 0x00000101);
  1025. cx_clear(MO_GP0_IO, 0x00000001);
  1026. msleep(1);
  1027. cx_set(MO_GP0_IO, 0x00000101);
  1028. break;
  1029. case CX88_BOARD_KWORLD_DVB_T:
  1030. case CX88_BOARD_DNTV_LIVE_DVB_T:
  1031. cx_set(MO_GP0_IO, 0x00000707);
  1032. cx_set(MO_GP2_IO, 0x00000101);
  1033. cx_clear(MO_GP2_IO, 0x00000001);
  1034. msleep(1);
  1035. cx_clear(MO_GP0_IO, 0x00000007);
  1036. cx_set(MO_GP2_IO, 0x00000101);
  1037. break;
  1038. }
  1039. if (cx88_boards[core->board].radio.type == CX88_RADIO)
  1040. core->has_radio = 1;
  1041. }
  1042. /* ------------------------------------------------------------------ */
  1043. EXPORT_SYMBOL(cx88_boards);
  1044. EXPORT_SYMBOL(cx88_bcount);
  1045. EXPORT_SYMBOL(cx88_subids);
  1046. EXPORT_SYMBOL(cx88_idcount);
  1047. EXPORT_SYMBOL(cx88_card_list);
  1048. EXPORT_SYMBOL(cx88_card_setup);
  1049. /*
  1050. * Local variables:
  1051. * c-basic-offset: 8
  1052. * End:
  1053. * 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
  1054. */