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 }, |
Janne Grunau | 82f3d55 | 2007-07-30 13:50:28 -0300 | [diff] [blame] | 920 | }; |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 921 | |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 922 | /* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */ |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 923 | static struct dibx000_agc_config stk7700p_7000m_mt2060_agc_config = { |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 924 | BAND_UHF | BAND_VHF, // band_caps |
| 925 | |
| 926 | /* 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, |
| 927 | * 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 */ |
| 928 | (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup |
| 929 | |
| 930 | 712, // inv_gain |
| 931 | 41, // time_stabiliz |
| 932 | |
| 933 | 0, // alpha_level |
| 934 | 118, // thlock |
| 935 | |
| 936 | 0, // wbd_inv |
| 937 | 4095, // wbd_ref |
| 938 | 0, // wbd_sel |
| 939 | 0, // wbd_alpha |
| 940 | |
| 941 | 42598, // agc1_max |
| 942 | 17694, // agc1_min |
| 943 | 45875, // agc2_max |
| 944 | 2621, // agc2_min |
| 945 | 0, // agc1_pt1 |
| 946 | 76, // agc1_pt2 |
| 947 | 139, // agc1_pt3 |
| 948 | 52, // agc1_slope1 |
| 949 | 59, // agc1_slope2 |
| 950 | 107, // agc2_pt1 |
| 951 | 172, // agc2_pt2 |
| 952 | 57, // agc2_slope1 |
| 953 | 70, // agc2_slope2 |
| 954 | |
| 955 | 21, // alpha_mant |
| 956 | 25, // alpha_exp |
| 957 | 28, // beta_mant |
| 958 | 48, // beta_exp |
| 959 | |
| 960 | 1, // perform_agc_softsplit |
| 961 | { 0, // split_min |
| 962 | 107, // split_max |
| 963 | 51800, // global_split_min |
| 964 | 24700 // global_split_max |
| 965 | }, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 966 | }; |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 967 | |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 968 | static struct dibx000_agc_config stk7700p_7000p_mt2060_agc_config = { |
| 969 | BAND_UHF | BAND_VHF, |
| 970 | |
| 971 | /* 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, |
| 972 | * 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 */ |
| 973 | (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup |
| 974 | |
| 975 | 712, // inv_gain |
| 976 | 41, // time_stabiliz |
| 977 | |
| 978 | 0, // alpha_level |
| 979 | 118, // thlock |
| 980 | |
| 981 | 0, // wbd_inv |
| 982 | 4095, // wbd_ref |
| 983 | 0, // wbd_sel |
| 984 | 0, // wbd_alpha |
| 985 | |
| 986 | 42598, // agc1_max |
| 987 | 16384, // agc1_min |
| 988 | 42598, // agc2_max |
| 989 | 0, // agc2_min |
| 990 | |
| 991 | 0, // agc1_pt1 |
| 992 | 137, // agc1_pt2 |
| 993 | 255, // agc1_pt3 |
| 994 | |
| 995 | 0, // agc1_slope1 |
| 996 | 255, // agc1_slope2 |
| 997 | |
| 998 | 0, // agc2_pt1 |
| 999 | 0, // agc2_pt2 |
| 1000 | |
| 1001 | 0, // agc2_slope1 |
| 1002 | 41, // agc2_slope2 |
| 1003 | |
| 1004 | 15, // alpha_mant |
| 1005 | 25, // alpha_exp |
| 1006 | |
| 1007 | 28, // beta_mant |
| 1008 | 48, // beta_exp |
| 1009 | |
| 1010 | 0, // perform_agc_softsplit |
| 1011 | }; |
| 1012 | |
| 1013 | static struct dibx000_bandwidth_config stk7700p_pll_config = { |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 1014 | 60000, 30000, // internal, sampling |
| 1015 | 1, 8, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass |
| 1016 | 0, 0, 1, 1, 0, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo |
| 1017 | (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k |
| 1018 | 60258167, // ifreq |
| 1019 | 20452225, // timf |
Patrick Boettcher | 3db78e5 | 2007-07-31 08:19:28 -0300 | [diff] [blame] | 1020 | 30000000, // xtal |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 1021 | }; |
| 1022 | |
| 1023 | static struct dib7000m_config stk7700p_dib7000m_config = { |
| 1024 | .dvbt_mode = 1, |
| 1025 | .output_mpeg2_in_188_bytes = 1, |
| 1026 | .quartz_direct = 1, |
| 1027 | |
| 1028 | .agc_config_count = 1, |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 1029 | .agc = &stk7700p_7000m_mt2060_agc_config, |
| 1030 | .bw = &stk7700p_pll_config, |
| 1031 | |
| 1032 | .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS, |
| 1033 | .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES, |
| 1034 | .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS, |
| 1035 | }; |
| 1036 | |
| 1037 | static struct dib7000p_config stk7700p_dib7000p_config = { |
| 1038 | .output_mpeg2_in_188_bytes = 1, |
| 1039 | |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 1040 | .agc_config_count = 1, |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 1041 | .agc = &stk7700p_7000p_mt2060_agc_config, |
| 1042 | .bw = &stk7700p_pll_config, |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 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 | }; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1048 | |
| 1049 | static int stk7700p_frontend_attach(struct dvb_usb_adapter *adap) |
| 1050 | { |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 1051 | struct dib0700_state *st = adap->dev->priv; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1052 | /* 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] | 1053 | |
| 1054 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 1055 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(50); |
| 1056 | |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 1057 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10); |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 1058 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 1059 | |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1060 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10); |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 1061 | dib0700_ctrl_clock(adap->dev, 72, 1); |
| 1062 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(100); |
| 1063 | |
| 1064 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1065 | |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 1066 | st->mt2060_if1[0] = 1220; |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 1067 | |
| 1068 | if (dib7000pc_detection(&adap->dev->i2c_adap)) { |
| 1069 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000p_config); |
| 1070 | st->is_dib7000pc = 1; |
| 1071 | } else |
| 1072 | adap->fe = dvb_attach(dib7000m_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000m_config); |
| 1073 | |
| 1074 | return adap->fe == NULL ? -ENODEV : 0; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1075 | } |
| 1076 | |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 1077 | static struct mt2060_config stk7700p_mt2060_config = { |
| 1078 | 0x60 |
| 1079 | }; |
| 1080 | |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1081 | static int stk7700p_tuner_attach(struct dvb_usb_adapter *adap) |
| 1082 | { |
Olivier DANET | c52344f | 2008-01-25 06:50:07 -0300 | [diff] [blame] | 1083 | struct i2c_adapter *prim_i2c = &adap->dev->i2c_adap; |
Patrick Boettcher | 69ea31e | 2006-10-17 18:28:14 -0300 | [diff] [blame] | 1084 | struct dib0700_state *st = adap->dev->priv; |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 1085 | struct i2c_adapter *tun_i2c; |
Olivier DANET | c52344f | 2008-01-25 06:50:07 -0300 | [diff] [blame] | 1086 | s8 a; |
| 1087 | int if1=1220; |
Al Viro | da5ee48 | 2008-05-21 00:31:21 -0300 | [diff] [blame] | 1088 | if (adap->dev->udev->descriptor.idVendor == cpu_to_le16(USB_VID_HAUPPAUGE) && |
| 1089 | 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] | 1090 | if (!eeprom_read(prim_i2c,0x58,&a)) if1=1220+a; |
| 1091 | } |
Patrick Boettcher | a75763f | 2006-10-18 08:34:16 -0300 | [diff] [blame] | 1092 | if (st->is_dib7000pc) |
| 1093 | tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); |
| 1094 | else |
| 1095 | tun_i2c = dib7000m_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); |
| 1096 | |
| 1097 | return dvb_attach(mt2060_attach, adap->fe, tun_i2c, &stk7700p_mt2060_config, |
Olivier DANET | c52344f | 2008-01-25 06:50:07 -0300 | [diff] [blame] | 1098 | if1) == NULL ? -ENODEV : 0; |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1099 | } |
| 1100 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1101 | /* DIB7070 generic */ |
| 1102 | static struct dibx000_agc_config dib7070_agc_config = { |
| 1103 | BAND_UHF | BAND_VHF | BAND_LBAND | BAND_SBAND, |
| 1104 | /* 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, |
| 1105 | * 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 */ |
| 1106 | (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), // setup |
| 1107 | |
| 1108 | 600, // inv_gain |
| 1109 | 10, // time_stabiliz |
| 1110 | |
| 1111 | 0, // alpha_level |
| 1112 | 118, // thlock |
| 1113 | |
| 1114 | 0, // wbd_inv |
| 1115 | 3530, // wbd_ref |
| 1116 | 1, // wbd_sel |
| 1117 | 5, // wbd_alpha |
| 1118 | |
| 1119 | 65535, // agc1_max |
| 1120 | 0, // agc1_min |
| 1121 | |
| 1122 | 65535, // agc2_max |
| 1123 | 0, // agc2_min |
| 1124 | |
| 1125 | 0, // agc1_pt1 |
| 1126 | 40, // agc1_pt2 |
| 1127 | 183, // agc1_pt3 |
| 1128 | 206, // agc1_slope1 |
| 1129 | 255, // agc1_slope2 |
| 1130 | 72, // agc2_pt1 |
| 1131 | 152, // agc2_pt2 |
| 1132 | 88, // agc2_slope1 |
| 1133 | 90, // agc2_slope2 |
| 1134 | |
| 1135 | 17, // alpha_mant |
| 1136 | 27, // alpha_exp |
| 1137 | 23, // beta_mant |
| 1138 | 51, // beta_exp |
| 1139 | |
| 1140 | 0, // perform_agc_softsplit |
| 1141 | }; |
| 1142 | |
| 1143 | static int dib7070_tuner_reset(struct dvb_frontend *fe, int onoff) |
| 1144 | { |
Patrick Boettcher | 7e5ce65 | 2009-08-03 13:43:40 -0300 | [diff] [blame] | 1145 | deb_info("reset: %d", onoff); |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1146 | return dib7000p_set_gpio(fe, 8, 0, !onoff); |
| 1147 | } |
| 1148 | |
| 1149 | static int dib7070_tuner_sleep(struct dvb_frontend *fe, int onoff) |
| 1150 | { |
Patrick Boettcher | 7e5ce65 | 2009-08-03 13:43:40 -0300 | [diff] [blame] | 1151 | deb_info("sleep: %d", onoff); |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1152 | return dib7000p_set_gpio(fe, 9, 0, onoff); |
| 1153 | } |
| 1154 | |
| 1155 | static struct dib0070_config dib7070p_dib0070_config[2] = { |
| 1156 | { |
| 1157 | .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS, |
| 1158 | .reset = dib7070_tuner_reset, |
| 1159 | .sleep = dib7070_tuner_sleep, |
| 1160 | .clock_khz = 12000, |
Patrick Boettcher | 7e5ce65 | 2009-08-03 13:43:40 -0300 | [diff] [blame] | 1161 | .clock_pad_drive = 4, |
| 1162 | .charge_pump = 2, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1163 | }, { |
| 1164 | .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS, |
| 1165 | .reset = dib7070_tuner_reset, |
| 1166 | .sleep = dib7070_tuner_sleep, |
| 1167 | .clock_khz = 12000, |
Patrick Boettcher | 7e5ce65 | 2009-08-03 13:43:40 -0300 | [diff] [blame] | 1168 | .charge_pump = 2, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1169 | } |
| 1170 | }; |
| 1171 | |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 1172 | static struct dib0070_config dib7770p_dib0070_config = { |
| 1173 | .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS, |
| 1174 | .reset = dib7070_tuner_reset, |
| 1175 | .sleep = dib7070_tuner_sleep, |
| 1176 | .clock_khz = 12000, |
| 1177 | .clock_pad_drive = 0, |
| 1178 | .flip_chip = 1, |
Olivier Grenie | eac1fe1 | 2009-09-23 13:41:27 -0300 | [diff] [blame] | 1179 | .charge_pump = 2, |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 1180 | }; |
| 1181 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1182 | static int dib7070_set_param_override(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep) |
| 1183 | { |
| 1184 | struct dvb_usb_adapter *adap = fe->dvb->priv; |
| 1185 | struct dib0700_adapter_state *state = adap->priv; |
| 1186 | |
| 1187 | u16 offset; |
| 1188 | u8 band = BAND_OF_FREQUENCY(fep->frequency/1000); |
| 1189 | switch (band) { |
| 1190 | case BAND_VHF: offset = 950; break; |
| 1191 | case BAND_UHF: |
| 1192 | default: offset = 550; break; |
| 1193 | } |
| 1194 | deb_info("WBD for DiB7000P: %d\n", offset + dib0070_wbd_offset(fe)); |
| 1195 | dib7000p_set_wbd_ref(fe, offset + dib0070_wbd_offset(fe)); |
| 1196 | return state->set_param_save(fe, fep); |
| 1197 | } |
| 1198 | |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 1199 | static int dib7770_set_param_override(struct dvb_frontend *fe, |
| 1200 | struct dvb_frontend_parameters *fep) |
| 1201 | { |
| 1202 | struct dvb_usb_adapter *adap = fe->dvb->priv; |
| 1203 | struct dib0700_adapter_state *state = adap->priv; |
| 1204 | |
| 1205 | u16 offset; |
| 1206 | u8 band = BAND_OF_FREQUENCY(fep->frequency/1000); |
| 1207 | switch (band) { |
| 1208 | case BAND_VHF: |
| 1209 | dib7000p_set_gpio(fe, 0, 0, 1); |
| 1210 | offset = 850; |
| 1211 | break; |
| 1212 | case BAND_UHF: |
| 1213 | default: |
| 1214 | dib7000p_set_gpio(fe, 0, 0, 0); |
| 1215 | offset = 250; |
| 1216 | break; |
| 1217 | } |
| 1218 | deb_info("WBD for DiB7000P: %d\n", offset + dib0070_wbd_offset(fe)); |
| 1219 | dib7000p_set_wbd_ref(fe, offset + dib0070_wbd_offset(fe)); |
| 1220 | return state->set_param_save(fe, fep); |
| 1221 | } |
| 1222 | |
| 1223 | static int dib7770p_tuner_attach(struct dvb_usb_adapter *adap) |
| 1224 | { |
| 1225 | struct dib0700_adapter_state *st = adap->priv; |
| 1226 | struct i2c_adapter *tun_i2c = dib7000p_get_i2c_master(adap->fe, |
| 1227 | DIBX000_I2C_INTERFACE_TUNER, 1); |
| 1228 | |
| 1229 | if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, |
| 1230 | &dib7770p_dib0070_config) == NULL) |
| 1231 | return -ENODEV; |
| 1232 | |
| 1233 | st->set_param_save = adap->fe->ops.tuner_ops.set_params; |
| 1234 | adap->fe->ops.tuner_ops.set_params = dib7770_set_param_override; |
| 1235 | return 0; |
| 1236 | } |
| 1237 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1238 | static int dib7070p_tuner_attach(struct dvb_usb_adapter *adap) |
| 1239 | { |
| 1240 | struct dib0700_adapter_state *st = adap->priv; |
| 1241 | struct i2c_adapter *tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); |
| 1242 | |
| 1243 | if (adap->id == 0) { |
| 1244 | if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, &dib7070p_dib0070_config[0]) == NULL) |
| 1245 | return -ENODEV; |
| 1246 | } else { |
| 1247 | if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, &dib7070p_dib0070_config[1]) == NULL) |
| 1248 | return -ENODEV; |
| 1249 | } |
| 1250 | |
| 1251 | st->set_param_save = adap->fe->ops.tuner_ops.set_params; |
| 1252 | adap->fe->ops.tuner_ops.set_params = dib7070_set_param_override; |
| 1253 | return 0; |
| 1254 | } |
| 1255 | |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 1256 | static int stk70x0p_pid_filter(struct dvb_usb_adapter *adapter, int index, u16 pid, int onoff) |
| 1257 | { |
| 1258 | return dib7000p_pid_filter(adapter->fe, index, pid, onoff); |
| 1259 | } |
| 1260 | |
| 1261 | static int stk70x0p_pid_filter_ctrl(struct dvb_usb_adapter *adapter, int onoff) |
| 1262 | { |
| 1263 | return dib7000p_pid_filter_ctrl(adapter->fe, onoff); |
| 1264 | } |
| 1265 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1266 | static struct dibx000_bandwidth_config dib7070_bw_config_12_mhz = { |
| 1267 | 60000, 15000, // internal, sampling |
| 1268 | 1, 20, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass |
| 1269 | 0, 0, 1, 1, 2, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo |
| 1270 | (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k |
| 1271 | (0 << 25) | 0, // ifreq = 0.000000 MHz |
| 1272 | 20452225, // timf |
| 1273 | 12000000, // xtal_hz |
| 1274 | }; |
| 1275 | |
| 1276 | static struct dib7000p_config dib7070p_dib7000p_config = { |
| 1277 | .output_mpeg2_in_188_bytes = 1, |
| 1278 | |
| 1279 | .agc_config_count = 1, |
| 1280 | .agc = &dib7070_agc_config, |
| 1281 | .bw = &dib7070_bw_config_12_mhz, |
Patrick Boettcher | 3cb2c39 | 2008-01-25 07:25:20 -0300 | [diff] [blame] | 1282 | .tuner_is_baseband = 1, |
| 1283 | .spur_protect = 1, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1284 | |
| 1285 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
| 1286 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, |
| 1287 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
| 1288 | |
| 1289 | .hostbus_diversity = 1, |
| 1290 | }; |
| 1291 | |
| 1292 | /* STK7070P */ |
| 1293 | static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap) |
| 1294 | { |
Al Viro | da5ee48 | 2008-05-21 00:31:21 -0300 | [diff] [blame] | 1295 | struct usb_device_descriptor *p = &adap->dev->udev->descriptor; |
| 1296 | if (p->idVendor == cpu_to_le16(USB_VID_PINNACLE) && |
| 1297 | p->idProduct == cpu_to_le16(USB_PID_PINNACLE_PCTV72E)) |
| 1298 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 1299 | else |
Al Viro | da5ee48 | 2008-05-21 00:31:21 -0300 | [diff] [blame] | 1300 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1301 | msleep(10); |
| 1302 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 1303 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 1304 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 1305 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 1306 | |
| 1307 | dib0700_ctrl_clock(adap->dev, 72, 1); |
| 1308 | |
| 1309 | msleep(10); |
| 1310 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 1311 | msleep(10); |
| 1312 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 1313 | |
Devin Heitmueller | 83c4fdf | 2009-01-21 01:55:45 -0300 | [diff] [blame] | 1314 | if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, |
| 1315 | &dib7070p_dib7000p_config) != 0) { |
| 1316 | err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", |
| 1317 | __func__); |
| 1318 | return -ENODEV; |
| 1319 | } |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1320 | |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 1321 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, |
| 1322 | &dib7070p_dib7000p_config); |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1323 | return adap->fe == NULL ? -ENODEV : 0; |
| 1324 | } |
| 1325 | |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 1326 | /* DIB807x generic */ |
| 1327 | static struct dibx000_agc_config dib807x_agc_config[2] = { |
| 1328 | { |
| 1329 | BAND_VHF, |
| 1330 | /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, |
| 1331 | * P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0, |
| 1332 | * P_agc_inv_pwm2=0,P_agc_inh_dc_rv_est=0, |
| 1333 | * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, |
| 1334 | * P_agc_write=0 */ |
| 1335 | (0 << 15) | (0 << 14) | (7 << 11) | (0 << 10) | (0 << 9) | |
| 1336 | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | |
| 1337 | (0 << 0), /* setup*/ |
| 1338 | |
| 1339 | 600, /* inv_gain*/ |
| 1340 | 10, /* time_stabiliz*/ |
| 1341 | |
| 1342 | 0, /* alpha_level*/ |
| 1343 | 118, /* thlock*/ |
| 1344 | |
| 1345 | 0, /* wbd_inv*/ |
| 1346 | 3530, /* wbd_ref*/ |
| 1347 | 1, /* wbd_sel*/ |
| 1348 | 5, /* wbd_alpha*/ |
| 1349 | |
| 1350 | 65535, /* agc1_max*/ |
| 1351 | 0, /* agc1_min*/ |
| 1352 | |
| 1353 | 65535, /* agc2_max*/ |
| 1354 | 0, /* agc2_min*/ |
| 1355 | |
| 1356 | 0, /* agc1_pt1*/ |
| 1357 | 40, /* agc1_pt2*/ |
| 1358 | 183, /* agc1_pt3*/ |
| 1359 | 206, /* agc1_slope1*/ |
| 1360 | 255, /* agc1_slope2*/ |
| 1361 | 72, /* agc2_pt1*/ |
| 1362 | 152, /* agc2_pt2*/ |
| 1363 | 88, /* agc2_slope1*/ |
| 1364 | 90, /* agc2_slope2*/ |
| 1365 | |
| 1366 | 17, /* alpha_mant*/ |
| 1367 | 27, /* alpha_exp*/ |
| 1368 | 23, /* beta_mant*/ |
| 1369 | 51, /* beta_exp*/ |
| 1370 | |
| 1371 | 0, /* perform_agc_softsplit*/ |
| 1372 | }, { |
| 1373 | BAND_UHF, |
| 1374 | /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, |
| 1375 | * P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0, |
| 1376 | * P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0, |
| 1377 | * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, |
| 1378 | * P_agc_write=0 */ |
| 1379 | (0 << 15) | (0 << 14) | (1 << 11) | (0 << 10) | (0 << 9) | |
| 1380 | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | |
| 1381 | (0 << 0), /* setup */ |
| 1382 | |
| 1383 | 600, /* inv_gain*/ |
| 1384 | 10, /* time_stabiliz*/ |
| 1385 | |
| 1386 | 0, /* alpha_level*/ |
| 1387 | 118, /* thlock*/ |
| 1388 | |
| 1389 | 0, /* wbd_inv*/ |
| 1390 | 3530, /* wbd_ref*/ |
| 1391 | 1, /* wbd_sel*/ |
| 1392 | 5, /* wbd_alpha*/ |
| 1393 | |
| 1394 | 65535, /* agc1_max*/ |
| 1395 | 0, /* agc1_min*/ |
| 1396 | |
| 1397 | 65535, /* agc2_max*/ |
| 1398 | 0, /* agc2_min*/ |
| 1399 | |
| 1400 | 0, /* agc1_pt1*/ |
| 1401 | 40, /* agc1_pt2*/ |
| 1402 | 183, /* agc1_pt3*/ |
| 1403 | 206, /* agc1_slope1*/ |
| 1404 | 255, /* agc1_slope2*/ |
| 1405 | 72, /* agc2_pt1*/ |
| 1406 | 152, /* agc2_pt2*/ |
| 1407 | 88, /* agc2_slope1*/ |
| 1408 | 90, /* agc2_slope2*/ |
| 1409 | |
| 1410 | 17, /* alpha_mant*/ |
| 1411 | 27, /* alpha_exp*/ |
| 1412 | 23, /* beta_mant*/ |
| 1413 | 51, /* beta_exp*/ |
| 1414 | |
| 1415 | 0, /* perform_agc_softsplit*/ |
| 1416 | } |
| 1417 | }; |
| 1418 | |
| 1419 | static struct dibx000_bandwidth_config dib807x_bw_config_12_mhz = { |
| 1420 | 60000, 15000, /* internal, sampling*/ |
| 1421 | 1, 20, 3, 1, 0, /* pll_cfg: prediv, ratio, range, reset, bypass*/ |
| 1422 | 0, 0, 1, 1, 2, /* misc: refdiv, bypclk_div, IO_CLK_en_core, |
| 1423 | ADClkSrc, modulo */ |
| 1424 | (3 << 14) | (1 << 12) | (599 << 0), /* sad_cfg: refsel, sel, freq_15k*/ |
| 1425 | (0 << 25) | 0, /* ifreq = 0.000000 MHz*/ |
| 1426 | 18179755, /* timf*/ |
| 1427 | 12000000, /* xtal_hz*/ |
| 1428 | }; |
| 1429 | |
| 1430 | static struct dib8000_config dib807x_dib8000_config[2] = { |
| 1431 | { |
| 1432 | .output_mpeg2_in_188_bytes = 1, |
| 1433 | |
| 1434 | .agc_config_count = 2, |
| 1435 | .agc = dib807x_agc_config, |
| 1436 | .pll = &dib807x_bw_config_12_mhz, |
| 1437 | .tuner_is_baseband = 1, |
| 1438 | |
| 1439 | .gpio_dir = DIB8000_GPIO_DEFAULT_DIRECTIONS, |
| 1440 | .gpio_val = DIB8000_GPIO_DEFAULT_VALUES, |
| 1441 | .gpio_pwm_pos = DIB8000_GPIO_DEFAULT_PWM_POS, |
| 1442 | |
| 1443 | .hostbus_diversity = 1, |
| 1444 | .div_cfg = 1, |
| 1445 | .agc_control = &dib0070_ctrl_agc_filter, |
| 1446 | .output_mode = OUTMODE_MPEG2_FIFO, |
| 1447 | .drives = 0x2d98, |
| 1448 | }, { |
| 1449 | .output_mpeg2_in_188_bytes = 1, |
| 1450 | |
| 1451 | .agc_config_count = 2, |
| 1452 | .agc = dib807x_agc_config, |
| 1453 | .pll = &dib807x_bw_config_12_mhz, |
| 1454 | .tuner_is_baseband = 1, |
| 1455 | |
| 1456 | .gpio_dir = DIB8000_GPIO_DEFAULT_DIRECTIONS, |
| 1457 | .gpio_val = DIB8000_GPIO_DEFAULT_VALUES, |
| 1458 | .gpio_pwm_pos = DIB8000_GPIO_DEFAULT_PWM_POS, |
| 1459 | |
| 1460 | .hostbus_diversity = 1, |
| 1461 | .agc_control = &dib0070_ctrl_agc_filter, |
| 1462 | .output_mode = OUTMODE_MPEG2_FIFO, |
| 1463 | .drives = 0x2d98, |
| 1464 | } |
| 1465 | }; |
| 1466 | |
| 1467 | static int dib807x_tuner_reset(struct dvb_frontend *fe, int onoff) |
| 1468 | { |
| 1469 | return dib8000_set_gpio(fe, 5, 0, !onoff); |
| 1470 | } |
| 1471 | |
| 1472 | static int dib807x_tuner_sleep(struct dvb_frontend *fe, int onoff) |
| 1473 | { |
| 1474 | return dib8000_set_gpio(fe, 0, 0, onoff); |
| 1475 | } |
| 1476 | |
| 1477 | static const struct dib0070_wbd_gain_cfg dib8070_wbd_gain_cfg[] = { |
| 1478 | { 240, 7}, |
| 1479 | { 0xffff, 6}, |
| 1480 | }; |
| 1481 | |
| 1482 | static struct dib0070_config dib807x_dib0070_config[2] = { |
| 1483 | { |
| 1484 | .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS, |
| 1485 | .reset = dib807x_tuner_reset, |
| 1486 | .sleep = dib807x_tuner_sleep, |
| 1487 | .clock_khz = 12000, |
| 1488 | .clock_pad_drive = 4, |
| 1489 | .vga_filter = 1, |
| 1490 | .force_crystal_mode = 1, |
| 1491 | .enable_third_order_filter = 1, |
| 1492 | .charge_pump = 0, |
| 1493 | .wbd_gain = dib8070_wbd_gain_cfg, |
| 1494 | .osc_buffer_state = 0, |
| 1495 | .freq_offset_khz_uhf = -100, |
| 1496 | .freq_offset_khz_vhf = -100, |
| 1497 | }, { |
| 1498 | .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS, |
| 1499 | .reset = dib807x_tuner_reset, |
| 1500 | .sleep = dib807x_tuner_sleep, |
| 1501 | .clock_khz = 12000, |
| 1502 | .clock_pad_drive = 2, |
| 1503 | .vga_filter = 1, |
| 1504 | .force_crystal_mode = 1, |
| 1505 | .enable_third_order_filter = 1, |
| 1506 | .charge_pump = 0, |
| 1507 | .wbd_gain = dib8070_wbd_gain_cfg, |
| 1508 | .osc_buffer_state = 0, |
| 1509 | .freq_offset_khz_uhf = -25, |
| 1510 | .freq_offset_khz_vhf = -25, |
| 1511 | } |
| 1512 | }; |
| 1513 | |
| 1514 | static int dib807x_set_param_override(struct dvb_frontend *fe, |
| 1515 | struct dvb_frontend_parameters *fep) |
| 1516 | { |
| 1517 | struct dvb_usb_adapter *adap = fe->dvb->priv; |
| 1518 | struct dib0700_adapter_state *state = adap->priv; |
| 1519 | |
| 1520 | u16 offset = dib0070_wbd_offset(fe); |
| 1521 | u8 band = BAND_OF_FREQUENCY(fep->frequency/1000); |
| 1522 | switch (band) { |
| 1523 | case BAND_VHF: |
| 1524 | offset += 750; |
| 1525 | break; |
| 1526 | case BAND_UHF: /* fall-thru wanted */ |
| 1527 | default: |
| 1528 | offset += 250; break; |
| 1529 | } |
| 1530 | deb_info("WBD for DiB8000: %d\n", offset); |
| 1531 | dib8000_set_wbd_ref(fe, offset); |
| 1532 | |
| 1533 | return state->set_param_save(fe, fep); |
| 1534 | } |
| 1535 | |
| 1536 | static int dib807x_tuner_attach(struct dvb_usb_adapter *adap) |
| 1537 | { |
| 1538 | struct dib0700_adapter_state *st = adap->priv; |
| 1539 | struct i2c_adapter *tun_i2c = dib8000_get_i2c_master(adap->fe, |
| 1540 | DIBX000_I2C_INTERFACE_TUNER, 1); |
| 1541 | |
| 1542 | if (adap->id == 0) { |
| 1543 | if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, |
| 1544 | &dib807x_dib0070_config[0]) == NULL) |
| 1545 | return -ENODEV; |
| 1546 | } else { |
| 1547 | if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, |
| 1548 | &dib807x_dib0070_config[1]) == NULL) |
| 1549 | return -ENODEV; |
| 1550 | } |
| 1551 | |
| 1552 | st->set_param_save = adap->fe->ops.tuner_ops.set_params; |
| 1553 | adap->fe->ops.tuner_ops.set_params = dib807x_set_param_override; |
| 1554 | return 0; |
| 1555 | } |
| 1556 | |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 1557 | static int stk807x_pid_filter(struct dvb_usb_adapter *adapter, int index, u16 pid, int onoff) |
| 1558 | { |
| 1559 | return dib8000_pid_filter(adapter->fe, index, pid, onoff); |
| 1560 | } |
| 1561 | |
| 1562 | static int stk807x_pid_filter_ctrl(struct dvb_usb_adapter *adapter, int onoff) |
| 1563 | { |
| 1564 | return dib8000_pid_filter_ctrl(adapter->fe, onoff); |
| 1565 | } |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 1566 | |
| 1567 | /* STK807x */ |
| 1568 | static int stk807x_frontend_attach(struct dvb_usb_adapter *adap) |
| 1569 | { |
| 1570 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 1571 | msleep(10); |
| 1572 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 1573 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 1574 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 1575 | |
| 1576 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 1577 | |
| 1578 | dib0700_ctrl_clock(adap->dev, 72, 1); |
| 1579 | |
| 1580 | msleep(10); |
| 1581 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 1582 | msleep(10); |
| 1583 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 1584 | |
| 1585 | dib8000_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, |
| 1586 | 0x80); |
| 1587 | |
| 1588 | adap->fe = dvb_attach(dib8000_attach, &adap->dev->i2c_adap, 0x80, |
| 1589 | &dib807x_dib8000_config[0]); |
| 1590 | |
| 1591 | return adap->fe == NULL ? -ENODEV : 0; |
| 1592 | } |
| 1593 | |
| 1594 | /* STK807xPVR */ |
| 1595 | static int stk807xpvr_frontend_attach0(struct dvb_usb_adapter *adap) |
| 1596 | { |
| 1597 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); |
| 1598 | msleep(30); |
| 1599 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 1600 | msleep(500); |
| 1601 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 1602 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 1603 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 1604 | |
| 1605 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 1606 | |
| 1607 | dib0700_ctrl_clock(adap->dev, 72, 1); |
| 1608 | |
| 1609 | msleep(10); |
| 1610 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 1611 | msleep(10); |
| 1612 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 1613 | |
| 1614 | /* initialize IC 0 */ |
| 1615 | dib8000_i2c_enumeration(&adap->dev->i2c_adap, 1, 0x12, 0x80); |
| 1616 | |
| 1617 | adap->fe = dvb_attach(dib8000_attach, &adap->dev->i2c_adap, 0x80, |
| 1618 | &dib807x_dib8000_config[0]); |
| 1619 | |
| 1620 | return adap->fe == NULL ? -ENODEV : 0; |
| 1621 | } |
| 1622 | |
| 1623 | static int stk807xpvr_frontend_attach1(struct dvb_usb_adapter *adap) |
| 1624 | { |
| 1625 | /* initialize IC 1 */ |
| 1626 | dib8000_i2c_enumeration(&adap->dev->i2c_adap, 1, 0x22, 0x82); |
| 1627 | |
| 1628 | adap->fe = dvb_attach(dib8000_attach, &adap->dev->i2c_adap, 0x82, |
| 1629 | &dib807x_dib8000_config[1]); |
| 1630 | |
| 1631 | return adap->fe == NULL ? -ENODEV : 0; |
| 1632 | } |
| 1633 | |
| 1634 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1635 | /* STK7070PD */ |
| 1636 | static struct dib7000p_config stk7070pd_dib7000p_config[2] = { |
| 1637 | { |
| 1638 | .output_mpeg2_in_188_bytes = 1, |
| 1639 | |
| 1640 | .agc_config_count = 1, |
| 1641 | .agc = &dib7070_agc_config, |
| 1642 | .bw = &dib7070_bw_config_12_mhz, |
Patrick Boettcher | 3cb2c39 | 2008-01-25 07:25:20 -0300 | [diff] [blame] | 1643 | .tuner_is_baseband = 1, |
| 1644 | .spur_protect = 1, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1645 | |
| 1646 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
| 1647 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, |
| 1648 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
| 1649 | |
| 1650 | .hostbus_diversity = 1, |
| 1651 | }, { |
| 1652 | .output_mpeg2_in_188_bytes = 1, |
| 1653 | |
| 1654 | .agc_config_count = 1, |
| 1655 | .agc = &dib7070_agc_config, |
| 1656 | .bw = &dib7070_bw_config_12_mhz, |
Patrick Boettcher | 3cb2c39 | 2008-01-25 07:25:20 -0300 | [diff] [blame] | 1657 | .tuner_is_baseband = 1, |
| 1658 | .spur_protect = 1, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1659 | |
| 1660 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
| 1661 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, |
| 1662 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
| 1663 | |
| 1664 | .hostbus_diversity = 1, |
| 1665 | } |
| 1666 | }; |
| 1667 | |
| 1668 | static int stk7070pd_frontend_attach0(struct dvb_usb_adapter *adap) |
| 1669 | { |
| 1670 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 1671 | msleep(10); |
| 1672 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 1673 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 1674 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 1675 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 1676 | |
| 1677 | dib0700_ctrl_clock(adap->dev, 72, 1); |
| 1678 | |
| 1679 | msleep(10); |
| 1680 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 1681 | msleep(10); |
| 1682 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 1683 | |
Devin Heitmueller | 83c4fdf | 2009-01-21 01:55:45 -0300 | [diff] [blame] | 1684 | if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 2, 18, |
| 1685 | stk7070pd_dib7000p_config) != 0) { |
| 1686 | err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", |
| 1687 | __func__); |
| 1688 | return -ENODEV; |
| 1689 | } |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1690 | |
| 1691 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, &stk7070pd_dib7000p_config[0]); |
| 1692 | return adap->fe == NULL ? -ENODEV : 0; |
| 1693 | } |
| 1694 | |
| 1695 | static int stk7070pd_frontend_attach1(struct dvb_usb_adapter *adap) |
| 1696 | { |
| 1697 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x82, &stk7070pd_dib7000p_config[1]); |
| 1698 | return adap->fe == NULL ? -ENODEV : 0; |
| 1699 | } |
| 1700 | |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 1701 | /* S5H1411 */ |
| 1702 | static struct s5h1411_config pinnacle_801e_config = { |
| 1703 | .output_mode = S5H1411_PARALLEL_OUTPUT, |
| 1704 | .gpio = S5H1411_GPIO_OFF, |
| 1705 | .mpeg_timing = S5H1411_MPEGTIMING_NONCONTINOUS_NONINVERTING_CLOCK, |
| 1706 | .qam_if = S5H1411_IF_44000, |
| 1707 | .vsb_if = S5H1411_IF_44000, |
| 1708 | .inversion = S5H1411_INVERSION_OFF, |
| 1709 | .status_mode = S5H1411_DEMODLOCKING |
| 1710 | }; |
| 1711 | |
| 1712 | /* Pinnacle PCTV HD Pro 801e GPIOs map: |
| 1713 | GPIO0 - currently unknown |
| 1714 | GPIO1 - xc5000 tuner reset |
| 1715 | GPIO2 - CX25843 sleep |
| 1716 | GPIO3 - currently unknown |
| 1717 | GPIO4 - currently unknown |
| 1718 | GPIO6 - currently unknown |
| 1719 | GPIO7 - currently unknown |
| 1720 | GPIO9 - currently unknown |
| 1721 | GPIO10 - CX25843 reset |
| 1722 | */ |
| 1723 | static int s5h1411_frontend_attach(struct dvb_usb_adapter *adap) |
| 1724 | { |
| 1725 | struct dib0700_state *st = adap->dev->priv; |
| 1726 | |
| 1727 | /* Make use of the new i2c functions from FW 1.20 */ |
| 1728 | st->fw_use_new_i2c_api = 1; |
| 1729 | |
| 1730 | /* The s5h1411 requires the dib0700 to not be in master mode */ |
| 1731 | st->disable_streaming_master_mode = 1; |
| 1732 | |
| 1733 | /* All msleep values taken from Windows USB trace */ |
| 1734 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 0); |
| 1735 | dib0700_set_gpio(adap->dev, GPIO3, GPIO_OUT, 0); |
| 1736 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 1737 | msleep(400); |
| 1738 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 1739 | msleep(60); |
| 1740 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 1741 | msleep(30); |
| 1742 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
| 1743 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
| 1744 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); |
| 1745 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); |
| 1746 | dib0700_set_gpio(adap->dev, GPIO2, GPIO_OUT, 0); |
| 1747 | msleep(30); |
| 1748 | |
| 1749 | /* Put the CX25843 to sleep for now since we're in digital mode */ |
| 1750 | dib0700_set_gpio(adap->dev, GPIO2, GPIO_OUT, 1); |
| 1751 | |
| 1752 | /* GPIOs are initialized, do the attach */ |
| 1753 | adap->fe = dvb_attach(s5h1411_attach, &pinnacle_801e_config, |
| 1754 | &adap->dev->i2c_adap); |
| 1755 | return adap->fe == NULL ? -ENODEV : 0; |
| 1756 | } |
| 1757 | |
Michael Krufky | 767f3b3 | 2008-09-25 09:47:07 -0300 | [diff] [blame] | 1758 | static int dib0700_xc5000_tuner_callback(void *priv, int component, |
| 1759 | int command, int arg) |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 1760 | { |
| 1761 | struct dvb_usb_adapter *adap = priv; |
| 1762 | |
Devin Heitmueller | 79025a9 | 2008-10-06 12:07:48 -0300 | [diff] [blame] | 1763 | if (command == XC5000_TUNER_RESET) { |
| 1764 | /* Reset the tuner */ |
| 1765 | dib0700_set_gpio(adap->dev, GPIO1, GPIO_OUT, 0); |
Devin Heitmueller | f0f4633 | 2009-05-04 21:57:41 -0300 | [diff] [blame] | 1766 | msleep(10); |
Devin Heitmueller | 79025a9 | 2008-10-06 12:07:48 -0300 | [diff] [blame] | 1767 | dib0700_set_gpio(adap->dev, GPIO1, GPIO_OUT, 1); |
Devin Heitmueller | f0f4633 | 2009-05-04 21:57:41 -0300 | [diff] [blame] | 1768 | msleep(10); |
Devin Heitmueller | 79025a9 | 2008-10-06 12:07:48 -0300 | [diff] [blame] | 1769 | } else { |
| 1770 | err("xc5000: unknown tuner callback command: %d\n", command); |
| 1771 | return -EINVAL; |
| 1772 | } |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 1773 | |
| 1774 | return 0; |
| 1775 | } |
| 1776 | |
| 1777 | static struct xc5000_config s5h1411_xc5000_tunerconfig = { |
| 1778 | .i2c_address = 0x64, |
| 1779 | .if_khz = 5380, |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 1780 | }; |
| 1781 | |
| 1782 | static int xc5000_tuner_attach(struct dvb_usb_adapter *adap) |
| 1783 | { |
Devin Heitmueller | 79025a9 | 2008-10-06 12:07:48 -0300 | [diff] [blame] | 1784 | /* FIXME: generalize & move to common area */ |
| 1785 | adap->fe->callback = dib0700_xc5000_tuner_callback; |
| 1786 | |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 1787 | return dvb_attach(xc5000_attach, adap->fe, &adap->dev->i2c_adap, |
Michael Krufky | 767f3b3 | 2008-09-25 09:47:07 -0300 | [diff] [blame] | 1788 | &s5h1411_xc5000_tunerconfig) |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 1789 | == NULL ? -ENODEV : 0; |
| 1790 | } |
| 1791 | |
Michael Krufky | ce904bc | 2009-01-19 01:12:55 -0300 | [diff] [blame] | 1792 | static struct lgdt3305_config hcw_lgdt3305_config = { |
| 1793 | .i2c_addr = 0x0e, |
| 1794 | .mpeg_mode = LGDT3305_MPEG_PARALLEL, |
| 1795 | .tpclk_edge = LGDT3305_TPCLK_FALLING_EDGE, |
| 1796 | .tpvalid_polarity = LGDT3305_TP_VALID_LOW, |
| 1797 | .deny_i2c_rptr = 0, |
| 1798 | .spectral_inversion = 1, |
| 1799 | .qam_if_khz = 6000, |
| 1800 | .vsb_if_khz = 6000, |
| 1801 | .usref_8vsb = 0x0500, |
| 1802 | }; |
| 1803 | |
| 1804 | static struct mxl5007t_config hcw_mxl5007t_config = { |
| 1805 | .xtal_freq_hz = MxL_XTAL_25_MHZ, |
| 1806 | .if_freq_hz = MxL_IF_6_MHZ, |
| 1807 | .invert_if = 1, |
| 1808 | }; |
| 1809 | |
| 1810 | /* TIGER-ATSC map: |
| 1811 | GPIO0 - LNA_CTR (H: LNA power enabled, L: LNA power disabled) |
| 1812 | GPIO1 - ANT_SEL (H: VPA, L: MCX) |
| 1813 | GPIO4 - SCL2 |
| 1814 | GPIO6 - EN_TUNER |
| 1815 | GPIO7 - SDA2 |
| 1816 | GPIO10 - DEM_RST |
| 1817 | |
| 1818 | MXL is behind LG's i2c repeater. LG is on SCL2/SDA2 gpios on the DIB |
| 1819 | */ |
| 1820 | static int lgdt3305_frontend_attach(struct dvb_usb_adapter *adap) |
| 1821 | { |
| 1822 | struct dib0700_state *st = adap->dev->priv; |
| 1823 | |
| 1824 | /* Make use of the new i2c functions from FW 1.20 */ |
| 1825 | st->fw_use_new_i2c_api = 1; |
| 1826 | |
| 1827 | st->disable_streaming_master_mode = 1; |
| 1828 | |
| 1829 | /* fe power enable */ |
| 1830 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); |
| 1831 | msleep(30); |
| 1832 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
| 1833 | msleep(30); |
| 1834 | |
| 1835 | /* demod reset */ |
| 1836 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 1837 | msleep(30); |
| 1838 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); |
| 1839 | msleep(30); |
| 1840 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
| 1841 | msleep(30); |
| 1842 | |
| 1843 | adap->fe = dvb_attach(lgdt3305_attach, |
| 1844 | &hcw_lgdt3305_config, |
| 1845 | &adap->dev->i2c_adap); |
| 1846 | |
| 1847 | return adap->fe == NULL ? -ENODEV : 0; |
| 1848 | } |
| 1849 | |
| 1850 | static int mxl5007t_tuner_attach(struct dvb_usb_adapter *adap) |
| 1851 | { |
| 1852 | return dvb_attach(mxl5007t_attach, adap->fe, |
| 1853 | &adap->dev->i2c_adap, 0x60, |
| 1854 | &hcw_mxl5007t_config) == NULL ? -ENODEV : 0; |
| 1855 | } |
| 1856 | |
| 1857 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1858 | /* DVB-USB and USB stuff follows */ |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1859 | struct usb_device_id dib0700_usb_id_table[] = { |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1860 | /* 0 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P) }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 1861 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P_PC) }, |
| 1862 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500) }, |
| 1863 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500_2) }, |
| 1864 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK) }, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1865 | /* 5 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR) }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 1866 | { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500) }, |
| 1867 | { USB_DEVICE(USB_VID_UNIWILL, USB_PID_UNIWILL_STK7700P) }, |
| 1868 | { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_STK7700P) }, |
| 1869 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_2) }, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1870 | /* 10 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR_2) }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 1871 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV2000E) }, |
| 1872 | { USB_DEVICE(USB_VID_TERRATEC, |
| 1873 | USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY) }, |
| 1874 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_TD_STICK) }, |
| 1875 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700D) }, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 1876 | /* 15 */{ USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070P) }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 1877 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV_DVB_T_FLASH) }, |
| 1878 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070PD) }, |
| 1879 | { USB_DEVICE(USB_VID_PINNACLE, |
| 1880 | USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T) }, |
| 1881 | { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500_PC) }, |
Joachim Steiger | fa3b877 | 2007-10-08 20:08:46 -0300 | [diff] [blame] | 1882 | /* 20 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_EXPRESS) }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 1883 | { USB_DEVICE(USB_VID_GIGABYTE, USB_PID_GIGABYTE_U7000) }, |
| 1884 | { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14BR) }, |
| 1885 | { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3000) }, |
| 1886 | { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3100) }, |
| 1887 | /* 25 */{ USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_3) }, |
| 1888 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_MYTV_T) }, |
| 1889 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_HT_USB_XE) }, |
| 1890 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_EXPRESSCARD_320CX) }, |
| 1891 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV72E) }, |
| 1892 | /* 30 */{ USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV73E) }, |
| 1893 | { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_EC372S) }, |
| 1894 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_HT_EXPRESS) }, |
Alexander Simon | dc88807 | 2008-03-29 21:37:54 -0300 | [diff] [blame] | 1895 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_XXS) }, |
Darryl Green | 5da4e2c | 2008-03-29 21:47:43 -0300 | [diff] [blame] | 1896 | { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_STK7700P_2) }, |
Michael Krufky | af2a887 | 2008-09-03 17:12:24 -0300 | [diff] [blame] | 1897 | /* 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] | 1898 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500_3) }, |
Finn Thain | 17a370b | 2008-09-06 13:42:47 -0300 | [diff] [blame] | 1899 | { USB_DEVICE(USB_VID_GIGABYTE, USB_PID_GIGABYTE_U8000) }, |
Daniel Oliveira Nascimento | 8751aaa | 2008-09-07 12:39:44 -0300 | [diff] [blame] | 1900 | { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_STK7700PH) }, |
Albert Comerma | 5769743 | 2008-09-07 12:43:33 -0300 | [diff] [blame] | 1901 | { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3000H) }, |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 1902 | /* 40 */{ USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV801E) }, |
Devin Heitmueller | d2fc3bf | 2008-09-25 06:22:23 -0300 | [diff] [blame] | 1903 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV801E_SE) }, |
Yusuf Altin | bb1b082 | 2009-01-08 07:58:45 -0300 | [diff] [blame] | 1904 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_EXPRESS) }, |
Nicolas Fournier | db4b2d1 | 2009-01-13 07:15:25 -0300 | [diff] [blame] | 1905 | { USB_DEVICE(USB_VID_TERRATEC, |
| 1906 | USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY_2) }, |
sebastian.blanes@gmail.com | 0a6e1ed | 2009-02-24 14:51:43 -0300 | [diff] [blame] | 1907 | { USB_DEVICE(USB_VID_SONY, USB_PID_SONY_PLAYTV) }, |
Pascal Terjan | 9abb6e6 | 2009-02-26 10:31:41 -0300 | [diff] [blame] | 1908 | /* 45 */{ USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_PD378S) }, |
Michael Krufky | ce904bc | 2009-01-19 01:12:55 -0300 | [diff] [blame] | 1909 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_TIGER_ATSC) }, |
| 1910 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_TIGER_ATSC_B210) }, |
Xoan Loureiro | 16ba1ee | 2009-03-29 08:43:36 -0300 | [diff] [blame] | 1911 | { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_MC770) }, |
Klaus Flittner | 919a548 | 2009-03-29 09:12:06 -0300 | [diff] [blame] | 1912 | { USB_DEVICE(USB_VID_ELGATO, USB_PID_ELGATO_EYETV_DTT) }, |
Armin Schenker | 513846e | 2009-04-20 11:57:49 -0300 | [diff] [blame] | 1913 | /* 50 */{ USB_DEVICE(USB_VID_ELGATO, USB_PID_ELGATO_EYETV_DTT_Dlx) }, |
tomas petr | f0f4ae7 | 2009-05-20 05:28:05 -0300 | [diff] [blame] | 1914 | { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_H) }, |
Patrick Boettcher | a9b8fe3 | 2009-05-20 05:35:02 -0300 | [diff] [blame] | 1915 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_T3) }, |
| 1916 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_T5) }, |
Pete Hildebrandt | c53d83c | 2009-08-05 11:46:38 -0300 | [diff] [blame] | 1917 | { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_STK7700D) }, |
Olivier Grenie | 74b76f2 | 2009-09-02 08:19:19 -0300 | [diff] [blame] | 1918 | /* 55 */{ USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_STK7700D_2) }, |
| 1919 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV73A) }, |
| 1920 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV73ESE) }, |
| 1921 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV282E) }, |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 1922 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7770P) }, |
Patrick Boettcher | db48138 | 2009-09-15 07:16:51 -0300 | [diff] [blame] | 1923 | /* 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] | 1924 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK807XPVR) }, |
| 1925 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK807XP) }, |
Mauro Carvalho Chehab | aaeab30 | 2009-09-16 09:18:26 -0300 | [diff] [blame] | 1926 | { USB_DEVICE(USB_VID_PIXELVIEW, USB_PID_PIXELVIEW_SBTVD) }, |
S?rgio Fortier | 8a378e8 | 2009-09-28 04:19:21 -0300 | [diff] [blame] | 1927 | { USB_DEVICE(USB_VID_EVOLUTEPC, USB_PID_TVWAY_PLUS) }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 1928 | { 0 } /* Terminating entry */ |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1929 | }; |
| 1930 | MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table); |
| 1931 | |
| 1932 | #define DIB0700_DEFAULT_DEVICE_PROPERTIES \ |
| 1933 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, \ |
| 1934 | .usb_ctrl = DEVICE_SPECIFIC, \ |
Devin Heitmueller | bdc203e | 2008-09-06 13:45:27 -0300 | [diff] [blame] | 1935 | .firmware = "dvb-usb-dib0700-1.20.fw", \ |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1936 | .download_firmware = dib0700_download_firmware, \ |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 1937 | .no_reconnect = 1, \ |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1938 | .size_of_priv = sizeof(struct dib0700_state), \ |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 1939 | .i2c_algo = &dib0700_i2c_algo, \ |
| 1940 | .identify_state = dib0700_identify_state |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1941 | |
| 1942 | #define DIB0700_DEFAULT_STREAMING_CONFIG(ep) \ |
| 1943 | .streaming_ctrl = dib0700_streaming_ctrl, \ |
| 1944 | .stream = { \ |
| 1945 | .type = USB_BULK, \ |
| 1946 | .count = 4, \ |
| 1947 | .endpoint = ep, \ |
| 1948 | .u = { \ |
| 1949 | .bulk = { \ |
| 1950 | .buffersize = 39480, \ |
| 1951 | } \ |
| 1952 | } \ |
| 1953 | } |
| 1954 | |
| 1955 | struct dvb_usb_device_properties dib0700_devices[] = { |
| 1956 | { |
| 1957 | DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 1958 | |
| 1959 | .num_adapters = 1, |
| 1960 | .adapter = { |
| 1961 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 1962 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 1963 | .pid_filter_count = 32, |
| 1964 | .pid_filter = stk70x0p_pid_filter, |
| 1965 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1966 | .frontend_attach = stk7700p_frontend_attach, |
| 1967 | .tuner_attach = stk7700p_tuner_attach, |
| 1968 | |
| 1969 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 1970 | }, |
| 1971 | }, |
| 1972 | |
dominik | 67053a4 | 2007-11-10 19:23:31 -0300 | [diff] [blame] | 1973 | .num_device_descs = 8, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1974 | .devices = { |
| 1975 | { "DiBcom STK7700P reference design", |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 1976 | { &dib0700_usb_id_table[0], &dib0700_usb_id_table[1] }, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1977 | { NULL }, |
| 1978 | }, |
| 1979 | { "Hauppauge Nova-T Stick", |
Stefan Traby | f9aeba4 | 2006-11-12 13:02:51 -0300 | [diff] [blame] | 1980 | { &dib0700_usb_id_table[4], &dib0700_usb_id_table[9], NULL }, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 1981 | { NULL }, |
| 1982 | }, |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 1983 | { "AVerMedia AVerTV DVB-T Volar", |
Jose Carlos Garcia Sogo | ced8fec | 2006-11-14 05:01:47 -0300 | [diff] [blame] | 1984 | { &dib0700_usb_id_table[5], &dib0700_usb_id_table[10] }, |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 1985 | { NULL }, |
| 1986 | }, |
| 1987 | { "Compro Videomate U500", |
Patrick Boettcher | 1f8ca4b | 2007-07-30 14:24:37 -0300 | [diff] [blame] | 1988 | { &dib0700_usb_id_table[6], &dib0700_usb_id_table[19] }, |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 1989 | { NULL }, |
Henning Schroeer | 0ce215e | 2006-10-19 07:58:22 -0300 | [diff] [blame] | 1990 | }, |
| 1991 | { "Uniwill STK7700P based (Hama and others)", |
| 1992 | { &dib0700_usb_id_table[7], NULL }, |
| 1993 | { NULL }, |
Michael Krufky | 8637a87 | 2006-11-08 16:47:32 -0300 | [diff] [blame] | 1994 | }, |
| 1995 | { "Leadtek Winfast DTV Dongle (STK7700P based)", |
Patrick Boettcher | 1e13c8f | 2009-09-19 05:24:40 -0300 | [diff] [blame] | 1996 | { &dib0700_usb_id_table[8], &dib0700_usb_id_table[34] }, |
Michael Krufky | 8637a87 | 2006-11-08 16:47:32 -0300 | [diff] [blame] | 1997 | { NULL }, |
Joachim Steiger | fa3b877 | 2007-10-08 20:08:46 -0300 | [diff] [blame] | 1998 | }, |
| 1999 | { "AVerMedia AVerTV DVB-T Express", |
| 2000 | { &dib0700_usb_id_table[20] }, |
| 2001 | { NULL }, |
dominik | 67053a4 | 2007-11-10 19:23:31 -0300 | [diff] [blame] | 2002 | }, |
dominik | 67053a4 | 2007-11-10 19:23:31 -0300 | [diff] [blame] | 2003 | { "Gigabyte U7000", |
| 2004 | { &dib0700_usb_id_table[21], NULL }, |
| 2005 | { NULL }, |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 2006 | } |
Darren Salt | b1139e3 | 2007-08-18 18:05:31 -0300 | [diff] [blame] | 2007 | }, |
| 2008 | |
| 2009 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 2010 | .rc_key_map = dib0700_rc_keys, |
| 2011 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
| 2012 | .rc_query = dib0700_rc_query |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 2013 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2014 | |
| 2015 | .num_adapters = 2, |
| 2016 | .adapter = { |
| 2017 | { |
| 2018 | .frontend_attach = bristol_frontend_attach, |
| 2019 | .tuner_attach = bristol_tuner_attach, |
| 2020 | |
| 2021 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2022 | }, { |
| 2023 | .frontend_attach = bristol_frontend_attach, |
| 2024 | .tuner_attach = bristol_tuner_attach, |
| 2025 | |
| 2026 | DIB0700_DEFAULT_STREAMING_CONFIG(0x03), |
| 2027 | } |
| 2028 | }, |
| 2029 | |
| 2030 | .num_device_descs = 1, |
| 2031 | .devices = { |
| 2032 | { "Hauppauge Nova-T 500 Dual DVB-T", |
Tomi Koivulahti | 49a1376 | 2006-10-19 07:27:19 -0300 | [diff] [blame] | 2033 | { &dib0700_usb_id_table[2], &dib0700_usb_id_table[3], NULL }, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 2034 | { NULL }, |
| 2035 | }, |
Janne Grunau | 82f3d55 | 2007-07-30 13:50:28 -0300 | [diff] [blame] | 2036 | }, |
| 2037 | |
| 2038 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 2039 | .rc_key_map = dib0700_rc_keys, |
Patrick Boettcher | 8779737 | 2007-07-30 17:02:17 -0300 | [diff] [blame] | 2040 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
Janne Grunau | 82f3d55 | 2007-07-30 13:50:28 -0300 | [diff] [blame] | 2041 | .rc_query = dib0700_rc_query |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 2042 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2043 | |
| 2044 | .num_adapters = 2, |
| 2045 | .adapter = { |
| 2046 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2047 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2048 | .pid_filter_count = 32, |
| 2049 | .pid_filter = stk70x0p_pid_filter, |
| 2050 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 2051 | .frontend_attach = stk7700d_frontend_attach, |
| 2052 | .tuner_attach = stk7700d_tuner_attach, |
| 2053 | |
| 2054 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2055 | }, { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2056 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2057 | .pid_filter_count = 32, |
| 2058 | .pid_filter = stk70x0p_pid_filter, |
| 2059 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 2060 | .frontend_attach = stk7700d_frontend_attach, |
| 2061 | .tuner_attach = stk7700d_tuner_attach, |
| 2062 | |
| 2063 | DIB0700_DEFAULT_STREAMING_CONFIG(0x03), |
| 2064 | } |
| 2065 | }, |
| 2066 | |
James A Webb | 200e861 | 2009-08-04 02:38:05 -0300 | [diff] [blame] | 2067 | .num_device_descs = 5, |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 2068 | .devices = { |
| 2069 | { "Pinnacle PCTV 2000e", |
| 2070 | { &dib0700_usb_id_table[11], NULL }, |
| 2071 | { NULL }, |
| 2072 | }, |
| 2073 | { "Terratec Cinergy DT XS Diversity", |
| 2074 | { &dib0700_usb_id_table[12], NULL }, |
| 2075 | { NULL }, |
| 2076 | }, |
Darren Salt | faebb91 | 2007-08-18 18:04:00 -0300 | [diff] [blame] | 2077 | { "Hauppauge Nova-TD Stick/Elgato Eye-TV Diversity", |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 2078 | { &dib0700_usb_id_table[13], NULL }, |
| 2079 | { NULL }, |
| 2080 | }, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2081 | { "DiBcom STK7700D reference design", |
Patrick Boettcher | b6884a1 | 2007-07-27 10:08:51 -0300 | [diff] [blame] | 2082 | { &dib0700_usb_id_table[14], NULL }, |
| 2083 | { NULL }, |
Yusuf Altin | bb1b082 | 2009-01-08 07:58:45 -0300 | [diff] [blame] | 2084 | }, |
James A Webb | 200e861 | 2009-08-04 02:38:05 -0300 | [diff] [blame] | 2085 | { "YUAN High-Tech DiBcom STK7700D", |
| 2086 | { &dib0700_usb_id_table[55], NULL }, |
| 2087 | { NULL }, |
| 2088 | }, |
Yusuf Altin | bb1b082 | 2009-01-08 07:58:45 -0300 | [diff] [blame] | 2089 | |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 2090 | }, |
Janne Grunau | 82f3d55 | 2007-07-30 13:50:28 -0300 | [diff] [blame] | 2091 | |
Olivier DANET | 54d75eb | 2007-07-25 14:42:54 -0300 | [diff] [blame] | 2092 | .rc_interval = DEFAULT_RC_INTERVAL, |
Janne Grunau | 82f3d55 | 2007-07-30 13:50:28 -0300 | [diff] [blame] | 2093 | .rc_key_map = dib0700_rc_keys, |
Patrick Boettcher | 8779737 | 2007-07-30 17:02:17 -0300 | [diff] [blame] | 2094 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
Janne Grunau | 82f3d55 | 2007-07-30 13:50:28 -0300 | [diff] [blame] | 2095 | .rc_query = dib0700_rc_query |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2096 | |
| 2097 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2098 | |
| 2099 | .num_adapters = 1, |
| 2100 | .adapter = { |
| 2101 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2102 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2103 | .pid_filter_count = 32, |
| 2104 | .pid_filter = stk70x0p_pid_filter, |
| 2105 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Daniel Gimpelevich | 132c318 | 2008-01-25 06:02:42 -0300 | [diff] [blame] | 2106 | .frontend_attach = stk7700P2_frontend_attach, |
| 2107 | .tuner_attach = stk7700d_tuner_attach, |
| 2108 | |
| 2109 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2110 | }, |
| 2111 | }, |
| 2112 | |
Yusuf Altin | bb1b082 | 2009-01-08 07:58:45 -0300 | [diff] [blame] | 2113 | .num_device_descs = 3, |
Daniel Gimpelevich | 132c318 | 2008-01-25 06:02:42 -0300 | [diff] [blame] | 2114 | .devices = { |
| 2115 | { "ASUS My Cinema U3000 Mini DVBT Tuner", |
| 2116 | { &dib0700_usb_id_table[23], NULL }, |
| 2117 | { NULL }, |
| 2118 | }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 2119 | { "Yuan EC372S", |
| 2120 | { &dib0700_usb_id_table[31], NULL }, |
| 2121 | { NULL }, |
Yusuf Altin | bb1b082 | 2009-01-08 07:58:45 -0300 | [diff] [blame] | 2122 | }, |
| 2123 | { "Terratec Cinergy T Express", |
| 2124 | { &dib0700_usb_id_table[42], NULL }, |
| 2125 | { NULL }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 2126 | } |
Chris Rankin | 48aa739 | 2008-09-25 06:52:24 -0300 | [diff] [blame] | 2127 | }, |
| 2128 | |
| 2129 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 2130 | .rc_key_map = dib0700_rc_keys, |
| 2131 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
| 2132 | .rc_query = dib0700_rc_query |
Daniel Gimpelevich | 132c318 | 2008-01-25 06:02:42 -0300 | [diff] [blame] | 2133 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2134 | |
| 2135 | .num_adapters = 1, |
| 2136 | .adapter = { |
| 2137 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2138 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2139 | .pid_filter_count = 32, |
| 2140 | .pid_filter = stk70x0p_pid_filter, |
| 2141 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2142 | .frontend_attach = stk7070p_frontend_attach, |
| 2143 | .tuner_attach = dib7070p_tuner_attach, |
| 2144 | |
| 2145 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2146 | |
| 2147 | .size_of_priv = sizeof(struct dib0700_adapter_state), |
| 2148 | }, |
| 2149 | }, |
| 2150 | |
Patrick Boettcher | 1e13c8f | 2009-09-19 05:24:40 -0300 | [diff] [blame] | 2151 | .num_device_descs = 11, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2152 | .devices = { |
| 2153 | { "DiBcom STK7070P reference design", |
| 2154 | { &dib0700_usb_id_table[15], NULL }, |
| 2155 | { NULL }, |
| 2156 | }, |
| 2157 | { "Pinnacle PCTV DVB-T Flash Stick", |
| 2158 | { &dib0700_usb_id_table[16], NULL }, |
| 2159 | { NULL }, |
| 2160 | }, |
Yousef Lamlum | 7999a81 | 2008-01-25 05:51:48 -0300 | [diff] [blame] | 2161 | { "Artec T14BR DVB-T", |
| 2162 | { &dib0700_usb_id_table[22], NULL }, |
| 2163 | { NULL }, |
Daniel Gimpelevich | 132c318 | 2008-01-25 06:02:42 -0300 | [diff] [blame] | 2164 | }, |
| 2165 | { "ASUS My Cinema U3100 Mini DVBT Tuner", |
| 2166 | { &dib0700_usb_id_table[24], NULL }, |
| 2167 | { NULL }, |
| 2168 | }, |
Tim Taubert | c7637b1 | 2008-01-25 06:16:36 -0300 | [diff] [blame] | 2169 | { "Hauppauge Nova-T Stick", |
| 2170 | { &dib0700_usb_id_table[25], NULL }, |
| 2171 | { NULL }, |
| 2172 | }, |
Darren Salt | 13b83b5 | 2008-01-25 06:20:02 -0300 | [diff] [blame] | 2173 | { "Hauppauge Nova-T MyTV.t", |
| 2174 | { &dib0700_usb_id_table[26], NULL }, |
| 2175 | { NULL }, |
| 2176 | }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 2177 | { "Pinnacle PCTV 72e", |
| 2178 | { &dib0700_usb_id_table[29], NULL }, |
| 2179 | { NULL }, |
| 2180 | }, |
| 2181 | { "Pinnacle PCTV 73e", |
| 2182 | { &dib0700_usb_id_table[30], NULL }, |
| 2183 | { NULL }, |
| 2184 | }, |
Klaus Flittner | 919a548 | 2009-03-29 09:12:06 -0300 | [diff] [blame] | 2185 | { "Elgato EyeTV DTT", |
| 2186 | { &dib0700_usb_id_table[49], NULL }, |
| 2187 | { NULL }, |
| 2188 | }, |
Pascal Terjan | 9abb6e6 | 2009-02-26 10:31:41 -0300 | [diff] [blame] | 2189 | { "Yuan PD378S", |
| 2190 | { &dib0700_usb_id_table[45], NULL }, |
| 2191 | { NULL }, |
| 2192 | }, |
Armin Schenker | 513846e | 2009-04-20 11:57:49 -0300 | [diff] [blame] | 2193 | { "Elgato EyeTV Dtt Dlx PD378S", |
| 2194 | { &dib0700_usb_id_table[50], NULL }, |
| 2195 | { NULL }, |
| 2196 | }, |
Tim Taubert | c7637b1 | 2008-01-25 06:16:36 -0300 | [diff] [blame] | 2197 | }, |
| 2198 | |
| 2199 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 2200 | .rc_key_map = dib0700_rc_keys, |
| 2201 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
| 2202 | .rc_query = dib0700_rc_query |
| 2203 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2204 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2205 | |
Olivier Grenie | 74b76f2 | 2009-09-02 08:19:19 -0300 | [diff] [blame] | 2206 | .num_adapters = 1, |
| 2207 | .adapter = { |
| 2208 | { |
Mauro Carvalho Chehab | 648732f | 2009-11-04 12:11:43 -0200 | [diff] [blame^] | 2209 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2210 | .pid_filter_count = 32, |
| 2211 | .pid_filter = stk70x0p_pid_filter, |
| 2212 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Olivier Grenie | 74b76f2 | 2009-09-02 08:19:19 -0300 | [diff] [blame] | 2213 | .frontend_attach = stk7070p_frontend_attach, |
| 2214 | .tuner_attach = dib7070p_tuner_attach, |
| 2215 | |
| 2216 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2217 | |
| 2218 | .size_of_priv = sizeof(struct dib0700_adapter_state), |
| 2219 | }, |
| 2220 | }, |
| 2221 | |
| 2222 | .num_device_descs = 3, |
| 2223 | .devices = { |
| 2224 | { "Pinnacle PCTV 73A", |
| 2225 | { &dib0700_usb_id_table[56], NULL }, |
| 2226 | { NULL }, |
| 2227 | }, |
| 2228 | { "Pinnacle PCTV 73e SE", |
| 2229 | { &dib0700_usb_id_table[57], NULL }, |
| 2230 | { NULL }, |
| 2231 | }, |
| 2232 | { "Pinnacle PCTV 282e", |
| 2233 | { &dib0700_usb_id_table[58], NULL }, |
| 2234 | { NULL }, |
| 2235 | }, |
| 2236 | }, |
| 2237 | |
| 2238 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 2239 | .rc_key_map = dib0700_rc_keys, |
| 2240 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
| 2241 | .rc_query = dib0700_rc_query |
| 2242 | |
| 2243 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2244 | |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2245 | .num_adapters = 2, |
| 2246 | .adapter = { |
| 2247 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2248 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2249 | .pid_filter_count = 32, |
| 2250 | .pid_filter = stk70x0p_pid_filter, |
| 2251 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2252 | .frontend_attach = stk7070pd_frontend_attach0, |
| 2253 | .tuner_attach = dib7070p_tuner_attach, |
| 2254 | |
| 2255 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2256 | |
| 2257 | .size_of_priv = sizeof(struct dib0700_adapter_state), |
| 2258 | }, { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2259 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2260 | .pid_filter_count = 32, |
| 2261 | .pid_filter = stk70x0p_pid_filter, |
| 2262 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2263 | .frontend_attach = stk7070pd_frontend_attach1, |
| 2264 | .tuner_attach = dib7070p_tuner_attach, |
| 2265 | |
| 2266 | DIB0700_DEFAULT_STREAMING_CONFIG(0x03), |
| 2267 | |
| 2268 | .size_of_priv = sizeof(struct dib0700_adapter_state), |
| 2269 | } |
| 2270 | }, |
| 2271 | |
sebastian.blanes@gmail.com | 0a6e1ed | 2009-02-24 14:51:43 -0300 | [diff] [blame] | 2272 | .num_device_descs = 6, |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2273 | .devices = { |
| 2274 | { "DiBcom STK7070PD reference design", |
| 2275 | { &dib0700_usb_id_table[17], NULL }, |
| 2276 | { NULL }, |
| 2277 | }, |
| 2278 | { "Pinnacle PCTV Dual DVB-T Diversity Stick", |
| 2279 | { &dib0700_usb_id_table[18], NULL }, |
| 2280 | { NULL }, |
Michael Krufky | d01eb2d | 2008-07-03 23:43:36 -0300 | [diff] [blame] | 2281 | }, |
| 2282 | { "Hauppauge Nova-TD Stick (52009)", |
| 2283 | { &dib0700_usb_id_table[35], NULL }, |
| 2284 | { NULL }, |
Michael Krufky | 9a0c04a | 2008-09-03 17:12:24 -0300 | [diff] [blame] | 2285 | }, |
| 2286 | { "Hauppauge Nova-TD-500 (84xxx)", |
| 2287 | { &dib0700_usb_id_table[36], NULL }, |
| 2288 | { NULL }, |
Nicolas Fournier | db4b2d1 | 2009-01-13 07:15:25 -0300 | [diff] [blame] | 2289 | }, |
Patrick Boettcher | a9b8fe3 | 2009-05-20 05:35:02 -0300 | [diff] [blame] | 2290 | { "Terratec Cinergy DT USB XS Diversity/ T5", |
| 2291 | { &dib0700_usb_id_table[43], |
| 2292 | &dib0700_usb_id_table[53], NULL}, |
Nicolas Fournier | db4b2d1 | 2009-01-13 07:15:25 -0300 | [diff] [blame] | 2293 | { NULL }, |
sebastian.blanes@gmail.com | 0a6e1ed | 2009-02-24 14:51:43 -0300 | [diff] [blame] | 2294 | }, |
| 2295 | { "Sony PlayTV", |
| 2296 | { &dib0700_usb_id_table[44], NULL }, |
| 2297 | { NULL }, |
dominik | 67053a4 | 2007-11-10 19:23:31 -0300 | [diff] [blame] | 2298 | } |
Arne Luehrs | c985a8d | 2009-01-21 01:37:20 -0300 | [diff] [blame] | 2299 | }, |
| 2300 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 2301 | .rc_key_map = dib0700_rc_keys, |
| 2302 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
| 2303 | .rc_query = dib0700_rc_query |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 2304 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2305 | |
| 2306 | .num_adapters = 1, |
| 2307 | .adapter = { |
| 2308 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2309 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2310 | .pid_filter_count = 32, |
| 2311 | .pid_filter = stk70x0p_pid_filter, |
| 2312 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 2313 | .frontend_attach = stk7700ph_frontend_attach, |
| 2314 | .tuner_attach = stk7700ph_tuner_attach, |
| 2315 | |
| 2316 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2317 | |
| 2318 | .size_of_priv = sizeof(struct |
| 2319 | dib0700_adapter_state), |
| 2320 | }, |
| 2321 | }, |
| 2322 | |
Pete Hildebrandt | c53d83c | 2009-08-05 11:46:38 -0300 | [diff] [blame] | 2323 | .num_device_descs = 9, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 2324 | .devices = { |
| 2325 | { "Terratec Cinergy HT USB XE", |
| 2326 | { &dib0700_usb_id_table[27], NULL }, |
| 2327 | { NULL }, |
| 2328 | }, |
| 2329 | { "Pinnacle Expresscard 320cx", |
| 2330 | { &dib0700_usb_id_table[28], NULL }, |
| 2331 | { NULL }, |
| 2332 | }, |
| 2333 | { "Terratec Cinergy HT Express", |
| 2334 | { &dib0700_usb_id_table[32], NULL }, |
| 2335 | { NULL }, |
| 2336 | }, |
Finn Thain | 17a370b | 2008-09-06 13:42:47 -0300 | [diff] [blame] | 2337 | { "Gigabyte U8000-RH", |
| 2338 | { &dib0700_usb_id_table[37], NULL }, |
| 2339 | { NULL }, |
| 2340 | }, |
Daniel Oliveira Nascimento | 8751aaa | 2008-09-07 12:39:44 -0300 | [diff] [blame] | 2341 | { "YUAN High-Tech STK7700PH", |
| 2342 | { &dib0700_usb_id_table[38], NULL }, |
| 2343 | { NULL }, |
| 2344 | }, |
Albert Comerma | 5769743 | 2008-09-07 12:43:33 -0300 | [diff] [blame] | 2345 | { "Asus My Cinema-U3000Hybrid", |
| 2346 | { &dib0700_usb_id_table[39], NULL }, |
| 2347 | { NULL }, |
| 2348 | }, |
Xoan Loureiro | 16ba1ee | 2009-03-29 08:43:36 -0300 | [diff] [blame] | 2349 | { "YUAN High-Tech MC770", |
| 2350 | { &dib0700_usb_id_table[48], NULL }, |
| 2351 | { NULL }, |
| 2352 | }, |
tomas petr | f0f4ae7 | 2009-05-20 05:28:05 -0300 | [diff] [blame] | 2353 | { "Leadtek WinFast DTV Dongle H", |
| 2354 | { &dib0700_usb_id_table[51], NULL }, |
| 2355 | { NULL }, |
| 2356 | }, |
Pete Hildebrandt | c53d83c | 2009-08-05 11:46:38 -0300 | [diff] [blame] | 2357 | { "YUAN High-Tech STK7700D", |
| 2358 | { &dib0700_usb_id_table[54], NULL }, |
| 2359 | { NULL }, |
| 2360 | }, |
Albert Comerma | 6ca8f0b | 2008-03-29 21:35:57 -0300 | [diff] [blame] | 2361 | }, |
| 2362 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 2363 | .rc_key_map = dib0700_rc_keys, |
| 2364 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
| 2365 | .rc_query = dib0700_rc_query |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 2366 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2367 | .num_adapters = 1, |
| 2368 | .adapter = { |
| 2369 | { |
| 2370 | .frontend_attach = s5h1411_frontend_attach, |
| 2371 | .tuner_attach = xc5000_tuner_attach, |
| 2372 | |
| 2373 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2374 | |
| 2375 | .size_of_priv = sizeof(struct |
| 2376 | dib0700_adapter_state), |
| 2377 | }, |
| 2378 | }, |
| 2379 | |
Devin Heitmueller | d2fc3bf | 2008-09-25 06:22:23 -0300 | [diff] [blame] | 2380 | .num_device_descs = 2, |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 2381 | .devices = { |
| 2382 | { "Pinnacle PCTV HD Pro USB Stick", |
| 2383 | { &dib0700_usb_id_table[40], NULL }, |
| 2384 | { NULL }, |
| 2385 | }, |
Devin Heitmueller | d2fc3bf | 2008-09-25 06:22:23 -0300 | [diff] [blame] | 2386 | { "Pinnacle PCTV HD USB Stick", |
| 2387 | { &dib0700_usb_id_table[41], NULL }, |
| 2388 | { NULL }, |
| 2389 | }, |
Devin Heitmueller | cb22cb5 | 2008-09-08 05:42:42 -0300 | [diff] [blame] | 2390 | }, |
| 2391 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 2392 | .rc_key_map = dib0700_rc_keys, |
| 2393 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
| 2394 | .rc_query = dib0700_rc_query |
Michael Krufky | ce904bc | 2009-01-19 01:12:55 -0300 | [diff] [blame] | 2395 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2396 | .num_adapters = 1, |
| 2397 | .adapter = { |
| 2398 | { |
| 2399 | .frontend_attach = lgdt3305_frontend_attach, |
| 2400 | .tuner_attach = mxl5007t_tuner_attach, |
| 2401 | |
| 2402 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2403 | |
| 2404 | .size_of_priv = sizeof(struct |
| 2405 | dib0700_adapter_state), |
| 2406 | }, |
| 2407 | }, |
| 2408 | |
| 2409 | .num_device_descs = 2, |
| 2410 | .devices = { |
| 2411 | { "Hauppauge ATSC MiniCard (B200)", |
| 2412 | { &dib0700_usb_id_table[46], NULL }, |
| 2413 | { NULL }, |
| 2414 | }, |
| 2415 | { "Hauppauge ATSC MiniCard (B210)", |
| 2416 | { &dib0700_usb_id_table[47], NULL }, |
| 2417 | { NULL }, |
| 2418 | }, |
| 2419 | }, |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 2420 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2421 | |
| 2422 | .num_adapters = 1, |
| 2423 | .adapter = { |
| 2424 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2425 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2426 | .pid_filter_count = 32, |
| 2427 | .pid_filter = stk70x0p_pid_filter, |
| 2428 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 2429 | .frontend_attach = stk7070p_frontend_attach, |
| 2430 | .tuner_attach = dib7770p_tuner_attach, |
| 2431 | |
| 2432 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2433 | |
| 2434 | .size_of_priv = |
Patrick Boettcher | db48138 | 2009-09-15 07:16:51 -0300 | [diff] [blame] | 2435 | sizeof(struct dib0700_adapter_state), |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 2436 | }, |
| 2437 | }, |
| 2438 | |
Patrick Boettcher | db48138 | 2009-09-15 07:16:51 -0300 | [diff] [blame] | 2439 | .num_device_descs = 2, |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 2440 | .devices = { |
| 2441 | { "DiBcom STK7770P reference design", |
| 2442 | { &dib0700_usb_id_table[59], NULL }, |
| 2443 | { NULL }, |
| 2444 | }, |
Patrick Boettcher | 1e13c8f | 2009-09-19 05:24:40 -0300 | [diff] [blame] | 2445 | { "Terratec Cinergy T USB XXS (HD)/ T3", |
| 2446 | { &dib0700_usb_id_table[33], |
| 2447 | &dib0700_usb_id_table[52], |
| 2448 | &dib0700_usb_id_table[60], NULL}, |
Patrick Boettcher | db48138 | 2009-09-15 07:16:51 -0300 | [diff] [blame] | 2449 | { NULL }, |
| 2450 | }, |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 2451 | }, |
Olivier Grenie | d300bd6 | 2009-09-15 06:55:35 -0300 | [diff] [blame] | 2452 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 2453 | .rc_key_map = dib0700_rc_keys, |
| 2454 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
| 2455 | .rc_query = dib0700_rc_query |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 2456 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2457 | .num_adapters = 1, |
| 2458 | .adapter = { |
| 2459 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2460 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2461 | .pid_filter_count = 32, |
| 2462 | .pid_filter = stk807x_pid_filter, |
| 2463 | .pid_filter_ctrl = stk807x_pid_filter_ctrl, |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 2464 | .frontend_attach = stk807x_frontend_attach, |
| 2465 | .tuner_attach = dib807x_tuner_attach, |
| 2466 | |
| 2467 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2468 | |
| 2469 | .size_of_priv = |
| 2470 | sizeof(struct dib0700_adapter_state), |
| 2471 | }, |
| 2472 | }, |
| 2473 | |
S?rgio Fortier | 8a378e8 | 2009-09-28 04:19:21 -0300 | [diff] [blame] | 2474 | .num_device_descs = 3, |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 2475 | .devices = { |
| 2476 | { "DiBcom STK807xP reference design", |
| 2477 | { &dib0700_usb_id_table[62], NULL }, |
| 2478 | { NULL }, |
| 2479 | }, |
Mauro Carvalho Chehab | aaeab30 | 2009-09-16 09:18:26 -0300 | [diff] [blame] | 2480 | { "Prolink Pixelview SBTVD", |
| 2481 | { &dib0700_usb_id_table[63], NULL }, |
| 2482 | { NULL }, |
| 2483 | }, |
S?rgio Fortier | 8a378e8 | 2009-09-28 04:19:21 -0300 | [diff] [blame] | 2484 | { "EvolutePC TVWay+", |
| 2485 | { &dib0700_usb_id_table[64], NULL }, |
| 2486 | { NULL }, |
| 2487 | }, |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 2488 | }, |
| 2489 | |
| 2490 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 2491 | .rc_key_map = dib0700_rc_keys, |
| 2492 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
| 2493 | .rc_query = dib0700_rc_query |
| 2494 | |
| 2495 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
| 2496 | .num_adapters = 2, |
| 2497 | .adapter = { |
| 2498 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2499 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2500 | .pid_filter_count = 32, |
| 2501 | .pid_filter = stk807x_pid_filter, |
| 2502 | .pid_filter_ctrl = stk807x_pid_filter_ctrl, |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 2503 | .frontend_attach = stk807xpvr_frontend_attach0, |
| 2504 | .tuner_attach = dib807x_tuner_attach, |
| 2505 | |
| 2506 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), |
| 2507 | |
| 2508 | .size_of_priv = |
| 2509 | sizeof(struct dib0700_adapter_state), |
| 2510 | }, |
| 2511 | { |
Olivier Grenie | f8731f4 | 2009-09-18 04:08:43 -0300 | [diff] [blame] | 2512 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, |
| 2513 | .pid_filter_count = 32, |
| 2514 | .pid_filter = stk807x_pid_filter, |
| 2515 | .pid_filter_ctrl = stk807x_pid_filter_ctrl, |
Patrick Boettcher | ba3fe3a | 2009-09-16 09:51:30 -0300 | [diff] [blame] | 2516 | .frontend_attach = stk807xpvr_frontend_attach1, |
| 2517 | .tuner_attach = dib807x_tuner_attach, |
| 2518 | |
| 2519 | DIB0700_DEFAULT_STREAMING_CONFIG(0x03), |
| 2520 | |
| 2521 | .size_of_priv = |
| 2522 | sizeof(struct dib0700_adapter_state), |
| 2523 | }, |
| 2524 | }, |
| 2525 | |
| 2526 | .num_device_descs = 1, |
| 2527 | .devices = { |
| 2528 | { "DiBcom STK807xPVR reference design", |
| 2529 | { &dib0700_usb_id_table[61], NULL }, |
| 2530 | { NULL }, |
| 2531 | }, |
| 2532 | }, |
| 2533 | |
| 2534 | .rc_interval = DEFAULT_RC_INTERVAL, |
| 2535 | .rc_key_map = dib0700_rc_keys, |
| 2536 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
| 2537 | .rc_query = dib0700_rc_query |
Patrick Boettcher | 01373a5 | 2007-07-30 12:49:04 -0300 | [diff] [blame] | 2538 | }, |
Patrick Boettcher | b7f5491 | 2006-09-19 12:51:37 -0300 | [diff] [blame] | 2539 | }; |
| 2540 | |
| 2541 | int dib0700_device_count = ARRAY_SIZE(dib0700_devices); |