blob: 64a29adcfd920f58394df9088c06c4ec391278a9 [file] [log] [blame]
Mike Isely989eb152007-11-26 01:53:12 -03001/*
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/*
23
24This source file should encompass ALL per-device type information for the
25driver. To define a new device, add elements to the pvr2_device_table and
26pvr2_device_desc structures.
27
28*/
29
30#include "pvrusb2-devattr.h"
31#include <linux/usb.h>
Mike Isely6a540252007-12-02 23:51:34 -030032/* This is needed in order to pull in tuner type ids... */
Mike Isely9e2e3ae2007-11-26 02:14:23 -030033#include <linux/i2c.h>
Mike Isely9e2e3ae2007-11-26 02:14:23 -030034#include <media/tuner.h>
Michael Krufky906a4952008-03-28 05:47:47 -030035#ifdef CONFIG_VIDEO_PVRUSB2_DVB
36#include "pvrusb2-hdw-internal.h"
37#include "lgdt330x.h"
Michael Krufky087886e2008-03-28 05:49:36 -030038#include "s5h1409.h"
39#include "tda18271.h"
40#include "tda8290.h"
Michael Krufky906a4952008-03-28 05:47:47 -030041#include "tuner-simple.h"
42#endif
Mike Isely989eb152007-11-26 01:53:12 -030043
Mike Isely45427832007-12-08 17:11:13 -030044
Mike Iselyd130fa82007-12-08 17:20:06 -030045/*------------------------------------------------------------------------*/
46/* Hauppauge PVR-USB2 Model 29xxx */
Mike Isely989eb152007-11-26 01:53:12 -030047
Mike Isely989eb152007-11-26 01:53:12 -030048static const char *pvr2_client_29xxx[] = {
49 "msp3400",
50 "saa7115",
51 "tuner",
52};
53
Mike Isely989eb152007-11-26 01:53:12 -030054static const char *pvr2_fw1_names_29xxx[] = {
55 "v4l-pvrusb2-29xxx-01.fw",
56};
57
Mike Iselyd130fa82007-12-08 17:20:06 -030058static const struct pvr2_device_desc pvr2_device_29xxx = {
Mike Iselye7f677f2008-03-16 01:13:17 -030059 .description = "WinTV PVR USB2 Model Category 29xxx",
Mike Isely989eb152007-11-26 01:53:12 -030060 .shortname = "29xxx",
61 .client_modules.lst = pvr2_client_29xxx,
62 .client_modules.cnt = ARRAY_SIZE(pvr2_client_29xxx),
63 .fx2_firmware.lst = pvr2_fw1_names_29xxx,
64 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_29xxx),
Mike Iselyaaf78842007-11-26 02:04:11 -030065 .flag_has_hauppauge_rom = !0,
Mike Isely1aaac602008-04-22 14:45:36 -030066 .flag_has_analogtuner = !0,
Mike Iselyd068c6e2008-04-22 14:45:36 -030067 .flag_has_fmradio = !0,
Mike Isely1aaac602008-04-22 14:45:36 -030068 .flag_has_composite = !0,
69 .flag_has_svideo = !0,
Mike Iselyf5174af2007-11-26 02:07:26 -030070 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
Mike Isely40381cb2008-04-22 14:45:42 -030071 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
Mike Iselyd130fa82007-12-08 17:20:06 -030072};
73
74
75
76/*------------------------------------------------------------------------*/
77/* Hauppauge PVR-USB2 Model 24xxx */
78
79static const char *pvr2_client_24xxx[] = {
80 "cx25840",
81 "tuner",
82 "wm8775",
83};
84
85static const char *pvr2_fw1_names_24xxx[] = {
86 "v4l-pvrusb2-24xxx-01.fw",
87};
88
89static const struct pvr2_device_desc pvr2_device_24xxx = {
Mike Iselye7f677f2008-03-16 01:13:17 -030090 .description = "WinTV PVR USB2 Model Category 24xxx",
Mike Isely989eb152007-11-26 01:53:12 -030091 .shortname = "24xxx",
92 .client_modules.lst = pvr2_client_24xxx,
93 .client_modules.cnt = ARRAY_SIZE(pvr2_client_24xxx),
94 .fx2_firmware.lst = pvr2_fw1_names_24xxx,
95 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_24xxx),
96 .flag_has_cx25840 = !0,
97 .flag_has_wm8775 = !0,
Mike Iselyaaf78842007-11-26 02:04:11 -030098 .flag_has_hauppauge_rom = !0,
Mike Isely056d1a82007-11-26 02:09:42 -030099 .flag_has_hauppauge_custom_ir = !0,
Mike Isely1aaac602008-04-22 14:45:36 -0300100 .flag_has_analogtuner = !0,
Mike Iselyd068c6e2008-04-22 14:45:36 -0300101 .flag_has_fmradio = !0,
Mike Isely1aaac602008-04-22 14:45:36 -0300102 .flag_has_composite = !0,
103 .flag_has_svideo = !0,
Mike Iselyf5174af2007-11-26 02:07:26 -0300104 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
Mike Isely40381cb2008-04-22 14:45:42 -0300105 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
Mike Iselyd130fa82007-12-08 17:20:06 -0300106};
107
108
109
110/*------------------------------------------------------------------------*/
111/* GOTVIEW USB2.0 DVD2 */
112
113static const char *pvr2_client_gotview_2[] = {
114 "cx25840",
115 "tuner",
116};
117
118static const struct pvr2_device_desc pvr2_device_gotview_2 = {
Mike Isely9e2e3ae2007-11-26 02:14:23 -0300119 .description = "Gotview USB 2.0 DVD 2",
120 .shortname = "gv2",
121 .client_modules.lst = pvr2_client_gotview_2,
122 .client_modules.cnt = ARRAY_SIZE(pvr2_client_gotview_2),
Mike Isely787f5ab2007-12-08 17:08:32 -0300123 .flag_has_cx25840 = !0,
Mike Isely9e2e3ae2007-11-26 02:14:23 -0300124 .default_tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
Mike Isely1aaac602008-04-22 14:45:36 -0300125 .flag_has_analogtuner = !0,
126 .flag_has_composite = !0,
127 .flag_has_svideo = !0,
Mike Isely9e2e3ae2007-11-26 02:14:23 -0300128 .signal_routing_scheme = PVR2_ROUTING_SCHEME_GOTVIEW,
Mike Isely989eb152007-11-26 01:53:12 -0300129};
130
Mike Iselyd130fa82007-12-08 17:20:06 -0300131
132
Mike Iselyfd1da782008-04-22 14:45:42 -0300133/*------------------------------------------------------------------------*/
134/* GOTVIEW USB2.0 DVD Deluxe */
135
136/* (same module list as gotview_2) */
137
138static const struct pvr2_device_desc pvr2_device_gotview_2d = {
139 .description = "Gotview USB 2.0 DVD Deluxe",
140 .shortname = "gv2d",
141 .client_modules.lst = pvr2_client_gotview_2,
142 .client_modules.cnt = ARRAY_SIZE(pvr2_client_gotview_2),
143 .flag_has_cx25840 = !0,
144 .default_tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
145 .flag_has_analogtuner = !0,
146 .flag_has_composite = !0,
147 .flag_has_svideo = !0,
148 .signal_routing_scheme = PVR2_ROUTING_SCHEME_GOTVIEW,
149};
150
151
152
Mike Iselyd130fa82007-12-08 17:20:06 -0300153#ifdef CONFIG_VIDEO_PVRUSB2_ONAIR_CREATOR
154/*------------------------------------------------------------------------*/
155/* OnAir Creator */
156
Michael Krufky906a4952008-03-28 05:47:47 -0300157#ifdef CONFIG_VIDEO_PVRUSB2_DVB
158static struct lgdt330x_config pvr2_lgdt3303_config = {
159 .demod_address = 0x0e,
160 .demod_chip = LGDT3303,
161 .clock_polarity_flip = 1,
162};
163
164static int pvr2_lgdt3303_attach(struct pvr2_dvb_adapter *adap)
165{
166 adap->fe = dvb_attach(lgdt330x_attach, &pvr2_lgdt3303_config,
167 &adap->channel.hdw->i2c_adap);
168 if (adap->fe)
169 return 0;
170
171 return -EIO;
172}
173
174static int pvr2_lgh06xf_attach(struct pvr2_dvb_adapter *adap)
175{
176 dvb_attach(simple_tuner_attach, adap->fe,
177 &adap->channel.hdw->i2c_adap, 0x61,
178 TUNER_LG_TDVS_H06XF);
179
180 return 0;
181}
182
183struct pvr2_dvb_props pvr2_onair_creator_fe_props = {
184 .frontend_attach = pvr2_lgdt3303_attach,
185 .tuner_attach = pvr2_lgh06xf_attach,
186};
187#endif
188
Mike Iselyd130fa82007-12-08 17:20:06 -0300189static const char *pvr2_client_onair_creator[] = {
190 "saa7115",
191 "tuner",
192 "cs53l32a",
193};
194
195static const struct pvr2_device_desc pvr2_device_onair_creator = {
196 .description = "OnAir Creator Hybrid USB tuner",
197 .shortname = "oac",
198 .client_modules.lst = pvr2_client_onair_creator,
199 .client_modules.cnt = ARRAY_SIZE(pvr2_client_onair_creator),
200 .default_tuner_type = TUNER_LG_TDVS_H06XF,
Mike Isely1aaac602008-04-22 14:45:36 -0300201 .flag_has_analogtuner = !0,
202 .flag_has_composite = !0,
203 .flag_has_svideo = !0,
Mike Iselyd130fa82007-12-08 17:20:06 -0300204 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
Mike Iselye8f5bac2008-04-22 14:45:40 -0300205 .digital_control_scheme = PVR2_DIGITAL_SCHEME_ONAIR,
Michael Krufkyf0910c72008-04-22 14:45:45 -0300206 .default_std_mask = V4L2_STD_NTSC_M,
Michael Krufky906a4952008-03-28 05:47:47 -0300207#ifdef CONFIG_VIDEO_PVRUSB2_DVB
208 .dvb_props = &pvr2_onair_creator_fe_props,
209#endif
Mike Iselyd130fa82007-12-08 17:20:06 -0300210};
211#endif
212
213
214
215#ifdef CONFIG_VIDEO_PVRUSB2_ONAIR_USB2
216/*------------------------------------------------------------------------*/
217/* OnAir USB 2.0 */
218
Michael Krufky906a4952008-03-28 05:47:47 -0300219#ifdef CONFIG_VIDEO_PVRUSB2_DVB
220static struct lgdt330x_config pvr2_lgdt3302_config = {
221 .demod_address = 0x0e,
222 .demod_chip = LGDT3302,
223};
224
225static int pvr2_lgdt3302_attach(struct pvr2_dvb_adapter *adap)
226{
227 adap->fe = dvb_attach(lgdt330x_attach, &pvr2_lgdt3302_config,
228 &adap->channel.hdw->i2c_adap);
229 if (adap->fe)
230 return 0;
231
232 return -EIO;
233}
234
235static int pvr2_fcv1236d_attach(struct pvr2_dvb_adapter *adap)
236{
237 dvb_attach(simple_tuner_attach, adap->fe,
238 &adap->channel.hdw->i2c_adap, 0x61,
239 TUNER_PHILIPS_FCV1236D);
240
241 return 0;
242}
243
244struct pvr2_dvb_props pvr2_onair_usb2_fe_props = {
245 .frontend_attach = pvr2_lgdt3302_attach,
246 .tuner_attach = pvr2_fcv1236d_attach,
247};
248#endif
249
Mike Iselyd130fa82007-12-08 17:20:06 -0300250static const char *pvr2_client_onair_usb2[] = {
251 "saa7115",
252 "tuner",
253 "cs53l32a",
254};
255
256static const struct pvr2_device_desc pvr2_device_onair_usb2 = {
257 .description = "OnAir USB2 Hybrid USB tuner",
258 .shortname = "oa2",
259 .client_modules.lst = pvr2_client_onair_usb2,
260 .client_modules.cnt = ARRAY_SIZE(pvr2_client_onair_usb2),
Michael Krufkyab8b8702008-04-22 14:46:05 -0300261 .default_tuner_type = TUNER_PHILIPS_FCV1236D,
Mike Isely1aaac602008-04-22 14:45:36 -0300262 .flag_has_analogtuner = !0,
263 .flag_has_composite = !0,
264 .flag_has_svideo = !0,
Mike Iselyd130fa82007-12-08 17:20:06 -0300265 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
Mike Iselye8f5bac2008-04-22 14:45:40 -0300266 .digital_control_scheme = PVR2_DIGITAL_SCHEME_ONAIR,
Michael Krufkyf0910c72008-04-22 14:45:45 -0300267 .default_std_mask = V4L2_STD_NTSC_M,
Michael Krufky906a4952008-03-28 05:47:47 -0300268#ifdef CONFIG_VIDEO_PVRUSB2_DVB
269 .dvb_props = &pvr2_onair_usb2_fe_props,
270#endif
Mike Iselyd130fa82007-12-08 17:20:06 -0300271};
272#endif
273
274
275
276/*------------------------------------------------------------------------*/
Michael Krufky92c9d072008-03-15 23:59:29 -0300277/* Hauppauge PVR-USB2 Model 73xxx */
278
279static const char *pvr2_client_73xxx[] = {
280 "cx25840",
281 "tuner",
282};
283
284static const char *pvr2_fw1_names_73xxx[] = {
285 "v4l-pvrusb2-73xxx-01.fw",
286};
287
288static const struct pvr2_device_desc pvr2_device_73xxx = {
Mike Iselye7f677f2008-03-16 01:13:17 -0300289 .description = "WinTV PVR USB2 Model Category 73xxx",
Michael Krufky92c9d072008-03-15 23:59:29 -0300290 .shortname = "73xxx",
291 .client_modules.lst = pvr2_client_73xxx,
292 .client_modules.cnt = ARRAY_SIZE(pvr2_client_73xxx),
293 .fx2_firmware.lst = pvr2_fw1_names_73xxx,
294 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_73xxx),
295 .flag_has_cx25840 = !0,
296 .flag_has_hauppauge_rom = !0,
297 .flag_has_analogtuner = !0,
298 .flag_has_composite = !0,
299 .flag_has_svideo = !0,
300 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
301 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
302 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
303};
304
305
306
307/*------------------------------------------------------------------------*/
Michael Krufky11fcd472007-10-25 02:01:10 -0300308/* Hauppauge PVR-USB2 Model 75xxx */
309
Michael Krufky087886e2008-03-28 05:49:36 -0300310#ifdef CONFIG_VIDEO_PVRUSB2_DVB
311static struct s5h1409_config pvr2_s5h1409_config = {
312 .demod_address = 0x32 >> 1,
313 .output_mode = S5H1409_PARALLEL_OUTPUT,
314 .gpio = S5H1409_GPIO_OFF,
315 .qam_if = 4000,
316 .inversion = S5H1409_INVERSION_ON,
317 .status_mode = S5H1409_DEMODLOCKING,
318};
319
320static struct tda829x_config tda829x_no_probe = {
321 .probe_tuner = TDA829X_DONT_PROBE,
322};
323
324static struct tda18271_std_map hauppauge_tda18271_std_map = {
325 .atsc_6 = { .if_freq = 5380, .agc_mode = 3, .std = 3,
326 .if_lvl = 6, .rfagc_top = 0x37, },
327 .qam_6 = { .if_freq = 4000, .agc_mode = 3, .std = 0,
328 .if_lvl = 6, .rfagc_top = 0x37, },
329};
330
331static struct tda18271_config hauppauge_tda18271_config = {
332 .std_map = &hauppauge_tda18271_std_map,
333 .gate = TDA18271_GATE_ANALOG,
334};
335
336static int pvr2_s5h1409_attach(struct pvr2_dvb_adapter *adap)
337{
338 adap->fe = dvb_attach(s5h1409_attach, &pvr2_s5h1409_config,
339 &adap->channel.hdw->i2c_adap);
340 if (adap->fe)
341 return 0;
342
343 return -EIO;
344}
345
346static int pvr2_tda18271_8295_attach(struct pvr2_dvb_adapter *adap)
347{
348 dvb_attach(tda829x_attach, adap->fe,
349 &adap->channel.hdw->i2c_adap, 0x42,
350 &tda829x_no_probe);
351 dvb_attach(tda18271_attach, adap->fe, 0x60,
352 &adap->channel.hdw->i2c_adap,
353 &hauppauge_tda18271_config);
354
355 return 0;
356}
357
358struct pvr2_dvb_props pvr2_750xx_dvb_props = {
359 .frontend_attach = pvr2_s5h1409_attach,
360 .tuner_attach = pvr2_tda18271_8295_attach,
361};
362#endif
363
Michael Krufky11fcd472007-10-25 02:01:10 -0300364static const char *pvr2_client_75xxx[] = {
365 "cx25840",
366 "tuner",
367};
368
369static const char *pvr2_fw1_names_75xxx[] = {
370 "v4l-pvrusb2-73xxx-01.fw",
371};
372
Michael Krufkyc8812842008-03-28 05:48:44 -0300373static const struct pvr2_device_desc pvr2_device_750xx = {
374 .description = "WinTV PVR USB2 Model Category 750xx",
375 .shortname = "750xx",
376 .client_modules.lst = pvr2_client_75xxx,
377 .client_modules.cnt = ARRAY_SIZE(pvr2_client_75xxx),
378 .fx2_firmware.lst = pvr2_fw1_names_75xxx,
379 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_75xxx),
380 .flag_has_cx25840 = !0,
381 .flag_has_hauppauge_rom = !0,
382 .flag_has_analogtuner = !0,
383 .flag_has_composite = !0,
384 .flag_has_svideo = !0,
385 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
386 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
387 .default_std_mask = V4L2_STD_NTSC_M,
388 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
Michael Krufky087886e2008-03-28 05:49:36 -0300389#ifdef CONFIG_VIDEO_PVRUSB2_DVB
390 .dvb_props = &pvr2_750xx_dvb_props,
391#endif
Michael Krufkyc8812842008-03-28 05:48:44 -0300392};
393
394static const struct pvr2_device_desc pvr2_device_751xx = {
395 .description = "WinTV PVR USB2 Model Category 751xx",
396 .shortname = "751xx",
Michael Krufky11fcd472007-10-25 02:01:10 -0300397 .client_modules.lst = pvr2_client_75xxx,
398 .client_modules.cnt = ARRAY_SIZE(pvr2_client_75xxx),
399 .fx2_firmware.lst = pvr2_fw1_names_75xxx,
400 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_75xxx),
401 .flag_has_cx25840 = !0,
402 .flag_has_hauppauge_rom = !0,
Mike Isely1aaac602008-04-22 14:45:36 -0300403 .flag_has_analogtuner = !0,
404 .flag_has_composite = !0,
405 .flag_has_svideo = !0,
Michael Krufky11fcd472007-10-25 02:01:10 -0300406 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
Mike Iselye8f5bac2008-04-22 14:45:40 -0300407 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
Michael Krufky11fcd472007-10-25 02:01:10 -0300408 .default_std_mask = V4L2_STD_NTSC_M,
Mike Isely40381cb2008-04-22 14:45:42 -0300409 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
Michael Krufky11fcd472007-10-25 02:01:10 -0300410};
411
412
413
414/*------------------------------------------------------------------------*/
Mike Iselyd130fa82007-12-08 17:20:06 -0300415
416struct usb_device_id pvr2_device_table[] = {
417 { USB_DEVICE(0x2040, 0x2900),
418 .driver_info = (kernel_ulong_t)&pvr2_device_29xxx},
419 { USB_DEVICE(0x2040, 0x2400),
420 .driver_info = (kernel_ulong_t)&pvr2_device_24xxx},
421 { USB_DEVICE(0x1164, 0x0622),
422 .driver_info = (kernel_ulong_t)&pvr2_device_gotview_2},
Mike Iselyfd1da782008-04-22 14:45:42 -0300423 { USB_DEVICE(0x1164, 0x0602),
424 .driver_info = (kernel_ulong_t)&pvr2_device_gotview_2d},
Mike Iselyd130fa82007-12-08 17:20:06 -0300425#ifdef CONFIG_VIDEO_PVRUSB2_ONAIR_CREATOR
426 { USB_DEVICE(0x11ba, 0x1003),
427 .driver_info = (kernel_ulong_t)&pvr2_device_onair_creator},
428#endif
429#ifdef CONFIG_VIDEO_PVRUSB2_ONAIR_USB2
430 { USB_DEVICE(0x11ba, 0x1001),
431 .driver_info = (kernel_ulong_t)&pvr2_device_onair_usb2},
432#endif
Michael Krufky92c9d072008-03-15 23:59:29 -0300433 { USB_DEVICE(0x2040, 0x7300),
434 .driver_info = (kernel_ulong_t)&pvr2_device_73xxx},
Michael Krufky11fcd472007-10-25 02:01:10 -0300435 { USB_DEVICE(0x2040, 0x7500),
Michael Krufkyc8812842008-03-28 05:48:44 -0300436 .driver_info = (kernel_ulong_t)&pvr2_device_750xx},
Michael Krufkydd6e9462008-03-08 06:07:38 -0300437 { USB_DEVICE(0x2040, 0x7501),
Michael Krufkyc8812842008-03-28 05:48:44 -0300438 .driver_info = (kernel_ulong_t)&pvr2_device_751xx},
Mike Iselyd130fa82007-12-08 17:20:06 -0300439 { }
440};
Mike Isely989eb152007-11-26 01:53:12 -0300441
442MODULE_DEVICE_TABLE(usb, pvr2_device_table);
443
444
445/*
446 Stuff for Emacs to see, in order to encourage consistent editing style:
447 *** Local Variables: ***
448 *** mode: c ***
449 *** fill-column: 75 ***
450 *** tab-width: 8 ***
451 *** c-basic-offset: 8 ***
452 *** End: ***
453 */