Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1 | /* Linux driver for devices based on the DiBcom DiB0700 USB bridge |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify it |
| 4 | * under the terms of the GNU General Public License as published by the Free |
| 5 | * Software Foundation, version 2. |
| 6 | * |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 7 | * Copyright (C) 2005-9 DiBcom, SA et al |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 8 | */ |
| 9 | #include "dib0700.h" |
| 10 | |
| 11 | #include "dib3000mc.h" |
Patrick Boettcher | 91bb9be | 2006-12-02 21:15:51 -0200 | [diff] [blame] | 12 | #include "dib7000m.h" |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 13 | #include "dib7000p.h" |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 14 | #include "dib8000.h" |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 15 | #include "dib9000.h" |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 16 | #include "mt2060.h" |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 17 | #include "mt2266.h" |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 18 | #include "tuner-xc2028.h" |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 19 | #include "xc5000.h" |
| 20 | #include "s5h1411.h" |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 21 | #include "dib0070.h" |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 22 | #include "dib0090.h" |
Michael Krufky | ce904bc | 2009-01-19 01:12:55 -0300 | [diff] [blame] | 23 | #include "lgdt3305.h" |
| 24 | #include "mxl5007t.h" |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 25 | |
Patrick Boettcher | 7fb3fc0 | 2006-09-20 04:37:18 -0300 | [diff] [blame] | 26 | static int force_lna_activation; |
| 27 | module_param(force_lna_activation, int, 0644); |
| 28 | MODULE_PARM_DESC(force_lna_activation, "force the activation of Low-Noise-Amplifyer(s) (LNA), " |
| 29 | "if applicable for the device (default: 0=automatic/off)."); |
| 30 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 31 | struct dib0700_adapter_state { |
| 32 | int (*set_param_save) (struct dvb_frontend *, struct dvb_frontend_parameters *); |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 33 | const struct firmware *frontend_firmware; |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 34 | }; |
| 35 | |
| 36 | /* Hauppauge Nova-T 500 (aka Bristol) |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 37 | * has a LNA on GPIO0 which is enabled by setting 1 */ |
| 38 | static struct mt2060_config bristol_mt2060_config[2] = { |
| 39 | { |
| 40 | .i2c_address = 0x60, |
Patrick Boettcher | 303cbea | 2006-09-19 12:51:56 -0300 | [diff] [blame] | 41 | .clock_out = 3, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 42 | }, { |
| 43 | .i2c_address = 0x61, |
| 44 | } |
| 45 | }; |
| 46 | |
Devin Heitmueller | 99afb98 | 2008-11-15 07:13:07 -0300 | [diff] [blame] | 47 | |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 48 | static struct dibx000_agc_config bristol_dib3000p_mt2060_agc_config = { |
| 49 | .band_caps = BAND_VHF | BAND_UHF, |
Patrick Boettcher | 01b4bf3 | 2006-09-19 12:51:53 -0300 | [diff] [blame] | 50 | .setup = (1 << 8) | (5 << 5) | (0 << 4) | (0 << 3) | (0 << 2) | (2 << 0), |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 51 | |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 52 | .agc1_max = 42598, |
| 53 | .agc1_min = 17694, |
| 54 | .agc2_max = 45875, |
| 55 | .agc2_min = 0, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 56 | |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 57 | .agc1_pt1 = 0, |
| 58 | .agc1_pt2 = 59, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 59 | |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 60 | .agc1_slope1 = 0, |
| 61 | .agc1_slope2 = 69, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 62 | |
| 63 | .agc2_pt1 = 0, |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 64 | .agc2_pt2 = 59, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 65 | |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 66 | .agc2_slope1 = 111, |
| 67 | .agc2_slope2 = 28, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 68 | }; |
| 69 | |
| 70 | static struct dib3000mc_config bristol_dib3000mc_config[2] = { |
| 71 | { .agc = &bristol_dib3000p_mt2060_agc_config, |
| 72 | .max_time = 0x196, |
| 73 | .ln_adc_level = 0x1cc7, |
| 74 | .output_mpeg2_in_188_bytes = 1, |
| 75 | }, |
| 76 | { .agc = &bristol_dib3000p_mt2060_agc_config, |
| 77 | .max_time = 0x196, |
| 78 | .ln_adc_level = 0x1cc7, |
| 79 | .output_mpeg2_in_188_bytes = 1, |
| 80 | } |
| 81 | }; |
| 82 | |
| 83 | static int bristol_frontend_attach(struct dvb_usb_adapter *adap) |
| 84 | { |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 85 | struct dib0700_state *st = adap->dev->priv; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 86 | if (adap->id == 0) { |
| 87 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(10); |
| 88 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10); |
| 89 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10); |
| 90 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(10); |
| 91 | |
Patrick Boettcher | 7fb3fc0 | 2006-09-20 04:37:18 -0300 | [diff] [blame] | 92 | if (force_lna_activation) |
| 93 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 94 | else |
| 95 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 0); |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 96 | |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 97 | if (dib3000mc_i2c_enumeration(&adap->dev->i2c_adap, 2, DEFAULT_DIB3000P_I2C_ADDRESS, bristol_dib3000mc_config) != 0) { |
| 98 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(10); |
| 99 | return -ENODEV; |
| 100 | } |
| 101 | } |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 102 | st->mt2060_if1[adap->id] = 1220; |
| 103 | return (adap->fe = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap, |
| 104 | (10 + adap->id) << 1, &bristol_dib3000mc_config[adap->id])) == NULL ? -ENODEV : 0; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 105 | } |
| 106 | |
Patrick Boettcher | 4a2b108 | 2008-01-25 07:32:58 -0300 | [diff] [blame] | 107 | static int eeprom_read(struct i2c_adapter *adap,u8 adrs,u8 *pval) |
Olivier DANET | c52344f | 2008-01-25 06:50:07 -0300 | [diff] [blame] | 108 | { |
| 109 | struct i2c_msg msg[2] = { |
| 110 | { .addr = 0x50, .flags = 0, .buf = &adrs, .len = 1 }, |
| 111 | { .addr = 0x50, .flags = I2C_M_RD, .buf = pval, .len = 1 }, |
| 112 | }; |
| 113 | if (i2c_transfer(adap, msg, 2) != 2) return -EREMOTEIO; |
| 114 | return 0; |
| 115 | } |
| 116 | |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 117 | static int bristol_tuner_attach(struct dvb_usb_adapter *adap) |
| 118 | { |
Olivier DANET | c52344f | 2008-01-25 06:50:07 -0300 | [diff] [blame] | 119 | struct i2c_adapter *prim_i2c = &adap->dev->i2c_adap; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 120 | struct i2c_adapter *tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe, 1); |
Olivier DANET | c52344f | 2008-01-25 06:50:07 -0300 | [diff] [blame] | 121 | s8 a; |
| 122 | int if1=1220; |
Al Viro | da5ee48 | 2008-05-21 00:31:21 -0300 | [diff] [blame] | 123 | if (adap->dev->udev->descriptor.idVendor == cpu_to_le16(USB_VID_HAUPPAUGE) && |
| 124 | adap->dev->udev->descriptor.idProduct == cpu_to_le16(USB_PID_HAUPPAUGE_NOVA_T_500_2)) { |
Olivier DANET | c52344f | 2008-01-25 06:50:07 -0300 | [diff] [blame] | 125 | if (!eeprom_read(prim_i2c,0x59 + adap->id,&a)) if1=1220+a; |
| 126 | } |
| 127 | return dvb_attach(mt2060_attach,adap->fe, tun_i2c,&bristol_mt2060_config[adap->id], |
| 128 | if1) == NULL ? -ENODEV : 0; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 129 | } |
| 130 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 131 | /* STK7700D: Pinnacle/Terratec/Hauppauge Dual DVB-T Diversity */ |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 132 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 133 | /* MT226x */ |
| 134 | static struct dibx000_agc_config stk7700d_7000p_mt2266_agc_config[2] = { |
| 135 | { |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 136 | BAND_UHF, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 137 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 138 | /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1, P_agc_inv_pwm1=1, P_agc_inv_pwm2=1, |
| 139 | * 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 */ |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 140 | (0 << 15) | (0 << 14) | (1 << 11) | (1 << 10) | (1 << 9) | (0 << 8) |
| 141 | | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 142 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 143 | 1130, |
| 144 | 21, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 145 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 146 | 0, |
| 147 | 118, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 148 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 149 | 0, |
| 150 | 3530, |
| 151 | 1, |
| 152 | 0, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 153 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 154 | 65535, |
| 155 | 33770, |
| 156 | 65535, |
| 157 | 23592, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 158 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 159 | 0, |
| 160 | 62, |
| 161 | 255, |
| 162 | 64, |
| 163 | 64, |
| 164 | 132, |
| 165 | 192, |
| 166 | 80, |
| 167 | 80, |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 168 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 169 | 17, |
| 170 | 27, |
| 171 | 23, |
| 172 | 51, |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 173 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 174 | 1, |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 175 | }, { |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 176 | BAND_VHF | BAND_LBAND, |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 177 | |
| 178 | /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1, P_agc_inv_pwm1=1, P_agc_inv_pwm2=1, |
| 179 | * 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 */ |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 180 | (0 << 15) | (0 << 14) | (1 << 11) | (1 << 10) | (1 << 9) | (0 << 8) |
| 181 | | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 182 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 183 | 2372, |
| 184 | 21, |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 185 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 186 | 0, |
| 187 | 118, |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 188 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 189 | 0, |
| 190 | 3530, |
| 191 | 1, |
| 192 | 0, |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 193 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 194 | 65535, |
| 195 | 0, |
| 196 | 65535, |
| 197 | 23592, |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 198 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 199 | 0, |
| 200 | 128, |
| 201 | 128, |
| 202 | 128, |
| 203 | 0, |
| 204 | 128, |
| 205 | 253, |
| 206 | 81, |
| 207 | 0, |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 208 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 209 | 17, |
| 210 | 27, |
| 211 | 23, |
| 212 | 51, |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 213 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 214 | 1, |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 215 | } |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 216 | }; |
| 217 | |
| 218 | static struct dibx000_bandwidth_config stk7700d_mt2266_pll_config = { |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 219 | 60000, 30000, |
| 220 | 1, 8, 3, 1, 0, |
| 221 | 0, 0, 1, 1, 2, |
| 222 | (3 << 14) | (1 << 12) | (524 << 0), |
| 223 | 0, |
| 224 | 20452225, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 225 | }; |
| 226 | |
| 227 | static struct dib7000p_config stk7700d_dib7000p_mt2266_config[] = { |
| 228 | { .output_mpeg2_in_188_bytes = 1, |
| 229 | .hostbus_diversity = 1, |
| 230 | .tuner_is_baseband = 1, |
| 231 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 232 | .agc_config_count = 2, |
| 233 | .agc = stk7700d_7000p_mt2266_agc_config, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 234 | .bw = &stk7700d_mt2266_pll_config, |
| 235 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 236 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
| 237 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, |
| 238 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 239 | }, |
| 240 | { .output_mpeg2_in_188_bytes = 1, |
| 241 | .hostbus_diversity = 1, |
| 242 | .tuner_is_baseband = 1, |
| 243 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 244 | .agc_config_count = 2, |
| 245 | .agc = stk7700d_7000p_mt2266_agc_config, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 246 | .bw = &stk7700d_mt2266_pll_config, |
| 247 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 248 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
| 249 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, |
| 250 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 251 | } |
| 252 | }; |
| 253 | |
| 254 | static struct mt2266_config stk7700d_mt2266_config[2] = { |
| 255 | { .i2c_address = 0x60 |
| 256 | }, |
| 257 | { .i2c_address = 0x60 |
| 258 | } |
| 259 | }; |
| 260 | |
Daniel Gimpelevich | 132c318 | 2008-01-25 06:02:42 -0300 | [diff] [blame] | 261 | static int stk7700P2_frontend_attach(struct dvb_usb_adapter *adap) |
| 262 | { |
| 263 | if (adap->id == 0) { |
| 264 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 265 | msleep(10); |
| 266 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 267 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 268 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 269 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 270 | msleep(10); |
| 271 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 272 | msleep(10); |
Devin Heitmueller | 83c4fdf | 2009-01-21 01:55:45 -0300 | [diff] [blame] | 273 | if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, |
| 274 | stk7700d_dib7000p_mt2266_config) |
| 275 | != 0) { |
| 276 | err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", __func__); |
| 277 | return -ENODEV; |
| 278 | } |
Daniel Gimpelevich | 132c318 | 2008-01-25 06:02:42 -0300 | [diff] [blame] | 279 | } |
| 280 | |
| 281 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap,0x80+(adap->id << 1), |
| 282 | &stk7700d_dib7000p_mt2266_config[adap->id]); |
| 283 | |
| 284 | return adap->fe == NULL ? -ENODEV : 0; |
| 285 | } |
| 286 | |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 287 | static int stk7700d_frontend_attach(struct dvb_usb_adapter *adap) |
| 288 | { |
| 289 | if (adap->id == 0) { |
| 290 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 291 | msleep(10); |
| 292 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 293 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 294 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 295 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 296 | msleep(10); |
| 297 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 298 | msleep(10); |
| 299 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
Devin Heitmueller | 83c4fdf | 2009-01-21 01:55:45 -0300 | [diff] [blame] | 300 | if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 2, 18, |
| 301 | stk7700d_dib7000p_mt2266_config) |
| 302 | != 0) { |
| 303 | err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", __func__); |
| 304 | return -ENODEV; |
| 305 | } |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 306 | } |
| 307 | |
| 308 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap,0x80+(adap->id << 1), |
| 309 | &stk7700d_dib7000p_mt2266_config[adap->id]); |
| 310 | |
| 311 | return adap->fe == NULL ? -ENODEV : 0; |
| 312 | } |
| 313 | |
| 314 | static int stk7700d_tuner_attach(struct dvb_usb_adapter *adap) |
| 315 | { |
| 316 | struct i2c_adapter *tun_i2c; |
| 317 | tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); |
| 318 | return dvb_attach(mt2266_attach, adap->fe, tun_i2c, |
Joe Perches | 1ebcad7 | 2009-07-02 15:57:09 -0300 | [diff] [blame] | 319 | &stk7700d_mt2266_config[adap->id]) == NULL ? -ENODEV : 0; |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 320 | } |
| 321 | |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 322 | /* STK7700-PH: Digital/Analog Hybrid Tuner, e.h. Cinergy HT USB HE */ |
Harvey Harrison | b1721d0 | 2008-04-25 19:03:08 -0700 | [diff] [blame] | 323 | static struct dibx000_agc_config xc3028_agc_config = { |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 324 | BAND_VHF | BAND_UHF, /* band_caps */ |
| 325 | |
| 326 | /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=0, |
| 327 | * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0, |
| 328 | * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */ |
| 329 | (0 << 15) | (0 << 14) | (0 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | |
| 330 | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), /* setup */ |
| 331 | |
| 332 | 712, /* inv_gain */ |
| 333 | 21, /* time_stabiliz */ |
| 334 | |
| 335 | 0, /* alpha_level */ |
| 336 | 118, /* thlock */ |
| 337 | |
| 338 | 0, /* wbd_inv */ |
| 339 | 2867, /* wbd_ref */ |
| 340 | 0, /* wbd_sel */ |
| 341 | 2, /* wbd_alpha */ |
| 342 | |
| 343 | 0, /* agc1_max */ |
| 344 | 0, /* agc1_min */ |
| 345 | 39718, /* agc2_max */ |
| 346 | 9930, /* agc2_min */ |
| 347 | 0, /* agc1_pt1 */ |
| 348 | 0, /* agc1_pt2 */ |
| 349 | 0, /* agc1_pt3 */ |
| 350 | 0, /* agc1_slope1 */ |
| 351 | 0, /* agc1_slope2 */ |
| 352 | 0, /* agc2_pt1 */ |
| 353 | 128, /* agc2_pt2 */ |
| 354 | 29, /* agc2_slope1 */ |
| 355 | 29, /* agc2_slope2 */ |
| 356 | |
| 357 | 17, /* alpha_mant */ |
| 358 | 27, /* alpha_exp */ |
| 359 | 23, /* beta_mant */ |
| 360 | 51, /* beta_exp */ |
| 361 | |
| 362 | 1, /* perform_agc_softsplit */ |
| 363 | }; |
| 364 | |
| 365 | /* PLL Configuration for COFDM BW_MHz = 8.00 with external clock = 30.00 */ |
Harvey Harrison | b1721d0 | 2008-04-25 19:03:08 -0700 | [diff] [blame] | 366 | static struct dibx000_bandwidth_config xc3028_bw_config = { |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 367 | 60000, 30000, /* internal, sampling */ |
| 368 | 1, 8, 3, 1, 0, /* pll_cfg: prediv, ratio, range, reset, bypass */ |
| 369 | 0, 0, 1, 1, 0, /* misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, |
| 370 | modulo */ |
| 371 | (3 << 14) | (1 << 12) | (524 << 0), /* sad_cfg: refsel, sel, freq_15k */ |
| 372 | (1 << 25) | 5816102, /* ifreq = 5.200000 MHz */ |
| 373 | 20452225, /* timf */ |
| 374 | 30000000, /* xtal_hz */ |
| 375 | }; |
| 376 | |
| 377 | static struct dib7000p_config stk7700ph_dib7700_xc3028_config = { |
| 378 | .output_mpeg2_in_188_bytes = 1, |
| 379 | .tuner_is_baseband = 1, |
| 380 | |
| 381 | .agc_config_count = 1, |
| 382 | .agc = &xc3028_agc_config, |
| 383 | .bw = &xc3028_bw_config, |
| 384 | |
| 385 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
| 386 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, |
| 387 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
| 388 | }; |
| 389 | |
Michael Krufky | d7cba04 | 2008-09-12 13:31:45 -0300 | [diff] [blame] | 390 | static int stk7700ph_xc3028_callback(void *ptr, int component, |
| 391 | int command, int arg) |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 392 | { |
| 393 | struct dvb_usb_adapter *adap = ptr; |
| 394 | |
| 395 | switch (command) { |
| 396 | case XC2028_TUNER_RESET: |
| 397 | /* Send the tuner in then out of reset */ |
| 398 | dib7000p_set_gpio(adap->fe, 8, 0, 0); msleep(10); |
| 399 | dib7000p_set_gpio(adap->fe, 8, 0, 1); |
| 400 | break; |
| 401 | case XC2028_RESET_CLK: |
| 402 | break; |
| 403 | default: |
| 404 | err("%s: unknown command %d, arg %d\n", __func__, |
| 405 | command, arg); |
| 406 | return -EINVAL; |
| 407 | } |
| 408 | return 0; |
| 409 | } |
| 410 | |
| 411 | static struct xc2028_ctrl stk7700ph_xc3028_ctrl = { |
| 412 | .fname = XC2028_DEFAULT_FIRMWARE, |
| 413 | .max_len = 64, |
| 414 | .demod = XC3028_FE_DIBCOM52, |
| 415 | }; |
| 416 | |
| 417 | static struct xc2028_config stk7700ph_xc3028_config = { |
| 418 | .i2c_addr = 0x61, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 419 | .ctrl = &stk7700ph_xc3028_ctrl, |
| 420 | }; |
| 421 | |
| 422 | static int stk7700ph_frontend_attach(struct dvb_usb_adapter *adap) |
| 423 | { |
| 424 | struct usb_device_descriptor *desc = &adap->dev->udev->descriptor; |
| 425 | |
Al Viro | da5ee48 | 2008-05-21 00:31:21 -0300 | [diff] [blame] | 426 | if (desc->idVendor == cpu_to_le16(USB_VID_PINNACLE) && |
| 427 | desc->idProduct == cpu_to_le16(USB_PID_PINNACLE_EXPRESSCARD_320CX)) |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 428 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); |
| 429 | else |
| 430 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 431 | msleep(20); |
| 432 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 433 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 434 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 435 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 436 | msleep(10); |
| 437 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 438 | msleep(20); |
| 439 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 440 | msleep(10); |
| 441 | |
Devin Heitmueller | 83c4fdf | 2009-01-21 01:55:45 -0300 | [diff] [blame] | 442 | if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, |
| 443 | &stk7700ph_dib7700_xc3028_config) != 0) { |
| 444 | err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", |
| 445 | __func__); |
| 446 | return -ENODEV; |
| 447 | } |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 448 | |
| 449 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, |
| 450 | &stk7700ph_dib7700_xc3028_config); |
| 451 | |
| 452 | return adap->fe == NULL ? -ENODEV : 0; |
| 453 | } |
| 454 | |
| 455 | static int stk7700ph_tuner_attach(struct dvb_usb_adapter *adap) |
| 456 | { |
| 457 | struct i2c_adapter *tun_i2c; |
| 458 | |
| 459 | tun_i2c = dib7000p_get_i2c_master(adap->fe, |
| 460 | DIBX000_I2C_INTERFACE_TUNER, 1); |
| 461 | |
| 462 | stk7700ph_xc3028_config.i2c_adap = tun_i2c; |
Michael Krufky | d7cba04 | 2008-09-12 13:31:45 -0300 | [diff] [blame] | 463 | |
| 464 | /* FIXME: generalize & move to common area */ |
| 465 | adap->fe->callback = stk7700ph_xc3028_callback; |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 466 | |
| 467 | return dvb_attach(xc2028_attach, adap->fe, &stk7700ph_xc3028_config) |
| 468 | == NULL ? -ENODEV : 0; |
| 469 | } |
| 470 | |
Devin Heitmueller | 4b330be | 2008-12-01 06:51:14 -0300 | [diff] [blame] | 471 | #define DEFAULT_RC_INTERVAL 50 |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 472 | |
| 473 | static u8 rc_request[] = { REQUEST_POLL_RC, 0 }; |
| 474 | |
Patrick Boettcher | 58e6f95 | 2008-03-29 21:37:01 -0300 | [diff] [blame] | 475 | /* Number of keypresses to ignore before start repeating */ |
Devin Heitmueller | 4b330be | 2008-12-01 06:51:14 -0300 | [diff] [blame] | 476 | #define RC_REPEAT_DELAY 6 |
Patrick Boettcher | 58e6f95 | 2008-03-29 21:37:01 -0300 | [diff] [blame] | 477 | |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 478 | /* |
| 479 | * This function is used only when firmware is < 1.20 version. Newer |
| 480 | * firmwares use bulk mode, with functions implemented at dib0700_core, |
| 481 | * at dib0700_rc_urb_completion() |
| 482 | */ |
| 483 | static int dib0700_rc_query_old_firmware(struct dvb_usb_device *d) |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 484 | { |
| 485 | u8 key[4]; |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 486 | u32 keycode; |
| 487 | u8 toggle; |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 488 | int i; |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 489 | struct dib0700_state *st = d->priv; |
Devin Heitmueller | 6a20710 | 2010-01-04 02:43:19 -0300 | [diff] [blame] | 490 | |
Devin Heitmueller | 6a20710 | 2010-01-04 02:43:19 -0300 | [diff] [blame] | 491 | if (st->fw_version >= 0x10200) { |
| 492 | /* For 1.20 firmware , We need to keep the RC polling |
| 493 | callback so we can reuse the input device setup in |
| 494 | dvb-usb-remote.c. However, the actual work is being done |
| 495 | in the bulk URB completion handler. */ |
| 496 | return 0; |
| 497 | } |
| 498 | |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 499 | i = dib0700_ctrl_rd(d, rc_request, 2, key, 4); |
| 500 | if (i <= 0) { |
Janne Grunau | 034d65e | 2007-07-31 08:48:40 -0300 | [diff] [blame] | 501 | err("RC Query Failed"); |
Janne Grunau | 89f4267 | 2007-07-31 19:45:13 -0300 | [diff] [blame] | 502 | return -1; |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 503 | } |
Patrick Boettcher | 58e6f95 | 2008-03-29 21:37:01 -0300 | [diff] [blame] | 504 | |
| 505 | /* losing half of KEY_0 events from Philipps rc5 remotes.. */ |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 506 | if (key[0] == 0 && key[1] == 0 && key[2] == 0 && key[3] == 0) |
| 507 | return 0; |
Patrick Boettcher | 58e6f95 | 2008-03-29 21:37:01 -0300 | [diff] [blame] | 508 | |
| 509 | /* info("%d: %2X %2X %2X %2X",dvb_usb_dib0700_ir_proto,(int)key[3-2],(int)key[3-3],(int)key[3-1],(int)key[3]); */ |
| 510 | |
| 511 | dib0700_rc_setup(d); /* reset ir sensor data to prevent false events */ |
| 512 | |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 513 | d->last_event = 0; |
Mauro Carvalho Chehab | 0ffd1ab | 2010-08-01 09:37:23 -0300 | [diff] [blame] | 514 | switch (d->props.rc.core.protocol) { |
Mauro Carvalho Chehab | 52b6614 | 2010-11-17 14:20:52 -0300 | [diff] [blame] | 515 | case RC_TYPE_NEC: |
Patrick Boettcher | 58e6f95 | 2008-03-29 21:37:01 -0300 | [diff] [blame] | 516 | /* NEC protocol sends repeat code as 0 0 0 FF */ |
| 517 | if ((key[3-2] == 0x00) && (key[3-3] == 0x00) && |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 518 | (key[3] == 0xff)) |
| 519 | keycode = d->last_event; |
| 520 | else { |
| 521 | keycode = key[3-2] << 8 | key[3-3]; |
| 522 | d->last_event = keycode; |
Patrick Boettcher | 58e6f95 | 2008-03-29 21:37:01 -0300 | [diff] [blame] | 523 | } |
Patrick Boettcher | 58e6f95 | 2008-03-29 21:37:01 -0300 | [diff] [blame] | 524 | |
Mauro Carvalho Chehab | ca86674 | 2010-11-17 13:53:11 -0300 | [diff] [blame] | 525 | rc_keydown(d->rc_dev, keycode, 0); |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 526 | break; |
| 527 | default: |
| 528 | /* RC-5 protocol changes toggle bit on new keypress */ |
| 529 | keycode = key[3-2] << 8 | key[3-3]; |
| 530 | toggle = key[3-1]; |
Mauro Carvalho Chehab | ca86674 | 2010-11-17 13:53:11 -0300 | [diff] [blame] | 531 | rc_keydown(d->rc_dev, keycode, toggle); |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 532 | |
Patrick Boettcher | 58e6f95 | 2008-03-29 21:37:01 -0300 | [diff] [blame] | 533 | break; |
| 534 | } |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 535 | return 0; |
| 536 | } |
| 537 | |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 538 | /* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */ |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 539 | static struct dibx000_agc_config stk7700p_7000m_mt2060_agc_config = { |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 540 | BAND_UHF | BAND_VHF, |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 541 | |
| 542 | /* 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, |
| 543 | * 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 */ |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 544 | (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) |
| 545 | | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 546 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 547 | 712, |
| 548 | 41, |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 549 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 550 | 0, |
| 551 | 118, |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 552 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 553 | 0, |
| 554 | 4095, |
| 555 | 0, |
| 556 | 0, |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 557 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 558 | 42598, |
| 559 | 17694, |
| 560 | 45875, |
| 561 | 2621, |
| 562 | 0, |
| 563 | 76, |
| 564 | 139, |
| 565 | 52, |
| 566 | 59, |
| 567 | 107, |
| 568 | 172, |
| 569 | 57, |
| 570 | 70, |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 571 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 572 | 21, |
| 573 | 25, |
| 574 | 28, |
| 575 | 48, |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 576 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 577 | 1, |
| 578 | { 0, |
| 579 | 107, |
| 580 | 51800, |
| 581 | 24700 |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 582 | }, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 583 | }; |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 584 | |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 585 | static struct dibx000_agc_config stk7700p_7000p_mt2060_agc_config = { |
| 586 | BAND_UHF | BAND_VHF, |
| 587 | |
| 588 | /* 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, |
| 589 | * 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 */ |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 590 | (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) |
| 591 | | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 592 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 593 | 712, |
| 594 | 41, |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 595 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 596 | 0, |
| 597 | 118, |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 598 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 599 | 0, |
| 600 | 4095, |
| 601 | 0, |
| 602 | 0, |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 603 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 604 | 42598, |
| 605 | 16384, |
| 606 | 42598, |
| 607 | 0, |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 608 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 609 | 0, |
| 610 | 137, |
| 611 | 255, |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 612 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 613 | 0, |
| 614 | 255, |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 615 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 616 | 0, |
| 617 | 0, |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 618 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 619 | 0, |
| 620 | 41, |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 621 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 622 | 15, |
| 623 | 25, |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 624 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 625 | 28, |
| 626 | 48, |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 627 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 628 | 0, |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 629 | }; |
| 630 | |
| 631 | static struct dibx000_bandwidth_config stk7700p_pll_config = { |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 632 | 60000, 30000, |
| 633 | 1, 8, 3, 1, 0, |
| 634 | 0, 0, 1, 1, 0, |
| 635 | (3 << 14) | (1 << 12) | (524 << 0), |
| 636 | 60258167, |
| 637 | 20452225, |
| 638 | 30000000, |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 639 | }; |
| 640 | |
| 641 | static struct dib7000m_config stk7700p_dib7000m_config = { |
| 642 | .dvbt_mode = 1, |
| 643 | .output_mpeg2_in_188_bytes = 1, |
| 644 | .quartz_direct = 1, |
| 645 | |
| 646 | .agc_config_count = 1, |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 647 | .agc = &stk7700p_7000m_mt2060_agc_config, |
| 648 | .bw = &stk7700p_pll_config, |
| 649 | |
| 650 | .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS, |
| 651 | .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES, |
| 652 | .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS, |
| 653 | }; |
| 654 | |
| 655 | static struct dib7000p_config stk7700p_dib7000p_config = { |
| 656 | .output_mpeg2_in_188_bytes = 1, |
| 657 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 658 | .agc_config_count = 1, |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 659 | .agc = &stk7700p_7000p_mt2060_agc_config, |
| 660 | .bw = &stk7700p_pll_config, |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 661 | |
| 662 | .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS, |
| 663 | .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES, |
| 664 | .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS, |
| 665 | }; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 666 | |
| 667 | static int stk7700p_frontend_attach(struct dvb_usb_adapter *adap) |
| 668 | { |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 669 | struct dib0700_state *st = adap->dev->priv; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 670 | /* unless there is no real power management in DVB - we leave the device on GPIO6 */ |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 671 | |
| 672 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 673 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(50); |
| 674 | |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 675 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10); |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 676 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 677 | |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 678 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10); |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 679 | dib0700_ctrl_clock(adap->dev, 72, 1); |
| 680 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(100); |
| 681 | |
| 682 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 683 | |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 684 | st->mt2060_if1[0] = 1220; |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 685 | |
| 686 | if (dib7000pc_detection(&adap->dev->i2c_adap)) { |
| 687 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000p_config); |
| 688 | st->is_dib7000pc = 1; |
| 689 | } else |
| 690 | adap->fe = dvb_attach(dib7000m_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000m_config); |
| 691 | |
| 692 | return adap->fe == NULL ? -ENODEV : 0; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 693 | } |
| 694 | |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 695 | static struct mt2060_config stk7700p_mt2060_config = { |
| 696 | 0x60 |
| 697 | }; |
| 698 | |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 699 | static int stk7700p_tuner_attach(struct dvb_usb_adapter *adap) |
| 700 | { |
Olivier DANET | c52344f | 2008-01-25 06:50:07 -0300 | [diff] [blame] | 701 | struct i2c_adapter *prim_i2c = &adap->dev->i2c_adap; |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 702 | struct dib0700_state *st = adap->dev->priv; |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 703 | struct i2c_adapter *tun_i2c; |
Olivier DANET | c52344f | 2008-01-25 06:50:07 -0300 | [diff] [blame] | 704 | s8 a; |
| 705 | int if1=1220; |
Al Viro | da5ee48 | 2008-05-21 00:31:21 -0300 | [diff] [blame] | 706 | if (adap->dev->udev->descriptor.idVendor == cpu_to_le16(USB_VID_HAUPPAUGE) && |
| 707 | adap->dev->udev->descriptor.idProduct == cpu_to_le16(USB_PID_HAUPPAUGE_NOVA_T_STICK)) { |
Olivier DANET | c52344f | 2008-01-25 06:50:07 -0300 | [diff] [blame] | 708 | if (!eeprom_read(prim_i2c,0x58,&a)) if1=1220+a; |
| 709 | } |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 710 | if (st->is_dib7000pc) |
| 711 | tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); |
| 712 | else |
| 713 | tun_i2c = dib7000m_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); |
| 714 | |
| 715 | return dvb_attach(mt2060_attach, adap->fe, tun_i2c, &stk7700p_mt2060_config, |
Olivier DANET | c52344f | 2008-01-25 06:50:07 -0300 | [diff] [blame] | 716 | if1) == NULL ? -ENODEV : 0; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 717 | } |
| 718 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 719 | /* DIB7070 generic */ |
| 720 | static struct dibx000_agc_config dib7070_agc_config = { |
| 721 | BAND_UHF | BAND_VHF | BAND_LBAND | BAND_SBAND, |
| 722 | /* 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, |
| 723 | * 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 */ |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 724 | (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) |
| 725 | | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 726 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 727 | 600, |
| 728 | 10, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 729 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 730 | 0, |
| 731 | 118, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 732 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 733 | 0, |
| 734 | 3530, |
| 735 | 1, |
| 736 | 5, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 737 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 738 | 65535, |
| 739 | 0, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 740 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 741 | 65535, |
| 742 | 0, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 743 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 744 | 0, |
| 745 | 40, |
| 746 | 183, |
| 747 | 206, |
| 748 | 255, |
| 749 | 72, |
| 750 | 152, |
| 751 | 88, |
| 752 | 90, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 753 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 754 | 17, |
| 755 | 27, |
| 756 | 23, |
| 757 | 51, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 758 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 759 | 0, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 760 | }; |
| 761 | |
| 762 | static int dib7070_tuner_reset(struct dvb_frontend *fe, int onoff) |
| 763 | { |
Patrick Boettcher | 7e5ce65 | 2009-08-03 13:43:40 -0300 | [diff] [blame] | 764 | deb_info("reset: %d", onoff); |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 765 | return dib7000p_set_gpio(fe, 8, 0, !onoff); |
| 766 | } |
| 767 | |
| 768 | static int dib7070_tuner_sleep(struct dvb_frontend *fe, int onoff) |
| 769 | { |
Patrick Boettcher | 7e5ce65 | 2009-08-03 13:43:40 -0300 | [diff] [blame] | 770 | deb_info("sleep: %d", onoff); |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 771 | return dib7000p_set_gpio(fe, 9, 0, onoff); |
| 772 | } |
| 773 | |
| 774 | static struct dib0070_config dib7070p_dib0070_config[2] = { |
| 775 | { |
| 776 | .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS, |
| 777 | .reset = dib7070_tuner_reset, |
| 778 | .sleep = dib7070_tuner_sleep, |
| 779 | .clock_khz = 12000, |
Patrick Boettcher | 7e5ce65 | 2009-08-03 13:43:40 -0300 | [diff] [blame] | 780 | .clock_pad_drive = 4, |
| 781 | .charge_pump = 2, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 782 | }, { |
| 783 | .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS, |
| 784 | .reset = dib7070_tuner_reset, |
| 785 | .sleep = dib7070_tuner_sleep, |
| 786 | .clock_khz = 12000, |
Patrick Boettcher | 7e5ce65 | 2009-08-03 13:43:40 -0300 | [diff] [blame] | 787 | .charge_pump = 2, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 788 | } |
| 789 | }; |
| 790 | |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 791 | static struct dib0070_config dib7770p_dib0070_config = { |
| 792 | .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS, |
| 793 | .reset = dib7070_tuner_reset, |
| 794 | .sleep = dib7070_tuner_sleep, |
| 795 | .clock_khz = 12000, |
| 796 | .clock_pad_drive = 0, |
| 797 | .flip_chip = 1, |
Olivier Grenie | eac1fe1 | 2009-09-23 13:41:27 -0300 | [diff] [blame] | 798 | .charge_pump = 2, |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 799 | }; |
| 800 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 801 | static int dib7070_set_param_override(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep) |
| 802 | { |
| 803 | struct dvb_usb_adapter *adap = fe->dvb->priv; |
| 804 | struct dib0700_adapter_state *state = adap->priv; |
| 805 | |
| 806 | u16 offset; |
| 807 | u8 band = BAND_OF_FREQUENCY(fep->frequency/1000); |
| 808 | switch (band) { |
| 809 | case BAND_VHF: offset = 950; break; |
| 810 | case BAND_UHF: |
| 811 | default: offset = 550; break; |
| 812 | } |
| 813 | deb_info("WBD for DiB7000P: %d\n", offset + dib0070_wbd_offset(fe)); |
| 814 | dib7000p_set_wbd_ref(fe, offset + dib0070_wbd_offset(fe)); |
| 815 | return state->set_param_save(fe, fep); |
| 816 | } |
| 817 | |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 818 | static int dib7770_set_param_override(struct dvb_frontend *fe, |
| 819 | struct dvb_frontend_parameters *fep) |
| 820 | { |
| 821 | struct dvb_usb_adapter *adap = fe->dvb->priv; |
| 822 | struct dib0700_adapter_state *state = adap->priv; |
| 823 | |
| 824 | u16 offset; |
| 825 | u8 band = BAND_OF_FREQUENCY(fep->frequency/1000); |
| 826 | switch (band) { |
| 827 | case BAND_VHF: |
| 828 | dib7000p_set_gpio(fe, 0, 0, 1); |
| 829 | offset = 850; |
| 830 | break; |
| 831 | case BAND_UHF: |
| 832 | default: |
| 833 | dib7000p_set_gpio(fe, 0, 0, 0); |
| 834 | offset = 250; |
| 835 | break; |
| 836 | } |
| 837 | deb_info("WBD for DiB7000P: %d\n", offset + dib0070_wbd_offset(fe)); |
| 838 | dib7000p_set_wbd_ref(fe, offset + dib0070_wbd_offset(fe)); |
| 839 | return state->set_param_save(fe, fep); |
| 840 | } |
| 841 | |
| 842 | static int dib7770p_tuner_attach(struct dvb_usb_adapter *adap) |
| 843 | { |
| 844 | struct dib0700_adapter_state *st = adap->priv; |
| 845 | struct i2c_adapter *tun_i2c = dib7000p_get_i2c_master(adap->fe, |
| 846 | DIBX000_I2C_INTERFACE_TUNER, 1); |
| 847 | |
| 848 | if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, |
| 849 | &dib7770p_dib0070_config) == NULL) |
| 850 | return -ENODEV; |
| 851 | |
| 852 | st->set_param_save = adap->fe->ops.tuner_ops.set_params; |
| 853 | adap->fe->ops.tuner_ops.set_params = dib7770_set_param_override; |
| 854 | return 0; |
| 855 | } |
| 856 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 857 | static int dib7070p_tuner_attach(struct dvb_usb_adapter *adap) |
| 858 | { |
| 859 | struct dib0700_adapter_state *st = adap->priv; |
| 860 | struct i2c_adapter *tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); |
| 861 | |
| 862 | if (adap->id == 0) { |
| 863 | if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, &dib7070p_dib0070_config[0]) == NULL) |
| 864 | return -ENODEV; |
| 865 | } else { |
| 866 | if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, &dib7070p_dib0070_config[1]) == NULL) |
| 867 | return -ENODEV; |
| 868 | } |
| 869 | |
| 870 | st->set_param_save = adap->fe->ops.tuner_ops.set_params; |
| 871 | adap->fe->ops.tuner_ops.set_params = dib7070_set_param_override; |
| 872 | return 0; |
| 873 | } |
| 874 | |
Olivier Grenie | e192a7c | 2011-01-14 13:58:59 -0300 | [diff] [blame] | 875 | static int stk7700p_pid_filter(struct dvb_usb_adapter *adapter, int index, |
| 876 | u16 pid, int onoff) |
| 877 | { |
| 878 | struct dib0700_state *st = adapter->dev->priv; |
| 879 | if (st->is_dib7000pc) |
| 880 | return dib7000p_pid_filter(adapter->fe, index, pid, onoff); |
| 881 | return dib7000m_pid_filter(adapter->fe, index, pid, onoff); |
| 882 | } |
| 883 | |
| 884 | static int stk7700p_pid_filter_ctrl(struct dvb_usb_adapter *adapter, int onoff) |
| 885 | { |
| 886 | struct dib0700_state *st = adapter->dev->priv; |
| 887 | if (st->is_dib7000pc) |
| 888 | return dib7000p_pid_filter_ctrl(adapter->fe, onoff); |
| 889 | return dib7000m_pid_filter_ctrl(adapter->fe, onoff); |
| 890 | } |
| 891 | |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 892 | static int stk70x0p_pid_filter(struct dvb_usb_adapter *adapter, int index, u16 pid, int onoff) |
| 893 | { |
| 894 | return dib7000p_pid_filter(adapter->fe, index, pid, onoff); |
| 895 | } |
| 896 | |
| 897 | static int stk70x0p_pid_filter_ctrl(struct dvb_usb_adapter *adapter, int onoff) |
| 898 | { |
| 899 | return dib7000p_pid_filter_ctrl(adapter->fe, onoff); |
| 900 | } |
| 901 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 902 | static struct dibx000_bandwidth_config dib7070_bw_config_12_mhz = { |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 903 | 60000, 15000, |
| 904 | 1, 20, 3, 1, 0, |
| 905 | 0, 0, 1, 1, 2, |
| 906 | (3 << 14) | (1 << 12) | (524 << 0), |
| 907 | (0 << 25) | 0, |
| 908 | 20452225, |
| 909 | 12000000, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 910 | }; |
| 911 | |
| 912 | static struct dib7000p_config dib7070p_dib7000p_config = { |
| 913 | .output_mpeg2_in_188_bytes = 1, |
| 914 | |
| 915 | .agc_config_count = 1, |
| 916 | .agc = &dib7070_agc_config, |
| 917 | .bw = &dib7070_bw_config_12_mhz, |
Patrick Boettcher | 3cb2c39 | 2008-01-25 07:25:20 -0300 | [diff] [blame] | 918 | .tuner_is_baseband = 1, |
| 919 | .spur_protect = 1, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 920 | |
| 921 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
| 922 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, |
| 923 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
| 924 | |
| 925 | .hostbus_diversity = 1, |
| 926 | }; |
| 927 | |
| 928 | /* STK7070P */ |
| 929 | static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap) |
| 930 | { |
Al Viro | da5ee48 | 2008-05-21 00:31:21 -0300 | [diff] [blame] | 931 | struct usb_device_descriptor *p = &adap->dev->udev->descriptor; |
| 932 | if (p->idVendor == cpu_to_le16(USB_VID_PINNACLE) && |
| 933 | p->idProduct == cpu_to_le16(USB_PID_PINNACLE_PCTV72E)) |
| 934 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 935 | else |
Al Viro | da5ee48 | 2008-05-21 00:31:21 -0300 | [diff] [blame] | 936 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 937 | msleep(10); |
| 938 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 939 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 940 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 941 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 942 | |
| 943 | dib0700_ctrl_clock(adap->dev, 72, 1); |
| 944 | |
| 945 | msleep(10); |
| 946 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 947 | msleep(10); |
| 948 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 949 | |
Devin Heitmueller | 83c4fdf | 2009-01-21 01:55:45 -0300 | [diff] [blame] | 950 | if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, |
| 951 | &dib7070p_dib7000p_config) != 0) { |
| 952 | err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", |
| 953 | __func__); |
| 954 | return -ENODEV; |
| 955 | } |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 956 | |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 957 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, |
| 958 | &dib7070p_dib7000p_config); |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 959 | return adap->fe == NULL ? -ENODEV : 0; |
| 960 | } |
| 961 | |
Olivier Grenie | 90e12ce | 2010-09-07 12:50:45 -0300 | [diff] [blame] | 962 | /* STK7770P */ |
| 963 | static struct dib7000p_config dib7770p_dib7000p_config = { |
| 964 | .output_mpeg2_in_188_bytes = 1, |
| 965 | |
| 966 | .agc_config_count = 1, |
| 967 | .agc = &dib7070_agc_config, |
| 968 | .bw = &dib7070_bw_config_12_mhz, |
| 969 | .tuner_is_baseband = 1, |
| 970 | .spur_protect = 1, |
| 971 | |
| 972 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
| 973 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, |
| 974 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
| 975 | |
| 976 | .hostbus_diversity = 1, |
| 977 | .enable_current_mirror = 1, |
Olivier Grenie | 970d14c | 2010-09-07 12:50:46 -0300 | [diff] [blame] | 978 | .disable_sample_and_hold = 0, |
Olivier Grenie | 90e12ce | 2010-09-07 12:50:45 -0300 | [diff] [blame] | 979 | }; |
| 980 | |
| 981 | static int stk7770p_frontend_attach(struct dvb_usb_adapter *adap) |
| 982 | { |
| 983 | struct usb_device_descriptor *p = &adap->dev->udev->descriptor; |
| 984 | if (p->idVendor == cpu_to_le16(USB_VID_PINNACLE) && |
| 985 | p->idProduct == cpu_to_le16(USB_PID_PINNACLE_PCTV72E)) |
| 986 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); |
| 987 | else |
| 988 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 989 | msleep(10); |
| 990 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 991 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 992 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 993 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 994 | |
| 995 | dib0700_ctrl_clock(adap->dev, 72, 1); |
| 996 | |
| 997 | msleep(10); |
| 998 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 999 | msleep(10); |
| 1000 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 1001 | |
| 1002 | if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, |
| 1003 | &dib7770p_dib7000p_config) != 0) { |
| 1004 | err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", |
| 1005 | __func__); |
| 1006 | return -ENODEV; |
| 1007 | } |
| 1008 | |
| 1009 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, |
| 1010 | &dib7770p_dib7000p_config); |
| 1011 | return adap->fe == NULL ? -ENODEV : 0; |
| 1012 | } |
| 1013 | |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 1014 | /* DIB807x generic */ |
| 1015 | static struct dibx000_agc_config dib807x_agc_config[2] = { |
| 1016 | { |
| 1017 | BAND_VHF, |
| 1018 | /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, |
| 1019 | * P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0, |
| 1020 | * P_agc_inv_pwm2=0,P_agc_inh_dc_rv_est=0, |
| 1021 | * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, |
| 1022 | * P_agc_write=0 */ |
| 1023 | (0 << 15) | (0 << 14) | (7 << 11) | (0 << 10) | (0 << 9) | |
| 1024 | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | |
| 1025 | (0 << 0), /* setup*/ |
| 1026 | |
| 1027 | 600, /* inv_gain*/ |
| 1028 | 10, /* time_stabiliz*/ |
| 1029 | |
| 1030 | 0, /* alpha_level*/ |
| 1031 | 118, /* thlock*/ |
| 1032 | |
| 1033 | 0, /* wbd_inv*/ |
| 1034 | 3530, /* wbd_ref*/ |
| 1035 | 1, /* wbd_sel*/ |
| 1036 | 5, /* wbd_alpha*/ |
| 1037 | |
| 1038 | 65535, /* agc1_max*/ |
| 1039 | 0, /* agc1_min*/ |
| 1040 | |
| 1041 | 65535, /* agc2_max*/ |
| 1042 | 0, /* agc2_min*/ |
| 1043 | |
| 1044 | 0, /* agc1_pt1*/ |
| 1045 | 40, /* agc1_pt2*/ |
| 1046 | 183, /* agc1_pt3*/ |
| 1047 | 206, /* agc1_slope1*/ |
| 1048 | 255, /* agc1_slope2*/ |
| 1049 | 72, /* agc2_pt1*/ |
| 1050 | 152, /* agc2_pt2*/ |
| 1051 | 88, /* agc2_slope1*/ |
| 1052 | 90, /* agc2_slope2*/ |
| 1053 | |
| 1054 | 17, /* alpha_mant*/ |
| 1055 | 27, /* alpha_exp*/ |
| 1056 | 23, /* beta_mant*/ |
| 1057 | 51, /* beta_exp*/ |
| 1058 | |
| 1059 | 0, /* perform_agc_softsplit*/ |
| 1060 | }, { |
| 1061 | BAND_UHF, |
| 1062 | /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, |
| 1063 | * P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0, |
| 1064 | * P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0, |
| 1065 | * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, |
| 1066 | * P_agc_write=0 */ |
| 1067 | (0 << 15) | (0 << 14) | (1 << 11) | (0 << 10) | (0 << 9) | |
| 1068 | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | |
| 1069 | (0 << 0), /* setup */ |
| 1070 | |
| 1071 | 600, /* inv_gain*/ |
| 1072 | 10, /* time_stabiliz*/ |
| 1073 | |
| 1074 | 0, /* alpha_level*/ |
| 1075 | 118, /* thlock*/ |
| 1076 | |
| 1077 | 0, /* wbd_inv*/ |
| 1078 | 3530, /* wbd_ref*/ |
| 1079 | 1, /* wbd_sel*/ |
| 1080 | 5, /* wbd_alpha*/ |
| 1081 | |
| 1082 | 65535, /* agc1_max*/ |
| 1083 | 0, /* agc1_min*/ |
| 1084 | |
| 1085 | 65535, /* agc2_max*/ |
| 1086 | 0, /* agc2_min*/ |
| 1087 | |
| 1088 | 0, /* agc1_pt1*/ |
| 1089 | 40, /* agc1_pt2*/ |
| 1090 | 183, /* agc1_pt3*/ |
| 1091 | 206, /* agc1_slope1*/ |
| 1092 | 255, /* agc1_slope2*/ |
| 1093 | 72, /* agc2_pt1*/ |
| 1094 | 152, /* agc2_pt2*/ |
| 1095 | 88, /* agc2_slope1*/ |
| 1096 | 90, /* agc2_slope2*/ |
| 1097 | |
| 1098 | 17, /* alpha_mant*/ |
| 1099 | 27, /* alpha_exp*/ |
| 1100 | 23, /* beta_mant*/ |
| 1101 | 51, /* beta_exp*/ |
| 1102 | |
| 1103 | 0, /* perform_agc_softsplit*/ |
| 1104 | } |
| 1105 | }; |
| 1106 | |
| 1107 | static struct dibx000_bandwidth_config dib807x_bw_config_12_mhz = { |
| 1108 | 60000, 15000, /* internal, sampling*/ |
| 1109 | 1, 20, 3, 1, 0, /* pll_cfg: prediv, ratio, range, reset, bypass*/ |
| 1110 | 0, 0, 1, 1, 2, /* misc: refdiv, bypclk_div, IO_CLK_en_core, |
| 1111 | ADClkSrc, modulo */ |
| 1112 | (3 << 14) | (1 << 12) | (599 << 0), /* sad_cfg: refsel, sel, freq_15k*/ |
| 1113 | (0 << 25) | 0, /* ifreq = 0.000000 MHz*/ |
| 1114 | 18179755, /* timf*/ |
| 1115 | 12000000, /* xtal_hz*/ |
| 1116 | }; |
| 1117 | |
| 1118 | static struct dib8000_config dib807x_dib8000_config[2] = { |
| 1119 | { |
| 1120 | .output_mpeg2_in_188_bytes = 1, |
| 1121 | |
| 1122 | .agc_config_count = 2, |
| 1123 | .agc = dib807x_agc_config, |
| 1124 | .pll = &dib807x_bw_config_12_mhz, |
| 1125 | .tuner_is_baseband = 1, |
| 1126 | |
| 1127 | .gpio_dir = DIB8000_GPIO_DEFAULT_DIRECTIONS, |
| 1128 | .gpio_val = DIB8000_GPIO_DEFAULT_VALUES, |
| 1129 | .gpio_pwm_pos = DIB8000_GPIO_DEFAULT_PWM_POS, |
| 1130 | |
| 1131 | .hostbus_diversity = 1, |
| 1132 | .div_cfg = 1, |
| 1133 | .agc_control = &dib0070_ctrl_agc_filter, |
| 1134 | .output_mode = OUTMODE_MPEG2_FIFO, |
| 1135 | .drives = 0x2d98, |
| 1136 | }, { |
| 1137 | .output_mpeg2_in_188_bytes = 1, |
| 1138 | |
| 1139 | .agc_config_count = 2, |
| 1140 | .agc = dib807x_agc_config, |
| 1141 | .pll = &dib807x_bw_config_12_mhz, |
| 1142 | .tuner_is_baseband = 1, |
| 1143 | |
| 1144 | .gpio_dir = DIB8000_GPIO_DEFAULT_DIRECTIONS, |
| 1145 | .gpio_val = DIB8000_GPIO_DEFAULT_VALUES, |
| 1146 | .gpio_pwm_pos = DIB8000_GPIO_DEFAULT_PWM_POS, |
| 1147 | |
| 1148 | .hostbus_diversity = 1, |
| 1149 | .agc_control = &dib0070_ctrl_agc_filter, |
| 1150 | .output_mode = OUTMODE_MPEG2_FIFO, |
| 1151 | .drives = 0x2d98, |
| 1152 | } |
| 1153 | }; |
| 1154 | |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1155 | static int dib80xx_tuner_reset(struct dvb_frontend *fe, int onoff) |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 1156 | { |
| 1157 | return dib8000_set_gpio(fe, 5, 0, !onoff); |
| 1158 | } |
| 1159 | |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1160 | static int dib80xx_tuner_sleep(struct dvb_frontend *fe, int onoff) |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 1161 | { |
| 1162 | return dib8000_set_gpio(fe, 0, 0, onoff); |
| 1163 | } |
| 1164 | |
| 1165 | static const struct dib0070_wbd_gain_cfg dib8070_wbd_gain_cfg[] = { |
| 1166 | { 240, 7}, |
| 1167 | { 0xffff, 6}, |
| 1168 | }; |
| 1169 | |
| 1170 | static struct dib0070_config dib807x_dib0070_config[2] = { |
| 1171 | { |
| 1172 | .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1173 | .reset = dib80xx_tuner_reset, |
| 1174 | .sleep = dib80xx_tuner_sleep, |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 1175 | .clock_khz = 12000, |
| 1176 | .clock_pad_drive = 4, |
| 1177 | .vga_filter = 1, |
| 1178 | .force_crystal_mode = 1, |
| 1179 | .enable_third_order_filter = 1, |
| 1180 | .charge_pump = 0, |
| 1181 | .wbd_gain = dib8070_wbd_gain_cfg, |
| 1182 | .osc_buffer_state = 0, |
| 1183 | .freq_offset_khz_uhf = -100, |
| 1184 | .freq_offset_khz_vhf = -100, |
| 1185 | }, { |
| 1186 | .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1187 | .reset = dib80xx_tuner_reset, |
| 1188 | .sleep = dib80xx_tuner_sleep, |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 1189 | .clock_khz = 12000, |
| 1190 | .clock_pad_drive = 2, |
| 1191 | .vga_filter = 1, |
| 1192 | .force_crystal_mode = 1, |
| 1193 | .enable_third_order_filter = 1, |
| 1194 | .charge_pump = 0, |
| 1195 | .wbd_gain = dib8070_wbd_gain_cfg, |
| 1196 | .osc_buffer_state = 0, |
| 1197 | .freq_offset_khz_uhf = -25, |
| 1198 | .freq_offset_khz_vhf = -25, |
| 1199 | } |
| 1200 | }; |
| 1201 | |
| 1202 | static int dib807x_set_param_override(struct dvb_frontend *fe, |
| 1203 | struct dvb_frontend_parameters *fep) |
| 1204 | { |
| 1205 | struct dvb_usb_adapter *adap = fe->dvb->priv; |
| 1206 | struct dib0700_adapter_state *state = adap->priv; |
| 1207 | |
| 1208 | u16 offset = dib0070_wbd_offset(fe); |
| 1209 | u8 band = BAND_OF_FREQUENCY(fep->frequency/1000); |
| 1210 | switch (band) { |
| 1211 | case BAND_VHF: |
| 1212 | offset += 750; |
| 1213 | break; |
| 1214 | case BAND_UHF: /* fall-thru wanted */ |
| 1215 | default: |
| 1216 | offset += 250; break; |
| 1217 | } |
| 1218 | deb_info("WBD for DiB8000: %d\n", offset); |
| 1219 | dib8000_set_wbd_ref(fe, offset); |
| 1220 | |
| 1221 | return state->set_param_save(fe, fep); |
| 1222 | } |
| 1223 | |
| 1224 | static int dib807x_tuner_attach(struct dvb_usb_adapter *adap) |
| 1225 | { |
| 1226 | struct dib0700_adapter_state *st = adap->priv; |
| 1227 | struct i2c_adapter *tun_i2c = dib8000_get_i2c_master(adap->fe, |
| 1228 | DIBX000_I2C_INTERFACE_TUNER, 1); |
| 1229 | |
| 1230 | if (adap->id == 0) { |
| 1231 | if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, |
| 1232 | &dib807x_dib0070_config[0]) == NULL) |
| 1233 | return -ENODEV; |
| 1234 | } else { |
| 1235 | if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, |
| 1236 | &dib807x_dib0070_config[1]) == NULL) |
| 1237 | return -ENODEV; |
| 1238 | } |
| 1239 | |
| 1240 | st->set_param_save = adap->fe->ops.tuner_ops.set_params; |
| 1241 | adap->fe->ops.tuner_ops.set_params = dib807x_set_param_override; |
| 1242 | return 0; |
| 1243 | } |
| 1244 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 1245 | static int stk80xx_pid_filter(struct dvb_usb_adapter *adapter, int index, |
| 1246 | u16 pid, int onoff) |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 1247 | { |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1248 | return dib8000_pid_filter(adapter->fe, index, pid, onoff); |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 1249 | } |
| 1250 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 1251 | static int stk80xx_pid_filter_ctrl(struct dvb_usb_adapter *adapter, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1252 | int onoff) |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 1253 | { |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1254 | return dib8000_pid_filter_ctrl(adapter->fe, onoff); |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 1255 | } |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 1256 | |
| 1257 | /* STK807x */ |
| 1258 | static int stk807x_frontend_attach(struct dvb_usb_adapter *adap) |
| 1259 | { |
| 1260 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 1261 | msleep(10); |
| 1262 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 1263 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 1264 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 1265 | |
| 1266 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 1267 | |
| 1268 | dib0700_ctrl_clock(adap->dev, 72, 1); |
| 1269 | |
| 1270 | msleep(10); |
| 1271 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 1272 | msleep(10); |
| 1273 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 1274 | |
| 1275 | dib8000_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, |
| 1276 | 0x80); |
| 1277 | |
| 1278 | adap->fe = dvb_attach(dib8000_attach, &adap->dev->i2c_adap, 0x80, |
| 1279 | &dib807x_dib8000_config[0]); |
| 1280 | |
| 1281 | return adap->fe == NULL ? -ENODEV : 0; |
| 1282 | } |
| 1283 | |
| 1284 | /* STK807xPVR */ |
| 1285 | static int stk807xpvr_frontend_attach0(struct dvb_usb_adapter *adap) |
| 1286 | { |
| 1287 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); |
| 1288 | msleep(30); |
| 1289 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 1290 | msleep(500); |
| 1291 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 1292 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 1293 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 1294 | |
| 1295 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 1296 | |
| 1297 | dib0700_ctrl_clock(adap->dev, 72, 1); |
| 1298 | |
| 1299 | msleep(10); |
| 1300 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 1301 | msleep(10); |
| 1302 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 1303 | |
| 1304 | /* initialize IC 0 */ |
Olivier Grenie | 9542f50 | 2009-12-07 08:09:04 -0300 | [diff] [blame] | 1305 | dib8000_i2c_enumeration(&adap->dev->i2c_adap, 1, 0x22, 0x80); |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 1306 | |
| 1307 | adap->fe = dvb_attach(dib8000_attach, &adap->dev->i2c_adap, 0x80, |
| 1308 | &dib807x_dib8000_config[0]); |
| 1309 | |
| 1310 | return adap->fe == NULL ? -ENODEV : 0; |
| 1311 | } |
| 1312 | |
| 1313 | static int stk807xpvr_frontend_attach1(struct dvb_usb_adapter *adap) |
| 1314 | { |
| 1315 | /* initialize IC 1 */ |
Olivier Grenie | 9542f50 | 2009-12-07 08:09:04 -0300 | [diff] [blame] | 1316 | dib8000_i2c_enumeration(&adap->dev->i2c_adap, 1, 0x12, 0x82); |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 1317 | |
| 1318 | adap->fe = dvb_attach(dib8000_attach, &adap->dev->i2c_adap, 0x82, |
| 1319 | &dib807x_dib8000_config[1]); |
| 1320 | |
| 1321 | return adap->fe == NULL ? -ENODEV : 0; |
| 1322 | } |
| 1323 | |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1324 | /* STK8096GP */ |
| 1325 | struct dibx000_agc_config dib8090_agc_config[2] = { |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1326 | { |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1327 | BAND_UHF | BAND_VHF | BAND_LBAND | BAND_SBAND, |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 1328 | /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1329 | * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0, |
| 1330 | * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0 */ |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 1331 | (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) |
| 1332 | | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1333 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 1334 | 787, |
| 1335 | 10, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1336 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 1337 | 0, |
| 1338 | 118, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1339 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 1340 | 0, |
| 1341 | 3530, |
| 1342 | 1, |
| 1343 | 5, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1344 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 1345 | 65535, |
| 1346 | 0, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1347 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 1348 | 65535, |
| 1349 | 0, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1350 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 1351 | 0, |
| 1352 | 32, |
| 1353 | 114, |
| 1354 | 143, |
| 1355 | 144, |
| 1356 | 114, |
| 1357 | 227, |
| 1358 | 116, |
| 1359 | 117, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1360 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 1361 | 28, |
| 1362 | 26, |
| 1363 | 31, |
| 1364 | 51, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1365 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 1366 | 0, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1367 | }, |
| 1368 | { |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1369 | BAND_CBAND, |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 1370 | /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1371 | * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0, |
| 1372 | * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0 */ |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 1373 | (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) |
| 1374 | | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1375 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 1376 | 787, |
| 1377 | 10, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1378 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 1379 | 0, |
| 1380 | 118, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1381 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 1382 | 0, |
| 1383 | 3530, |
| 1384 | 1, |
| 1385 | 5, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1386 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 1387 | 0, |
| 1388 | 0, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1389 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 1390 | 65535, |
| 1391 | 0, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1392 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 1393 | 0, |
| 1394 | 32, |
| 1395 | 114, |
| 1396 | 143, |
| 1397 | 144, |
| 1398 | 114, |
| 1399 | 227, |
| 1400 | 116, |
| 1401 | 117, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1402 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 1403 | 28, |
| 1404 | 26, |
| 1405 | 31, |
| 1406 | 51, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1407 | |
Olivier Grenie | 9c78303 | 2009-12-07 07:49:40 -0300 | [diff] [blame] | 1408 | 0, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1409 | } |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1410 | }; |
| 1411 | |
| 1412 | static struct dibx000_bandwidth_config dib8090_pll_config_12mhz = { |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1413 | 54000, 13500, |
| 1414 | 1, 18, 3, 1, 0, |
| 1415 | 0, 0, 1, 1, 2, |
| 1416 | (3 << 14) | (1 << 12) | (599 << 0), |
| 1417 | (0 << 25) | 0, |
| 1418 | 20199727, |
| 1419 | 12000000, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1420 | }; |
| 1421 | |
| 1422 | static int dib8090_get_adc_power(struct dvb_frontend *fe) |
| 1423 | { |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1424 | return dib8000_get_adc_power(fe, 1); |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1425 | } |
| 1426 | |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1427 | static struct dib8000_config dib809x_dib8000_config[2] = { |
| 1428 | { |
| 1429 | .output_mpeg2_in_188_bytes = 1, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1430 | |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1431 | .agc_config_count = 2, |
| 1432 | .agc = dib8090_agc_config, |
| 1433 | .agc_control = dib0090_dcc_freq, |
| 1434 | .pll = &dib8090_pll_config_12mhz, |
| 1435 | .tuner_is_baseband = 1, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1436 | |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1437 | .gpio_dir = DIB8000_GPIO_DEFAULT_DIRECTIONS, |
| 1438 | .gpio_val = DIB8000_GPIO_DEFAULT_VALUES, |
| 1439 | .gpio_pwm_pos = DIB8000_GPIO_DEFAULT_PWM_POS, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1440 | |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1441 | .hostbus_diversity = 1, |
| 1442 | .div_cfg = 0x31, |
| 1443 | .output_mode = OUTMODE_MPEG2_FIFO, |
| 1444 | .drives = 0x2d98, |
| 1445 | .diversity_delay = 48, |
| 1446 | .refclksel = 3, |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 1447 | }, { |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1448 | .output_mpeg2_in_188_bytes = 1, |
| 1449 | |
| 1450 | .agc_config_count = 2, |
| 1451 | .agc = dib8090_agc_config, |
| 1452 | .agc_control = dib0090_dcc_freq, |
| 1453 | .pll = &dib8090_pll_config_12mhz, |
| 1454 | .tuner_is_baseband = 1, |
| 1455 | |
| 1456 | .gpio_dir = DIB8000_GPIO_DEFAULT_DIRECTIONS, |
| 1457 | .gpio_val = DIB8000_GPIO_DEFAULT_VALUES, |
| 1458 | .gpio_pwm_pos = DIB8000_GPIO_DEFAULT_PWM_POS, |
| 1459 | |
| 1460 | .hostbus_diversity = 1, |
| 1461 | .div_cfg = 0x31, |
| 1462 | .output_mode = OUTMODE_DIVERSITY, |
| 1463 | .drives = 0x2d08, |
| 1464 | .diversity_delay = 1, |
| 1465 | .refclksel = 3, |
| 1466 | } |
| 1467 | }; |
| 1468 | |
| 1469 | static struct dib0090_wbd_slope dib8090_wbd_table[] = { |
| 1470 | /* max freq ; cold slope ; cold offset ; warm slope ; warm offset ; wbd gain */ |
| 1471 | { 120, 0, 500, 0, 500, 4 }, /* CBAND */ |
| 1472 | { 170, 0, 450, 0, 450, 4 }, /* CBAND */ |
| 1473 | { 380, 48, 373, 28, 259, 6 }, /* VHF */ |
| 1474 | { 860, 34, 700, 36, 616, 6 }, /* high UHF */ |
| 1475 | { 0xFFFF, 34, 700, 36, 616, 6 }, /* default */ |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1476 | }; |
| 1477 | |
| 1478 | static struct dib0090_config dib809x_dib0090_config = { |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1479 | .io.pll_bypass = 1, |
| 1480 | .io.pll_range = 1, |
| 1481 | .io.pll_prediv = 1, |
| 1482 | .io.pll_loopdiv = 20, |
| 1483 | .io.adc_clock_ratio = 8, |
| 1484 | .io.pll_int_loop_filt = 0, |
| 1485 | .io.clock_khz = 12000, |
| 1486 | .reset = dib80xx_tuner_reset, |
| 1487 | .sleep = dib80xx_tuner_sleep, |
| 1488 | .clkouttobamse = 1, |
| 1489 | .analog_output = 1, |
| 1490 | .i2c_address = DEFAULT_DIB0090_I2C_ADDRESS, |
| 1491 | .use_pwm_agc = 1, |
| 1492 | .clkoutdrive = 1, |
| 1493 | .get_adc_power = dib8090_get_adc_power, |
| 1494 | .freq_offset_khz_uhf = -63, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1495 | .freq_offset_khz_vhf = -143, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1496 | .wbd = dib8090_wbd_table, |
| 1497 | .fref_clock_ratio = 6, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1498 | }; |
| 1499 | |
| 1500 | static int dib8096_set_param_override(struct dvb_frontend *fe, |
| 1501 | struct dvb_frontend_parameters *fep) |
| 1502 | { |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1503 | struct dvb_usb_adapter *adap = fe->dvb->priv; |
| 1504 | struct dib0700_adapter_state *state = adap->priv; |
| 1505 | u8 band = BAND_OF_FREQUENCY(fep->frequency/1000); |
| 1506 | u16 target; |
| 1507 | int ret = 0; |
| 1508 | enum frontend_tune_state tune_state = CT_SHUTDOWN; |
| 1509 | u16 ltgain, rf_gain_limit; |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1510 | |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1511 | ret = state->set_param_save(fe, fep); |
| 1512 | if (ret < 0) |
| 1513 | return ret; |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1514 | |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1515 | target = (dib0090_get_wbd_offset(fe) * 8 * 18 / 33 + 1) / 2; |
| 1516 | dib8000_set_wbd_ref(fe, target); |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1517 | |
| 1518 | |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1519 | if (band == BAND_CBAND) { |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 1520 | deb_info("tuning in CBAND - soft-AGC startup\n"); |
| 1521 | dib0090_set_tune_state(fe, CT_AGC_START); |
| 1522 | do { |
| 1523 | ret = dib0090_gain_control(fe); |
| 1524 | msleep(ret); |
| 1525 | tune_state = dib0090_get_tune_state(fe); |
| 1526 | if (tune_state == CT_AGC_STEP_0) |
| 1527 | dib8000_set_gpio(fe, 6, 0, 1); |
| 1528 | else if (tune_state == CT_AGC_STEP_1) { |
| 1529 | dib0090_get_current_gain(fe, NULL, NULL, &rf_gain_limit, <gain); |
| 1530 | if (rf_gain_limit == 0) |
| 1531 | dib8000_set_gpio(fe, 6, 0, 0); |
| 1532 | } |
| 1533 | } while (tune_state < CT_AGC_STOP); |
| 1534 | dib0090_pwm_gain_reset(fe); |
| 1535 | dib8000_pwm_agc_reset(fe); |
| 1536 | dib8000_set_tune_state(fe, CT_DEMOD_START); |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1537 | } else { |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 1538 | deb_info("not tuning in CBAND - standard AGC startup\n"); |
| 1539 | dib0090_pwm_gain_reset(fe); |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1540 | } |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1541 | |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1542 | return 0; |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1543 | } |
| 1544 | |
| 1545 | static int dib809x_tuner_attach(struct dvb_usb_adapter *adap) |
| 1546 | { |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1547 | struct dib0700_adapter_state *st = adap->priv; |
| 1548 | struct i2c_adapter *tun_i2c = dib8000_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1549 | |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1550 | if (dvb_attach(dib0090_register, adap->fe, tun_i2c, &dib809x_dib0090_config) == NULL) |
| 1551 | return -ENODEV; |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1552 | |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1553 | st->set_param_save = adap->fe->ops.tuner_ops.set_params; |
| 1554 | adap->fe->ops.tuner_ops.set_params = dib8096_set_param_override; |
| 1555 | return 0; |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1556 | } |
| 1557 | |
| 1558 | static int stk809x_frontend_attach(struct dvb_usb_adapter *adap) |
| 1559 | { |
| 1560 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 1561 | msleep(10); |
| 1562 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 1563 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 1564 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 1565 | |
| 1566 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 1567 | |
| 1568 | dib0700_ctrl_clock(adap->dev, 72, 1); |
| 1569 | |
| 1570 | msleep(10); |
| 1571 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 1572 | msleep(10); |
| 1573 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 1574 | |
| 1575 | dib8000_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, 0x80); |
| 1576 | |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1577 | adap->fe = dvb_attach(dib8000_attach, &adap->dev->i2c_adap, 0x80, &dib809x_dib8000_config[0]); |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 1578 | |
| 1579 | return adap->fe == NULL ? -ENODEV : 0; |
| 1580 | } |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 1581 | |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1582 | static int nim8096md_tuner_attach(struct dvb_usb_adapter *adap) |
| 1583 | { |
| 1584 | struct dib0700_adapter_state *st = adap->priv; |
| 1585 | struct i2c_adapter *tun_i2c; |
| 1586 | struct dvb_frontend *fe_slave = dib8000_get_slave_frontend(adap->fe, 1); |
| 1587 | |
| 1588 | if (fe_slave) { |
| 1589 | tun_i2c = dib8000_get_i2c_master(fe_slave, DIBX000_I2C_INTERFACE_TUNER, 1); |
| 1590 | if (dvb_attach(dib0090_register, fe_slave, tun_i2c, &dib809x_dib0090_config) == NULL) |
| 1591 | return -ENODEV; |
| 1592 | fe_slave->dvb = adap->fe->dvb; |
| 1593 | fe_slave->ops.tuner_ops.set_params = dib8096_set_param_override; |
| 1594 | } |
| 1595 | tun_i2c = dib8000_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); |
| 1596 | if (dvb_attach(dib0090_register, adap->fe, tun_i2c, &dib809x_dib0090_config) == NULL) |
| 1597 | return -ENODEV; |
| 1598 | |
| 1599 | st->set_param_save = adap->fe->ops.tuner_ops.set_params; |
| 1600 | adap->fe->ops.tuner_ops.set_params = dib8096_set_param_override; |
| 1601 | |
| 1602 | return 0; |
| 1603 | } |
| 1604 | |
| 1605 | static int nim8096md_frontend_attach(struct dvb_usb_adapter *adap) |
| 1606 | { |
| 1607 | struct dvb_frontend *fe_slave; |
| 1608 | |
| 1609 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 1610 | msleep(20); |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1611 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 1612 | msleep(1000); |
| 1613 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 1614 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 1615 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 1616 | |
| 1617 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 1618 | |
| 1619 | dib0700_ctrl_clock(adap->dev, 72, 1); |
| 1620 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 1621 | msleep(20); |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1622 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 1623 | msleep(20); |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1624 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 1625 | |
| 1626 | dib8000_i2c_enumeration(&adap->dev->i2c_adap, 2, 18, 0x80); |
| 1627 | |
| 1628 | adap->fe = dvb_attach(dib8000_attach, &adap->dev->i2c_adap, 0x80, &dib809x_dib8000_config[0]); |
| 1629 | if (adap->fe == NULL) |
| 1630 | return -ENODEV; |
| 1631 | |
| 1632 | fe_slave = dvb_attach(dib8000_attach, &adap->dev->i2c_adap, 0x82, &dib809x_dib8000_config[1]); |
| 1633 | dib8000_set_slave_frontend(adap->fe, fe_slave); |
| 1634 | |
| 1635 | return fe_slave == NULL ? -ENODEV : 0; |
| 1636 | } |
| 1637 | |
| 1638 | /* STK9090M */ |
| 1639 | static int dib90x0_pid_filter(struct dvb_usb_adapter *adapter, int index, u16 pid, int onoff) |
| 1640 | { |
| 1641 | return dib9000_fw_pid_filter(adapter->fe, index, pid, onoff); |
| 1642 | } |
| 1643 | |
| 1644 | static int dib90x0_pid_filter_ctrl(struct dvb_usb_adapter *adapter, int onoff) |
| 1645 | { |
| 1646 | return dib9000_fw_pid_filter_ctrl(adapter->fe, onoff); |
| 1647 | } |
| 1648 | |
| 1649 | static int dib90x0_tuner_reset(struct dvb_frontend *fe, int onoff) |
| 1650 | { |
| 1651 | return dib9000_set_gpio(fe, 5, 0, !onoff); |
| 1652 | } |
| 1653 | |
| 1654 | static int dib90x0_tuner_sleep(struct dvb_frontend *fe, int onoff) |
| 1655 | { |
| 1656 | return dib9000_set_gpio(fe, 0, 0, onoff); |
| 1657 | } |
| 1658 | |
| 1659 | static int dib01x0_pmu_update(struct i2c_adapter *i2c, u16 *data, u8 len) |
| 1660 | { |
| 1661 | u8 wb[4] = { 0xc >> 8, 0xc & 0xff, 0, 0 }; |
| 1662 | u8 rb[2]; |
| 1663 | struct i2c_msg msg[2] = { |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 1664 | {.addr = 0x1e >> 1, .flags = 0, .buf = wb, .len = 2}, |
| 1665 | {.addr = 0x1e >> 1, .flags = I2C_M_RD, .buf = rb, .len = 2}, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1666 | }; |
| 1667 | u8 index_data; |
| 1668 | |
| 1669 | dibx000_i2c_set_speed(i2c, 250); |
| 1670 | |
| 1671 | if (i2c_transfer(i2c, msg, 2) != 2) |
| 1672 | return -EIO; |
| 1673 | |
| 1674 | switch (rb[0] << 8 | rb[1]) { |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 1675 | case 0: |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1676 | deb_info("Found DiB0170 rev1: This version of DiB0170 is not supported any longer.\n"); |
| 1677 | return -EIO; |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 1678 | case 1: |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1679 | deb_info("Found DiB0170 rev2"); |
| 1680 | break; |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 1681 | case 2: |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1682 | deb_info("Found DiB0190 rev2"); |
| 1683 | break; |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 1684 | default: |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1685 | deb_info("DiB01x0 not found"); |
| 1686 | return -EIO; |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 1687 | } |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1688 | |
| 1689 | for (index_data = 0; index_data < len; index_data += 2) { |
| 1690 | wb[2] = (data[index_data + 1] >> 8) & 0xff; |
| 1691 | wb[3] = (data[index_data + 1]) & 0xff; |
| 1692 | |
| 1693 | if (data[index_data] == 0) { |
| 1694 | wb[0] = (data[index_data] >> 8) & 0xff; |
| 1695 | wb[1] = (data[index_data]) & 0xff; |
| 1696 | msg[0].len = 2; |
| 1697 | if (i2c_transfer(i2c, msg, 2) != 2) |
| 1698 | return -EIO; |
| 1699 | wb[2] |= rb[0]; |
| 1700 | wb[3] |= rb[1] & ~(3 << 4); |
| 1701 | } |
| 1702 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 1703 | wb[0] = (data[index_data] >> 8)&0xff; |
| 1704 | wb[1] = (data[index_data])&0xff; |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1705 | msg[0].len = 4; |
| 1706 | if (i2c_transfer(i2c, &msg[0], 1) != 1) |
| 1707 | return -EIO; |
| 1708 | } |
| 1709 | return 0; |
| 1710 | } |
| 1711 | |
| 1712 | static struct dib9000_config stk9090m_config = { |
| 1713 | .output_mpeg2_in_188_bytes = 1, |
| 1714 | .output_mode = OUTMODE_MPEG2_FIFO, |
| 1715 | .vcxo_timer = 279620, |
| 1716 | .timing_frequency = 20452225, |
| 1717 | .demod_clock_khz = 60000, |
| 1718 | .xtal_clock_khz = 30000, |
| 1719 | .if_drives = (0 << 15) | (1 << 13) | (0 << 12) | (3 << 10) | (0 << 9) | (1 << 7) | (0 << 6) | (0 << 4) | (1 << 3) | (1 << 1) | (0), |
| 1720 | .subband = { |
| 1721 | 2, |
| 1722 | { |
| 1723 | { 240, { BOARD_GPIO_COMPONENT_DEMOD, BOARD_GPIO_FUNCTION_SUBBAND_GPIO, 0x0008, 0x0000, 0x0008 } }, /* GPIO 3 to 1 for VHF */ |
| 1724 | { 890, { BOARD_GPIO_COMPONENT_DEMOD, BOARD_GPIO_FUNCTION_SUBBAND_GPIO, 0x0008, 0x0000, 0x0000 } }, /* GPIO 3 to 0 for UHF */ |
| 1725 | { 0 }, |
| 1726 | }, |
| 1727 | }, |
| 1728 | .gpio_function = { |
| 1729 | { .component = BOARD_GPIO_COMPONENT_DEMOD, .function = BOARD_GPIO_FUNCTION_COMPONENT_ON, .mask = 0x10 | 0x21, .direction = 0 & ~0x21, .value = (0x10 & ~0x1) | 0x20 }, |
| 1730 | { .component = BOARD_GPIO_COMPONENT_DEMOD, .function = BOARD_GPIO_FUNCTION_COMPONENT_OFF, .mask = 0x10 | 0x21, .direction = 0 & ~0x21, .value = 0 | 0x21 }, |
| 1731 | }, |
| 1732 | }; |
| 1733 | |
| 1734 | static struct dib9000_config nim9090md_config[2] = { |
| 1735 | { |
| 1736 | .output_mpeg2_in_188_bytes = 1, |
| 1737 | .output_mode = OUTMODE_MPEG2_FIFO, |
| 1738 | .vcxo_timer = 279620, |
| 1739 | .timing_frequency = 20452225, |
| 1740 | .demod_clock_khz = 60000, |
| 1741 | .xtal_clock_khz = 30000, |
| 1742 | .if_drives = (0 << 15) | (1 << 13) | (0 << 12) | (3 << 10) | (0 << 9) | (1 << 7) | (0 << 6) | (0 << 4) | (1 << 3) | (1 << 1) | (0), |
| 1743 | }, { |
| 1744 | .output_mpeg2_in_188_bytes = 1, |
| 1745 | .output_mode = OUTMODE_DIVERSITY, |
| 1746 | .vcxo_timer = 279620, |
| 1747 | .timing_frequency = 20452225, |
| 1748 | .demod_clock_khz = 60000, |
| 1749 | .xtal_clock_khz = 30000, |
| 1750 | .if_drives = (0 << 15) | (1 << 13) | (0 << 12) | (3 << 10) | (0 << 9) | (1 << 7) | (0 << 6) | (0 << 4) | (1 << 3) | (1 << 1) | (0), |
| 1751 | .subband = { |
| 1752 | 2, |
| 1753 | { |
| 1754 | { 240, { BOARD_GPIO_COMPONENT_DEMOD, BOARD_GPIO_FUNCTION_SUBBAND_GPIO, 0x0006, 0x0000, 0x0006 } }, /* GPIO 1 and 2 to 1 for VHF */ |
| 1755 | { 890, { BOARD_GPIO_COMPONENT_DEMOD, BOARD_GPIO_FUNCTION_SUBBAND_GPIO, 0x0006, 0x0000, 0x0000 } }, /* GPIO 1 and 2 to 0 for UHF */ |
| 1756 | { 0 }, |
| 1757 | }, |
| 1758 | }, |
| 1759 | .gpio_function = { |
| 1760 | { .component = BOARD_GPIO_COMPONENT_DEMOD, .function = BOARD_GPIO_FUNCTION_COMPONENT_ON, .mask = 0x10 | 0x21, .direction = 0 & ~0x21, .value = (0x10 & ~0x1) | 0x20 }, |
| 1761 | { .component = BOARD_GPIO_COMPONENT_DEMOD, .function = BOARD_GPIO_FUNCTION_COMPONENT_OFF, .mask = 0x10 | 0x21, .direction = 0 & ~0x21, .value = 0 | 0x21 }, |
| 1762 | }, |
| 1763 | } |
| 1764 | }; |
| 1765 | |
| 1766 | static struct dib0090_config dib9090_dib0090_config = { |
| 1767 | .io.pll_bypass = 0, |
| 1768 | .io.pll_range = 1, |
| 1769 | .io.pll_prediv = 1, |
| 1770 | .io.pll_loopdiv = 8, |
| 1771 | .io.adc_clock_ratio = 8, |
| 1772 | .io.pll_int_loop_filt = 0, |
| 1773 | .io.clock_khz = 30000, |
| 1774 | .reset = dib90x0_tuner_reset, |
| 1775 | .sleep = dib90x0_tuner_sleep, |
| 1776 | .clkouttobamse = 0, |
| 1777 | .analog_output = 0, |
| 1778 | .use_pwm_agc = 0, |
| 1779 | .clkoutdrive = 0, |
| 1780 | .freq_offset_khz_uhf = 0, |
| 1781 | .freq_offset_khz_vhf = 0, |
| 1782 | }; |
| 1783 | |
| 1784 | static struct dib0090_config nim9090md_dib0090_config[2] = { |
| 1785 | { |
| 1786 | .io.pll_bypass = 0, |
| 1787 | .io.pll_range = 1, |
| 1788 | .io.pll_prediv = 1, |
| 1789 | .io.pll_loopdiv = 8, |
| 1790 | .io.adc_clock_ratio = 8, |
| 1791 | .io.pll_int_loop_filt = 0, |
| 1792 | .io.clock_khz = 30000, |
| 1793 | .reset = dib90x0_tuner_reset, |
| 1794 | .sleep = dib90x0_tuner_sleep, |
| 1795 | .clkouttobamse = 1, |
| 1796 | .analog_output = 0, |
| 1797 | .use_pwm_agc = 0, |
| 1798 | .clkoutdrive = 0, |
| 1799 | .freq_offset_khz_uhf = 0, |
| 1800 | .freq_offset_khz_vhf = 0, |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 1801 | }, { |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1802 | .io.pll_bypass = 0, |
| 1803 | .io.pll_range = 1, |
| 1804 | .io.pll_prediv = 1, |
| 1805 | .io.pll_loopdiv = 8, |
| 1806 | .io.adc_clock_ratio = 8, |
| 1807 | .io.pll_int_loop_filt = 0, |
| 1808 | .io.clock_khz = 30000, |
| 1809 | .reset = dib90x0_tuner_reset, |
| 1810 | .sleep = dib90x0_tuner_sleep, |
| 1811 | .clkouttobamse = 0, |
| 1812 | .analog_output = 0, |
| 1813 | .use_pwm_agc = 0, |
| 1814 | .clkoutdrive = 0, |
| 1815 | .freq_offset_khz_uhf = 0, |
| 1816 | .freq_offset_khz_vhf = 0, |
| 1817 | } |
| 1818 | }; |
| 1819 | |
| 1820 | |
| 1821 | static int stk9090m_frontend_attach(struct dvb_usb_adapter *adap) |
| 1822 | { |
| 1823 | struct dib0700_adapter_state *state = adap->priv; |
| 1824 | struct dib0700_state *st = adap->dev->priv; |
| 1825 | u32 fw_version; |
| 1826 | |
| 1827 | /* Make use of the new i2c functions from FW 1.20 */ |
| 1828 | dib0700_get_version(adap->dev, NULL, NULL, &fw_version, NULL); |
| 1829 | if (fw_version >= 0x10200) |
| 1830 | st->fw_use_new_i2c_api = 1; |
| 1831 | dib0700_set_i2c_speed(adap->dev, 340); |
| 1832 | |
| 1833 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 1834 | msleep(20); |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1835 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 1836 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 1837 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 1838 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 1839 | |
| 1840 | dib0700_ctrl_clock(adap->dev, 72, 1); |
| 1841 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 1842 | msleep(20); |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1843 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 1844 | msleep(20); |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1845 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 1846 | |
| 1847 | dib9000_i2c_enumeration(&adap->dev->i2c_adap, 1, 0x10, 0x80); |
| 1848 | |
| 1849 | if (request_firmware(&state->frontend_firmware, "dib9090.fw", &adap->dev->udev->dev)) { |
| 1850 | deb_info("%s: Upload failed. (file not found?)\n", __func__); |
| 1851 | return -ENODEV; |
| 1852 | } else { |
| 1853 | deb_info("%s: firmware read %Zu bytes.\n", __func__, state->frontend_firmware->size); |
| 1854 | } |
| 1855 | stk9090m_config.microcode_B_fe_size = state->frontend_firmware->size; |
| 1856 | stk9090m_config.microcode_B_fe_buffer = state->frontend_firmware->data; |
| 1857 | |
| 1858 | adap->fe = dvb_attach(dib9000_attach, &adap->dev->i2c_adap, 0x80, &stk9090m_config); |
| 1859 | |
| 1860 | return adap->fe == NULL ? -ENODEV : 0; |
| 1861 | } |
| 1862 | |
| 1863 | static int dib9090_tuner_attach(struct dvb_usb_adapter *adap) |
| 1864 | { |
| 1865 | struct dib0700_adapter_state *state = adap->priv; |
| 1866 | struct i2c_adapter *i2c = dib9000_get_tuner_interface(adap->fe); |
| 1867 | u16 data_dib190[10] = { |
| 1868 | 1, 0x1374, |
| 1869 | 2, 0x01a2, |
| 1870 | 7, 0x0020, |
| 1871 | 0, 0x00ef, |
| 1872 | 8, 0x0486, |
| 1873 | }; |
| 1874 | |
| 1875 | if (dvb_attach(dib0090_fw_register, adap->fe, i2c, &dib9090_dib0090_config) == NULL) |
| 1876 | return -ENODEV; |
| 1877 | i2c = dib9000_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_GPIO_1_2, 0); |
| 1878 | if (dib01x0_pmu_update(i2c, data_dib190, 10) != 0) |
| 1879 | return -ENODEV; |
| 1880 | dib0700_set_i2c_speed(adap->dev, 2000); |
| 1881 | if (dib9000_firmware_post_pll_init(adap->fe) < 0) |
| 1882 | return -ENODEV; |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 1883 | release_firmware(state->frontend_firmware); |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1884 | return 0; |
| 1885 | } |
| 1886 | |
| 1887 | static int nim9090md_frontend_attach(struct dvb_usb_adapter *adap) |
| 1888 | { |
| 1889 | struct dib0700_adapter_state *state = adap->priv; |
| 1890 | struct dib0700_state *st = adap->dev->priv; |
| 1891 | struct i2c_adapter *i2c; |
| 1892 | struct dvb_frontend *fe_slave; |
| 1893 | u32 fw_version; |
| 1894 | |
| 1895 | /* Make use of the new i2c functions from FW 1.20 */ |
| 1896 | dib0700_get_version(adap->dev, NULL, NULL, &fw_version, NULL); |
| 1897 | if (fw_version >= 0x10200) |
| 1898 | st->fw_use_new_i2c_api = 1; |
| 1899 | dib0700_set_i2c_speed(adap->dev, 340); |
| 1900 | |
| 1901 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 1902 | msleep(20); |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1903 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 1904 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 1905 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 1906 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 1907 | |
| 1908 | dib0700_ctrl_clock(adap->dev, 72, 1); |
| 1909 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 1910 | msleep(20); |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1911 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 1912 | msleep(20); |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1913 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 1914 | |
| 1915 | if (request_firmware(&state->frontend_firmware, "dib9090.fw", &adap->dev->udev->dev)) { |
| 1916 | deb_info("%s: Upload failed. (file not found?)\n", __func__); |
| 1917 | return -EIO; |
| 1918 | } else { |
| 1919 | deb_info("%s: firmware read %Zu bytes.\n", __func__, state->frontend_firmware->size); |
| 1920 | } |
| 1921 | nim9090md_config[0].microcode_B_fe_size = state->frontend_firmware->size; |
| 1922 | nim9090md_config[0].microcode_B_fe_buffer = state->frontend_firmware->data; |
| 1923 | nim9090md_config[1].microcode_B_fe_size = state->frontend_firmware->size; |
| 1924 | nim9090md_config[1].microcode_B_fe_buffer = state->frontend_firmware->data; |
| 1925 | |
| 1926 | dib9000_i2c_enumeration(&adap->dev->i2c_adap, 1, 0x20, 0x80); |
| 1927 | adap->fe = dvb_attach(dib9000_attach, &adap->dev->i2c_adap, 0x80, &nim9090md_config[0]); |
| 1928 | |
| 1929 | if (adap->fe == NULL) |
| 1930 | return -ENODEV; |
| 1931 | |
| 1932 | i2c = dib9000_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_GPIO_3_4, 0); |
| 1933 | dib9000_i2c_enumeration(i2c, 1, 0x12, 0x82); |
| 1934 | |
| 1935 | fe_slave = dvb_attach(dib9000_attach, i2c, 0x82, &nim9090md_config[1]); |
| 1936 | dib9000_set_slave_frontend(adap->fe, fe_slave); |
| 1937 | |
| 1938 | return fe_slave == NULL ? -ENODEV : 0; |
| 1939 | } |
| 1940 | |
| 1941 | static int nim9090md_tuner_attach(struct dvb_usb_adapter *adap) |
| 1942 | { |
| 1943 | struct dib0700_adapter_state *state = adap->priv; |
| 1944 | struct i2c_adapter *i2c; |
| 1945 | struct dvb_frontend *fe_slave; |
| 1946 | u16 data_dib190[10] = { |
| 1947 | 1, 0x5374, |
| 1948 | 2, 0x01ae, |
| 1949 | 7, 0x0020, |
| 1950 | 0, 0x00ef, |
| 1951 | 8, 0x0406, |
| 1952 | }; |
| 1953 | i2c = dib9000_get_tuner_interface(adap->fe); |
| 1954 | if (dvb_attach(dib0090_fw_register, adap->fe, i2c, &nim9090md_dib0090_config[0]) == NULL) |
| 1955 | return -ENODEV; |
| 1956 | i2c = dib9000_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_GPIO_1_2, 0); |
| 1957 | if (dib01x0_pmu_update(i2c, data_dib190, 10) < 0) |
| 1958 | return -ENODEV; |
| 1959 | dib0700_set_i2c_speed(adap->dev, 2000); |
| 1960 | if (dib9000_firmware_post_pll_init(adap->fe) < 0) |
| 1961 | return -ENODEV; |
| 1962 | |
| 1963 | fe_slave = dib9000_get_slave_frontend(adap->fe, 1); |
| 1964 | if (fe_slave != NULL) { |
| 1965 | i2c = dib9000_get_component_bus_interface(adap->fe); |
| 1966 | dib9000_set_i2c_adapter(fe_slave, i2c); |
| 1967 | |
| 1968 | i2c = dib9000_get_tuner_interface(fe_slave); |
| 1969 | if (dvb_attach(dib0090_fw_register, fe_slave, i2c, &nim9090md_dib0090_config[1]) == NULL) |
| 1970 | return -ENODEV; |
| 1971 | fe_slave->dvb = adap->fe->dvb; |
| 1972 | dib9000_fw_set_component_bus_speed(adap->fe, 2000); |
| 1973 | if (dib9000_firmware_post_pll_init(fe_slave) < 0) |
| 1974 | return -ENODEV; |
| 1975 | } |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 1976 | release_firmware(state->frontend_firmware); |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 1977 | |
| 1978 | return 0; |
| 1979 | } |
| 1980 | |
| 1981 | /* NIM7090 */ |
| 1982 | struct dib7090p_best_adc { |
| 1983 | u32 timf; |
| 1984 | u32 pll_loopdiv; |
| 1985 | u32 pll_prediv; |
| 1986 | }; |
| 1987 | |
| 1988 | static int dib7090p_get_best_sampling(struct dvb_frontend *fe , struct dib7090p_best_adc *adc) |
| 1989 | { |
| 1990 | u8 spur = 0, prediv = 0, loopdiv = 0, min_prediv = 1, max_prediv = 1; |
| 1991 | |
| 1992 | u16 xtal = 12000; |
| 1993 | u32 fcp_min = 1900; /* PLL Minimum Frequency comparator KHz */ |
| 1994 | u32 fcp_max = 20000; /* PLL Maximum Frequency comparator KHz */ |
| 1995 | u32 fdem_max = 76000; |
| 1996 | u32 fdem_min = 69500; |
| 1997 | u32 fcp = 0, fs = 0, fdem = 0; |
| 1998 | u32 harmonic_id = 0; |
| 1999 | |
| 2000 | adc->pll_loopdiv = loopdiv; |
| 2001 | adc->pll_prediv = prediv; |
| 2002 | adc->timf = 0; |
| 2003 | |
| 2004 | deb_info("bandwidth = %d fdem_min =%d", fe->dtv_property_cache.bandwidth_hz, fdem_min); |
| 2005 | |
| 2006 | /* Find Min and Max prediv */ |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2007 | while ((xtal/max_prediv) >= fcp_min) |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2008 | max_prediv++; |
| 2009 | |
| 2010 | max_prediv--; |
| 2011 | min_prediv = max_prediv; |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2012 | while ((xtal/min_prediv) <= fcp_max) { |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2013 | min_prediv--; |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2014 | if (min_prediv == 1) |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2015 | break; |
| 2016 | } |
| 2017 | deb_info("MIN prediv = %d : MAX prediv = %d", min_prediv, max_prediv); |
| 2018 | |
| 2019 | min_prediv = 2; |
| 2020 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2021 | for (prediv = min_prediv ; prediv < max_prediv; prediv++) { |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2022 | fcp = xtal / prediv; |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2023 | if (fcp > fcp_min && fcp < fcp_max) { |
| 2024 | for (loopdiv = 1 ; loopdiv < 64 ; loopdiv++) { |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2025 | fdem = ((xtal/prediv) * loopdiv); |
| 2026 | fs = fdem / 4; |
| 2027 | /* test min/max system restrictions */ |
| 2028 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2029 | if ((fdem >= fdem_min) && (fdem <= fdem_max) && (fs >= fe->dtv_property_cache.bandwidth_hz/1000)) { |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2030 | spur = 0; |
| 2031 | /* test fs harmonics positions */ |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2032 | for (harmonic_id = (fe->dtv_property_cache.frequency / (1000*fs)) ; harmonic_id <= ((fe->dtv_property_cache.frequency / (1000*fs))+1) ; harmonic_id++) { |
| 2033 | if (((fs*harmonic_id) >= ((fe->dtv_property_cache.frequency/1000) - (fe->dtv_property_cache.bandwidth_hz/2000))) && ((fs*harmonic_id) <= ((fe->dtv_property_cache.frequency/1000) + (fe->dtv_property_cache.bandwidth_hz/2000)))) { |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2034 | spur = 1; |
| 2035 | break; |
| 2036 | } |
| 2037 | } |
| 2038 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2039 | if (!spur) { |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2040 | adc->pll_loopdiv = loopdiv; |
| 2041 | adc->pll_prediv = prediv; |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2042 | adc->timf = 2396745143UL/fdem*(1 << 9); |
| 2043 | adc->timf += ((2396745143UL%fdem) << 9)/fdem; |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2044 | deb_info("loopdiv=%i prediv=%i timf=%i", loopdiv, prediv, adc->timf); |
| 2045 | break; |
| 2046 | } |
| 2047 | } |
| 2048 | } |
| 2049 | } |
| 2050 | if (!spur) |
| 2051 | break; |
| 2052 | } |
| 2053 | |
| 2054 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2055 | if (adc->pll_loopdiv == 0 && adc->pll_prediv == 0) |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2056 | return -EINVAL; |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2057 | else |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2058 | return 0; |
| 2059 | } |
| 2060 | |
| 2061 | static int dib7090_agc_startup(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep) |
| 2062 | { |
| 2063 | struct dvb_usb_adapter *adap = fe->dvb->priv; |
| 2064 | struct dib0700_adapter_state *state = adap->priv; |
| 2065 | struct dibx000_bandwidth_config pll; |
| 2066 | u16 target; |
| 2067 | struct dib7090p_best_adc adc; |
| 2068 | int ret; |
| 2069 | |
| 2070 | ret = state->set_param_save(fe, fep); |
| 2071 | if (ret < 0) |
| 2072 | return ret; |
| 2073 | |
| 2074 | memset(&pll, 0, sizeof(struct dibx000_bandwidth_config)); |
| 2075 | dib0090_pwm_gain_reset(fe); |
| 2076 | target = (dib0090_get_wbd_offset(fe) * 8 + 1) / 2; |
| 2077 | dib7000p_set_wbd_ref(fe, target); |
| 2078 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2079 | if (dib7090p_get_best_sampling(fe, &adc) == 0) { |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2080 | pll.pll_ratio = adc.pll_loopdiv; |
| 2081 | pll.pll_prediv = adc.pll_prediv; |
| 2082 | |
| 2083 | dib7000p_update_pll(fe, &pll); |
| 2084 | dib7000p_ctrl_timf(fe, DEMOD_TIMF_SET, adc.timf); |
| 2085 | } |
| 2086 | return 0; |
| 2087 | } |
| 2088 | |
| 2089 | static struct dib0090_wbd_slope dib7090_wbd_table[] = { |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2090 | { 380, 81, 850, 64, 540, 4}, |
| 2091 | { 860, 51, 866, 21, 375, 4}, |
| 2092 | {1700, 0, 250, 0, 100, 6}, |
| 2093 | {2600, 0, 250, 0, 100, 6}, |
| 2094 | { 0xFFFF, 0, 0, 0, 0, 0}, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2095 | }; |
| 2096 | |
| 2097 | struct dibx000_agc_config dib7090_agc_config[2] = { |
| 2098 | { |
| 2099 | .band_caps = BAND_UHF, |
| 2100 | /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, |
| 2101 | * 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 */ |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2102 | .setup = (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2103 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2104 | .inv_gain = 687, |
| 2105 | .time_stabiliz = 10, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2106 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2107 | .alpha_level = 0, |
| 2108 | .thlock = 118, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2109 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2110 | .wbd_inv = 0, |
| 2111 | .wbd_ref = 1200, |
| 2112 | .wbd_sel = 3, |
| 2113 | .wbd_alpha = 5, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2114 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2115 | .agc1_max = 65535, |
| 2116 | .agc1_min = 0, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2117 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2118 | .agc2_max = 65535, |
| 2119 | .agc2_min = 0, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2120 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2121 | .agc1_pt1 = 0, |
| 2122 | .agc1_pt2 = 32, |
| 2123 | .agc1_pt3 = 114, |
| 2124 | .agc1_slope1 = 143, |
| 2125 | .agc1_slope2 = 144, |
| 2126 | .agc2_pt1 = 114, |
| 2127 | .agc2_pt2 = 227, |
| 2128 | .agc2_slope1 = 116, |
| 2129 | .agc2_slope2 = 117, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2130 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2131 | .alpha_mant = 18, |
| 2132 | .alpha_exp = 0, |
| 2133 | .beta_mant = 20, |
| 2134 | .beta_exp = 59, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2135 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2136 | .perform_agc_softsplit = 0, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2137 | } , { |
| 2138 | .band_caps = BAND_FM | BAND_VHF | BAND_CBAND, |
| 2139 | /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, |
| 2140 | * 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 */ |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2141 | .setup = (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2142 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2143 | .inv_gain = 732, |
| 2144 | .time_stabiliz = 10, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2145 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2146 | .alpha_level = 0, |
| 2147 | .thlock = 118, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2148 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2149 | .wbd_inv = 0, |
| 2150 | .wbd_ref = 1200, |
| 2151 | .wbd_sel = 3, |
| 2152 | .wbd_alpha = 5, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2153 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2154 | .agc1_max = 65535, |
| 2155 | .agc1_min = 0, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2156 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2157 | .agc2_max = 65535, |
| 2158 | .agc2_min = 0, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2159 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2160 | .agc1_pt1 = 0, |
| 2161 | .agc1_pt2 = 0, |
| 2162 | .agc1_pt3 = 98, |
| 2163 | .agc1_slope1 = 0, |
| 2164 | .agc1_slope2 = 167, |
Patrick Boettcher | 7f4d527 | 2011-04-03 12:28:08 -0300 | [diff] [blame] | 2165 | .agc2_pt1 = 98, |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2166 | .agc2_pt2 = 255, |
| 2167 | .agc2_slope1 = 104, |
| 2168 | .agc2_slope2 = 0, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2169 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2170 | .alpha_mant = 18, |
| 2171 | .alpha_exp = 0, |
| 2172 | .beta_mant = 20, |
| 2173 | .beta_exp = 59, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2174 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2175 | .perform_agc_softsplit = 0, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2176 | } |
| 2177 | }; |
| 2178 | |
| 2179 | static struct dibx000_bandwidth_config dib7090_clock_config_12_mhz = { |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2180 | 60000, 15000, |
| 2181 | 1, 5, 0, 0, 0, |
| 2182 | 0, 0, 1, 1, 2, |
| 2183 | (3 << 14) | (1 << 12) | (524 << 0), |
| 2184 | (0 << 25) | 0, |
| 2185 | 20452225, |
| 2186 | 15000000, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2187 | }; |
| 2188 | |
| 2189 | static struct dib7000p_config nim7090_dib7000p_config = { |
| 2190 | .output_mpeg2_in_188_bytes = 1, |
| 2191 | .hostbus_diversity = 1, |
| 2192 | .tuner_is_baseband = 1, |
| 2193 | .update_lna = NULL, |
| 2194 | |
| 2195 | .agc_config_count = 2, |
| 2196 | .agc = dib7090_agc_config, |
| 2197 | |
| 2198 | .bw = &dib7090_clock_config_12_mhz, |
| 2199 | |
| 2200 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
| 2201 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, |
| 2202 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
| 2203 | |
| 2204 | .pwm_freq_div = 0, |
| 2205 | |
| 2206 | .agc_control = dib7090_agc_restart, |
| 2207 | |
| 2208 | .spur_protect = 0, |
| 2209 | .disable_sample_and_hold = 0, |
| 2210 | .enable_current_mirror = 0, |
| 2211 | .diversity_delay = 0, |
| 2212 | |
| 2213 | .output_mode = OUTMODE_MPEG2_FIFO, |
| 2214 | .enMpegOutput = 1, |
| 2215 | }; |
| 2216 | |
| 2217 | static struct dib7000p_config tfe7090pvr_dib7000p_config[2] = { |
| 2218 | { |
| 2219 | .output_mpeg2_in_188_bytes = 1, |
| 2220 | .hostbus_diversity = 1, |
| 2221 | .tuner_is_baseband = 1, |
| 2222 | .update_lna = NULL, |
| 2223 | |
| 2224 | .agc_config_count = 2, |
| 2225 | .agc = dib7090_agc_config, |
| 2226 | |
| 2227 | .bw = &dib7090_clock_config_12_mhz, |
| 2228 | |
| 2229 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
| 2230 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, |
| 2231 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
| 2232 | |
| 2233 | .pwm_freq_div = 0, |
| 2234 | |
| 2235 | .agc_control = dib7090_agc_restart, |
| 2236 | |
| 2237 | .spur_protect = 0, |
| 2238 | .disable_sample_and_hold = 0, |
| 2239 | .enable_current_mirror = 0, |
| 2240 | .diversity_delay = 0, |
| 2241 | |
| 2242 | .output_mode = OUTMODE_MPEG2_PAR_GATED_CLK, |
| 2243 | .default_i2c_addr = 0x90, |
| 2244 | .enMpegOutput = 1, |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2245 | }, { |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2246 | .output_mpeg2_in_188_bytes = 1, |
| 2247 | .hostbus_diversity = 1, |
| 2248 | .tuner_is_baseband = 1, |
| 2249 | .update_lna = NULL, |
| 2250 | |
| 2251 | .agc_config_count = 2, |
| 2252 | .agc = dib7090_agc_config, |
| 2253 | |
| 2254 | .bw = &dib7090_clock_config_12_mhz, |
| 2255 | |
| 2256 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
| 2257 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, |
| 2258 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
| 2259 | |
| 2260 | .pwm_freq_div = 0, |
| 2261 | |
| 2262 | .agc_control = dib7090_agc_restart, |
| 2263 | |
| 2264 | .spur_protect = 0, |
| 2265 | .disable_sample_and_hold = 0, |
| 2266 | .enable_current_mirror = 0, |
| 2267 | .diversity_delay = 0, |
| 2268 | |
| 2269 | .output_mode = OUTMODE_MPEG2_PAR_GATED_CLK, |
| 2270 | .default_i2c_addr = 0x92, |
| 2271 | .enMpegOutput = 0, |
| 2272 | } |
| 2273 | }; |
| 2274 | |
| 2275 | static const struct dib0090_config nim7090_dib0090_config = { |
| 2276 | .io.clock_khz = 12000, |
| 2277 | .io.pll_bypass = 0, |
| 2278 | .io.pll_range = 0, |
| 2279 | .io.pll_prediv = 3, |
| 2280 | .io.pll_loopdiv = 6, |
| 2281 | .io.adc_clock_ratio = 0, |
| 2282 | .io.pll_int_loop_filt = 0, |
| 2283 | .reset = dib7090_tuner_sleep, |
| 2284 | .sleep = dib7090_tuner_sleep, |
| 2285 | |
| 2286 | .freq_offset_khz_uhf = 0, |
| 2287 | .freq_offset_khz_vhf = 0, |
| 2288 | |
| 2289 | .get_adc_power = dib7090_get_adc_power, |
| 2290 | |
| 2291 | .clkouttobamse = 1, |
| 2292 | .analog_output = 0, |
| 2293 | |
| 2294 | .wbd_vhf_offset = 0, |
| 2295 | .wbd_cband_offset = 0, |
| 2296 | .use_pwm_agc = 1, |
| 2297 | .clkoutdrive = 0, |
| 2298 | |
| 2299 | .fref_clock_ratio = 0, |
| 2300 | |
| 2301 | .wbd = dib7090_wbd_table, |
| 2302 | |
| 2303 | .ls_cfg_pad_drv = 0, |
| 2304 | .data_tx_drv = 0, |
| 2305 | .low_if = NULL, |
| 2306 | .in_soc = 1, |
| 2307 | }; |
| 2308 | |
| 2309 | static const struct dib0090_config tfe7090pvr_dib0090_config[2] = { |
| 2310 | { |
| 2311 | .io.clock_khz = 12000, |
| 2312 | .io.pll_bypass = 0, |
| 2313 | .io.pll_range = 0, |
| 2314 | .io.pll_prediv = 3, |
| 2315 | .io.pll_loopdiv = 6, |
| 2316 | .io.adc_clock_ratio = 0, |
| 2317 | .io.pll_int_loop_filt = 0, |
| 2318 | .reset = dib7090_tuner_sleep, |
| 2319 | .sleep = dib7090_tuner_sleep, |
| 2320 | |
| 2321 | .freq_offset_khz_uhf = 50, |
| 2322 | .freq_offset_khz_vhf = 70, |
| 2323 | |
| 2324 | .get_adc_power = dib7090_get_adc_power, |
| 2325 | |
| 2326 | .clkouttobamse = 1, |
| 2327 | .analog_output = 0, |
| 2328 | |
| 2329 | .wbd_vhf_offset = 0, |
| 2330 | .wbd_cband_offset = 0, |
| 2331 | .use_pwm_agc = 1, |
| 2332 | .clkoutdrive = 0, |
| 2333 | |
| 2334 | .fref_clock_ratio = 0, |
| 2335 | |
| 2336 | .wbd = dib7090_wbd_table, |
| 2337 | |
| 2338 | .ls_cfg_pad_drv = 0, |
| 2339 | .data_tx_drv = 0, |
| 2340 | .low_if = NULL, |
| 2341 | .in_soc = 1, |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2342 | }, { |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2343 | .io.clock_khz = 12000, |
| 2344 | .io.pll_bypass = 0, |
| 2345 | .io.pll_range = 0, |
| 2346 | .io.pll_prediv = 3, |
| 2347 | .io.pll_loopdiv = 6, |
| 2348 | .io.adc_clock_ratio = 0, |
| 2349 | .io.pll_int_loop_filt = 0, |
| 2350 | .reset = dib7090_tuner_sleep, |
| 2351 | .sleep = dib7090_tuner_sleep, |
| 2352 | |
| 2353 | .freq_offset_khz_uhf = -50, |
| 2354 | .freq_offset_khz_vhf = -70, |
| 2355 | |
| 2356 | .get_adc_power = dib7090_get_adc_power, |
| 2357 | |
| 2358 | .clkouttobamse = 1, |
| 2359 | .analog_output = 0, |
| 2360 | |
| 2361 | .wbd_vhf_offset = 0, |
| 2362 | .wbd_cband_offset = 0, |
| 2363 | .use_pwm_agc = 1, |
| 2364 | .clkoutdrive = 0, |
| 2365 | |
| 2366 | .fref_clock_ratio = 0, |
| 2367 | |
| 2368 | .wbd = dib7090_wbd_table, |
| 2369 | |
| 2370 | .ls_cfg_pad_drv = 0, |
| 2371 | .data_tx_drv = 0, |
| 2372 | .low_if = NULL, |
| 2373 | .in_soc = 1, |
| 2374 | } |
| 2375 | }; |
| 2376 | |
| 2377 | static int nim7090_frontend_attach(struct dvb_usb_adapter *adap) |
| 2378 | { |
| 2379 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2380 | msleep(20); |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2381 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 2382 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 2383 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 2384 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 2385 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2386 | msleep(20); |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2387 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2388 | msleep(20); |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2389 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 2390 | |
| 2391 | if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 0x10, &nim7090_dib7000p_config) != 0) { |
| 2392 | err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", __func__); |
| 2393 | return -ENODEV; |
| 2394 | } |
| 2395 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, &nim7090_dib7000p_config); |
| 2396 | |
| 2397 | return adap->fe == NULL ? -ENODEV : 0; |
| 2398 | } |
| 2399 | |
| 2400 | static int nim7090_tuner_attach(struct dvb_usb_adapter *adap) |
| 2401 | { |
| 2402 | struct dib0700_adapter_state *st = adap->priv; |
| 2403 | struct i2c_adapter *tun_i2c = dib7090_get_i2c_tuner(adap->fe); |
| 2404 | |
| 2405 | if (dvb_attach(dib0090_register, adap->fe, tun_i2c, &nim7090_dib0090_config) == NULL) |
| 2406 | return -ENODEV; |
| 2407 | |
| 2408 | dib7000p_set_gpio(adap->fe, 8, 0, 1); |
| 2409 | |
| 2410 | st->set_param_save = adap->fe->ops.tuner_ops.set_params; |
| 2411 | adap->fe->ops.tuner_ops.set_params = dib7090_agc_startup; |
| 2412 | return 0; |
| 2413 | } |
| 2414 | |
| 2415 | static int tfe7090pvr_frontend0_attach(struct dvb_usb_adapter *adap) |
| 2416 | { |
| 2417 | struct dib0700_state *st = adap->dev->priv; |
| 2418 | |
| 2419 | /* The TFE7090 requires the dib0700 to not be in master mode */ |
| 2420 | st->disable_streaming_master_mode = 1; |
| 2421 | |
| 2422 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2423 | msleep(20); |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2424 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 2425 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 2426 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 2427 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 2428 | |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2429 | msleep(20); |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2430 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
Olivier Grenie | b4d6046e | 2011-01-04 13:08:14 -0300 | [diff] [blame] | 2431 | msleep(20); |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2432 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 2433 | |
| 2434 | /* initialize IC 0 */ |
| 2435 | if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 0x20, &tfe7090pvr_dib7000p_config[0]) != 0) { |
| 2436 | err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", __func__); |
| 2437 | return -ENODEV; |
| 2438 | } |
| 2439 | |
| 2440 | dib0700_set_i2c_speed(adap->dev, 340); |
| 2441 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x90, &tfe7090pvr_dib7000p_config[0]); |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2442 | if (adap->fe == NULL) |
| 2443 | return -ENODEV; |
| 2444 | |
Patrick Boettcher | 7168252 | 2011-04-03 12:44:25 -0300 | [diff] [blame] | 2445 | dib7090_slave_reset(adap->fe); |
| 2446 | |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2447 | return 0; |
| 2448 | } |
| 2449 | |
| 2450 | static int tfe7090pvr_frontend1_attach(struct dvb_usb_adapter *adap) |
| 2451 | { |
| 2452 | struct i2c_adapter *i2c; |
| 2453 | |
| 2454 | if (adap->dev->adapter[0].fe == NULL) { |
| 2455 | err("the master dib7090 has to be initialized first"); |
| 2456 | return -ENODEV; /* the master device has not been initialized */ |
| 2457 | } |
| 2458 | |
| 2459 | i2c = dib7000p_get_i2c_master(adap->dev->adapter[0].fe, DIBX000_I2C_INTERFACE_GPIO_6_7, 1); |
| 2460 | if (dib7000p_i2c_enumeration(i2c, 1, 0x10, &tfe7090pvr_dib7000p_config[1]) != 0) { |
| 2461 | err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", __func__); |
| 2462 | return -ENODEV; |
| 2463 | } |
| 2464 | |
| 2465 | adap->fe = dvb_attach(dib7000p_attach, i2c, 0x92, &tfe7090pvr_dib7000p_config[1]); |
| 2466 | dib0700_set_i2c_speed(adap->dev, 200); |
| 2467 | |
| 2468 | return adap->fe == NULL ? -ENODEV : 0; |
| 2469 | } |
| 2470 | |
| 2471 | static int tfe7090pvr_tuner0_attach(struct dvb_usb_adapter *adap) |
| 2472 | { |
| 2473 | struct dib0700_adapter_state *st = adap->priv; |
| 2474 | struct i2c_adapter *tun_i2c = dib7090_get_i2c_tuner(adap->fe); |
| 2475 | |
| 2476 | if (dvb_attach(dib0090_register, adap->fe, tun_i2c, &tfe7090pvr_dib0090_config[0]) == NULL) |
| 2477 | return -ENODEV; |
| 2478 | |
| 2479 | dib7000p_set_gpio(adap->fe, 8, 0, 1); |
| 2480 | |
| 2481 | st->set_param_save = adap->fe->ops.tuner_ops.set_params; |
| 2482 | adap->fe->ops.tuner_ops.set_params = dib7090_agc_startup; |
| 2483 | return 0; |
| 2484 | } |
| 2485 | |
| 2486 | static int tfe7090pvr_tuner1_attach(struct dvb_usb_adapter *adap) |
| 2487 | { |
| 2488 | struct dib0700_adapter_state *st = adap->priv; |
| 2489 | struct i2c_adapter *tun_i2c = dib7090_get_i2c_tuner(adap->fe); |
| 2490 | |
| 2491 | if (dvb_attach(dib0090_register, adap->fe, tun_i2c, &tfe7090pvr_dib0090_config[1]) == NULL) |
| 2492 | return -ENODEV; |
| 2493 | |
| 2494 | dib7000p_set_gpio(adap->fe, 8, 0, 1); |
| 2495 | |
| 2496 | st->set_param_save = adap->fe->ops.tuner_ops.set_params; |
| 2497 | adap->fe->ops.tuner_ops.set_params = dib7090_agc_startup; |
| 2498 | return 0; |
| 2499 | } |
| 2500 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2501 | /* STK7070PD */ |
| 2502 | static struct dib7000p_config stk7070pd_dib7000p_config[2] = { |
| 2503 | { |
| 2504 | .output_mpeg2_in_188_bytes = 1, |
| 2505 | |
| 2506 | .agc_config_count = 1, |
| 2507 | .agc = &dib7070_agc_config, |
| 2508 | .bw = &dib7070_bw_config_12_mhz, |
Patrick Boettcher | 3cb2c39 | 2008-01-25 07:25:20 -0300 | [diff] [blame] | 2509 | .tuner_is_baseband = 1, |
| 2510 | .spur_protect = 1, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2511 | |
| 2512 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
| 2513 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, |
| 2514 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
| 2515 | |
| 2516 | .hostbus_diversity = 1, |
| 2517 | }, { |
| 2518 | .output_mpeg2_in_188_bytes = 1, |
| 2519 | |
| 2520 | .agc_config_count = 1, |
| 2521 | .agc = &dib7070_agc_config, |
| 2522 | .bw = &dib7070_bw_config_12_mhz, |
Patrick Boettcher | 3cb2c39 | 2008-01-25 07:25:20 -0300 | [diff] [blame] | 2523 | .tuner_is_baseband = 1, |
| 2524 | .spur_protect = 1, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2525 | |
| 2526 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
| 2527 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, |
| 2528 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
| 2529 | |
| 2530 | .hostbus_diversity = 1, |
| 2531 | } |
| 2532 | }; |
| 2533 | |
| 2534 | static int stk7070pd_frontend_attach0(struct dvb_usb_adapter *adap) |
| 2535 | { |
| 2536 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 2537 | msleep(10); |
| 2538 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 2539 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 2540 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 2541 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 2542 | |
| 2543 | dib0700_ctrl_clock(adap->dev, 72, 1); |
| 2544 | |
| 2545 | msleep(10); |
| 2546 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 2547 | msleep(10); |
| 2548 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 2549 | |
Devin Heitmueller | 83c4fdf | 2009-01-21 01:55:45 -0300 | [diff] [blame] | 2550 | if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 2, 18, |
| 2551 | stk7070pd_dib7000p_config) != 0) { |
| 2552 | err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", |
| 2553 | __func__); |
| 2554 | return -ENODEV; |
| 2555 | } |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2556 | |
| 2557 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, &stk7070pd_dib7000p_config[0]); |
| 2558 | return adap->fe == NULL ? -ENODEV : 0; |
| 2559 | } |
| 2560 | |
| 2561 | static int stk7070pd_frontend_attach1(struct dvb_usb_adapter *adap) |
| 2562 | { |
| 2563 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x82, &stk7070pd_dib7000p_config[1]); |
| 2564 | return adap->fe == NULL ? -ENODEV : 0; |
| 2565 | } |
| 2566 | |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 2567 | /* S5H1411 */ |
| 2568 | static struct s5h1411_config pinnacle_801e_config = { |
| 2569 | .output_mode = S5H1411_PARALLEL_OUTPUT, |
| 2570 | .gpio = S5H1411_GPIO_OFF, |
| 2571 | .mpeg_timing = S5H1411_MPEGTIMING_NONCONTINOUS_NONINVERTING_CLOCK, |
| 2572 | .qam_if = S5H1411_IF_44000, |
| 2573 | .vsb_if = S5H1411_IF_44000, |
| 2574 | .inversion = S5H1411_INVERSION_OFF, |
| 2575 | .status_mode = S5H1411_DEMODLOCKING |
| 2576 | }; |
| 2577 | |
| 2578 | /* Pinnacle PCTV HD Pro 801e GPIOs map: |
| 2579 | GPIO0 - currently unknown |
| 2580 | GPIO1 - xc5000 tuner reset |
| 2581 | GPIO2 - CX25843 sleep |
| 2582 | GPIO3 - currently unknown |
| 2583 | GPIO4 - currently unknown |
| 2584 | GPIO6 - currently unknown |
| 2585 | GPIO7 - currently unknown |
| 2586 | GPIO9 - currently unknown |
| 2587 | GPIO10 - CX25843 reset |
| 2588 | */ |
| 2589 | static int s5h1411_frontend_attach(struct dvb_usb_adapter *adap) |
| 2590 | { |
| 2591 | struct dib0700_state *st = adap->dev->priv; |
| 2592 | |
| 2593 | /* Make use of the new i2c functions from FW 1.20 */ |
| 2594 | st->fw_use_new_i2c_api = 1; |
| 2595 | |
| 2596 | /* The s5h1411 requires the dib0700 to not be in master mode */ |
| 2597 | st->disable_streaming_master_mode = 1; |
| 2598 | |
| 2599 | /* All msleep values taken from Windows USB trace */ |
| 2600 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 0); |
| 2601 | dib0700_set_gpio(adap->dev, GPIO3, GPIO_OUT, 0); |
| 2602 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 2603 | msleep(400); |
| 2604 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 2605 | msleep(60); |
| 2606 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 2607 | msleep(30); |
| 2608 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 2609 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 2610 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 2611 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 2612 | dib0700_set_gpio(adap->dev, GPIO2, GPIO_OUT, 0); |
| 2613 | msleep(30); |
| 2614 | |
| 2615 | /* Put the CX25843 to sleep for now since we're in digital mode */ |
| 2616 | dib0700_set_gpio(adap->dev, GPIO2, GPIO_OUT, 1); |
| 2617 | |
| 2618 | /* GPIOs are initialized, do the attach */ |
| 2619 | adap->fe = dvb_attach(s5h1411_attach, &pinnacle_801e_config, |
| 2620 | &adap->dev->i2c_adap); |
| 2621 | return adap->fe == NULL ? -ENODEV : 0; |
| 2622 | } |
| 2623 | |
Michael Krufky | 767f3b3 | 2008-09-25 09:47:07 -0300 | [diff] [blame] | 2624 | static int dib0700_xc5000_tuner_callback(void *priv, int component, |
| 2625 | int command, int arg) |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 2626 | { |
| 2627 | struct dvb_usb_adapter *adap = priv; |
| 2628 | |
Devin Heitmueller | 79025a9 | 2008-10-06 12:07:48 -0300 | [diff] [blame] | 2629 | if (command == XC5000_TUNER_RESET) { |
| 2630 | /* Reset the tuner */ |
| 2631 | dib0700_set_gpio(adap->dev, GPIO1, GPIO_OUT, 0); |
Devin Heitmueller | f0f4633 | 2009-05-04 21:57:41 -0300 | [diff] [blame] | 2632 | msleep(10); |
Devin Heitmueller | 79025a9 | 2008-10-06 12:07:48 -0300 | [diff] [blame] | 2633 | dib0700_set_gpio(adap->dev, GPIO1, GPIO_OUT, 1); |
Devin Heitmueller | f0f4633 | 2009-05-04 21:57:41 -0300 | [diff] [blame] | 2634 | msleep(10); |
Devin Heitmueller | 79025a9 | 2008-10-06 12:07:48 -0300 | [diff] [blame] | 2635 | } else { |
| 2636 | err("xc5000: unknown tuner callback command: %d\n", command); |
| 2637 | return -EINVAL; |
| 2638 | } |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 2639 | |
| 2640 | return 0; |
| 2641 | } |
| 2642 | |
| 2643 | static struct xc5000_config s5h1411_xc5000_tunerconfig = { |
| 2644 | .i2c_address = 0x64, |
| 2645 | .if_khz = 5380, |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 2646 | }; |
| 2647 | |
| 2648 | static int xc5000_tuner_attach(struct dvb_usb_adapter *adap) |
| 2649 | { |
Devin Heitmueller | 79025a9 | 2008-10-06 12:07:48 -0300 | [diff] [blame] | 2650 | /* FIXME: generalize & move to common area */ |
| 2651 | adap->fe->callback = dib0700_xc5000_tuner_callback; |
| 2652 | |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 2653 | return dvb_attach(xc5000_attach, adap->fe, &adap->dev->i2c_adap, |
Michael Krufky | 767f3b3 | 2008-09-25 09:47:07 -0300 | [diff] [blame] | 2654 | &s5h1411_xc5000_tunerconfig) |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 2655 | == NULL ? -ENODEV : 0; |
| 2656 | } |
| 2657 | |
Michael Krufky | ce904bc | 2009-01-19 01:12:55 -0300 | [diff] [blame] | 2658 | static struct lgdt3305_config hcw_lgdt3305_config = { |
| 2659 | .i2c_addr = 0x0e, |
| 2660 | .mpeg_mode = LGDT3305_MPEG_PARALLEL, |
| 2661 | .tpclk_edge = LGDT3305_TPCLK_FALLING_EDGE, |
| 2662 | .tpvalid_polarity = LGDT3305_TP_VALID_LOW, |
| 2663 | .deny_i2c_rptr = 0, |
| 2664 | .spectral_inversion = 1, |
| 2665 | .qam_if_khz = 6000, |
| 2666 | .vsb_if_khz = 6000, |
| 2667 | .usref_8vsb = 0x0500, |
| 2668 | }; |
| 2669 | |
| 2670 | static struct mxl5007t_config hcw_mxl5007t_config = { |
| 2671 | .xtal_freq_hz = MxL_XTAL_25_MHZ, |
| 2672 | .if_freq_hz = MxL_IF_6_MHZ, |
| 2673 | .invert_if = 1, |
| 2674 | }; |
| 2675 | |
| 2676 | /* TIGER-ATSC map: |
| 2677 | GPIO0 - LNA_CTR (H: LNA power enabled, L: LNA power disabled) |
| 2678 | GPIO1 - ANT_SEL (H: VPA, L: MCX) |
| 2679 | GPIO4 - SCL2 |
| 2680 | GPIO6 - EN_TUNER |
| 2681 | GPIO7 - SDA2 |
| 2682 | GPIO10 - DEM_RST |
| 2683 | |
| 2684 | MXL is behind LG's i2c repeater. LG is on SCL2/SDA2 gpios on the DIB |
| 2685 | */ |
| 2686 | static int lgdt3305_frontend_attach(struct dvb_usb_adapter *adap) |
| 2687 | { |
| 2688 | struct dib0700_state *st = adap->dev->priv; |
| 2689 | |
| 2690 | /* Make use of the new i2c functions from FW 1.20 */ |
| 2691 | st->fw_use_new_i2c_api = 1; |
| 2692 | |
| 2693 | st->disable_streaming_master_mode = 1; |
| 2694 | |
| 2695 | /* fe power enable */ |
| 2696 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); |
| 2697 | msleep(30); |
| 2698 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 2699 | msleep(30); |
| 2700 | |
| 2701 | /* demod reset */ |
| 2702 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 2703 | msleep(30); |
| 2704 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 2705 | msleep(30); |
| 2706 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 2707 | msleep(30); |
| 2708 | |
| 2709 | adap->fe = dvb_attach(lgdt3305_attach, |
| 2710 | &hcw_lgdt3305_config, |
| 2711 | &adap->dev->i2c_adap); |
| 2712 | |
| 2713 | return adap->fe == NULL ? -ENODEV : 0; |
| 2714 | } |
| 2715 | |
| 2716 | static int mxl5007t_tuner_attach(struct dvb_usb_adapter *adap) |
| 2717 | { |
| 2718 | return dvb_attach(mxl5007t_attach, adap->fe, |
| 2719 | &adap->dev->i2c_adap, 0x60, |
| 2720 | &hcw_mxl5007t_config) == NULL ? -ENODEV : 0; |
| 2721 | } |
| 2722 | |
| 2723 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2724 | /* DVB-USB and USB stuff follows */ |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 2725 | struct usb_device_id dib0700_usb_id_table[] = { |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2726 | /* 0 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P) }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 2727 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P_PC) }, |
| 2728 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500) }, |
| 2729 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500_2) }, |
| 2730 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK) }, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2731 | /* 5 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR) }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 2732 | { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500) }, |
| 2733 | { USB_DEVICE(USB_VID_UNIWILL, USB_PID_UNIWILL_STK7700P) }, |
| 2734 | { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_STK7700P) }, |
| 2735 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_2) }, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2736 | /* 10 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR_2) }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 2737 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV2000E) }, |
| 2738 | { USB_DEVICE(USB_VID_TERRATEC, |
| 2739 | USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY) }, |
| 2740 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_TD_STICK) }, |
| 2741 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700D) }, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2742 | /* 15 */{ USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070P) }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 2743 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV_DVB_T_FLASH) }, |
| 2744 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070PD) }, |
| 2745 | { USB_DEVICE(USB_VID_PINNACLE, |
| 2746 | USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T) }, |
| 2747 | { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500_PC) }, |
Joachim Steiger | fa3b877 | 2007-10-08 20:08:46 -0300 | [diff] [blame] | 2748 | /* 20 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_EXPRESS) }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 2749 | { USB_DEVICE(USB_VID_GIGABYTE, USB_PID_GIGABYTE_U7000) }, |
| 2750 | { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14BR) }, |
| 2751 | { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3000) }, |
| 2752 | { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3100) }, |
| 2753 | /* 25 */{ USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_3) }, |
| 2754 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_MYTV_T) }, |
| 2755 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_HT_USB_XE) }, |
| 2756 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_EXPRESSCARD_320CX) }, |
| 2757 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV72E) }, |
| 2758 | /* 30 */{ USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV73E) }, |
| 2759 | { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_EC372S) }, |
| 2760 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_HT_EXPRESS) }, |
Alexander Simon | dc88807 | 2008-03-29 21:37:54 -0300 | [diff] [blame] | 2761 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_XXS) }, |
Darryl Green | 5da4e2c | 2008-03-29 21:47:43 -0300 | [diff] [blame] | 2762 | { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_STK7700P_2) }, |
Michael Krufky | af2a887 | 2008-09-03 17:12:24 -0300 | [diff] [blame] | 2763 | /* 35 */{ USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_TD_STICK_52009) }, |
Michael Krufky | 9a0c04a | 2008-09-03 17:12:24 -0300 | [diff] [blame] | 2764 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500_3) }, |
Finn Thain | 17a370b | 2008-09-06 13:42:47 -0300 | [diff] [blame] | 2765 | { USB_DEVICE(USB_VID_GIGABYTE, USB_PID_GIGABYTE_U8000) }, |
Daniel Oliveira Nascimento | 8751aaa | 2008-09-07 12:39:44 -0300 | [diff] [blame] | 2766 | { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_STK7700PH) }, |
Albert Comerma | 5769743 | 2008-09-07 12:43:33 -0300 | [diff] [blame] | 2767 | { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3000H) }, |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 2768 | /* 40 */{ USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV801E) }, |
Devin Heitmueller | d2fc3bf | 2008-09-25 06:22:23 -0300 | [diff] [blame] | 2769 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV801E_SE) }, |
Yusuf Altin | bb1b082 | 2009-01-08 07:58:45 -0300 | [diff] [blame] | 2770 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_EXPRESS) }, |
Nicolas Fournier | db4b2d1 | 2009-01-13 07:15:25 -0300 | [diff] [blame] | 2771 | { USB_DEVICE(USB_VID_TERRATEC, |
| 2772 | USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY_2) }, |
sebastian.blanes@gmail.com | 0a6e1ed | 2009-02-24 14:51:43 -0300 | [diff] [blame] | 2773 | { USB_DEVICE(USB_VID_SONY, USB_PID_SONY_PLAYTV) }, |
Pascal Terjan | 9abb6e6 | 2009-02-26 10:31:41 -0300 | [diff] [blame] | 2774 | /* 45 */{ USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_PD378S) }, |
Michael Krufky | ce904bc | 2009-01-19 01:12:55 -0300 | [diff] [blame] | 2775 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_TIGER_ATSC) }, |
| 2776 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_TIGER_ATSC_B210) }, |
Xoan Loureiro | 16ba1ee | 2009-03-29 08:43:36 -0300 | [diff] [blame] | 2777 | { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_MC770) }, |
Klaus Flittner | 919a548 | 2009-03-29 09:12:06 -0300 | [diff] [blame] | 2778 | { USB_DEVICE(USB_VID_ELGATO, USB_PID_ELGATO_EYETV_DTT) }, |
Armin Schenker | 513846e | 2009-04-20 11:57:49 -0300 | [diff] [blame] | 2779 | /* 50 */{ USB_DEVICE(USB_VID_ELGATO, USB_PID_ELGATO_EYETV_DTT_Dlx) }, |
tomas petr | f0f4ae7 | 2009-05-20 05:28:05 -0300 | [diff] [blame] | 2780 | { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_H) }, |
Patrick Boettcher | a9b8fe3 | 2009-05-20 05:35:02 -0300 | [diff] [blame] | 2781 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_T3) }, |
| 2782 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_T5) }, |
Pete Hildebrandt | c53d83c | 2009-08-05 11:46:38 -0300 | [diff] [blame] | 2783 | { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_STK7700D) }, |
Olivier Grenie | 74b76f2 | 2009-09-02 08:19:19 -0300 | [diff] [blame] | 2784 | /* 55 */{ USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_STK7700D_2) }, |
| 2785 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV73A) }, |
Patrick Boettcher | e414753 | 2009-11-30 13:52:57 -0300 | [diff] [blame] | 2786 | { USB_DEVICE(USB_VID_PCTV, USB_PID_PINNACLE_PCTV73ESE) }, |
| 2787 | { USB_DEVICE(USB_VID_PCTV, USB_PID_PINNACLE_PCTV282E) }, |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 2788 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7770P) }, |
Patrick Boettcher | db48138 | 2009-09-15 07:16:51 -0300 | [diff] [blame] | 2789 | /* 60 */{ USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_XXS_2) }, |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 2790 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK807XPVR) }, |
| 2791 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK807XP) }, |
Mauro Carvalho Chehab | 3bfb317 | 2010-09-03 10:50:24 -0300 | [diff] [blame] | 2792 | { USB_DEVICE_VER(USB_VID_PIXELVIEW, USB_PID_PIXELVIEW_SBTVD, 0x000, 0x3f00) }, |
S?rgio Fortier | 8a378e8 | 2009-09-28 04:19:21 -0300 | [diff] [blame] | 2793 | { USB_DEVICE(USB_VID_EVOLUTEPC, USB_PID_TVWAY_PLUS) }, |
Patrick Boettcher | 20232c4 | 2009-12-01 12:08:56 -0300 | [diff] [blame] | 2794 | /* 65 */{ USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV73ESE) }, |
Patrick Boettcher | e414753 | 2009-11-30 13:52:57 -0300 | [diff] [blame] | 2795 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV282E) }, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 2796 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK8096GP) }, |
Michael Müller | 84e2f03 | 2010-04-26 22:18:57 -0300 | [diff] [blame] | 2797 | { USB_DEVICE(USB_VID_ELGATO, USB_PID_ELGATO_EYETV_DIVERSITY) }, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 2798 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_NIM9090M) }, |
| 2799 | /* 70 */{ USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_NIM8096MD) }, |
| 2800 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_NIM9090MD) }, |
| 2801 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_NIM7090) }, |
| 2802 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_TFE7090PVR) }, |
Lukas Max Fisch | 498e677 | 2011-02-08 16:51:45 -0300 | [diff] [blame] | 2803 | { USB_DEVICE(USB_VID_TECHNISAT, USB_PID_TECHNISAT_AIRSTAR_TELESTICK_2) }, |
Stéphane Elmaleh | d140230 | 2011-05-21 07:33:38 -0300 | [diff] [blame] | 2804 | /* 75 */{ USB_DEVICE(USB_VID_MEDION, USB_PID_CREATIX_CTX1921) }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 2805 | { 0 } /* Terminating entry */ |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 2806 | }; |
| 2807 | MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table); |
| 2808 | |
| 2809 | #define DIB0700_DEFAULT_DEVICE_PROPERTIES \ |
| 2810 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, \ |
| 2811 | .usb_ctrl = DEVICE_SPECIFIC, \ |
Devin Heitmueller | bdc203e | 2008-09-06 13:45:27 -0300 | [diff] [blame] | 2812 | .firmware = "dvb-usb-dib0700-1.20.fw", \ |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 2813 | .download_firmware = dib0700_download_firmware, \ |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 2814 | .no_reconnect = 1, \ |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 2815 | .size_of_priv = sizeof(struct dib0700_state), \ |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 2816 | .i2c_algo = &dib0700_i2c_algo, \ |
| 2817 | .identify_state = dib0700_identify_state |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 2818 | |
| 2819 | #define DIB0700_DEFAULT_STREAMING_CONFIG(ep) \ |
| 2820 | .streaming_ctrl = dib0700_streaming_ctrl, \ |
| 2821 | .stream = { \ |
| 2822 | .type = USB_BULK, \ |
| 2823 | .count = 4, \ |
| 2824 | .endpoint = ep, \ |
| 2825 | .u = { \ |
| 2826 | .bulk = { \ |
| 2827 | .buffersize = 39480, \ |
| 2828 | } \ |
| 2829 | } \ |
| 2830 | } |
| 2831 | |
| 2832 | struct dvb_usb_device_properties dib0700_devices[] = { |
| 2833 | { |
| 2834 | DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2835 | |
| 2836 | .num_adapters = 1, |
| 2837 | .adapter = { |
| 2838 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2839 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2840 | .pid_filter_count = 32, |
Olivier Grenie | e192a7c | 2011-01-14 13:58:59 -0300 | [diff] [blame] | 2841 | .pid_filter = stk7700p_pid_filter, |
| 2842 | .pid_filter_ctrl = stk7700p_pid_filter_ctrl, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 2843 | .frontend_attach = stk7700p_frontend_attach, |
| 2844 | .tuner_attach = stk7700p_tuner_attach, |
| 2845 | |
| 2846 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2847 | }, |
| 2848 | }, |
| 2849 | |
dominik | 67053a4 | 2007-11-10 19:23:31 -0300 | [diff] [blame] | 2850 | .num_device_descs = 8, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 2851 | .devices = { |
| 2852 | { "DiBcom STK7700P reference design", |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 2853 | { &dib0700_usb_id_table[0], &dib0700_usb_id_table[1] }, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 2854 | { NULL }, |
| 2855 | }, |
| 2856 | { "Hauppauge Nova-T Stick", |
Stefan Traby | f9aeba4 | 2006-11-12 13:02:51 -0300 | [diff] [blame] | 2857 | { &dib0700_usb_id_table[4], &dib0700_usb_id_table[9], NULL }, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 2858 | { NULL }, |
| 2859 | }, |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 2860 | { "AVerMedia AVerTV DVB-T Volar", |
Jose Carlos Garcia Sogo | ced8fec | 2006-11-14 05:01:47 -0300 | [diff] [blame] | 2861 | { &dib0700_usb_id_table[5], &dib0700_usb_id_table[10] }, |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 2862 | { NULL }, |
| 2863 | }, |
| 2864 | { "Compro Videomate U500", |
Patrick Boettcher | 1f8ca4b | 2007-07-30 14:24:37 -0300 | [diff] [blame] | 2865 | { &dib0700_usb_id_table[6], &dib0700_usb_id_table[19] }, |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 2866 | { NULL }, |
Henning Schroeer | 0ce215e | 2006-10-19 07:58:22 -0300 | [diff] [blame] | 2867 | }, |
| 2868 | { "Uniwill STK7700P based (Hama and others)", |
| 2869 | { &dib0700_usb_id_table[7], NULL }, |
| 2870 | { NULL }, |
Michael Krufky | 8637a87 | 2006-11-08 16:47:32 -0300 | [diff] [blame] | 2871 | }, |
| 2872 | { "Leadtek Winfast DTV Dongle (STK7700P based)", |
Patrick Boettcher | 1e13c8f | 2009-09-19 05:24:40 -0300 | [diff] [blame] | 2873 | { &dib0700_usb_id_table[8], &dib0700_usb_id_table[34] }, |
Michael Krufky | 8637a87 | 2006-11-08 16:47:32 -0300 | [diff] [blame] | 2874 | { NULL }, |
Joachim Steiger | fa3b877 | 2007-10-08 20:08:46 -0300 | [diff] [blame] | 2875 | }, |
| 2876 | { "AVerMedia AVerTV DVB-T Express", |
| 2877 | { &dib0700_usb_id_table[20] }, |
| 2878 | { NULL }, |
dominik | 67053a4 | 2007-11-10 19:23:31 -0300 | [diff] [blame] | 2879 | }, |
dominik | 67053a4 | 2007-11-10 19:23:31 -0300 | [diff] [blame] | 2880 | { "Gigabyte U7000", |
| 2881 | { &dib0700_usb_id_table[21], NULL }, |
| 2882 | { NULL }, |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 2883 | } |
Darren Salt | b1139e3 | 2007-08-18 18:05:31 -0300 | [diff] [blame] | 2884 | }, |
| 2885 | |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 2886 | .rc.core = { |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 2887 | .rc_interval = DEFAULT_RC_INTERVAL, |
Mauro Carvalho Chehab | 5af935c | 2010-08-01 08:02:35 -0300 | [diff] [blame] | 2888 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
Mauro Carvalho Chehab | 0ffd1ab | 2010-08-01 09:37:23 -0300 | [diff] [blame] | 2889 | .rc_query = dib0700_rc_query_old_firmware, |
Mauro Carvalho Chehab | 52b6614 | 2010-11-17 14:20:52 -0300 | [diff] [blame] | 2890 | .allowed_protos = RC_TYPE_RC5 | |
| 2891 | RC_TYPE_RC6 | |
| 2892 | RC_TYPE_NEC, |
David Härdeman | d8b4b58 | 2010-10-29 16:08:23 -0300 | [diff] [blame] | 2893 | .change_protocol = dib0700_change_protocol, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 2894 | }, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 2895 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2896 | |
| 2897 | .num_adapters = 2, |
| 2898 | .adapter = { |
| 2899 | { |
| 2900 | .frontend_attach = bristol_frontend_attach, |
| 2901 | .tuner_attach = bristol_tuner_attach, |
| 2902 | |
| 2903 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2904 | }, { |
| 2905 | .frontend_attach = bristol_frontend_attach, |
| 2906 | .tuner_attach = bristol_tuner_attach, |
| 2907 | |
| 2908 | DIB0700_DEFAULT_STREAMING_CONFIG(0x03), |
| 2909 | } |
| 2910 | }, |
| 2911 | |
| 2912 | .num_device_descs = 1, |
| 2913 | .devices = { |
| 2914 | { "Hauppauge Nova-T 500 Dual DVB-T", |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 2915 | { &dib0700_usb_id_table[2], &dib0700_usb_id_table[3], NULL }, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 2916 | { NULL }, |
| 2917 | }, |
Janne Grunau | 82f3d55 | 2007-07-30 13:50:28 -0300 | [diff] [blame] | 2918 | }, |
| 2919 | |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 2920 | .rc.core = { |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 2921 | .rc_interval = DEFAULT_RC_INTERVAL, |
Mauro Carvalho Chehab | 5af935c | 2010-08-01 08:02:35 -0300 | [diff] [blame] | 2922 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
Mauro Carvalho Chehab | 0ffd1ab | 2010-08-01 09:37:23 -0300 | [diff] [blame] | 2923 | .rc_query = dib0700_rc_query_old_firmware, |
Mauro Carvalho Chehab | 52b6614 | 2010-11-17 14:20:52 -0300 | [diff] [blame] | 2924 | .allowed_protos = RC_TYPE_RC5 | |
| 2925 | RC_TYPE_RC6 | |
| 2926 | RC_TYPE_NEC, |
David Härdeman | d8b4b58 | 2010-10-29 16:08:23 -0300 | [diff] [blame] | 2927 | .change_protocol = dib0700_change_protocol, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 2928 | }, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 2929 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2930 | |
| 2931 | .num_adapters = 2, |
| 2932 | .adapter = { |
| 2933 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2934 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2935 | .pid_filter_count = 32, |
| 2936 | .pid_filter = stk70x0p_pid_filter, |
| 2937 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 2938 | .frontend_attach = stk7700d_frontend_attach, |
| 2939 | .tuner_attach = stk7700d_tuner_attach, |
| 2940 | |
| 2941 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2942 | }, { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2943 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2944 | .pid_filter_count = 32, |
| 2945 | .pid_filter = stk70x0p_pid_filter, |
| 2946 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 2947 | .frontend_attach = stk7700d_frontend_attach, |
| 2948 | .tuner_attach = stk7700d_tuner_attach, |
| 2949 | |
| 2950 | DIB0700_DEFAULT_STREAMING_CONFIG(0x03), |
| 2951 | } |
| 2952 | }, |
| 2953 | |
James A Webb | 200e861 | 2009-08-04 02:38:05 -0300 | [diff] [blame] | 2954 | .num_device_descs = 5, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 2955 | .devices = { |
| 2956 | { "Pinnacle PCTV 2000e", |
| 2957 | { &dib0700_usb_id_table[11], NULL }, |
| 2958 | { NULL }, |
| 2959 | }, |
| 2960 | { "Terratec Cinergy DT XS Diversity", |
| 2961 | { &dib0700_usb_id_table[12], NULL }, |
| 2962 | { NULL }, |
| 2963 | }, |
Darren Salt | faebb91 | 2007-08-18 18:04:00 -0300 | [diff] [blame] | 2964 | { "Hauppauge Nova-TD Stick/Elgato Eye-TV Diversity", |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 2965 | { &dib0700_usb_id_table[13], NULL }, |
| 2966 | { NULL }, |
| 2967 | }, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2968 | { "DiBcom STK7700D reference design", |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 2969 | { &dib0700_usb_id_table[14], NULL }, |
| 2970 | { NULL }, |
Yusuf Altin | bb1b082 | 2009-01-08 07:58:45 -0300 | [diff] [blame] | 2971 | }, |
James A Webb | 200e861 | 2009-08-04 02:38:05 -0300 | [diff] [blame] | 2972 | { "YUAN High-Tech DiBcom STK7700D", |
| 2973 | { &dib0700_usb_id_table[55], NULL }, |
| 2974 | { NULL }, |
| 2975 | }, |
Yusuf Altin | bb1b082 | 2009-01-08 07:58:45 -0300 | [diff] [blame] | 2976 | |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 2977 | }, |
Janne Grunau | 82f3d55 | 2007-07-30 13:50:28 -0300 | [diff] [blame] | 2978 | |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 2979 | .rc.core = { |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 2980 | .rc_interval = DEFAULT_RC_INTERVAL, |
Mauro Carvalho Chehab | 5af935c | 2010-08-01 08:02:35 -0300 | [diff] [blame] | 2981 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
Mauro Carvalho Chehab | 0ffd1ab | 2010-08-01 09:37:23 -0300 | [diff] [blame] | 2982 | .rc_query = dib0700_rc_query_old_firmware, |
Mauro Carvalho Chehab | 52b6614 | 2010-11-17 14:20:52 -0300 | [diff] [blame] | 2983 | .allowed_protos = RC_TYPE_RC5 | |
| 2984 | RC_TYPE_RC6 | |
| 2985 | RC_TYPE_NEC, |
David Härdeman | d8b4b58 | 2010-10-29 16:08:23 -0300 | [diff] [blame] | 2986 | .change_protocol = dib0700_change_protocol, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 2987 | }, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2988 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2989 | |
| 2990 | .num_adapters = 1, |
| 2991 | .adapter = { |
| 2992 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2993 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2994 | .pid_filter_count = 32, |
| 2995 | .pid_filter = stk70x0p_pid_filter, |
| 2996 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Daniel Gimpelevich | 132c318 | 2008-01-25 06:02:42 -0300 | [diff] [blame] | 2997 | .frontend_attach = stk7700P2_frontend_attach, |
| 2998 | .tuner_attach = stk7700d_tuner_attach, |
| 2999 | |
| 3000 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 3001 | }, |
| 3002 | }, |
| 3003 | |
Yusuf Altin | bb1b082 | 2009-01-08 07:58:45 -0300 | [diff] [blame] | 3004 | .num_device_descs = 3, |
Daniel Gimpelevich | 132c318 | 2008-01-25 06:02:42 -0300 | [diff] [blame] | 3005 | .devices = { |
| 3006 | { "ASUS My Cinema U3000 Mini DVBT Tuner", |
| 3007 | { &dib0700_usb_id_table[23], NULL }, |
| 3008 | { NULL }, |
| 3009 | }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 3010 | { "Yuan EC372S", |
| 3011 | { &dib0700_usb_id_table[31], NULL }, |
| 3012 | { NULL }, |
Yusuf Altin | bb1b082 | 2009-01-08 07:58:45 -0300 | [diff] [blame] | 3013 | }, |
| 3014 | { "Terratec Cinergy T Express", |
| 3015 | { &dib0700_usb_id_table[42], NULL }, |
| 3016 | { NULL }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 3017 | } |
Chris Rankin | 48aa739 | 2008-09-25 06:52:24 -0300 | [diff] [blame] | 3018 | }, |
| 3019 | |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 3020 | .rc.core = { |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 3021 | .rc_interval = DEFAULT_RC_INTERVAL, |
Mauro Carvalho Chehab | 5af935c | 2010-08-01 08:02:35 -0300 | [diff] [blame] | 3022 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 3023 | .module_name = "dib0700", |
Mauro Carvalho Chehab | 0ffd1ab | 2010-08-01 09:37:23 -0300 | [diff] [blame] | 3024 | .rc_query = dib0700_rc_query_old_firmware, |
Mauro Carvalho Chehab | 52b6614 | 2010-11-17 14:20:52 -0300 | [diff] [blame] | 3025 | .allowed_protos = RC_TYPE_RC5 | |
| 3026 | RC_TYPE_RC6 | |
| 3027 | RC_TYPE_NEC, |
David Härdeman | d8b4b58 | 2010-10-29 16:08:23 -0300 | [diff] [blame] | 3028 | .change_protocol = dib0700_change_protocol, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 3029 | }, |
Daniel Gimpelevich | 132c318 | 2008-01-25 06:02:42 -0300 | [diff] [blame] | 3030 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 3031 | |
| 3032 | .num_adapters = 1, |
| 3033 | .adapter = { |
| 3034 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 3035 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 3036 | .pid_filter_count = 32, |
| 3037 | .pid_filter = stk70x0p_pid_filter, |
| 3038 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 3039 | .frontend_attach = stk7070p_frontend_attach, |
| 3040 | .tuner_attach = dib7070p_tuner_attach, |
| 3041 | |
| 3042 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 3043 | |
| 3044 | .size_of_priv = sizeof(struct dib0700_adapter_state), |
| 3045 | }, |
| 3046 | }, |
| 3047 | |
Patrick Boettcher | 1e13c8f | 2009-09-19 05:24:40 -0300 | [diff] [blame] | 3048 | .num_device_descs = 11, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 3049 | .devices = { |
| 3050 | { "DiBcom STK7070P reference design", |
| 3051 | { &dib0700_usb_id_table[15], NULL }, |
| 3052 | { NULL }, |
| 3053 | }, |
| 3054 | { "Pinnacle PCTV DVB-T Flash Stick", |
| 3055 | { &dib0700_usb_id_table[16], NULL }, |
| 3056 | { NULL }, |
| 3057 | }, |
Yousef Lamlum | 7999a81 | 2008-01-25 05:51:48 -0300 | [diff] [blame] | 3058 | { "Artec T14BR DVB-T", |
| 3059 | { &dib0700_usb_id_table[22], NULL }, |
| 3060 | { NULL }, |
Daniel Gimpelevich | 132c318 | 2008-01-25 06:02:42 -0300 | [diff] [blame] | 3061 | }, |
| 3062 | { "ASUS My Cinema U3100 Mini DVBT Tuner", |
| 3063 | { &dib0700_usb_id_table[24], NULL }, |
| 3064 | { NULL }, |
| 3065 | }, |
Tim Taubert | c7637b1 | 2008-01-25 06:16:36 -0300 | [diff] [blame] | 3066 | { "Hauppauge Nova-T Stick", |
| 3067 | { &dib0700_usb_id_table[25], NULL }, |
| 3068 | { NULL }, |
| 3069 | }, |
Darren Salt | 13b83b5 | 2008-01-25 06:20:02 -0300 | [diff] [blame] | 3070 | { "Hauppauge Nova-T MyTV.t", |
| 3071 | { &dib0700_usb_id_table[26], NULL }, |
| 3072 | { NULL }, |
| 3073 | }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 3074 | { "Pinnacle PCTV 72e", |
| 3075 | { &dib0700_usb_id_table[29], NULL }, |
| 3076 | { NULL }, |
| 3077 | }, |
| 3078 | { "Pinnacle PCTV 73e", |
| 3079 | { &dib0700_usb_id_table[30], NULL }, |
| 3080 | { NULL }, |
| 3081 | }, |
Klaus Flittner | 919a548 | 2009-03-29 09:12:06 -0300 | [diff] [blame] | 3082 | { "Elgato EyeTV DTT", |
| 3083 | { &dib0700_usb_id_table[49], NULL }, |
| 3084 | { NULL }, |
| 3085 | }, |
Pascal Terjan | 9abb6e6 | 2009-02-26 10:31:41 -0300 | [diff] [blame] | 3086 | { "Yuan PD378S", |
| 3087 | { &dib0700_usb_id_table[45], NULL }, |
| 3088 | { NULL }, |
| 3089 | }, |
Armin Schenker | 513846e | 2009-04-20 11:57:49 -0300 | [diff] [blame] | 3090 | { "Elgato EyeTV Dtt Dlx PD378S", |
| 3091 | { &dib0700_usb_id_table[50], NULL }, |
| 3092 | { NULL }, |
| 3093 | }, |
Tim Taubert | c7637b1 | 2008-01-25 06:16:36 -0300 | [diff] [blame] | 3094 | }, |
| 3095 | |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 3096 | .rc.core = { |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 3097 | .rc_interval = DEFAULT_RC_INTERVAL, |
Mauro Carvalho Chehab | 5af935c | 2010-08-01 08:02:35 -0300 | [diff] [blame] | 3098 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 3099 | .module_name = "dib0700", |
Mauro Carvalho Chehab | 0ffd1ab | 2010-08-01 09:37:23 -0300 | [diff] [blame] | 3100 | .rc_query = dib0700_rc_query_old_firmware, |
Mauro Carvalho Chehab | 52b6614 | 2010-11-17 14:20:52 -0300 | [diff] [blame] | 3101 | .allowed_protos = RC_TYPE_RC5 | |
| 3102 | RC_TYPE_RC6 | |
| 3103 | RC_TYPE_NEC, |
David Härdeman | d8b4b58 | 2010-10-29 16:08:23 -0300 | [diff] [blame] | 3104 | .change_protocol = dib0700_change_protocol, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 3105 | }, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 3106 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 3107 | |
Olivier Grenie | 74b76f2 | 2009-09-02 08:19:19 -0300 | [diff] [blame] | 3108 | .num_adapters = 1, |
| 3109 | .adapter = { |
| 3110 | { |
Mauro Carvalho Chehab | 648732f | 2009-11-04 12:11:43 -0200 | [diff] [blame] | 3111 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 3112 | .pid_filter_count = 32, |
| 3113 | .pid_filter = stk70x0p_pid_filter, |
| 3114 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Olivier Grenie | 74b76f2 | 2009-09-02 08:19:19 -0300 | [diff] [blame] | 3115 | .frontend_attach = stk7070p_frontend_attach, |
| 3116 | .tuner_attach = dib7070p_tuner_attach, |
| 3117 | |
| 3118 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 3119 | |
| 3120 | .size_of_priv = sizeof(struct dib0700_adapter_state), |
| 3121 | }, |
| 3122 | }, |
| 3123 | |
Patrick Boettcher | 20232c4 | 2009-12-01 12:08:56 -0300 | [diff] [blame] | 3124 | .num_device_descs = 3, |
Olivier Grenie | 74b76f2 | 2009-09-02 08:19:19 -0300 | [diff] [blame] | 3125 | .devices = { |
| 3126 | { "Pinnacle PCTV 73A", |
| 3127 | { &dib0700_usb_id_table[56], NULL }, |
| 3128 | { NULL }, |
| 3129 | }, |
| 3130 | { "Pinnacle PCTV 73e SE", |
Patrick Boettcher | 20232c4 | 2009-12-01 12:08:56 -0300 | [diff] [blame] | 3131 | { &dib0700_usb_id_table[57], &dib0700_usb_id_table[65], NULL }, |
Olivier Grenie | 74b76f2 | 2009-09-02 08:19:19 -0300 | [diff] [blame] | 3132 | { NULL }, |
| 3133 | }, |
| 3134 | { "Pinnacle PCTV 282e", |
Patrick Boettcher | 20232c4 | 2009-12-01 12:08:56 -0300 | [diff] [blame] | 3135 | { &dib0700_usb_id_table[58], &dib0700_usb_id_table[66], NULL }, |
Olivier Grenie | 74b76f2 | 2009-09-02 08:19:19 -0300 | [diff] [blame] | 3136 | { NULL }, |
| 3137 | }, |
| 3138 | }, |
| 3139 | |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 3140 | .rc.core = { |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 3141 | .rc_interval = DEFAULT_RC_INTERVAL, |
Mauro Carvalho Chehab | 5af935c | 2010-08-01 08:02:35 -0300 | [diff] [blame] | 3142 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 3143 | .module_name = "dib0700", |
Mauro Carvalho Chehab | 0ffd1ab | 2010-08-01 09:37:23 -0300 | [diff] [blame] | 3144 | .rc_query = dib0700_rc_query_old_firmware, |
Mauro Carvalho Chehab | 52b6614 | 2010-11-17 14:20:52 -0300 | [diff] [blame] | 3145 | .allowed_protos = RC_TYPE_RC5 | |
| 3146 | RC_TYPE_RC6 | |
| 3147 | RC_TYPE_NEC, |
David Härdeman | d8b4b58 | 2010-10-29 16:08:23 -0300 | [diff] [blame] | 3148 | .change_protocol = dib0700_change_protocol, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 3149 | }, |
Olivier Grenie | 74b76f2 | 2009-09-02 08:19:19 -0300 | [diff] [blame] | 3150 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 3151 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 3152 | .num_adapters = 2, |
| 3153 | .adapter = { |
| 3154 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 3155 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 3156 | .pid_filter_count = 32, |
| 3157 | .pid_filter = stk70x0p_pid_filter, |
| 3158 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 3159 | .frontend_attach = stk7070pd_frontend_attach0, |
| 3160 | .tuner_attach = dib7070p_tuner_attach, |
| 3161 | |
| 3162 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 3163 | |
| 3164 | .size_of_priv = sizeof(struct dib0700_adapter_state), |
| 3165 | }, { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 3166 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 3167 | .pid_filter_count = 32, |
| 3168 | .pid_filter = stk70x0p_pid_filter, |
| 3169 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 3170 | .frontend_attach = stk7070pd_frontend_attach1, |
| 3171 | .tuner_attach = dib7070p_tuner_attach, |
| 3172 | |
| 3173 | DIB0700_DEFAULT_STREAMING_CONFIG(0x03), |
| 3174 | |
| 3175 | .size_of_priv = sizeof(struct dib0700_adapter_state), |
| 3176 | } |
| 3177 | }, |
| 3178 | |
Mauro Carvalho Chehab | 5af935c | 2010-08-01 08:02:35 -0300 | [diff] [blame] | 3179 | .num_device_descs = 6, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 3180 | .devices = { |
| 3181 | { "DiBcom STK7070PD reference design", |
| 3182 | { &dib0700_usb_id_table[17], NULL }, |
| 3183 | { NULL }, |
| 3184 | }, |
| 3185 | { "Pinnacle PCTV Dual DVB-T Diversity Stick", |
| 3186 | { &dib0700_usb_id_table[18], NULL }, |
| 3187 | { NULL }, |
Michael Krufky | d01eb2d | 2008-07-03 23:43:36 -0300 | [diff] [blame] | 3188 | }, |
| 3189 | { "Hauppauge Nova-TD Stick (52009)", |
| 3190 | { &dib0700_usb_id_table[35], NULL }, |
| 3191 | { NULL }, |
Michael Krufky | 9a0c04a | 2008-09-03 17:12:24 -0300 | [diff] [blame] | 3192 | }, |
| 3193 | { "Hauppauge Nova-TD-500 (84xxx)", |
| 3194 | { &dib0700_usb_id_table[36], NULL }, |
| 3195 | { NULL }, |
Nicolas Fournier | db4b2d1 | 2009-01-13 07:15:25 -0300 | [diff] [blame] | 3196 | }, |
Patrick Boettcher | a9b8fe3 | 2009-05-20 05:35:02 -0300 | [diff] [blame] | 3197 | { "Terratec Cinergy DT USB XS Diversity/ T5", |
| 3198 | { &dib0700_usb_id_table[43], |
| 3199 | &dib0700_usb_id_table[53], NULL}, |
Nicolas Fournier | db4b2d1 | 2009-01-13 07:15:25 -0300 | [diff] [blame] | 3200 | { NULL }, |
sebastian.blanes@gmail.com | 0a6e1ed | 2009-02-24 14:51:43 -0300 | [diff] [blame] | 3201 | }, |
| 3202 | { "Sony PlayTV", |
| 3203 | { &dib0700_usb_id_table[44], NULL }, |
| 3204 | { NULL }, |
Michael Müller | 84e2f03 | 2010-04-26 22:18:57 -0300 | [diff] [blame] | 3205 | }, |
Mauro Carvalho Chehab | 5af935c | 2010-08-01 08:02:35 -0300 | [diff] [blame] | 3206 | }, |
| 3207 | |
| 3208 | .rc.core = { |
| 3209 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 3210 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
| 3211 | .module_name = "dib0700", |
Mauro Carvalho Chehab | 0ffd1ab | 2010-08-01 09:37:23 -0300 | [diff] [blame] | 3212 | .rc_query = dib0700_rc_query_old_firmware, |
Mauro Carvalho Chehab | 52b6614 | 2010-11-17 14:20:52 -0300 | [diff] [blame] | 3213 | .allowed_protos = RC_TYPE_RC5 | |
| 3214 | RC_TYPE_RC6 | |
| 3215 | RC_TYPE_NEC, |
David Härdeman | d8b4b58 | 2010-10-29 16:08:23 -0300 | [diff] [blame] | 3216 | .change_protocol = dib0700_change_protocol, |
Mauro Carvalho Chehab | 5af935c | 2010-08-01 08:02:35 -0300 | [diff] [blame] | 3217 | }, |
| 3218 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 3219 | |
| 3220 | .num_adapters = 2, |
| 3221 | .adapter = { |
| 3222 | { |
| 3223 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 3224 | .pid_filter_count = 32, |
| 3225 | .pid_filter = stk70x0p_pid_filter, |
| 3226 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
| 3227 | .frontend_attach = stk7070pd_frontend_attach0, |
| 3228 | .tuner_attach = dib7070p_tuner_attach, |
| 3229 | |
| 3230 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 3231 | |
| 3232 | .size_of_priv = sizeof(struct dib0700_adapter_state), |
| 3233 | }, { |
| 3234 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 3235 | .pid_filter_count = 32, |
| 3236 | .pid_filter = stk70x0p_pid_filter, |
| 3237 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
| 3238 | .frontend_attach = stk7070pd_frontend_attach1, |
| 3239 | .tuner_attach = dib7070p_tuner_attach, |
| 3240 | |
| 3241 | DIB0700_DEFAULT_STREAMING_CONFIG(0x03), |
| 3242 | |
| 3243 | .size_of_priv = sizeof(struct dib0700_adapter_state), |
| 3244 | } |
| 3245 | }, |
| 3246 | |
| 3247 | .num_device_descs = 1, |
| 3248 | .devices = { |
Michael Müller | 84e2f03 | 2010-04-26 22:18:57 -0300 | [diff] [blame] | 3249 | { "Elgato EyeTV Diversity", |
| 3250 | { &dib0700_usb_id_table[68], NULL }, |
| 3251 | { NULL }, |
| 3252 | }, |
Arne Luehrs | c985a8d | 2009-01-21 01:37:20 -0300 | [diff] [blame] | 3253 | }, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 3254 | |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 3255 | .rc.core = { |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 3256 | .rc_interval = DEFAULT_RC_INTERVAL, |
Mauro Carvalho Chehab | 5af935c | 2010-08-01 08:02:35 -0300 | [diff] [blame] | 3257 | .rc_codes = RC_MAP_DIB0700_NEC_TABLE, |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 3258 | .module_name = "dib0700", |
Mauro Carvalho Chehab | 0ffd1ab | 2010-08-01 09:37:23 -0300 | [diff] [blame] | 3259 | .rc_query = dib0700_rc_query_old_firmware, |
Mauro Carvalho Chehab | 52b6614 | 2010-11-17 14:20:52 -0300 | [diff] [blame] | 3260 | .allowed_protos = RC_TYPE_RC5 | |
| 3261 | RC_TYPE_RC6 | |
| 3262 | RC_TYPE_NEC, |
David Härdeman | d8b4b58 | 2010-10-29 16:08:23 -0300 | [diff] [blame] | 3263 | .change_protocol = dib0700_change_protocol, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 3264 | }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 3265 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 3266 | |
| 3267 | .num_adapters = 1, |
| 3268 | .adapter = { |
| 3269 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 3270 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 3271 | .pid_filter_count = 32, |
| 3272 | .pid_filter = stk70x0p_pid_filter, |
| 3273 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 3274 | .frontend_attach = stk7700ph_frontend_attach, |
| 3275 | .tuner_attach = stk7700ph_tuner_attach, |
| 3276 | |
| 3277 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 3278 | |
| 3279 | .size_of_priv = sizeof(struct |
| 3280 | dib0700_adapter_state), |
| 3281 | }, |
| 3282 | }, |
| 3283 | |
Pete Hildebrandt | c53d83c | 2009-08-05 11:46:38 -0300 | [diff] [blame] | 3284 | .num_device_descs = 9, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 3285 | .devices = { |
| 3286 | { "Terratec Cinergy HT USB XE", |
| 3287 | { &dib0700_usb_id_table[27], NULL }, |
| 3288 | { NULL }, |
| 3289 | }, |
| 3290 | { "Pinnacle Expresscard 320cx", |
| 3291 | { &dib0700_usb_id_table[28], NULL }, |
| 3292 | { NULL }, |
| 3293 | }, |
| 3294 | { "Terratec Cinergy HT Express", |
| 3295 | { &dib0700_usb_id_table[32], NULL }, |
| 3296 | { NULL }, |
| 3297 | }, |
Finn Thain | 17a370b | 2008-09-06 13:42:47 -0300 | [diff] [blame] | 3298 | { "Gigabyte U8000-RH", |
| 3299 | { &dib0700_usb_id_table[37], NULL }, |
| 3300 | { NULL }, |
| 3301 | }, |
Daniel Oliveira Nascimento | 8751aaa | 2008-09-07 12:39:44 -0300 | [diff] [blame] | 3302 | { "YUAN High-Tech STK7700PH", |
| 3303 | { &dib0700_usb_id_table[38], NULL }, |
| 3304 | { NULL }, |
| 3305 | }, |
Albert Comerma | 5769743 | 2008-09-07 12:43:33 -0300 | [diff] [blame] | 3306 | { "Asus My Cinema-U3000Hybrid", |
| 3307 | { &dib0700_usb_id_table[39], NULL }, |
| 3308 | { NULL }, |
| 3309 | }, |
Xoan Loureiro | 16ba1ee | 2009-03-29 08:43:36 -0300 | [diff] [blame] | 3310 | { "YUAN High-Tech MC770", |
| 3311 | { &dib0700_usb_id_table[48], NULL }, |
| 3312 | { NULL }, |
| 3313 | }, |
tomas petr | f0f4ae7 | 2009-05-20 05:28:05 -0300 | [diff] [blame] | 3314 | { "Leadtek WinFast DTV Dongle H", |
| 3315 | { &dib0700_usb_id_table[51], NULL }, |
| 3316 | { NULL }, |
| 3317 | }, |
Pete Hildebrandt | c53d83c | 2009-08-05 11:46:38 -0300 | [diff] [blame] | 3318 | { "YUAN High-Tech STK7700D", |
| 3319 | { &dib0700_usb_id_table[54], NULL }, |
| 3320 | { NULL }, |
| 3321 | }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 3322 | }, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 3323 | |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 3324 | .rc.core = { |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 3325 | .rc_interval = DEFAULT_RC_INTERVAL, |
Mauro Carvalho Chehab | 5af935c | 2010-08-01 08:02:35 -0300 | [diff] [blame] | 3326 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 3327 | .module_name = "dib0700", |
Mauro Carvalho Chehab | 0ffd1ab | 2010-08-01 09:37:23 -0300 | [diff] [blame] | 3328 | .rc_query = dib0700_rc_query_old_firmware, |
Mauro Carvalho Chehab | 52b6614 | 2010-11-17 14:20:52 -0300 | [diff] [blame] | 3329 | .allowed_protos = RC_TYPE_RC5 | |
| 3330 | RC_TYPE_RC6 | |
| 3331 | RC_TYPE_NEC, |
David Härdeman | d8b4b58 | 2010-10-29 16:08:23 -0300 | [diff] [blame] | 3332 | .change_protocol = dib0700_change_protocol, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 3333 | }, |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 3334 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 3335 | .num_adapters = 1, |
| 3336 | .adapter = { |
| 3337 | { |
| 3338 | .frontend_attach = s5h1411_frontend_attach, |
| 3339 | .tuner_attach = xc5000_tuner_attach, |
| 3340 | |
| 3341 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 3342 | |
| 3343 | .size_of_priv = sizeof(struct |
| 3344 | dib0700_adapter_state), |
| 3345 | }, |
| 3346 | }, |
| 3347 | |
Devin Heitmueller | d2fc3bf | 2008-09-25 06:22:23 -0300 | [diff] [blame] | 3348 | .num_device_descs = 2, |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 3349 | .devices = { |
| 3350 | { "Pinnacle PCTV HD Pro USB Stick", |
| 3351 | { &dib0700_usb_id_table[40], NULL }, |
| 3352 | { NULL }, |
| 3353 | }, |
Devin Heitmueller | d2fc3bf | 2008-09-25 06:22:23 -0300 | [diff] [blame] | 3354 | { "Pinnacle PCTV HD USB Stick", |
| 3355 | { &dib0700_usb_id_table[41], NULL }, |
| 3356 | { NULL }, |
| 3357 | }, |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 3358 | }, |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 3359 | |
| 3360 | .rc.core = { |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 3361 | .rc_interval = DEFAULT_RC_INTERVAL, |
Mauro Carvalho Chehab | 5af935c | 2010-08-01 08:02:35 -0300 | [diff] [blame] | 3362 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 3363 | .module_name = "dib0700", |
Mauro Carvalho Chehab | 0ffd1ab | 2010-08-01 09:37:23 -0300 | [diff] [blame] | 3364 | .rc_query = dib0700_rc_query_old_firmware, |
Mauro Carvalho Chehab | 52b6614 | 2010-11-17 14:20:52 -0300 | [diff] [blame] | 3365 | .allowed_protos = RC_TYPE_RC5 | |
| 3366 | RC_TYPE_RC6 | |
| 3367 | RC_TYPE_NEC, |
David Härdeman | d8b4b58 | 2010-10-29 16:08:23 -0300 | [diff] [blame] | 3368 | .change_protocol = dib0700_change_protocol, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 3369 | }, |
Michael Krufky | ce904bc | 2009-01-19 01:12:55 -0300 | [diff] [blame] | 3370 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 3371 | .num_adapters = 1, |
| 3372 | .adapter = { |
| 3373 | { |
| 3374 | .frontend_attach = lgdt3305_frontend_attach, |
| 3375 | .tuner_attach = mxl5007t_tuner_attach, |
| 3376 | |
| 3377 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 3378 | |
| 3379 | .size_of_priv = sizeof(struct |
| 3380 | dib0700_adapter_state), |
| 3381 | }, |
| 3382 | }, |
| 3383 | |
| 3384 | .num_device_descs = 2, |
| 3385 | .devices = { |
| 3386 | { "Hauppauge ATSC MiniCard (B200)", |
| 3387 | { &dib0700_usb_id_table[46], NULL }, |
| 3388 | { NULL }, |
| 3389 | }, |
| 3390 | { "Hauppauge ATSC MiniCard (B210)", |
| 3391 | { &dib0700_usb_id_table[47], NULL }, |
| 3392 | { NULL }, |
| 3393 | }, |
| 3394 | }, |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 3395 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 3396 | |
| 3397 | .num_adapters = 1, |
| 3398 | .adapter = { |
| 3399 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 3400 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 3401 | .pid_filter_count = 32, |
| 3402 | .pid_filter = stk70x0p_pid_filter, |
| 3403 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Olivier Grenie | 90e12ce | 2010-09-07 12:50:45 -0300 | [diff] [blame] | 3404 | .frontend_attach = stk7770p_frontend_attach, |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 3405 | .tuner_attach = dib7770p_tuner_attach, |
| 3406 | |
| 3407 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 3408 | |
| 3409 | .size_of_priv = |
Patrick Boettcher | db48138 | 2009-09-15 07:16:51 -0300 | [diff] [blame] | 3410 | sizeof(struct dib0700_adapter_state), |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 3411 | }, |
| 3412 | }, |
| 3413 | |
Stéphane Elmaleh | d140230 | 2011-05-21 07:33:38 -0300 | [diff] [blame] | 3414 | .num_device_descs = 4, |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 3415 | .devices = { |
| 3416 | { "DiBcom STK7770P reference design", |
| 3417 | { &dib0700_usb_id_table[59], NULL }, |
| 3418 | { NULL }, |
| 3419 | }, |
Patrick Boettcher | 1e13c8f | 2009-09-19 05:24:40 -0300 | [diff] [blame] | 3420 | { "Terratec Cinergy T USB XXS (HD)/ T3", |
| 3421 | { &dib0700_usb_id_table[33], |
| 3422 | &dib0700_usb_id_table[52], |
| 3423 | &dib0700_usb_id_table[60], NULL}, |
Patrick Boettcher | db48138 | 2009-09-15 07:16:51 -0300 | [diff] [blame] | 3424 | { NULL }, |
| 3425 | }, |
Lukas Max Fisch | 498e677 | 2011-02-08 16:51:45 -0300 | [diff] [blame] | 3426 | { "TechniSat AirStar TeleStick 2", |
| 3427 | { &dib0700_usb_id_table[74], NULL }, |
| 3428 | { NULL }, |
| 3429 | }, |
Stéphane Elmaleh | d140230 | 2011-05-21 07:33:38 -0300 | [diff] [blame] | 3430 | { "Medion CTX1921 DVB-T USB", |
| 3431 | { &dib0700_usb_id_table[75], NULL }, |
| 3432 | { NULL }, |
| 3433 | }, |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 3434 | }, |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 3435 | |
| 3436 | .rc.core = { |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 3437 | .rc_interval = DEFAULT_RC_INTERVAL, |
Mauro Carvalho Chehab | 5af935c | 2010-08-01 08:02:35 -0300 | [diff] [blame] | 3438 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 3439 | .module_name = "dib0700", |
Mauro Carvalho Chehab | 0ffd1ab | 2010-08-01 09:37:23 -0300 | [diff] [blame] | 3440 | .rc_query = dib0700_rc_query_old_firmware, |
Mauro Carvalho Chehab | 52b6614 | 2010-11-17 14:20:52 -0300 | [diff] [blame] | 3441 | .allowed_protos = RC_TYPE_RC5 | |
| 3442 | RC_TYPE_RC6 | |
| 3443 | RC_TYPE_NEC, |
David Härdeman | d8b4b58 | 2010-10-29 16:08:23 -0300 | [diff] [blame] | 3444 | .change_protocol = dib0700_change_protocol, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 3445 | }, |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 3446 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 3447 | .num_adapters = 1, |
| 3448 | .adapter = { |
| 3449 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 3450 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 3451 | .pid_filter_count = 32, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 3452 | .pid_filter = stk80xx_pid_filter, |
| 3453 | .pid_filter_ctrl = stk80xx_pid_filter_ctrl, |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 3454 | .frontend_attach = stk807x_frontend_attach, |
| 3455 | .tuner_attach = dib807x_tuner_attach, |
| 3456 | |
| 3457 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 3458 | |
| 3459 | .size_of_priv = |
| 3460 | sizeof(struct dib0700_adapter_state), |
| 3461 | }, |
| 3462 | }, |
| 3463 | |
S?rgio Fortier | 8a378e8 | 2009-09-28 04:19:21 -0300 | [diff] [blame] | 3464 | .num_device_descs = 3, |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 3465 | .devices = { |
| 3466 | { "DiBcom STK807xP reference design", |
| 3467 | { &dib0700_usb_id_table[62], NULL }, |
| 3468 | { NULL }, |
| 3469 | }, |
Mauro Carvalho Chehab | aaeab30 | 2009-09-16 09:18:26 -0300 | [diff] [blame] | 3470 | { "Prolink Pixelview SBTVD", |
| 3471 | { &dib0700_usb_id_table[63], NULL }, |
| 3472 | { NULL }, |
| 3473 | }, |
S?rgio Fortier | 8a378e8 | 2009-09-28 04:19:21 -0300 | [diff] [blame] | 3474 | { "EvolutePC TVWay+", |
| 3475 | { &dib0700_usb_id_table[64], NULL }, |
| 3476 | { NULL }, |
| 3477 | }, |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 3478 | }, |
| 3479 | |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 3480 | .rc.core = { |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 3481 | .rc_interval = DEFAULT_RC_INTERVAL, |
Mauro Carvalho Chehab | 5af935c | 2010-08-01 08:02:35 -0300 | [diff] [blame] | 3482 | .rc_codes = RC_MAP_DIB0700_NEC_TABLE, |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 3483 | .module_name = "dib0700", |
Mauro Carvalho Chehab | 0ffd1ab | 2010-08-01 09:37:23 -0300 | [diff] [blame] | 3484 | .rc_query = dib0700_rc_query_old_firmware, |
Mauro Carvalho Chehab | 52b6614 | 2010-11-17 14:20:52 -0300 | [diff] [blame] | 3485 | .allowed_protos = RC_TYPE_RC5 | |
| 3486 | RC_TYPE_RC6 | |
| 3487 | RC_TYPE_NEC, |
David Härdeman | d8b4b58 | 2010-10-29 16:08:23 -0300 | [diff] [blame] | 3488 | .change_protocol = dib0700_change_protocol, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 3489 | }, |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 3490 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 3491 | .num_adapters = 2, |
| 3492 | .adapter = { |
| 3493 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 3494 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 3495 | .pid_filter_count = 32, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 3496 | .pid_filter = stk80xx_pid_filter, |
| 3497 | .pid_filter_ctrl = stk80xx_pid_filter_ctrl, |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 3498 | .frontend_attach = stk807xpvr_frontend_attach0, |
| 3499 | .tuner_attach = dib807x_tuner_attach, |
| 3500 | |
| 3501 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 3502 | |
| 3503 | .size_of_priv = |
| 3504 | sizeof(struct dib0700_adapter_state), |
| 3505 | }, |
| 3506 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 3507 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 3508 | .pid_filter_count = 32, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 3509 | .pid_filter = stk80xx_pid_filter, |
| 3510 | .pid_filter_ctrl = stk80xx_pid_filter_ctrl, |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 3511 | .frontend_attach = stk807xpvr_frontend_attach1, |
| 3512 | .tuner_attach = dib807x_tuner_attach, |
| 3513 | |
| 3514 | DIB0700_DEFAULT_STREAMING_CONFIG(0x03), |
| 3515 | |
| 3516 | .size_of_priv = |
| 3517 | sizeof(struct dib0700_adapter_state), |
| 3518 | }, |
| 3519 | }, |
| 3520 | |
| 3521 | .num_device_descs = 1, |
| 3522 | .devices = { |
| 3523 | { "DiBcom STK807xPVR reference design", |
| 3524 | { &dib0700_usb_id_table[61], NULL }, |
| 3525 | { NULL }, |
| 3526 | }, |
| 3527 | }, |
| 3528 | |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 3529 | .rc.core = { |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 3530 | .rc_interval = DEFAULT_RC_INTERVAL, |
Mauro Carvalho Chehab | 5af935c | 2010-08-01 08:02:35 -0300 | [diff] [blame] | 3531 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 3532 | .module_name = "dib0700", |
Mauro Carvalho Chehab | 0ffd1ab | 2010-08-01 09:37:23 -0300 | [diff] [blame] | 3533 | .rc_query = dib0700_rc_query_old_firmware, |
Mauro Carvalho Chehab | 52b6614 | 2010-11-17 14:20:52 -0300 | [diff] [blame] | 3534 | .allowed_protos = RC_TYPE_RC5 | |
| 3535 | RC_TYPE_RC6 | |
| 3536 | RC_TYPE_NEC, |
David Härdeman | d8b4b58 | 2010-10-29 16:08:23 -0300 | [diff] [blame] | 3537 | .change_protocol = dib0700_change_protocol, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 3538 | }, |
Olivier Grenie | 03245a5 | 2009-12-04 13:27:57 -0300 | [diff] [blame] | 3539 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 3540 | .num_adapters = 1, |
| 3541 | .adapter = { |
| 3542 | { |
| 3543 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | |
| 3544 | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 3545 | .pid_filter_count = 32, |
| 3546 | .pid_filter = stk80xx_pid_filter, |
| 3547 | .pid_filter_ctrl = stk80xx_pid_filter_ctrl, |
| 3548 | .frontend_attach = stk809x_frontend_attach, |
| 3549 | .tuner_attach = dib809x_tuner_attach, |
| 3550 | |
| 3551 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 3552 | |
| 3553 | .size_of_priv = |
| 3554 | sizeof(struct dib0700_adapter_state), |
| 3555 | }, |
| 3556 | }, |
| 3557 | |
| 3558 | .num_device_descs = 1, |
| 3559 | .devices = { |
| 3560 | { "DiBcom STK8096GP reference design", |
| 3561 | { &dib0700_usb_id_table[67], NULL }, |
| 3562 | { NULL }, |
| 3563 | }, |
| 3564 | }, |
| 3565 | |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 3566 | .rc.core = { |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 3567 | .rc_interval = DEFAULT_RC_INTERVAL, |
Mauro Carvalho Chehab | 5af935c | 2010-08-01 08:02:35 -0300 | [diff] [blame] | 3568 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
Mauro Carvalho Chehab | 72b3931 | 2010-07-31 22:56:00 -0300 | [diff] [blame] | 3569 | .module_name = "dib0700", |
Mauro Carvalho Chehab | 0ffd1ab | 2010-08-01 09:37:23 -0300 | [diff] [blame] | 3570 | .rc_query = dib0700_rc_query_old_firmware, |
Mauro Carvalho Chehab | 52b6614 | 2010-11-17 14:20:52 -0300 | [diff] [blame] | 3571 | .allowed_protos = RC_TYPE_RC5 | |
| 3572 | RC_TYPE_RC6 | |
| 3573 | RC_TYPE_NEC, |
David Härdeman | d8b4b58 | 2010-10-29 16:08:23 -0300 | [diff] [blame] | 3574 | .change_protocol = dib0700_change_protocol, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 3575 | }, |
Olivier Grenie | be9bae1 | 2011-01-04 05:42:19 -0300 | [diff] [blame] | 3576 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 3577 | .num_adapters = 1, |
| 3578 | .adapter = { |
| 3579 | { |
| 3580 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | |
| 3581 | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 3582 | .pid_filter_count = 32, |
| 3583 | .pid_filter = dib90x0_pid_filter, |
| 3584 | .pid_filter_ctrl = dib90x0_pid_filter_ctrl, |
| 3585 | .frontend_attach = stk9090m_frontend_attach, |
| 3586 | .tuner_attach = dib9090_tuner_attach, |
| 3587 | |
| 3588 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 3589 | |
| 3590 | .size_of_priv = |
| 3591 | sizeof(struct dib0700_adapter_state), |
| 3592 | }, |
| 3593 | }, |
| 3594 | |
| 3595 | .num_device_descs = 1, |
| 3596 | .devices = { |
| 3597 | { "DiBcom STK9090M reference design", |
| 3598 | { &dib0700_usb_id_table[69], NULL }, |
| 3599 | { NULL }, |
| 3600 | }, |
| 3601 | }, |
| 3602 | |
| 3603 | .rc.core = { |
| 3604 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 3605 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
| 3606 | .module_name = "dib0700", |
| 3607 | .rc_query = dib0700_rc_query_old_firmware, |
| 3608 | .allowed_protos = RC_TYPE_RC5 | |
| 3609 | RC_TYPE_RC6 | |
| 3610 | RC_TYPE_NEC, |
| 3611 | .change_protocol = dib0700_change_protocol, |
| 3612 | }, |
| 3613 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 3614 | .num_adapters = 1, |
| 3615 | .adapter = { |
| 3616 | { |
| 3617 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | |
| 3618 | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 3619 | .pid_filter_count = 32, |
| 3620 | .pid_filter = stk80xx_pid_filter, |
| 3621 | .pid_filter_ctrl = stk80xx_pid_filter_ctrl, |
| 3622 | .frontend_attach = nim8096md_frontend_attach, |
| 3623 | .tuner_attach = nim8096md_tuner_attach, |
| 3624 | |
| 3625 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 3626 | |
| 3627 | .size_of_priv = |
| 3628 | sizeof(struct dib0700_adapter_state), |
| 3629 | }, |
| 3630 | }, |
| 3631 | |
| 3632 | .num_device_descs = 1, |
| 3633 | .devices = { |
| 3634 | { "DiBcom NIM8096MD reference design", |
| 3635 | { &dib0700_usb_id_table[70], NULL }, |
| 3636 | { NULL }, |
| 3637 | }, |
| 3638 | }, |
| 3639 | |
| 3640 | .rc.core = { |
| 3641 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 3642 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
| 3643 | .module_name = "dib0700", |
| 3644 | .rc_query = dib0700_rc_query_old_firmware, |
| 3645 | .allowed_protos = RC_TYPE_RC5 | |
| 3646 | RC_TYPE_RC6 | |
| 3647 | RC_TYPE_NEC, |
| 3648 | .change_protocol = dib0700_change_protocol, |
| 3649 | }, |
| 3650 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 3651 | .num_adapters = 1, |
| 3652 | .adapter = { |
| 3653 | { |
| 3654 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | |
| 3655 | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 3656 | .pid_filter_count = 32, |
| 3657 | .pid_filter = dib90x0_pid_filter, |
| 3658 | .pid_filter_ctrl = dib90x0_pid_filter_ctrl, |
| 3659 | .frontend_attach = nim9090md_frontend_attach, |
| 3660 | .tuner_attach = nim9090md_tuner_attach, |
| 3661 | |
| 3662 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 3663 | |
| 3664 | .size_of_priv = |
| 3665 | sizeof(struct dib0700_adapter_state), |
| 3666 | }, |
| 3667 | }, |
| 3668 | |
| 3669 | .num_device_descs = 1, |
| 3670 | .devices = { |
| 3671 | { "DiBcom NIM9090MD reference design", |
| 3672 | { &dib0700_usb_id_table[71], NULL }, |
| 3673 | { NULL }, |
| 3674 | }, |
| 3675 | }, |
| 3676 | |
| 3677 | .rc.core = { |
| 3678 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 3679 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
| 3680 | .module_name = "dib0700", |
| 3681 | .rc_query = dib0700_rc_query_old_firmware, |
| 3682 | .allowed_protos = RC_TYPE_RC5 | |
| 3683 | RC_TYPE_RC6 | |
| 3684 | RC_TYPE_NEC, |
| 3685 | .change_protocol = dib0700_change_protocol, |
| 3686 | }, |
| 3687 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 3688 | .num_adapters = 1, |
| 3689 | .adapter = { |
| 3690 | { |
| 3691 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | |
| 3692 | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 3693 | .pid_filter_count = 32, |
| 3694 | .pid_filter = stk70x0p_pid_filter, |
| 3695 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
| 3696 | .frontend_attach = nim7090_frontend_attach, |
| 3697 | .tuner_attach = nim7090_tuner_attach, |
| 3698 | |
| 3699 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 3700 | |
| 3701 | .size_of_priv = |
| 3702 | sizeof(struct dib0700_adapter_state), |
| 3703 | }, |
| 3704 | }, |
| 3705 | |
| 3706 | .num_device_descs = 1, |
| 3707 | .devices = { |
| 3708 | { "DiBcom NIM7090 reference design", |
| 3709 | { &dib0700_usb_id_table[72], NULL }, |
| 3710 | { NULL }, |
| 3711 | }, |
| 3712 | }, |
| 3713 | |
| 3714 | .rc.core = { |
| 3715 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 3716 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
| 3717 | .module_name = "dib0700", |
| 3718 | .rc_query = dib0700_rc_query_old_firmware, |
| 3719 | .allowed_protos = RC_TYPE_RC5 | |
| 3720 | RC_TYPE_RC6 | |
| 3721 | RC_TYPE_NEC, |
| 3722 | .change_protocol = dib0700_change_protocol, |
| 3723 | }, |
| 3724 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 3725 | .num_adapters = 2, |
| 3726 | .adapter = { |
| 3727 | { |
| 3728 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | |
| 3729 | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 3730 | .pid_filter_count = 32, |
| 3731 | .pid_filter = stk70x0p_pid_filter, |
| 3732 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
| 3733 | .frontend_attach = tfe7090pvr_frontend0_attach, |
| 3734 | .tuner_attach = tfe7090pvr_tuner0_attach, |
| 3735 | |
| 3736 | DIB0700_DEFAULT_STREAMING_CONFIG(0x03), |
| 3737 | |
| 3738 | .size_of_priv = |
| 3739 | sizeof(struct dib0700_adapter_state), |
| 3740 | }, |
| 3741 | { |
| 3742 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | |
| 3743 | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 3744 | .pid_filter_count = 32, |
| 3745 | .pid_filter = stk70x0p_pid_filter, |
| 3746 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
| 3747 | .frontend_attach = tfe7090pvr_frontend1_attach, |
| 3748 | .tuner_attach = tfe7090pvr_tuner1_attach, |
| 3749 | |
| 3750 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 3751 | |
| 3752 | .size_of_priv = |
| 3753 | sizeof(struct dib0700_adapter_state), |
| 3754 | }, |
| 3755 | }, |
| 3756 | |
| 3757 | .num_device_descs = 1, |
| 3758 | .devices = { |
| 3759 | { "DiBcom TFE7090PVR reference design", |
| 3760 | { &dib0700_usb_id_table[73], NULL }, |
| 3761 | { NULL }, |
| 3762 | }, |
| 3763 | }, |
| 3764 | |
| 3765 | .rc.core = { |
| 3766 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 3767 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
| 3768 | .module_name = "dib0700", |
| 3769 | .rc_query = dib0700_rc_query_old_firmware, |
| 3770 | .allowed_protos = RC_TYPE_RC5 | |
| 3771 | RC_TYPE_RC6 | |
| 3772 | RC_TYPE_NEC, |
| 3773 | .change_protocol = dib0700_change_protocol, |
| 3774 | }, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 3775 | }, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 3776 | }; |
| 3777 | |
| 3778 | int dib0700_device_count = ARRAY_SIZE(dib0700_devices); |