cx88-cards.c 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103
  1. /*
  2. * $Id: cx88-cards.c,v 1.86 2005/07/14 03:06:43 mchehab 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 = UNSET,
  681. .tuner_addr = ADDR_UNSET,
  682. .radio_addr = ADDR_UNSET,
  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. .dvb = 1,
  722. },
  723. [CX88_BOARD_ADSTECH_DVB_T_PCI] = {
  724. .name = "ADS Tech Instant TV DVB-T PCI",
  725. .tuner_type = TUNER_ABSENT,
  726. .radio_type = UNSET,
  727. .tuner_addr = ADDR_UNSET,
  728. .radio_addr = ADDR_UNSET,
  729. .input = {{
  730. .type = CX88_VMUX_COMPOSITE1,
  731. .vmux = 1,
  732. .gpio0 = 0x0700,
  733. .gpio2 = 0x0101,
  734. },{
  735. .type = CX88_VMUX_SVIDEO,
  736. .vmux = 2,
  737. .gpio0 = 0x0700,
  738. .gpio2 = 0x0101,
  739. }},
  740. .dvb = 1,
  741. },
  742. [CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1] = {
  743. .name = "TerraTec Cinergy 1400 DVB-T",
  744. .tuner_type = TUNER_ABSENT,
  745. .input = {{
  746. .type = CX88_VMUX_DVB,
  747. .vmux = 0,
  748. }},
  749. .dvb = 1,
  750. },
  751. };
  752. const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards);
  753. /* ------------------------------------------------------------------ */
  754. /* PCI subsystem IDs */
  755. struct cx88_subid cx88_subids[] = {
  756. {
  757. .subvendor = 0x0070,
  758. .subdevice = 0x3400,
  759. .card = CX88_BOARD_HAUPPAUGE,
  760. },{
  761. .subvendor = 0x0070,
  762. .subdevice = 0x3401,
  763. .card = CX88_BOARD_HAUPPAUGE,
  764. },{
  765. .subvendor = 0x14c7,
  766. .subdevice = 0x0106,
  767. .card = CX88_BOARD_GDI,
  768. },{
  769. .subvendor = 0x14c7,
  770. .subdevice = 0x0107, /* with mpeg encoder */
  771. .card = CX88_BOARD_GDI,
  772. },{
  773. .subvendor = PCI_VENDOR_ID_ATI,
  774. .subdevice = 0x00f8,
  775. .card = CX88_BOARD_ATI_WONDER_PRO,
  776. },{
  777. .subvendor = 0x107d,
  778. .subdevice = 0x6611,
  779. .card = CX88_BOARD_WINFAST2000XP_EXPERT,
  780. },{
  781. .subvendor = 0x107d,
  782. .subdevice = 0x6613, /* NTSC */
  783. .card = CX88_BOARD_WINFAST2000XP_EXPERT,
  784. },{
  785. .subvendor = 0x107d,
  786. .subdevice = 0x6620,
  787. .card = CX88_BOARD_WINFAST_DV2000,
  788. },{
  789. .subvendor = 0x107d,
  790. .subdevice = 0x663b,
  791. .card = CX88_BOARD_LEADTEK_PVR2000,
  792. },{
  793. .subvendor = 0x107d,
  794. .subdevice = 0x663C,
  795. .card = CX88_BOARD_LEADTEK_PVR2000,
  796. },{
  797. .subvendor = 0x1461,
  798. .subdevice = 0x000b,
  799. .card = CX88_BOARD_AVERTV_303,
  800. },{
  801. .subvendor = 0x1462,
  802. .subdevice = 0x8606,
  803. .card = CX88_BOARD_MSI_TVANYWHERE_MASTER,
  804. },{
  805. .subvendor = 0x10fc,
  806. .subdevice = 0xd003,
  807. .card = CX88_BOARD_IODATA_GVVCP3PCI,
  808. },{
  809. .subvendor = 0x1043,
  810. .subdevice = 0x4823, /* with mpeg encoder */
  811. .card = CX88_BOARD_ASUS_PVR_416,
  812. },{
  813. .subvendor = 0x17de,
  814. .subdevice = 0x08a6,
  815. .card = CX88_BOARD_KWORLD_DVB_T,
  816. },{
  817. .subvendor = 0x18ac,
  818. .subdevice = 0xd810,
  819. .card = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q,
  820. },{
  821. .subvendor = 0x18ac,
  822. .subdevice = 0xd820,
  823. .card = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T,
  824. },{
  825. .subvendor = 0x18AC,
  826. .subdevice = 0xDB00,
  827. .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1,
  828. },{
  829. .subvendor = 0x0070,
  830. .subdevice = 0x9002,
  831. .card = CX88_BOARD_HAUPPAUGE_DVB_T1,
  832. },{
  833. .subvendor = 0x14f1,
  834. .subdevice = 0x0187,
  835. .card = CX88_BOARD_CONEXANT_DVB_T1,
  836. },{
  837. .subvendor = 0x1540,
  838. .subdevice = 0x2580,
  839. .card = CX88_BOARD_PROVIDEO_PV259,
  840. },{
  841. .subvendor = 0x18AC,
  842. .subdevice = 0xDB10,
  843. .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS,
  844. },{
  845. .subvendor = 0x1554,
  846. .subdevice = 0x4811,
  847. .card = CX88_BOARD_PIXELVIEW,
  848. },{
  849. .subvendor = 0x7063,
  850. .subdevice = 0x3000, /* HD-3000 card */
  851. .card = CX88_BOARD_PCHDTV_HD3000,
  852. },{
  853. .subvendor = 0x17DE,
  854. .subdevice = 0xA8A6,
  855. .card = CX88_BOARD_DNTV_LIVE_DVB_T,
  856. },{
  857. .subvendor = 0x0070,
  858. .subdevice = 0x2801,
  859. .card = CX88_BOARD_HAUPPAUGE_ROSLYN,
  860. },{
  861. .subvendor = 0x14F1,
  862. .subdevice = 0x0342,
  863. .card = CX88_BOARD_DIGITALLOGIC_MEC,
  864. },{
  865. .subvendor = 0x10fc,
  866. .subdevice = 0xd035,
  867. .card = CX88_BOARD_IODATA_GVBCTV7E,
  868. },{
  869. .subvendor = 0x1421,
  870. .subdevice = 0x0334,
  871. .card = CX88_BOARD_ADSTECH_DVB_T_PCI,
  872. },{
  873. .subvendor = 0x153b,
  874. .subdevice = 0x1166,
  875. .card = CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1,
  876. },
  877. };
  878. const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids);
  879. /* ----------------------------------------------------------------------- */
  880. /* some leadtek specific stuff */
  881. static void __devinit leadtek_eeprom(struct cx88_core *core, u8 *eeprom_data)
  882. {
  883. /* This is just for the "Winfast 2000XP Expert" board ATM; I don't have data on
  884. * any others.
  885. *
  886. * Byte 0 is 1 on the NTSC board.
  887. */
  888. if (eeprom_data[4] != 0x7d ||
  889. eeprom_data[5] != 0x10 ||
  890. eeprom_data[7] != 0x66) {
  891. printk(KERN_WARNING "%s: Leadtek eeprom invalid.\n",
  892. core->name);
  893. return;
  894. }
  895. core->has_radio = 1;
  896. core->tuner_type = (eeprom_data[6] == 0x13) ? 43 : 38;
  897. printk(KERN_INFO "%s: Leadtek Winfast 2000XP Expert config: "
  898. "tuner=%d, eeprom[0]=0x%02x\n",
  899. core->name, core->tuner_type, eeprom_data[0]);
  900. }
  901. /* ----------------------------------------------------------------------- */
  902. static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data)
  903. {
  904. struct tveeprom tv;
  905. tveeprom_hauppauge_analog(&tv, eeprom_data);
  906. core->tuner_type = tv.tuner_type;
  907. core->has_radio = tv.has_radio;
  908. }
  909. static int hauppauge_eeprom_dvb(struct cx88_core *core, u8 *ee)
  910. {
  911. int model;
  912. int tuner;
  913. /* Make sure we support the board model */
  914. model = ee[0x1f] << 24 | ee[0x1e] << 16 | ee[0x1d] << 8 | ee[0x1c];
  915. switch(model) {
  916. case 90002:
  917. case 90500:
  918. case 90501:
  919. /* known */
  920. break;
  921. default:
  922. printk("%s: warning: unknown hauppauge model #%d\n",
  923. core->name, model);
  924. break;
  925. }
  926. /* Make sure we support the tuner */
  927. tuner = ee[0x2d];
  928. switch(tuner) {
  929. case 0x4B: /* dtt 7595 */
  930. case 0x4C: /* dtt 7592 */
  931. break;
  932. default:
  933. printk("%s: error: unknown hauppauge tuner 0x%02x\n",
  934. core->name, tuner);
  935. return -ENODEV;
  936. }
  937. printk(KERN_INFO "%s: hauppauge eeprom: model=%d, tuner=%d\n",
  938. core->name, model, tuner);
  939. return 0;
  940. }
  941. /* ----------------------------------------------------------------------- */
  942. /* some GDI (was: Modular Technology) specific stuff */
  943. static struct {
  944. int id;
  945. int fm;
  946. char *name;
  947. } gdi_tuner[] = {
  948. [ 0x01 ] = { .id = TUNER_ABSENT,
  949. .name = "NTSC_M" },
  950. [ 0x02 ] = { .id = TUNER_ABSENT,
  951. .name = "PAL_B" },
  952. [ 0x03 ] = { .id = TUNER_ABSENT,
  953. .name = "PAL_I" },
  954. [ 0x04 ] = { .id = TUNER_ABSENT,
  955. .name = "PAL_D" },
  956. [ 0x05 ] = { .id = TUNER_ABSENT,
  957. .name = "SECAM" },
  958. [ 0x10 ] = { .id = TUNER_ABSENT,
  959. .fm = 1,
  960. .name = "TEMIC_4049" },
  961. [ 0x11 ] = { .id = TUNER_TEMIC_4136FY5,
  962. .name = "TEMIC_4136" },
  963. [ 0x12 ] = { .id = TUNER_ABSENT,
  964. .name = "TEMIC_4146" },
  965. [ 0x20 ] = { .id = TUNER_PHILIPS_FQ1216ME,
  966. .fm = 1,
  967. .name = "PHILIPS_FQ1216_MK3" },
  968. [ 0x21 ] = { .id = TUNER_ABSENT, .fm = 1,
  969. .name = "PHILIPS_FQ1236_MK3" },
  970. [ 0x22 ] = { .id = TUNER_ABSENT,
  971. .name = "PHILIPS_FI1236_MK3" },
  972. [ 0x23 ] = { .id = TUNER_ABSENT,
  973. .name = "PHILIPS_FI1216_MK3" },
  974. };
  975. static void gdi_eeprom(struct cx88_core *core, u8 *eeprom_data)
  976. {
  977. char *name = (eeprom_data[0x0d] < ARRAY_SIZE(gdi_tuner))
  978. ? gdi_tuner[eeprom_data[0x0d]].name : NULL;
  979. printk(KERN_INFO "%s: GDI: tuner=%s\n", core->name,
  980. name ? name : "unknown");
  981. if (NULL == name)
  982. return;
  983. core->tuner_type = gdi_tuner[eeprom_data[0x0d]].id;
  984. core->has_radio = gdi_tuner[eeprom_data[0x0d]].fm;
  985. }
  986. /* ----------------------------------------------------------------------- */
  987. void cx88_card_list(struct cx88_core *core, struct pci_dev *pci)
  988. {
  989. int i;
  990. if (0 == pci->subsystem_vendor &&
  991. 0 == pci->subsystem_device) {
  992. printk("%s: Your board has no valid PCI Subsystem ID and thus can't\n"
  993. "%s: be autodetected. Please pass card=<n> insmod option to\n"
  994. "%s: workaround that. Redirect complaints to the vendor of\n"
  995. "%s: the TV card. Best regards,\n"
  996. "%s: -- tux\n",
  997. core->name,core->name,core->name,core->name,core->name);
  998. } else {
  999. printk("%s: Your board isn't known (yet) to the driver. You can\n"
  1000. "%s: try to pick one of the existing card configs via\n"
  1001. "%s: card=<n> insmod option. Updating to the latest\n"
  1002. "%s: version might help as well.\n",
  1003. core->name,core->name,core->name,core->name);
  1004. }
  1005. printk("%s: Here is a list of valid choices for the card=<n> insmod option:\n",
  1006. core->name);
  1007. for (i = 0; i < cx88_bcount; i++)
  1008. printk("%s: card=%d -> %s\n",
  1009. core->name, i, cx88_boards[i].name);
  1010. }
  1011. void cx88_card_setup(struct cx88_core *core)
  1012. {
  1013. static u8 eeprom[128];
  1014. if (0 == core->i2c_rc) {
  1015. core->i2c_client.addr = 0xa0 >> 1;
  1016. tveeprom_read(&core->i2c_client,eeprom,sizeof(eeprom));
  1017. }
  1018. switch (core->board) {
  1019. case CX88_BOARD_HAUPPAUGE:
  1020. case CX88_BOARD_HAUPPAUGE_ROSLYN:
  1021. if (0 == core->i2c_rc)
  1022. hauppauge_eeprom(core,eeprom+8);
  1023. break;
  1024. case CX88_BOARD_GDI:
  1025. if (0 == core->i2c_rc)
  1026. gdi_eeprom(core,eeprom);
  1027. break;
  1028. case CX88_BOARD_WINFAST2000XP_EXPERT:
  1029. if (0 == core->i2c_rc)
  1030. leadtek_eeprom(core,eeprom);
  1031. break;
  1032. case CX88_BOARD_HAUPPAUGE_DVB_T1:
  1033. if (0 == core->i2c_rc)
  1034. hauppauge_eeprom_dvb(core,eeprom);
  1035. break;
  1036. case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
  1037. case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS:
  1038. /* GPIO0:0 is hooked to mt352 reset pin */
  1039. cx_set(MO_GP0_IO, 0x00000101);
  1040. cx_clear(MO_GP0_IO, 0x00000001);
  1041. msleep(1);
  1042. cx_set(MO_GP0_IO, 0x00000101);
  1043. break;
  1044. case CX88_BOARD_KWORLD_DVB_T:
  1045. case CX88_BOARD_DNTV_LIVE_DVB_T:
  1046. cx_set(MO_GP0_IO, 0x00000707);
  1047. cx_set(MO_GP2_IO, 0x00000101);
  1048. cx_clear(MO_GP2_IO, 0x00000001);
  1049. msleep(1);
  1050. cx_clear(MO_GP0_IO, 0x00000007);
  1051. cx_set(MO_GP2_IO, 0x00000101);
  1052. break;
  1053. }
  1054. if (cx88_boards[core->board].radio.type == CX88_RADIO)
  1055. core->has_radio = 1;
  1056. }
  1057. /* ------------------------------------------------------------------ */
  1058. EXPORT_SYMBOL(cx88_boards);
  1059. EXPORT_SYMBOL(cx88_bcount);
  1060. EXPORT_SYMBOL(cx88_subids);
  1061. EXPORT_SYMBOL(cx88_idcount);
  1062. EXPORT_SYMBOL(cx88_card_list);
  1063. EXPORT_SYMBOL(cx88_card_setup);
  1064. /*
  1065. * Local variables:
  1066. * c-basic-offset: 8
  1067. * End:
  1068. * 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
  1069. */