cx23885-cards.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. /*
  2. * Driver for the Conexant CX23885 PCIe bridge
  3. *
  4. * Copyright (c) 2006 Steven Toth <stoth@linuxtv.org>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. *
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21. #include <linux/init.h>
  22. #include <linux/module.h>
  23. #include <linux/pci.h>
  24. #include <linux/delay.h>
  25. #include <media/cx25840.h>
  26. #include "cx23885.h"
  27. /* ------------------------------------------------------------------ */
  28. /* board config info */
  29. struct cx23885_board cx23885_boards[] = {
  30. [CX23885_BOARD_UNKNOWN] = {
  31. .name = "UNKNOWN/GENERIC",
  32. /* Ensure safe default for unknown boards */
  33. .clk_freq = 0,
  34. .input = {{
  35. .type = CX23885_VMUX_COMPOSITE1,
  36. .vmux = 0,
  37. },{
  38. .type = CX23885_VMUX_COMPOSITE2,
  39. .vmux = 1,
  40. },{
  41. .type = CX23885_VMUX_COMPOSITE3,
  42. .vmux = 2,
  43. },{
  44. .type = CX23885_VMUX_COMPOSITE4,
  45. .vmux = 3,
  46. }},
  47. },
  48. [CX23885_BOARD_HAUPPAUGE_HVR1800lp] = {
  49. .name = "Hauppauge WinTV-HVR1800lp",
  50. .portc = CX23885_MPEG_DVB,
  51. .input = {{
  52. .type = CX23885_VMUX_TELEVISION,
  53. .vmux = 0,
  54. .gpio0 = 0xff00,
  55. },{
  56. .type = CX23885_VMUX_DEBUG,
  57. .vmux = 0,
  58. .gpio0 = 0xff01,
  59. },{
  60. .type = CX23885_VMUX_COMPOSITE1,
  61. .vmux = 1,
  62. .gpio0 = 0xff02,
  63. },{
  64. .type = CX23885_VMUX_SVIDEO,
  65. .vmux = 2,
  66. .gpio0 = 0xff02,
  67. }},
  68. },
  69. [CX23885_BOARD_HAUPPAUGE_HVR1800] = {
  70. .name = "Hauppauge WinTV-HVR1800",
  71. .porta = CX23885_ANALOG_VIDEO,
  72. .portb = CX23885_MPEG_ENCODER,
  73. .portc = CX23885_MPEG_DVB,
  74. .tuner_type = TUNER_PHILIPS_TDA8290,
  75. .tuner_addr = 0x42, /* 0x84 >> 1 */
  76. .input = {{
  77. .type = CX23885_VMUX_TELEVISION,
  78. .vmux = CX25840_VIN7_CH3 |
  79. CX25840_VIN5_CH2 |
  80. CX25840_VIN2_CH1,
  81. .gpio0 = 0,
  82. },{
  83. .type = CX23885_VMUX_COMPOSITE1,
  84. .vmux = CX25840_VIN7_CH3 |
  85. CX25840_VIN4_CH2 |
  86. CX25840_VIN6_CH1,
  87. .gpio0 = 0,
  88. },{
  89. .type = CX23885_VMUX_SVIDEO,
  90. .vmux = CX25840_VIN7_CH3 |
  91. CX25840_VIN4_CH2 |
  92. CX25840_VIN8_CH1 |
  93. CX25840_SVIDEO_ON,
  94. .gpio0 = 0,
  95. }},
  96. },
  97. [CX23885_BOARD_HAUPPAUGE_HVR1250] = {
  98. .name = "Hauppauge WinTV-HVR1250",
  99. .portc = CX23885_MPEG_DVB,
  100. .input = {{
  101. .type = CX23885_VMUX_TELEVISION,
  102. .vmux = 0,
  103. .gpio0 = 0xff00,
  104. },{
  105. .type = CX23885_VMUX_DEBUG,
  106. .vmux = 0,
  107. .gpio0 = 0xff01,
  108. },{
  109. .type = CX23885_VMUX_COMPOSITE1,
  110. .vmux = 1,
  111. .gpio0 = 0xff02,
  112. },{
  113. .type = CX23885_VMUX_SVIDEO,
  114. .vmux = 2,
  115. .gpio0 = 0xff02,
  116. }},
  117. },
  118. [CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP] = {
  119. .name = "DViCO FusionHDTV5 Express",
  120. .portb = CX23885_MPEG_DVB,
  121. },
  122. [CX23885_BOARD_HAUPPAUGE_HVR1500Q] = {
  123. .name = "Hauppauge WinTV-HVR1500Q",
  124. .portc = CX23885_MPEG_DVB,
  125. },
  126. [CX23885_BOARD_HAUPPAUGE_HVR1500] = {
  127. .name = "Hauppauge WinTV-HVR1500",
  128. .portc = CX23885_MPEG_DVB,
  129. },
  130. [CX23885_BOARD_HAUPPAUGE_HVR1200] = {
  131. .name = "Hauppauge WinTV-HVR1200",
  132. .portc = CX23885_MPEG_DVB,
  133. },
  134. [CX23885_BOARD_HAUPPAUGE_HVR1700] = {
  135. .name = "Hauppauge WinTV-HVR1700",
  136. .portc = CX23885_MPEG_DVB,
  137. },
  138. [CX23885_BOARD_HAUPPAUGE_HVR1400] = {
  139. .name = "Hauppauge WinTV-HVR1400",
  140. .portc = CX23885_MPEG_DVB,
  141. },
  142. [CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP] = {
  143. .name = "DViCO FusionHDTV7 Dual Express",
  144. .portb = CX23885_MPEG_DVB,
  145. .portc = CX23885_MPEG_DVB,
  146. },
  147. };
  148. const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards);
  149. /* ------------------------------------------------------------------ */
  150. /* PCI subsystem IDs */
  151. struct cx23885_subid cx23885_subids[] = {
  152. {
  153. .subvendor = 0x0070,
  154. .subdevice = 0x3400,
  155. .card = CX23885_BOARD_UNKNOWN,
  156. },{
  157. .subvendor = 0x0070,
  158. .subdevice = 0x7600,
  159. .card = CX23885_BOARD_HAUPPAUGE_HVR1800lp,
  160. },{
  161. .subvendor = 0x0070,
  162. .subdevice = 0x7800,
  163. .card = CX23885_BOARD_HAUPPAUGE_HVR1800,
  164. },{
  165. .subvendor = 0x0070,
  166. .subdevice = 0x7801,
  167. .card = CX23885_BOARD_HAUPPAUGE_HVR1800,
  168. },{
  169. .subvendor = 0x0070,
  170. .subdevice = 0x7809,
  171. .card = CX23885_BOARD_HAUPPAUGE_HVR1800,
  172. },{
  173. .subvendor = 0x0070,
  174. .subdevice = 0x7911,
  175. .card = CX23885_BOARD_HAUPPAUGE_HVR1250,
  176. },{
  177. .subvendor = 0x18ac,
  178. .subdevice = 0xd500,
  179. .card = CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP,
  180. },{
  181. .subvendor = 0x0070,
  182. .subdevice = 0x7790,
  183. .card = CX23885_BOARD_HAUPPAUGE_HVR1500Q,
  184. },{
  185. .subvendor = 0x0070,
  186. .subdevice = 0x7797,
  187. .card = CX23885_BOARD_HAUPPAUGE_HVR1500Q,
  188. },{
  189. .subvendor = 0x0070,
  190. .subdevice = 0x7710,
  191. .card = CX23885_BOARD_HAUPPAUGE_HVR1500,
  192. },{
  193. .subvendor = 0x0070,
  194. .subdevice = 0x7717,
  195. .card = CX23885_BOARD_HAUPPAUGE_HVR1500,
  196. }, {
  197. .subvendor = 0x0070,
  198. .subdevice = 0x71d1,
  199. .card = CX23885_BOARD_HAUPPAUGE_HVR1200,
  200. }, {
  201. .subvendor = 0x0070,
  202. .subdevice = 0x71d3,
  203. .card = CX23885_BOARD_HAUPPAUGE_HVR1200,
  204. }, {
  205. .subvendor = 0x0070,
  206. .subdevice = 0x8101,
  207. .card = CX23885_BOARD_HAUPPAUGE_HVR1700,
  208. }, {
  209. .subvendor = 0x0070,
  210. .subdevice = 0x8010,
  211. .card = CX23885_BOARD_HAUPPAUGE_HVR1400,
  212. },{
  213. .subvendor = 0x18ac,
  214. .subdevice = 0xd618,
  215. .card = CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP,
  216. },
  217. };
  218. const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids);
  219. void cx23885_card_list(struct cx23885_dev *dev)
  220. {
  221. int i;
  222. if (0 == dev->pci->subsystem_vendor &&
  223. 0 == dev->pci->subsystem_device) {
  224. printk("%s: Your board has no valid PCIe Subsystem ID and thus can't\n"
  225. "%s: be autodetected. Please pass card=<n> insmod option to\n"
  226. "%s: workaround that. Redirect complaints to the vendor of\n"
  227. "%s: the TV card. Best regards,\n"
  228. "%s: -- tux\n",
  229. dev->name, dev->name, dev->name, dev->name, dev->name);
  230. } else {
  231. printk("%s: Your board isn't known (yet) to the driver. You can\n"
  232. "%s: try to pick one of the existing card configs via\n"
  233. "%s: card=<n> insmod option. Updating to the latest\n"
  234. "%s: version might help as well.\n",
  235. dev->name, dev->name, dev->name, dev->name);
  236. }
  237. printk("%s: Here is a list of valid choices for the card=<n> insmod option:\n",
  238. dev->name);
  239. for (i = 0; i < cx23885_bcount; i++)
  240. printk("%s: card=%d -> %s\n",
  241. dev->name, i, cx23885_boards[i].name);
  242. }
  243. static void hauppauge_eeprom(struct cx23885_dev *dev, u8 *eeprom_data)
  244. {
  245. struct tveeprom tv;
  246. tveeprom_hauppauge_analog(&dev->i2c_bus[0].i2c_client, &tv, eeprom_data);
  247. /* Make sure we support the board model */
  248. switch (tv.model)
  249. {
  250. case 71009:
  251. /* WinTV-HVR1200 (PCIe, Retail, full height)
  252. * DVB-T and basic analog */
  253. case 71359:
  254. /* WinTV-HVR1200 (PCIe, OEM, half height)
  255. * DVB-T and basic analog */
  256. case 71439:
  257. /* WinTV-HVR1200 (PCIe, OEM, half height)
  258. * DVB-T and basic analog */
  259. case 71449:
  260. /* WinTV-HVR1200 (PCIe, OEM, full height)
  261. * DVB-T and basic analog */
  262. case 71939:
  263. /* WinTV-HVR1200 (PCIe, OEM, half height)
  264. * DVB-T and basic analog */
  265. case 71949:
  266. /* WinTV-HVR1200 (PCIe, OEM, full height)
  267. * DVB-T and basic analog */
  268. case 71959:
  269. /* WinTV-HVR1200 (PCIe, OEM, full height)
  270. * DVB-T and basic analog */
  271. case 71979:
  272. /* WinTV-HVR1200 (PCIe, OEM, half height)
  273. * DVB-T and basic analog */
  274. case 71999:
  275. /* WinTV-HVR1200 (PCIe, OEM, full height)
  276. * DVB-T and basic analog */
  277. case 76601: /* WinTV-HVR1800lp (PCIe, Retail, No IR, Dual channel ATSC and MPEG2 HW Encoder */
  278. case 77001: /* WinTV-HVR1500 (Express Card, OEM, No IR, ATSC and Basic analog */
  279. case 77011: /* WinTV-HVR1500 (Express Card, Retail, No IR, ATSC and Basic analog */
  280. case 77041: /* WinTV-HVR1500Q (Express Card, OEM, No IR, ATSC/QAM and Basic analog */
  281. case 77051: /* WinTV-HVR1500Q (Express Card, Retail, No IR, ATSC/QAM and Basic analog */
  282. case 78011: /* WinTV-HVR1800 (PCIe, Retail, 3.5mm in, IR, No FM, Dual channel ATSC and MPEG2 HW Encoder */
  283. case 78501: /* WinTV-HVR1800 (PCIe, OEM, RCA in, No IR, FM, Dual channel ATSC and MPEG2 HW Encoder */
  284. case 78521: /* WinTV-HVR1800 (PCIe, OEM, RCA in, No IR, FM, Dual channel ATSC and MPEG2 HW Encoder */
  285. case 78531: /* WinTV-HVR1800 (PCIe, OEM, RCA in, No IR, No FM, Dual channel ATSC and MPEG2 HW Encoder */
  286. case 78631: /* WinTV-HVR1800 (PCIe, OEM, No IR, No FM, Dual channel ATSC and MPEG2 HW Encoder */
  287. case 79001: /* WinTV-HVR1250 (PCIe, Retail, IR, full height, ATSC and Basic analog */
  288. case 79101: /* WinTV-HVR1250 (PCIe, Retail, IR, half height, ATSC and Basic analog */
  289. case 79561: /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, ATSC and Basic analog */
  290. case 79571: /* WinTV-HVR1250 (PCIe, OEM, No IR, full height, ATSC and Basic analog */
  291. case 79671: /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, ATSC and Basic analog */
  292. case 80019:
  293. /* WinTV-HVR1400 (Express Card, Retail, IR,
  294. * DVB-T and Basic analog */
  295. case 81509:
  296. /* WinTV-HVR1700 (PCIe, OEM, No IR, half height)
  297. * DVB-T and MPEG2 HW Encoder */
  298. case 81519:
  299. /* WinTV-HVR1700 (PCIe, OEM, No IR, full height)
  300. * DVB-T and MPEG2 HW Encoder */
  301. break;
  302. default:
  303. printk("%s: warning: unknown hauppauge model #%d\n", dev->name, tv.model);
  304. break;
  305. }
  306. printk(KERN_INFO "%s: hauppauge eeprom: model=%d\n",
  307. dev->name, tv.model);
  308. }
  309. /* Tuner callback function for cx23885 boards. Currently only needed
  310. * for HVR1500Q, which has an xc5000 tuner.
  311. */
  312. int cx23885_tuner_callback(void *priv, int command, int arg)
  313. {
  314. struct cx23885_i2c *bus = priv;
  315. struct cx23885_dev *dev = bus->dev;
  316. u32 bitmask = 0;
  317. if (command != 0) {
  318. printk(KERN_ERR "%s(): Unknown command 0x%x.\n",
  319. __func__, command);
  320. return -EINVAL;
  321. }
  322. switch(dev->board) {
  323. case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
  324. /* Tuner Reset Command from xc5000 */
  325. if (command == 0)
  326. bitmask = 0x04;
  327. break;
  328. case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP:
  329. if (command == 0) {
  330. /* Two identical tuners on two different i2c buses,
  331. * we need to reset the correct gpio. */
  332. if (bus->nr == 0)
  333. bitmask = 0x01;
  334. else if (bus->nr == 1)
  335. bitmask = 0x04;
  336. }
  337. break;
  338. }
  339. if (bitmask) {
  340. /* Drive the tuner into reset and back out */
  341. cx_clear(GP0_IO, bitmask);
  342. mdelay(200);
  343. cx_set(GP0_IO, bitmask);
  344. }
  345. return 0;
  346. }
  347. void cx23885_gpio_setup(struct cx23885_dev *dev)
  348. {
  349. switch(dev->board) {
  350. case CX23885_BOARD_HAUPPAUGE_HVR1250:
  351. /* GPIO-0 cx24227 demodulator reset */
  352. cx_set(GP0_IO, 0x00010001); /* Bring the part out of reset */
  353. break;
  354. case CX23885_BOARD_HAUPPAUGE_HVR1500:
  355. /* GPIO-0 cx24227 demodulator */
  356. /* GPIO-2 xc3028 tuner */
  357. /* Put the parts into reset */
  358. cx_set(GP0_IO, 0x00050000);
  359. cx_clear(GP0_IO, 0x00000005);
  360. msleep(5);
  361. /* Bring the parts out of reset */
  362. cx_set(GP0_IO, 0x00050005);
  363. break;
  364. case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
  365. /* GPIO-0 cx24227 demodulator reset */
  366. /* GPIO-2 xc5000 tuner reset */
  367. cx_set(GP0_IO, 0x00050005); /* Bring the part out of reset */
  368. break;
  369. case CX23885_BOARD_HAUPPAUGE_HVR1800:
  370. /* GPIO-0 656_CLK */
  371. /* GPIO-1 656_D0 */
  372. /* GPIO-2 8295A Reset */
  373. /* GPIO-3-10 cx23417 data0-7 */
  374. /* GPIO-11-14 cx23417 addr0-3 */
  375. /* GPIO-15-18 cx23417 READY, CS, RD, WR */
  376. /* GPIO-19 IR_RX */
  377. /* CX23417 GPIO's */
  378. /* EIO15 Zilog Reset */
  379. /* EIO14 S5H1409/CX24227 Reset */
  380. /* Force the TDA8295A into reset and back */
  381. cx_set(GP0_IO, 0x00040004);
  382. mdelay(20);
  383. cx_clear(GP0_IO, 0x00000004);
  384. mdelay(20);
  385. cx_set(GP0_IO, 0x00040004);
  386. mdelay(20);
  387. break;
  388. case CX23885_BOARD_HAUPPAUGE_HVR1200:
  389. /* GPIO-0 tda10048 demodulator reset */
  390. /* GPIO-2 tda18271 tuner reset */
  391. /* Put the parts into reset and back */
  392. cx_set(GP0_IO, 0x00050000);
  393. mdelay(20);
  394. cx_clear(GP0_IO, 0x00000005);
  395. mdelay(20);
  396. cx_set(GP0_IO, 0x00050005);
  397. break;
  398. case CX23885_BOARD_HAUPPAUGE_HVR1700:
  399. /* GPIO-0 TDA10048 demodulator reset */
  400. /* GPIO-2 TDA8295A Reset */
  401. /* GPIO-3-10 cx23417 data0-7 */
  402. /* GPIO-11-14 cx23417 addr0-3 */
  403. /* GPIO-15-18 cx23417 READY, CS, RD, WR */
  404. /* The following GPIO's are on the interna AVCore (cx25840) */
  405. /* GPIO-19 IR_RX */
  406. /* GPIO-20 IR_TX 416/DVBT Select */
  407. /* GPIO-21 IIS DAT */
  408. /* GPIO-22 IIS WCLK */
  409. /* GPIO-23 IIS BCLK */
  410. /* Put the parts into reset and back */
  411. cx_set(GP0_IO, 0x00050000);
  412. mdelay(20);
  413. cx_clear(GP0_IO, 0x00000005);
  414. mdelay(20);
  415. cx_set(GP0_IO, 0x00050005);
  416. break;
  417. case CX23885_BOARD_HAUPPAUGE_HVR1400:
  418. /* GPIO-0 Dibcom7000p demodulator reset */
  419. /* GPIO-2 xc3028L tuner reset */
  420. /* GPIO-13 LED */
  421. /* Put the parts into reset and back */
  422. cx_set(GP0_IO, 0x00050000);
  423. mdelay(20);
  424. cx_clear(GP0_IO, 0x00000005);
  425. mdelay(20);
  426. cx_set(GP0_IO, 0x00050005);
  427. break;
  428. case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP:
  429. /* GPIO-0 xc5000 tuner reset i2c bus 0 */
  430. /* GPIO-1 s5h1409 demod reset i2c bus 0 */
  431. /* GPIO-2 xc5000 tuner reset i2c bus 1 */
  432. /* GPIO-3 s5h1409 demod reset i2c bus 0 */
  433. /* Put the parts into reset and back */
  434. cx_set(GP0_IO, 0x000f0000);
  435. mdelay(20);
  436. cx_clear(GP0_IO, 0x0000000f);
  437. mdelay(20);
  438. cx_set(GP0_IO, 0x000f000f);
  439. break;
  440. }
  441. }
  442. int cx23885_ir_init(struct cx23885_dev *dev)
  443. {
  444. switch (dev->board) {
  445. case CX23885_BOARD_HAUPPAUGE_HVR1250:
  446. case CX23885_BOARD_HAUPPAUGE_HVR1500:
  447. case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
  448. case CX23885_BOARD_HAUPPAUGE_HVR1800:
  449. case CX23885_BOARD_HAUPPAUGE_HVR1200:
  450. case CX23885_BOARD_HAUPPAUGE_HVR1400:
  451. /* FIXME: Implement me */
  452. break;
  453. }
  454. return 0;
  455. }
  456. void cx23885_card_setup(struct cx23885_dev *dev)
  457. {
  458. struct cx23885_tsport *ts1 = &dev->ts1;
  459. struct cx23885_tsport *ts2 = &dev->ts2;
  460. static u8 eeprom[256];
  461. if (dev->i2c_bus[0].i2c_rc == 0) {
  462. dev->i2c_bus[0].i2c_client.addr = 0xa0 >> 1;
  463. tveeprom_read(&dev->i2c_bus[0].i2c_client,
  464. eeprom, sizeof(eeprom));
  465. }
  466. switch (dev->board) {
  467. case CX23885_BOARD_HAUPPAUGE_HVR1250:
  468. case CX23885_BOARD_HAUPPAUGE_HVR1500:
  469. case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
  470. case CX23885_BOARD_HAUPPAUGE_HVR1400:
  471. if (dev->i2c_bus[0].i2c_rc == 0)
  472. hauppauge_eeprom(dev, eeprom+0x80);
  473. break;
  474. case CX23885_BOARD_HAUPPAUGE_HVR1800:
  475. case CX23885_BOARD_HAUPPAUGE_HVR1800lp:
  476. case CX23885_BOARD_HAUPPAUGE_HVR1200:
  477. case CX23885_BOARD_HAUPPAUGE_HVR1700:
  478. if (dev->i2c_bus[0].i2c_rc == 0)
  479. hauppauge_eeprom(dev, eeprom+0xc0);
  480. break;
  481. }
  482. switch (dev->board) {
  483. case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP:
  484. ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */
  485. ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */
  486. ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
  487. /* break omitted intentionally */
  488. case CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP:
  489. ts1->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */
  490. ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */
  491. ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
  492. break;
  493. case CX23885_BOARD_HAUPPAUGE_HVR1800:
  494. /* Defaults for VID B - Analog encoder */
  495. /* DREQ_POL, SMODE, PUNC_CLK, MCLK_POL Serial bus + punc clk */
  496. ts1->gen_ctrl_val = 0x10e;
  497. ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */
  498. ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
  499. /* APB_TSVALERR_POL (active low)*/
  500. ts1->vld_misc_val = 0x2000;
  501. ts1->hw_sop_ctrl_val = (0x47 << 16 | 188 << 4 | 0xc);
  502. /* Defaults for VID C */
  503. ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */
  504. ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */
  505. ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
  506. break;
  507. case CX23885_BOARD_HAUPPAUGE_HVR1250:
  508. case CX23885_BOARD_HAUPPAUGE_HVR1500:
  509. case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
  510. case CX23885_BOARD_HAUPPAUGE_HVR1800lp:
  511. case CX23885_BOARD_HAUPPAUGE_HVR1200:
  512. case CX23885_BOARD_HAUPPAUGE_HVR1700:
  513. case CX23885_BOARD_HAUPPAUGE_HVR1400:
  514. default:
  515. ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */
  516. ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */
  517. ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
  518. }
  519. /* Certain boards support analog, or require the avcore to be
  520. * loaded, ensure this happens.
  521. */
  522. switch (dev->board) {
  523. case CX23885_BOARD_HAUPPAUGE_HVR1800:
  524. case CX23885_BOARD_HAUPPAUGE_HVR1800lp:
  525. case CX23885_BOARD_HAUPPAUGE_HVR1700:
  526. request_module("cx25840");
  527. break;
  528. }
  529. }
  530. /* ------------------------------------------------------------------ */
  531. /*
  532. * Local variables:
  533. * c-basic-offset: 8
  534. * End:
  535. * 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
  536. */