22 #include <linux/module.h>
24 #include <linux/device.h>
70 static unsigned int debug;
72 #define dprintk(level, fmt, arg...)\
73 do { if (debug >= level)\
74 printk(KERN_DEBUG "%s/0: " fmt, dev->name, ## arg);\
79 static unsigned int alt_tuner;
119 static int cx23885_dvb_set_frontend(
struct dvb_frontend *fe);
133 if (fe && fe->
dvb.frontend && fe->
dvb.frontend->ops.i2c_gate_ctrl)
134 fe->
dvb.frontend->ops.i2c_gate_ctrl(fe->
dvb.frontend, open);
140 cx23885_dvb_set_frontend(fe->
dvb.frontend);
144 .buf_setup = dvb_buf_setup,
145 .buf_prepare = dvb_buf_prepare,
146 .buf_queue = dvb_buf_queue,
147 .buf_release = dvb_buf_release,
151 .demod_address = 0x32 >> 1,
161 .demod_address = 0x10 >> 1,
172 .demod_address = 0x10 >> 1,
183 .demod_address = 0x32 >> 1,
193 .demod_address = 0x32 >> 1,
203 .demod_address = 0x32 >> 1,
211 static struct mt2131_config hauppauge_generic_tunerconfig = {
216 .demod_address = 0x0e,
222 .demod_address = 0x32 >> 1,
232 .demod_address = 0x32 >> 1,
261 static struct xc5000_config hauppauge_hvr1500q_tunerconfig = {
276 .atsc_6 = { .if_freq = 5380, .agc_mode = 3, .std = 3,
277 .if_lvl = 6, .rfagc_top = 0x37 },
278 .qam_6 = { .if_freq = 4000, .agc_mode = 3, .std = 0,
279 .if_lvl = 6, .rfagc_top = 0x37 },
283 .dvbt_6 = { .if_freq = 3300, .agc_mode = 3, .std = 4,
284 .if_lvl = 1, .rfagc_top = 0x37, },
285 .dvbt_7 = { .if_freq = 3800, .agc_mode = 3, .std = 5,
286 .if_lvl = 1, .rfagc_top = 0x37, },
287 .dvbt_8 = { .if_freq = 4300, .agc_mode = 3, .std = 6,
288 .if_lvl = 1, .rfagc_top = 0x37, },
292 .std_map = &hauppauge_tda18271_std_map,
298 .std_map = &hauppauge_hvr1200_tda18271_std_map,
309 .atsc_6 = { .if_freq = 3250, .agc_mode = 3, .std = 4,
310 .if_lvl = 1, .rfagc_top = 0x58 },
311 .qam_6 = { .if_freq = 4000, .agc_mode = 3, .std = 5,
312 .if_lvl = 1, .rfagc_top = 0x58 },
316 .std_map = &hauppauge_hvr127x_std_map,
326 .spectral_inversion = 1,
339 (0 << 15) | (0 << 14) | (0 << 11) | (0 << 10) | (0 << 9) | (0 << 8) |
340 (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0),
390 (3 << 14) | (1 << 12) | (524 << 0),
397 .output_mpeg2_in_188_bytes = 1,
398 .hostbus_diversity = 1,
399 .tuner_is_baseband = 0,
402 .agc_config_count = 1,
403 .agc = &xc3028_agc_config,
404 .bw = &xc3028_bw_config,
418 .demod_address = 0x0f,
421 .disable_i2c_gate_ctrl = 1,
438 .demod_address = 0x68,
443 .ts_config_regs = stv0900_ts_regs,
465 .demod_address = 0x55,
469 .demod_address = 0x68,
473 .demod_address = 0x05,
478 .demod_address = 0x19,
482 .if_clk_freq = 30400,
504 .diseqc_envelope_mode =
false,
506 .tuner_get_frequency = stb6100_get_frequency,
507 .tuner_set_frequency = stb6100_set_frequency,
508 .tuner_set_bandwidth = stb6100_set_bandwidth,
509 .tuner_get_bandwidth = stb6100_get_bandwidth,
513 .tuner_address = 0x60,
514 .refclock = 27000000,
531 static int cx23885_dvb_set_frontend(
struct dvb_frontend *fe)
537 switch (dev->
board) {
559 static struct lgs8gxx_config magicpro_prohdtve2_lgs8g75_config = {
561 .demod_address = 0x19,
565 .if_clk_freq = 30400,
574 static struct xc5000_config magicpro_prohdtve2_xc5000_config = {
581 .demod_address = 0x44,
583 .ts_sampling_edge = 1,
585 .osc_clk_freq = 30400,
600 .demod_address = 0x44,
602 .ts_sampling_edge = 1,
604 .osc_clk_freq = 30400,
618 .demod_address = 0x1c,
625 .demod_address = 0x1d,
644 static struct drxk_config terratec_drxk_config[] = {
656 .tuner_address = 0x60,
658 .tuner_address = 0x67,
729 switch (dev->
board) {
733 &hauppauge_generic_config,
735 if (fe0->
dvb.frontend !=
NULL) {
738 &hauppauge_generic_tunerconfig, 0);
745 &hauppauge_lgdt3305_config,
747 if (fe0->
dvb.frontend !=
NULL) {
749 0x60, &dev->
i2c_bus[1].i2c_adap,
750 &hauppauge_hvr127x_config);
759 if (fe0->
dvb.frontend !=
NULL) {
761 0x60, &dev->
i2c_bus[1].i2c_adap,
762 &hauppauge_tda18271_config);
766 0x60, &dev->
i2c_bus[1].i2c_adap,
767 &hauppauge_tda18271_config);
776 &hauppauge_ezqam_config,
778 if (fe0->
dvb.frontend !=
NULL) {
780 &dev->
i2c_bus[1].i2c_adap, 0x42,
783 0x60, &dev->
i2c_bus[1].i2c_adap,
784 &hauppauge_tda18271_config);
791 &hauppauge_generic_config,
796 &hauppauge_generic_tunerconfig, 0);
803 &hauppauge_hvr1800lp_config,
805 if (fe0->
dvb.frontend !=
NULL) {
808 &hauppauge_generic_tunerconfig, 0);
814 &fusionhdtv_5_express,
816 if (fe0->
dvb.frontend !=
NULL) {
819 TUNER_LG_TDVS_H06XF);
825 &hauppauge_hvr1500q_config,
830 &hauppauge_hvr1500q_tunerconfig);
835 &hauppauge_hvr1500_config,
837 if (fe0->
dvb.frontend !=
NULL) {
850 fe0->
dvb.frontend, &cfg);
851 if (fe !=
NULL && fe->
ops.tuner_ops.set_config !=
NULL)
852 fe->
ops.tuner_ops.set_config(fe, &ctl);
859 &hauppauge_hvr1200_config,
861 if (fe0->
dvb.frontend !=
NULL) {
863 &dev->
i2c_bus[1].i2c_adap, 0x42,
866 0x60, &dev->
i2c_bus[1].i2c_adap,
867 &hauppauge_hvr1200_tuner_config);
873 &hauppauge_hvr1210_config,
875 if (fe0->
dvb.frontend !=
NULL) {
877 0x60, &dev->
i2c_bus[1].i2c_adap,
878 &hauppauge_hvr1210_tuner_config);
885 0x12, &hauppauge_hvr1400_dib7000_config);
886 if (fe0->
dvb.frontend !=
NULL) {
902 fe0->
dvb.frontend, &cfg);
903 if (fe !=
NULL && fe->
ops.tuner_ops.set_config !=
NULL)
904 fe->
ops.tuner_ops.set_config(fe, &ctl);
911 &dvico_s5h1409_config,
915 &dvico_s5h1411_config,
920 &dvico_xc5000_tunerconfig);
926 &dvico_fusionhdtv_xc3028,
928 if (fe0->
dvb.frontend !=
NULL) {
942 if (fe !=
NULL && fe->
ops.tuner_ops.set_config !=
NULL)
943 fe->
ops.tuner_ops.set_config(fe, &ctl);
953 &dvico_fusionhdtv_xc3028,
955 if (fe0->
dvb.frontend !=
NULL) {
969 if (fe !=
NULL && fe->
ops.tuner_ops.set_config !=
NULL)
970 fe->
ops.tuner_ops.set_config(fe, &ctl);
977 &dvico_fusionhdtv_xc3028,
979 if (fe0->
dvb.frontend !=
NULL) {
984 .dvb_amplitude = 134,
985 .set_smoothedcvbs = 1,
990 &dev->
i2c_bus[1].i2c_adap, &cfg);
994 goto frontend_detach;
1002 &tbs_cx24116_config,
1004 if (fe0->
dvb.frontend !=
NULL)
1012 &tevii_ds3000_config,
1014 if (fe0->
dvb.frontend !=
NULL)
1022 &dvbworld_cx24116_config,
1031 &netup_stv0900_config,
1033 if (fe0->
dvb.frontend !=
NULL) {
1036 &netup_stv6110_tunerconfig_a,
1044 "No LNBH24 found!\n");
1052 &netup_stv0900_config,
1054 if (fe0->
dvb.frontend !=
NULL) {
1057 &netup_stv6110_tunerconfig_b,
1065 "No LNBH24 found!\n");
1076 &mygica_x8506_lgs8gl5_config,
1078 if (fe0->
dvb.frontend !=
NULL) {
1081 &i2c_bus2->i2c_adap,
1082 &mygica_x8506_xc5000_config);
1089 &magicpro_prohdtve2_lgs8g75_config,
1091 if (fe0->
dvb.frontend !=
NULL) {
1094 &i2c_bus2->i2c_adap,
1095 &magicpro_prohdtve2_xc5000_config);
1101 &hcw_s5h1411_config,
1103 if (fe0->
dvb.frontend !=
NULL)
1105 0x60, &dev->
i2c_bus[0].i2c_adap,
1106 &hauppauge_tda18271_config);
1109 0x60, &dev->
i2c_bus[1].i2c_adap,
1110 &hauppauge_tda18271_config);
1116 &hcw_s5h1411_config,
1118 if (fe0->
dvb.frontend !=
NULL)
1120 0x60, &dev->
i2c_bus[0].i2c_adap,
1121 &hauppauge_tda18271_config);
1129 &mygica_x8558pro_atbm8830_cfg1,
1131 if (fe0->
dvb.frontend !=
NULL) {
1135 &mygic_x8558pro_max2165_cfg1);
1142 &mygica_x8558pro_atbm8830_cfg2,
1144 if (fe0->
dvb.frontend !=
NULL) {
1148 &mygic_x8558pro_max2165_cfg2);
1160 &netup_stv0367_config[port->
nr - 1],
1162 if (fe0->
dvb.frontend !=
NULL) {
1166 &netup_xc5000_config[port->
nr - 1]))
1167 goto frontend_detach;
1169 fe0->
dvb.frontend->ops.tuner_ops.init(fe0->
dvb.frontend);
1174 goto frontend_detach;
1177 &netup_stv0367_config[port->
nr - 1],
1179 if (fe1->
dvb.frontend !=
NULL) {
1180 fe1->
dvb.frontend->id = 1;
1184 &netup_xc5000_config[port->
nr - 1]))
1185 goto frontend_detach;
1196 &terratec_drxk_config[0],
1198 if (fe0->
dvb.frontend !=
NULL) {
1201 &terratec_mt2063_config[0],
1202 &i2c_bus2->i2c_adap))
1203 goto frontend_detach;
1209 &terratec_drxk_config[1],
1211 if (fe0->
dvb.frontend !=
NULL) {
1214 &terratec_mt2063_config[1],
1215 &i2c_bus2->i2c_adap))
1216 goto frontend_detach;
1225 &tevii_ds3000_config,
1232 &prof_8000_stv090x_config,
1235 if (fe0->
dvb.frontend !=
NULL) {
1238 &prof_8000_stb6100_config,
1240 goto frontend_detach;
1242 fe0->
dvb.frontend->ops.set_voltage = p8000_set_voltage;
1247 " isn't supported yet\n",
1252 if ((
NULL == fe0->
dvb.frontend) || (fe1 &&
NULL == fe1->
dvb.frontend)) {
1255 goto frontend_detach;
1264 fe0->
dvb.frontend->ops.ts_bus_ctrl = cx23885_dvb_bus_ctrl;
1266 fe1->
dvb.frontend->ops.ts_bus_ctrl = cx23885_dvb_bus_ctrl;
1272 if (fe0->
dvb.frontend->ops.analog_ops.standby)
1273 fe0->
dvb.frontend->ops.analog_ops.standby(fe0->
dvb.frontend);
1277 &dev->
pci->dev, adapter_nr, mfe_shared);
1279 goto frontend_detach;
1282 switch (dev->
board) {
1288 cinfo.port[port->
nr - 1].mac, 6);
1299 .demux = &fe0->
dvb.demux,
1313 dev->
i2c_bus[0].i2c_client.addr = 0xa0 >> 1;
1360 dprintk(1,
" ->probed by Card=%d Name=%s, PCI %02x:%02x\n",
1376 err = dvb_register(port);
1396 if (fe0 && fe0->
dvb.frontend)
1399 switch (port->
dev->board) {