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