aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/dvb-usb/dib0700_devices.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/usb/dvb-usb/dib0700_devices.c')
-rw-r--r--drivers/media/usb/dvb-usb/dib0700_devices.c383
1 files changed, 211 insertions, 172 deletions
diff --git a/drivers/media/usb/dvb-usb/dib0700_devices.c b/drivers/media/usb/dvb-usb/dib0700_devices.c
index ce47d3f1c850..e1757b8f5f5d 100644
--- a/drivers/media/usb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/usb/dvb-usb/dib0700_devices.c
@@ -220,12 +220,21 @@ static struct dibx000_agc_config stk7700d_7000p_mt2266_agc_config[2] = {
220}; 220};
221 221
222static struct dibx000_bandwidth_config stk7700d_mt2266_pll_config = { 222static struct dibx000_bandwidth_config stk7700d_mt2266_pll_config = {
223 60000, 30000, 223 .internal = 60000,
224 1, 8, 3, 1, 0, 224 .sampling = 30000,
225 0, 0, 1, 1, 2, 225 .pll_prediv = 1,
226 (3 << 14) | (1 << 12) | (524 << 0), 226 .pll_ratio = 8,
227 0, 227 .pll_range = 3,
228 20452225, 228 .pll_reset = 1,
229 .pll_bypass = 0,
230 .enable_refdiv = 0,
231 .bypclk_div = 0,
232 .IO_CLK_en_core = 1,
233 .ADClkSrc = 1,
234 .modulo = 2,
235 .sad_cfg = (3 << 14) | (1 << 12) | (524 << 0),
236 .ifreq = 0,
237 .timf = 20452225,
229}; 238};
230 239
231static struct dib7000p_config stk7700d_dib7000p_mt2266_config[] = { 240static struct dib7000p_config stk7700d_dib7000p_mt2266_config[] = {
@@ -342,57 +351,57 @@ static int stk7700d_tuner_attach(struct dvb_usb_adapter *adap)
342 351
343/* STK7700-PH: Digital/Analog Hybrid Tuner, e.h. Cinergy HT USB HE */ 352/* STK7700-PH: Digital/Analog Hybrid Tuner, e.h. Cinergy HT USB HE */
344static struct dibx000_agc_config xc3028_agc_config = { 353static struct dibx000_agc_config xc3028_agc_config = {
345 BAND_VHF | BAND_UHF, /* band_caps */ 354 .band_caps = BAND_VHF | BAND_UHF,
346
347 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=0, 355 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=0,
348 * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0, 356 * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
349 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */ 357 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */
350 (0 << 15) | (0 << 14) | (0 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | 358 .setup = (0 << 15) | (0 << 14) | (0 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0),
351 (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), /* setup */ 359 .inv_gain = 712,
352 360 .time_stabiliz = 21,
353 712, /* inv_gain */ 361 .alpha_level = 0,
354 21, /* time_stabiliz */ 362 .thlock = 118,
355 363 .wbd_inv = 0,
356 0, /* alpha_level */ 364 .wbd_ref = 2867,
357 118, /* thlock */ 365 .wbd_sel = 0,
358 366 .wbd_alpha = 2,
359 0, /* wbd_inv */ 367 .agc1_max = 0,
360 2867, /* wbd_ref */ 368 .agc1_min = 0,
361 0, /* wbd_sel */ 369 .agc2_max = 39718,
362 2, /* wbd_alpha */ 370 .agc2_min = 9930,
363 371 .agc1_pt1 = 0,
364 0, /* agc1_max */ 372 .agc1_pt2 = 0,
365 0, /* agc1_min */ 373 .agc1_pt3 = 0,
366 39718, /* agc2_max */ 374 .agc1_slope1 = 0,
367 9930, /* agc2_min */ 375 .agc1_slope2 = 0,
368 0, /* agc1_pt1 */ 376 .agc2_pt1 = 0,
369 0, /* agc1_pt2 */ 377 .agc2_pt2 = 128,
370 0, /* agc1_pt3 */ 378 .agc2_slope1 = 29,
371 0, /* agc1_slope1 */ 379 .agc2_slope2 = 29,
372 0, /* agc1_slope2 */ 380 .alpha_mant = 17,
373 0, /* agc2_pt1 */ 381 .alpha_exp = 27,
374 128, /* agc2_pt2 */ 382 .beta_mant = 23,
375 29, /* agc2_slope1 */ 383 .beta_exp = 51,
376 29, /* agc2_slope2 */ 384 .perform_agc_softsplit = 1,
377
378 17, /* alpha_mant */
379 27, /* alpha_exp */
380 23, /* beta_mant */
381 51, /* beta_exp */
382
383 1, /* perform_agc_softsplit */
384}; 385};
385 386
386/* PLL Configuration for COFDM BW_MHz = 8.00 with external clock = 30.00 */ 387/* PLL Configuration for COFDM BW_MHz = 8.00 with external clock = 30.00 */
387static struct dibx000_bandwidth_config xc3028_bw_config = { 388static struct dibx000_bandwidth_config xc3028_bw_config = {
388 60000, 30000, /* internal, sampling */ 389 .internal = 60000,
389 1, 8, 3, 1, 0, /* pll_cfg: prediv, ratio, range, reset, bypass */ 390 .sampling = 30000,
390 0, 0, 1, 1, 0, /* misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, 391 .pll_prediv = 1,
391 modulo */ 392 .pll_ratio = 8,
392 (3 << 14) | (1 << 12) | (524 << 0), /* sad_cfg: refsel, sel, freq_15k */ 393 .pll_range = 3,
393 (1 << 25) | 5816102, /* ifreq = 5.200000 MHz */ 394 .pll_reset = 1,
394 20452225, /* timf */ 395 .pll_bypass = 0,
395 30000000, /* xtal_hz */ 396 .enable_refdiv = 0,
397 .bypclk_div = 0,
398 .IO_CLK_en_core = 1,
399 .ADClkSrc = 1,
400 .modulo = 0,
401 .sad_cfg = (3 << 14) | (1 << 12) | (524 << 0), /* sad_cfg: refsel, sel, freq_15k */
402 .ifreq = (1 << 25) | 5816102, /* ifreq = 5.200000 MHz */
403 .timf = 20452225,
404 .xtal_hz = 30000000,
396}; 405};
397 406
398static struct dib7000p_config stk7700ph_dib7700_xc3028_config = { 407static struct dib7000p_config stk7700ph_dib7700_xc3028_config = {
@@ -614,59 +623,55 @@ static struct dibx000_agc_config stk7700p_7000m_mt2060_agc_config = {
614}; 623};
615 624
616static struct dibx000_agc_config stk7700p_7000p_mt2060_agc_config = { 625static struct dibx000_agc_config stk7700p_7000p_mt2060_agc_config = {
617 BAND_UHF | BAND_VHF, 626 .band_caps = BAND_UHF | BAND_VHF,
618
619 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=5, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, 627 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=5, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0,
620 * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */ 628 * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */
621 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) 629 .setup = (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0),
622 | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), 630 .inv_gain = 712,
623 631 .time_stabiliz = 41,
624 712, 632 .alpha_level = 0,
625 41, 633 .thlock = 118,
626 634 .wbd_inv = 0,
627 0, 635 .wbd_ref = 4095,
628 118, 636 .wbd_sel = 0,
629 637 .wbd_alpha = 0,
630 0, 638 .agc1_max = 42598,
631 4095, 639 .agc1_min = 16384,
632 0, 640 .agc2_max = 42598,
633 0, 641 .agc2_min = 0,
634 642 .agc1_pt1 = 0,
635 42598, 643 .agc1_pt2 = 137,
636 16384, 644 .agc1_pt3 = 255,
637 42598, 645 .agc1_slope1 = 0,
638 0, 646 .agc1_slope2 = 255,
639 647 .agc2_pt1 = 0,
640 0, 648 .agc2_pt2 = 0,
641 137, 649 .agc2_slope1 = 0,
642 255, 650 .agc2_slope2 = 41,
643 651 .alpha_mant = 15,
644 0, 652 .alpha_exp = 25,
645 255, 653 .beta_mant = 28,
646 654 .beta_exp = 48,
647 0, 655 .perform_agc_softsplit = 0,
648 0,
649
650 0,
651 41,
652
653 15,
654 25,
655
656 28,
657 48,
658
659 0,
660}; 656};
661 657
662static struct dibx000_bandwidth_config stk7700p_pll_config = { 658static struct dibx000_bandwidth_config stk7700p_pll_config = {
663 60000, 30000, 659 .internal = 60000,
664 1, 8, 3, 1, 0, 660 .sampling = 30000,
665 0, 0, 1, 1, 0, 661 .pll_prediv = 1,
666 (3 << 14) | (1 << 12) | (524 << 0), 662 .pll_ratio = 8,
667 60258167, 663 .pll_range = 3,
668 20452225, 664 .pll_reset = 1,
669 30000000, 665 .pll_bypass = 0,
666 .enable_refdiv = 0,
667 .bypclk_div = 0,
668 .IO_CLK_en_core = 1,
669 .ADClkSrc = 1,
670 .modulo = 0,
671 .sad_cfg = (3 << 14) | (1 << 12) | (524 << 0),
672 .ifreq = 60258167,
673 .timf = 20452225,
674 .xtal_hz = 30000000,
670}; 675};
671 676
672static struct dib7000m_config stk7700p_dib7000m_config = { 677static struct dib7000m_config stk7700p_dib7000m_config = {
@@ -758,45 +763,36 @@ static int stk7700p_tuner_attach(struct dvb_usb_adapter *adap)
758 763
759/* DIB7070 generic */ 764/* DIB7070 generic */
760static struct dibx000_agc_config dib7070_agc_config = { 765static struct dibx000_agc_config dib7070_agc_config = {
761 BAND_UHF | BAND_VHF | BAND_LBAND | BAND_SBAND, 766 .band_caps = BAND_UHF | BAND_VHF | BAND_LBAND | BAND_SBAND,
762 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=5, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, 767 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=5, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0,
763 * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0 */ 768 * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0 */
764 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) 769 .setup = (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
765 | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), 770 .inv_gain = 600,
766 771 .time_stabiliz = 10,
767 600, 772 .alpha_level = 0,
768 10, 773 .thlock = 118,
769 774 .wbd_inv = 0,
770 0, 775 .wbd_ref = 3530,
771 118, 776 .wbd_sel = 1,
772 777 .wbd_alpha = 5,
773 0, 778 .agc1_max = 65535,
774 3530, 779 .agc1_min = 0,
775 1, 780 .agc2_max = 65535,
776 5, 781 .agc2_min = 0,
777 782 .agc1_pt1 = 0,
778 65535, 783 .agc1_pt2 = 40,
779 0, 784 .agc1_pt3 = 183,
780 785 .agc1_slope1 = 206,
781 65535, 786 .agc1_slope2 = 255,
782 0, 787 .agc2_pt1 = 72,
783 788 .agc2_pt2 = 152,
784 0, 789 .agc2_slope1 = 88,
785 40, 790 .agc2_slope2 = 90,
786 183, 791 .alpha_mant = 17,
787 206, 792 .alpha_exp = 27,
788 255, 793 .beta_mant = 23,
789 72, 794 .beta_exp = 51,
790 152, 795 .perform_agc_softsplit = 0,
791 88,
792 90,
793
794 17,
795 27,
796 23,
797 51,
798
799 0,
800}; 796};
801 797
802static int dib7070_tuner_reset(struct dvb_frontend *fe, int onoff) 798static int dib7070_tuner_reset(struct dvb_frontend *fe, int onoff)
@@ -952,13 +948,22 @@ static int stk70x0p_pid_filter_ctrl(struct dvb_usb_adapter *adapter, int onoff)
952} 948}
953 949
954static struct dibx000_bandwidth_config dib7070_bw_config_12_mhz = { 950static struct dibx000_bandwidth_config dib7070_bw_config_12_mhz = {
955 60000, 15000, 951 .internal = 60000,
956 1, 20, 3, 1, 0, 952 .sampling = 15000,
957 0, 0, 1, 1, 2, 953 .pll_prediv = 1,
958 (3 << 14) | (1 << 12) | (524 << 0), 954 .pll_ratio = 20,
959 (0 << 25) | 0, 955 .pll_range = 3,
960 20452225, 956 .pll_reset = 1,
961 12000000, 957 .pll_bypass = 0,
958 .enable_refdiv = 0,
959 .bypclk_div = 0,
960 .IO_CLK_en_core = 1,
961 .ADClkSrc = 1,
962 .modulo = 2,
963 .sad_cfg = (3 << 14) | (1 << 12) | (524 << 0),
964 .ifreq = (0 << 25) | 0,
965 .timf = 20452225,
966 .xtal_hz = 12000000,
962}; 967};
963 968
964static struct dib7000p_config dib7070p_dib7000p_config = { 969static struct dib7000p_config dib7070p_dib7000p_config = {
@@ -1169,14 +1174,22 @@ static struct dibx000_agc_config dib807x_agc_config[2] = {
1169}; 1174};
1170 1175
1171static struct dibx000_bandwidth_config dib807x_bw_config_12_mhz = { 1176static struct dibx000_bandwidth_config dib807x_bw_config_12_mhz = {
1172 60000, 15000, /* internal, sampling*/ 1177 .internal = 60000,
1173 1, 20, 3, 1, 0, /* pll_cfg: prediv, ratio, range, reset, bypass*/ 1178 .sampling = 15000,
1174 0, 0, 1, 1, 2, /* misc: refdiv, bypclk_div, IO_CLK_en_core, 1179 .pll_prediv = 1,
1175 ADClkSrc, modulo */ 1180 .pll_ratio = 20,
1176 (3 << 14) | (1 << 12) | (599 << 0), /* sad_cfg: refsel, sel, freq_15k*/ 1181 .pll_range = 3,
1177 (0 << 25) | 0, /* ifreq = 0.000000 MHz*/ 1182 .pll_reset = 1,
1178 18179755, /* timf*/ 1183 .pll_bypass = 0,
1179 12000000, /* xtal_hz*/ 1184 .enable_refdiv = 0,
1185 .bypclk_div = 0,
1186 .IO_CLK_en_core = 1,
1187 .ADClkSrc = 1,
1188 .modulo = 2,
1189 .sad_cfg = (3 << 14) | (1 << 12) | (599 << 0), /* sad_cfg: refsel, sel, freq_15k*/
1190 .ifreq = (0 << 25) | 0, /* ifreq = 0.000000 MHz*/
1191 .timf = 18179755,
1192 .xtal_hz = 12000000,
1180}; 1193};
1181 1194
1182static struct dib8000_config dib807x_dib8000_config[2] = { 1195static struct dib8000_config dib807x_dib8000_config[2] = {
@@ -1921,13 +1934,22 @@ static struct dibx000_agc_config dib8096p_agc_config[2] = {
1921}; 1934};
1922 1935
1923static struct dibx000_bandwidth_config dib8096p_clock_config_12_mhz = { 1936static struct dibx000_bandwidth_config dib8096p_clock_config_12_mhz = {
1924 108000, 13500, 1937 .internal = 108000,
1925 1, 9, 1, 0, 0, 1938 .sampling = 13500,
1926 0, 0, 0, 0, 2, 1939 .pll_prediv = 1,
1927 (3 << 14) | (1 << 12) | (524 << 0), 1940 .pll_ratio = 9,
1928 (0 << 25) | 0, 1941 .pll_range = 1,
1929 20199729, 1942 .pll_reset = 0,
1930 12000000, 1943 .pll_bypass = 0,
1944 .enable_refdiv = 0,
1945 .bypclk_div = 0,
1946 .IO_CLK_en_core = 0,
1947 .ADClkSrc = 0,
1948 .modulo = 2,
1949 .sad_cfg = (3 << 14) | (1 << 12) | (524 << 0),
1950 .ifreq = (0 << 25) | 0,
1951 .timf = 20199729,
1952 .xtal_hz = 12000000,
1931}; 1953};
1932 1954
1933static struct dib8000_config tfe8096p_dib8000_config = { 1955static struct dib8000_config tfe8096p_dib8000_config = {
@@ -2724,13 +2746,22 @@ static struct dibx000_agc_config dib7090_agc_config[2] = {
2724}; 2746};
2725 2747
2726static struct dibx000_bandwidth_config dib7090_clock_config_12_mhz = { 2748static struct dibx000_bandwidth_config dib7090_clock_config_12_mhz = {
2727 60000, 15000, 2749 .internal = 60000,
2728 1, 5, 0, 0, 0, 2750 .sampling = 15000,
2729 0, 0, 1, 1, 2, 2751 .pll_prediv = 1,
2730 (3 << 14) | (1 << 12) | (524 << 0), 2752 .pll_ratio = 5,
2731 (0 << 25) | 0, 2753 .pll_range = 0,
2732 20452225, 2754 .pll_reset = 0,
2733 15000000, 2755 .pll_bypass = 0,
2756 .enable_refdiv = 0,
2757 .bypclk_div = 0,
2758 .IO_CLK_en_core = 1,
2759 .ADClkSrc = 1,
2760 .modulo = 2,
2761 .sad_cfg = (3 << 14) | (1 << 12) | (524 << 0),
2762 .ifreq = (0 << 25) | 0,
2763 .timf = 20452225,
2764 .xtal_hz = 15000000,
2734}; 2765};
2735 2766
2736static struct dib7000p_config nim7090_dib7000p_config = { 2767static struct dib7000p_config nim7090_dib7000p_config = {
@@ -3498,14 +3529,22 @@ static struct dibx000_agc_config stk7700p_7000p_xc4000_agc_config = {
3498}; 3529};
3499 3530
3500static struct dibx000_bandwidth_config stk7700p_xc4000_pll_config = { 3531static struct dibx000_bandwidth_config stk7700p_xc4000_pll_config = {
3501 60000, 30000, /* internal, sampling */ 3532 .internal = 60000,
3502 1, 8, 3, 1, 0, /* pll_cfg: prediv, ratio, range, reset, bypass */ 3533 .sampling = 30000,
3503 0, 0, 1, 1, 0, /* misc: refdiv, bypclk_div, IO_CLK_en_core, */ 3534 .pll_prediv = 1,
3504 /* ADClkSrc, modulo */ 3535 .pll_ratio = 8,
3505 (3 << 14) | (1 << 12) | 524, /* sad_cfg: refsel, sel, freq_15k */ 3536 .pll_range = 3,
3506 39370534, /* ifreq */ 3537 .pll_reset = 1,
3507 20452225, /* timf */ 3538 .pll_bypass = 0,
3508 30000000 /* xtal */ 3539 .enable_refdiv = 0,
3540 .bypclk_div = 0,
3541 .IO_CLK_en_core = 1,
3542 .ADClkSrc = 1,
3543 .modulo = 0,
3544 .sad_cfg = (3 << 14) | (1 << 12) | 524, /* sad_cfg: refsel, sel, freq_15k */
3545 .ifreq = 39370534,
3546 .timf = 20452225,
3547 .xtal_hz = 30000000
3509}; 3548};
3510 3549
3511/* FIXME: none of these inputs are validated yet */ 3550/* FIXME: none of these inputs are validated yet */