pvrusb2-devattr.c 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. *
  4. * Copyright (C) 2007 Mike Isely <[email protected]>
  5. */
  6. /*
  7. This source file should encompass ALL per-device type information for the
  8. driver. To define a new device, add elements to the pvr2_device_table and
  9. pvr2_device_desc structures.
  10. */
  11. #include "pvrusb2-devattr.h"
  12. #include <linux/usb.h>
  13. #include <linux/module.h>
  14. /* This is needed in order to pull in tuner type ids... */
  15. #include <linux/i2c.h>
  16. #include <media/tuner.h>
  17. #ifdef CONFIG_VIDEO_PVRUSB2_DVB
  18. #include "pvrusb2-hdw-internal.h"
  19. #include "lgdt330x.h"
  20. #include "s5h1409.h"
  21. #include "s5h1411.h"
  22. #include "tda10048.h"
  23. #include "tda18271.h"
  24. #include "tda8290.h"
  25. #include "tuner-simple.h"
  26. #include "si2157.h"
  27. #include "lgdt3306a.h"
  28. #include "si2168.h"
  29. #endif
  30. /*------------------------------------------------------------------------*/
  31. /* Hauppauge PVR-USB2 Model 29xxx */
  32. static const struct pvr2_device_client_desc pvr2_cli_29xxx[] = {
  33. { .module_id = PVR2_CLIENT_ID_SAA7115 },
  34. { .module_id = PVR2_CLIENT_ID_MSP3400 },
  35. { .module_id = PVR2_CLIENT_ID_TUNER },
  36. { .module_id = PVR2_CLIENT_ID_DEMOD },
  37. };
  38. #define PVR2_FIRMWARE_29xxx "v4l-pvrusb2-29xxx-01.fw"
  39. static const char *pvr2_fw1_names_29xxx[] = {
  40. PVR2_FIRMWARE_29xxx,
  41. };
  42. static const struct pvr2_device_desc pvr2_device_29xxx = {
  43. .description = "WinTV PVR USB2 Model 29xxx",
  44. .shortname = "29xxx",
  45. .client_table.lst = pvr2_cli_29xxx,
  46. .client_table.cnt = ARRAY_SIZE(pvr2_cli_29xxx),
  47. .fx2_firmware.lst = pvr2_fw1_names_29xxx,
  48. .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_29xxx),
  49. .flag_has_hauppauge_rom = !0,
  50. .flag_has_analogtuner = !0,
  51. .flag_has_fmradio = !0,
  52. .flag_has_composite = !0,
  53. .flag_has_svideo = !0,
  54. .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
  55. .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
  56. .ir_scheme = PVR2_IR_SCHEME_29XXX,
  57. };
  58. /*------------------------------------------------------------------------*/
  59. /* Hauppauge PVR-USB2 Model 24xxx */
  60. static const struct pvr2_device_client_desc pvr2_cli_24xxx[] = {
  61. { .module_id = PVR2_CLIENT_ID_CX25840 },
  62. { .module_id = PVR2_CLIENT_ID_TUNER },
  63. { .module_id = PVR2_CLIENT_ID_WM8775 },
  64. { .module_id = PVR2_CLIENT_ID_DEMOD },
  65. };
  66. #define PVR2_FIRMWARE_24xxx "v4l-pvrusb2-24xxx-01.fw"
  67. static const char *pvr2_fw1_names_24xxx[] = {
  68. PVR2_FIRMWARE_24xxx,
  69. };
  70. static const struct pvr2_device_desc pvr2_device_24xxx = {
  71. .description = "WinTV PVR USB2 Model 24xxx",
  72. .shortname = "24xxx",
  73. .client_table.lst = pvr2_cli_24xxx,
  74. .client_table.cnt = ARRAY_SIZE(pvr2_cli_24xxx),
  75. .fx2_firmware.lst = pvr2_fw1_names_24xxx,
  76. .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_24xxx),
  77. .flag_has_cx25840 = !0,
  78. .flag_has_wm8775 = !0,
  79. .flag_has_hauppauge_rom = !0,
  80. .flag_has_analogtuner = !0,
  81. .flag_has_fmradio = !0,
  82. .flag_has_composite = !0,
  83. .flag_has_svideo = !0,
  84. .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
  85. .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
  86. .ir_scheme = PVR2_IR_SCHEME_24XXX,
  87. };
  88. /*------------------------------------------------------------------------*/
  89. /* GOTVIEW USB2.0 DVD2 */
  90. static const struct pvr2_device_client_desc pvr2_cli_gotview_2[] = {
  91. { .module_id = PVR2_CLIENT_ID_CX25840 },
  92. { .module_id = PVR2_CLIENT_ID_TUNER },
  93. { .module_id = PVR2_CLIENT_ID_DEMOD },
  94. };
  95. static const struct pvr2_device_desc pvr2_device_gotview_2 = {
  96. .description = "Gotview USB 2.0 DVD 2",
  97. .shortname = "gv2",
  98. .client_table.lst = pvr2_cli_gotview_2,
  99. .client_table.cnt = ARRAY_SIZE(pvr2_cli_gotview_2),
  100. .flag_has_cx25840 = !0,
  101. .default_tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
  102. .flag_has_analogtuner = !0,
  103. .flag_has_fmradio = !0,
  104. .flag_has_composite = !0,
  105. .flag_has_svideo = !0,
  106. .signal_routing_scheme = PVR2_ROUTING_SCHEME_GOTVIEW,
  107. };
  108. /*------------------------------------------------------------------------*/
  109. /* GOTVIEW USB2.0 DVD Deluxe */
  110. /* (same module list as gotview_2) */
  111. static const struct pvr2_device_desc pvr2_device_gotview_2d = {
  112. .description = "Gotview USB 2.0 DVD Deluxe",
  113. .shortname = "gv2d",
  114. .client_table.lst = pvr2_cli_gotview_2,
  115. .client_table.cnt = ARRAY_SIZE(pvr2_cli_gotview_2),
  116. .flag_has_cx25840 = !0,
  117. .default_tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
  118. .flag_has_analogtuner = !0,
  119. .flag_has_composite = !0,
  120. .flag_has_svideo = !0,
  121. .signal_routing_scheme = PVR2_ROUTING_SCHEME_GOTVIEW,
  122. };
  123. /*------------------------------------------------------------------------*/
  124. /* Terratec Grabster AV400 */
  125. static const struct pvr2_device_client_desc pvr2_cli_av400[] = {
  126. { .module_id = PVR2_CLIENT_ID_CX25840 },
  127. };
  128. static const struct pvr2_device_desc pvr2_device_av400 = {
  129. .description = "Terratec Grabster AV400",
  130. .shortname = "av400",
  131. .flag_is_experimental = 1,
  132. .client_table.lst = pvr2_cli_av400,
  133. .client_table.cnt = ARRAY_SIZE(pvr2_cli_av400),
  134. .flag_has_cx25840 = !0,
  135. .flag_has_analogtuner = 0,
  136. .flag_has_composite = !0,
  137. .flag_has_svideo = !0,
  138. .signal_routing_scheme = PVR2_ROUTING_SCHEME_AV400,
  139. };
  140. /*------------------------------------------------------------------------*/
  141. /* OnAir Creator */
  142. #ifdef CONFIG_VIDEO_PVRUSB2_DVB
  143. static struct lgdt330x_config pvr2_lgdt3303_config = {
  144. .demod_chip = LGDT3303,
  145. .clock_polarity_flip = 1,
  146. };
  147. static int pvr2_lgdt3303_attach(struct pvr2_dvb_adapter *adap)
  148. {
  149. adap->fe[0] = dvb_attach(lgdt330x_attach, &pvr2_lgdt3303_config,
  150. 0x0e,
  151. &adap->channel.hdw->i2c_adap);
  152. if (adap->fe[0])
  153. return 0;
  154. return -EIO;
  155. }
  156. static int pvr2_lgh06xf_attach(struct pvr2_dvb_adapter *adap)
  157. {
  158. dvb_attach(simple_tuner_attach, adap->fe[0],
  159. &adap->channel.hdw->i2c_adap, 0x61,
  160. TUNER_LG_TDVS_H06XF);
  161. return 0;
  162. }
  163. static const struct pvr2_dvb_props pvr2_onair_creator_fe_props = {
  164. .frontend_attach = pvr2_lgdt3303_attach,
  165. .tuner_attach = pvr2_lgh06xf_attach,
  166. };
  167. #endif
  168. static const struct pvr2_device_client_desc pvr2_cli_onair_creator[] = {
  169. { .module_id = PVR2_CLIENT_ID_SAA7115 },
  170. { .module_id = PVR2_CLIENT_ID_CS53L32A },
  171. { .module_id = PVR2_CLIENT_ID_TUNER },
  172. };
  173. static const struct pvr2_device_desc pvr2_device_onair_creator = {
  174. .description = "OnAir Creator Hybrid USB tuner",
  175. .shortname = "oac",
  176. .client_table.lst = pvr2_cli_onair_creator,
  177. .client_table.cnt = ARRAY_SIZE(pvr2_cli_onair_creator),
  178. .default_tuner_type = TUNER_LG_TDVS_H06XF,
  179. .flag_has_analogtuner = !0,
  180. .flag_has_composite = !0,
  181. .flag_has_svideo = !0,
  182. .flag_digital_requires_cx23416 = !0,
  183. .signal_routing_scheme = PVR2_ROUTING_SCHEME_ONAIR,
  184. .digital_control_scheme = PVR2_DIGITAL_SCHEME_ONAIR,
  185. .default_std_mask = V4L2_STD_NTSC_M,
  186. #ifdef CONFIG_VIDEO_PVRUSB2_DVB
  187. .dvb_props = &pvr2_onair_creator_fe_props,
  188. #endif
  189. };
  190. /*------------------------------------------------------------------------*/
  191. /* OnAir USB 2.0 */
  192. #ifdef CONFIG_VIDEO_PVRUSB2_DVB
  193. static struct lgdt330x_config pvr2_lgdt3302_config = {
  194. .demod_chip = LGDT3302,
  195. };
  196. static int pvr2_lgdt3302_attach(struct pvr2_dvb_adapter *adap)
  197. {
  198. adap->fe[0] = dvb_attach(lgdt330x_attach, &pvr2_lgdt3302_config,
  199. 0x0e,
  200. &adap->channel.hdw->i2c_adap);
  201. if (adap->fe[0])
  202. return 0;
  203. return -EIO;
  204. }
  205. static int pvr2_fcv1236d_attach(struct pvr2_dvb_adapter *adap)
  206. {
  207. dvb_attach(simple_tuner_attach, adap->fe[0],
  208. &adap->channel.hdw->i2c_adap, 0x61,
  209. TUNER_PHILIPS_FCV1236D);
  210. return 0;
  211. }
  212. static const struct pvr2_dvb_props pvr2_onair_usb2_fe_props = {
  213. .frontend_attach = pvr2_lgdt3302_attach,
  214. .tuner_attach = pvr2_fcv1236d_attach,
  215. };
  216. #endif
  217. static const struct pvr2_device_client_desc pvr2_cli_onair_usb2[] = {
  218. { .module_id = PVR2_CLIENT_ID_SAA7115 },
  219. { .module_id = PVR2_CLIENT_ID_CS53L32A },
  220. { .module_id = PVR2_CLIENT_ID_TUNER },
  221. };
  222. static const struct pvr2_device_desc pvr2_device_onair_usb2 = {
  223. .description = "OnAir USB2 Hybrid USB tuner",
  224. .shortname = "oa2",
  225. .client_table.lst = pvr2_cli_onair_usb2,
  226. .client_table.cnt = ARRAY_SIZE(pvr2_cli_onair_usb2),
  227. .default_tuner_type = TUNER_PHILIPS_FCV1236D,
  228. .flag_has_analogtuner = !0,
  229. .flag_has_composite = !0,
  230. .flag_has_svideo = !0,
  231. .flag_digital_requires_cx23416 = !0,
  232. .signal_routing_scheme = PVR2_ROUTING_SCHEME_ONAIR,
  233. .digital_control_scheme = PVR2_DIGITAL_SCHEME_ONAIR,
  234. .default_std_mask = V4L2_STD_NTSC_M,
  235. #ifdef CONFIG_VIDEO_PVRUSB2_DVB
  236. .dvb_props = &pvr2_onair_usb2_fe_props,
  237. #endif
  238. };
  239. /*------------------------------------------------------------------------*/
  240. /* Hauppauge PVR-USB2 Model 73xxx */
  241. #ifdef CONFIG_VIDEO_PVRUSB2_DVB
  242. static struct tda10048_config hauppauge_tda10048_config = {
  243. .demod_address = 0x10 >> 1,
  244. .output_mode = TDA10048_PARALLEL_OUTPUT,
  245. .fwbulkwritelen = TDA10048_BULKWRITE_50,
  246. .inversion = TDA10048_INVERSION_ON,
  247. .dtv6_if_freq_khz = TDA10048_IF_3300,
  248. .dtv7_if_freq_khz = TDA10048_IF_3800,
  249. .dtv8_if_freq_khz = TDA10048_IF_4300,
  250. .clk_freq_khz = TDA10048_CLK_16000,
  251. .disable_gate_access = 1,
  252. };
  253. static struct tda829x_config tda829x_no_probe = {
  254. .probe_tuner = TDA829X_DONT_PROBE,
  255. };
  256. static struct tda18271_std_map hauppauge_tda18271_dvbt_std_map = {
  257. .dvbt_6 = { .if_freq = 3300, .agc_mode = 3, .std = 4,
  258. .if_lvl = 1, .rfagc_top = 0x37, },
  259. .dvbt_7 = { .if_freq = 3800, .agc_mode = 3, .std = 5,
  260. .if_lvl = 1, .rfagc_top = 0x37, },
  261. .dvbt_8 = { .if_freq = 4300, .agc_mode = 3, .std = 6,
  262. .if_lvl = 1, .rfagc_top = 0x37, },
  263. };
  264. static struct tda18271_config hauppauge_tda18271_dvb_config = {
  265. .std_map = &hauppauge_tda18271_dvbt_std_map,
  266. .gate = TDA18271_GATE_ANALOG,
  267. .output_opt = TDA18271_OUTPUT_LT_OFF,
  268. };
  269. static int pvr2_tda10048_attach(struct pvr2_dvb_adapter *adap)
  270. {
  271. adap->fe[0] = dvb_attach(tda10048_attach, &hauppauge_tda10048_config,
  272. &adap->channel.hdw->i2c_adap);
  273. if (adap->fe[0])
  274. return 0;
  275. return -EIO;
  276. }
  277. static int pvr2_73xxx_tda18271_8295_attach(struct pvr2_dvb_adapter *adap)
  278. {
  279. dvb_attach(tda829x_attach, adap->fe[0],
  280. &adap->channel.hdw->i2c_adap, 0x42,
  281. &tda829x_no_probe);
  282. dvb_attach(tda18271_attach, adap->fe[0], 0x60,
  283. &adap->channel.hdw->i2c_adap,
  284. &hauppauge_tda18271_dvb_config);
  285. return 0;
  286. }
  287. static const struct pvr2_dvb_props pvr2_73xxx_dvb_props = {
  288. .frontend_attach = pvr2_tda10048_attach,
  289. .tuner_attach = pvr2_73xxx_tda18271_8295_attach,
  290. };
  291. #endif
  292. static const struct pvr2_device_client_desc pvr2_cli_73xxx[] = {
  293. { .module_id = PVR2_CLIENT_ID_CX25840 },
  294. { .module_id = PVR2_CLIENT_ID_TUNER,
  295. .i2c_address_list = "\x42"},
  296. };
  297. #define PVR2_FIRMWARE_73xxx "v4l-pvrusb2-73xxx-01.fw"
  298. static const char *pvr2_fw1_names_73xxx[] = {
  299. PVR2_FIRMWARE_73xxx,
  300. };
  301. static const struct pvr2_device_desc pvr2_device_73xxx = {
  302. .description = "WinTV HVR-1900 Model 73xxx",
  303. .shortname = "73xxx",
  304. .client_table.lst = pvr2_cli_73xxx,
  305. .client_table.cnt = ARRAY_SIZE(pvr2_cli_73xxx),
  306. .fx2_firmware.lst = pvr2_fw1_names_73xxx,
  307. .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_73xxx),
  308. .flag_has_cx25840 = !0,
  309. .flag_has_hauppauge_rom = !0,
  310. .flag_has_analogtuner = !0,
  311. .flag_has_composite = !0,
  312. .flag_has_svideo = !0,
  313. .flag_fx2_16kb = !0,
  314. .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
  315. .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
  316. .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
  317. .ir_scheme = PVR2_IR_SCHEME_ZILOG,
  318. #ifdef CONFIG_VIDEO_PVRUSB2_DVB
  319. .dvb_props = &pvr2_73xxx_dvb_props,
  320. #endif
  321. };
  322. /*------------------------------------------------------------------------*/
  323. /* Hauppauge PVR-USB2 Model 75xxx */
  324. #ifdef CONFIG_VIDEO_PVRUSB2_DVB
  325. static struct s5h1409_config pvr2_s5h1409_config = {
  326. .demod_address = 0x32 >> 1,
  327. .output_mode = S5H1409_PARALLEL_OUTPUT,
  328. .gpio = S5H1409_GPIO_OFF,
  329. .qam_if = 4000,
  330. .inversion = S5H1409_INVERSION_ON,
  331. .status_mode = S5H1409_DEMODLOCKING,
  332. };
  333. static struct s5h1411_config pvr2_s5h1411_config = {
  334. .output_mode = S5H1411_PARALLEL_OUTPUT,
  335. .gpio = S5H1411_GPIO_OFF,
  336. .vsb_if = S5H1411_IF_44000,
  337. .qam_if = S5H1411_IF_4000,
  338. .inversion = S5H1411_INVERSION_ON,
  339. .status_mode = S5H1411_DEMODLOCKING,
  340. };
  341. static struct tda18271_std_map hauppauge_tda18271_std_map = {
  342. .atsc_6 = { .if_freq = 5380, .agc_mode = 3, .std = 3,
  343. .if_lvl = 6, .rfagc_top = 0x37, },
  344. .qam_6 = { .if_freq = 4000, .agc_mode = 3, .std = 0,
  345. .if_lvl = 6, .rfagc_top = 0x37, },
  346. };
  347. static struct tda18271_config hauppauge_tda18271_config = {
  348. .std_map = &hauppauge_tda18271_std_map,
  349. .gate = TDA18271_GATE_ANALOG,
  350. .output_opt = TDA18271_OUTPUT_LT_OFF,
  351. };
  352. static int pvr2_s5h1409_attach(struct pvr2_dvb_adapter *adap)
  353. {
  354. adap->fe[0] = dvb_attach(s5h1409_attach, &pvr2_s5h1409_config,
  355. &adap->channel.hdw->i2c_adap);
  356. if (adap->fe[0])
  357. return 0;
  358. return -EIO;
  359. }
  360. static int pvr2_s5h1411_attach(struct pvr2_dvb_adapter *adap)
  361. {
  362. adap->fe[0] = dvb_attach(s5h1411_attach, &pvr2_s5h1411_config,
  363. &adap->channel.hdw->i2c_adap);
  364. if (adap->fe[0])
  365. return 0;
  366. return -EIO;
  367. }
  368. static int pvr2_tda18271_8295_attach(struct pvr2_dvb_adapter *adap)
  369. {
  370. dvb_attach(tda829x_attach, adap->fe[0],
  371. &adap->channel.hdw->i2c_adap, 0x42,
  372. &tda829x_no_probe);
  373. dvb_attach(tda18271_attach, adap->fe[0], 0x60,
  374. &adap->channel.hdw->i2c_adap,
  375. &hauppauge_tda18271_config);
  376. return 0;
  377. }
  378. static const struct pvr2_dvb_props pvr2_750xx_dvb_props = {
  379. .frontend_attach = pvr2_s5h1409_attach,
  380. .tuner_attach = pvr2_tda18271_8295_attach,
  381. };
  382. static const struct pvr2_dvb_props pvr2_751xx_dvb_props = {
  383. .frontend_attach = pvr2_s5h1411_attach,
  384. .tuner_attach = pvr2_tda18271_8295_attach,
  385. };
  386. #endif
  387. #define PVR2_FIRMWARE_75xxx "v4l-pvrusb2-73xxx-01.fw"
  388. static const char *pvr2_fw1_names_75xxx[] = {
  389. PVR2_FIRMWARE_75xxx,
  390. };
  391. static const struct pvr2_device_desc pvr2_device_750xx = {
  392. .description = "WinTV HVR-1950 Model 750xx",
  393. .shortname = "750xx",
  394. .client_table.lst = pvr2_cli_73xxx,
  395. .client_table.cnt = ARRAY_SIZE(pvr2_cli_73xxx),
  396. .fx2_firmware.lst = pvr2_fw1_names_75xxx,
  397. .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_75xxx),
  398. .flag_has_cx25840 = !0,
  399. .flag_has_hauppauge_rom = !0,
  400. .flag_has_analogtuner = !0,
  401. .flag_has_composite = !0,
  402. .flag_has_svideo = !0,
  403. .flag_fx2_16kb = !0,
  404. .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
  405. .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
  406. .default_std_mask = V4L2_STD_NTSC_M,
  407. .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
  408. .ir_scheme = PVR2_IR_SCHEME_ZILOG,
  409. #ifdef CONFIG_VIDEO_PVRUSB2_DVB
  410. .dvb_props = &pvr2_750xx_dvb_props,
  411. #endif
  412. };
  413. static const struct pvr2_device_desc pvr2_device_751xx = {
  414. .description = "WinTV HVR-1950 Model 751xx",
  415. .shortname = "751xx",
  416. .client_table.lst = pvr2_cli_73xxx,
  417. .client_table.cnt = ARRAY_SIZE(pvr2_cli_73xxx),
  418. .fx2_firmware.lst = pvr2_fw1_names_75xxx,
  419. .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_75xxx),
  420. .flag_has_cx25840 = !0,
  421. .flag_has_hauppauge_rom = !0,
  422. .flag_has_analogtuner = !0,
  423. .flag_has_composite = !0,
  424. .flag_has_svideo = !0,
  425. .flag_fx2_16kb = !0,
  426. .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
  427. .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
  428. .default_std_mask = V4L2_STD_NTSC_M,
  429. .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
  430. .ir_scheme = PVR2_IR_SCHEME_ZILOG,
  431. #ifdef CONFIG_VIDEO_PVRUSB2_DVB
  432. .dvb_props = &pvr2_751xx_dvb_props,
  433. #endif
  434. };
  435. /*------------------------------------------------------------------------*/
  436. /* Hauppauge PVR-USB2 Model 160000 / 160111 -- HVR-1955 / HVR-1975 */
  437. #ifdef CONFIG_VIDEO_PVRUSB2_DVB
  438. static int pvr2_si2157_attach(struct pvr2_dvb_adapter *adap);
  439. static int pvr2_si2168_attach(struct pvr2_dvb_adapter *adap);
  440. static int pvr2_dual_fe_attach(struct pvr2_dvb_adapter *adap);
  441. static int pvr2_lgdt3306a_attach(struct pvr2_dvb_adapter *adap);
  442. static const struct pvr2_dvb_props pvr2_160000_dvb_props = {
  443. .frontend_attach = pvr2_dual_fe_attach,
  444. .tuner_attach = pvr2_si2157_attach,
  445. };
  446. static const struct pvr2_dvb_props pvr2_160111_dvb_props = {
  447. .frontend_attach = pvr2_lgdt3306a_attach,
  448. .tuner_attach = pvr2_si2157_attach,
  449. };
  450. static int pvr2_si2157_attach(struct pvr2_dvb_adapter *adap)
  451. {
  452. struct si2157_config si2157_config = {};
  453. si2157_config.inversion = 1;
  454. si2157_config.fe = adap->fe[0];
  455. adap->i2c_client_tuner = dvb_module_probe("si2157", "si2177",
  456. &adap->channel.hdw->i2c_adap,
  457. 0x60, &si2157_config);
  458. if (!adap->i2c_client_tuner)
  459. return -ENODEV;
  460. return 0;
  461. }
  462. static int pvr2_si2168_attach(struct pvr2_dvb_adapter *adap)
  463. {
  464. struct si2168_config si2168_config = {};
  465. struct i2c_adapter *adapter;
  466. pr_debug("%s()\n", __func__);
  467. si2168_config.fe = &adap->fe[1];
  468. si2168_config.i2c_adapter = &adapter;
  469. si2168_config.ts_mode = SI2168_TS_PARALLEL; /*2, 1-serial, 2-parallel.*/
  470. si2168_config.ts_clock_gapped = 1; /*0-disabled, 1-enabled.*/
  471. si2168_config.ts_clock_inv = 0; /*0-not-invert, 1-invert*/
  472. si2168_config.spectral_inversion = 1; /*0-not-invert, 1-invert*/
  473. adap->i2c_client_demod[1] = dvb_module_probe("si2168", NULL,
  474. &adap->channel.hdw->i2c_adap,
  475. 0x64, &si2168_config);
  476. if (!adap->i2c_client_demod[1])
  477. return -ENODEV;
  478. return 0;
  479. }
  480. static int pvr2_lgdt3306a_attach(struct pvr2_dvb_adapter *adap)
  481. {
  482. struct lgdt3306a_config lgdt3306a_config;
  483. struct i2c_adapter *adapter;
  484. pr_debug("%s()\n", __func__);
  485. lgdt3306a_config.fe = &adap->fe[0];
  486. lgdt3306a_config.i2c_adapter = &adapter;
  487. lgdt3306a_config.deny_i2c_rptr = 1;
  488. lgdt3306a_config.spectral_inversion = 1;
  489. lgdt3306a_config.qam_if_khz = 4000;
  490. lgdt3306a_config.vsb_if_khz = 3250;
  491. lgdt3306a_config.mpeg_mode = LGDT3306A_MPEG_PARALLEL;
  492. lgdt3306a_config.tpclk_edge = LGDT3306A_TPCLK_FALLING_EDGE;
  493. lgdt3306a_config.tpvalid_polarity = LGDT3306A_TP_VALID_LOW;
  494. lgdt3306a_config.xtalMHz = 25; /* demod clock MHz; 24/25 supported */
  495. adap->i2c_client_demod[0] = dvb_module_probe("lgdt3306a", NULL,
  496. &adap->channel.hdw->i2c_adap,
  497. 0x59, &lgdt3306a_config);
  498. if (!adap->i2c_client_demod[0])
  499. return -ENODEV;
  500. return 0;
  501. }
  502. static int pvr2_dual_fe_attach(struct pvr2_dvb_adapter *adap)
  503. {
  504. pr_debug("%s()\n", __func__);
  505. if (pvr2_lgdt3306a_attach(adap) != 0)
  506. return -ENODEV;
  507. if (pvr2_si2168_attach(adap) != 0) {
  508. dvb_module_release(adap->i2c_client_demod[0]);
  509. return -ENODEV;
  510. }
  511. return 0;
  512. }
  513. #endif
  514. #define PVR2_FIRMWARE_160xxx "v4l-pvrusb2-160xxx-01.fw"
  515. static const char *pvr2_fw1_names_160xxx[] = {
  516. PVR2_FIRMWARE_160xxx,
  517. };
  518. static const struct pvr2_device_client_desc pvr2_cli_160xxx[] = {
  519. { .module_id = PVR2_CLIENT_ID_CX25840 },
  520. };
  521. static const struct pvr2_device_desc pvr2_device_160000 = {
  522. .description = "WinTV HVR-1975 Model 160000",
  523. .shortname = "160000",
  524. .client_table.lst = pvr2_cli_160xxx,
  525. .client_table.cnt = ARRAY_SIZE(pvr2_cli_160xxx),
  526. .fx2_firmware.lst = pvr2_fw1_names_160xxx,
  527. .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_160xxx),
  528. .default_tuner_type = TUNER_ABSENT,
  529. .flag_has_cx25840 = 1,
  530. .flag_has_hauppauge_rom = 1,
  531. .flag_has_analogtuner = 1,
  532. .flag_has_composite = 1,
  533. .flag_has_svideo = 1,
  534. .flag_fx2_16kb = 1,
  535. .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
  536. .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
  537. .default_std_mask = V4L2_STD_NTSC_M,
  538. .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
  539. .ir_scheme = PVR2_IR_SCHEME_ZILOG,
  540. #ifdef CONFIG_VIDEO_PVRUSB2_DVB
  541. .dvb_props = &pvr2_160000_dvb_props,
  542. #endif
  543. };
  544. static const struct pvr2_device_desc pvr2_device_160111 = {
  545. .description = "WinTV HVR-1955 Model 160111",
  546. .shortname = "160111",
  547. .client_table.lst = pvr2_cli_160xxx,
  548. .client_table.cnt = ARRAY_SIZE(pvr2_cli_160xxx),
  549. .fx2_firmware.lst = pvr2_fw1_names_160xxx,
  550. .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_160xxx),
  551. .default_tuner_type = TUNER_ABSENT,
  552. .flag_has_cx25840 = 1,
  553. .flag_has_hauppauge_rom = 1,
  554. .flag_has_analogtuner = 1,
  555. .flag_has_composite = 1,
  556. .flag_has_svideo = 1,
  557. .flag_fx2_16kb = 1,
  558. .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
  559. .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
  560. .default_std_mask = V4L2_STD_NTSC_M,
  561. .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
  562. .ir_scheme = PVR2_IR_SCHEME_ZILOG,
  563. #ifdef CONFIG_VIDEO_PVRUSB2_DVB
  564. .dvb_props = &pvr2_160111_dvb_props,
  565. #endif
  566. };
  567. /*------------------------------------------------------------------------*/
  568. struct usb_device_id pvr2_device_table[] = {
  569. { USB_DEVICE(0x2040, 0x2900),
  570. .driver_info = (kernel_ulong_t)&pvr2_device_29xxx},
  571. { USB_DEVICE(0x2040, 0x2950), /* Logically identical to 2900 */
  572. .driver_info = (kernel_ulong_t)&pvr2_device_29xxx},
  573. { USB_DEVICE(0x2040, 0x2400),
  574. .driver_info = (kernel_ulong_t)&pvr2_device_24xxx},
  575. { USB_DEVICE(0x1164, 0x0622),
  576. .driver_info = (kernel_ulong_t)&pvr2_device_gotview_2},
  577. { USB_DEVICE(0x1164, 0x0602),
  578. .driver_info = (kernel_ulong_t)&pvr2_device_gotview_2d},
  579. { USB_DEVICE(0x11ba, 0x1003),
  580. .driver_info = (kernel_ulong_t)&pvr2_device_onair_creator},
  581. { USB_DEVICE(0x11ba, 0x1001),
  582. .driver_info = (kernel_ulong_t)&pvr2_device_onair_usb2},
  583. { USB_DEVICE(0x2040, 0x7300),
  584. .driver_info = (kernel_ulong_t)&pvr2_device_73xxx},
  585. { USB_DEVICE(0x2040, 0x7500),
  586. .driver_info = (kernel_ulong_t)&pvr2_device_750xx},
  587. { USB_DEVICE(0x2040, 0x7501),
  588. .driver_info = (kernel_ulong_t)&pvr2_device_751xx},
  589. { USB_DEVICE(0x0ccd, 0x0039),
  590. .driver_info = (kernel_ulong_t)&pvr2_device_av400},
  591. { USB_DEVICE(0x2040, 0x7502),
  592. .driver_info = (kernel_ulong_t)&pvr2_device_160111},
  593. { USB_DEVICE(0x2040, 0x7510),
  594. .driver_info = (kernel_ulong_t)&pvr2_device_160000},
  595. { }
  596. };
  597. MODULE_DEVICE_TABLE(usb, pvr2_device_table);
  598. MODULE_FIRMWARE(PVR2_FIRMWARE_29xxx);
  599. MODULE_FIRMWARE(PVR2_FIRMWARE_24xxx);
  600. MODULE_FIRMWARE(PVR2_FIRMWARE_73xxx);
  601. MODULE_FIRMWARE(PVR2_FIRMWARE_75xxx);