0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include "pvrusb2-devattr.h"
0016 #include <linux/usb.h>
0017 #include <linux/module.h>
0018
0019 #include <linux/i2c.h>
0020 #include <media/tuner.h>
0021 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
0022 #include "pvrusb2-hdw-internal.h"
0023 #include "lgdt330x.h"
0024 #include "s5h1409.h"
0025 #include "s5h1411.h"
0026 #include "tda10048.h"
0027 #include "tda18271.h"
0028 #include "tda8290.h"
0029 #include "tuner-simple.h"
0030 #include "si2157.h"
0031 #include "lgdt3306a.h"
0032 #include "si2168.h"
0033 #endif
0034
0035
0036
0037
0038
0039 static const struct pvr2_device_client_desc pvr2_cli_29xxx[] = {
0040 { .module_id = PVR2_CLIENT_ID_SAA7115 },
0041 { .module_id = PVR2_CLIENT_ID_MSP3400 },
0042 { .module_id = PVR2_CLIENT_ID_TUNER },
0043 { .module_id = PVR2_CLIENT_ID_DEMOD },
0044 };
0045
0046 #define PVR2_FIRMWARE_29xxx "v4l-pvrusb2-29xxx-01.fw"
0047 static const char *pvr2_fw1_names_29xxx[] = {
0048 PVR2_FIRMWARE_29xxx,
0049 };
0050
0051 static const struct pvr2_device_desc pvr2_device_29xxx = {
0052 .description = "WinTV PVR USB2 Model 29xxx",
0053 .shortname = "29xxx",
0054 .client_table.lst = pvr2_cli_29xxx,
0055 .client_table.cnt = ARRAY_SIZE(pvr2_cli_29xxx),
0056 .fx2_firmware.lst = pvr2_fw1_names_29xxx,
0057 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_29xxx),
0058 .flag_has_hauppauge_rom = !0,
0059 .flag_has_analogtuner = !0,
0060 .flag_has_fmradio = !0,
0061 .flag_has_composite = !0,
0062 .flag_has_svideo = !0,
0063 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
0064 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
0065 .ir_scheme = PVR2_IR_SCHEME_29XXX,
0066 };
0067
0068
0069
0070
0071
0072
0073 static const struct pvr2_device_client_desc pvr2_cli_24xxx[] = {
0074 { .module_id = PVR2_CLIENT_ID_CX25840 },
0075 { .module_id = PVR2_CLIENT_ID_TUNER },
0076 { .module_id = PVR2_CLIENT_ID_WM8775 },
0077 { .module_id = PVR2_CLIENT_ID_DEMOD },
0078 };
0079
0080 #define PVR2_FIRMWARE_24xxx "v4l-pvrusb2-24xxx-01.fw"
0081 static const char *pvr2_fw1_names_24xxx[] = {
0082 PVR2_FIRMWARE_24xxx,
0083 };
0084
0085 static const struct pvr2_device_desc pvr2_device_24xxx = {
0086 .description = "WinTV PVR USB2 Model 24xxx",
0087 .shortname = "24xxx",
0088 .client_table.lst = pvr2_cli_24xxx,
0089 .client_table.cnt = ARRAY_SIZE(pvr2_cli_24xxx),
0090 .fx2_firmware.lst = pvr2_fw1_names_24xxx,
0091 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_24xxx),
0092 .flag_has_cx25840 = !0,
0093 .flag_has_wm8775 = !0,
0094 .flag_has_hauppauge_rom = !0,
0095 .flag_has_analogtuner = !0,
0096 .flag_has_fmradio = !0,
0097 .flag_has_composite = !0,
0098 .flag_has_svideo = !0,
0099 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
0100 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
0101 .ir_scheme = PVR2_IR_SCHEME_24XXX,
0102 };
0103
0104
0105
0106
0107
0108
0109 static const struct pvr2_device_client_desc pvr2_cli_gotview_2[] = {
0110 { .module_id = PVR2_CLIENT_ID_CX25840 },
0111 { .module_id = PVR2_CLIENT_ID_TUNER },
0112 { .module_id = PVR2_CLIENT_ID_DEMOD },
0113 };
0114
0115 static const struct pvr2_device_desc pvr2_device_gotview_2 = {
0116 .description = "Gotview USB 2.0 DVD 2",
0117 .shortname = "gv2",
0118 .client_table.lst = pvr2_cli_gotview_2,
0119 .client_table.cnt = ARRAY_SIZE(pvr2_cli_gotview_2),
0120 .flag_has_cx25840 = !0,
0121 .default_tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
0122 .flag_has_analogtuner = !0,
0123 .flag_has_fmradio = !0,
0124 .flag_has_composite = !0,
0125 .flag_has_svideo = !0,
0126 .signal_routing_scheme = PVR2_ROUTING_SCHEME_GOTVIEW,
0127 };
0128
0129
0130
0131
0132
0133
0134
0135
0136 static const struct pvr2_device_desc pvr2_device_gotview_2d = {
0137 .description = "Gotview USB 2.0 DVD Deluxe",
0138 .shortname = "gv2d",
0139 .client_table.lst = pvr2_cli_gotview_2,
0140 .client_table.cnt = ARRAY_SIZE(pvr2_cli_gotview_2),
0141 .flag_has_cx25840 = !0,
0142 .default_tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
0143 .flag_has_analogtuner = !0,
0144 .flag_has_composite = !0,
0145 .flag_has_svideo = !0,
0146 .signal_routing_scheme = PVR2_ROUTING_SCHEME_GOTVIEW,
0147 };
0148
0149
0150
0151
0152
0153
0154 static const struct pvr2_device_client_desc pvr2_cli_av400[] = {
0155 { .module_id = PVR2_CLIENT_ID_CX25840 },
0156 };
0157
0158 static const struct pvr2_device_desc pvr2_device_av400 = {
0159 .description = "Terratec Grabster AV400",
0160 .shortname = "av400",
0161 .flag_is_experimental = 1,
0162 .client_table.lst = pvr2_cli_av400,
0163 .client_table.cnt = ARRAY_SIZE(pvr2_cli_av400),
0164 .flag_has_cx25840 = !0,
0165 .flag_has_analogtuner = 0,
0166 .flag_has_composite = !0,
0167 .flag_has_svideo = !0,
0168 .signal_routing_scheme = PVR2_ROUTING_SCHEME_AV400,
0169 };
0170
0171
0172
0173
0174
0175
0176 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
0177 static struct lgdt330x_config pvr2_lgdt3303_config = {
0178 .demod_chip = LGDT3303,
0179 .clock_polarity_flip = 1,
0180 };
0181
0182 static int pvr2_lgdt3303_attach(struct pvr2_dvb_adapter *adap)
0183 {
0184 adap->fe[0] = dvb_attach(lgdt330x_attach, &pvr2_lgdt3303_config,
0185 0x0e,
0186 &adap->channel.hdw->i2c_adap);
0187 if (adap->fe[0])
0188 return 0;
0189
0190 return -EIO;
0191 }
0192
0193 static int pvr2_lgh06xf_attach(struct pvr2_dvb_adapter *adap)
0194 {
0195 dvb_attach(simple_tuner_attach, adap->fe[0],
0196 &adap->channel.hdw->i2c_adap, 0x61,
0197 TUNER_LG_TDVS_H06XF);
0198
0199 return 0;
0200 }
0201
0202 static const struct pvr2_dvb_props pvr2_onair_creator_fe_props = {
0203 .frontend_attach = pvr2_lgdt3303_attach,
0204 .tuner_attach = pvr2_lgh06xf_attach,
0205 };
0206 #endif
0207
0208 static const struct pvr2_device_client_desc pvr2_cli_onair_creator[] = {
0209 { .module_id = PVR2_CLIENT_ID_SAA7115 },
0210 { .module_id = PVR2_CLIENT_ID_CS53L32A },
0211 { .module_id = PVR2_CLIENT_ID_TUNER },
0212 };
0213
0214 static const struct pvr2_device_desc pvr2_device_onair_creator = {
0215 .description = "OnAir Creator Hybrid USB tuner",
0216 .shortname = "oac",
0217 .client_table.lst = pvr2_cli_onair_creator,
0218 .client_table.cnt = ARRAY_SIZE(pvr2_cli_onair_creator),
0219 .default_tuner_type = TUNER_LG_TDVS_H06XF,
0220 .flag_has_analogtuner = !0,
0221 .flag_has_composite = !0,
0222 .flag_has_svideo = !0,
0223 .flag_digital_requires_cx23416 = !0,
0224 .signal_routing_scheme = PVR2_ROUTING_SCHEME_ONAIR,
0225 .digital_control_scheme = PVR2_DIGITAL_SCHEME_ONAIR,
0226 .default_std_mask = V4L2_STD_NTSC_M,
0227 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
0228 .dvb_props = &pvr2_onair_creator_fe_props,
0229 #endif
0230 };
0231
0232
0233
0234
0235
0236
0237 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
0238 static struct lgdt330x_config pvr2_lgdt3302_config = {
0239 .demod_chip = LGDT3302,
0240 };
0241
0242 static int pvr2_lgdt3302_attach(struct pvr2_dvb_adapter *adap)
0243 {
0244 adap->fe[0] = dvb_attach(lgdt330x_attach, &pvr2_lgdt3302_config,
0245 0x0e,
0246 &adap->channel.hdw->i2c_adap);
0247 if (adap->fe[0])
0248 return 0;
0249
0250 return -EIO;
0251 }
0252
0253 static int pvr2_fcv1236d_attach(struct pvr2_dvb_adapter *adap)
0254 {
0255 dvb_attach(simple_tuner_attach, adap->fe[0],
0256 &adap->channel.hdw->i2c_adap, 0x61,
0257 TUNER_PHILIPS_FCV1236D);
0258
0259 return 0;
0260 }
0261
0262 static const struct pvr2_dvb_props pvr2_onair_usb2_fe_props = {
0263 .frontend_attach = pvr2_lgdt3302_attach,
0264 .tuner_attach = pvr2_fcv1236d_attach,
0265 };
0266 #endif
0267
0268 static const struct pvr2_device_client_desc pvr2_cli_onair_usb2[] = {
0269 { .module_id = PVR2_CLIENT_ID_SAA7115 },
0270 { .module_id = PVR2_CLIENT_ID_CS53L32A },
0271 { .module_id = PVR2_CLIENT_ID_TUNER },
0272 };
0273
0274 static const struct pvr2_device_desc pvr2_device_onair_usb2 = {
0275 .description = "OnAir USB2 Hybrid USB tuner",
0276 .shortname = "oa2",
0277 .client_table.lst = pvr2_cli_onair_usb2,
0278 .client_table.cnt = ARRAY_SIZE(pvr2_cli_onair_usb2),
0279 .default_tuner_type = TUNER_PHILIPS_FCV1236D,
0280 .flag_has_analogtuner = !0,
0281 .flag_has_composite = !0,
0282 .flag_has_svideo = !0,
0283 .flag_digital_requires_cx23416 = !0,
0284 .signal_routing_scheme = PVR2_ROUTING_SCHEME_ONAIR,
0285 .digital_control_scheme = PVR2_DIGITAL_SCHEME_ONAIR,
0286 .default_std_mask = V4L2_STD_NTSC_M,
0287 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
0288 .dvb_props = &pvr2_onair_usb2_fe_props,
0289 #endif
0290 };
0291
0292
0293
0294
0295
0296
0297 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
0298 static struct tda10048_config hauppauge_tda10048_config = {
0299 .demod_address = 0x10 >> 1,
0300 .output_mode = TDA10048_PARALLEL_OUTPUT,
0301 .fwbulkwritelen = TDA10048_BULKWRITE_50,
0302 .inversion = TDA10048_INVERSION_ON,
0303 .dtv6_if_freq_khz = TDA10048_IF_3300,
0304 .dtv7_if_freq_khz = TDA10048_IF_3800,
0305 .dtv8_if_freq_khz = TDA10048_IF_4300,
0306 .clk_freq_khz = TDA10048_CLK_16000,
0307 .disable_gate_access = 1,
0308 };
0309
0310 static struct tda829x_config tda829x_no_probe = {
0311 .probe_tuner = TDA829X_DONT_PROBE,
0312 };
0313
0314 static struct tda18271_std_map hauppauge_tda18271_dvbt_std_map = {
0315 .dvbt_6 = { .if_freq = 3300, .agc_mode = 3, .std = 4,
0316 .if_lvl = 1, .rfagc_top = 0x37, },
0317 .dvbt_7 = { .if_freq = 3800, .agc_mode = 3, .std = 5,
0318 .if_lvl = 1, .rfagc_top = 0x37, },
0319 .dvbt_8 = { .if_freq = 4300, .agc_mode = 3, .std = 6,
0320 .if_lvl = 1, .rfagc_top = 0x37, },
0321 };
0322
0323 static struct tda18271_config hauppauge_tda18271_dvb_config = {
0324 .std_map = &hauppauge_tda18271_dvbt_std_map,
0325 .gate = TDA18271_GATE_ANALOG,
0326 .output_opt = TDA18271_OUTPUT_LT_OFF,
0327 };
0328
0329 static int pvr2_tda10048_attach(struct pvr2_dvb_adapter *adap)
0330 {
0331 adap->fe[0] = dvb_attach(tda10048_attach, &hauppauge_tda10048_config,
0332 &adap->channel.hdw->i2c_adap);
0333 if (adap->fe[0])
0334 return 0;
0335
0336 return -EIO;
0337 }
0338
0339 static int pvr2_73xxx_tda18271_8295_attach(struct pvr2_dvb_adapter *adap)
0340 {
0341 dvb_attach(tda829x_attach, adap->fe[0],
0342 &adap->channel.hdw->i2c_adap, 0x42,
0343 &tda829x_no_probe);
0344 dvb_attach(tda18271_attach, adap->fe[0], 0x60,
0345 &adap->channel.hdw->i2c_adap,
0346 &hauppauge_tda18271_dvb_config);
0347
0348 return 0;
0349 }
0350
0351 static const struct pvr2_dvb_props pvr2_73xxx_dvb_props = {
0352 .frontend_attach = pvr2_tda10048_attach,
0353 .tuner_attach = pvr2_73xxx_tda18271_8295_attach,
0354 };
0355 #endif
0356
0357 static const struct pvr2_device_client_desc pvr2_cli_73xxx[] = {
0358 { .module_id = PVR2_CLIENT_ID_CX25840 },
0359 { .module_id = PVR2_CLIENT_ID_TUNER,
0360 .i2c_address_list = "\x42"},
0361 };
0362
0363 #define PVR2_FIRMWARE_73xxx "v4l-pvrusb2-73xxx-01.fw"
0364 static const char *pvr2_fw1_names_73xxx[] = {
0365 PVR2_FIRMWARE_73xxx,
0366 };
0367
0368 static const struct pvr2_device_desc pvr2_device_73xxx = {
0369 .description = "WinTV HVR-1900 Model 73xxx",
0370 .shortname = "73xxx",
0371 .client_table.lst = pvr2_cli_73xxx,
0372 .client_table.cnt = ARRAY_SIZE(pvr2_cli_73xxx),
0373 .fx2_firmware.lst = pvr2_fw1_names_73xxx,
0374 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_73xxx),
0375 .flag_has_cx25840 = !0,
0376 .flag_has_hauppauge_rom = !0,
0377 .flag_has_analogtuner = !0,
0378 .flag_has_composite = !0,
0379 .flag_has_svideo = !0,
0380 .flag_fx2_16kb = !0,
0381 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
0382 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
0383 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
0384 .ir_scheme = PVR2_IR_SCHEME_ZILOG,
0385 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
0386 .dvb_props = &pvr2_73xxx_dvb_props,
0387 #endif
0388 };
0389
0390
0391
0392
0393
0394
0395 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
0396 static struct s5h1409_config pvr2_s5h1409_config = {
0397 .demod_address = 0x32 >> 1,
0398 .output_mode = S5H1409_PARALLEL_OUTPUT,
0399 .gpio = S5H1409_GPIO_OFF,
0400 .qam_if = 4000,
0401 .inversion = S5H1409_INVERSION_ON,
0402 .status_mode = S5H1409_DEMODLOCKING,
0403 };
0404
0405 static struct s5h1411_config pvr2_s5h1411_config = {
0406 .output_mode = S5H1411_PARALLEL_OUTPUT,
0407 .gpio = S5H1411_GPIO_OFF,
0408 .vsb_if = S5H1411_IF_44000,
0409 .qam_if = S5H1411_IF_4000,
0410 .inversion = S5H1411_INVERSION_ON,
0411 .status_mode = S5H1411_DEMODLOCKING,
0412 };
0413
0414 static struct tda18271_std_map hauppauge_tda18271_std_map = {
0415 .atsc_6 = { .if_freq = 5380, .agc_mode = 3, .std = 3,
0416 .if_lvl = 6, .rfagc_top = 0x37, },
0417 .qam_6 = { .if_freq = 4000, .agc_mode = 3, .std = 0,
0418 .if_lvl = 6, .rfagc_top = 0x37, },
0419 };
0420
0421 static struct tda18271_config hauppauge_tda18271_config = {
0422 .std_map = &hauppauge_tda18271_std_map,
0423 .gate = TDA18271_GATE_ANALOG,
0424 .output_opt = TDA18271_OUTPUT_LT_OFF,
0425 };
0426
0427 static int pvr2_s5h1409_attach(struct pvr2_dvb_adapter *adap)
0428 {
0429 adap->fe[0] = dvb_attach(s5h1409_attach, &pvr2_s5h1409_config,
0430 &adap->channel.hdw->i2c_adap);
0431 if (adap->fe[0])
0432 return 0;
0433
0434 return -EIO;
0435 }
0436
0437 static int pvr2_s5h1411_attach(struct pvr2_dvb_adapter *adap)
0438 {
0439 adap->fe[0] = dvb_attach(s5h1411_attach, &pvr2_s5h1411_config,
0440 &adap->channel.hdw->i2c_adap);
0441 if (adap->fe[0])
0442 return 0;
0443
0444 return -EIO;
0445 }
0446
0447 static int pvr2_tda18271_8295_attach(struct pvr2_dvb_adapter *adap)
0448 {
0449 dvb_attach(tda829x_attach, adap->fe[0],
0450 &adap->channel.hdw->i2c_adap, 0x42,
0451 &tda829x_no_probe);
0452 dvb_attach(tda18271_attach, adap->fe[0], 0x60,
0453 &adap->channel.hdw->i2c_adap,
0454 &hauppauge_tda18271_config);
0455
0456 return 0;
0457 }
0458
0459 static const struct pvr2_dvb_props pvr2_750xx_dvb_props = {
0460 .frontend_attach = pvr2_s5h1409_attach,
0461 .tuner_attach = pvr2_tda18271_8295_attach,
0462 };
0463
0464 static const struct pvr2_dvb_props pvr2_751xx_dvb_props = {
0465 .frontend_attach = pvr2_s5h1411_attach,
0466 .tuner_attach = pvr2_tda18271_8295_attach,
0467 };
0468 #endif
0469
0470 #define PVR2_FIRMWARE_75xxx "v4l-pvrusb2-73xxx-01.fw"
0471 static const char *pvr2_fw1_names_75xxx[] = {
0472 PVR2_FIRMWARE_75xxx,
0473 };
0474
0475 static const struct pvr2_device_desc pvr2_device_750xx = {
0476 .description = "WinTV HVR-1950 Model 750xx",
0477 .shortname = "750xx",
0478 .client_table.lst = pvr2_cli_73xxx,
0479 .client_table.cnt = ARRAY_SIZE(pvr2_cli_73xxx),
0480 .fx2_firmware.lst = pvr2_fw1_names_75xxx,
0481 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_75xxx),
0482 .flag_has_cx25840 = !0,
0483 .flag_has_hauppauge_rom = !0,
0484 .flag_has_analogtuner = !0,
0485 .flag_has_composite = !0,
0486 .flag_has_svideo = !0,
0487 .flag_fx2_16kb = !0,
0488 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
0489 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
0490 .default_std_mask = V4L2_STD_NTSC_M,
0491 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
0492 .ir_scheme = PVR2_IR_SCHEME_ZILOG,
0493 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
0494 .dvb_props = &pvr2_750xx_dvb_props,
0495 #endif
0496 };
0497
0498 static const struct pvr2_device_desc pvr2_device_751xx = {
0499 .description = "WinTV HVR-1950 Model 751xx",
0500 .shortname = "751xx",
0501 .client_table.lst = pvr2_cli_73xxx,
0502 .client_table.cnt = ARRAY_SIZE(pvr2_cli_73xxx),
0503 .fx2_firmware.lst = pvr2_fw1_names_75xxx,
0504 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_75xxx),
0505 .flag_has_cx25840 = !0,
0506 .flag_has_hauppauge_rom = !0,
0507 .flag_has_analogtuner = !0,
0508 .flag_has_composite = !0,
0509 .flag_has_svideo = !0,
0510 .flag_fx2_16kb = !0,
0511 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
0512 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
0513 .default_std_mask = V4L2_STD_NTSC_M,
0514 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
0515 .ir_scheme = PVR2_IR_SCHEME_ZILOG,
0516 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
0517 .dvb_props = &pvr2_751xx_dvb_props,
0518 #endif
0519 };
0520
0521
0522
0523
0524 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
0525 static int pvr2_si2157_attach(struct pvr2_dvb_adapter *adap);
0526 static int pvr2_si2168_attach(struct pvr2_dvb_adapter *adap);
0527 static int pvr2_dual_fe_attach(struct pvr2_dvb_adapter *adap);
0528 static int pvr2_lgdt3306a_attach(struct pvr2_dvb_adapter *adap);
0529
0530 static const struct pvr2_dvb_props pvr2_160000_dvb_props = {
0531 .frontend_attach = pvr2_dual_fe_attach,
0532 .tuner_attach = pvr2_si2157_attach,
0533 };
0534
0535 static const struct pvr2_dvb_props pvr2_160111_dvb_props = {
0536 .frontend_attach = pvr2_lgdt3306a_attach,
0537 .tuner_attach = pvr2_si2157_attach,
0538 };
0539
0540 static int pvr2_si2157_attach(struct pvr2_dvb_adapter *adap)
0541 {
0542 struct si2157_config si2157_config = {};
0543
0544 si2157_config.inversion = 1;
0545 si2157_config.fe = adap->fe[0];
0546
0547 adap->i2c_client_tuner = dvb_module_probe("si2157", "si2177",
0548 &adap->channel.hdw->i2c_adap,
0549 0x60, &si2157_config);
0550
0551 if (!adap->i2c_client_tuner)
0552 return -ENODEV;
0553
0554 return 0;
0555 }
0556
0557 static int pvr2_si2168_attach(struct pvr2_dvb_adapter *adap)
0558 {
0559 struct si2168_config si2168_config = {};
0560 struct i2c_adapter *adapter;
0561
0562 pr_debug("%s()\n", __func__);
0563
0564 si2168_config.fe = &adap->fe[1];
0565 si2168_config.i2c_adapter = &adapter;
0566 si2168_config.ts_mode = SI2168_TS_PARALLEL;
0567 si2168_config.ts_clock_gapped = 1;
0568 si2168_config.ts_clock_inv = 0;
0569 si2168_config.spectral_inversion = 1;
0570
0571 adap->i2c_client_demod[1] = dvb_module_probe("si2168", NULL,
0572 &adap->channel.hdw->i2c_adap,
0573 0x64, &si2168_config);
0574
0575 if (!adap->i2c_client_demod[1])
0576 return -ENODEV;
0577
0578 return 0;
0579 }
0580
0581 static int pvr2_lgdt3306a_attach(struct pvr2_dvb_adapter *adap)
0582 {
0583 struct lgdt3306a_config lgdt3306a_config;
0584 struct i2c_adapter *adapter;
0585
0586 pr_debug("%s()\n", __func__);
0587
0588 lgdt3306a_config.fe = &adap->fe[0];
0589 lgdt3306a_config.i2c_adapter = &adapter;
0590 lgdt3306a_config.deny_i2c_rptr = 1;
0591 lgdt3306a_config.spectral_inversion = 1;
0592 lgdt3306a_config.qam_if_khz = 4000;
0593 lgdt3306a_config.vsb_if_khz = 3250;
0594 lgdt3306a_config.mpeg_mode = LGDT3306A_MPEG_PARALLEL;
0595 lgdt3306a_config.tpclk_edge = LGDT3306A_TPCLK_FALLING_EDGE;
0596 lgdt3306a_config.tpvalid_polarity = LGDT3306A_TP_VALID_LOW;
0597 lgdt3306a_config.xtalMHz = 25;
0598
0599 adap->i2c_client_demod[0] = dvb_module_probe("lgdt3306a", NULL,
0600 &adap->channel.hdw->i2c_adap,
0601 0x59, &lgdt3306a_config);
0602
0603 if (!adap->i2c_client_demod[0])
0604 return -ENODEV;
0605
0606 return 0;
0607 }
0608
0609 static int pvr2_dual_fe_attach(struct pvr2_dvb_adapter *adap)
0610 {
0611 pr_debug("%s()\n", __func__);
0612
0613 if (pvr2_lgdt3306a_attach(adap) != 0)
0614 return -ENODEV;
0615
0616 if (pvr2_si2168_attach(adap) != 0) {
0617 dvb_module_release(adap->i2c_client_demod[0]);
0618 return -ENODEV;
0619 }
0620
0621 return 0;
0622 }
0623 #endif
0624
0625 #define PVR2_FIRMWARE_160xxx "v4l-pvrusb2-160xxx-01.fw"
0626 static const char *pvr2_fw1_names_160xxx[] = {
0627 PVR2_FIRMWARE_160xxx,
0628 };
0629
0630 static const struct pvr2_device_client_desc pvr2_cli_160xxx[] = {
0631 { .module_id = PVR2_CLIENT_ID_CX25840 },
0632 };
0633
0634 static const struct pvr2_device_desc pvr2_device_160000 = {
0635 .description = "WinTV HVR-1975 Model 160000",
0636 .shortname = "160000",
0637 .client_table.lst = pvr2_cli_160xxx,
0638 .client_table.cnt = ARRAY_SIZE(pvr2_cli_160xxx),
0639 .fx2_firmware.lst = pvr2_fw1_names_160xxx,
0640 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_160xxx),
0641 .default_tuner_type = TUNER_ABSENT,
0642 .flag_has_cx25840 = 1,
0643 .flag_has_hauppauge_rom = 1,
0644 .flag_has_analogtuner = 1,
0645 .flag_has_composite = 1,
0646 .flag_has_svideo = 1,
0647 .flag_fx2_16kb = 1,
0648 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
0649 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
0650 .default_std_mask = V4L2_STD_NTSC_M,
0651 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
0652 .ir_scheme = PVR2_IR_SCHEME_ZILOG,
0653 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
0654 .dvb_props = &pvr2_160000_dvb_props,
0655 #endif
0656 };
0657
0658 static const struct pvr2_device_desc pvr2_device_160111 = {
0659 .description = "WinTV HVR-1955 Model 160111",
0660 .shortname = "160111",
0661 .client_table.lst = pvr2_cli_160xxx,
0662 .client_table.cnt = ARRAY_SIZE(pvr2_cli_160xxx),
0663 .fx2_firmware.lst = pvr2_fw1_names_160xxx,
0664 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_160xxx),
0665 .default_tuner_type = TUNER_ABSENT,
0666 .flag_has_cx25840 = 1,
0667 .flag_has_hauppauge_rom = 1,
0668 .flag_has_analogtuner = 1,
0669 .flag_has_composite = 1,
0670 .flag_has_svideo = 1,
0671 .flag_fx2_16kb = 1,
0672 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
0673 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
0674 .default_std_mask = V4L2_STD_NTSC_M,
0675 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
0676 .ir_scheme = PVR2_IR_SCHEME_ZILOG,
0677 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
0678 .dvb_props = &pvr2_160111_dvb_props,
0679 #endif
0680 };
0681
0682
0683
0684 struct usb_device_id pvr2_device_table[] = {
0685 { USB_DEVICE(0x2040, 0x2900),
0686 .driver_info = (kernel_ulong_t)&pvr2_device_29xxx},
0687 { USB_DEVICE(0x2040, 0x2950),
0688 .driver_info = (kernel_ulong_t)&pvr2_device_29xxx},
0689 { USB_DEVICE(0x2040, 0x2400),
0690 .driver_info = (kernel_ulong_t)&pvr2_device_24xxx},
0691 { USB_DEVICE(0x1164, 0x0622),
0692 .driver_info = (kernel_ulong_t)&pvr2_device_gotview_2},
0693 { USB_DEVICE(0x1164, 0x0602),
0694 .driver_info = (kernel_ulong_t)&pvr2_device_gotview_2d},
0695 { USB_DEVICE(0x11ba, 0x1003),
0696 .driver_info = (kernel_ulong_t)&pvr2_device_onair_creator},
0697 { USB_DEVICE(0x11ba, 0x1001),
0698 .driver_info = (kernel_ulong_t)&pvr2_device_onair_usb2},
0699 { USB_DEVICE(0x2040, 0x7300),
0700 .driver_info = (kernel_ulong_t)&pvr2_device_73xxx},
0701 { USB_DEVICE(0x2040, 0x7500),
0702 .driver_info = (kernel_ulong_t)&pvr2_device_750xx},
0703 { USB_DEVICE(0x2040, 0x7501),
0704 .driver_info = (kernel_ulong_t)&pvr2_device_751xx},
0705 { USB_DEVICE(0x0ccd, 0x0039),
0706 .driver_info = (kernel_ulong_t)&pvr2_device_av400},
0707 { USB_DEVICE(0x2040, 0x7502),
0708 .driver_info = (kernel_ulong_t)&pvr2_device_160111},
0709 { USB_DEVICE(0x2040, 0x7510),
0710 .driver_info = (kernel_ulong_t)&pvr2_device_160000},
0711 { }
0712 };
0713
0714 MODULE_DEVICE_TABLE(usb, pvr2_device_table);
0715 MODULE_FIRMWARE(PVR2_FIRMWARE_29xxx);
0716 MODULE_FIRMWARE(PVR2_FIRMWARE_24xxx);
0717 MODULE_FIRMWARE(PVR2_FIRMWARE_73xxx);
0718 MODULE_FIRMWARE(PVR2_FIRMWARE_75xxx);