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 #include <linux/module.h>
32 /* This is needed in order to pull in tuner type ids... */
33 #include <linux/i2c.h>
34 #include <media/tuner.h>
35 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
36 #include "pvrusb2-hdw-internal.h"
43 #include "tuner-simple.h"
47 /*------------------------------------------------------------------------*/
48 /* Hauppauge PVR-USB2 Model 29xxx */
50 static const struct pvr2_device_client_desc pvr2_cli_29xxx
[] = {
51 { .module_id
= PVR2_CLIENT_ID_SAA7115
},
52 { .module_id
= PVR2_CLIENT_ID_MSP3400
},
53 { .module_id
= PVR2_CLIENT_ID_TUNER
},
54 { .module_id
= PVR2_CLIENT_ID_DEMOD
},
57 static const char *pvr2_fw1_names_29xxx
[] = {
58 "v4l-pvrusb2-29xxx-01.fw",
61 static const struct pvr2_device_desc pvr2_device_29xxx
= {
62 .description
= "WinTV PVR USB2 Model 29xxx",
64 .client_table
.lst
= pvr2_cli_29xxx
,
65 .client_table
.cnt
= ARRAY_SIZE(pvr2_cli_29xxx
),
66 .fx2_firmware
.lst
= pvr2_fw1_names_29xxx
,
67 .fx2_firmware
.cnt
= ARRAY_SIZE(pvr2_fw1_names_29xxx
),
68 .flag_has_hauppauge_rom
= !0,
69 .flag_has_analogtuner
= !0,
70 .flag_has_fmradio
= !0,
71 .flag_has_composite
= !0,
72 .flag_has_svideo
= !0,
73 .signal_routing_scheme
= PVR2_ROUTING_SCHEME_HAUPPAUGE
,
74 .led_scheme
= PVR2_LED_SCHEME_HAUPPAUGE
,
75 .ir_scheme
= PVR2_IR_SCHEME_29XXX
,
80 /*------------------------------------------------------------------------*/
81 /* Hauppauge PVR-USB2 Model 24xxx */
83 static const struct pvr2_device_client_desc pvr2_cli_24xxx
[] = {
84 { .module_id
= PVR2_CLIENT_ID_CX25840
},
85 { .module_id
= PVR2_CLIENT_ID_TUNER
},
86 { .module_id
= PVR2_CLIENT_ID_WM8775
},
87 { .module_id
= PVR2_CLIENT_ID_DEMOD
},
90 static const char *pvr2_fw1_names_24xxx
[] = {
91 "v4l-pvrusb2-24xxx-01.fw",
94 static const struct pvr2_device_desc pvr2_device_24xxx
= {
95 .description
= "WinTV PVR USB2 Model 24xxx",
97 .client_table
.lst
= pvr2_cli_24xxx
,
98 .client_table
.cnt
= ARRAY_SIZE(pvr2_cli_24xxx
),
99 .fx2_firmware
.lst
= pvr2_fw1_names_24xxx
,
100 .fx2_firmware
.cnt
= ARRAY_SIZE(pvr2_fw1_names_24xxx
),
101 .flag_has_cx25840
= !0,
102 .flag_has_wm8775
= !0,
103 .flag_has_hauppauge_rom
= !0,
104 .flag_has_analogtuner
= !0,
105 .flag_has_fmradio
= !0,
106 .flag_has_composite
= !0,
107 .flag_has_svideo
= !0,
108 .signal_routing_scheme
= PVR2_ROUTING_SCHEME_HAUPPAUGE
,
109 .led_scheme
= PVR2_LED_SCHEME_HAUPPAUGE
,
110 .ir_scheme
= PVR2_IR_SCHEME_24XXX
,
115 /*------------------------------------------------------------------------*/
116 /* GOTVIEW USB2.0 DVD2 */
118 static const struct pvr2_device_client_desc pvr2_cli_gotview_2
[] = {
119 { .module_id
= PVR2_CLIENT_ID_CX25840
},
120 { .module_id
= PVR2_CLIENT_ID_TUNER
},
121 { .module_id
= PVR2_CLIENT_ID_DEMOD
},
124 static const struct pvr2_device_desc pvr2_device_gotview_2
= {
125 .description
= "Gotview USB 2.0 DVD 2",
127 .client_table
.lst
= pvr2_cli_gotview_2
,
128 .client_table
.cnt
= ARRAY_SIZE(pvr2_cli_gotview_2
),
129 .flag_has_cx25840
= !0,
130 .default_tuner_type
= TUNER_PHILIPS_FM1216ME_MK3
,
131 .flag_has_analogtuner
= !0,
132 .flag_has_fmradio
= !0,
133 .flag_has_composite
= !0,
134 .flag_has_svideo
= !0,
135 .signal_routing_scheme
= PVR2_ROUTING_SCHEME_GOTVIEW
,
140 /*------------------------------------------------------------------------*/
141 /* GOTVIEW USB2.0 DVD Deluxe */
143 /* (same module list as gotview_2) */
145 static const struct pvr2_device_desc pvr2_device_gotview_2d
= {
146 .description
= "Gotview USB 2.0 DVD Deluxe",
148 .client_table
.lst
= pvr2_cli_gotview_2
,
149 .client_table
.cnt
= ARRAY_SIZE(pvr2_cli_gotview_2
),
150 .flag_has_cx25840
= !0,
151 .default_tuner_type
= TUNER_PHILIPS_FM1216ME_MK3
,
152 .flag_has_analogtuner
= !0,
153 .flag_has_composite
= !0,
154 .flag_has_svideo
= !0,
155 .signal_routing_scheme
= PVR2_ROUTING_SCHEME_GOTVIEW
,
160 /*------------------------------------------------------------------------*/
161 /* Terratec Grabster AV400 */
163 static const struct pvr2_device_client_desc pvr2_cli_av400
[] = {
164 { .module_id
= PVR2_CLIENT_ID_CX25840
},
167 static const struct pvr2_device_desc pvr2_device_av400
= {
168 .description
= "Terratec Grabster AV400",
169 .shortname
= "av400",
170 .flag_is_experimental
= 1,
171 .client_table
.lst
= pvr2_cli_av400
,
172 .client_table
.cnt
= ARRAY_SIZE(pvr2_cli_av400
),
173 .flag_has_cx25840
= !0,
174 .flag_has_analogtuner
= 0,
175 .flag_has_composite
= !0,
176 .flag_has_svideo
= !0,
177 .signal_routing_scheme
= PVR2_ROUTING_SCHEME_AV400
,
182 /*------------------------------------------------------------------------*/
185 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
186 static struct lgdt330x_config pvr2_lgdt3303_config
= {
187 .demod_address
= 0x0e,
188 .demod_chip
= LGDT3303
,
189 .clock_polarity_flip
= 1,
192 static int pvr2_lgdt3303_attach(struct pvr2_dvb_adapter
*adap
)
194 adap
->fe
= dvb_attach(lgdt330x_attach
, &pvr2_lgdt3303_config
,
195 &adap
->channel
.hdw
->i2c_adap
);
202 static int pvr2_lgh06xf_attach(struct pvr2_dvb_adapter
*adap
)
204 dvb_attach(simple_tuner_attach
, adap
->fe
,
205 &adap
->channel
.hdw
->i2c_adap
, 0x61,
206 TUNER_LG_TDVS_H06XF
);
211 static const struct pvr2_dvb_props pvr2_onair_creator_fe_props
= {
212 .frontend_attach
= pvr2_lgdt3303_attach
,
213 .tuner_attach
= pvr2_lgh06xf_attach
,
217 static const struct pvr2_device_client_desc pvr2_cli_onair_creator
[] = {
218 { .module_id
= PVR2_CLIENT_ID_SAA7115
},
219 { .module_id
= PVR2_CLIENT_ID_CS53L32A
},
220 { .module_id
= PVR2_CLIENT_ID_TUNER
},
223 static const struct pvr2_device_desc pvr2_device_onair_creator
= {
224 .description
= "OnAir Creator Hybrid USB tuner",
226 .client_table
.lst
= pvr2_cli_onair_creator
,
227 .client_table
.cnt
= ARRAY_SIZE(pvr2_cli_onair_creator
),
228 .default_tuner_type
= TUNER_LG_TDVS_H06XF
,
229 .flag_has_analogtuner
= !0,
230 .flag_has_composite
= !0,
231 .flag_has_svideo
= !0,
232 .flag_digital_requires_cx23416
= !0,
233 .signal_routing_scheme
= PVR2_ROUTING_SCHEME_ONAIR
,
234 .digital_control_scheme
= PVR2_DIGITAL_SCHEME_ONAIR
,
235 .default_std_mask
= V4L2_STD_NTSC_M
,
236 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
237 .dvb_props
= &pvr2_onair_creator_fe_props
,
243 /*------------------------------------------------------------------------*/
246 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
247 static struct lgdt330x_config pvr2_lgdt3302_config
= {
248 .demod_address
= 0x0e,
249 .demod_chip
= LGDT3302
,
252 static int pvr2_lgdt3302_attach(struct pvr2_dvb_adapter
*adap
)
254 adap
->fe
= dvb_attach(lgdt330x_attach
, &pvr2_lgdt3302_config
,
255 &adap
->channel
.hdw
->i2c_adap
);
262 static int pvr2_fcv1236d_attach(struct pvr2_dvb_adapter
*adap
)
264 dvb_attach(simple_tuner_attach
, adap
->fe
,
265 &adap
->channel
.hdw
->i2c_adap
, 0x61,
266 TUNER_PHILIPS_FCV1236D
);
271 static const struct pvr2_dvb_props pvr2_onair_usb2_fe_props
= {
272 .frontend_attach
= pvr2_lgdt3302_attach
,
273 .tuner_attach
= pvr2_fcv1236d_attach
,
277 static const struct pvr2_device_client_desc pvr2_cli_onair_usb2
[] = {
278 { .module_id
= PVR2_CLIENT_ID_SAA7115
},
279 { .module_id
= PVR2_CLIENT_ID_CS53L32A
},
280 { .module_id
= PVR2_CLIENT_ID_TUNER
},
283 static const struct pvr2_device_desc pvr2_device_onair_usb2
= {
284 .description
= "OnAir USB2 Hybrid USB tuner",
286 .client_table
.lst
= pvr2_cli_onair_usb2
,
287 .client_table
.cnt
= ARRAY_SIZE(pvr2_cli_onair_usb2
),
288 .default_tuner_type
= TUNER_PHILIPS_FCV1236D
,
289 .flag_has_analogtuner
= !0,
290 .flag_has_composite
= !0,
291 .flag_has_svideo
= !0,
292 .flag_digital_requires_cx23416
= !0,
293 .signal_routing_scheme
= PVR2_ROUTING_SCHEME_ONAIR
,
294 .digital_control_scheme
= PVR2_DIGITAL_SCHEME_ONAIR
,
295 .default_std_mask
= V4L2_STD_NTSC_M
,
296 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
297 .dvb_props
= &pvr2_onair_usb2_fe_props
,
303 /*------------------------------------------------------------------------*/
304 /* Hauppauge PVR-USB2 Model 73xxx */
306 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
307 static struct tda10048_config hauppauge_tda10048_config
= {
308 .demod_address
= 0x10 >> 1,
309 .output_mode
= TDA10048_PARALLEL_OUTPUT
,
310 .fwbulkwritelen
= TDA10048_BULKWRITE_50
,
311 .inversion
= TDA10048_INVERSION_ON
,
312 .dtv6_if_freq_khz
= TDA10048_IF_3300
,
313 .dtv7_if_freq_khz
= TDA10048_IF_3800
,
314 .dtv8_if_freq_khz
= TDA10048_IF_4300
,
315 .clk_freq_khz
= TDA10048_CLK_16000
,
316 .disable_gate_access
= 1,
319 static struct tda829x_config tda829x_no_probe
= {
320 .probe_tuner
= TDA829X_DONT_PROBE
,
323 static struct tda18271_config hauppauge_tda18271_dvb_config
= {
324 .gate
= TDA18271_GATE_ANALOG
,
325 .output_opt
= TDA18271_OUTPUT_LT_OFF
,
328 static int pvr2_tda10048_attach(struct pvr2_dvb_adapter
*adap
)
330 adap
->fe
= dvb_attach(tda10048_attach
, &hauppauge_tda10048_config
,
331 &adap
->channel
.hdw
->i2c_adap
);
338 static int pvr2_73xxx_tda18271_8295_attach(struct pvr2_dvb_adapter
*adap
)
340 dvb_attach(tda829x_attach
, adap
->fe
,
341 &adap
->channel
.hdw
->i2c_adap
, 0x42,
343 dvb_attach(tda18271_attach
, adap
->fe
, 0x60,
344 &adap
->channel
.hdw
->i2c_adap
,
345 &hauppauge_tda18271_dvb_config
);
350 static const struct pvr2_dvb_props pvr2_73xxx_dvb_props
= {
351 .frontend_attach
= pvr2_tda10048_attach
,
352 .tuner_attach
= pvr2_73xxx_tda18271_8295_attach
,
356 static const struct pvr2_device_client_desc pvr2_cli_73xxx
[] = {
357 { .module_id
= PVR2_CLIENT_ID_CX25840
},
358 { .module_id
= PVR2_CLIENT_ID_TUNER
,
359 .i2c_address_list
= "\x42"},
362 static const char *pvr2_fw1_names_73xxx
[] = {
363 "v4l-pvrusb2-73xxx-01.fw",
366 static const struct pvr2_device_desc pvr2_device_73xxx
= {
367 .description
= "WinTV HVR-1900 Model 73xxx",
368 .shortname
= "73xxx",
369 .client_table
.lst
= pvr2_cli_73xxx
,
370 .client_table
.cnt
= ARRAY_SIZE(pvr2_cli_73xxx
),
371 .fx2_firmware
.lst
= pvr2_fw1_names_73xxx
,
372 .fx2_firmware
.cnt
= ARRAY_SIZE(pvr2_fw1_names_73xxx
),
373 .flag_has_cx25840
= !0,
374 .flag_has_hauppauge_rom
= !0,
375 .flag_has_analogtuner
= !0,
376 .flag_has_composite
= !0,
377 .flag_has_svideo
= !0,
379 .signal_routing_scheme
= PVR2_ROUTING_SCHEME_HAUPPAUGE
,
380 .digital_control_scheme
= PVR2_DIGITAL_SCHEME_HAUPPAUGE
,
381 .led_scheme
= PVR2_LED_SCHEME_HAUPPAUGE
,
382 .ir_scheme
= PVR2_IR_SCHEME_ZILOG
,
383 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
384 .dvb_props
= &pvr2_73xxx_dvb_props
,
390 /*------------------------------------------------------------------------*/
391 /* Hauppauge PVR-USB2 Model 75xxx */
393 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
394 static struct s5h1409_config pvr2_s5h1409_config
= {
395 .demod_address
= 0x32 >> 1,
396 .output_mode
= S5H1409_PARALLEL_OUTPUT
,
397 .gpio
= S5H1409_GPIO_OFF
,
399 .inversion
= S5H1409_INVERSION_ON
,
400 .status_mode
= S5H1409_DEMODLOCKING
,
403 static struct s5h1411_config pvr2_s5h1411_config
= {
404 .output_mode
= S5H1411_PARALLEL_OUTPUT
,
405 .gpio
= S5H1411_GPIO_OFF
,
406 .vsb_if
= S5H1411_IF_44000
,
407 .qam_if
= S5H1411_IF_4000
,
408 .inversion
= S5H1411_INVERSION_ON
,
409 .status_mode
= S5H1411_DEMODLOCKING
,
412 static struct tda18271_std_map hauppauge_tda18271_std_map
= {
413 .atsc_6
= { .if_freq
= 5380, .agc_mode
= 3, .std
= 3,
414 .if_lvl
= 6, .rfagc_top
= 0x37, },
415 .qam_6
= { .if_freq
= 4000, .agc_mode
= 3, .std
= 0,
416 .if_lvl
= 6, .rfagc_top
= 0x37, },
419 static struct tda18271_config hauppauge_tda18271_config
= {
420 .std_map
= &hauppauge_tda18271_std_map
,
421 .gate
= TDA18271_GATE_ANALOG
,
422 .output_opt
= TDA18271_OUTPUT_LT_OFF
,
425 static int pvr2_s5h1409_attach(struct pvr2_dvb_adapter
*adap
)
427 adap
->fe
= dvb_attach(s5h1409_attach
, &pvr2_s5h1409_config
,
428 &adap
->channel
.hdw
->i2c_adap
);
435 static int pvr2_s5h1411_attach(struct pvr2_dvb_adapter
*adap
)
437 adap
->fe
= dvb_attach(s5h1411_attach
, &pvr2_s5h1411_config
,
438 &adap
->channel
.hdw
->i2c_adap
);
445 static int pvr2_tda18271_8295_attach(struct pvr2_dvb_adapter
*adap
)
447 dvb_attach(tda829x_attach
, adap
->fe
,
448 &adap
->channel
.hdw
->i2c_adap
, 0x42,
450 dvb_attach(tda18271_attach
, adap
->fe
, 0x60,
451 &adap
->channel
.hdw
->i2c_adap
,
452 &hauppauge_tda18271_config
);
457 static const struct pvr2_dvb_props pvr2_750xx_dvb_props
= {
458 .frontend_attach
= pvr2_s5h1409_attach
,
459 .tuner_attach
= pvr2_tda18271_8295_attach
,
462 static const struct pvr2_dvb_props pvr2_751xx_dvb_props
= {
463 .frontend_attach
= pvr2_s5h1411_attach
,
464 .tuner_attach
= pvr2_tda18271_8295_attach
,
468 static const char *pvr2_fw1_names_75xxx
[] = {
469 "v4l-pvrusb2-73xxx-01.fw",
472 static const struct pvr2_device_desc pvr2_device_750xx
= {
473 .description
= "WinTV HVR-1950 Model 750xx",
474 .shortname
= "750xx",
475 .client_table
.lst
= pvr2_cli_73xxx
,
476 .client_table
.cnt
= ARRAY_SIZE(pvr2_cli_73xxx
),
477 .fx2_firmware
.lst
= pvr2_fw1_names_75xxx
,
478 .fx2_firmware
.cnt
= ARRAY_SIZE(pvr2_fw1_names_75xxx
),
479 .flag_has_cx25840
= !0,
480 .flag_has_hauppauge_rom
= !0,
481 .flag_has_analogtuner
= !0,
482 .flag_has_composite
= !0,
483 .flag_has_svideo
= !0,
485 .signal_routing_scheme
= PVR2_ROUTING_SCHEME_HAUPPAUGE
,
486 .digital_control_scheme
= PVR2_DIGITAL_SCHEME_HAUPPAUGE
,
487 .default_std_mask
= V4L2_STD_NTSC_M
,
488 .led_scheme
= PVR2_LED_SCHEME_HAUPPAUGE
,
489 .ir_scheme
= PVR2_IR_SCHEME_ZILOG
,
490 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
491 .dvb_props
= &pvr2_750xx_dvb_props
,
495 static const struct pvr2_device_desc pvr2_device_751xx
= {
496 .description
= "WinTV HVR-1950 Model 751xx",
497 .shortname
= "751xx",
498 .client_table
.lst
= pvr2_cli_73xxx
,
499 .client_table
.cnt
= ARRAY_SIZE(pvr2_cli_73xxx
),
500 .fx2_firmware
.lst
= pvr2_fw1_names_75xxx
,
501 .fx2_firmware
.cnt
= ARRAY_SIZE(pvr2_fw1_names_75xxx
),
502 .flag_has_cx25840
= !0,
503 .flag_has_hauppauge_rom
= !0,
504 .flag_has_analogtuner
= !0,
505 .flag_has_composite
= !0,
506 .flag_has_svideo
= !0,
508 .signal_routing_scheme
= PVR2_ROUTING_SCHEME_HAUPPAUGE
,
509 .digital_control_scheme
= PVR2_DIGITAL_SCHEME_HAUPPAUGE
,
510 .default_std_mask
= V4L2_STD_NTSC_M
,
511 .led_scheme
= PVR2_LED_SCHEME_HAUPPAUGE
,
512 .ir_scheme
= PVR2_IR_SCHEME_ZILOG
,
513 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
514 .dvb_props
= &pvr2_751xx_dvb_props
,
520 /*------------------------------------------------------------------------*/
522 struct usb_device_id pvr2_device_table
[] = {
523 { USB_DEVICE(0x2040, 0x2900),
524 .driver_info
= (kernel_ulong_t
)&pvr2_device_29xxx
},
525 { USB_DEVICE(0x2040, 0x2950), /* Logically identical to 2900 */
526 .driver_info
= (kernel_ulong_t
)&pvr2_device_29xxx
},
527 { USB_DEVICE(0x2040, 0x2400),
528 .driver_info
= (kernel_ulong_t
)&pvr2_device_24xxx
},
529 { USB_DEVICE(0x1164, 0x0622),
530 .driver_info
= (kernel_ulong_t
)&pvr2_device_gotview_2
},
531 { USB_DEVICE(0x1164, 0x0602),
532 .driver_info
= (kernel_ulong_t
)&pvr2_device_gotview_2d
},
533 { USB_DEVICE(0x11ba, 0x1003),
534 .driver_info
= (kernel_ulong_t
)&pvr2_device_onair_creator
},
535 { USB_DEVICE(0x11ba, 0x1001),
536 .driver_info
= (kernel_ulong_t
)&pvr2_device_onair_usb2
},
537 { USB_DEVICE(0x2040, 0x7300),
538 .driver_info
= (kernel_ulong_t
)&pvr2_device_73xxx
},
539 { USB_DEVICE(0x2040, 0x7500),
540 .driver_info
= (kernel_ulong_t
)&pvr2_device_750xx
},
541 { USB_DEVICE(0x2040, 0x7501),
542 .driver_info
= (kernel_ulong_t
)&pvr2_device_751xx
},
543 { USB_DEVICE(0x0ccd, 0x0039),
544 .driver_info
= (kernel_ulong_t
)&pvr2_device_av400
},
548 MODULE_DEVICE_TABLE(usb
, pvr2_device_table
);
552 Stuff for Emacs to see, in order to encourage consistent editing style:
553 *** Local Variables: ***
555 *** fill-column: 75 ***
557 *** c-basic-offset: 8 ***