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