4 * Copyright (C) 2007 Mike Isely <isely@pobox.com>
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
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 This source file should encompass ALL per-device type information for the
24 driver. To define a new device, add elements to the pvr2_device_table and
25 pvr2_device_desc structures.
29 #include "pvrusb2-devattr.h"
30 #include <linux/usb.h>
31 /* This is needed in order to pull in tuner type ids... */
32 #include <linux/i2c.h>
33 #include <media/tuner.h>
34 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
35 #include "pvrusb2-hdw-internal.h"
42 #include "tuner-simple.h"
46 /*------------------------------------------------------------------------*/
47 /* Hauppauge PVR-USB2 Model 29xxx */
49 static const struct pvr2_device_client_desc pvr2_cli_29xxx[] = {
50 { .module_id = PVR2_CLIENT_ID_SAA7115 },
51 { .module_id = PVR2_CLIENT_ID_MSP3400 },
52 { .module_id = PVR2_CLIENT_ID_TUNER },
53 { .module_id = PVR2_CLIENT_ID_DEMOD },
56 static const char *pvr2_fw1_names_29xxx[] = {
57 "v4l-pvrusb2-29xxx-01.fw",
60 static const struct pvr2_device_desc pvr2_device_29xxx = {
61 .description = "WinTV PVR USB2 Model 29xxx",
63 .client_table.lst = pvr2_cli_29xxx,
64 .client_table.cnt = ARRAY_SIZE(pvr2_cli_29xxx),
65 .fx2_firmware.lst = pvr2_fw1_names_29xxx,
66 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_29xxx),
67 .flag_has_hauppauge_rom = !0,
68 .flag_has_analogtuner = !0,
69 .flag_has_fmradio = !0,
70 .flag_has_composite = !0,
71 .flag_has_svideo = !0,
72 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
73 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
74 .ir_scheme = PVR2_IR_SCHEME_29XXX,
79 /*------------------------------------------------------------------------*/
80 /* Hauppauge PVR-USB2 Model 24xxx */
82 static const struct pvr2_device_client_desc pvr2_cli_24xxx[] = {
83 { .module_id = PVR2_CLIENT_ID_CX25840 },
84 { .module_id = PVR2_CLIENT_ID_TUNER },
85 { .module_id = PVR2_CLIENT_ID_WM8775 },
86 { .module_id = PVR2_CLIENT_ID_DEMOD },
89 static const char *pvr2_fw1_names_24xxx[] = {
90 "v4l-pvrusb2-24xxx-01.fw",
93 static const struct pvr2_device_desc pvr2_device_24xxx = {
94 .description = "WinTV PVR USB2 Model 24xxx",
96 .client_table.lst = pvr2_cli_24xxx,
97 .client_table.cnt = ARRAY_SIZE(pvr2_cli_24xxx),
98 .fx2_firmware.lst = pvr2_fw1_names_24xxx,
99 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_24xxx),
100 .flag_has_cx25840 = !0,
101 .flag_has_wm8775 = !0,
102 .flag_has_hauppauge_rom = !0,
103 .flag_has_analogtuner = !0,
104 .flag_has_fmradio = !0,
105 .flag_has_composite = !0,
106 .flag_has_svideo = !0,
107 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
108 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
109 .ir_scheme = PVR2_IR_SCHEME_24XXX,
114 /*------------------------------------------------------------------------*/
115 /* GOTVIEW USB2.0 DVD2 */
117 static const struct pvr2_device_client_desc pvr2_cli_gotview_2[] = {
118 { .module_id = PVR2_CLIENT_ID_CX25840 },
119 { .module_id = PVR2_CLIENT_ID_TUNER },
120 { .module_id = PVR2_CLIENT_ID_DEMOD },
123 static const struct pvr2_device_desc pvr2_device_gotview_2 = {
124 .description = "Gotview USB 2.0 DVD 2",
126 .client_table.lst = pvr2_cli_gotview_2,
127 .client_table.cnt = ARRAY_SIZE(pvr2_cli_gotview_2),
128 .flag_has_cx25840 = !0,
129 .default_tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
130 .flag_has_analogtuner = !0,
131 .flag_has_fmradio = !0,
132 .flag_has_composite = !0,
133 .flag_has_svideo = !0,
134 .signal_routing_scheme = PVR2_ROUTING_SCHEME_GOTVIEW,
139 /*------------------------------------------------------------------------*/
140 /* GOTVIEW USB2.0 DVD Deluxe */
142 /* (same module list as gotview_2) */
144 static const struct pvr2_device_desc pvr2_device_gotview_2d = {
145 .description = "Gotview USB 2.0 DVD Deluxe",
147 .client_table.lst = pvr2_cli_gotview_2,
148 .client_table.cnt = ARRAY_SIZE(pvr2_cli_gotview_2),
149 .flag_has_cx25840 = !0,
150 .default_tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
151 .flag_has_analogtuner = !0,
152 .flag_has_composite = !0,
153 .flag_has_svideo = !0,
154 .signal_routing_scheme = PVR2_ROUTING_SCHEME_GOTVIEW,
159 /*------------------------------------------------------------------------*/
160 /* Terratec Grabster AV400 */
162 static const struct pvr2_device_client_desc pvr2_cli_av400[] = {
163 { .module_id = PVR2_CLIENT_ID_CX25840 },
166 static const struct pvr2_device_desc pvr2_device_av400 = {
167 .description = "Terratec Grabster AV400",
168 .shortname = "av400",
169 .flag_is_experimental = 1,
170 .client_table.lst = pvr2_cli_av400,
171 .client_table.cnt = ARRAY_SIZE(pvr2_cli_av400),
172 .flag_has_cx25840 = !0,
173 .flag_has_analogtuner = 0,
174 .flag_has_composite = !0,
175 .flag_has_svideo = !0,
176 .signal_routing_scheme = PVR2_ROUTING_SCHEME_AV400,
181 /*------------------------------------------------------------------------*/
184 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
185 static struct lgdt330x_config pvr2_lgdt3303_config = {
186 .demod_address = 0x0e,
187 .demod_chip = LGDT3303,
188 .clock_polarity_flip = 1,
191 static int pvr2_lgdt3303_attach(struct pvr2_dvb_adapter *adap)
193 adap->fe = dvb_attach(lgdt330x_attach, &pvr2_lgdt3303_config,
194 &adap->channel.hdw->i2c_adap);
201 static int pvr2_lgh06xf_attach(struct pvr2_dvb_adapter *adap)
203 dvb_attach(simple_tuner_attach, adap->fe,
204 &adap->channel.hdw->i2c_adap, 0x61,
205 TUNER_LG_TDVS_H06XF);
210 static const struct pvr2_dvb_props pvr2_onair_creator_fe_props = {
211 .frontend_attach = pvr2_lgdt3303_attach,
212 .tuner_attach = pvr2_lgh06xf_attach,
216 static const struct pvr2_device_client_desc pvr2_cli_onair_creator[] = {
217 { .module_id = PVR2_CLIENT_ID_SAA7115 },
218 { .module_id = PVR2_CLIENT_ID_CS53L32A },
219 { .module_id = PVR2_CLIENT_ID_TUNER },
222 static const struct pvr2_device_desc pvr2_device_onair_creator = {
223 .description = "OnAir Creator Hybrid USB tuner",
225 .client_table.lst = pvr2_cli_onair_creator,
226 .client_table.cnt = ARRAY_SIZE(pvr2_cli_onair_creator),
227 .default_tuner_type = TUNER_LG_TDVS_H06XF,
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_creator_fe_props,
242 /*------------------------------------------------------------------------*/
245 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
246 static struct lgdt330x_config pvr2_lgdt3302_config = {
247 .demod_address = 0x0e,
248 .demod_chip = LGDT3302,
251 static int pvr2_lgdt3302_attach(struct pvr2_dvb_adapter *adap)
253 adap->fe = dvb_attach(lgdt330x_attach, &pvr2_lgdt3302_config,
254 &adap->channel.hdw->i2c_adap);
261 static int pvr2_fcv1236d_attach(struct pvr2_dvb_adapter *adap)
263 dvb_attach(simple_tuner_attach, adap->fe,
264 &adap->channel.hdw->i2c_adap, 0x61,
265 TUNER_PHILIPS_FCV1236D);
270 static const struct pvr2_dvb_props pvr2_onair_usb2_fe_props = {
271 .frontend_attach = pvr2_lgdt3302_attach,
272 .tuner_attach = pvr2_fcv1236d_attach,
276 static const struct pvr2_device_client_desc pvr2_cli_onair_usb2[] = {
277 { .module_id = PVR2_CLIENT_ID_SAA7115 },
278 { .module_id = PVR2_CLIENT_ID_CS53L32A },
279 { .module_id = PVR2_CLIENT_ID_TUNER },
282 static const struct pvr2_device_desc pvr2_device_onair_usb2 = {
283 .description = "OnAir USB2 Hybrid USB tuner",
285 .client_table.lst = pvr2_cli_onair_usb2,
286 .client_table.cnt = ARRAY_SIZE(pvr2_cli_onair_usb2),
287 .default_tuner_type = TUNER_PHILIPS_FCV1236D,
288 .flag_has_analogtuner = !0,
289 .flag_has_composite = !0,
290 .flag_has_svideo = !0,
291 .flag_digital_requires_cx23416 = !0,
292 .signal_routing_scheme = PVR2_ROUTING_SCHEME_ONAIR,
293 .digital_control_scheme = PVR2_DIGITAL_SCHEME_ONAIR,
294 .default_std_mask = V4L2_STD_NTSC_M,
295 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
296 .dvb_props = &pvr2_onair_usb2_fe_props,
302 /*------------------------------------------------------------------------*/
303 /* Hauppauge PVR-USB2 Model 73xxx */
305 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
306 static struct tda10048_config hauppauge_tda10048_config = {
307 .demod_address = 0x10 >> 1,
308 .output_mode = TDA10048_PARALLEL_OUTPUT,
309 .fwbulkwritelen = TDA10048_BULKWRITE_50,
310 .inversion = TDA10048_INVERSION_ON,
311 .dtv6_if_freq_khz = TDA10048_IF_3300,
312 .dtv7_if_freq_khz = TDA10048_IF_3800,
313 .dtv8_if_freq_khz = TDA10048_IF_4300,
314 .clk_freq_khz = TDA10048_CLK_16000,
315 .disable_gate_access = 1,
318 static struct tda829x_config tda829x_no_probe = {
319 .probe_tuner = TDA829X_DONT_PROBE,
322 static struct tda18271_std_map hauppauge_tda18271_dvbt_std_map = {
323 .dvbt_6 = { .if_freq = 3300, .agc_mode = 3, .std = 4,
324 .if_lvl = 1, .rfagc_top = 0x37, },
325 .dvbt_7 = { .if_freq = 3800, .agc_mode = 3, .std = 5,
326 .if_lvl = 1, .rfagc_top = 0x37, },
327 .dvbt_8 = { .if_freq = 4300, .agc_mode = 3, .std = 6,
328 .if_lvl = 1, .rfagc_top = 0x37, },
331 static struct tda18271_config hauppauge_tda18271_dvb_config = {
332 .std_map = &hauppauge_tda18271_dvbt_std_map,
333 .gate = TDA18271_GATE_ANALOG,
334 .output_opt = TDA18271_OUTPUT_LT_OFF,
337 static int pvr2_tda10048_attach(struct pvr2_dvb_adapter *adap)
339 adap->fe = dvb_attach(tda10048_attach, &hauppauge_tda10048_config,
340 &adap->channel.hdw->i2c_adap);
347 static int pvr2_73xxx_tda18271_8295_attach(struct pvr2_dvb_adapter *adap)
349 dvb_attach(tda829x_attach, adap->fe,
350 &adap->channel.hdw->i2c_adap, 0x42,
352 dvb_attach(tda18271_attach, adap->fe, 0x60,
353 &adap->channel.hdw->i2c_adap,
354 &hauppauge_tda18271_dvb_config);
359 static const struct pvr2_dvb_props pvr2_73xxx_dvb_props = {
360 .frontend_attach = pvr2_tda10048_attach,
361 .tuner_attach = pvr2_73xxx_tda18271_8295_attach,
365 static const struct pvr2_device_client_desc pvr2_cli_73xxx[] = {
366 { .module_id = PVR2_CLIENT_ID_CX25840 },
367 { .module_id = PVR2_CLIENT_ID_TUNER,
368 .i2c_address_list = "\x42"},
371 static const char *pvr2_fw1_names_73xxx[] = {
372 "v4l-pvrusb2-73xxx-01.fw",
375 static const struct pvr2_device_desc pvr2_device_73xxx = {
376 .description = "WinTV HVR-1900 Model 73xxx",
377 .shortname = "73xxx",
378 .client_table.lst = pvr2_cli_73xxx,
379 .client_table.cnt = ARRAY_SIZE(pvr2_cli_73xxx),
380 .fx2_firmware.lst = pvr2_fw1_names_73xxx,
381 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_73xxx),
382 .flag_has_cx25840 = !0,
383 .flag_has_hauppauge_rom = !0,
384 .flag_has_analogtuner = !0,
385 .flag_has_composite = !0,
386 .flag_has_svideo = !0,
388 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
389 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
390 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
391 .ir_scheme = PVR2_IR_SCHEME_ZILOG,
392 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
393 .dvb_props = &pvr2_73xxx_dvb_props,
399 /*------------------------------------------------------------------------*/
400 /* Hauppauge PVR-USB2 Model 75xxx */
402 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
403 static struct s5h1409_config pvr2_s5h1409_config = {
404 .demod_address = 0x32 >> 1,
405 .output_mode = S5H1409_PARALLEL_OUTPUT,
406 .gpio = S5H1409_GPIO_OFF,
408 .inversion = S5H1409_INVERSION_ON,
409 .status_mode = S5H1409_DEMODLOCKING,
412 static struct s5h1411_config pvr2_s5h1411_config = {
413 .output_mode = S5H1411_PARALLEL_OUTPUT,
414 .gpio = S5H1411_GPIO_OFF,
415 .vsb_if = S5H1411_IF_44000,
416 .qam_if = S5H1411_IF_4000,
417 .inversion = S5H1411_INVERSION_ON,
418 .status_mode = S5H1411_DEMODLOCKING,
421 static struct tda18271_std_map hauppauge_tda18271_std_map = {
422 .atsc_6 = { .if_freq = 5380, .agc_mode = 3, .std = 3,
423 .if_lvl = 6, .rfagc_top = 0x37, },
424 .qam_6 = { .if_freq = 4000, .agc_mode = 3, .std = 0,
425 .if_lvl = 6, .rfagc_top = 0x37, },
428 static struct tda18271_config hauppauge_tda18271_config = {
429 .std_map = &hauppauge_tda18271_std_map,
430 .gate = TDA18271_GATE_ANALOG,
431 .output_opt = TDA18271_OUTPUT_LT_OFF,
434 static int pvr2_s5h1409_attach(struct pvr2_dvb_adapter *adap)
436 adap->fe = dvb_attach(s5h1409_attach, &pvr2_s5h1409_config,
437 &adap->channel.hdw->i2c_adap);
444 static int pvr2_s5h1411_attach(struct pvr2_dvb_adapter *adap)
446 adap->fe = dvb_attach(s5h1411_attach, &pvr2_s5h1411_config,
447 &adap->channel.hdw->i2c_adap);
454 static int pvr2_tda18271_8295_attach(struct pvr2_dvb_adapter *adap)
456 dvb_attach(tda829x_attach, adap->fe,
457 &adap->channel.hdw->i2c_adap, 0x42,
459 dvb_attach(tda18271_attach, adap->fe, 0x60,
460 &adap->channel.hdw->i2c_adap,
461 &hauppauge_tda18271_config);
466 static const struct pvr2_dvb_props pvr2_750xx_dvb_props = {
467 .frontend_attach = pvr2_s5h1409_attach,
468 .tuner_attach = pvr2_tda18271_8295_attach,
471 static const struct pvr2_dvb_props pvr2_751xx_dvb_props = {
472 .frontend_attach = pvr2_s5h1411_attach,
473 .tuner_attach = pvr2_tda18271_8295_attach,
477 static const char *pvr2_fw1_names_75xxx[] = {
478 "v4l-pvrusb2-73xxx-01.fw",
481 static const struct pvr2_device_desc pvr2_device_750xx = {
482 .description = "WinTV HVR-1950 Model 750xx",
483 .shortname = "750xx",
484 .client_table.lst = pvr2_cli_73xxx,
485 .client_table.cnt = ARRAY_SIZE(pvr2_cli_73xxx),
486 .fx2_firmware.lst = pvr2_fw1_names_75xxx,
487 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_75xxx),
488 .flag_has_cx25840 = !0,
489 .flag_has_hauppauge_rom = !0,
490 .flag_has_analogtuner = !0,
491 .flag_has_composite = !0,
492 .flag_has_svideo = !0,
494 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
495 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
496 .default_std_mask = V4L2_STD_NTSC_M,
497 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
498 .ir_scheme = PVR2_IR_SCHEME_ZILOG,
499 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
500 .dvb_props = &pvr2_750xx_dvb_props,
504 static const struct pvr2_device_desc pvr2_device_751xx = {
505 .description = "WinTV HVR-1950 Model 751xx",
506 .shortname = "751xx",
507 .client_table.lst = pvr2_cli_73xxx,
508 .client_table.cnt = ARRAY_SIZE(pvr2_cli_73xxx),
509 .fx2_firmware.lst = pvr2_fw1_names_75xxx,
510 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_75xxx),
511 .flag_has_cx25840 = !0,
512 .flag_has_hauppauge_rom = !0,
513 .flag_has_analogtuner = !0,
514 .flag_has_composite = !0,
515 .flag_has_svideo = !0,
517 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
518 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
519 .default_std_mask = V4L2_STD_NTSC_M,
520 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
521 .ir_scheme = PVR2_IR_SCHEME_ZILOG,
522 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
523 .dvb_props = &pvr2_751xx_dvb_props,
529 /*------------------------------------------------------------------------*/
531 struct usb_device_id pvr2_device_table[] = {
532 { USB_DEVICE(0x2040, 0x2900),
533 .driver_info = (kernel_ulong_t)&pvr2_device_29xxx},
534 { USB_DEVICE(0x2040, 0x2950), /* Logically identical to 2900 */
535 .driver_info = (kernel_ulong_t)&pvr2_device_29xxx},
536 { USB_DEVICE(0x2040, 0x2400),
537 .driver_info = (kernel_ulong_t)&pvr2_device_24xxx},
538 { USB_DEVICE(0x1164, 0x0622),
539 .driver_info = (kernel_ulong_t)&pvr2_device_gotview_2},
540 { USB_DEVICE(0x1164, 0x0602),
541 .driver_info = (kernel_ulong_t)&pvr2_device_gotview_2d},
542 { USB_DEVICE(0x11ba, 0x1003),
543 .driver_info = (kernel_ulong_t)&pvr2_device_onair_creator},
544 { USB_DEVICE(0x11ba, 0x1001),
545 .driver_info = (kernel_ulong_t)&pvr2_device_onair_usb2},
546 { USB_DEVICE(0x2040, 0x7300),
547 .driver_info = (kernel_ulong_t)&pvr2_device_73xxx},
548 { USB_DEVICE(0x2040, 0x7500),
549 .driver_info = (kernel_ulong_t)&pvr2_device_750xx},
550 { USB_DEVICE(0x2040, 0x7501),
551 .driver_info = (kernel_ulong_t)&pvr2_device_751xx},
552 { USB_DEVICE(0x0ccd, 0x0039),
553 .driver_info = (kernel_ulong_t)&pvr2_device_av400},
557 MODULE_DEVICE_TABLE(usb, pvr2_device_table);
561 Stuff for Emacs to see, in order to encourage consistent editing style:
562 *** Local Variables: ***
564 *** fill-column: 75 ***
566 *** c-basic-offset: 8 ***