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 | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 7 | * Copyright (C) 2005-7 DiBcom, SA |
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 | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 14 | #include "mt2060.h" |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 15 | #include "mt2266.h" |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 16 | #include "dib0070.h" |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 17 | |
Patrick Boettcher | 7fb3fc0 | 2006-09-20 04:37:18 -0300 | [diff] [blame] | 18 | static int force_lna_activation; |
| 19 | module_param(force_lna_activation, int, 0644); |
| 20 | MODULE_PARM_DESC(force_lna_activation, "force the activation of Low-Noise-Amplifyer(s) (LNA), " |
| 21 | "if applicable for the device (default: 0=automatic/off)."); |
| 22 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 23 | struct dib0700_adapter_state { |
| 24 | int (*set_param_save) (struct dvb_frontend *, struct dvb_frontend_parameters *); |
| 25 | }; |
| 26 | |
| 27 | /* Hauppauge Nova-T 500 (aka Bristol) |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 28 | * has a LNA on GPIO0 which is enabled by setting 1 */ |
| 29 | static struct mt2060_config bristol_mt2060_config[2] = { |
| 30 | { |
| 31 | .i2c_address = 0x60, |
Patrick Boettcher | 303cbea | 2006-09-19 12:51:56 -0300 | [diff] [blame] | 32 | .clock_out = 3, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 33 | }, { |
| 34 | .i2c_address = 0x61, |
| 35 | } |
| 36 | }; |
| 37 | |
| 38 | static struct dibx000_agc_config bristol_dib3000p_mt2060_agc_config = { |
| 39 | .band_caps = BAND_VHF | BAND_UHF, |
Patrick Boettcher | 01b4bf3 | 2006-09-19 12:51:53 -0300 | [diff] [blame] | 40 | .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] | 41 | |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 42 | .agc1_max = 42598, |
| 43 | .agc1_min = 17694, |
| 44 | .agc2_max = 45875, |
| 45 | .agc2_min = 0, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 46 | |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 47 | .agc1_pt1 = 0, |
| 48 | .agc1_pt2 = 59, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 49 | |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 50 | .agc1_slope1 = 0, |
| 51 | .agc1_slope2 = 69, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 52 | |
| 53 | .agc2_pt1 = 0, |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 54 | .agc2_pt2 = 59, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 55 | |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 56 | .agc2_slope1 = 111, |
| 57 | .agc2_slope2 = 28, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 58 | }; |
| 59 | |
| 60 | static struct dib3000mc_config bristol_dib3000mc_config[2] = { |
| 61 | { .agc = &bristol_dib3000p_mt2060_agc_config, |
| 62 | .max_time = 0x196, |
| 63 | .ln_adc_level = 0x1cc7, |
| 64 | .output_mpeg2_in_188_bytes = 1, |
| 65 | }, |
| 66 | { .agc = &bristol_dib3000p_mt2060_agc_config, |
| 67 | .max_time = 0x196, |
| 68 | .ln_adc_level = 0x1cc7, |
| 69 | .output_mpeg2_in_188_bytes = 1, |
| 70 | } |
| 71 | }; |
| 72 | |
| 73 | static int bristol_frontend_attach(struct dvb_usb_adapter *adap) |
| 74 | { |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 75 | struct dib0700_state *st = adap->dev->priv; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 76 | if (adap->id == 0) { |
| 77 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(10); |
| 78 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10); |
| 79 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10); |
| 80 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(10); |
| 81 | |
Patrick Boettcher | 7fb3fc0 | 2006-09-20 04:37:18 -0300 | [diff] [blame] | 82 | if (force_lna_activation) |
| 83 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 84 | else |
| 85 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 0); |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 86 | |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 87 | if (dib3000mc_i2c_enumeration(&adap->dev->i2c_adap, 2, DEFAULT_DIB3000P_I2C_ADDRESS, bristol_dib3000mc_config) != 0) { |
| 88 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(10); |
| 89 | return -ENODEV; |
| 90 | } |
| 91 | } |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 92 | st->mt2060_if1[adap->id] = 1220; |
| 93 | return (adap->fe = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap, |
| 94 | (10 + adap->id) << 1, &bristol_dib3000mc_config[adap->id])) == NULL ? -ENODEV : 0; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 95 | } |
| 96 | |
| 97 | static int bristol_tuner_attach(struct dvb_usb_adapter *adap) |
| 98 | { |
| 99 | struct dib0700_state *st = adap->dev->priv; |
| 100 | struct i2c_adapter *tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe, 1); |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 101 | return dvb_attach(mt2060_attach,adap->fe, tun_i2c, &bristol_mt2060_config[adap->id], |
| 102 | st->mt2060_if1[adap->id]) == NULL ? -ENODEV : 0; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 103 | } |
| 104 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 105 | /* STK7700D: Pinnacle/Terratec/Hauppauge Dual DVB-T Diversity */ |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 106 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 107 | /* MT226x */ |
| 108 | static struct dibx000_agc_config stk7700d_7000p_mt2266_agc_config[2] = { |
| 109 | { |
| 110 | BAND_UHF, // band_caps |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 111 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 112 | /* 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, |
| 113 | * 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 */ |
| 114 | (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] | 115 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 116 | 1130, // inv_gain |
| 117 | 21, // time_stabiliz |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 118 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 119 | 0, // alpha_level |
| 120 | 118, // thlock |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 121 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 122 | 0, // wbd_inv |
| 123 | 3530, // wbd_ref |
| 124 | 1, // wbd_sel |
| 125 | 0, // wbd_alpha |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 126 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 127 | 65535, // agc1_max |
| 128 | 33770, // agc1_min |
| 129 | 65535, // agc2_max |
| 130 | 23592, // agc2_min |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 131 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 132 | 0, // agc1_pt1 |
| 133 | 62, // agc1_pt2 |
| 134 | 255, // agc1_pt3 |
| 135 | 64, // agc1_slope1 |
| 136 | 64, // agc1_slope2 |
| 137 | 132, // agc2_pt1 |
| 138 | 192, // agc2_pt2 |
| 139 | 80, // agc2_slope1 |
| 140 | 80, // agc2_slope2 |
| 141 | |
| 142 | 17, // alpha_mant |
| 143 | 27, // alpha_exp |
| 144 | 23, // beta_mant |
| 145 | 51, // beta_exp |
| 146 | |
| 147 | 1, // perform_agc_softsplit |
| 148 | }, { |
| 149 | BAND_VHF | BAND_LBAND, // band_caps |
| 150 | |
| 151 | /* 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, |
| 152 | * 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 */ |
| 153 | (0 << 15) | (0 << 14) | (1 << 11) | (1 << 10) | (1 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup |
| 154 | |
| 155 | 2372, // inv_gain |
| 156 | 21, // time_stabiliz |
| 157 | |
| 158 | 0, // alpha_level |
| 159 | 118, // thlock |
| 160 | |
| 161 | 0, // wbd_inv |
| 162 | 3530, // wbd_ref |
| 163 | 1, // wbd_sel |
| 164 | 0, // wbd_alpha |
| 165 | |
| 166 | 65535, // agc1_max |
| 167 | 0, // agc1_min |
| 168 | 65535, // agc2_max |
| 169 | 23592, // agc2_min |
| 170 | |
| 171 | 0, // agc1_pt1 |
| 172 | 128, // agc1_pt2 |
| 173 | 128, // agc1_pt3 |
| 174 | 128, // agc1_slope1 |
| 175 | 0, // agc1_slope2 |
| 176 | 128, // agc2_pt1 |
| 177 | 253, // agc2_pt2 |
| 178 | 81, // agc2_slope1 |
| 179 | 0, // agc2_slope2 |
| 180 | |
| 181 | 17, // alpha_mant |
| 182 | 27, // alpha_exp |
| 183 | 23, // beta_mant |
| 184 | 51, // beta_exp |
| 185 | |
| 186 | 1, // perform_agc_softsplit |
| 187 | } |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 188 | }; |
| 189 | |
| 190 | static struct dibx000_bandwidth_config stk7700d_mt2266_pll_config = { |
| 191 | 60000, 30000, // internal, sampling |
| 192 | 1, 8, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass |
| 193 | 0, 0, 1, 1, 2, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo |
| 194 | (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k |
| 195 | 0, // ifreq |
| 196 | 20452225, // timf |
| 197 | }; |
| 198 | |
| 199 | static struct dib7000p_config stk7700d_dib7000p_mt2266_config[] = { |
| 200 | { .output_mpeg2_in_188_bytes = 1, |
| 201 | .hostbus_diversity = 1, |
| 202 | .tuner_is_baseband = 1, |
| 203 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 204 | .agc_config_count = 2, |
| 205 | .agc = stk7700d_7000p_mt2266_agc_config, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 206 | .bw = &stk7700d_mt2266_pll_config, |
| 207 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 208 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
| 209 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, |
| 210 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 211 | }, |
| 212 | { .output_mpeg2_in_188_bytes = 1, |
| 213 | .hostbus_diversity = 1, |
| 214 | .tuner_is_baseband = 1, |
| 215 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 216 | .agc_config_count = 2, |
| 217 | .agc = stk7700d_7000p_mt2266_agc_config, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 218 | .bw = &stk7700d_mt2266_pll_config, |
| 219 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 220 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
| 221 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, |
| 222 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 223 | } |
| 224 | }; |
| 225 | |
| 226 | static struct mt2266_config stk7700d_mt2266_config[2] = { |
| 227 | { .i2c_address = 0x60 |
| 228 | }, |
| 229 | { .i2c_address = 0x60 |
| 230 | } |
| 231 | }; |
| 232 | |
| 233 | static int stk7700d_frontend_attach(struct dvb_usb_adapter *adap) |
| 234 | { |
| 235 | if (adap->id == 0) { |
| 236 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 237 | msleep(10); |
| 238 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 239 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 240 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 241 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 242 | msleep(10); |
| 243 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 244 | msleep(10); |
| 245 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 246 | dib7000p_i2c_enumeration(&adap->dev->i2c_adap,2,18,stk7700d_dib7000p_mt2266_config); |
| 247 | } |
| 248 | |
| 249 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap,0x80+(adap->id << 1), |
| 250 | &stk7700d_dib7000p_mt2266_config[adap->id]); |
| 251 | |
| 252 | return adap->fe == NULL ? -ENODEV : 0; |
| 253 | } |
| 254 | |
| 255 | static int stk7700d_tuner_attach(struct dvb_usb_adapter *adap) |
| 256 | { |
| 257 | struct i2c_adapter *tun_i2c; |
| 258 | tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); |
| 259 | return dvb_attach(mt2266_attach, adap->fe, tun_i2c, |
| 260 | &stk7700d_mt2266_config[adap->id]) == NULL ? -ENODEV : 0;; |
| 261 | } |
| 262 | |
| 263 | #define DEFAULT_RC_INTERVAL 150 |
| 264 | |
| 265 | static u8 rc_request[] = { REQUEST_POLL_RC, 0 }; |
| 266 | |
Janne Grunau | 82f3d55 | 2007-07-30 13:50:28 -0300 | [diff] [blame] | 267 | static int dib0700_rc_query(struct dvb_usb_device *d, u32 *event, int *state) |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 268 | { |
| 269 | u8 key[4]; |
| 270 | int i; |
| 271 | struct dvb_usb_rc_key *keymap = d->props.rc_key_map; |
| 272 | struct dib0700_state *st = d->priv; |
| 273 | *event = 0; |
| 274 | *state = REMOTE_NO_KEY_PRESSED; |
| 275 | i=dib0700_ctrl_rd(d,rc_request,2,key,4); |
| 276 | if (i<=0) { |
Janne Grunau | 034d65e | 2007-07-31 08:48:40 -0300 | [diff] [blame] | 277 | err("RC Query Failed"); |
Janne Grunau | 89f4267 | 2007-07-31 19:45:13 -0300 | [diff] [blame] | 278 | return -1; |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 279 | } |
| 280 | if (key[0]==0 && key[1]==0 && key[2]==0 && key[3]==0) return 0; |
Janne Grunau | 89f4267 | 2007-07-31 19:45:13 -0300 | [diff] [blame] | 281 | if (key[3-1]!=st->rc_toggle) { |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 282 | for (i=0;i<d->props.rc_key_map_size; i++) { |
Janne Grunau | 89f4267 | 2007-07-31 19:45:13 -0300 | [diff] [blame] | 283 | if (keymap[i].custom == key[3-2] && keymap[i].data == key[3-3]) { |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 284 | *event = keymap[i].event; |
| 285 | *state = REMOTE_KEY_PRESSED; |
Janne Grunau | 89f4267 | 2007-07-31 19:45:13 -0300 | [diff] [blame] | 286 | st->rc_toggle=key[3-1]; |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 287 | return 0; |
| 288 | } |
| 289 | } |
Janne Grunau | 89f4267 | 2007-07-31 19:45:13 -0300 | [diff] [blame] | 290 | err("Unknown remote controller key : %2X %2X",(int)key[3-2],(int)key[3-3]); |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 291 | } |
| 292 | return 0; |
| 293 | } |
| 294 | |
Janne Grunau | 82f3d55 | 2007-07-30 13:50:28 -0300 | [diff] [blame] | 295 | static struct dvb_usb_rc_key dib0700_rc_keys[] = { |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 296 | /* Key codes for the tiny Pinnacle remote*/ |
| 297 | { 0x07, 0x00, KEY_MUTE }, |
| 298 | { 0x07, 0x01, KEY_MENU }, // Pinnacle logo |
| 299 | { 0x07, 0x39, KEY_POWER }, |
| 300 | { 0x07, 0x03, KEY_VOLUMEUP }, |
| 301 | { 0x07, 0x09, KEY_VOLUMEDOWN }, |
| 302 | { 0x07, 0x06, KEY_CHANNELUP }, |
| 303 | { 0x07, 0x0c, KEY_CHANNELDOWN }, |
| 304 | { 0x07, 0x0f, KEY_1 }, |
| 305 | { 0x07, 0x15, KEY_2 }, |
| 306 | { 0x07, 0x10, KEY_3 }, |
| 307 | { 0x07, 0x18, KEY_4 }, |
| 308 | { 0x07, 0x1b, KEY_5 }, |
| 309 | { 0x07, 0x1e, KEY_6 }, |
| 310 | { 0x07, 0x11, KEY_7 }, |
| 311 | { 0x07, 0x21, KEY_8 }, |
| 312 | { 0x07, 0x12, KEY_9 }, |
| 313 | { 0x07, 0x27, KEY_0 }, |
| 314 | { 0x07, 0x24, KEY_SCREEN }, // 'Square' key |
| 315 | { 0x07, 0x2a, KEY_TEXT }, // 'T' key |
| 316 | { 0x07, 0x2d, KEY_REWIND }, |
| 317 | { 0x07, 0x30, KEY_PLAY }, |
| 318 | { 0x07, 0x33, KEY_FASTFORWARD }, |
| 319 | { 0x07, 0x36, KEY_RECORD }, |
| 320 | { 0x07, 0x3c, KEY_STOP }, |
| 321 | { 0x07, 0x3f, KEY_CANCEL }, // '?' key |
| 322 | /* Key codes for the Terratec Cinergy DT XS Diversity, similar to cinergyT2.c */ |
| 323 | { 0xeb, 0x01, KEY_POWER }, |
| 324 | { 0xeb, 0x02, KEY_1 }, |
| 325 | { 0xeb, 0x03, KEY_2 }, |
| 326 | { 0xeb, 0x04, KEY_3 }, |
| 327 | { 0xeb, 0x05, KEY_4 }, |
| 328 | { 0xeb, 0x06, KEY_5 }, |
| 329 | { 0xeb, 0x07, KEY_6 }, |
| 330 | { 0xeb, 0x08, KEY_7 }, |
| 331 | { 0xeb, 0x09, KEY_8 }, |
| 332 | { 0xeb, 0x0a, KEY_9 }, |
| 333 | { 0xeb, 0x0b, KEY_VIDEO }, |
| 334 | { 0xeb, 0x0c, KEY_0 }, |
| 335 | { 0xeb, 0x0d, KEY_REFRESH }, |
| 336 | { 0xeb, 0x0f, KEY_EPG }, |
| 337 | { 0xeb, 0x10, KEY_UP }, |
| 338 | { 0xeb, 0x11, KEY_LEFT }, |
| 339 | { 0xeb, 0x12, KEY_OK }, |
| 340 | { 0xeb, 0x13, KEY_RIGHT }, |
| 341 | { 0xeb, 0x14, KEY_DOWN }, |
| 342 | { 0xeb, 0x16, KEY_INFO }, |
| 343 | { 0xeb, 0x17, KEY_RED }, |
| 344 | { 0xeb, 0x18, KEY_GREEN }, |
| 345 | { 0xeb, 0x19, KEY_YELLOW }, |
| 346 | { 0xeb, 0x1a, KEY_BLUE }, |
| 347 | { 0xeb, 0x1b, KEY_CHANNELUP }, |
| 348 | { 0xeb, 0x1c, KEY_VOLUMEUP }, |
Janne Grunau | 7161f27 | 2007-07-30 13:54:55 -0300 | [diff] [blame] | 349 | { 0xeb, 0x1d, KEY_MUTE }, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 350 | { 0xeb, 0x1e, KEY_VOLUMEDOWN }, |
| 351 | { 0xeb, 0x1f, KEY_CHANNELDOWN }, |
| 352 | { 0xeb, 0x40, KEY_PAUSE }, |
| 353 | { 0xeb, 0x41, KEY_HOME }, |
| 354 | { 0xeb, 0x42, KEY_MENU }, /* DVD Menu */ |
| 355 | { 0xeb, 0x43, KEY_SUBTITLE }, |
| 356 | { 0xeb, 0x44, KEY_TEXT }, /* Teletext */ |
| 357 | { 0xeb, 0x45, KEY_DELETE }, |
| 358 | { 0xeb, 0x46, KEY_TV }, |
| 359 | { 0xeb, 0x47, KEY_DVD }, |
| 360 | { 0xeb, 0x48, KEY_STOP }, |
| 361 | { 0xeb, 0x49, KEY_VIDEO }, |
| 362 | { 0xeb, 0x4a, KEY_AUDIO }, /* Music */ |
| 363 | { 0xeb, 0x4b, KEY_SCREEN }, /* Pic */ |
| 364 | { 0xeb, 0x4c, KEY_PLAY }, |
| 365 | { 0xeb, 0x4d, KEY_BACK }, |
| 366 | { 0xeb, 0x4e, KEY_REWIND }, |
| 367 | { 0xeb, 0x4f, KEY_FASTFORWARD }, |
| 368 | { 0xeb, 0x54, KEY_PREVIOUS }, |
| 369 | { 0xeb, 0x58, KEY_RECORD }, |
Janne Grunau | 7161f27 | 2007-07-30 13:54:55 -0300 | [diff] [blame] | 370 | { 0xeb, 0x5c, KEY_NEXT }, |
| 371 | |
| 372 | /* Key codes for the Haupauge WinTV Nova-TD, copied from nova-t-usb2.c (Nova-T USB2) */ |
| 373 | { 0x1e, 0x00, KEY_0 }, |
| 374 | { 0x1e, 0x01, KEY_1 }, |
| 375 | { 0x1e, 0x02, KEY_2 }, |
| 376 | { 0x1e, 0x03, KEY_3 }, |
| 377 | { 0x1e, 0x04, KEY_4 }, |
| 378 | { 0x1e, 0x05, KEY_5 }, |
| 379 | { 0x1e, 0x06, KEY_6 }, |
| 380 | { 0x1e, 0x07, KEY_7 }, |
| 381 | { 0x1e, 0x08, KEY_8 }, |
| 382 | { 0x1e, 0x09, KEY_9 }, |
| 383 | { 0x1e, 0x0a, KEY_KPASTERISK }, |
| 384 | { 0x1e, 0x0b, KEY_RED }, |
| 385 | { 0x1e, 0x0c, KEY_RADIO }, |
| 386 | { 0x1e, 0x0d, KEY_MENU }, |
| 387 | { 0x1e, 0x0e, KEY_GRAVE }, /* # */ |
| 388 | { 0x1e, 0x0f, KEY_MUTE }, |
| 389 | { 0x1e, 0x10, KEY_VOLUMEUP }, |
| 390 | { 0x1e, 0x11, KEY_VOLUMEDOWN }, |
| 391 | { 0x1e, 0x12, KEY_CHANNEL }, |
| 392 | { 0x1e, 0x14, KEY_UP }, |
| 393 | { 0x1e, 0x15, KEY_DOWN }, |
| 394 | { 0x1e, 0x16, KEY_LEFT }, |
| 395 | { 0x1e, 0x17, KEY_RIGHT }, |
| 396 | { 0x1e, 0x18, KEY_VIDEO }, |
| 397 | { 0x1e, 0x19, KEY_AUDIO }, |
| 398 | { 0x1e, 0x1a, KEY_MEDIA }, |
| 399 | { 0x1e, 0x1b, KEY_EPG }, |
| 400 | { 0x1e, 0x1c, KEY_TV }, |
| 401 | { 0x1e, 0x1e, KEY_NEXT }, |
| 402 | { 0x1e, 0x1f, KEY_BACK }, |
| 403 | { 0x1e, 0x20, KEY_CHANNELUP }, |
| 404 | { 0x1e, 0x21, KEY_CHANNELDOWN }, |
| 405 | { 0x1e, 0x24, KEY_LAST }, /* Skip backwards */ |
| 406 | { 0x1e, 0x25, KEY_OK }, |
| 407 | { 0x1e, 0x29, KEY_BLUE}, |
| 408 | { 0x1e, 0x2e, KEY_GREEN }, |
| 409 | { 0x1e, 0x30, KEY_PAUSE }, |
| 410 | { 0x1e, 0x32, KEY_REWIND }, |
| 411 | { 0x1e, 0x34, KEY_FASTFORWARD }, |
| 412 | { 0x1e, 0x35, KEY_PLAY }, |
| 413 | { 0x1e, 0x36, KEY_STOP }, |
| 414 | { 0x1e, 0x37, KEY_RECORD }, |
| 415 | { 0x1e, 0x38, KEY_YELLOW }, |
| 416 | { 0x1e, 0x3b, KEY_GOTO }, |
| 417 | { 0x1e, 0x3d, KEY_POWER }, |
Jaroslav Barton | 48e6a01 | 2007-11-10 19:17:45 -0300 | [diff] [blame^] | 418 | |
| 419 | /* Key codes for the Leadtek Winfast DTV Dongle */ |
| 420 | { 0x00, 0x42, KEY_POWER }, |
| 421 | { 0x07, 0x7c, KEY_TUNER }, |
| 422 | { 0x0f, 0x4e, KEY_PRINT }, /* PREVIEW */ |
| 423 | { 0x08, 0x40, KEY_SCREEN }, /* full screen toggle*/ |
| 424 | { 0x0f, 0x71, KEY_DOT }, /* frequency */ |
| 425 | { 0x07, 0x43, KEY_0 }, |
| 426 | { 0x0c, 0x41, KEY_1 }, |
| 427 | { 0x04, 0x43, KEY_2 }, |
| 428 | { 0x0b, 0x7f, KEY_3 }, |
| 429 | { 0x0e, 0x41, KEY_4 }, |
| 430 | { 0x06, 0x43, KEY_5 }, |
| 431 | { 0x09, 0x7f, KEY_6 }, |
| 432 | { 0x0d, 0x7e, KEY_7 }, |
| 433 | { 0x05, 0x7c, KEY_8 }, |
| 434 | { 0x0a, 0x40, KEY_9 }, |
| 435 | { 0x0e, 0x4e, KEY_CLEAR }, |
| 436 | { 0x04, 0x7c, KEY_CHANNEL }, /* show channel number */ |
| 437 | { 0x0f, 0x41, KEY_LAST }, /* recall */ |
| 438 | { 0x03, 0x42, KEY_MUTE }, |
| 439 | { 0x06, 0x4c, KEY_RESERVED }, /* PIP button*/ |
| 440 | { 0x01, 0x72, KEY_SHUFFLE }, /* SNAPSHOT */ |
| 441 | { 0x0c, 0x4e, KEY_PLAYPAUSE }, /* TIMESHIFT */ |
| 442 | { 0x0b, 0x70, KEY_RECORD }, |
| 443 | { 0x03, 0x7d, KEY_VOLUMEUP }, |
| 444 | { 0x01, 0x7d, KEY_VOLUMEDOWN }, |
| 445 | { 0x02, 0x42, KEY_CHANNELUP }, |
| 446 | { 0x00, 0x7d, KEY_CHANNELDOWN }, |
Janne Grunau | 82f3d55 | 2007-07-30 13:50:28 -0300 | [diff] [blame] | 447 | }; |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 448 | |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 449 | /* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */ |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 450 | static struct dibx000_agc_config stk7700p_7000m_mt2060_agc_config = { |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 451 | BAND_UHF | BAND_VHF, // band_caps |
| 452 | |
| 453 | /* 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, |
| 454 | * 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 */ |
| 455 | (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup |
| 456 | |
| 457 | 712, // inv_gain |
| 458 | 41, // time_stabiliz |
| 459 | |
| 460 | 0, // alpha_level |
| 461 | 118, // thlock |
| 462 | |
| 463 | 0, // wbd_inv |
| 464 | 4095, // wbd_ref |
| 465 | 0, // wbd_sel |
| 466 | 0, // wbd_alpha |
| 467 | |
| 468 | 42598, // agc1_max |
| 469 | 17694, // agc1_min |
| 470 | 45875, // agc2_max |
| 471 | 2621, // agc2_min |
| 472 | 0, // agc1_pt1 |
| 473 | 76, // agc1_pt2 |
| 474 | 139, // agc1_pt3 |
| 475 | 52, // agc1_slope1 |
| 476 | 59, // agc1_slope2 |
| 477 | 107, // agc2_pt1 |
| 478 | 172, // agc2_pt2 |
| 479 | 57, // agc2_slope1 |
| 480 | 70, // agc2_slope2 |
| 481 | |
| 482 | 21, // alpha_mant |
| 483 | 25, // alpha_exp |
| 484 | 28, // beta_mant |
| 485 | 48, // beta_exp |
| 486 | |
| 487 | 1, // perform_agc_softsplit |
| 488 | { 0, // split_min |
| 489 | 107, // split_max |
| 490 | 51800, // global_split_min |
| 491 | 24700 // global_split_max |
| 492 | }, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 493 | }; |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 494 | |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 495 | static struct dibx000_agc_config stk7700p_7000p_mt2060_agc_config = { |
| 496 | BAND_UHF | BAND_VHF, |
| 497 | |
| 498 | /* 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, |
| 499 | * 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 */ |
| 500 | (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup |
| 501 | |
| 502 | 712, // inv_gain |
| 503 | 41, // time_stabiliz |
| 504 | |
| 505 | 0, // alpha_level |
| 506 | 118, // thlock |
| 507 | |
| 508 | 0, // wbd_inv |
| 509 | 4095, // wbd_ref |
| 510 | 0, // wbd_sel |
| 511 | 0, // wbd_alpha |
| 512 | |
| 513 | 42598, // agc1_max |
| 514 | 16384, // agc1_min |
| 515 | 42598, // agc2_max |
| 516 | 0, // agc2_min |
| 517 | |
| 518 | 0, // agc1_pt1 |
| 519 | 137, // agc1_pt2 |
| 520 | 255, // agc1_pt3 |
| 521 | |
| 522 | 0, // agc1_slope1 |
| 523 | 255, // agc1_slope2 |
| 524 | |
| 525 | 0, // agc2_pt1 |
| 526 | 0, // agc2_pt2 |
| 527 | |
| 528 | 0, // agc2_slope1 |
| 529 | 41, // agc2_slope2 |
| 530 | |
| 531 | 15, // alpha_mant |
| 532 | 25, // alpha_exp |
| 533 | |
| 534 | 28, // beta_mant |
| 535 | 48, // beta_exp |
| 536 | |
| 537 | 0, // perform_agc_softsplit |
| 538 | }; |
| 539 | |
| 540 | static struct dibx000_bandwidth_config stk7700p_pll_config = { |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 541 | 60000, 30000, // internal, sampling |
| 542 | 1, 8, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass |
| 543 | 0, 0, 1, 1, 0, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo |
| 544 | (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k |
| 545 | 60258167, // ifreq |
| 546 | 20452225, // timf |
Patrick Boettcher | 3db78e5 | 2007-07-31 08:19:28 -0300 | [diff] [blame] | 547 | 30000000, // xtal |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 548 | }; |
| 549 | |
| 550 | static struct dib7000m_config stk7700p_dib7000m_config = { |
| 551 | .dvbt_mode = 1, |
| 552 | .output_mpeg2_in_188_bytes = 1, |
| 553 | .quartz_direct = 1, |
| 554 | |
| 555 | .agc_config_count = 1, |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 556 | .agc = &stk7700p_7000m_mt2060_agc_config, |
| 557 | .bw = &stk7700p_pll_config, |
| 558 | |
| 559 | .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS, |
| 560 | .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES, |
| 561 | .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS, |
| 562 | }; |
| 563 | |
| 564 | static struct dib7000p_config stk7700p_dib7000p_config = { |
| 565 | .output_mpeg2_in_188_bytes = 1, |
| 566 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 567 | .agc_config_count = 1, |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 568 | .agc = &stk7700p_7000p_mt2060_agc_config, |
| 569 | .bw = &stk7700p_pll_config, |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 570 | |
| 571 | .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS, |
| 572 | .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES, |
| 573 | .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS, |
| 574 | }; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 575 | |
| 576 | static int stk7700p_frontend_attach(struct dvb_usb_adapter *adap) |
| 577 | { |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 578 | struct dib0700_state *st = adap->dev->priv; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 579 | /* 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] | 580 | |
| 581 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 582 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(50); |
| 583 | |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 584 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10); |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 585 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 586 | |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 587 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10); |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 588 | dib0700_ctrl_clock(adap->dev, 72, 1); |
| 589 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(100); |
| 590 | |
| 591 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 592 | |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 593 | st->mt2060_if1[0] = 1220; |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 594 | |
| 595 | if (dib7000pc_detection(&adap->dev->i2c_adap)) { |
| 596 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000p_config); |
| 597 | st->is_dib7000pc = 1; |
| 598 | } else |
| 599 | adap->fe = dvb_attach(dib7000m_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000m_config); |
| 600 | |
| 601 | return adap->fe == NULL ? -ENODEV : 0; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 602 | } |
| 603 | |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 604 | static struct mt2060_config stk7700p_mt2060_config = { |
| 605 | 0x60 |
| 606 | }; |
| 607 | |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 608 | static int stk7700p_tuner_attach(struct dvb_usb_adapter *adap) |
| 609 | { |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 610 | struct dib0700_state *st = adap->dev->priv; |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 611 | struct i2c_adapter *tun_i2c; |
| 612 | |
| 613 | if (st->is_dib7000pc) |
| 614 | tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); |
| 615 | else |
| 616 | tun_i2c = dib7000m_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); |
| 617 | |
| 618 | return dvb_attach(mt2060_attach, adap->fe, tun_i2c, &stk7700p_mt2060_config, |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 619 | st->mt2060_if1[0]) == NULL ? -ENODEV : 0; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 620 | } |
| 621 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 622 | /* DIB7070 generic */ |
| 623 | static struct dibx000_agc_config dib7070_agc_config = { |
| 624 | BAND_UHF | BAND_VHF | BAND_LBAND | BAND_SBAND, |
| 625 | /* 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, |
| 626 | * 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 */ |
| 627 | (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), // setup |
| 628 | |
| 629 | 600, // inv_gain |
| 630 | 10, // time_stabiliz |
| 631 | |
| 632 | 0, // alpha_level |
| 633 | 118, // thlock |
| 634 | |
| 635 | 0, // wbd_inv |
| 636 | 3530, // wbd_ref |
| 637 | 1, // wbd_sel |
| 638 | 5, // wbd_alpha |
| 639 | |
| 640 | 65535, // agc1_max |
| 641 | 0, // agc1_min |
| 642 | |
| 643 | 65535, // agc2_max |
| 644 | 0, // agc2_min |
| 645 | |
| 646 | 0, // agc1_pt1 |
| 647 | 40, // agc1_pt2 |
| 648 | 183, // agc1_pt3 |
| 649 | 206, // agc1_slope1 |
| 650 | 255, // agc1_slope2 |
| 651 | 72, // agc2_pt1 |
| 652 | 152, // agc2_pt2 |
| 653 | 88, // agc2_slope1 |
| 654 | 90, // agc2_slope2 |
| 655 | |
| 656 | 17, // alpha_mant |
| 657 | 27, // alpha_exp |
| 658 | 23, // beta_mant |
| 659 | 51, // beta_exp |
| 660 | |
| 661 | 0, // perform_agc_softsplit |
| 662 | }; |
| 663 | |
| 664 | static int dib7070_tuner_reset(struct dvb_frontend *fe, int onoff) |
| 665 | { |
| 666 | return dib7000p_set_gpio(fe, 8, 0, !onoff); |
| 667 | } |
| 668 | |
| 669 | static int dib7070_tuner_sleep(struct dvb_frontend *fe, int onoff) |
| 670 | { |
| 671 | return dib7000p_set_gpio(fe, 9, 0, onoff); |
| 672 | } |
| 673 | |
| 674 | static struct dib0070_config dib7070p_dib0070_config[2] = { |
| 675 | { |
| 676 | .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS, |
| 677 | .reset = dib7070_tuner_reset, |
| 678 | .sleep = dib7070_tuner_sleep, |
| 679 | .clock_khz = 12000, |
| 680 | .clock_pad_drive = 4 |
| 681 | }, { |
| 682 | .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS, |
| 683 | .reset = dib7070_tuner_reset, |
| 684 | .sleep = dib7070_tuner_sleep, |
| 685 | .clock_khz = 12000, |
| 686 | |
| 687 | } |
| 688 | }; |
| 689 | |
| 690 | static int dib7070_set_param_override(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep) |
| 691 | { |
| 692 | struct dvb_usb_adapter *adap = fe->dvb->priv; |
| 693 | struct dib0700_adapter_state *state = adap->priv; |
| 694 | |
| 695 | u16 offset; |
| 696 | u8 band = BAND_OF_FREQUENCY(fep->frequency/1000); |
| 697 | switch (band) { |
| 698 | case BAND_VHF: offset = 950; break; |
| 699 | case BAND_UHF: |
| 700 | default: offset = 550; break; |
| 701 | } |
| 702 | deb_info("WBD for DiB7000P: %d\n", offset + dib0070_wbd_offset(fe)); |
| 703 | dib7000p_set_wbd_ref(fe, offset + dib0070_wbd_offset(fe)); |
| 704 | return state->set_param_save(fe, fep); |
| 705 | } |
| 706 | |
| 707 | static int dib7070p_tuner_attach(struct dvb_usb_adapter *adap) |
| 708 | { |
| 709 | struct dib0700_adapter_state *st = adap->priv; |
| 710 | struct i2c_adapter *tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); |
| 711 | |
| 712 | if (adap->id == 0) { |
| 713 | if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, &dib7070p_dib0070_config[0]) == NULL) |
| 714 | return -ENODEV; |
| 715 | } else { |
| 716 | if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, &dib7070p_dib0070_config[1]) == NULL) |
| 717 | return -ENODEV; |
| 718 | } |
| 719 | |
| 720 | st->set_param_save = adap->fe->ops.tuner_ops.set_params; |
| 721 | adap->fe->ops.tuner_ops.set_params = dib7070_set_param_override; |
| 722 | return 0; |
| 723 | } |
| 724 | |
| 725 | static struct dibx000_bandwidth_config dib7070_bw_config_12_mhz = { |
| 726 | 60000, 15000, // internal, sampling |
| 727 | 1, 20, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass |
| 728 | 0, 0, 1, 1, 2, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo |
| 729 | (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k |
| 730 | (0 << 25) | 0, // ifreq = 0.000000 MHz |
| 731 | 20452225, // timf |
| 732 | 12000000, // xtal_hz |
| 733 | }; |
| 734 | |
| 735 | static struct dib7000p_config dib7070p_dib7000p_config = { |
| 736 | .output_mpeg2_in_188_bytes = 1, |
| 737 | |
| 738 | .agc_config_count = 1, |
| 739 | .agc = &dib7070_agc_config, |
| 740 | .bw = &dib7070_bw_config_12_mhz, |
| 741 | |
| 742 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
| 743 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, |
| 744 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
| 745 | |
| 746 | .hostbus_diversity = 1, |
| 747 | }; |
| 748 | |
| 749 | /* STK7070P */ |
| 750 | static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap) |
| 751 | { |
| 752 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 753 | msleep(10); |
| 754 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 755 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 756 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 757 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 758 | |
| 759 | dib0700_ctrl_clock(adap->dev, 72, 1); |
| 760 | |
| 761 | msleep(10); |
| 762 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 763 | msleep(10); |
| 764 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 765 | |
| 766 | dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, &dib7070p_dib7000p_config); |
| 767 | |
| 768 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, &dib7070p_dib7000p_config); |
| 769 | return adap->fe == NULL ? -ENODEV : 0; |
| 770 | } |
| 771 | |
| 772 | /* STK7070PD */ |
| 773 | static struct dib7000p_config stk7070pd_dib7000p_config[2] = { |
| 774 | { |
| 775 | .output_mpeg2_in_188_bytes = 1, |
| 776 | |
| 777 | .agc_config_count = 1, |
| 778 | .agc = &dib7070_agc_config, |
| 779 | .bw = &dib7070_bw_config_12_mhz, |
| 780 | |
| 781 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
| 782 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, |
| 783 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
| 784 | |
| 785 | .hostbus_diversity = 1, |
| 786 | }, { |
| 787 | .output_mpeg2_in_188_bytes = 1, |
| 788 | |
| 789 | .agc_config_count = 1, |
| 790 | .agc = &dib7070_agc_config, |
| 791 | .bw = &dib7070_bw_config_12_mhz, |
| 792 | |
| 793 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
| 794 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, |
| 795 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
| 796 | |
| 797 | .hostbus_diversity = 1, |
| 798 | } |
| 799 | }; |
| 800 | |
| 801 | static int stk7070pd_frontend_attach0(struct dvb_usb_adapter *adap) |
| 802 | { |
| 803 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 804 | msleep(10); |
| 805 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 806 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 807 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 808 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 809 | |
| 810 | dib0700_ctrl_clock(adap->dev, 72, 1); |
| 811 | |
| 812 | msleep(10); |
| 813 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 814 | msleep(10); |
| 815 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 816 | |
| 817 | dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 2, 18, stk7070pd_dib7000p_config); |
| 818 | |
| 819 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, &stk7070pd_dib7000p_config[0]); |
| 820 | return adap->fe == NULL ? -ENODEV : 0; |
| 821 | } |
| 822 | |
| 823 | static int stk7070pd_frontend_attach1(struct dvb_usb_adapter *adap) |
| 824 | { |
| 825 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x82, &stk7070pd_dib7000p_config[1]); |
| 826 | return adap->fe == NULL ? -ENODEV : 0; |
| 827 | } |
| 828 | |
| 829 | /* DVB-USB and USB stuff follows */ |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 830 | struct usb_device_id dib0700_usb_id_table[] = { |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 831 | /* 0 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P) }, |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 832 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P_PC) }, |
| 833 | |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 834 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500) }, |
Patrick Boettcher | d535cfa | 2006-09-19 12:51:49 -0300 | [diff] [blame] | 835 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500_2) }, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 836 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK) }, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 837 | /* 5 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR) }, |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 838 | { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500) }, |
Henning Schroeer | 0ce215e | 2006-10-19 07:58:22 -0300 | [diff] [blame] | 839 | { USB_DEVICE(USB_VID_UNIWILL, USB_PID_UNIWILL_STK7700P) }, |
Michael Krufky | 8637a87 | 2006-11-08 16:47:32 -0300 | [diff] [blame] | 840 | { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_STK7700P) }, |
Stefan Traby | f9aeba4 | 2006-11-12 13:02:51 -0300 | [diff] [blame] | 841 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_2) }, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 842 | /* 10 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR_2) }, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 843 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV2000E) }, |
| 844 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY) }, |
| 845 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_TD_STICK) }, |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 846 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700D) }, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 847 | /* 15 */{ USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070P) }, |
| 848 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV_DVB_T_FLASH) }, |
| 849 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070PD) }, |
| 850 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T) }, |
Patrick Boettcher | 1f8ca4b | 2007-07-30 14:24:37 -0300 | [diff] [blame] | 851 | { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500_PC) }, |
Joachim Steiger | fa3b877 | 2007-10-08 20:08:46 -0300 | [diff] [blame] | 852 | /* 20 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_EXPRESS) }, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 853 | { 0 } /* Terminating entry */ |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 854 | }; |
| 855 | MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table); |
| 856 | |
| 857 | #define DIB0700_DEFAULT_DEVICE_PROPERTIES \ |
| 858 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, \ |
| 859 | .usb_ctrl = DEVICE_SPECIFIC, \ |
Patrick Boettcher | 74c78a2 | 2007-10-11 14:06:37 -0300 | [diff] [blame] | 860 | .firmware = "dvb-usb-dib0700-1.10.fw", \ |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 861 | .download_firmware = dib0700_download_firmware, \ |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 862 | .no_reconnect = 1, \ |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 863 | .size_of_priv = sizeof(struct dib0700_state), \ |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 864 | .i2c_algo = &dib0700_i2c_algo, \ |
| 865 | .identify_state = dib0700_identify_state |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 866 | |
| 867 | #define DIB0700_DEFAULT_STREAMING_CONFIG(ep) \ |
| 868 | .streaming_ctrl = dib0700_streaming_ctrl, \ |
| 869 | .stream = { \ |
| 870 | .type = USB_BULK, \ |
| 871 | .count = 4, \ |
| 872 | .endpoint = ep, \ |
| 873 | .u = { \ |
| 874 | .bulk = { \ |
| 875 | .buffersize = 39480, \ |
| 876 | } \ |
| 877 | } \ |
| 878 | } |
| 879 | |
| 880 | struct dvb_usb_device_properties dib0700_devices[] = { |
| 881 | { |
| 882 | DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 883 | |
| 884 | .num_adapters = 1, |
| 885 | .adapter = { |
| 886 | { |
| 887 | .frontend_attach = stk7700p_frontend_attach, |
| 888 | .tuner_attach = stk7700p_tuner_attach, |
| 889 | |
| 890 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 891 | }, |
| 892 | }, |
| 893 | |
Joachim Steiger | fa3b877 | 2007-10-08 20:08:46 -0300 | [diff] [blame] | 894 | .num_device_descs = 7, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 895 | .devices = { |
| 896 | { "DiBcom STK7700P reference design", |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 897 | { &dib0700_usb_id_table[0], &dib0700_usb_id_table[1] }, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 898 | { NULL }, |
| 899 | }, |
| 900 | { "Hauppauge Nova-T Stick", |
Stefan Traby | f9aeba4 | 2006-11-12 13:02:51 -0300 | [diff] [blame] | 901 | { &dib0700_usb_id_table[4], &dib0700_usb_id_table[9], NULL }, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 902 | { NULL }, |
| 903 | }, |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 904 | { "AVerMedia AVerTV DVB-T Volar", |
Jose Carlos Garcia Sogo | ced8fec | 2006-11-14 05:01:47 -0300 | [diff] [blame] | 905 | { &dib0700_usb_id_table[5], &dib0700_usb_id_table[10] }, |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 906 | { NULL }, |
| 907 | }, |
| 908 | { "Compro Videomate U500", |
Patrick Boettcher | 1f8ca4b | 2007-07-30 14:24:37 -0300 | [diff] [blame] | 909 | { &dib0700_usb_id_table[6], &dib0700_usb_id_table[19] }, |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 910 | { NULL }, |
Henning Schroeer | 0ce215e | 2006-10-19 07:58:22 -0300 | [diff] [blame] | 911 | }, |
| 912 | { "Uniwill STK7700P based (Hama and others)", |
| 913 | { &dib0700_usb_id_table[7], NULL }, |
| 914 | { NULL }, |
Michael Krufky | 8637a87 | 2006-11-08 16:47:32 -0300 | [diff] [blame] | 915 | }, |
| 916 | { "Leadtek Winfast DTV Dongle (STK7700P based)", |
| 917 | { &dib0700_usb_id_table[8], NULL }, |
| 918 | { NULL }, |
Joachim Steiger | fa3b877 | 2007-10-08 20:08:46 -0300 | [diff] [blame] | 919 | }, |
| 920 | { "AVerMedia AVerTV DVB-T Express", |
| 921 | { &dib0700_usb_id_table[20] }, |
| 922 | { NULL }, |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 923 | } |
Darren Salt | b1139e3 | 2007-08-18 18:05:31 -0300 | [diff] [blame] | 924 | }, |
| 925 | |
| 926 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 927 | .rc_key_map = dib0700_rc_keys, |
| 928 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
| 929 | .rc_query = dib0700_rc_query |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 930 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 931 | |
| 932 | .num_adapters = 2, |
| 933 | .adapter = { |
| 934 | { |
| 935 | .frontend_attach = bristol_frontend_attach, |
| 936 | .tuner_attach = bristol_tuner_attach, |
| 937 | |
| 938 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 939 | }, { |
| 940 | .frontend_attach = bristol_frontend_attach, |
| 941 | .tuner_attach = bristol_tuner_attach, |
| 942 | |
| 943 | DIB0700_DEFAULT_STREAMING_CONFIG(0x03), |
| 944 | } |
| 945 | }, |
| 946 | |
| 947 | .num_device_descs = 1, |
| 948 | .devices = { |
| 949 | { "Hauppauge Nova-T 500 Dual DVB-T", |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 950 | { &dib0700_usb_id_table[2], &dib0700_usb_id_table[3], NULL }, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 951 | { NULL }, |
| 952 | }, |
Janne Grunau | 82f3d55 | 2007-07-30 13:50:28 -0300 | [diff] [blame] | 953 | }, |
| 954 | |
| 955 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 956 | .rc_key_map = dib0700_rc_keys, |
Patrick Boettcher | 8779737 | 2007-07-30 17:02:17 -0300 | [diff] [blame] | 957 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
Janne Grunau | 82f3d55 | 2007-07-30 13:50:28 -0300 | [diff] [blame] | 958 | .rc_query = dib0700_rc_query |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 959 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 960 | |
| 961 | .num_adapters = 2, |
| 962 | .adapter = { |
| 963 | { |
| 964 | .frontend_attach = stk7700d_frontend_attach, |
| 965 | .tuner_attach = stk7700d_tuner_attach, |
| 966 | |
| 967 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 968 | }, { |
| 969 | .frontend_attach = stk7700d_frontend_attach, |
| 970 | .tuner_attach = stk7700d_tuner_attach, |
| 971 | |
| 972 | DIB0700_DEFAULT_STREAMING_CONFIG(0x03), |
| 973 | } |
| 974 | }, |
| 975 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 976 | .num_device_descs = 4, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 977 | .devices = { |
| 978 | { "Pinnacle PCTV 2000e", |
| 979 | { &dib0700_usb_id_table[11], NULL }, |
| 980 | { NULL }, |
| 981 | }, |
| 982 | { "Terratec Cinergy DT XS Diversity", |
| 983 | { &dib0700_usb_id_table[12], NULL }, |
| 984 | { NULL }, |
| 985 | }, |
Darren Salt | faebb91 | 2007-08-18 18:04:00 -0300 | [diff] [blame] | 986 | { "Hauppauge Nova-TD Stick/Elgato Eye-TV Diversity", |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 987 | { &dib0700_usb_id_table[13], NULL }, |
| 988 | { NULL }, |
| 989 | }, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 990 | { "DiBcom STK7700D reference design", |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 991 | { &dib0700_usb_id_table[14], NULL }, |
| 992 | { NULL }, |
| 993 | }, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 994 | }, |
Janne Grunau | 82f3d55 | 2007-07-30 13:50:28 -0300 | [diff] [blame] | 995 | |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 996 | .rc_interval = DEFAULT_RC_INTERVAL, |
Janne Grunau | 82f3d55 | 2007-07-30 13:50:28 -0300 | [diff] [blame] | 997 | .rc_key_map = dib0700_rc_keys, |
Patrick Boettcher | 8779737 | 2007-07-30 17:02:17 -0300 | [diff] [blame] | 998 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
Janne Grunau | 82f3d55 | 2007-07-30 13:50:28 -0300 | [diff] [blame] | 999 | .rc_query = dib0700_rc_query |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1000 | |
| 1001 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 1002 | |
| 1003 | .num_adapters = 1, |
| 1004 | .adapter = { |
| 1005 | { |
| 1006 | .frontend_attach = stk7070p_frontend_attach, |
| 1007 | .tuner_attach = dib7070p_tuner_attach, |
| 1008 | |
| 1009 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 1010 | |
| 1011 | .size_of_priv = sizeof(struct dib0700_adapter_state), |
| 1012 | }, |
| 1013 | }, |
| 1014 | |
| 1015 | .num_device_descs = 2, |
| 1016 | .devices = { |
| 1017 | { "DiBcom STK7070P reference design", |
| 1018 | { &dib0700_usb_id_table[15], NULL }, |
| 1019 | { NULL }, |
| 1020 | }, |
| 1021 | { "Pinnacle PCTV DVB-T Flash Stick", |
| 1022 | { &dib0700_usb_id_table[16], NULL }, |
| 1023 | { NULL }, |
| 1024 | }, |
| 1025 | } |
| 1026 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 1027 | |
| 1028 | .num_adapters = 2, |
| 1029 | .adapter = { |
| 1030 | { |
| 1031 | .frontend_attach = stk7070pd_frontend_attach0, |
| 1032 | .tuner_attach = dib7070p_tuner_attach, |
| 1033 | |
| 1034 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 1035 | |
| 1036 | .size_of_priv = sizeof(struct dib0700_adapter_state), |
| 1037 | }, { |
| 1038 | .frontend_attach = stk7070pd_frontend_attach1, |
| 1039 | .tuner_attach = dib7070p_tuner_attach, |
| 1040 | |
| 1041 | DIB0700_DEFAULT_STREAMING_CONFIG(0x03), |
| 1042 | |
| 1043 | .size_of_priv = sizeof(struct dib0700_adapter_state), |
| 1044 | } |
| 1045 | }, |
| 1046 | |
| 1047 | .num_device_descs = 2, |
| 1048 | .devices = { |
| 1049 | { "DiBcom STK7070PD reference design", |
| 1050 | { &dib0700_usb_id_table[17], NULL }, |
| 1051 | { NULL }, |
| 1052 | }, |
| 1053 | { "Pinnacle PCTV Dual DVB-T Diversity Stick", |
| 1054 | { &dib0700_usb_id_table[18], NULL }, |
| 1055 | { NULL }, |
| 1056 | }, |
| 1057 | } |
| 1058 | }, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1059 | }; |
| 1060 | |
| 1061 | int dib0700_device_count = ARRAY_SIZE(dib0700_devices); |