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" |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 15 | #include "mt2060.h" |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 16 | #include "mt2266.h" |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 17 | #include "tuner-xc2028.h" |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 18 | #include "xc5000.h" |
| 19 | #include "s5h1411.h" |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 20 | #include "dib0070.h" |
Michael Krufky | ce904bc | 2009-01-19 01:12:55 -0300 | [diff] [blame] | 21 | #include "lgdt3305.h" |
| 22 | #include "mxl5007t.h" |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 23 | |
Patrick Boettcher | 7fb3fc0 | 2006-09-20 04:37:18 -0300 | [diff] [blame] | 24 | static int force_lna_activation; |
| 25 | module_param(force_lna_activation, int, 0644); |
| 26 | MODULE_PARM_DESC(force_lna_activation, "force the activation of Low-Noise-Amplifyer(s) (LNA), " |
| 27 | "if applicable for the device (default: 0=automatic/off)."); |
| 28 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 29 | struct dib0700_adapter_state { |
| 30 | int (*set_param_save) (struct dvb_frontend *, struct dvb_frontend_parameters *); |
| 31 | }; |
| 32 | |
| 33 | /* Hauppauge Nova-T 500 (aka Bristol) |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 34 | * has a LNA on GPIO0 which is enabled by setting 1 */ |
| 35 | static struct mt2060_config bristol_mt2060_config[2] = { |
| 36 | { |
| 37 | .i2c_address = 0x60, |
Patrick Boettcher | 303cbea | 2006-09-19 12:51:56 -0300 | [diff] [blame] | 38 | .clock_out = 3, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 39 | }, { |
| 40 | .i2c_address = 0x61, |
| 41 | } |
| 42 | }; |
| 43 | |
Devin Heitmueller | 99afb98 | 2008-11-15 07:13:07 -0300 | [diff] [blame] | 44 | |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 45 | static struct dibx000_agc_config bristol_dib3000p_mt2060_agc_config = { |
| 46 | .band_caps = BAND_VHF | BAND_UHF, |
Patrick Boettcher | 01b4bf3 | 2006-09-19 12:51:53 -0300 | [diff] [blame] | 47 | .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] | 48 | |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 49 | .agc1_max = 42598, |
| 50 | .agc1_min = 17694, |
| 51 | .agc2_max = 45875, |
| 52 | .agc2_min = 0, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 53 | |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 54 | .agc1_pt1 = 0, |
| 55 | .agc1_pt2 = 59, |
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_slope1 = 0, |
| 58 | .agc1_slope2 = 69, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 59 | |
| 60 | .agc2_pt1 = 0, |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 61 | .agc2_pt2 = 59, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 62 | |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 63 | .agc2_slope1 = 111, |
| 64 | .agc2_slope2 = 28, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 65 | }; |
| 66 | |
| 67 | static struct dib3000mc_config bristol_dib3000mc_config[2] = { |
| 68 | { .agc = &bristol_dib3000p_mt2060_agc_config, |
| 69 | .max_time = 0x196, |
| 70 | .ln_adc_level = 0x1cc7, |
| 71 | .output_mpeg2_in_188_bytes = 1, |
| 72 | }, |
| 73 | { .agc = &bristol_dib3000p_mt2060_agc_config, |
| 74 | .max_time = 0x196, |
| 75 | .ln_adc_level = 0x1cc7, |
| 76 | .output_mpeg2_in_188_bytes = 1, |
| 77 | } |
| 78 | }; |
| 79 | |
| 80 | static int bristol_frontend_attach(struct dvb_usb_adapter *adap) |
| 81 | { |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 82 | struct dib0700_state *st = adap->dev->priv; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 83 | if (adap->id == 0) { |
| 84 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(10); |
| 85 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10); |
| 86 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10); |
| 87 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(10); |
| 88 | |
Patrick Boettcher | 7fb3fc0 | 2006-09-20 04:37:18 -0300 | [diff] [blame] | 89 | if (force_lna_activation) |
| 90 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 91 | else |
| 92 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 0); |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 93 | |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 94 | if (dib3000mc_i2c_enumeration(&adap->dev->i2c_adap, 2, DEFAULT_DIB3000P_I2C_ADDRESS, bristol_dib3000mc_config) != 0) { |
| 95 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(10); |
| 96 | return -ENODEV; |
| 97 | } |
| 98 | } |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 99 | st->mt2060_if1[adap->id] = 1220; |
| 100 | return (adap->fe = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap, |
| 101 | (10 + adap->id) << 1, &bristol_dib3000mc_config[adap->id])) == NULL ? -ENODEV : 0; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 102 | } |
| 103 | |
Patrick Boettcher | 4a2b108 | 2008-01-25 07:32:58 -0300 | [diff] [blame] | 104 | static int eeprom_read(struct i2c_adapter *adap,u8 adrs,u8 *pval) |
Olivier DANET | c52344f | 2008-01-25 06:50:07 -0300 | [diff] [blame] | 105 | { |
| 106 | struct i2c_msg msg[2] = { |
| 107 | { .addr = 0x50, .flags = 0, .buf = &adrs, .len = 1 }, |
| 108 | { .addr = 0x50, .flags = I2C_M_RD, .buf = pval, .len = 1 }, |
| 109 | }; |
| 110 | if (i2c_transfer(adap, msg, 2) != 2) return -EREMOTEIO; |
| 111 | return 0; |
| 112 | } |
| 113 | |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 114 | static int bristol_tuner_attach(struct dvb_usb_adapter *adap) |
| 115 | { |
Olivier DANET | c52344f | 2008-01-25 06:50:07 -0300 | [diff] [blame] | 116 | struct i2c_adapter *prim_i2c = &adap->dev->i2c_adap; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 117 | 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] | 118 | s8 a; |
| 119 | int if1=1220; |
Al Viro | da5ee48 | 2008-05-21 00:31:21 -0300 | [diff] [blame] | 120 | if (adap->dev->udev->descriptor.idVendor == cpu_to_le16(USB_VID_HAUPPAUGE) && |
| 121 | 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] | 122 | if (!eeprom_read(prim_i2c,0x59 + adap->id,&a)) if1=1220+a; |
| 123 | } |
| 124 | return dvb_attach(mt2060_attach,adap->fe, tun_i2c,&bristol_mt2060_config[adap->id], |
| 125 | if1) == NULL ? -ENODEV : 0; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 126 | } |
| 127 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 128 | /* STK7700D: Pinnacle/Terratec/Hauppauge Dual DVB-T Diversity */ |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 129 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 130 | /* MT226x */ |
| 131 | static struct dibx000_agc_config stk7700d_7000p_mt2266_agc_config[2] = { |
| 132 | { |
| 133 | BAND_UHF, // band_caps |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 134 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 135 | /* 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, |
| 136 | * 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 */ |
| 137 | (0 << 15) | (0 << 14) | (1 << 11) | (1 << 10) | (1 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), // setup |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 138 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 139 | 1130, // inv_gain |
| 140 | 21, // time_stabiliz |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 141 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 142 | 0, // alpha_level |
| 143 | 118, // thlock |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 144 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 145 | 0, // wbd_inv |
| 146 | 3530, // wbd_ref |
| 147 | 1, // wbd_sel |
| 148 | 0, // wbd_alpha |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 149 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 150 | 65535, // agc1_max |
| 151 | 33770, // agc1_min |
| 152 | 65535, // agc2_max |
| 153 | 23592, // agc2_min |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 154 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 155 | 0, // agc1_pt1 |
| 156 | 62, // agc1_pt2 |
| 157 | 255, // agc1_pt3 |
| 158 | 64, // agc1_slope1 |
| 159 | 64, // agc1_slope2 |
| 160 | 132, // agc2_pt1 |
| 161 | 192, // agc2_pt2 |
| 162 | 80, // agc2_slope1 |
| 163 | 80, // agc2_slope2 |
| 164 | |
| 165 | 17, // alpha_mant |
| 166 | 27, // alpha_exp |
| 167 | 23, // beta_mant |
| 168 | 51, // beta_exp |
| 169 | |
| 170 | 1, // perform_agc_softsplit |
| 171 | }, { |
| 172 | BAND_VHF | BAND_LBAND, // band_caps |
| 173 | |
| 174 | /* 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, |
| 175 | * 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 */ |
| 176 | (0 << 15) | (0 << 14) | (1 << 11) | (1 << 10) | (1 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup |
| 177 | |
| 178 | 2372, // inv_gain |
| 179 | 21, // time_stabiliz |
| 180 | |
| 181 | 0, // alpha_level |
| 182 | 118, // thlock |
| 183 | |
| 184 | 0, // wbd_inv |
| 185 | 3530, // wbd_ref |
| 186 | 1, // wbd_sel |
| 187 | 0, // wbd_alpha |
| 188 | |
| 189 | 65535, // agc1_max |
| 190 | 0, // agc1_min |
| 191 | 65535, // agc2_max |
| 192 | 23592, // agc2_min |
| 193 | |
| 194 | 0, // agc1_pt1 |
| 195 | 128, // agc1_pt2 |
| 196 | 128, // agc1_pt3 |
| 197 | 128, // agc1_slope1 |
| 198 | 0, // agc1_slope2 |
| 199 | 128, // agc2_pt1 |
| 200 | 253, // agc2_pt2 |
| 201 | 81, // agc2_slope1 |
| 202 | 0, // agc2_slope2 |
| 203 | |
| 204 | 17, // alpha_mant |
| 205 | 27, // alpha_exp |
| 206 | 23, // beta_mant |
| 207 | 51, // beta_exp |
| 208 | |
| 209 | 1, // perform_agc_softsplit |
| 210 | } |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 211 | }; |
| 212 | |
| 213 | static struct dibx000_bandwidth_config stk7700d_mt2266_pll_config = { |
| 214 | 60000, 30000, // internal, sampling |
| 215 | 1, 8, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass |
| 216 | 0, 0, 1, 1, 2, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo |
| 217 | (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k |
| 218 | 0, // ifreq |
| 219 | 20452225, // timf |
| 220 | }; |
| 221 | |
| 222 | static struct dib7000p_config stk7700d_dib7000p_mt2266_config[] = { |
| 223 | { .output_mpeg2_in_188_bytes = 1, |
| 224 | .hostbus_diversity = 1, |
| 225 | .tuner_is_baseband = 1, |
| 226 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 227 | .agc_config_count = 2, |
| 228 | .agc = stk7700d_7000p_mt2266_agc_config, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 229 | .bw = &stk7700d_mt2266_pll_config, |
| 230 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 231 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
| 232 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, |
| 233 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 234 | }, |
| 235 | { .output_mpeg2_in_188_bytes = 1, |
| 236 | .hostbus_diversity = 1, |
| 237 | .tuner_is_baseband = 1, |
| 238 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 239 | .agc_config_count = 2, |
| 240 | .agc = stk7700d_7000p_mt2266_agc_config, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 241 | .bw = &stk7700d_mt2266_pll_config, |
| 242 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 243 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
| 244 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, |
| 245 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 246 | } |
| 247 | }; |
| 248 | |
| 249 | static struct mt2266_config stk7700d_mt2266_config[2] = { |
| 250 | { .i2c_address = 0x60 |
| 251 | }, |
| 252 | { .i2c_address = 0x60 |
| 253 | } |
| 254 | }; |
| 255 | |
Daniel Gimpelevich | 132c318 | 2008-01-25 06:02:42 -0300 | [diff] [blame] | 256 | static int stk7700P2_frontend_attach(struct dvb_usb_adapter *adap) |
| 257 | { |
| 258 | if (adap->id == 0) { |
| 259 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 260 | msleep(10); |
| 261 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 262 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 263 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 264 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 265 | msleep(10); |
| 266 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 267 | msleep(10); |
Devin Heitmueller | 83c4fdf | 2009-01-21 01:55:45 -0300 | [diff] [blame] | 268 | if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, |
| 269 | stk7700d_dib7000p_mt2266_config) |
| 270 | != 0) { |
| 271 | err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", __func__); |
| 272 | return -ENODEV; |
| 273 | } |
Daniel Gimpelevich | 132c318 | 2008-01-25 06:02:42 -0300 | [diff] [blame] | 274 | } |
| 275 | |
| 276 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap,0x80+(adap->id << 1), |
| 277 | &stk7700d_dib7000p_mt2266_config[adap->id]); |
| 278 | |
| 279 | return adap->fe == NULL ? -ENODEV : 0; |
| 280 | } |
| 281 | |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 282 | static int stk7700d_frontend_attach(struct dvb_usb_adapter *adap) |
| 283 | { |
| 284 | if (adap->id == 0) { |
| 285 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 286 | msleep(10); |
| 287 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 288 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 289 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 290 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 291 | msleep(10); |
| 292 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 293 | msleep(10); |
| 294 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
Devin Heitmueller | 83c4fdf | 2009-01-21 01:55:45 -0300 | [diff] [blame] | 295 | if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 2, 18, |
| 296 | stk7700d_dib7000p_mt2266_config) |
| 297 | != 0) { |
| 298 | err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", __func__); |
| 299 | return -ENODEV; |
| 300 | } |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 301 | } |
| 302 | |
| 303 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap,0x80+(adap->id << 1), |
| 304 | &stk7700d_dib7000p_mt2266_config[adap->id]); |
| 305 | |
| 306 | return adap->fe == NULL ? -ENODEV : 0; |
| 307 | } |
| 308 | |
| 309 | static int stk7700d_tuner_attach(struct dvb_usb_adapter *adap) |
| 310 | { |
| 311 | struct i2c_adapter *tun_i2c; |
| 312 | tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); |
| 313 | return dvb_attach(mt2266_attach, adap->fe, tun_i2c, |
Joe Perches | 1ebcad7 | 2009-07-02 15:57:09 -0300 | [diff] [blame] | 314 | &stk7700d_mt2266_config[adap->id]) == NULL ? -ENODEV : 0; |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 315 | } |
| 316 | |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 317 | /* STK7700-PH: Digital/Analog Hybrid Tuner, e.h. Cinergy HT USB HE */ |
Harvey Harrison | b1721d0 | 2008-04-25 19:03:08 -0700 | [diff] [blame] | 318 | static struct dibx000_agc_config xc3028_agc_config = { |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 319 | BAND_VHF | BAND_UHF, /* band_caps */ |
| 320 | |
| 321 | /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=0, |
| 322 | * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0, |
| 323 | * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */ |
| 324 | (0 << 15) | (0 << 14) | (0 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | |
| 325 | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), /* setup */ |
| 326 | |
| 327 | 712, /* inv_gain */ |
| 328 | 21, /* time_stabiliz */ |
| 329 | |
| 330 | 0, /* alpha_level */ |
| 331 | 118, /* thlock */ |
| 332 | |
| 333 | 0, /* wbd_inv */ |
| 334 | 2867, /* wbd_ref */ |
| 335 | 0, /* wbd_sel */ |
| 336 | 2, /* wbd_alpha */ |
| 337 | |
| 338 | 0, /* agc1_max */ |
| 339 | 0, /* agc1_min */ |
| 340 | 39718, /* agc2_max */ |
| 341 | 9930, /* agc2_min */ |
| 342 | 0, /* agc1_pt1 */ |
| 343 | 0, /* agc1_pt2 */ |
| 344 | 0, /* agc1_pt3 */ |
| 345 | 0, /* agc1_slope1 */ |
| 346 | 0, /* agc1_slope2 */ |
| 347 | 0, /* agc2_pt1 */ |
| 348 | 128, /* agc2_pt2 */ |
| 349 | 29, /* agc2_slope1 */ |
| 350 | 29, /* agc2_slope2 */ |
| 351 | |
| 352 | 17, /* alpha_mant */ |
| 353 | 27, /* alpha_exp */ |
| 354 | 23, /* beta_mant */ |
| 355 | 51, /* beta_exp */ |
| 356 | |
| 357 | 1, /* perform_agc_softsplit */ |
| 358 | }; |
| 359 | |
| 360 | /* 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] | 361 | static struct dibx000_bandwidth_config xc3028_bw_config = { |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 362 | 60000, 30000, /* internal, sampling */ |
| 363 | 1, 8, 3, 1, 0, /* pll_cfg: prediv, ratio, range, reset, bypass */ |
| 364 | 0, 0, 1, 1, 0, /* misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, |
| 365 | modulo */ |
| 366 | (3 << 14) | (1 << 12) | (524 << 0), /* sad_cfg: refsel, sel, freq_15k */ |
| 367 | (1 << 25) | 5816102, /* ifreq = 5.200000 MHz */ |
| 368 | 20452225, /* timf */ |
| 369 | 30000000, /* xtal_hz */ |
| 370 | }; |
| 371 | |
| 372 | static struct dib7000p_config stk7700ph_dib7700_xc3028_config = { |
| 373 | .output_mpeg2_in_188_bytes = 1, |
| 374 | .tuner_is_baseband = 1, |
| 375 | |
| 376 | .agc_config_count = 1, |
| 377 | .agc = &xc3028_agc_config, |
| 378 | .bw = &xc3028_bw_config, |
| 379 | |
| 380 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
| 381 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, |
| 382 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
| 383 | }; |
| 384 | |
Michael Krufky | d7cba04 | 2008-09-12 13:31:45 -0300 | [diff] [blame] | 385 | static int stk7700ph_xc3028_callback(void *ptr, int component, |
| 386 | int command, int arg) |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 387 | { |
| 388 | struct dvb_usb_adapter *adap = ptr; |
| 389 | |
| 390 | switch (command) { |
| 391 | case XC2028_TUNER_RESET: |
| 392 | /* Send the tuner in then out of reset */ |
| 393 | dib7000p_set_gpio(adap->fe, 8, 0, 0); msleep(10); |
| 394 | dib7000p_set_gpio(adap->fe, 8, 0, 1); |
| 395 | break; |
| 396 | case XC2028_RESET_CLK: |
| 397 | break; |
| 398 | default: |
| 399 | err("%s: unknown command %d, arg %d\n", __func__, |
| 400 | command, arg); |
| 401 | return -EINVAL; |
| 402 | } |
| 403 | return 0; |
| 404 | } |
| 405 | |
| 406 | static struct xc2028_ctrl stk7700ph_xc3028_ctrl = { |
| 407 | .fname = XC2028_DEFAULT_FIRMWARE, |
| 408 | .max_len = 64, |
| 409 | .demod = XC3028_FE_DIBCOM52, |
| 410 | }; |
| 411 | |
| 412 | static struct xc2028_config stk7700ph_xc3028_config = { |
| 413 | .i2c_addr = 0x61, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 414 | .ctrl = &stk7700ph_xc3028_ctrl, |
| 415 | }; |
| 416 | |
| 417 | static int stk7700ph_frontend_attach(struct dvb_usb_adapter *adap) |
| 418 | { |
| 419 | struct usb_device_descriptor *desc = &adap->dev->udev->descriptor; |
| 420 | |
Al Viro | da5ee48 | 2008-05-21 00:31:21 -0300 | [diff] [blame] | 421 | if (desc->idVendor == cpu_to_le16(USB_VID_PINNACLE) && |
| 422 | desc->idProduct == cpu_to_le16(USB_PID_PINNACLE_EXPRESSCARD_320CX)) |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 423 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); |
| 424 | else |
| 425 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 426 | msleep(20); |
| 427 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 428 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 429 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 430 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 431 | msleep(10); |
| 432 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 433 | msleep(20); |
| 434 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 435 | msleep(10); |
| 436 | |
Devin Heitmueller | 83c4fdf | 2009-01-21 01:55:45 -0300 | [diff] [blame] | 437 | if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, |
| 438 | &stk7700ph_dib7700_xc3028_config) != 0) { |
| 439 | err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", |
| 440 | __func__); |
| 441 | return -ENODEV; |
| 442 | } |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 443 | |
| 444 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, |
| 445 | &stk7700ph_dib7700_xc3028_config); |
| 446 | |
| 447 | return adap->fe == NULL ? -ENODEV : 0; |
| 448 | } |
| 449 | |
| 450 | static int stk7700ph_tuner_attach(struct dvb_usb_adapter *adap) |
| 451 | { |
| 452 | struct i2c_adapter *tun_i2c; |
| 453 | |
| 454 | tun_i2c = dib7000p_get_i2c_master(adap->fe, |
| 455 | DIBX000_I2C_INTERFACE_TUNER, 1); |
| 456 | |
| 457 | stk7700ph_xc3028_config.i2c_adap = tun_i2c; |
Michael Krufky | d7cba04 | 2008-09-12 13:31:45 -0300 | [diff] [blame] | 458 | |
| 459 | /* FIXME: generalize & move to common area */ |
| 460 | adap->fe->callback = stk7700ph_xc3028_callback; |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 461 | |
| 462 | return dvb_attach(xc2028_attach, adap->fe, &stk7700ph_xc3028_config) |
| 463 | == NULL ? -ENODEV : 0; |
| 464 | } |
| 465 | |
Devin Heitmueller | 4b330be | 2008-12-01 06:51:14 -0300 | [diff] [blame] | 466 | #define DEFAULT_RC_INTERVAL 50 |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 467 | |
| 468 | static u8 rc_request[] = { REQUEST_POLL_RC, 0 }; |
| 469 | |
Patrick Boettcher | 58e6f95 | 2008-03-29 21:37:01 -0300 | [diff] [blame] | 470 | /* Number of keypresses to ignore before start repeating */ |
Devin Heitmueller | 4b330be | 2008-12-01 06:51:14 -0300 | [diff] [blame] | 471 | #define RC_REPEAT_DELAY 6 |
| 472 | #define RC_REPEAT_DELAY_V1_20 10 |
Patrick Boettcher | 58e6f95 | 2008-03-29 21:37:01 -0300 | [diff] [blame] | 473 | |
Devin Heitmueller | 99afb98 | 2008-11-15 07:13:07 -0300 | [diff] [blame] | 474 | |
| 475 | |
| 476 | /* Used by firmware versions < 1.20 (deprecated) */ |
| 477 | static int dib0700_rc_query_legacy(struct dvb_usb_device *d, u32 *event, |
| 478 | int *state) |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 479 | { |
| 480 | u8 key[4]; |
| 481 | int i; |
| 482 | struct dvb_usb_rc_key *keymap = d->props.rc_key_map; |
| 483 | struct dib0700_state *st = d->priv; |
| 484 | *event = 0; |
| 485 | *state = REMOTE_NO_KEY_PRESSED; |
| 486 | i=dib0700_ctrl_rd(d,rc_request,2,key,4); |
| 487 | if (i<=0) { |
Janne Grunau | 034d65e | 2007-07-31 08:48:40 -0300 | [diff] [blame] | 488 | err("RC Query Failed"); |
Janne Grunau | 89f4267 | 2007-07-31 19:45:13 -0300 | [diff] [blame] | 489 | return -1; |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 490 | } |
Patrick Boettcher | 58e6f95 | 2008-03-29 21:37:01 -0300 | [diff] [blame] | 491 | |
| 492 | /* losing half of KEY_0 events from Philipps rc5 remotes.. */ |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 493 | if (key[0]==0 && key[1]==0 && key[2]==0 && key[3]==0) return 0; |
Patrick Boettcher | 58e6f95 | 2008-03-29 21:37:01 -0300 | [diff] [blame] | 494 | |
| 495 | /* 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]); */ |
| 496 | |
| 497 | dib0700_rc_setup(d); /* reset ir sensor data to prevent false events */ |
| 498 | |
| 499 | switch (dvb_usb_dib0700_ir_proto) { |
| 500 | case 0: { |
| 501 | /* NEC protocol sends repeat code as 0 0 0 FF */ |
| 502 | if ((key[3-2] == 0x00) && (key[3-3] == 0x00) && |
| 503 | (key[3] == 0xFF)) { |
| 504 | st->rc_counter++; |
| 505 | if (st->rc_counter > RC_REPEAT_DELAY) { |
| 506 | *event = d->last_event; |
| 507 | *state = REMOTE_KEY_PRESSED; |
| 508 | st->rc_counter = RC_REPEAT_DELAY; |
| 509 | } |
| 510 | return 0; |
| 511 | } |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 512 | for (i=0;i<d->props.rc_key_map_size; i++) { |
Mauro Carvalho Chehab | 2e36588 | 2009-08-29 15:19:31 -0300 | [diff] [blame] | 513 | if (rc5_custom(&keymap[i]) == key[3-2] && |
| 514 | rc5_data(&keymap[i]) == key[3-3]) { |
Patrick Boettcher | 58e6f95 | 2008-03-29 21:37:01 -0300 | [diff] [blame] | 515 | st->rc_counter = 0; |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 516 | *event = keymap[i].event; |
| 517 | *state = REMOTE_KEY_PRESSED; |
Patrick Boettcher | 58e6f95 | 2008-03-29 21:37:01 -0300 | [diff] [blame] | 518 | d->last_event = keymap[i].event; |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 519 | return 0; |
| 520 | } |
| 521 | } |
Patrick Boettcher | 58e6f95 | 2008-03-29 21:37:01 -0300 | [diff] [blame] | 522 | break; |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 523 | } |
Patrick Boettcher | 58e6f95 | 2008-03-29 21:37:01 -0300 | [diff] [blame] | 524 | default: { |
| 525 | /* RC-5 protocol changes toggle bit on new keypress */ |
| 526 | for (i = 0; i < d->props.rc_key_map_size; i++) { |
Mauro Carvalho Chehab | 2e36588 | 2009-08-29 15:19:31 -0300 | [diff] [blame] | 527 | if (rc5_custom(&keymap[i]) == key[3-2] && |
| 528 | rc5_data(&keymap[i]) == key[3-3]) { |
Patrick Boettcher | 58e6f95 | 2008-03-29 21:37:01 -0300 | [diff] [blame] | 529 | if (d->last_event == keymap[i].event && |
| 530 | key[3-1] == st->rc_toggle) { |
| 531 | st->rc_counter++; |
| 532 | /* prevents unwanted double hits */ |
| 533 | if (st->rc_counter > RC_REPEAT_DELAY) { |
| 534 | *event = d->last_event; |
| 535 | *state = REMOTE_KEY_PRESSED; |
| 536 | st->rc_counter = RC_REPEAT_DELAY; |
| 537 | } |
| 538 | |
| 539 | return 0; |
| 540 | } |
| 541 | st->rc_counter = 0; |
| 542 | *event = keymap[i].event; |
| 543 | *state = REMOTE_KEY_PRESSED; |
| 544 | st->rc_toggle = key[3-1]; |
| 545 | d->last_event = keymap[i].event; |
| 546 | return 0; |
| 547 | } |
| 548 | } |
| 549 | break; |
| 550 | } |
| 551 | } |
| 552 | err("Unknown remote controller key: %2X %2X %2X %2X", (int) key[3-2], (int) key[3-3], (int) key[3-1], (int) key[3]); |
| 553 | d->last_event = 0; |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 554 | return 0; |
| 555 | } |
| 556 | |
Devin Heitmueller | 99afb98 | 2008-11-15 07:13:07 -0300 | [diff] [blame] | 557 | /* This is the structure of the RC response packet starting in firmware 1.20 */ |
| 558 | struct dib0700_rc_response { |
| 559 | u8 report_id; |
| 560 | u8 data_state; |
Mauro Carvalho Chehab | aa15c0a | 2009-09-26 13:29:35 -0300 | [diff] [blame] | 561 | u16 system; |
Devin Heitmueller | 99afb98 | 2008-11-15 07:13:07 -0300 | [diff] [blame] | 562 | u8 data; |
| 563 | u8 not_data; |
| 564 | }; |
| 565 | |
| 566 | /* This supports the new IR response format for firmware v1.20 */ |
| 567 | static int dib0700_rc_query_v1_20(struct dvb_usb_device *d, u32 *event, |
| 568 | int *state) |
| 569 | { |
| 570 | struct dvb_usb_rc_key *keymap = d->props.rc_key_map; |
| 571 | struct dib0700_state *st = d->priv; |
| 572 | struct dib0700_rc_response poll_reply; |
| 573 | u8 buf[6]; |
| 574 | int i; |
| 575 | int status; |
| 576 | int actlen; |
| 577 | int found = 0; |
| 578 | |
| 579 | /* Set initial results in case we exit the function early */ |
| 580 | *event = 0; |
| 581 | *state = REMOTE_NO_KEY_PRESSED; |
| 582 | |
| 583 | /* Firmware v1.20 provides RC data via bulk endpoint 1 */ |
| 584 | status = usb_bulk_msg(d->udev, usb_rcvbulkpipe(d->udev, 1), buf, |
| 585 | sizeof(buf), &actlen, 50); |
| 586 | if (status < 0) { |
| 587 | /* No data available (meaning no key press) */ |
| 588 | return 0; |
| 589 | } |
| 590 | |
Mauro Carvalho Chehab | aa15c0a | 2009-09-26 13:29:35 -0300 | [diff] [blame] | 591 | |
| 592 | switch (dvb_usb_dib0700_ir_proto) { |
| 593 | case 0: |
| 594 | poll_reply.report_id = 0; |
| 595 | poll_reply.data_state = 1; |
| 596 | poll_reply.system = buf[2]; |
| 597 | poll_reply.data = buf[4]; |
| 598 | poll_reply.not_data = buf[5]; |
| 599 | |
| 600 | /* NEC protocol sends repeat code as 0 0 0 FF */ |
| 601 | if ((poll_reply.system == 0x00) && (poll_reply.data == 0x00) |
| 602 | && (poll_reply.not_data == 0xff)) { |
| 603 | poll_reply.data_state = 2; |
| 604 | break; |
| 605 | } |
| 606 | break; |
| 607 | default: |
| 608 | if (actlen != sizeof(buf)) { |
| 609 | /* We didn't get back the 6 byte message we expected */ |
| 610 | err("Unexpected RC response size [%d]", actlen); |
| 611 | return -1; |
| 612 | } |
| 613 | |
| 614 | poll_reply.report_id = buf[0]; |
| 615 | poll_reply.data_state = buf[1]; |
| 616 | poll_reply.system = (buf[2] << 8) | buf[3]; |
| 617 | poll_reply.data = buf[4]; |
| 618 | poll_reply.not_data = buf[5]; |
| 619 | |
| 620 | break; |
Devin Heitmueller | 99afb98 | 2008-11-15 07:13:07 -0300 | [diff] [blame] | 621 | } |
| 622 | |
Devin Heitmueller | 99afb98 | 2008-11-15 07:13:07 -0300 | [diff] [blame] | 623 | if ((poll_reply.data + poll_reply.not_data) != 0xff) { |
| 624 | /* Key failed integrity check */ |
Mauro Carvalho Chehab | aa15c0a | 2009-09-26 13:29:35 -0300 | [diff] [blame] | 625 | err("key failed integrity check: %04x %02x %02x", |
| 626 | poll_reply.system, |
Devin Heitmueller | 99afb98 | 2008-11-15 07:13:07 -0300 | [diff] [blame] | 627 | poll_reply.data, poll_reply.not_data); |
| 628 | return -1; |
| 629 | } |
| 630 | |
Mauro Carvalho Chehab | aa15c0a | 2009-09-26 13:29:35 -0300 | [diff] [blame] | 631 | |
Devin Heitmueller | 99afb98 | 2008-11-15 07:13:07 -0300 | [diff] [blame] | 632 | /* Find the key in the map */ |
| 633 | for (i = 0; i < d->props.rc_key_map_size; i++) { |
Mauro Carvalho Chehab | aa15c0a | 2009-09-26 13:29:35 -0300 | [diff] [blame] | 634 | if (rc5_custom(&keymap[i]) == (poll_reply.system & 0xff) && |
Mauro Carvalho Chehab | 2e36588 | 2009-08-29 15:19:31 -0300 | [diff] [blame] | 635 | rc5_data(&keymap[i]) == poll_reply.data) { |
Devin Heitmueller | 99afb98 | 2008-11-15 07:13:07 -0300 | [diff] [blame] | 636 | *event = keymap[i].event; |
| 637 | found = 1; |
| 638 | break; |
| 639 | } |
| 640 | } |
| 641 | |
| 642 | if (found == 0) { |
Mauro Carvalho Chehab | aa15c0a | 2009-09-26 13:29:35 -0300 | [diff] [blame] | 643 | err("Unknown remote controller key: %04x %02x %02x", |
| 644 | poll_reply.system, |
Devin Heitmueller | 99afb98 | 2008-11-15 07:13:07 -0300 | [diff] [blame] | 645 | poll_reply.data, poll_reply.not_data); |
| 646 | d->last_event = 0; |
| 647 | return 0; |
| 648 | } |
| 649 | |
| 650 | if (poll_reply.data_state == 1) { |
| 651 | /* New key hit */ |
| 652 | st->rc_counter = 0; |
| 653 | *event = keymap[i].event; |
| 654 | *state = REMOTE_KEY_PRESSED; |
| 655 | d->last_event = keymap[i].event; |
| 656 | } else if (poll_reply.data_state == 2) { |
| 657 | /* Key repeated */ |
| 658 | st->rc_counter++; |
| 659 | |
| 660 | /* prevents unwanted double hits */ |
| 661 | if (st->rc_counter > RC_REPEAT_DELAY_V1_20) { |
| 662 | *event = d->last_event; |
| 663 | *state = REMOTE_KEY_PRESSED; |
| 664 | st->rc_counter = RC_REPEAT_DELAY_V1_20; |
| 665 | } |
| 666 | } else { |
| 667 | err("Unknown data state [%d]", poll_reply.data_state); |
| 668 | } |
| 669 | |
| 670 | return 0; |
| 671 | } |
| 672 | |
| 673 | static int dib0700_rc_query(struct dvb_usb_device *d, u32 *event, int *state) |
| 674 | { |
| 675 | struct dib0700_state *st = d->priv; |
| 676 | |
| 677 | /* Because some people may have improperly named firmware files, |
| 678 | let's figure out whether to use the new firmware call or the legacy |
| 679 | call based on the firmware version embedded in the file */ |
| 680 | if (st->rc_func_version == 0) { |
| 681 | u32 hwver, romver, ramver, fwtype; |
| 682 | int ret = dib0700_get_version(d, &hwver, &romver, &ramver, |
| 683 | &fwtype); |
| 684 | if (ret < 0) { |
| 685 | err("Could not determine version info"); |
| 686 | return -1; |
| 687 | } |
| 688 | if (ramver < 0x10200) |
| 689 | st->rc_func_version = 1; |
| 690 | else |
| 691 | st->rc_func_version = 2; |
| 692 | } |
| 693 | |
| 694 | if (st->rc_func_version == 2) |
| 695 | return dib0700_rc_query_v1_20(d, event, state); |
| 696 | else |
| 697 | return dib0700_rc_query_legacy(d, event, state); |
| 698 | } |
| 699 | |
Janne Grunau | 82f3d55 | 2007-07-30 13:50:28 -0300 | [diff] [blame] | 700 | static struct dvb_usb_rc_key dib0700_rc_keys[] = { |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 701 | /* Key codes for the tiny Pinnacle remote*/ |
Mauro Carvalho Chehab | 2e36588 | 2009-08-29 15:19:31 -0300 | [diff] [blame] | 702 | { 0x0700, KEY_MUTE }, |
| 703 | { 0x0701, KEY_MENU }, /* Pinnacle logo */ |
| 704 | { 0x0739, KEY_POWER }, |
| 705 | { 0x0703, KEY_VOLUMEUP }, |
| 706 | { 0x0709, KEY_VOLUMEDOWN }, |
| 707 | { 0x0706, KEY_CHANNELUP }, |
| 708 | { 0x070c, KEY_CHANNELDOWN }, |
| 709 | { 0x070f, KEY_1 }, |
| 710 | { 0x0715, KEY_2 }, |
| 711 | { 0x0710, KEY_3 }, |
| 712 | { 0x0718, KEY_4 }, |
| 713 | { 0x071b, KEY_5 }, |
| 714 | { 0x071e, KEY_6 }, |
| 715 | { 0x0711, KEY_7 }, |
| 716 | { 0x0721, KEY_8 }, |
| 717 | { 0x0712, KEY_9 }, |
| 718 | { 0x0727, KEY_0 }, |
| 719 | { 0x0724, KEY_SCREEN }, /* 'Square' key */ |
| 720 | { 0x072a, KEY_TEXT }, /* 'T' key */ |
| 721 | { 0x072d, KEY_REWIND }, |
| 722 | { 0x0730, KEY_PLAY }, |
| 723 | { 0x0733, KEY_FASTFORWARD }, |
| 724 | { 0x0736, KEY_RECORD }, |
| 725 | { 0x073c, KEY_STOP }, |
| 726 | { 0x073f, KEY_CANCEL }, /* '?' key */ |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 727 | /* Key codes for the Terratec Cinergy DT XS Diversity, similar to cinergyT2.c */ |
Mauro Carvalho Chehab | 2e36588 | 2009-08-29 15:19:31 -0300 | [diff] [blame] | 728 | { 0xeb01, KEY_POWER }, |
| 729 | { 0xeb02, KEY_1 }, |
| 730 | { 0xeb03, KEY_2 }, |
| 731 | { 0xeb04, KEY_3 }, |
| 732 | { 0xeb05, KEY_4 }, |
| 733 | { 0xeb06, KEY_5 }, |
| 734 | { 0xeb07, KEY_6 }, |
| 735 | { 0xeb08, KEY_7 }, |
| 736 | { 0xeb09, KEY_8 }, |
| 737 | { 0xeb0a, KEY_9 }, |
| 738 | { 0xeb0b, KEY_VIDEO }, |
| 739 | { 0xeb0c, KEY_0 }, |
| 740 | { 0xeb0d, KEY_REFRESH }, |
| 741 | { 0xeb0f, KEY_EPG }, |
| 742 | { 0xeb10, KEY_UP }, |
| 743 | { 0xeb11, KEY_LEFT }, |
| 744 | { 0xeb12, KEY_OK }, |
| 745 | { 0xeb13, KEY_RIGHT }, |
| 746 | { 0xeb14, KEY_DOWN }, |
| 747 | { 0xeb16, KEY_INFO }, |
| 748 | { 0xeb17, KEY_RED }, |
| 749 | { 0xeb18, KEY_GREEN }, |
| 750 | { 0xeb19, KEY_YELLOW }, |
| 751 | { 0xeb1a, KEY_BLUE }, |
| 752 | { 0xeb1b, KEY_CHANNELUP }, |
| 753 | { 0xeb1c, KEY_VOLUMEUP }, |
| 754 | { 0xeb1d, KEY_MUTE }, |
| 755 | { 0xeb1e, KEY_VOLUMEDOWN }, |
| 756 | { 0xeb1f, KEY_CHANNELDOWN }, |
| 757 | { 0xeb40, KEY_PAUSE }, |
| 758 | { 0xeb41, KEY_HOME }, |
| 759 | { 0xeb42, KEY_MENU }, /* DVD Menu */ |
| 760 | { 0xeb43, KEY_SUBTITLE }, |
| 761 | { 0xeb44, KEY_TEXT }, /* Teletext */ |
| 762 | { 0xeb45, KEY_DELETE }, |
| 763 | { 0xeb46, KEY_TV }, |
| 764 | { 0xeb47, KEY_DVD }, |
| 765 | { 0xeb48, KEY_STOP }, |
| 766 | { 0xeb49, KEY_VIDEO }, |
| 767 | { 0xeb4a, KEY_AUDIO }, /* Music */ |
| 768 | { 0xeb4b, KEY_SCREEN }, /* Pic */ |
| 769 | { 0xeb4c, KEY_PLAY }, |
| 770 | { 0xeb4d, KEY_BACK }, |
| 771 | { 0xeb4e, KEY_REWIND }, |
| 772 | { 0xeb4f, KEY_FASTFORWARD }, |
| 773 | { 0xeb54, KEY_PREVIOUS }, |
| 774 | { 0xeb58, KEY_RECORD }, |
| 775 | { 0xeb5c, KEY_NEXT }, |
Janne Grunau | 7161f27 | 2007-07-30 13:54:55 -0300 | [diff] [blame] | 776 | |
| 777 | /* Key codes for the Haupauge WinTV Nova-TD, copied from nova-t-usb2.c (Nova-T USB2) */ |
Mauro Carvalho Chehab | 2e36588 | 2009-08-29 15:19:31 -0300 | [diff] [blame] | 778 | { 0x1e00, KEY_0 }, |
| 779 | { 0x1e01, KEY_1 }, |
| 780 | { 0x1e02, KEY_2 }, |
| 781 | { 0x1e03, KEY_3 }, |
| 782 | { 0x1e04, KEY_4 }, |
| 783 | { 0x1e05, KEY_5 }, |
| 784 | { 0x1e06, KEY_6 }, |
| 785 | { 0x1e07, KEY_7 }, |
| 786 | { 0x1e08, KEY_8 }, |
| 787 | { 0x1e09, KEY_9 }, |
| 788 | { 0x1e0a, KEY_KPASTERISK }, |
| 789 | { 0x1e0b, KEY_RED }, |
| 790 | { 0x1e0c, KEY_RADIO }, |
| 791 | { 0x1e0d, KEY_MENU }, |
| 792 | { 0x1e0e, KEY_GRAVE }, /* # */ |
| 793 | { 0x1e0f, KEY_MUTE }, |
| 794 | { 0x1e10, KEY_VOLUMEUP }, |
| 795 | { 0x1e11, KEY_VOLUMEDOWN }, |
| 796 | { 0x1e12, KEY_CHANNEL }, |
| 797 | { 0x1e14, KEY_UP }, |
| 798 | { 0x1e15, KEY_DOWN }, |
| 799 | { 0x1e16, KEY_LEFT }, |
| 800 | { 0x1e17, KEY_RIGHT }, |
| 801 | { 0x1e18, KEY_VIDEO }, |
| 802 | { 0x1e19, KEY_AUDIO }, |
| 803 | { 0x1e1a, KEY_MEDIA }, |
| 804 | { 0x1e1b, KEY_EPG }, |
| 805 | { 0x1e1c, KEY_TV }, |
| 806 | { 0x1e1e, KEY_NEXT }, |
| 807 | { 0x1e1f, KEY_BACK }, |
| 808 | { 0x1e20, KEY_CHANNELUP }, |
| 809 | { 0x1e21, KEY_CHANNELDOWN }, |
| 810 | { 0x1e24, KEY_LAST }, /* Skip backwards */ |
| 811 | { 0x1e25, KEY_OK }, |
| 812 | { 0x1e29, KEY_BLUE}, |
| 813 | { 0x1e2e, KEY_GREEN }, |
| 814 | { 0x1e30, KEY_PAUSE }, |
| 815 | { 0x1e32, KEY_REWIND }, |
| 816 | { 0x1e34, KEY_FASTFORWARD }, |
| 817 | { 0x1e35, KEY_PLAY }, |
| 818 | { 0x1e36, KEY_STOP }, |
| 819 | { 0x1e37, KEY_RECORD }, |
| 820 | { 0x1e38, KEY_YELLOW }, |
| 821 | { 0x1e3b, KEY_GOTO }, |
| 822 | { 0x1e3d, KEY_POWER }, |
Jaroslav Barton | 48e6a01 | 2007-11-10 19:17:45 -0300 | [diff] [blame] | 823 | |
| 824 | /* Key codes for the Leadtek Winfast DTV Dongle */ |
Mauro Carvalho Chehab | 2e36588 | 2009-08-29 15:19:31 -0300 | [diff] [blame] | 825 | { 0x0042, KEY_POWER }, |
| 826 | { 0x077c, KEY_TUNER }, |
| 827 | { 0x0f4e, KEY_PRINT }, /* PREVIEW */ |
| 828 | { 0x0840, KEY_SCREEN }, /* full screen toggle*/ |
| 829 | { 0x0f71, KEY_DOT }, /* frequency */ |
| 830 | { 0x0743, KEY_0 }, |
| 831 | { 0x0c41, KEY_1 }, |
| 832 | { 0x0443, KEY_2 }, |
| 833 | { 0x0b7f, KEY_3 }, |
| 834 | { 0x0e41, KEY_4 }, |
| 835 | { 0x0643, KEY_5 }, |
| 836 | { 0x097f, KEY_6 }, |
| 837 | { 0x0d7e, KEY_7 }, |
| 838 | { 0x057c, KEY_8 }, |
| 839 | { 0x0a40, KEY_9 }, |
| 840 | { 0x0e4e, KEY_CLEAR }, |
| 841 | { 0x047c, KEY_CHANNEL }, /* show channel number */ |
| 842 | { 0x0f41, KEY_LAST }, /* recall */ |
| 843 | { 0x0342, KEY_MUTE }, |
| 844 | { 0x064c, KEY_RESERVED }, /* PIP button*/ |
| 845 | { 0x0172, KEY_SHUFFLE }, /* SNAPSHOT */ |
| 846 | { 0x0c4e, KEY_PLAYPAUSE }, /* TIMESHIFT */ |
| 847 | { 0x0b70, KEY_RECORD }, |
| 848 | { 0x037d, KEY_VOLUMEUP }, |
| 849 | { 0x017d, KEY_VOLUMEDOWN }, |
| 850 | { 0x0242, KEY_CHANNELUP }, |
| 851 | { 0x007d, KEY_CHANNELDOWN }, |
Chris Rankin | 48aa739 | 2008-09-25 06:52:24 -0300 | [diff] [blame] | 852 | |
| 853 | /* Key codes for Nova-TD "credit card" remote control. */ |
Mauro Carvalho Chehab | 2e36588 | 2009-08-29 15:19:31 -0300 | [diff] [blame] | 854 | { 0x1d00, KEY_0 }, |
| 855 | { 0x1d01, KEY_1 }, |
| 856 | { 0x1d02, KEY_2 }, |
| 857 | { 0x1d03, KEY_3 }, |
| 858 | { 0x1d04, KEY_4 }, |
| 859 | { 0x1d05, KEY_5 }, |
| 860 | { 0x1d06, KEY_6 }, |
| 861 | { 0x1d07, KEY_7 }, |
| 862 | { 0x1d08, KEY_8 }, |
| 863 | { 0x1d09, KEY_9 }, |
| 864 | { 0x1d0a, KEY_TEXT }, |
| 865 | { 0x1d0d, KEY_MENU }, |
| 866 | { 0x1d0f, KEY_MUTE }, |
| 867 | { 0x1d10, KEY_VOLUMEUP }, |
| 868 | { 0x1d11, KEY_VOLUMEDOWN }, |
| 869 | { 0x1d12, KEY_CHANNEL }, |
| 870 | { 0x1d14, KEY_UP }, |
| 871 | { 0x1d15, KEY_DOWN }, |
| 872 | { 0x1d16, KEY_LEFT }, |
| 873 | { 0x1d17, KEY_RIGHT }, |
| 874 | { 0x1d1c, KEY_TV }, |
| 875 | { 0x1d1e, KEY_NEXT }, |
| 876 | { 0x1d1f, KEY_BACK }, |
| 877 | { 0x1d20, KEY_CHANNELUP }, |
| 878 | { 0x1d21, KEY_CHANNELDOWN }, |
| 879 | { 0x1d24, KEY_LAST }, |
| 880 | { 0x1d25, KEY_OK }, |
| 881 | { 0x1d30, KEY_PAUSE }, |
| 882 | { 0x1d32, KEY_REWIND }, |
| 883 | { 0x1d34, KEY_FASTFORWARD }, |
| 884 | { 0x1d35, KEY_PLAY }, |
| 885 | { 0x1d36, KEY_STOP }, |
| 886 | { 0x1d37, KEY_RECORD }, |
| 887 | { 0x1d3b, KEY_GOTO }, |
| 888 | { 0x1d3d, KEY_POWER }, |
Mauro Carvalho Chehab | 4c5128b | 2009-09-26 13:31:31 -0300 | [diff] [blame] | 889 | |
| 890 | /* Key codes for the Pixelview SBTVD remote (proto NEC) */ |
| 891 | { 0x8613, KEY_MUTE }, |
| 892 | { 0x8612, KEY_POWER }, |
| 893 | { 0x8601, KEY_1 }, |
| 894 | { 0x8602, KEY_2 }, |
| 895 | { 0x8603, KEY_3 }, |
| 896 | { 0x8604, KEY_4 }, |
| 897 | { 0x8605, KEY_5 }, |
| 898 | { 0x8606, KEY_6 }, |
| 899 | { 0x8607, KEY_7 }, |
| 900 | { 0x8608, KEY_8 }, |
| 901 | { 0x8609, KEY_9 }, |
| 902 | { 0x8600, KEY_0 }, |
| 903 | { 0x860d, KEY_CHANNELUP }, |
| 904 | { 0x8619, KEY_CHANNELDOWN }, |
| 905 | { 0x8610, KEY_VOLUMEUP }, |
| 906 | { 0x860c, KEY_VOLUMEDOWN }, |
| 907 | |
| 908 | { 0x860a, KEY_CAMERA }, |
| 909 | { 0x860b, KEY_ZOOM }, |
| 910 | { 0x861b, KEY_BACKSPACE }, |
| 911 | { 0x8615, KEY_ENTER }, |
| 912 | |
| 913 | { 0x861d, KEY_UP }, |
| 914 | { 0x861e, KEY_DOWN }, |
| 915 | { 0x860e, KEY_LEFT }, |
| 916 | { 0x860f, KEY_RIGHT }, |
| 917 | |
| 918 | { 0x8618, KEY_RECORD }, |
| 919 | { 0x861a, KEY_STOP }, |
Sergio C Fortier | c86c82b | 2009-11-04 15:55:09 -0300 | [diff] [blame] | 920 | |
| 921 | /* Key codes for the EvolutePC TVWay+ remote (proto NEC) */ |
| 922 | { 0x7a00, KEY_MENU }, |
| 923 | { 0x7a01, KEY_RECORD }, |
| 924 | { 0x7a02, KEY_PLAY }, |
| 925 | { 0x7a03, KEY_STOP }, |
| 926 | { 0x7a10, KEY_CHANNELUP }, |
| 927 | { 0x7a11, KEY_CHANNELDOWN }, |
| 928 | { 0x7a12, KEY_VOLUMEUP }, |
| 929 | { 0x7a13, KEY_VOLUMEDOWN }, |
| 930 | { 0x7a40, KEY_POWER }, |
| 931 | { 0x7a41, KEY_MUTE }, |
Janne Grunau | 82f3d55 | 2007-07-30 13:50:28 -0300 | [diff] [blame] | 932 | }; |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 933 | |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 934 | /* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */ |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 935 | static struct dibx000_agc_config stk7700p_7000m_mt2060_agc_config = { |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 936 | BAND_UHF | BAND_VHF, // band_caps |
| 937 | |
| 938 | /* 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, |
| 939 | * 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 */ |
| 940 | (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup |
| 941 | |
| 942 | 712, // inv_gain |
| 943 | 41, // time_stabiliz |
| 944 | |
| 945 | 0, // alpha_level |
| 946 | 118, // thlock |
| 947 | |
| 948 | 0, // wbd_inv |
| 949 | 4095, // wbd_ref |
| 950 | 0, // wbd_sel |
| 951 | 0, // wbd_alpha |
| 952 | |
| 953 | 42598, // agc1_max |
| 954 | 17694, // agc1_min |
| 955 | 45875, // agc2_max |
| 956 | 2621, // agc2_min |
| 957 | 0, // agc1_pt1 |
| 958 | 76, // agc1_pt2 |
| 959 | 139, // agc1_pt3 |
| 960 | 52, // agc1_slope1 |
| 961 | 59, // agc1_slope2 |
| 962 | 107, // agc2_pt1 |
| 963 | 172, // agc2_pt2 |
| 964 | 57, // agc2_slope1 |
| 965 | 70, // agc2_slope2 |
| 966 | |
| 967 | 21, // alpha_mant |
| 968 | 25, // alpha_exp |
| 969 | 28, // beta_mant |
| 970 | 48, // beta_exp |
| 971 | |
| 972 | 1, // perform_agc_softsplit |
| 973 | { 0, // split_min |
| 974 | 107, // split_max |
| 975 | 51800, // global_split_min |
| 976 | 24700 // global_split_max |
| 977 | }, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 978 | }; |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 979 | |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 980 | static struct dibx000_agc_config stk7700p_7000p_mt2060_agc_config = { |
| 981 | BAND_UHF | BAND_VHF, |
| 982 | |
| 983 | /* 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, |
| 984 | * 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 */ |
| 985 | (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup |
| 986 | |
| 987 | 712, // inv_gain |
| 988 | 41, // time_stabiliz |
| 989 | |
| 990 | 0, // alpha_level |
| 991 | 118, // thlock |
| 992 | |
| 993 | 0, // wbd_inv |
| 994 | 4095, // wbd_ref |
| 995 | 0, // wbd_sel |
| 996 | 0, // wbd_alpha |
| 997 | |
| 998 | 42598, // agc1_max |
| 999 | 16384, // agc1_min |
| 1000 | 42598, // agc2_max |
| 1001 | 0, // agc2_min |
| 1002 | |
| 1003 | 0, // agc1_pt1 |
| 1004 | 137, // agc1_pt2 |
| 1005 | 255, // agc1_pt3 |
| 1006 | |
| 1007 | 0, // agc1_slope1 |
| 1008 | 255, // agc1_slope2 |
| 1009 | |
| 1010 | 0, // agc2_pt1 |
| 1011 | 0, // agc2_pt2 |
| 1012 | |
| 1013 | 0, // agc2_slope1 |
| 1014 | 41, // agc2_slope2 |
| 1015 | |
| 1016 | 15, // alpha_mant |
| 1017 | 25, // alpha_exp |
| 1018 | |
| 1019 | 28, // beta_mant |
| 1020 | 48, // beta_exp |
| 1021 | |
| 1022 | 0, // perform_agc_softsplit |
| 1023 | }; |
| 1024 | |
| 1025 | static struct dibx000_bandwidth_config stk7700p_pll_config = { |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 1026 | 60000, 30000, // internal, sampling |
| 1027 | 1, 8, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass |
| 1028 | 0, 0, 1, 1, 0, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo |
| 1029 | (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k |
| 1030 | 60258167, // ifreq |
| 1031 | 20452225, // timf |
Patrick Boettcher | 3db78e5 | 2007-07-31 08:19:28 -0300 | [diff] [blame] | 1032 | 30000000, // xtal |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 1033 | }; |
| 1034 | |
| 1035 | static struct dib7000m_config stk7700p_dib7000m_config = { |
| 1036 | .dvbt_mode = 1, |
| 1037 | .output_mpeg2_in_188_bytes = 1, |
| 1038 | .quartz_direct = 1, |
| 1039 | |
| 1040 | .agc_config_count = 1, |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 1041 | .agc = &stk7700p_7000m_mt2060_agc_config, |
| 1042 | .bw = &stk7700p_pll_config, |
| 1043 | |
| 1044 | .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS, |
| 1045 | .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES, |
| 1046 | .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS, |
| 1047 | }; |
| 1048 | |
| 1049 | static struct dib7000p_config stk7700p_dib7000p_config = { |
| 1050 | .output_mpeg2_in_188_bytes = 1, |
| 1051 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 1052 | .agc_config_count = 1, |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 1053 | .agc = &stk7700p_7000p_mt2060_agc_config, |
| 1054 | .bw = &stk7700p_pll_config, |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 1055 | |
| 1056 | .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS, |
| 1057 | .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES, |
| 1058 | .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS, |
| 1059 | }; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1060 | |
| 1061 | static int stk7700p_frontend_attach(struct dvb_usb_adapter *adap) |
| 1062 | { |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 1063 | struct dib0700_state *st = adap->dev->priv; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1064 | /* 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] | 1065 | |
| 1066 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 1067 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(50); |
| 1068 | |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 1069 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10); |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 1070 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 1071 | |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1072 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10); |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 1073 | dib0700_ctrl_clock(adap->dev, 72, 1); |
| 1074 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(100); |
| 1075 | |
| 1076 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1077 | |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 1078 | st->mt2060_if1[0] = 1220; |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 1079 | |
| 1080 | if (dib7000pc_detection(&adap->dev->i2c_adap)) { |
| 1081 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000p_config); |
| 1082 | st->is_dib7000pc = 1; |
| 1083 | } else |
| 1084 | adap->fe = dvb_attach(dib7000m_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000m_config); |
| 1085 | |
| 1086 | return adap->fe == NULL ? -ENODEV : 0; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1087 | } |
| 1088 | |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 1089 | static struct mt2060_config stk7700p_mt2060_config = { |
| 1090 | 0x60 |
| 1091 | }; |
| 1092 | |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1093 | static int stk7700p_tuner_attach(struct dvb_usb_adapter *adap) |
| 1094 | { |
Olivier DANET | c52344f | 2008-01-25 06:50:07 -0300 | [diff] [blame] | 1095 | struct i2c_adapter *prim_i2c = &adap->dev->i2c_adap; |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 1096 | struct dib0700_state *st = adap->dev->priv; |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 1097 | struct i2c_adapter *tun_i2c; |
Olivier DANET | c52344f | 2008-01-25 06:50:07 -0300 | [diff] [blame] | 1098 | s8 a; |
| 1099 | int if1=1220; |
Al Viro | da5ee48 | 2008-05-21 00:31:21 -0300 | [diff] [blame] | 1100 | if (adap->dev->udev->descriptor.idVendor == cpu_to_le16(USB_VID_HAUPPAUGE) && |
| 1101 | 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] | 1102 | if (!eeprom_read(prim_i2c,0x58,&a)) if1=1220+a; |
| 1103 | } |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 1104 | if (st->is_dib7000pc) |
| 1105 | tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); |
| 1106 | else |
| 1107 | tun_i2c = dib7000m_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); |
| 1108 | |
| 1109 | return dvb_attach(mt2060_attach, adap->fe, tun_i2c, &stk7700p_mt2060_config, |
Olivier DANET | c52344f | 2008-01-25 06:50:07 -0300 | [diff] [blame] | 1110 | if1) == NULL ? -ENODEV : 0; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1111 | } |
| 1112 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1113 | /* DIB7070 generic */ |
| 1114 | static struct dibx000_agc_config dib7070_agc_config = { |
| 1115 | BAND_UHF | BAND_VHF | BAND_LBAND | BAND_SBAND, |
| 1116 | /* 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, |
| 1117 | * 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 */ |
| 1118 | (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), // setup |
| 1119 | |
| 1120 | 600, // inv_gain |
| 1121 | 10, // time_stabiliz |
| 1122 | |
| 1123 | 0, // alpha_level |
| 1124 | 118, // thlock |
| 1125 | |
| 1126 | 0, // wbd_inv |
| 1127 | 3530, // wbd_ref |
| 1128 | 1, // wbd_sel |
| 1129 | 5, // wbd_alpha |
| 1130 | |
| 1131 | 65535, // agc1_max |
| 1132 | 0, // agc1_min |
| 1133 | |
| 1134 | 65535, // agc2_max |
| 1135 | 0, // agc2_min |
| 1136 | |
| 1137 | 0, // agc1_pt1 |
| 1138 | 40, // agc1_pt2 |
| 1139 | 183, // agc1_pt3 |
| 1140 | 206, // agc1_slope1 |
| 1141 | 255, // agc1_slope2 |
| 1142 | 72, // agc2_pt1 |
| 1143 | 152, // agc2_pt2 |
| 1144 | 88, // agc2_slope1 |
| 1145 | 90, // agc2_slope2 |
| 1146 | |
| 1147 | 17, // alpha_mant |
| 1148 | 27, // alpha_exp |
| 1149 | 23, // beta_mant |
| 1150 | 51, // beta_exp |
| 1151 | |
| 1152 | 0, // perform_agc_softsplit |
| 1153 | }; |
| 1154 | |
| 1155 | static int dib7070_tuner_reset(struct dvb_frontend *fe, int onoff) |
| 1156 | { |
Patrick Boettcher | 7e5ce65 | 2009-08-03 13:43:40 -0300 | [diff] [blame] | 1157 | deb_info("reset: %d", onoff); |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1158 | return dib7000p_set_gpio(fe, 8, 0, !onoff); |
| 1159 | } |
| 1160 | |
| 1161 | static int dib7070_tuner_sleep(struct dvb_frontend *fe, int onoff) |
| 1162 | { |
Patrick Boettcher | 7e5ce65 | 2009-08-03 13:43:40 -0300 | [diff] [blame] | 1163 | deb_info("sleep: %d", onoff); |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1164 | return dib7000p_set_gpio(fe, 9, 0, onoff); |
| 1165 | } |
| 1166 | |
| 1167 | static struct dib0070_config dib7070p_dib0070_config[2] = { |
| 1168 | { |
| 1169 | .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS, |
| 1170 | .reset = dib7070_tuner_reset, |
| 1171 | .sleep = dib7070_tuner_sleep, |
| 1172 | .clock_khz = 12000, |
Patrick Boettcher | 7e5ce65 | 2009-08-03 13:43:40 -0300 | [diff] [blame] | 1173 | .clock_pad_drive = 4, |
| 1174 | .charge_pump = 2, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1175 | }, { |
| 1176 | .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS, |
| 1177 | .reset = dib7070_tuner_reset, |
| 1178 | .sleep = dib7070_tuner_sleep, |
| 1179 | .clock_khz = 12000, |
Patrick Boettcher | 7e5ce65 | 2009-08-03 13:43:40 -0300 | [diff] [blame] | 1180 | .charge_pump = 2, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1181 | } |
| 1182 | }; |
| 1183 | |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 1184 | static struct dib0070_config dib7770p_dib0070_config = { |
| 1185 | .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS, |
| 1186 | .reset = dib7070_tuner_reset, |
| 1187 | .sleep = dib7070_tuner_sleep, |
| 1188 | .clock_khz = 12000, |
| 1189 | .clock_pad_drive = 0, |
| 1190 | .flip_chip = 1, |
Olivier Grenie | eac1fe1 | 2009-09-23 13:41:27 -0300 | [diff] [blame] | 1191 | .charge_pump = 2, |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 1192 | }; |
| 1193 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1194 | static int dib7070_set_param_override(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep) |
| 1195 | { |
| 1196 | struct dvb_usb_adapter *adap = fe->dvb->priv; |
| 1197 | struct dib0700_adapter_state *state = adap->priv; |
| 1198 | |
| 1199 | u16 offset; |
| 1200 | u8 band = BAND_OF_FREQUENCY(fep->frequency/1000); |
| 1201 | switch (band) { |
| 1202 | case BAND_VHF: offset = 950; break; |
| 1203 | case BAND_UHF: |
| 1204 | default: offset = 550; break; |
| 1205 | } |
| 1206 | deb_info("WBD for DiB7000P: %d\n", offset + dib0070_wbd_offset(fe)); |
| 1207 | dib7000p_set_wbd_ref(fe, offset + dib0070_wbd_offset(fe)); |
| 1208 | return state->set_param_save(fe, fep); |
| 1209 | } |
| 1210 | |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 1211 | static int dib7770_set_param_override(struct dvb_frontend *fe, |
| 1212 | struct dvb_frontend_parameters *fep) |
| 1213 | { |
| 1214 | struct dvb_usb_adapter *adap = fe->dvb->priv; |
| 1215 | struct dib0700_adapter_state *state = adap->priv; |
| 1216 | |
| 1217 | u16 offset; |
| 1218 | u8 band = BAND_OF_FREQUENCY(fep->frequency/1000); |
| 1219 | switch (band) { |
| 1220 | case BAND_VHF: |
| 1221 | dib7000p_set_gpio(fe, 0, 0, 1); |
| 1222 | offset = 850; |
| 1223 | break; |
| 1224 | case BAND_UHF: |
| 1225 | default: |
| 1226 | dib7000p_set_gpio(fe, 0, 0, 0); |
| 1227 | offset = 250; |
| 1228 | break; |
| 1229 | } |
| 1230 | deb_info("WBD for DiB7000P: %d\n", offset + dib0070_wbd_offset(fe)); |
| 1231 | dib7000p_set_wbd_ref(fe, offset + dib0070_wbd_offset(fe)); |
| 1232 | return state->set_param_save(fe, fep); |
| 1233 | } |
| 1234 | |
| 1235 | static int dib7770p_tuner_attach(struct dvb_usb_adapter *adap) |
| 1236 | { |
| 1237 | struct dib0700_adapter_state *st = adap->priv; |
| 1238 | struct i2c_adapter *tun_i2c = dib7000p_get_i2c_master(adap->fe, |
| 1239 | DIBX000_I2C_INTERFACE_TUNER, 1); |
| 1240 | |
| 1241 | if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, |
| 1242 | &dib7770p_dib0070_config) == NULL) |
| 1243 | return -ENODEV; |
| 1244 | |
| 1245 | st->set_param_save = adap->fe->ops.tuner_ops.set_params; |
| 1246 | adap->fe->ops.tuner_ops.set_params = dib7770_set_param_override; |
| 1247 | return 0; |
| 1248 | } |
| 1249 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1250 | static int dib7070p_tuner_attach(struct dvb_usb_adapter *adap) |
| 1251 | { |
| 1252 | struct dib0700_adapter_state *st = adap->priv; |
| 1253 | struct i2c_adapter *tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); |
| 1254 | |
| 1255 | if (adap->id == 0) { |
| 1256 | if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, &dib7070p_dib0070_config[0]) == NULL) |
| 1257 | return -ENODEV; |
| 1258 | } else { |
| 1259 | if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, &dib7070p_dib0070_config[1]) == NULL) |
| 1260 | return -ENODEV; |
| 1261 | } |
| 1262 | |
| 1263 | st->set_param_save = adap->fe->ops.tuner_ops.set_params; |
| 1264 | adap->fe->ops.tuner_ops.set_params = dib7070_set_param_override; |
| 1265 | return 0; |
| 1266 | } |
| 1267 | |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 1268 | static int stk70x0p_pid_filter(struct dvb_usb_adapter *adapter, int index, u16 pid, int onoff) |
| 1269 | { |
| 1270 | return dib7000p_pid_filter(adapter->fe, index, pid, onoff); |
| 1271 | } |
| 1272 | |
| 1273 | static int stk70x0p_pid_filter_ctrl(struct dvb_usb_adapter *adapter, int onoff) |
| 1274 | { |
| 1275 | return dib7000p_pid_filter_ctrl(adapter->fe, onoff); |
| 1276 | } |
| 1277 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1278 | static struct dibx000_bandwidth_config dib7070_bw_config_12_mhz = { |
| 1279 | 60000, 15000, // internal, sampling |
| 1280 | 1, 20, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass |
| 1281 | 0, 0, 1, 1, 2, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo |
| 1282 | (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k |
| 1283 | (0 << 25) | 0, // ifreq = 0.000000 MHz |
| 1284 | 20452225, // timf |
| 1285 | 12000000, // xtal_hz |
| 1286 | }; |
| 1287 | |
| 1288 | static struct dib7000p_config dib7070p_dib7000p_config = { |
| 1289 | .output_mpeg2_in_188_bytes = 1, |
| 1290 | |
| 1291 | .agc_config_count = 1, |
| 1292 | .agc = &dib7070_agc_config, |
| 1293 | .bw = &dib7070_bw_config_12_mhz, |
Patrick Boettcher | 3cb2c39 | 2008-01-25 07:25:20 -0300 | [diff] [blame] | 1294 | .tuner_is_baseband = 1, |
| 1295 | .spur_protect = 1, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1296 | |
| 1297 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
| 1298 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, |
| 1299 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
| 1300 | |
| 1301 | .hostbus_diversity = 1, |
| 1302 | }; |
| 1303 | |
| 1304 | /* STK7070P */ |
| 1305 | static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap) |
| 1306 | { |
Al Viro | da5ee48 | 2008-05-21 00:31:21 -0300 | [diff] [blame] | 1307 | struct usb_device_descriptor *p = &adap->dev->udev->descriptor; |
| 1308 | if (p->idVendor == cpu_to_le16(USB_VID_PINNACLE) && |
| 1309 | p->idProduct == cpu_to_le16(USB_PID_PINNACLE_PCTV72E)) |
| 1310 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 1311 | else |
Al Viro | da5ee48 | 2008-05-21 00:31:21 -0300 | [diff] [blame] | 1312 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1313 | msleep(10); |
| 1314 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 1315 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 1316 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 1317 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 1318 | |
| 1319 | dib0700_ctrl_clock(adap->dev, 72, 1); |
| 1320 | |
| 1321 | msleep(10); |
| 1322 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 1323 | msleep(10); |
| 1324 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 1325 | |
Devin Heitmueller | 83c4fdf | 2009-01-21 01:55:45 -0300 | [diff] [blame] | 1326 | if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, |
| 1327 | &dib7070p_dib7000p_config) != 0) { |
| 1328 | err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", |
| 1329 | __func__); |
| 1330 | return -ENODEV; |
| 1331 | } |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1332 | |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 1333 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, |
| 1334 | &dib7070p_dib7000p_config); |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1335 | return adap->fe == NULL ? -ENODEV : 0; |
| 1336 | } |
| 1337 | |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 1338 | /* DIB807x generic */ |
| 1339 | static struct dibx000_agc_config dib807x_agc_config[2] = { |
| 1340 | { |
| 1341 | BAND_VHF, |
| 1342 | /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, |
| 1343 | * P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0, |
| 1344 | * P_agc_inv_pwm2=0,P_agc_inh_dc_rv_est=0, |
| 1345 | * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, |
| 1346 | * P_agc_write=0 */ |
| 1347 | (0 << 15) | (0 << 14) | (7 << 11) | (0 << 10) | (0 << 9) | |
| 1348 | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | |
| 1349 | (0 << 0), /* setup*/ |
| 1350 | |
| 1351 | 600, /* inv_gain*/ |
| 1352 | 10, /* time_stabiliz*/ |
| 1353 | |
| 1354 | 0, /* alpha_level*/ |
| 1355 | 118, /* thlock*/ |
| 1356 | |
| 1357 | 0, /* wbd_inv*/ |
| 1358 | 3530, /* wbd_ref*/ |
| 1359 | 1, /* wbd_sel*/ |
| 1360 | 5, /* wbd_alpha*/ |
| 1361 | |
| 1362 | 65535, /* agc1_max*/ |
| 1363 | 0, /* agc1_min*/ |
| 1364 | |
| 1365 | 65535, /* agc2_max*/ |
| 1366 | 0, /* agc2_min*/ |
| 1367 | |
| 1368 | 0, /* agc1_pt1*/ |
| 1369 | 40, /* agc1_pt2*/ |
| 1370 | 183, /* agc1_pt3*/ |
| 1371 | 206, /* agc1_slope1*/ |
| 1372 | 255, /* agc1_slope2*/ |
| 1373 | 72, /* agc2_pt1*/ |
| 1374 | 152, /* agc2_pt2*/ |
| 1375 | 88, /* agc2_slope1*/ |
| 1376 | 90, /* agc2_slope2*/ |
| 1377 | |
| 1378 | 17, /* alpha_mant*/ |
| 1379 | 27, /* alpha_exp*/ |
| 1380 | 23, /* beta_mant*/ |
| 1381 | 51, /* beta_exp*/ |
| 1382 | |
| 1383 | 0, /* perform_agc_softsplit*/ |
| 1384 | }, { |
| 1385 | BAND_UHF, |
| 1386 | /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, |
| 1387 | * P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0, |
| 1388 | * P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0, |
| 1389 | * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, |
| 1390 | * P_agc_write=0 */ |
| 1391 | (0 << 15) | (0 << 14) | (1 << 11) | (0 << 10) | (0 << 9) | |
| 1392 | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | |
| 1393 | (0 << 0), /* setup */ |
| 1394 | |
| 1395 | 600, /* inv_gain*/ |
| 1396 | 10, /* time_stabiliz*/ |
| 1397 | |
| 1398 | 0, /* alpha_level*/ |
| 1399 | 118, /* thlock*/ |
| 1400 | |
| 1401 | 0, /* wbd_inv*/ |
| 1402 | 3530, /* wbd_ref*/ |
| 1403 | 1, /* wbd_sel*/ |
| 1404 | 5, /* wbd_alpha*/ |
| 1405 | |
| 1406 | 65535, /* agc1_max*/ |
| 1407 | 0, /* agc1_min*/ |
| 1408 | |
| 1409 | 65535, /* agc2_max*/ |
| 1410 | 0, /* agc2_min*/ |
| 1411 | |
| 1412 | 0, /* agc1_pt1*/ |
| 1413 | 40, /* agc1_pt2*/ |
| 1414 | 183, /* agc1_pt3*/ |
| 1415 | 206, /* agc1_slope1*/ |
| 1416 | 255, /* agc1_slope2*/ |
| 1417 | 72, /* agc2_pt1*/ |
| 1418 | 152, /* agc2_pt2*/ |
| 1419 | 88, /* agc2_slope1*/ |
| 1420 | 90, /* agc2_slope2*/ |
| 1421 | |
| 1422 | 17, /* alpha_mant*/ |
| 1423 | 27, /* alpha_exp*/ |
| 1424 | 23, /* beta_mant*/ |
| 1425 | 51, /* beta_exp*/ |
| 1426 | |
| 1427 | 0, /* perform_agc_softsplit*/ |
| 1428 | } |
| 1429 | }; |
| 1430 | |
| 1431 | static struct dibx000_bandwidth_config dib807x_bw_config_12_mhz = { |
| 1432 | 60000, 15000, /* internal, sampling*/ |
| 1433 | 1, 20, 3, 1, 0, /* pll_cfg: prediv, ratio, range, reset, bypass*/ |
| 1434 | 0, 0, 1, 1, 2, /* misc: refdiv, bypclk_div, IO_CLK_en_core, |
| 1435 | ADClkSrc, modulo */ |
| 1436 | (3 << 14) | (1 << 12) | (599 << 0), /* sad_cfg: refsel, sel, freq_15k*/ |
| 1437 | (0 << 25) | 0, /* ifreq = 0.000000 MHz*/ |
| 1438 | 18179755, /* timf*/ |
| 1439 | 12000000, /* xtal_hz*/ |
| 1440 | }; |
| 1441 | |
| 1442 | static struct dib8000_config dib807x_dib8000_config[2] = { |
| 1443 | { |
| 1444 | .output_mpeg2_in_188_bytes = 1, |
| 1445 | |
| 1446 | .agc_config_count = 2, |
| 1447 | .agc = dib807x_agc_config, |
| 1448 | .pll = &dib807x_bw_config_12_mhz, |
| 1449 | .tuner_is_baseband = 1, |
| 1450 | |
| 1451 | .gpio_dir = DIB8000_GPIO_DEFAULT_DIRECTIONS, |
| 1452 | .gpio_val = DIB8000_GPIO_DEFAULT_VALUES, |
| 1453 | .gpio_pwm_pos = DIB8000_GPIO_DEFAULT_PWM_POS, |
| 1454 | |
| 1455 | .hostbus_diversity = 1, |
| 1456 | .div_cfg = 1, |
| 1457 | .agc_control = &dib0070_ctrl_agc_filter, |
| 1458 | .output_mode = OUTMODE_MPEG2_FIFO, |
| 1459 | .drives = 0x2d98, |
| 1460 | }, { |
| 1461 | .output_mpeg2_in_188_bytes = 1, |
| 1462 | |
| 1463 | .agc_config_count = 2, |
| 1464 | .agc = dib807x_agc_config, |
| 1465 | .pll = &dib807x_bw_config_12_mhz, |
| 1466 | .tuner_is_baseband = 1, |
| 1467 | |
| 1468 | .gpio_dir = DIB8000_GPIO_DEFAULT_DIRECTIONS, |
| 1469 | .gpio_val = DIB8000_GPIO_DEFAULT_VALUES, |
| 1470 | .gpio_pwm_pos = DIB8000_GPIO_DEFAULT_PWM_POS, |
| 1471 | |
| 1472 | .hostbus_diversity = 1, |
| 1473 | .agc_control = &dib0070_ctrl_agc_filter, |
| 1474 | .output_mode = OUTMODE_MPEG2_FIFO, |
| 1475 | .drives = 0x2d98, |
| 1476 | } |
| 1477 | }; |
| 1478 | |
| 1479 | static int dib807x_tuner_reset(struct dvb_frontend *fe, int onoff) |
| 1480 | { |
| 1481 | return dib8000_set_gpio(fe, 5, 0, !onoff); |
| 1482 | } |
| 1483 | |
| 1484 | static int dib807x_tuner_sleep(struct dvb_frontend *fe, int onoff) |
| 1485 | { |
| 1486 | return dib8000_set_gpio(fe, 0, 0, onoff); |
| 1487 | } |
| 1488 | |
| 1489 | static const struct dib0070_wbd_gain_cfg dib8070_wbd_gain_cfg[] = { |
| 1490 | { 240, 7}, |
| 1491 | { 0xffff, 6}, |
| 1492 | }; |
| 1493 | |
| 1494 | static struct dib0070_config dib807x_dib0070_config[2] = { |
| 1495 | { |
| 1496 | .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS, |
| 1497 | .reset = dib807x_tuner_reset, |
| 1498 | .sleep = dib807x_tuner_sleep, |
| 1499 | .clock_khz = 12000, |
| 1500 | .clock_pad_drive = 4, |
| 1501 | .vga_filter = 1, |
| 1502 | .force_crystal_mode = 1, |
| 1503 | .enable_third_order_filter = 1, |
| 1504 | .charge_pump = 0, |
| 1505 | .wbd_gain = dib8070_wbd_gain_cfg, |
| 1506 | .osc_buffer_state = 0, |
| 1507 | .freq_offset_khz_uhf = -100, |
| 1508 | .freq_offset_khz_vhf = -100, |
| 1509 | }, { |
| 1510 | .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS, |
| 1511 | .reset = dib807x_tuner_reset, |
| 1512 | .sleep = dib807x_tuner_sleep, |
| 1513 | .clock_khz = 12000, |
| 1514 | .clock_pad_drive = 2, |
| 1515 | .vga_filter = 1, |
| 1516 | .force_crystal_mode = 1, |
| 1517 | .enable_third_order_filter = 1, |
| 1518 | .charge_pump = 0, |
| 1519 | .wbd_gain = dib8070_wbd_gain_cfg, |
| 1520 | .osc_buffer_state = 0, |
| 1521 | .freq_offset_khz_uhf = -25, |
| 1522 | .freq_offset_khz_vhf = -25, |
| 1523 | } |
| 1524 | }; |
| 1525 | |
| 1526 | static int dib807x_set_param_override(struct dvb_frontend *fe, |
| 1527 | struct dvb_frontend_parameters *fep) |
| 1528 | { |
| 1529 | struct dvb_usb_adapter *adap = fe->dvb->priv; |
| 1530 | struct dib0700_adapter_state *state = adap->priv; |
| 1531 | |
| 1532 | u16 offset = dib0070_wbd_offset(fe); |
| 1533 | u8 band = BAND_OF_FREQUENCY(fep->frequency/1000); |
| 1534 | switch (band) { |
| 1535 | case BAND_VHF: |
| 1536 | offset += 750; |
| 1537 | break; |
| 1538 | case BAND_UHF: /* fall-thru wanted */ |
| 1539 | default: |
| 1540 | offset += 250; break; |
| 1541 | } |
| 1542 | deb_info("WBD for DiB8000: %d\n", offset); |
| 1543 | dib8000_set_wbd_ref(fe, offset); |
| 1544 | |
| 1545 | return state->set_param_save(fe, fep); |
| 1546 | } |
| 1547 | |
| 1548 | static int dib807x_tuner_attach(struct dvb_usb_adapter *adap) |
| 1549 | { |
| 1550 | struct dib0700_adapter_state *st = adap->priv; |
| 1551 | struct i2c_adapter *tun_i2c = dib8000_get_i2c_master(adap->fe, |
| 1552 | DIBX000_I2C_INTERFACE_TUNER, 1); |
| 1553 | |
| 1554 | if (adap->id == 0) { |
| 1555 | if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, |
| 1556 | &dib807x_dib0070_config[0]) == NULL) |
| 1557 | return -ENODEV; |
| 1558 | } else { |
| 1559 | if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, |
| 1560 | &dib807x_dib0070_config[1]) == NULL) |
| 1561 | return -ENODEV; |
| 1562 | } |
| 1563 | |
| 1564 | st->set_param_save = adap->fe->ops.tuner_ops.set_params; |
| 1565 | adap->fe->ops.tuner_ops.set_params = dib807x_set_param_override; |
| 1566 | return 0; |
| 1567 | } |
| 1568 | |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 1569 | static int stk807x_pid_filter(struct dvb_usb_adapter *adapter, int index, u16 pid, int onoff) |
| 1570 | { |
| 1571 | return dib8000_pid_filter(adapter->fe, index, pid, onoff); |
| 1572 | } |
| 1573 | |
| 1574 | static int stk807x_pid_filter_ctrl(struct dvb_usb_adapter *adapter, int onoff) |
| 1575 | { |
| 1576 | return dib8000_pid_filter_ctrl(adapter->fe, onoff); |
| 1577 | } |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 1578 | |
| 1579 | /* STK807x */ |
| 1580 | static int stk807x_frontend_attach(struct dvb_usb_adapter *adap) |
| 1581 | { |
| 1582 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 1583 | msleep(10); |
| 1584 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 1585 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 1586 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 1587 | |
| 1588 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 1589 | |
| 1590 | dib0700_ctrl_clock(adap->dev, 72, 1); |
| 1591 | |
| 1592 | msleep(10); |
| 1593 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 1594 | msleep(10); |
| 1595 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 1596 | |
| 1597 | dib8000_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, |
| 1598 | 0x80); |
| 1599 | |
| 1600 | adap->fe = dvb_attach(dib8000_attach, &adap->dev->i2c_adap, 0x80, |
| 1601 | &dib807x_dib8000_config[0]); |
| 1602 | |
| 1603 | return adap->fe == NULL ? -ENODEV : 0; |
| 1604 | } |
| 1605 | |
| 1606 | /* STK807xPVR */ |
| 1607 | static int stk807xpvr_frontend_attach0(struct dvb_usb_adapter *adap) |
| 1608 | { |
| 1609 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); |
| 1610 | msleep(30); |
| 1611 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 1612 | msleep(500); |
| 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 | |
| 1621 | msleep(10); |
| 1622 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 1623 | msleep(10); |
| 1624 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 1625 | |
| 1626 | /* initialize IC 0 */ |
| 1627 | dib8000_i2c_enumeration(&adap->dev->i2c_adap, 1, 0x12, 0x80); |
| 1628 | |
| 1629 | adap->fe = dvb_attach(dib8000_attach, &adap->dev->i2c_adap, 0x80, |
| 1630 | &dib807x_dib8000_config[0]); |
| 1631 | |
| 1632 | return adap->fe == NULL ? -ENODEV : 0; |
| 1633 | } |
| 1634 | |
| 1635 | static int stk807xpvr_frontend_attach1(struct dvb_usb_adapter *adap) |
| 1636 | { |
| 1637 | /* initialize IC 1 */ |
| 1638 | dib8000_i2c_enumeration(&adap->dev->i2c_adap, 1, 0x22, 0x82); |
| 1639 | |
| 1640 | adap->fe = dvb_attach(dib8000_attach, &adap->dev->i2c_adap, 0x82, |
| 1641 | &dib807x_dib8000_config[1]); |
| 1642 | |
| 1643 | return adap->fe == NULL ? -ENODEV : 0; |
| 1644 | } |
| 1645 | |
| 1646 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1647 | /* STK7070PD */ |
| 1648 | static struct dib7000p_config stk7070pd_dib7000p_config[2] = { |
| 1649 | { |
| 1650 | .output_mpeg2_in_188_bytes = 1, |
| 1651 | |
| 1652 | .agc_config_count = 1, |
| 1653 | .agc = &dib7070_agc_config, |
| 1654 | .bw = &dib7070_bw_config_12_mhz, |
Patrick Boettcher | 3cb2c39 | 2008-01-25 07:25:20 -0300 | [diff] [blame] | 1655 | .tuner_is_baseband = 1, |
| 1656 | .spur_protect = 1, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1657 | |
| 1658 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
| 1659 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, |
| 1660 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
| 1661 | |
| 1662 | .hostbus_diversity = 1, |
| 1663 | }, { |
| 1664 | .output_mpeg2_in_188_bytes = 1, |
| 1665 | |
| 1666 | .agc_config_count = 1, |
| 1667 | .agc = &dib7070_agc_config, |
| 1668 | .bw = &dib7070_bw_config_12_mhz, |
Patrick Boettcher | 3cb2c39 | 2008-01-25 07:25:20 -0300 | [diff] [blame] | 1669 | .tuner_is_baseband = 1, |
| 1670 | .spur_protect = 1, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1671 | |
| 1672 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
| 1673 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, |
| 1674 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
| 1675 | |
| 1676 | .hostbus_diversity = 1, |
| 1677 | } |
| 1678 | }; |
| 1679 | |
| 1680 | static int stk7070pd_frontend_attach0(struct dvb_usb_adapter *adap) |
| 1681 | { |
| 1682 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 1683 | msleep(10); |
| 1684 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 1685 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 1686 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 1687 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 1688 | |
| 1689 | dib0700_ctrl_clock(adap->dev, 72, 1); |
| 1690 | |
| 1691 | msleep(10); |
| 1692 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 1693 | msleep(10); |
| 1694 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 1695 | |
Devin Heitmueller | 83c4fdf | 2009-01-21 01:55:45 -0300 | [diff] [blame] | 1696 | if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 2, 18, |
| 1697 | stk7070pd_dib7000p_config) != 0) { |
| 1698 | err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", |
| 1699 | __func__); |
| 1700 | return -ENODEV; |
| 1701 | } |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1702 | |
| 1703 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, &stk7070pd_dib7000p_config[0]); |
| 1704 | return adap->fe == NULL ? -ENODEV : 0; |
| 1705 | } |
| 1706 | |
| 1707 | static int stk7070pd_frontend_attach1(struct dvb_usb_adapter *adap) |
| 1708 | { |
| 1709 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x82, &stk7070pd_dib7000p_config[1]); |
| 1710 | return adap->fe == NULL ? -ENODEV : 0; |
| 1711 | } |
| 1712 | |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 1713 | /* S5H1411 */ |
| 1714 | static struct s5h1411_config pinnacle_801e_config = { |
| 1715 | .output_mode = S5H1411_PARALLEL_OUTPUT, |
| 1716 | .gpio = S5H1411_GPIO_OFF, |
| 1717 | .mpeg_timing = S5H1411_MPEGTIMING_NONCONTINOUS_NONINVERTING_CLOCK, |
| 1718 | .qam_if = S5H1411_IF_44000, |
| 1719 | .vsb_if = S5H1411_IF_44000, |
| 1720 | .inversion = S5H1411_INVERSION_OFF, |
| 1721 | .status_mode = S5H1411_DEMODLOCKING |
| 1722 | }; |
| 1723 | |
| 1724 | /* Pinnacle PCTV HD Pro 801e GPIOs map: |
| 1725 | GPIO0 - currently unknown |
| 1726 | GPIO1 - xc5000 tuner reset |
| 1727 | GPIO2 - CX25843 sleep |
| 1728 | GPIO3 - currently unknown |
| 1729 | GPIO4 - currently unknown |
| 1730 | GPIO6 - currently unknown |
| 1731 | GPIO7 - currently unknown |
| 1732 | GPIO9 - currently unknown |
| 1733 | GPIO10 - CX25843 reset |
| 1734 | */ |
| 1735 | static int s5h1411_frontend_attach(struct dvb_usb_adapter *adap) |
| 1736 | { |
| 1737 | struct dib0700_state *st = adap->dev->priv; |
| 1738 | |
| 1739 | /* Make use of the new i2c functions from FW 1.20 */ |
| 1740 | st->fw_use_new_i2c_api = 1; |
| 1741 | |
| 1742 | /* The s5h1411 requires the dib0700 to not be in master mode */ |
| 1743 | st->disable_streaming_master_mode = 1; |
| 1744 | |
| 1745 | /* All msleep values taken from Windows USB trace */ |
| 1746 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 0); |
| 1747 | dib0700_set_gpio(adap->dev, GPIO3, GPIO_OUT, 0); |
| 1748 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 1749 | msleep(400); |
| 1750 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 1751 | msleep(60); |
| 1752 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 1753 | msleep(30); |
| 1754 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 1755 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 1756 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 1757 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 1758 | dib0700_set_gpio(adap->dev, GPIO2, GPIO_OUT, 0); |
| 1759 | msleep(30); |
| 1760 | |
| 1761 | /* Put the CX25843 to sleep for now since we're in digital mode */ |
| 1762 | dib0700_set_gpio(adap->dev, GPIO2, GPIO_OUT, 1); |
| 1763 | |
| 1764 | /* GPIOs are initialized, do the attach */ |
| 1765 | adap->fe = dvb_attach(s5h1411_attach, &pinnacle_801e_config, |
| 1766 | &adap->dev->i2c_adap); |
| 1767 | return adap->fe == NULL ? -ENODEV : 0; |
| 1768 | } |
| 1769 | |
Michael Krufky | 767f3b3 | 2008-09-25 09:47:07 -0300 | [diff] [blame] | 1770 | static int dib0700_xc5000_tuner_callback(void *priv, int component, |
| 1771 | int command, int arg) |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 1772 | { |
| 1773 | struct dvb_usb_adapter *adap = priv; |
| 1774 | |
Devin Heitmueller | 79025a9 | 2008-10-06 12:07:48 -0300 | [diff] [blame] | 1775 | if (command == XC5000_TUNER_RESET) { |
| 1776 | /* Reset the tuner */ |
| 1777 | dib0700_set_gpio(adap->dev, GPIO1, GPIO_OUT, 0); |
Devin Heitmueller | f0f4633 | 2009-05-04 21:57:41 -0300 | [diff] [blame] | 1778 | msleep(10); |
Devin Heitmueller | 79025a9 | 2008-10-06 12:07:48 -0300 | [diff] [blame] | 1779 | dib0700_set_gpio(adap->dev, GPIO1, GPIO_OUT, 1); |
Devin Heitmueller | f0f4633 | 2009-05-04 21:57:41 -0300 | [diff] [blame] | 1780 | msleep(10); |
Devin Heitmueller | 79025a9 | 2008-10-06 12:07:48 -0300 | [diff] [blame] | 1781 | } else { |
| 1782 | err("xc5000: unknown tuner callback command: %d\n", command); |
| 1783 | return -EINVAL; |
| 1784 | } |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 1785 | |
| 1786 | return 0; |
| 1787 | } |
| 1788 | |
| 1789 | static struct xc5000_config s5h1411_xc5000_tunerconfig = { |
| 1790 | .i2c_address = 0x64, |
| 1791 | .if_khz = 5380, |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 1792 | }; |
| 1793 | |
| 1794 | static int xc5000_tuner_attach(struct dvb_usb_adapter *adap) |
| 1795 | { |
Devin Heitmueller | 79025a9 | 2008-10-06 12:07:48 -0300 | [diff] [blame] | 1796 | /* FIXME: generalize & move to common area */ |
| 1797 | adap->fe->callback = dib0700_xc5000_tuner_callback; |
| 1798 | |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 1799 | return dvb_attach(xc5000_attach, adap->fe, &adap->dev->i2c_adap, |
Michael Krufky | 767f3b3 | 2008-09-25 09:47:07 -0300 | [diff] [blame] | 1800 | &s5h1411_xc5000_tunerconfig) |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 1801 | == NULL ? -ENODEV : 0; |
| 1802 | } |
| 1803 | |
Michael Krufky | ce904bc | 2009-01-19 01:12:55 -0300 | [diff] [blame] | 1804 | static struct lgdt3305_config hcw_lgdt3305_config = { |
| 1805 | .i2c_addr = 0x0e, |
| 1806 | .mpeg_mode = LGDT3305_MPEG_PARALLEL, |
| 1807 | .tpclk_edge = LGDT3305_TPCLK_FALLING_EDGE, |
| 1808 | .tpvalid_polarity = LGDT3305_TP_VALID_LOW, |
| 1809 | .deny_i2c_rptr = 0, |
| 1810 | .spectral_inversion = 1, |
| 1811 | .qam_if_khz = 6000, |
| 1812 | .vsb_if_khz = 6000, |
| 1813 | .usref_8vsb = 0x0500, |
| 1814 | }; |
| 1815 | |
| 1816 | static struct mxl5007t_config hcw_mxl5007t_config = { |
| 1817 | .xtal_freq_hz = MxL_XTAL_25_MHZ, |
| 1818 | .if_freq_hz = MxL_IF_6_MHZ, |
| 1819 | .invert_if = 1, |
| 1820 | }; |
| 1821 | |
| 1822 | /* TIGER-ATSC map: |
| 1823 | GPIO0 - LNA_CTR (H: LNA power enabled, L: LNA power disabled) |
| 1824 | GPIO1 - ANT_SEL (H: VPA, L: MCX) |
| 1825 | GPIO4 - SCL2 |
| 1826 | GPIO6 - EN_TUNER |
| 1827 | GPIO7 - SDA2 |
| 1828 | GPIO10 - DEM_RST |
| 1829 | |
| 1830 | MXL is behind LG's i2c repeater. LG is on SCL2/SDA2 gpios on the DIB |
| 1831 | */ |
| 1832 | static int lgdt3305_frontend_attach(struct dvb_usb_adapter *adap) |
| 1833 | { |
| 1834 | struct dib0700_state *st = adap->dev->priv; |
| 1835 | |
| 1836 | /* Make use of the new i2c functions from FW 1.20 */ |
| 1837 | st->fw_use_new_i2c_api = 1; |
| 1838 | |
| 1839 | st->disable_streaming_master_mode = 1; |
| 1840 | |
| 1841 | /* fe power enable */ |
| 1842 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); |
| 1843 | msleep(30); |
| 1844 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 1845 | msleep(30); |
| 1846 | |
| 1847 | /* demod reset */ |
| 1848 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 1849 | msleep(30); |
| 1850 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 1851 | msleep(30); |
| 1852 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 1853 | msleep(30); |
| 1854 | |
| 1855 | adap->fe = dvb_attach(lgdt3305_attach, |
| 1856 | &hcw_lgdt3305_config, |
| 1857 | &adap->dev->i2c_adap); |
| 1858 | |
| 1859 | return adap->fe == NULL ? -ENODEV : 0; |
| 1860 | } |
| 1861 | |
| 1862 | static int mxl5007t_tuner_attach(struct dvb_usb_adapter *adap) |
| 1863 | { |
| 1864 | return dvb_attach(mxl5007t_attach, adap->fe, |
| 1865 | &adap->dev->i2c_adap, 0x60, |
| 1866 | &hcw_mxl5007t_config) == NULL ? -ENODEV : 0; |
| 1867 | } |
| 1868 | |
| 1869 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1870 | /* DVB-USB and USB stuff follows */ |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1871 | struct usb_device_id dib0700_usb_id_table[] = { |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1872 | /* 0 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P) }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 1873 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P_PC) }, |
| 1874 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500) }, |
| 1875 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500_2) }, |
| 1876 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK) }, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1877 | /* 5 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR) }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 1878 | { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500) }, |
| 1879 | { USB_DEVICE(USB_VID_UNIWILL, USB_PID_UNIWILL_STK7700P) }, |
| 1880 | { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_STK7700P) }, |
| 1881 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_2) }, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1882 | /* 10 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR_2) }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 1883 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV2000E) }, |
| 1884 | { USB_DEVICE(USB_VID_TERRATEC, |
| 1885 | USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY) }, |
| 1886 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_TD_STICK) }, |
| 1887 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700D) }, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1888 | /* 15 */{ USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070P) }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 1889 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV_DVB_T_FLASH) }, |
| 1890 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070PD) }, |
| 1891 | { USB_DEVICE(USB_VID_PINNACLE, |
| 1892 | USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T) }, |
| 1893 | { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500_PC) }, |
Joachim Steiger | fa3b877 | 2007-10-08 20:08:46 -0300 | [diff] [blame] | 1894 | /* 20 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_EXPRESS) }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 1895 | { USB_DEVICE(USB_VID_GIGABYTE, USB_PID_GIGABYTE_U7000) }, |
| 1896 | { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14BR) }, |
| 1897 | { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3000) }, |
| 1898 | { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3100) }, |
| 1899 | /* 25 */{ USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_3) }, |
| 1900 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_MYTV_T) }, |
| 1901 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_HT_USB_XE) }, |
| 1902 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_EXPRESSCARD_320CX) }, |
| 1903 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV72E) }, |
| 1904 | /* 30 */{ USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV73E) }, |
| 1905 | { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_EC372S) }, |
| 1906 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_HT_EXPRESS) }, |
Alexander Simon | dc88807 | 2008-03-29 21:37:54 -0300 | [diff] [blame] | 1907 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_XXS) }, |
Darryl Green | 5da4e2c | 2008-03-29 21:47:43 -0300 | [diff] [blame] | 1908 | { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_STK7700P_2) }, |
Michael Krufky | af2a887 | 2008-09-03 17:12:24 -0300 | [diff] [blame] | 1909 | /* 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] | 1910 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500_3) }, |
Finn Thain | 17a370b | 2008-09-06 13:42:47 -0300 | [diff] [blame] | 1911 | { USB_DEVICE(USB_VID_GIGABYTE, USB_PID_GIGABYTE_U8000) }, |
Daniel Oliveira Nascimento | 8751aaa | 2008-09-07 12:39:44 -0300 | [diff] [blame] | 1912 | { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_STK7700PH) }, |
Albert Comerma | 5769743 | 2008-09-07 12:43:33 -0300 | [diff] [blame] | 1913 | { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3000H) }, |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 1914 | /* 40 */{ USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV801E) }, |
Devin Heitmueller | d2fc3bf | 2008-09-25 06:22:23 -0300 | [diff] [blame] | 1915 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV801E_SE) }, |
Yusuf Altin | bb1b082 | 2009-01-08 07:58:45 -0300 | [diff] [blame] | 1916 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_EXPRESS) }, |
Nicolas Fournier | db4b2d1 | 2009-01-13 07:15:25 -0300 | [diff] [blame] | 1917 | { USB_DEVICE(USB_VID_TERRATEC, |
| 1918 | USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY_2) }, |
sebastian.blanes@gmail.com | 0a6e1ed | 2009-02-24 14:51:43 -0300 | [diff] [blame] | 1919 | { USB_DEVICE(USB_VID_SONY, USB_PID_SONY_PLAYTV) }, |
Pascal Terjan | 9abb6e6 | 2009-02-26 10:31:41 -0300 | [diff] [blame] | 1920 | /* 45 */{ USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_PD378S) }, |
Michael Krufky | ce904bc | 2009-01-19 01:12:55 -0300 | [diff] [blame] | 1921 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_TIGER_ATSC) }, |
| 1922 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_TIGER_ATSC_B210) }, |
Xoan Loureiro | 16ba1ee | 2009-03-29 08:43:36 -0300 | [diff] [blame] | 1923 | { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_MC770) }, |
Klaus Flittner | 919a548 | 2009-03-29 09:12:06 -0300 | [diff] [blame] | 1924 | { USB_DEVICE(USB_VID_ELGATO, USB_PID_ELGATO_EYETV_DTT) }, |
Armin Schenker | 513846e | 2009-04-20 11:57:49 -0300 | [diff] [blame] | 1925 | /* 50 */{ USB_DEVICE(USB_VID_ELGATO, USB_PID_ELGATO_EYETV_DTT_Dlx) }, |
tomas petr | f0f4ae7 | 2009-05-20 05:28:05 -0300 | [diff] [blame] | 1926 | { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_H) }, |
Patrick Boettcher | a9b8fe3 | 2009-05-20 05:35:02 -0300 | [diff] [blame] | 1927 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_T3) }, |
| 1928 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_T5) }, |
Pete Hildebrandt | c53d83c | 2009-08-05 11:46:38 -0300 | [diff] [blame] | 1929 | { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_STK7700D) }, |
Olivier Grenie | 74b76f2 | 2009-09-02 08:19:19 -0300 | [diff] [blame] | 1930 | /* 55 */{ USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_STK7700D_2) }, |
| 1931 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV73A) }, |
Patrick Boettcher | e414753 | 2009-11-30 13:52:57 -0300 | [diff] [blame] | 1932 | { USB_DEVICE(USB_VID_PCTV, USB_PID_PINNACLE_PCTV73ESE) }, |
| 1933 | { USB_DEVICE(USB_VID_PCTV, USB_PID_PINNACLE_PCTV282E) }, |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 1934 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7770P) }, |
Patrick Boettcher | db48138 | 2009-09-15 07:16:51 -0300 | [diff] [blame] | 1935 | /* 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] | 1936 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK807XPVR) }, |
| 1937 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK807XP) }, |
Mauro Carvalho Chehab | aaeab30 | 2009-09-16 09:18:26 -0300 | [diff] [blame] | 1938 | { USB_DEVICE(USB_VID_PIXELVIEW, USB_PID_PIXELVIEW_SBTVD) }, |
S?rgio Fortier | 8a378e8 | 2009-09-28 04:19:21 -0300 | [diff] [blame] | 1939 | { USB_DEVICE(USB_VID_EVOLUTEPC, USB_PID_TVWAY_PLUS) }, |
Patrick Boettcher | 20232c4 | 2009-12-01 12:08:56 -0300 | [diff] [blame^] | 1940 | /* 65 */{ USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV73ESE) }, |
Patrick Boettcher | e414753 | 2009-11-30 13:52:57 -0300 | [diff] [blame] | 1941 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV282E) }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 1942 | { 0 } /* Terminating entry */ |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1943 | }; |
| 1944 | MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table); |
| 1945 | |
| 1946 | #define DIB0700_DEFAULT_DEVICE_PROPERTIES \ |
| 1947 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, \ |
| 1948 | .usb_ctrl = DEVICE_SPECIFIC, \ |
Devin Heitmueller | bdc203e | 2008-09-06 13:45:27 -0300 | [diff] [blame] | 1949 | .firmware = "dvb-usb-dib0700-1.20.fw", \ |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1950 | .download_firmware = dib0700_download_firmware, \ |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 1951 | .no_reconnect = 1, \ |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1952 | .size_of_priv = sizeof(struct dib0700_state), \ |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 1953 | .i2c_algo = &dib0700_i2c_algo, \ |
| 1954 | .identify_state = dib0700_identify_state |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1955 | |
| 1956 | #define DIB0700_DEFAULT_STREAMING_CONFIG(ep) \ |
| 1957 | .streaming_ctrl = dib0700_streaming_ctrl, \ |
| 1958 | .stream = { \ |
| 1959 | .type = USB_BULK, \ |
| 1960 | .count = 4, \ |
| 1961 | .endpoint = ep, \ |
| 1962 | .u = { \ |
| 1963 | .bulk = { \ |
| 1964 | .buffersize = 39480, \ |
| 1965 | } \ |
| 1966 | } \ |
| 1967 | } |
| 1968 | |
| 1969 | struct dvb_usb_device_properties dib0700_devices[] = { |
| 1970 | { |
| 1971 | DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 1972 | |
| 1973 | .num_adapters = 1, |
| 1974 | .adapter = { |
| 1975 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 1976 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 1977 | .pid_filter_count = 32, |
| 1978 | .pid_filter = stk70x0p_pid_filter, |
| 1979 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1980 | .frontend_attach = stk7700p_frontend_attach, |
| 1981 | .tuner_attach = stk7700p_tuner_attach, |
| 1982 | |
| 1983 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 1984 | }, |
| 1985 | }, |
| 1986 | |
dominik | 67053a4 | 2007-11-10 19:23:31 -0300 | [diff] [blame] | 1987 | .num_device_descs = 8, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1988 | .devices = { |
| 1989 | { "DiBcom STK7700P reference design", |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 1990 | { &dib0700_usb_id_table[0], &dib0700_usb_id_table[1] }, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1991 | { NULL }, |
| 1992 | }, |
| 1993 | { "Hauppauge Nova-T Stick", |
Stefan Traby | f9aeba4 | 2006-11-12 13:02:51 -0300 | [diff] [blame] | 1994 | { &dib0700_usb_id_table[4], &dib0700_usb_id_table[9], NULL }, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1995 | { NULL }, |
| 1996 | }, |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 1997 | { "AVerMedia AVerTV DVB-T Volar", |
Jose Carlos Garcia Sogo | ced8fec | 2006-11-14 05:01:47 -0300 | [diff] [blame] | 1998 | { &dib0700_usb_id_table[5], &dib0700_usb_id_table[10] }, |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 1999 | { NULL }, |
| 2000 | }, |
| 2001 | { "Compro Videomate U500", |
Patrick Boettcher | 1f8ca4b | 2007-07-30 14:24:37 -0300 | [diff] [blame] | 2002 | { &dib0700_usb_id_table[6], &dib0700_usb_id_table[19] }, |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 2003 | { NULL }, |
Henning Schroeer | 0ce215e | 2006-10-19 07:58:22 -0300 | [diff] [blame] | 2004 | }, |
| 2005 | { "Uniwill STK7700P based (Hama and others)", |
| 2006 | { &dib0700_usb_id_table[7], NULL }, |
| 2007 | { NULL }, |
Michael Krufky | 8637a87 | 2006-11-08 16:47:32 -0300 | [diff] [blame] | 2008 | }, |
| 2009 | { "Leadtek Winfast DTV Dongle (STK7700P based)", |
Patrick Boettcher | 1e13c8f | 2009-09-19 05:24:40 -0300 | [diff] [blame] | 2010 | { &dib0700_usb_id_table[8], &dib0700_usb_id_table[34] }, |
Michael Krufky | 8637a87 | 2006-11-08 16:47:32 -0300 | [diff] [blame] | 2011 | { NULL }, |
Joachim Steiger | fa3b877 | 2007-10-08 20:08:46 -0300 | [diff] [blame] | 2012 | }, |
| 2013 | { "AVerMedia AVerTV DVB-T Express", |
| 2014 | { &dib0700_usb_id_table[20] }, |
| 2015 | { NULL }, |
dominik | 67053a4 | 2007-11-10 19:23:31 -0300 | [diff] [blame] | 2016 | }, |
dominik | 67053a4 | 2007-11-10 19:23:31 -0300 | [diff] [blame] | 2017 | { "Gigabyte U7000", |
| 2018 | { &dib0700_usb_id_table[21], NULL }, |
| 2019 | { NULL }, |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 2020 | } |
Darren Salt | b1139e3 | 2007-08-18 18:05:31 -0300 | [diff] [blame] | 2021 | }, |
| 2022 | |
| 2023 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 2024 | .rc_key_map = dib0700_rc_keys, |
| 2025 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
| 2026 | .rc_query = dib0700_rc_query |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 2027 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2028 | |
| 2029 | .num_adapters = 2, |
| 2030 | .adapter = { |
| 2031 | { |
| 2032 | .frontend_attach = bristol_frontend_attach, |
| 2033 | .tuner_attach = bristol_tuner_attach, |
| 2034 | |
| 2035 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2036 | }, { |
| 2037 | .frontend_attach = bristol_frontend_attach, |
| 2038 | .tuner_attach = bristol_tuner_attach, |
| 2039 | |
| 2040 | DIB0700_DEFAULT_STREAMING_CONFIG(0x03), |
| 2041 | } |
| 2042 | }, |
| 2043 | |
| 2044 | .num_device_descs = 1, |
| 2045 | .devices = { |
| 2046 | { "Hauppauge Nova-T 500 Dual DVB-T", |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 2047 | { &dib0700_usb_id_table[2], &dib0700_usb_id_table[3], NULL }, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 2048 | { NULL }, |
| 2049 | }, |
Janne Grunau | 82f3d55 | 2007-07-30 13:50:28 -0300 | [diff] [blame] | 2050 | }, |
| 2051 | |
| 2052 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 2053 | .rc_key_map = dib0700_rc_keys, |
Patrick Boettcher | 8779737 | 2007-07-30 17:02:17 -0300 | [diff] [blame] | 2054 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
Janne Grunau | 82f3d55 | 2007-07-30 13:50:28 -0300 | [diff] [blame] | 2055 | .rc_query = dib0700_rc_query |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 2056 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2057 | |
| 2058 | .num_adapters = 2, |
| 2059 | .adapter = { |
| 2060 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2061 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2062 | .pid_filter_count = 32, |
| 2063 | .pid_filter = stk70x0p_pid_filter, |
| 2064 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 2065 | .frontend_attach = stk7700d_frontend_attach, |
| 2066 | .tuner_attach = stk7700d_tuner_attach, |
| 2067 | |
| 2068 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2069 | }, { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2070 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2071 | .pid_filter_count = 32, |
| 2072 | .pid_filter = stk70x0p_pid_filter, |
| 2073 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 2074 | .frontend_attach = stk7700d_frontend_attach, |
| 2075 | .tuner_attach = stk7700d_tuner_attach, |
| 2076 | |
| 2077 | DIB0700_DEFAULT_STREAMING_CONFIG(0x03), |
| 2078 | } |
| 2079 | }, |
| 2080 | |
James A Webb | 200e861 | 2009-08-04 02:38:05 -0300 | [diff] [blame] | 2081 | .num_device_descs = 5, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 2082 | .devices = { |
| 2083 | { "Pinnacle PCTV 2000e", |
| 2084 | { &dib0700_usb_id_table[11], NULL }, |
| 2085 | { NULL }, |
| 2086 | }, |
| 2087 | { "Terratec Cinergy DT XS Diversity", |
| 2088 | { &dib0700_usb_id_table[12], NULL }, |
| 2089 | { NULL }, |
| 2090 | }, |
Darren Salt | faebb91 | 2007-08-18 18:04:00 -0300 | [diff] [blame] | 2091 | { "Hauppauge Nova-TD Stick/Elgato Eye-TV Diversity", |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 2092 | { &dib0700_usb_id_table[13], NULL }, |
| 2093 | { NULL }, |
| 2094 | }, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2095 | { "DiBcom STK7700D reference design", |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 2096 | { &dib0700_usb_id_table[14], NULL }, |
| 2097 | { NULL }, |
Yusuf Altin | bb1b082 | 2009-01-08 07:58:45 -0300 | [diff] [blame] | 2098 | }, |
James A Webb | 200e861 | 2009-08-04 02:38:05 -0300 | [diff] [blame] | 2099 | { "YUAN High-Tech DiBcom STK7700D", |
| 2100 | { &dib0700_usb_id_table[55], NULL }, |
| 2101 | { NULL }, |
| 2102 | }, |
Yusuf Altin | bb1b082 | 2009-01-08 07:58:45 -0300 | [diff] [blame] | 2103 | |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 2104 | }, |
Janne Grunau | 82f3d55 | 2007-07-30 13:50:28 -0300 | [diff] [blame] | 2105 | |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 2106 | .rc_interval = DEFAULT_RC_INTERVAL, |
Janne Grunau | 82f3d55 | 2007-07-30 13:50:28 -0300 | [diff] [blame] | 2107 | .rc_key_map = dib0700_rc_keys, |
Patrick Boettcher | 8779737 | 2007-07-30 17:02:17 -0300 | [diff] [blame] | 2108 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
Janne Grunau | 82f3d55 | 2007-07-30 13:50:28 -0300 | [diff] [blame] | 2109 | .rc_query = dib0700_rc_query |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2110 | |
| 2111 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2112 | |
| 2113 | .num_adapters = 1, |
| 2114 | .adapter = { |
| 2115 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2116 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2117 | .pid_filter_count = 32, |
| 2118 | .pid_filter = stk70x0p_pid_filter, |
| 2119 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Daniel Gimpelevich | 132c318 | 2008-01-25 06:02:42 -0300 | [diff] [blame] | 2120 | .frontend_attach = stk7700P2_frontend_attach, |
| 2121 | .tuner_attach = stk7700d_tuner_attach, |
| 2122 | |
| 2123 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2124 | }, |
| 2125 | }, |
| 2126 | |
Yusuf Altin | bb1b082 | 2009-01-08 07:58:45 -0300 | [diff] [blame] | 2127 | .num_device_descs = 3, |
Daniel Gimpelevich | 132c318 | 2008-01-25 06:02:42 -0300 | [diff] [blame] | 2128 | .devices = { |
| 2129 | { "ASUS My Cinema U3000 Mini DVBT Tuner", |
| 2130 | { &dib0700_usb_id_table[23], NULL }, |
| 2131 | { NULL }, |
| 2132 | }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 2133 | { "Yuan EC372S", |
| 2134 | { &dib0700_usb_id_table[31], NULL }, |
| 2135 | { NULL }, |
Yusuf Altin | bb1b082 | 2009-01-08 07:58:45 -0300 | [diff] [blame] | 2136 | }, |
| 2137 | { "Terratec Cinergy T Express", |
| 2138 | { &dib0700_usb_id_table[42], NULL }, |
| 2139 | { NULL }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 2140 | } |
Chris Rankin | 48aa739 | 2008-09-25 06:52:24 -0300 | [diff] [blame] | 2141 | }, |
| 2142 | |
| 2143 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 2144 | .rc_key_map = dib0700_rc_keys, |
| 2145 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
| 2146 | .rc_query = dib0700_rc_query |
Daniel Gimpelevich | 132c318 | 2008-01-25 06:02:42 -0300 | [diff] [blame] | 2147 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2148 | |
| 2149 | .num_adapters = 1, |
| 2150 | .adapter = { |
| 2151 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2152 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2153 | .pid_filter_count = 32, |
| 2154 | .pid_filter = stk70x0p_pid_filter, |
| 2155 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2156 | .frontend_attach = stk7070p_frontend_attach, |
| 2157 | .tuner_attach = dib7070p_tuner_attach, |
| 2158 | |
| 2159 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2160 | |
| 2161 | .size_of_priv = sizeof(struct dib0700_adapter_state), |
| 2162 | }, |
| 2163 | }, |
| 2164 | |
Patrick Boettcher | 1e13c8f | 2009-09-19 05:24:40 -0300 | [diff] [blame] | 2165 | .num_device_descs = 11, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2166 | .devices = { |
| 2167 | { "DiBcom STK7070P reference design", |
| 2168 | { &dib0700_usb_id_table[15], NULL }, |
| 2169 | { NULL }, |
| 2170 | }, |
| 2171 | { "Pinnacle PCTV DVB-T Flash Stick", |
| 2172 | { &dib0700_usb_id_table[16], NULL }, |
| 2173 | { NULL }, |
| 2174 | }, |
Yousef Lamlum | 7999a81 | 2008-01-25 05:51:48 -0300 | [diff] [blame] | 2175 | { "Artec T14BR DVB-T", |
| 2176 | { &dib0700_usb_id_table[22], NULL }, |
| 2177 | { NULL }, |
Daniel Gimpelevich | 132c318 | 2008-01-25 06:02:42 -0300 | [diff] [blame] | 2178 | }, |
| 2179 | { "ASUS My Cinema U3100 Mini DVBT Tuner", |
| 2180 | { &dib0700_usb_id_table[24], NULL }, |
| 2181 | { NULL }, |
| 2182 | }, |
Tim Taubert | c7637b1 | 2008-01-25 06:16:36 -0300 | [diff] [blame] | 2183 | { "Hauppauge Nova-T Stick", |
| 2184 | { &dib0700_usb_id_table[25], NULL }, |
| 2185 | { NULL }, |
| 2186 | }, |
Darren Salt | 13b83b5 | 2008-01-25 06:20:02 -0300 | [diff] [blame] | 2187 | { "Hauppauge Nova-T MyTV.t", |
| 2188 | { &dib0700_usb_id_table[26], NULL }, |
| 2189 | { NULL }, |
| 2190 | }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 2191 | { "Pinnacle PCTV 72e", |
| 2192 | { &dib0700_usb_id_table[29], NULL }, |
| 2193 | { NULL }, |
| 2194 | }, |
| 2195 | { "Pinnacle PCTV 73e", |
| 2196 | { &dib0700_usb_id_table[30], NULL }, |
| 2197 | { NULL }, |
| 2198 | }, |
Klaus Flittner | 919a548 | 2009-03-29 09:12:06 -0300 | [diff] [blame] | 2199 | { "Elgato EyeTV DTT", |
| 2200 | { &dib0700_usb_id_table[49], NULL }, |
| 2201 | { NULL }, |
| 2202 | }, |
Pascal Terjan | 9abb6e6 | 2009-02-26 10:31:41 -0300 | [diff] [blame] | 2203 | { "Yuan PD378S", |
| 2204 | { &dib0700_usb_id_table[45], NULL }, |
| 2205 | { NULL }, |
| 2206 | }, |
Armin Schenker | 513846e | 2009-04-20 11:57:49 -0300 | [diff] [blame] | 2207 | { "Elgato EyeTV Dtt Dlx PD378S", |
| 2208 | { &dib0700_usb_id_table[50], NULL }, |
| 2209 | { NULL }, |
| 2210 | }, |
Tim Taubert | c7637b1 | 2008-01-25 06:16:36 -0300 | [diff] [blame] | 2211 | }, |
| 2212 | |
| 2213 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 2214 | .rc_key_map = dib0700_rc_keys, |
| 2215 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
| 2216 | .rc_query = dib0700_rc_query |
| 2217 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2218 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2219 | |
Olivier Grenie | 74b76f2 | 2009-09-02 08:19:19 -0300 | [diff] [blame] | 2220 | .num_adapters = 1, |
| 2221 | .adapter = { |
| 2222 | { |
Mauro Carvalho Chehab | 648732f | 2009-11-04 12:11:43 -0200 | [diff] [blame] | 2223 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2224 | .pid_filter_count = 32, |
| 2225 | .pid_filter = stk70x0p_pid_filter, |
| 2226 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Olivier Grenie | 74b76f2 | 2009-09-02 08:19:19 -0300 | [diff] [blame] | 2227 | .frontend_attach = stk7070p_frontend_attach, |
| 2228 | .tuner_attach = dib7070p_tuner_attach, |
| 2229 | |
| 2230 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2231 | |
| 2232 | .size_of_priv = sizeof(struct dib0700_adapter_state), |
| 2233 | }, |
| 2234 | }, |
| 2235 | |
Patrick Boettcher | 20232c4 | 2009-12-01 12:08:56 -0300 | [diff] [blame^] | 2236 | .num_device_descs = 3, |
Olivier Grenie | 74b76f2 | 2009-09-02 08:19:19 -0300 | [diff] [blame] | 2237 | .devices = { |
| 2238 | { "Pinnacle PCTV 73A", |
| 2239 | { &dib0700_usb_id_table[56], NULL }, |
| 2240 | { NULL }, |
| 2241 | }, |
| 2242 | { "Pinnacle PCTV 73e SE", |
Patrick Boettcher | 20232c4 | 2009-12-01 12:08:56 -0300 | [diff] [blame^] | 2243 | { &dib0700_usb_id_table[57], &dib0700_usb_id_table[65], NULL }, |
Olivier Grenie | 74b76f2 | 2009-09-02 08:19:19 -0300 | [diff] [blame] | 2244 | { NULL }, |
| 2245 | }, |
| 2246 | { "Pinnacle PCTV 282e", |
Patrick Boettcher | 20232c4 | 2009-12-01 12:08:56 -0300 | [diff] [blame^] | 2247 | { &dib0700_usb_id_table[58], &dib0700_usb_id_table[66], NULL }, |
Olivier Grenie | 74b76f2 | 2009-09-02 08:19:19 -0300 | [diff] [blame] | 2248 | { NULL }, |
| 2249 | }, |
| 2250 | }, |
| 2251 | |
| 2252 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 2253 | .rc_key_map = dib0700_rc_keys, |
| 2254 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
| 2255 | .rc_query = dib0700_rc_query |
| 2256 | |
| 2257 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2258 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2259 | .num_adapters = 2, |
| 2260 | .adapter = { |
| 2261 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2262 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2263 | .pid_filter_count = 32, |
| 2264 | .pid_filter = stk70x0p_pid_filter, |
| 2265 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2266 | .frontend_attach = stk7070pd_frontend_attach0, |
| 2267 | .tuner_attach = dib7070p_tuner_attach, |
| 2268 | |
| 2269 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2270 | |
| 2271 | .size_of_priv = sizeof(struct dib0700_adapter_state), |
| 2272 | }, { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2273 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2274 | .pid_filter_count = 32, |
| 2275 | .pid_filter = stk70x0p_pid_filter, |
| 2276 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2277 | .frontend_attach = stk7070pd_frontend_attach1, |
| 2278 | .tuner_attach = dib7070p_tuner_attach, |
| 2279 | |
| 2280 | DIB0700_DEFAULT_STREAMING_CONFIG(0x03), |
| 2281 | |
| 2282 | .size_of_priv = sizeof(struct dib0700_adapter_state), |
| 2283 | } |
| 2284 | }, |
| 2285 | |
sebastian.blanes@gmail.com | 0a6e1ed | 2009-02-24 14:51:43 -0300 | [diff] [blame] | 2286 | .num_device_descs = 6, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2287 | .devices = { |
| 2288 | { "DiBcom STK7070PD reference design", |
| 2289 | { &dib0700_usb_id_table[17], NULL }, |
| 2290 | { NULL }, |
| 2291 | }, |
| 2292 | { "Pinnacle PCTV Dual DVB-T Diversity Stick", |
| 2293 | { &dib0700_usb_id_table[18], NULL }, |
| 2294 | { NULL }, |
Michael Krufky | d01eb2d | 2008-07-03 23:43:36 -0300 | [diff] [blame] | 2295 | }, |
| 2296 | { "Hauppauge Nova-TD Stick (52009)", |
| 2297 | { &dib0700_usb_id_table[35], NULL }, |
| 2298 | { NULL }, |
Michael Krufky | 9a0c04a | 2008-09-03 17:12:24 -0300 | [diff] [blame] | 2299 | }, |
| 2300 | { "Hauppauge Nova-TD-500 (84xxx)", |
| 2301 | { &dib0700_usb_id_table[36], NULL }, |
| 2302 | { NULL }, |
Nicolas Fournier | db4b2d1 | 2009-01-13 07:15:25 -0300 | [diff] [blame] | 2303 | }, |
Patrick Boettcher | a9b8fe3 | 2009-05-20 05:35:02 -0300 | [diff] [blame] | 2304 | { "Terratec Cinergy DT USB XS Diversity/ T5", |
| 2305 | { &dib0700_usb_id_table[43], |
| 2306 | &dib0700_usb_id_table[53], NULL}, |
Nicolas Fournier | db4b2d1 | 2009-01-13 07:15:25 -0300 | [diff] [blame] | 2307 | { NULL }, |
sebastian.blanes@gmail.com | 0a6e1ed | 2009-02-24 14:51:43 -0300 | [diff] [blame] | 2308 | }, |
| 2309 | { "Sony PlayTV", |
| 2310 | { &dib0700_usb_id_table[44], NULL }, |
| 2311 | { NULL }, |
dominik | 67053a4 | 2007-11-10 19:23:31 -0300 | [diff] [blame] | 2312 | } |
Arne Luehrs | c985a8d | 2009-01-21 01:37:20 -0300 | [diff] [blame] | 2313 | }, |
| 2314 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 2315 | .rc_key_map = dib0700_rc_keys, |
| 2316 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
| 2317 | .rc_query = dib0700_rc_query |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 2318 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2319 | |
| 2320 | .num_adapters = 1, |
| 2321 | .adapter = { |
| 2322 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2323 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2324 | .pid_filter_count = 32, |
| 2325 | .pid_filter = stk70x0p_pid_filter, |
| 2326 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 2327 | .frontend_attach = stk7700ph_frontend_attach, |
| 2328 | .tuner_attach = stk7700ph_tuner_attach, |
| 2329 | |
| 2330 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2331 | |
| 2332 | .size_of_priv = sizeof(struct |
| 2333 | dib0700_adapter_state), |
| 2334 | }, |
| 2335 | }, |
| 2336 | |
Pete Hildebrandt | c53d83c | 2009-08-05 11:46:38 -0300 | [diff] [blame] | 2337 | .num_device_descs = 9, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 2338 | .devices = { |
| 2339 | { "Terratec Cinergy HT USB XE", |
| 2340 | { &dib0700_usb_id_table[27], NULL }, |
| 2341 | { NULL }, |
| 2342 | }, |
| 2343 | { "Pinnacle Expresscard 320cx", |
| 2344 | { &dib0700_usb_id_table[28], NULL }, |
| 2345 | { NULL }, |
| 2346 | }, |
| 2347 | { "Terratec Cinergy HT Express", |
| 2348 | { &dib0700_usb_id_table[32], NULL }, |
| 2349 | { NULL }, |
| 2350 | }, |
Finn Thain | 17a370b | 2008-09-06 13:42:47 -0300 | [diff] [blame] | 2351 | { "Gigabyte U8000-RH", |
| 2352 | { &dib0700_usb_id_table[37], NULL }, |
| 2353 | { NULL }, |
| 2354 | }, |
Daniel Oliveira Nascimento | 8751aaa | 2008-09-07 12:39:44 -0300 | [diff] [blame] | 2355 | { "YUAN High-Tech STK7700PH", |
| 2356 | { &dib0700_usb_id_table[38], NULL }, |
| 2357 | { NULL }, |
| 2358 | }, |
Albert Comerma | 5769743 | 2008-09-07 12:43:33 -0300 | [diff] [blame] | 2359 | { "Asus My Cinema-U3000Hybrid", |
| 2360 | { &dib0700_usb_id_table[39], NULL }, |
| 2361 | { NULL }, |
| 2362 | }, |
Xoan Loureiro | 16ba1ee | 2009-03-29 08:43:36 -0300 | [diff] [blame] | 2363 | { "YUAN High-Tech MC770", |
| 2364 | { &dib0700_usb_id_table[48], NULL }, |
| 2365 | { NULL }, |
| 2366 | }, |
tomas petr | f0f4ae7 | 2009-05-20 05:28:05 -0300 | [diff] [blame] | 2367 | { "Leadtek WinFast DTV Dongle H", |
| 2368 | { &dib0700_usb_id_table[51], NULL }, |
| 2369 | { NULL }, |
| 2370 | }, |
Pete Hildebrandt | c53d83c | 2009-08-05 11:46:38 -0300 | [diff] [blame] | 2371 | { "YUAN High-Tech STK7700D", |
| 2372 | { &dib0700_usb_id_table[54], NULL }, |
| 2373 | { NULL }, |
| 2374 | }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 2375 | }, |
| 2376 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 2377 | .rc_key_map = dib0700_rc_keys, |
| 2378 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
| 2379 | .rc_query = dib0700_rc_query |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 2380 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2381 | .num_adapters = 1, |
| 2382 | .adapter = { |
| 2383 | { |
| 2384 | .frontend_attach = s5h1411_frontend_attach, |
| 2385 | .tuner_attach = xc5000_tuner_attach, |
| 2386 | |
| 2387 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2388 | |
| 2389 | .size_of_priv = sizeof(struct |
| 2390 | dib0700_adapter_state), |
| 2391 | }, |
| 2392 | }, |
| 2393 | |
Devin Heitmueller | d2fc3bf | 2008-09-25 06:22:23 -0300 | [diff] [blame] | 2394 | .num_device_descs = 2, |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 2395 | .devices = { |
| 2396 | { "Pinnacle PCTV HD Pro USB Stick", |
| 2397 | { &dib0700_usb_id_table[40], NULL }, |
| 2398 | { NULL }, |
| 2399 | }, |
Devin Heitmueller | d2fc3bf | 2008-09-25 06:22:23 -0300 | [diff] [blame] | 2400 | { "Pinnacle PCTV HD USB Stick", |
| 2401 | { &dib0700_usb_id_table[41], NULL }, |
| 2402 | { NULL }, |
| 2403 | }, |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 2404 | }, |
| 2405 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 2406 | .rc_key_map = dib0700_rc_keys, |
| 2407 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
| 2408 | .rc_query = dib0700_rc_query |
Michael Krufky | ce904bc | 2009-01-19 01:12:55 -0300 | [diff] [blame] | 2409 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2410 | .num_adapters = 1, |
| 2411 | .adapter = { |
| 2412 | { |
| 2413 | .frontend_attach = lgdt3305_frontend_attach, |
| 2414 | .tuner_attach = mxl5007t_tuner_attach, |
| 2415 | |
| 2416 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2417 | |
| 2418 | .size_of_priv = sizeof(struct |
| 2419 | dib0700_adapter_state), |
| 2420 | }, |
| 2421 | }, |
| 2422 | |
| 2423 | .num_device_descs = 2, |
| 2424 | .devices = { |
| 2425 | { "Hauppauge ATSC MiniCard (B200)", |
| 2426 | { &dib0700_usb_id_table[46], NULL }, |
| 2427 | { NULL }, |
| 2428 | }, |
| 2429 | { "Hauppauge ATSC MiniCard (B210)", |
| 2430 | { &dib0700_usb_id_table[47], NULL }, |
| 2431 | { NULL }, |
| 2432 | }, |
| 2433 | }, |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 2434 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2435 | |
| 2436 | .num_adapters = 1, |
| 2437 | .adapter = { |
| 2438 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2439 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2440 | .pid_filter_count = 32, |
| 2441 | .pid_filter = stk70x0p_pid_filter, |
| 2442 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 2443 | .frontend_attach = stk7070p_frontend_attach, |
| 2444 | .tuner_attach = dib7770p_tuner_attach, |
| 2445 | |
| 2446 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2447 | |
| 2448 | .size_of_priv = |
Patrick Boettcher | db48138 | 2009-09-15 07:16:51 -0300 | [diff] [blame] | 2449 | sizeof(struct dib0700_adapter_state), |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 2450 | }, |
| 2451 | }, |
| 2452 | |
Patrick Boettcher | db48138 | 2009-09-15 07:16:51 -0300 | [diff] [blame] | 2453 | .num_device_descs = 2, |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 2454 | .devices = { |
| 2455 | { "DiBcom STK7770P reference design", |
| 2456 | { &dib0700_usb_id_table[59], NULL }, |
| 2457 | { NULL }, |
| 2458 | }, |
Patrick Boettcher | 1e13c8f | 2009-09-19 05:24:40 -0300 | [diff] [blame] | 2459 | { "Terratec Cinergy T USB XXS (HD)/ T3", |
| 2460 | { &dib0700_usb_id_table[33], |
| 2461 | &dib0700_usb_id_table[52], |
| 2462 | &dib0700_usb_id_table[60], NULL}, |
Patrick Boettcher | db48138 | 2009-09-15 07:16:51 -0300 | [diff] [blame] | 2463 | { NULL }, |
| 2464 | }, |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 2465 | }, |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 2466 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 2467 | .rc_key_map = dib0700_rc_keys, |
| 2468 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
| 2469 | .rc_query = dib0700_rc_query |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 2470 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2471 | .num_adapters = 1, |
| 2472 | .adapter = { |
| 2473 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2474 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2475 | .pid_filter_count = 32, |
| 2476 | .pid_filter = stk807x_pid_filter, |
| 2477 | .pid_filter_ctrl = stk807x_pid_filter_ctrl, |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 2478 | .frontend_attach = stk807x_frontend_attach, |
| 2479 | .tuner_attach = dib807x_tuner_attach, |
| 2480 | |
| 2481 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2482 | |
| 2483 | .size_of_priv = |
| 2484 | sizeof(struct dib0700_adapter_state), |
| 2485 | }, |
| 2486 | }, |
| 2487 | |
S?rgio Fortier | 8a378e8 | 2009-09-28 04:19:21 -0300 | [diff] [blame] | 2488 | .num_device_descs = 3, |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 2489 | .devices = { |
| 2490 | { "DiBcom STK807xP reference design", |
| 2491 | { &dib0700_usb_id_table[62], NULL }, |
| 2492 | { NULL }, |
| 2493 | }, |
Mauro Carvalho Chehab | aaeab30 | 2009-09-16 09:18:26 -0300 | [diff] [blame] | 2494 | { "Prolink Pixelview SBTVD", |
| 2495 | { &dib0700_usb_id_table[63], NULL }, |
| 2496 | { NULL }, |
| 2497 | }, |
S?rgio Fortier | 8a378e8 | 2009-09-28 04:19:21 -0300 | [diff] [blame] | 2498 | { "EvolutePC TVWay+", |
| 2499 | { &dib0700_usb_id_table[64], NULL }, |
| 2500 | { NULL }, |
| 2501 | }, |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 2502 | }, |
| 2503 | |
| 2504 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 2505 | .rc_key_map = dib0700_rc_keys, |
| 2506 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
| 2507 | .rc_query = dib0700_rc_query |
| 2508 | |
| 2509 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2510 | .num_adapters = 2, |
| 2511 | .adapter = { |
| 2512 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2513 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2514 | .pid_filter_count = 32, |
| 2515 | .pid_filter = stk807x_pid_filter, |
| 2516 | .pid_filter_ctrl = stk807x_pid_filter_ctrl, |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 2517 | .frontend_attach = stk807xpvr_frontend_attach0, |
| 2518 | .tuner_attach = dib807x_tuner_attach, |
| 2519 | |
| 2520 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2521 | |
| 2522 | .size_of_priv = |
| 2523 | sizeof(struct dib0700_adapter_state), |
| 2524 | }, |
| 2525 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2526 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2527 | .pid_filter_count = 32, |
| 2528 | .pid_filter = stk807x_pid_filter, |
| 2529 | .pid_filter_ctrl = stk807x_pid_filter_ctrl, |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 2530 | .frontend_attach = stk807xpvr_frontend_attach1, |
| 2531 | .tuner_attach = dib807x_tuner_attach, |
| 2532 | |
| 2533 | DIB0700_DEFAULT_STREAMING_CONFIG(0x03), |
| 2534 | |
| 2535 | .size_of_priv = |
| 2536 | sizeof(struct dib0700_adapter_state), |
| 2537 | }, |
| 2538 | }, |
| 2539 | |
| 2540 | .num_device_descs = 1, |
| 2541 | .devices = { |
| 2542 | { "DiBcom STK807xPVR reference design", |
| 2543 | { &dib0700_usb_id_table[61], NULL }, |
| 2544 | { NULL }, |
| 2545 | }, |
| 2546 | }, |
| 2547 | |
| 2548 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 2549 | .rc_key_map = dib0700_rc_keys, |
| 2550 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
| 2551 | .rc_query = dib0700_rc_query |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2552 | }, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 2553 | }; |
| 2554 | |
| 2555 | int dib0700_device_count = ARRAY_SIZE(dib0700_devices); |