cx23885-cards.c 17 KB

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