diff options
author | James Harper <james.harper@ejbdigital.com.au> | 2014-06-12 06:12:24 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-07-26 10:55:03 -0400 |
commit | 46b21bbaa8a8a9d0c83afd7a6035a9d6c20064f1 (patch) | |
tree | 10b20b25a90e2b7e6302b4b26bda65c0bf99ac6f /drivers | |
parent | 7b4eeed174b71c325705ff8c53f333bc79d0ee7a (diff) |
[media] Add support for DViCO FusionHDTV DVB-T Dual Express2
DViCO FusionHDTV DVB-T Dual Express2 is cx23885 + dib7070
[m.chehab@samsung.com: fix conflicts and make checkpatch happy]
Signed-off-by: James Harper <james.harper@ejbdigital.com.au>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/pci/cx23885/cx23885-cards.c | 13 | ||||
-rw-r--r-- | drivers/media/pci/cx23885/cx23885-dvb.c | 125 | ||||
-rw-r--r-- | drivers/media/pci/cx23885/cx23885.h | 1 |
3 files changed, 139 insertions, 0 deletions
diff --git a/drivers/media/pci/cx23885/cx23885-cards.c b/drivers/media/pci/cx23885/cx23885-cards.c index 972306704e55..1d1550a8116a 100644 --- a/drivers/media/pci/cx23885/cx23885-cards.c +++ b/drivers/media/pci/cx23885/cx23885-cards.c | |||
@@ -650,6 +650,11 @@ struct cx23885_board cx23885_boards[] = { | |||
650 | .amux = CX25840_AUDIO6, | 650 | .amux = CX25840_AUDIO6, |
651 | } }, | 651 | } }, |
652 | }, | 652 | }, |
653 | [CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP2] = { | ||
654 | .name = "DViCO FusionHDTV DVB-T Dual Express2", | ||
655 | .portb = CX23885_MPEG_DVB, | ||
656 | .portc = CX23885_MPEG_DVB, | ||
657 | }, | ||
653 | [CX23885_BOARD_HAUPPAUGE_IMPACTVCBE] = { | 658 | [CX23885_BOARD_HAUPPAUGE_IMPACTVCBE] = { |
654 | .name = "Hauppauge ImpactVCB-e", | 659 | .name = "Hauppauge ImpactVCB-e", |
655 | .tuner_type = TUNER_ABSENT, | 660 | .tuner_type = TUNER_ABSENT, |
@@ -920,6 +925,10 @@ struct cx23885_subid cx23885_subids[] = { | |||
920 | .subvendor = 0x0070, | 925 | .subvendor = 0x0070, |
921 | .subdevice = 0x7133, | 926 | .subdevice = 0x7133, |
922 | .card = CX23885_BOARD_HAUPPAUGE_IMPACTVCBE, | 927 | .card = CX23885_BOARD_HAUPPAUGE_IMPACTVCBE, |
928 | }, { | ||
929 | .subvendor = 0x18ac, | ||
930 | .subdevice = 0xdb98, | ||
931 | .card = CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP2, | ||
923 | }, | 932 | }, |
924 | }; | 933 | }; |
925 | const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids); | 934 | const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids); |
@@ -1163,6 +1172,7 @@ int cx23885_tuner_callback(void *priv, int component, int command, int arg) | |||
1163 | break; | 1172 | break; |
1164 | case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP: | 1173 | case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP: |
1165 | case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP: | 1174 | case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP: |
1175 | case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP2: | ||
1166 | /* Two identical tuners on two different i2c buses, | 1176 | /* Two identical tuners on two different i2c buses, |
1167 | * we need to reset the correct gpio. */ | 1177 | * we need to reset the correct gpio. */ |
1168 | if (port->nr == 1) | 1178 | if (port->nr == 1) |
@@ -1306,6 +1316,7 @@ void cx23885_gpio_setup(struct cx23885_dev *dev) | |||
1306 | cx_set(GP0_IO, 0x000f000f); | 1316 | cx_set(GP0_IO, 0x000f000f); |
1307 | break; | 1317 | break; |
1308 | case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP: | 1318 | case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP: |
1319 | case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP2: | ||
1309 | /* GPIO-0 portb xc3028 reset */ | 1320 | /* GPIO-0 portb xc3028 reset */ |
1310 | /* GPIO-1 portb zl10353 reset */ | 1321 | /* GPIO-1 portb zl10353 reset */ |
1311 | /* GPIO-2 portc xc3028 reset */ | 1322 | /* GPIO-2 portc xc3028 reset */ |
@@ -1611,6 +1622,7 @@ int cx23885_ir_init(struct cx23885_dev *dev) | |||
1611 | ir_rxtx_pin_cfg_count, ir_rxtx_pin_cfg); | 1622 | ir_rxtx_pin_cfg_count, ir_rxtx_pin_cfg); |
1612 | break; | 1623 | break; |
1613 | case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP: | 1624 | case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP: |
1625 | case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP2: | ||
1614 | request_module("ir-kbd-i2c"); | 1626 | request_module("ir-kbd-i2c"); |
1615 | break; | 1627 | break; |
1616 | } | 1628 | } |
@@ -1747,6 +1759,7 @@ void cx23885_card_setup(struct cx23885_dev *dev) | |||
1747 | break; | 1759 | break; |
1748 | case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP: | 1760 | case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP: |
1749 | case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP: | 1761 | case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP: |
1762 | case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP2: | ||
1750 | ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */ | 1763 | ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */ |
1751 | ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */ | 1764 | ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */ |
1752 | ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; | 1765 | ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; |
diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c b/drivers/media/pci/cx23885/cx23885-dvb.c index d037459f3d14..9135260f3457 100644 --- a/drivers/media/pci/cx23885/cx23885-dvb.c +++ b/drivers/media/pci/cx23885/cx23885-dvb.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include "tuner-xc2028.h" | 44 | #include "tuner-xc2028.h" |
45 | #include "tuner-simple.h" | 45 | #include "tuner-simple.h" |
46 | #include "dib7000p.h" | 46 | #include "dib7000p.h" |
47 | #include "dib0070.h" | ||
47 | #include "dibx000_common.h" | 48 | #include "dibx000_common.h" |
48 | #include "zl10353.h" | 49 | #include "zl10353.h" |
49 | #include "stv0900.h" | 50 | #include "stv0900.h" |
@@ -746,6 +747,106 @@ static int netup_altera_fpga_rw(void *device, int flag, int data, int read) | |||
746 | return 0; | 747 | return 0; |
747 | }; | 748 | }; |
748 | 749 | ||
750 | static int dib7070_tuner_reset(struct dvb_frontend *fe, int onoff) | ||
751 | { | ||
752 | struct dib7000p_ops *dib7000p_ops = fe->sec_priv; | ||
753 | |||
754 | return dib7000p_ops->set_gpio(fe, 8, 0, !onoff); | ||
755 | } | ||
756 | |||
757 | static int dib7070_tuner_sleep(struct dvb_frontend *fe, int onoff) | ||
758 | { | ||
759 | return 0; | ||
760 | } | ||
761 | |||
762 | static struct dib0070_config dib7070p_dib0070_config = { | ||
763 | .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS, | ||
764 | .reset = dib7070_tuner_reset, | ||
765 | .sleep = dib7070_tuner_sleep, | ||
766 | .clock_khz = 12000, | ||
767 | .freq_offset_khz_vhf = 950, | ||
768 | .freq_offset_khz_vhf = 550, | ||
769 | /* .flip_chip = 1, */ | ||
770 | }; | ||
771 | |||
772 | /* DIB7070 generic */ | ||
773 | static struct dibx000_agc_config dib7070_agc_config = { | ||
774 | .band_caps = BAND_UHF | BAND_VHF | BAND_LBAND | BAND_SBAND, | ||
775 | |||
776 | /* | ||
777 | * P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=5, | ||
778 | * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0, | ||
779 | * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0 | ||
780 | */ | ||
781 | .setup = (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | | ||
782 | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), | ||
783 | .inv_gain = 600, | ||
784 | .time_stabiliz = 10, | ||
785 | .alpha_level = 0, | ||
786 | .thlock = 118, | ||
787 | .wbd_inv = 0, | ||
788 | .wbd_ref = 3530, | ||
789 | .wbd_sel = 1, | ||
790 | .wbd_alpha = 5, | ||
791 | .agc1_max = 65535, | ||
792 | .agc1_min = 0, | ||
793 | .agc2_max = 65535, | ||
794 | .agc2_min = 0, | ||
795 | .agc1_pt1 = 0, | ||
796 | .agc1_pt2 = 40, | ||
797 | .agc1_pt3 = 183, | ||
798 | .agc1_slope1 = 206, | ||
799 | .agc1_slope2 = 255, | ||
800 | .agc2_pt1 = 72, | ||
801 | .agc2_pt2 = 152, | ||
802 | .agc2_slope1 = 88, | ||
803 | .agc2_slope2 = 90, | ||
804 | .alpha_mant = 17, | ||
805 | .alpha_exp = 27, | ||
806 | .beta_mant = 23, | ||
807 | .beta_exp = 51, | ||
808 | .perform_agc_softsplit = 0, | ||
809 | }; | ||
810 | |||
811 | static struct dibx000_bandwidth_config dib7070_bw_config_12_mhz = { | ||
812 | .internal = 60000, | ||
813 | .sampling = 15000, | ||
814 | .pll_prediv = 1, | ||
815 | .pll_ratio = 20, | ||
816 | .pll_range = 3, | ||
817 | .pll_reset = 1, | ||
818 | .pll_bypass = 0, | ||
819 | .enable_refdiv = 0, | ||
820 | .bypclk_div = 0, | ||
821 | .IO_CLK_en_core = 1, | ||
822 | .ADClkSrc = 1, | ||
823 | .modulo = 2, | ||
824 | /* refsel, sel, freq_15k */ | ||
825 | .sad_cfg = (3 << 14) | (1 << 12) | (524 << 0), | ||
826 | .ifreq = (0 << 25) | 0, | ||
827 | .timf = 20452225, | ||
828 | .xtal_hz = 12000000, | ||
829 | }; | ||
830 | |||
831 | static struct dib7000p_config dib7070p_dib7000p_config = { | ||
832 | /* .output_mode = OUTMODE_MPEG2_FIFO, */ | ||
833 | .output_mode = OUTMODE_MPEG2_SERIAL, | ||
834 | /* .output_mode = OUTMODE_MPEG2_PAR_GATED_CLK, */ | ||
835 | .output_mpeg2_in_188_bytes = 1, | ||
836 | |||
837 | .agc_config_count = 1, | ||
838 | .agc = &dib7070_agc_config, | ||
839 | .bw = &dib7070_bw_config_12_mhz, | ||
840 | .tuner_is_baseband = 1, | ||
841 | .spur_protect = 1, | ||
842 | |||
843 | .gpio_dir = 0xfcef, /* DIB7000P_GPIO_DEFAULT_DIRECTIONS, */ | ||
844 | .gpio_val = 0x0110, /* DIB7000P_GPIO_DEFAULT_VALUES, */ | ||
845 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, | ||
846 | |||
847 | .hostbus_diversity = 1, | ||
848 | }; | ||
849 | |||
749 | static int dvb_register(struct cx23885_tsport *port) | 850 | static int dvb_register(struct cx23885_tsport *port) |
750 | { | 851 | { |
751 | struct dib7000p_ops dib7000p_ops; | 852 | struct dib7000p_ops dib7000p_ops; |
@@ -993,6 +1094,30 @@ static int dvb_register(struct cx23885_tsport *port) | |||
993 | } | 1094 | } |
994 | break; | 1095 | break; |
995 | } | 1096 | } |
1097 | case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP2: { | ||
1098 | i2c_bus = &dev->i2c_bus[port->nr - 1]; | ||
1099 | /* cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0); */ | ||
1100 | /* cxusb_bluebird_gpio_pulse(adap->dev, 0x02, 1); */ | ||
1101 | |||
1102 | if (!dvb_attach(dib7000p_attach, &dib7000p_ops)) | ||
1103 | return -ENODEV; | ||
1104 | |||
1105 | if (dib7000p_ops.i2c_enumeration(&i2c_bus->i2c_adap, 1, 0x12, &dib7070p_dib7000p_config) < 0) { | ||
1106 | printk(KERN_WARNING "Unable to enumerate dib7000p\n"); | ||
1107 | return -ENODEV; | ||
1108 | } | ||
1109 | fe0->dvb.frontend = dib7000p_ops.init(&i2c_bus->i2c_adap, 0x80, &dib7070p_dib7000p_config); | ||
1110 | if (fe0->dvb.frontend != NULL) { | ||
1111 | struct i2c_adapter *tun_i2c; | ||
1112 | |||
1113 | fe0->dvb.frontend->sec_priv = kmalloc(sizeof(dib7000p_ops), GFP_KERNEL); | ||
1114 | memcpy(fe0->dvb.frontend->sec_priv, &dib7000p_ops, sizeof(dib7000p_ops)); | ||
1115 | tun_i2c = dib7000p_ops.get_i2c_master(fe0->dvb.frontend, DIBX000_I2C_INTERFACE_TUNER, 1); | ||
1116 | if (!dvb_attach(dib0070_attach, fe0->dvb.frontend, tun_i2c, &dib7070p_dib0070_config)) | ||
1117 | return -ENODEV; | ||
1118 | } | ||
1119 | break; | ||
1120 | } | ||
996 | case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H: | 1121 | case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H: |
997 | case CX23885_BOARD_COMPRO_VIDEOMATE_E650F: | 1122 | case CX23885_BOARD_COMPRO_VIDEOMATE_E650F: |
998 | case CX23885_BOARD_COMPRO_VIDEOMATE_E800: | 1123 | case CX23885_BOARD_COMPRO_VIDEOMATE_E800: |
diff --git a/drivers/media/pci/cx23885/cx23885.h b/drivers/media/pci/cx23885/cx23885.h index 6a4b20e5fcac..0e086c03da67 100644 --- a/drivers/media/pci/cx23885/cx23885.h +++ b/drivers/media/pci/cx23885/cx23885.h | |||
@@ -97,6 +97,7 @@ | |||
97 | #define CX23885_BOARD_TBS_6980 41 | 97 | #define CX23885_BOARD_TBS_6980 41 |
98 | #define CX23885_BOARD_LEADTEK_WINFAST_PXPVR2200 42 | 98 | #define CX23885_BOARD_LEADTEK_WINFAST_PXPVR2200 42 |
99 | #define CX23885_BOARD_HAUPPAUGE_IMPACTVCBE 43 | 99 | #define CX23885_BOARD_HAUPPAUGE_IMPACTVCBE 43 |
100 | #define CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP2 44 | ||
100 | 101 | ||
101 | #define GPIO_0 0x00000001 | 102 | #define GPIO_0 0x00000001 |
102 | #define GPIO_1 0x00000002 | 103 | #define GPIO_1 0x00000002 |