diff options
Diffstat (limited to 'drivers/media/video/cx23885/cx23885-dvb.c')
-rw-r--r-- | drivers/media/video/cx23885/cx23885-dvb.c | 156 |
1 files changed, 150 insertions, 6 deletions
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c index 1dc070da8652..48a975134ac5 100644 --- a/drivers/media/video/cx23885/cx23885-dvb.c +++ b/drivers/media/video/cx23885/cx23885-dvb.c | |||
@@ -45,12 +45,15 @@ | |||
45 | #include "dibx000_common.h" | 45 | #include "dibx000_common.h" |
46 | #include "zl10353.h" | 46 | #include "zl10353.h" |
47 | #include "stv0900.h" | 47 | #include "stv0900.h" |
48 | #include "stv0900_reg.h" | ||
48 | #include "stv6110.h" | 49 | #include "stv6110.h" |
49 | #include "lnbh24.h" | 50 | #include "lnbh24.h" |
50 | #include "cx24116.h" | 51 | #include "cx24116.h" |
51 | #include "cimax2.h" | 52 | #include "cimax2.h" |
53 | #include "lgs8gxx.h" | ||
52 | #include "netup-eeprom.h" | 54 | #include "netup-eeprom.h" |
53 | #include "netup-init.h" | 55 | #include "netup-init.h" |
56 | #include "lgdt3305.h" | ||
54 | 57 | ||
55 | static unsigned int debug; | 58 | static unsigned int debug; |
56 | 59 | ||
@@ -122,7 +125,22 @@ static struct tda10048_config hauppauge_hvr1200_config = { | |||
122 | .demod_address = 0x10 >> 1, | 125 | .demod_address = 0x10 >> 1, |
123 | .output_mode = TDA10048_SERIAL_OUTPUT, | 126 | .output_mode = TDA10048_SERIAL_OUTPUT, |
124 | .fwbulkwritelen = TDA10048_BULKWRITE_200, | 127 | .fwbulkwritelen = TDA10048_BULKWRITE_200, |
125 | .inversion = TDA10048_INVERSION_ON | 128 | .inversion = TDA10048_INVERSION_ON, |
129 | .dtv6_if_freq_khz = TDA10048_IF_3300, | ||
130 | .dtv7_if_freq_khz = TDA10048_IF_3800, | ||
131 | .dtv8_if_freq_khz = TDA10048_IF_4300, | ||
132 | .clk_freq_khz = TDA10048_CLK_16000, | ||
133 | }; | ||
134 | |||
135 | static struct tda10048_config hauppauge_hvr1210_config = { | ||
136 | .demod_address = 0x10 >> 1, | ||
137 | .output_mode = TDA10048_SERIAL_OUTPUT, | ||
138 | .fwbulkwritelen = TDA10048_BULKWRITE_200, | ||
139 | .inversion = TDA10048_INVERSION_ON, | ||
140 | .dtv6_if_freq_khz = TDA10048_IF_3300, | ||
141 | .dtv7_if_freq_khz = TDA10048_IF_3500, | ||
142 | .dtv8_if_freq_khz = TDA10048_IF_4000, | ||
143 | .clk_freq_khz = TDA10048_CLK_16000, | ||
126 | }; | 144 | }; |
127 | 145 | ||
128 | static struct s5h1409_config hauppauge_ezqam_config = { | 146 | static struct s5h1409_config hauppauge_ezqam_config = { |
@@ -194,6 +212,16 @@ static struct s5h1411_config dvico_s5h1411_config = { | |||
194 | .mpeg_timing = S5H1411_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK, | 212 | .mpeg_timing = S5H1411_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK, |
195 | }; | 213 | }; |
196 | 214 | ||
215 | static struct s5h1411_config hcw_s5h1411_config = { | ||
216 | .output_mode = S5H1411_SERIAL_OUTPUT, | ||
217 | .gpio = S5H1411_GPIO_OFF, | ||
218 | .vsb_if = S5H1411_IF_44000, | ||
219 | .qam_if = S5H1411_IF_4000, | ||
220 | .inversion = S5H1411_INVERSION_ON, | ||
221 | .status_mode = S5H1411_DEMODLOCKING, | ||
222 | .mpeg_timing = S5H1411_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK, | ||
223 | }; | ||
224 | |||
197 | static struct xc5000_config hauppauge_hvr1500q_tunerconfig = { | 225 | static struct xc5000_config hauppauge_hvr1500q_tunerconfig = { |
198 | .i2c_address = 0x61, | 226 | .i2c_address = 0x61, |
199 | .if_khz = 5380, | 227 | .if_khz = 5380, |
@@ -215,15 +243,51 @@ static struct tda18271_std_map hauppauge_tda18271_std_map = { | |||
215 | .if_lvl = 6, .rfagc_top = 0x37 }, | 243 | .if_lvl = 6, .rfagc_top = 0x37 }, |
216 | }; | 244 | }; |
217 | 245 | ||
246 | static struct tda18271_std_map hauppauge_hvr1200_tda18271_std_map = { | ||
247 | .dvbt_6 = { .if_freq = 3300, .agc_mode = 3, .std = 4, | ||
248 | .if_lvl = 1, .rfagc_top = 0x37, }, | ||
249 | .dvbt_7 = { .if_freq = 3800, .agc_mode = 3, .std = 5, | ||
250 | .if_lvl = 1, .rfagc_top = 0x37, }, | ||
251 | .dvbt_8 = { .if_freq = 4300, .agc_mode = 3, .std = 6, | ||
252 | .if_lvl = 1, .rfagc_top = 0x37, }, | ||
253 | }; | ||
254 | |||
218 | static struct tda18271_config hauppauge_tda18271_config = { | 255 | static struct tda18271_config hauppauge_tda18271_config = { |
219 | .std_map = &hauppauge_tda18271_std_map, | 256 | .std_map = &hauppauge_tda18271_std_map, |
220 | .gate = TDA18271_GATE_ANALOG, | 257 | .gate = TDA18271_GATE_ANALOG, |
221 | }; | 258 | }; |
222 | 259 | ||
223 | static struct tda18271_config hauppauge_hvr1200_tuner_config = { | 260 | static struct tda18271_config hauppauge_hvr1200_tuner_config = { |
261 | .std_map = &hauppauge_hvr1200_tda18271_std_map, | ||
224 | .gate = TDA18271_GATE_ANALOG, | 262 | .gate = TDA18271_GATE_ANALOG, |
225 | }; | 263 | }; |
226 | 264 | ||
265 | static struct tda18271_config hauppauge_hvr1210_tuner_config = { | ||
266 | .gate = TDA18271_GATE_DIGITAL, | ||
267 | }; | ||
268 | |||
269 | static struct tda18271_std_map hauppauge_hvr127x_std_map = { | ||
270 | .atsc_6 = { .if_freq = 3250, .agc_mode = 3, .std = 4, | ||
271 | .if_lvl = 1, .rfagc_top = 0x58 }, | ||
272 | .qam_6 = { .if_freq = 4000, .agc_mode = 3, .std = 5, | ||
273 | .if_lvl = 1, .rfagc_top = 0x58 }, | ||
274 | }; | ||
275 | |||
276 | static struct tda18271_config hauppauge_hvr127x_config = { | ||
277 | .std_map = &hauppauge_hvr127x_std_map, | ||
278 | }; | ||
279 | |||
280 | static struct lgdt3305_config hauppauge_lgdt3305_config = { | ||
281 | .i2c_addr = 0x0e, | ||
282 | .mpeg_mode = LGDT3305_MPEG_SERIAL, | ||
283 | .tpclk_edge = LGDT3305_TPCLK_FALLING_EDGE, | ||
284 | .tpvalid_polarity = LGDT3305_TP_VALID_HIGH, | ||
285 | .deny_i2c_rptr = 1, | ||
286 | .spectral_inversion = 1, | ||
287 | .qam_if_khz = 4000, | ||
288 | .vsb_if_khz = 3250, | ||
289 | }; | ||
290 | |||
227 | static struct dibx000_agc_config xc3028_agc_config = { | 291 | static struct dibx000_agc_config xc3028_agc_config = { |
228 | BAND_VHF | BAND_UHF, /* band_caps */ | 292 | BAND_VHF | BAND_UHF, /* band_caps */ |
229 | 293 | ||
@@ -317,13 +381,25 @@ static struct zl10353_config dvico_fusionhdtv_xc3028 = { | |||
317 | .disable_i2c_gate_ctrl = 1, | 381 | .disable_i2c_gate_ctrl = 1, |
318 | }; | 382 | }; |
319 | 383 | ||
384 | static struct stv0900_reg stv0900_ts_regs[] = { | ||
385 | { R0900_TSGENERAL, 0x00 }, | ||
386 | { R0900_P1_TSSPEED, 0x40 }, | ||
387 | { R0900_P2_TSSPEED, 0x40 }, | ||
388 | { R0900_P1_TSCFGM, 0xc0 }, | ||
389 | { R0900_P2_TSCFGM, 0xc0 }, | ||
390 | { R0900_P1_TSCFGH, 0xe0 }, | ||
391 | { R0900_P2_TSCFGH, 0xe0 }, | ||
392 | { R0900_P1_TSCFGL, 0x20 }, | ||
393 | { R0900_P2_TSCFGL, 0x20 }, | ||
394 | { 0xffff, 0xff }, /* terminate */ | ||
395 | }; | ||
396 | |||
320 | static struct stv0900_config netup_stv0900_config = { | 397 | static struct stv0900_config netup_stv0900_config = { |
321 | .demod_address = 0x68, | 398 | .demod_address = 0x68, |
322 | .xtal = 27000000, | 399 | .xtal = 27000000, |
323 | .clkmode = 3,/* 0-CLKI, 2-XTALI, else AUTO */ | 400 | .clkmode = 3,/* 0-CLKI, 2-XTALI, else AUTO */ |
324 | .diseqc_mode = 2,/* 2/3 PWM */ | 401 | .diseqc_mode = 2,/* 2/3 PWM */ |
325 | .path1_mode = 2,/*Serial continues clock */ | 402 | .ts_config_regs = stv0900_ts_regs, |
326 | .path2_mode = 2,/*Serial continues clock */ | ||
327 | .tun1_maddress = 0,/* 0x60 */ | 403 | .tun1_maddress = 0,/* 0x60 */ |
328 | .tun2_maddress = 3,/* 0x63 */ | 404 | .tun2_maddress = 3,/* 0x63 */ |
329 | .tun1_adc = 1,/* 1 Vpp */ | 405 | .tun1_adc = 1,/* 1 Vpp */ |
@@ -368,10 +444,29 @@ static struct cx24116_config dvbworld_cx24116_config = { | |||
368 | .demod_address = 0x05, | 444 | .demod_address = 0x05, |
369 | }; | 445 | }; |
370 | 446 | ||
447 | static struct lgs8gxx_config mygica_x8506_lgs8gl5_config = { | ||
448 | .prod = LGS8GXX_PROD_LGS8GL5, | ||
449 | .demod_address = 0x19, | ||
450 | .serial_ts = 0, | ||
451 | .ts_clk_pol = 1, | ||
452 | .ts_clk_gated = 1, | ||
453 | .if_clk_freq = 30400, /* 30.4 MHz */ | ||
454 | .if_freq = 5380, /* 5.38 MHz */ | ||
455 | .if_neg_center = 1, | ||
456 | .ext_adc = 0, | ||
457 | .adc_signed = 0, | ||
458 | .if_neg_edge = 0, | ||
459 | }; | ||
460 | |||
461 | static struct xc5000_config mygica_x8506_xc5000_config = { | ||
462 | .i2c_address = 0x61, | ||
463 | .if_khz = 5380, | ||
464 | }; | ||
465 | |||
371 | static int dvb_register(struct cx23885_tsport *port) | 466 | static int dvb_register(struct cx23885_tsport *port) |
372 | { | 467 | { |
373 | struct cx23885_dev *dev = port->dev; | 468 | struct cx23885_dev *dev = port->dev; |
374 | struct cx23885_i2c *i2c_bus = NULL; | 469 | struct cx23885_i2c *i2c_bus = NULL, *i2c_bus2 = NULL; |
375 | struct videobuf_dvb_frontend *fe0; | 470 | struct videobuf_dvb_frontend *fe0; |
376 | int ret; | 471 | int ret; |
377 | 472 | ||
@@ -396,6 +491,29 @@ static int dvb_register(struct cx23885_tsport *port) | |||
396 | &hauppauge_generic_tunerconfig, 0); | 491 | &hauppauge_generic_tunerconfig, 0); |
397 | } | 492 | } |
398 | break; | 493 | break; |
494 | case CX23885_BOARD_HAUPPAUGE_HVR1270: | ||
495 | case CX23885_BOARD_HAUPPAUGE_HVR1275: | ||
496 | i2c_bus = &dev->i2c_bus[0]; | ||
497 | fe0->dvb.frontend = dvb_attach(lgdt3305_attach, | ||
498 | &hauppauge_lgdt3305_config, | ||
499 | &i2c_bus->i2c_adap); | ||
500 | if (fe0->dvb.frontend != NULL) { | ||
501 | dvb_attach(tda18271_attach, fe0->dvb.frontend, | ||
502 | 0x60, &dev->i2c_bus[1].i2c_adap, | ||
503 | &hauppauge_hvr127x_config); | ||
504 | } | ||
505 | break; | ||
506 | case CX23885_BOARD_HAUPPAUGE_HVR1255: | ||
507 | i2c_bus = &dev->i2c_bus[0]; | ||
508 | fe0->dvb.frontend = dvb_attach(s5h1411_attach, | ||
509 | &hcw_s5h1411_config, | ||
510 | &i2c_bus->i2c_adap); | ||
511 | if (fe0->dvb.frontend != NULL) { | ||
512 | dvb_attach(tda18271_attach, fe0->dvb.frontend, | ||
513 | 0x60, &dev->i2c_bus[1].i2c_adap, | ||
514 | &hauppauge_tda18271_config); | ||
515 | } | ||
516 | break; | ||
399 | case CX23885_BOARD_HAUPPAUGE_HVR1800: | 517 | case CX23885_BOARD_HAUPPAUGE_HVR1800: |
400 | i2c_bus = &dev->i2c_bus[0]; | 518 | i2c_bus = &dev->i2c_bus[0]; |
401 | switch (alt_tuner) { | 519 | switch (alt_tuner) { |
@@ -496,6 +614,17 @@ static int dvb_register(struct cx23885_tsport *port) | |||
496 | &hauppauge_hvr1200_tuner_config); | 614 | &hauppauge_hvr1200_tuner_config); |
497 | } | 615 | } |
498 | break; | 616 | break; |
617 | case CX23885_BOARD_HAUPPAUGE_HVR1210: | ||
618 | i2c_bus = &dev->i2c_bus[0]; | ||
619 | fe0->dvb.frontend = dvb_attach(tda10048_attach, | ||
620 | &hauppauge_hvr1210_config, | ||
621 | &i2c_bus->i2c_adap); | ||
622 | if (fe0->dvb.frontend != NULL) { | ||
623 | dvb_attach(tda18271_attach, fe0->dvb.frontend, | ||
624 | 0x60, &dev->i2c_bus[1].i2c_adap, | ||
625 | &hauppauge_hvr1210_tuner_config); | ||
626 | } | ||
627 | break; | ||
499 | case CX23885_BOARD_HAUPPAUGE_HVR1400: | 628 | case CX23885_BOARD_HAUPPAUGE_HVR1400: |
500 | i2c_bus = &dev->i2c_bus[0]; | 629 | i2c_bus = &dev->i2c_bus[0]; |
501 | fe0->dvb.frontend = dvb_attach(dib7000p_attach, | 630 | fe0->dvb.frontend = dvb_attach(dib7000p_attach, |
@@ -630,7 +759,8 @@ static int dvb_register(struct cx23885_tsport *port) | |||
630 | if (!dvb_attach(lnbh24_attach, | 759 | if (!dvb_attach(lnbh24_attach, |
631 | fe0->dvb.frontend, | 760 | fe0->dvb.frontend, |
632 | &i2c_bus->i2c_adap, | 761 | &i2c_bus->i2c_adap, |
633 | LNBH24_PCL, 0, 0x09)) | 762 | LNBH24_PCL, |
763 | LNBH24_TTX, 0x09)) | ||
634 | printk(KERN_ERR | 764 | printk(KERN_ERR |
635 | "No LNBH24 found!\n"); | 765 | "No LNBH24 found!\n"); |
636 | 766 | ||
@@ -650,7 +780,8 @@ static int dvb_register(struct cx23885_tsport *port) | |||
650 | if (!dvb_attach(lnbh24_attach, | 780 | if (!dvb_attach(lnbh24_attach, |
651 | fe0->dvb.frontend, | 781 | fe0->dvb.frontend, |
652 | &i2c_bus->i2c_adap, | 782 | &i2c_bus->i2c_adap, |
653 | LNBH24_PCL, 0, 0x0a)) | 783 | LNBH24_PCL, |
784 | LNBH24_TTX, 0x0a)) | ||
654 | printk(KERN_ERR | 785 | printk(KERN_ERR |
655 | "No LNBH24 found!\n"); | 786 | "No LNBH24 found!\n"); |
656 | 787 | ||
@@ -659,6 +790,19 @@ static int dvb_register(struct cx23885_tsport *port) | |||
659 | break; | 790 | break; |
660 | } | 791 | } |
661 | break; | 792 | break; |
793 | case CX23885_BOARD_MYGICA_X8506: | ||
794 | i2c_bus = &dev->i2c_bus[0]; | ||
795 | i2c_bus2 = &dev->i2c_bus[1]; | ||
796 | fe0->dvb.frontend = dvb_attach(lgs8gxx_attach, | ||
797 | &mygica_x8506_lgs8gl5_config, | ||
798 | &i2c_bus->i2c_adap); | ||
799 | if (fe0->dvb.frontend != NULL) { | ||
800 | dvb_attach(xc5000_attach, | ||
801 | fe0->dvb.frontend, | ||
802 | &i2c_bus2->i2c_adap, | ||
803 | &mygica_x8506_xc5000_config); | ||
804 | } | ||
805 | break; | ||
662 | default: | 806 | default: |
663 | printk(KERN_INFO "%s: The frontend of your DVB/ATSC card " | 807 | printk(KERN_INFO "%s: The frontend of your DVB/ATSC card " |
664 | " isn't supported yet\n", | 808 | " isn't supported yet\n", |