pvrusb2-devattr.c 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. /*
  2. *
  3. * $Id$
  4. *
  5. * Copyright (C) 2007 Mike Isely <isely@pobox.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License
  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. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. *
  20. */
  21. /*
  22. This source file should encompass ALL per-device type information for the
  23. driver. To define a new device, add elements to the pvr2_device_table and
  24. pvr2_device_desc structures.
  25. */
  26. #include "pvrusb2-devattr.h"
  27. #include <linux/usb.h>
  28. /* This is needed in order to pull in tuner type ids... */
  29. #include <linux/i2c.h>
  30. #include <media/tuner.h>
  31. #ifdef CONFIG_VIDEO_PVRUSB2_DVB
  32. #include "pvrusb2-hdw-internal.h"
  33. #include "lgdt330x.h"
  34. #include "tuner-simple.h"
  35. #endif
  36. /*------------------------------------------------------------------------*/
  37. /* Hauppauge PVR-USB2 Model 29xxx */
  38. static const char *pvr2_client_29xxx[] = {
  39. "msp3400",
  40. "saa7115",
  41. "tuner",
  42. };
  43. static const char *pvr2_fw1_names_29xxx[] = {
  44. "v4l-pvrusb2-29xxx-01.fw",
  45. };
  46. static const struct pvr2_device_desc pvr2_device_29xxx = {
  47. .description = "WinTV PVR USB2 Model Category 29xxx",
  48. .shortname = "29xxx",
  49. .client_modules.lst = pvr2_client_29xxx,
  50. .client_modules.cnt = ARRAY_SIZE(pvr2_client_29xxx),
  51. .fx2_firmware.lst = pvr2_fw1_names_29xxx,
  52. .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_29xxx),
  53. .flag_has_hauppauge_rom = !0,
  54. .flag_has_analogtuner = !0,
  55. .flag_has_fmradio = !0,
  56. .flag_has_composite = !0,
  57. .flag_has_svideo = !0,
  58. .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
  59. .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
  60. };
  61. /*------------------------------------------------------------------------*/
  62. /* Hauppauge PVR-USB2 Model 24xxx */
  63. static const char *pvr2_client_24xxx[] = {
  64. "cx25840",
  65. "tuner",
  66. "wm8775",
  67. };
  68. static const char *pvr2_fw1_names_24xxx[] = {
  69. "v4l-pvrusb2-24xxx-01.fw",
  70. };
  71. static const struct pvr2_device_desc pvr2_device_24xxx = {
  72. .description = "WinTV PVR USB2 Model Category 24xxx",
  73. .shortname = "24xxx",
  74. .client_modules.lst = pvr2_client_24xxx,
  75. .client_modules.cnt = ARRAY_SIZE(pvr2_client_24xxx),
  76. .fx2_firmware.lst = pvr2_fw1_names_24xxx,
  77. .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_24xxx),
  78. .flag_has_cx25840 = !0,
  79. .flag_has_wm8775 = !0,
  80. .flag_has_hauppauge_rom = !0,
  81. .flag_has_hauppauge_custom_ir = !0,
  82. .flag_has_analogtuner = !0,
  83. .flag_has_fmradio = !0,
  84. .flag_has_composite = !0,
  85. .flag_has_svideo = !0,
  86. .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
  87. .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
  88. };
  89. /*------------------------------------------------------------------------*/
  90. /* GOTVIEW USB2.0 DVD2 */
  91. static const char *pvr2_client_gotview_2[] = {
  92. "cx25840",
  93. "tuner",
  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_modules.lst = pvr2_client_gotview_2,
  99. .client_modules.cnt = ARRAY_SIZE(pvr2_client_gotview_2),
  100. .flag_has_cx25840 = !0,
  101. .default_tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
  102. .flag_has_analogtuner = !0,
  103. .flag_has_composite = !0,
  104. .flag_has_svideo = !0,
  105. .signal_routing_scheme = PVR2_ROUTING_SCHEME_GOTVIEW,
  106. };
  107. /*------------------------------------------------------------------------*/
  108. /* GOTVIEW USB2.0 DVD Deluxe */
  109. /* (same module list as gotview_2) */
  110. static const struct pvr2_device_desc pvr2_device_gotview_2d = {
  111. .description = "Gotview USB 2.0 DVD Deluxe",
  112. .shortname = "gv2d",
  113. .client_modules.lst = pvr2_client_gotview_2,
  114. .client_modules.cnt = ARRAY_SIZE(pvr2_client_gotview_2),
  115. .flag_has_cx25840 = !0,
  116. .default_tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
  117. .flag_has_analogtuner = !0,
  118. .flag_has_composite = !0,
  119. .flag_has_svideo = !0,
  120. .signal_routing_scheme = PVR2_ROUTING_SCHEME_GOTVIEW,
  121. };
  122. #ifdef CONFIG_VIDEO_PVRUSB2_ONAIR_CREATOR
  123. /*------------------------------------------------------------------------*/
  124. /* OnAir Creator */
  125. #ifdef CONFIG_VIDEO_PVRUSB2_DVB
  126. static struct lgdt330x_config pvr2_lgdt3303_config = {
  127. .demod_address = 0x0e,
  128. .demod_chip = LGDT3303,
  129. .clock_polarity_flip = 1,
  130. };
  131. static int pvr2_lgdt3303_attach(struct pvr2_dvb_adapter *adap)
  132. {
  133. adap->fe = dvb_attach(lgdt330x_attach, &pvr2_lgdt3303_config,
  134. &adap->channel.hdw->i2c_adap);
  135. if (adap->fe)
  136. return 0;
  137. return -EIO;
  138. }
  139. static int pvr2_lgh06xf_attach(struct pvr2_dvb_adapter *adap)
  140. {
  141. dvb_attach(simple_tuner_attach, adap->fe,
  142. &adap->channel.hdw->i2c_adap, 0x61,
  143. TUNER_LG_TDVS_H06XF);
  144. return 0;
  145. }
  146. struct pvr2_dvb_props pvr2_onair_creator_fe_props = {
  147. .frontend_attach = pvr2_lgdt3303_attach,
  148. .tuner_attach = pvr2_lgh06xf_attach,
  149. };
  150. #endif
  151. static const char *pvr2_client_onair_creator[] = {
  152. "saa7115",
  153. "tuner",
  154. "cs53l32a",
  155. };
  156. static const struct pvr2_device_desc pvr2_device_onair_creator = {
  157. .description = "OnAir Creator Hybrid USB tuner",
  158. .shortname = "oac",
  159. .client_modules.lst = pvr2_client_onair_creator,
  160. .client_modules.cnt = ARRAY_SIZE(pvr2_client_onair_creator),
  161. .default_tuner_type = TUNER_LG_TDVS_H06XF,
  162. .flag_has_analogtuner = !0,
  163. .flag_has_composite = !0,
  164. .flag_has_svideo = !0,
  165. .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
  166. .digital_control_scheme = PVR2_DIGITAL_SCHEME_ONAIR,
  167. .default_std_mask = V4L2_STD_NTSC_M,
  168. #ifdef CONFIG_VIDEO_PVRUSB2_DVB
  169. .dvb_props = &pvr2_onair_creator_fe_props,
  170. #endif
  171. };
  172. #endif
  173. #ifdef CONFIG_VIDEO_PVRUSB2_ONAIR_USB2
  174. /*------------------------------------------------------------------------*/
  175. /* OnAir USB 2.0 */
  176. #ifdef CONFIG_VIDEO_PVRUSB2_DVB
  177. static struct lgdt330x_config pvr2_lgdt3302_config = {
  178. .demod_address = 0x0e,
  179. .demod_chip = LGDT3302,
  180. };
  181. static int pvr2_lgdt3302_attach(struct pvr2_dvb_adapter *adap)
  182. {
  183. adap->fe = dvb_attach(lgdt330x_attach, &pvr2_lgdt3302_config,
  184. &adap->channel.hdw->i2c_adap);
  185. if (adap->fe)
  186. return 0;
  187. return -EIO;
  188. }
  189. static int pvr2_fcv1236d_attach(struct pvr2_dvb_adapter *adap)
  190. {
  191. dvb_attach(simple_tuner_attach, adap->fe,
  192. &adap->channel.hdw->i2c_adap, 0x61,
  193. TUNER_PHILIPS_FCV1236D);
  194. return 0;
  195. }
  196. struct pvr2_dvb_props pvr2_onair_usb2_fe_props = {
  197. .frontend_attach = pvr2_lgdt3302_attach,
  198. .tuner_attach = pvr2_fcv1236d_attach,
  199. };
  200. #endif
  201. static const char *pvr2_client_onair_usb2[] = {
  202. "saa7115",
  203. "tuner",
  204. "cs53l32a",
  205. };
  206. static const struct pvr2_device_desc pvr2_device_onair_usb2 = {
  207. .description = "OnAir USB2 Hybrid USB tuner",
  208. .shortname = "oa2",
  209. .client_modules.lst = pvr2_client_onair_usb2,
  210. .client_modules.cnt = ARRAY_SIZE(pvr2_client_onair_usb2),
  211. .default_tuner_type = TUNER_PHILIPS_FCV1236D,
  212. .flag_has_analogtuner = !0,
  213. .flag_has_composite = !0,
  214. .flag_has_svideo = !0,
  215. .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
  216. .digital_control_scheme = PVR2_DIGITAL_SCHEME_ONAIR,
  217. .default_std_mask = V4L2_STD_NTSC_M,
  218. #ifdef CONFIG_VIDEO_PVRUSB2_DVB
  219. .dvb_props = &pvr2_onair_usb2_fe_props,
  220. #endif
  221. };
  222. #endif
  223. /*------------------------------------------------------------------------*/
  224. /* Hauppauge PVR-USB2 Model 73xxx */
  225. static const char *pvr2_client_73xxx[] = {
  226. "cx25840",
  227. "tuner",
  228. };
  229. static const char *pvr2_fw1_names_73xxx[] = {
  230. "v4l-pvrusb2-73xxx-01.fw",
  231. };
  232. static const struct pvr2_device_desc pvr2_device_73xxx = {
  233. .description = "WinTV PVR USB2 Model Category 73xxx",
  234. .shortname = "73xxx",
  235. .client_modules.lst = pvr2_client_73xxx,
  236. .client_modules.cnt = ARRAY_SIZE(pvr2_client_73xxx),
  237. .fx2_firmware.lst = pvr2_fw1_names_73xxx,
  238. .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_73xxx),
  239. .flag_has_cx25840 = !0,
  240. .flag_has_hauppauge_rom = !0,
  241. .flag_has_analogtuner = !0,
  242. .flag_has_composite = !0,
  243. .flag_has_svideo = !0,
  244. .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
  245. .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
  246. .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
  247. };
  248. /*------------------------------------------------------------------------*/
  249. /* Hauppauge PVR-USB2 Model 75xxx */
  250. static const char *pvr2_client_75xxx[] = {
  251. "cx25840",
  252. "tuner",
  253. };
  254. static const char *pvr2_fw1_names_75xxx[] = {
  255. "v4l-pvrusb2-73xxx-01.fw",
  256. };
  257. static const struct pvr2_device_desc pvr2_device_750xx = {
  258. .description = "WinTV PVR USB2 Model Category 750xx",
  259. .shortname = "750xx",
  260. .client_modules.lst = pvr2_client_75xxx,
  261. .client_modules.cnt = ARRAY_SIZE(pvr2_client_75xxx),
  262. .fx2_firmware.lst = pvr2_fw1_names_75xxx,
  263. .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_75xxx),
  264. .flag_has_cx25840 = !0,
  265. .flag_has_hauppauge_rom = !0,
  266. .flag_has_analogtuner = !0,
  267. .flag_has_composite = !0,
  268. .flag_has_svideo = !0,
  269. .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
  270. .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
  271. .default_std_mask = V4L2_STD_NTSC_M,
  272. .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
  273. };
  274. static const struct pvr2_device_desc pvr2_device_751xx = {
  275. .description = "WinTV PVR USB2 Model Category 751xx",
  276. .shortname = "751xx",
  277. .client_modules.lst = pvr2_client_75xxx,
  278. .client_modules.cnt = ARRAY_SIZE(pvr2_client_75xxx),
  279. .fx2_firmware.lst = pvr2_fw1_names_75xxx,
  280. .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_75xxx),
  281. .flag_has_cx25840 = !0,
  282. .flag_has_hauppauge_rom = !0,
  283. .flag_has_analogtuner = !0,
  284. .flag_has_composite = !0,
  285. .flag_has_svideo = !0,
  286. .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
  287. .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
  288. .default_std_mask = V4L2_STD_NTSC_M,
  289. .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
  290. };
  291. /*------------------------------------------------------------------------*/
  292. struct usb_device_id pvr2_device_table[] = {
  293. { USB_DEVICE(0x2040, 0x2900),
  294. .driver_info = (kernel_ulong_t)&pvr2_device_29xxx},
  295. { USB_DEVICE(0x2040, 0x2400),
  296. .driver_info = (kernel_ulong_t)&pvr2_device_24xxx},
  297. { USB_DEVICE(0x1164, 0x0622),
  298. .driver_info = (kernel_ulong_t)&pvr2_device_gotview_2},
  299. { USB_DEVICE(0x1164, 0x0602),
  300. .driver_info = (kernel_ulong_t)&pvr2_device_gotview_2d},
  301. #ifdef CONFIG_VIDEO_PVRUSB2_ONAIR_CREATOR
  302. { USB_DEVICE(0x11ba, 0x1003),
  303. .driver_info = (kernel_ulong_t)&pvr2_device_onair_creator},
  304. #endif
  305. #ifdef CONFIG_VIDEO_PVRUSB2_ONAIR_USB2
  306. { USB_DEVICE(0x11ba, 0x1001),
  307. .driver_info = (kernel_ulong_t)&pvr2_device_onair_usb2},
  308. #endif
  309. { USB_DEVICE(0x2040, 0x7300),
  310. .driver_info = (kernel_ulong_t)&pvr2_device_73xxx},
  311. { USB_DEVICE(0x2040, 0x7500),
  312. .driver_info = (kernel_ulong_t)&pvr2_device_750xx},
  313. { USB_DEVICE(0x2040, 0x7501),
  314. .driver_info = (kernel_ulong_t)&pvr2_device_751xx},
  315. { }
  316. };
  317. MODULE_DEVICE_TABLE(usb, pvr2_device_table);
  318. /*
  319. Stuff for Emacs to see, in order to encourage consistent editing style:
  320. *** Local Variables: ***
  321. *** mode: c ***
  322. *** fill-column: 75 ***
  323. *** tab-width: 8 ***
  324. *** c-basic-offset: 8 ***
  325. *** End: ***
  326. */