Commit | Line | Data |
---|---|---|
b7f54910 PB |
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 | * | |
b6884a17 | 7 | * Copyright (C) 2005-7 DiBcom, SA |
b7f54910 PB |
8 | */ |
9 | #include "dib0700.h" | |
10 | ||
11 | #include "dib3000mc.h" | |
91bb9be6 | 12 | #include "dib7000m.h" |
a75763ff | 13 | #include "dib7000p.h" |
b7f54910 | 14 | #include "mt2060.h" |
54d75eba | 15 | #include "mt2266.h" |
6ca8f0b9 | 16 | #include "tuner-xc2028.h" |
01373a5c | 17 | #include "dib0070.h" |
b7f54910 | 18 | |
7fb3fc0c PB |
19 | static int force_lna_activation; |
20 | module_param(force_lna_activation, int, 0644); | |
21 | MODULE_PARM_DESC(force_lna_activation, "force the activation of Low-Noise-Amplifyer(s) (LNA), " | |
22 | "if applicable for the device (default: 0=automatic/off)."); | |
23 | ||
01373a5c PB |
24 | struct dib0700_adapter_state { |
25 | int (*set_param_save) (struct dvb_frontend *, struct dvb_frontend_parameters *); | |
26 | }; | |
27 | ||
28 | /* Hauppauge Nova-T 500 (aka Bristol) | |
b7f54910 PB |
29 | * has a LNA on GPIO0 which is enabled by setting 1 */ |
30 | static struct mt2060_config bristol_mt2060_config[2] = { | |
31 | { | |
32 | .i2c_address = 0x60, | |
303cbeaa | 33 | .clock_out = 3, |
b7f54910 PB |
34 | }, { |
35 | .i2c_address = 0x61, | |
36 | } | |
37 | }; | |
38 | ||
39 | static struct dibx000_agc_config bristol_dib3000p_mt2060_agc_config = { | |
40 | .band_caps = BAND_VHF | BAND_UHF, | |
01b4bf31 | 41 | .setup = (1 << 8) | (5 << 5) | (0 << 4) | (0 << 3) | (0 << 2) | (2 << 0), |
b7f54910 | 42 | |
6958effe PB |
43 | .agc1_max = 42598, |
44 | .agc1_min = 17694, | |
45 | .agc2_max = 45875, | |
46 | .agc2_min = 0, | |
b7f54910 | 47 | |
6958effe PB |
48 | .agc1_pt1 = 0, |
49 | .agc1_pt2 = 59, | |
b7f54910 | 50 | |
6958effe PB |
51 | .agc1_slope1 = 0, |
52 | .agc1_slope2 = 69, | |
b7f54910 PB |
53 | |
54 | .agc2_pt1 = 0, | |
6958effe | 55 | .agc2_pt2 = 59, |
b7f54910 | 56 | |
6958effe PB |
57 | .agc2_slope1 = 111, |
58 | .agc2_slope2 = 28, | |
b7f54910 PB |
59 | }; |
60 | ||
61 | static struct dib3000mc_config bristol_dib3000mc_config[2] = { | |
62 | { .agc = &bristol_dib3000p_mt2060_agc_config, | |
63 | .max_time = 0x196, | |
64 | .ln_adc_level = 0x1cc7, | |
65 | .output_mpeg2_in_188_bytes = 1, | |
66 | }, | |
67 | { .agc = &bristol_dib3000p_mt2060_agc_config, | |
68 | .max_time = 0x196, | |
69 | .ln_adc_level = 0x1cc7, | |
70 | .output_mpeg2_in_188_bytes = 1, | |
71 | } | |
72 | }; | |
73 | ||
74 | static int bristol_frontend_attach(struct dvb_usb_adapter *adap) | |
75 | { | |
6958effe | 76 | struct dib0700_state *st = adap->dev->priv; |
b7f54910 PB |
77 | if (adap->id == 0) { |
78 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(10); | |
79 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10); | |
80 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10); | |
81 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(10); | |
82 | ||
7fb3fc0c PB |
83 | if (force_lna_activation) |
84 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); | |
85 | else | |
86 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 0); | |
6958effe | 87 | |
b7f54910 PB |
88 | if (dib3000mc_i2c_enumeration(&adap->dev->i2c_adap, 2, DEFAULT_DIB3000P_I2C_ADDRESS, bristol_dib3000mc_config) != 0) { |
89 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(10); | |
90 | return -ENODEV; | |
91 | } | |
92 | } | |
6958effe PB |
93 | st->mt2060_if1[adap->id] = 1220; |
94 | return (adap->fe = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap, | |
95 | (10 + adap->id) << 1, &bristol_dib3000mc_config[adap->id])) == NULL ? -ENODEV : 0; | |
b7f54910 PB |
96 | } |
97 | ||
4a2b1083 | 98 | static int eeprom_read(struct i2c_adapter *adap,u8 adrs,u8 *pval) |
c52344fd OD |
99 | { |
100 | struct i2c_msg msg[2] = { | |
101 | { .addr = 0x50, .flags = 0, .buf = &adrs, .len = 1 }, | |
102 | { .addr = 0x50, .flags = I2C_M_RD, .buf = pval, .len = 1 }, | |
103 | }; | |
104 | if (i2c_transfer(adap, msg, 2) != 2) return -EREMOTEIO; | |
105 | return 0; | |
106 | } | |
107 | ||
b7f54910 PB |
108 | static int bristol_tuner_attach(struct dvb_usb_adapter *adap) |
109 | { | |
c52344fd | 110 | struct i2c_adapter *prim_i2c = &adap->dev->i2c_adap; |
b7f54910 | 111 | struct i2c_adapter *tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe, 1); |
c52344fd OD |
112 | s8 a; |
113 | int if1=1220; | |
114 | if (adap->dev->udev->descriptor.idVendor == USB_VID_HAUPPAUGE && | |
115 | adap->dev->udev->descriptor.idProduct == USB_PID_HAUPPAUGE_NOVA_T_500_2) { | |
116 | if (!eeprom_read(prim_i2c,0x59 + adap->id,&a)) if1=1220+a; | |
117 | } | |
118 | return dvb_attach(mt2060_attach,adap->fe, tun_i2c,&bristol_mt2060_config[adap->id], | |
119 | if1) == NULL ? -ENODEV : 0; | |
b7f54910 PB |
120 | } |
121 | ||
01373a5c | 122 | /* STK7700D: Pinnacle/Terratec/Hauppauge Dual DVB-T Diversity */ |
54d75eba | 123 | |
b6884a17 PB |
124 | /* MT226x */ |
125 | static struct dibx000_agc_config stk7700d_7000p_mt2266_agc_config[2] = { | |
126 | { | |
127 | BAND_UHF, // band_caps | |
128 | ||
129 | /* 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, | |
130 | * 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 */ | |
131 | (0 << 15) | (0 << 14) | (1 << 11) | (1 << 10) | (1 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), // setup | |
132 | ||
133 | 1130, // inv_gain | |
134 | 21, // time_stabiliz | |
135 | ||
136 | 0, // alpha_level | |
137 | 118, // thlock | |
138 | ||
139 | 0, // wbd_inv | |
140 | 3530, // wbd_ref | |
141 | 1, // wbd_sel | |
142 | 0, // wbd_alpha | |
143 | ||
144 | 65535, // agc1_max | |
145 | 33770, // agc1_min | |
146 | 65535, // agc2_max | |
147 | 23592, // agc2_min | |
148 | ||
149 | 0, // agc1_pt1 | |
150 | 62, // agc1_pt2 | |
151 | 255, // agc1_pt3 | |
152 | 64, // agc1_slope1 | |
153 | 64, // agc1_slope2 | |
154 | 132, // agc2_pt1 | |
155 | 192, // agc2_pt2 | |
156 | 80, // agc2_slope1 | |
157 | 80, // agc2_slope2 | |
158 | ||
159 | 17, // alpha_mant | |
160 | 27, // alpha_exp | |
161 | 23, // beta_mant | |
162 | 51, // beta_exp | |
163 | ||
164 | 1, // perform_agc_softsplit | |
165 | }, { | |
166 | BAND_VHF | BAND_LBAND, // band_caps | |
167 | ||
168 | /* 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, | |
169 | * 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 */ | |
170 | (0 << 15) | (0 << 14) | (1 << 11) | (1 << 10) | (1 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup | |
171 | ||
172 | 2372, // inv_gain | |
173 | 21, // time_stabiliz | |
174 | ||
175 | 0, // alpha_level | |
176 | 118, // thlock | |
177 | ||
178 | 0, // wbd_inv | |
179 | 3530, // wbd_ref | |
180 | 1, // wbd_sel | |
181 | 0, // wbd_alpha | |
182 | ||
183 | 65535, // agc1_max | |
184 | 0, // agc1_min | |
185 | 65535, // agc2_max | |
186 | 23592, // agc2_min | |
187 | ||
188 | 0, // agc1_pt1 | |
189 | 128, // agc1_pt2 | |
190 | 128, // agc1_pt3 | |
191 | 128, // agc1_slope1 | |
192 | 0, // agc1_slope2 | |
193 | 128, // agc2_pt1 | |
194 | 253, // agc2_pt2 | |
195 | 81, // agc2_slope1 | |
196 | 0, // agc2_slope2 | |
197 | ||
198 | 17, // alpha_mant | |
199 | 27, // alpha_exp | |
200 | 23, // beta_mant | |
201 | 51, // beta_exp | |
202 | ||
203 | 1, // perform_agc_softsplit | |
204 | } | |
54d75eba OD |
205 | }; |
206 | ||
207 | static struct dibx000_bandwidth_config stk7700d_mt2266_pll_config = { | |
208 | 60000, 30000, // internal, sampling | |
209 | 1, 8, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass | |
210 | 0, 0, 1, 1, 2, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo | |
211 | (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k | |
212 | 0, // ifreq | |
213 | 20452225, // timf | |
214 | }; | |
215 | ||
216 | static struct dib7000p_config stk7700d_dib7000p_mt2266_config[] = { | |
217 | { .output_mpeg2_in_188_bytes = 1, | |
218 | .hostbus_diversity = 1, | |
219 | .tuner_is_baseband = 1, | |
220 | ||
b6884a17 PB |
221 | .agc_config_count = 2, |
222 | .agc = stk7700d_7000p_mt2266_agc_config, | |
54d75eba OD |
223 | .bw = &stk7700d_mt2266_pll_config, |
224 | ||
b6884a17 PB |
225 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
226 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, | |
227 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, | |
54d75eba OD |
228 | }, |
229 | { .output_mpeg2_in_188_bytes = 1, | |
230 | .hostbus_diversity = 1, | |
231 | .tuner_is_baseband = 1, | |
232 | ||
b6884a17 PB |
233 | .agc_config_count = 2, |
234 | .agc = stk7700d_7000p_mt2266_agc_config, | |
54d75eba OD |
235 | .bw = &stk7700d_mt2266_pll_config, |
236 | ||
b6884a17 PB |
237 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, |
238 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, | |
239 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, | |
54d75eba OD |
240 | } |
241 | }; | |
242 | ||
243 | static struct mt2266_config stk7700d_mt2266_config[2] = { | |
244 | { .i2c_address = 0x60 | |
245 | }, | |
246 | { .i2c_address = 0x60 | |
247 | } | |
248 | }; | |
249 | ||
132c3188 DG |
250 | static int stk7700P2_frontend_attach(struct dvb_usb_adapter *adap) |
251 | { | |
252 | if (adap->id == 0) { | |
253 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); | |
254 | msleep(10); | |
255 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); | |
256 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); | |
257 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); | |
258 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); | |
259 | msleep(10); | |
260 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); | |
261 | msleep(10); | |
262 | dib7000p_i2c_enumeration(&adap->dev->i2c_adap,1,18,stk7700d_dib7000p_mt2266_config); | |
263 | } | |
264 | ||
265 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap,0x80+(adap->id << 1), | |
266 | &stk7700d_dib7000p_mt2266_config[adap->id]); | |
267 | ||
268 | return adap->fe == NULL ? -ENODEV : 0; | |
269 | } | |
270 | ||
54d75eba OD |
271 | static int stk7700d_frontend_attach(struct dvb_usb_adapter *adap) |
272 | { | |
273 | if (adap->id == 0) { | |
274 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); | |
275 | msleep(10); | |
276 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); | |
277 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); | |
278 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); | |
279 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); | |
280 | msleep(10); | |
281 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); | |
282 | msleep(10); | |
283 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); | |
284 | dib7000p_i2c_enumeration(&adap->dev->i2c_adap,2,18,stk7700d_dib7000p_mt2266_config); | |
285 | } | |
286 | ||
287 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap,0x80+(adap->id << 1), | |
288 | &stk7700d_dib7000p_mt2266_config[adap->id]); | |
289 | ||
290 | return adap->fe == NULL ? -ENODEV : 0; | |
291 | } | |
292 | ||
293 | static int stk7700d_tuner_attach(struct dvb_usb_adapter *adap) | |
294 | { | |
295 | struct i2c_adapter *tun_i2c; | |
296 | tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); | |
297 | return dvb_attach(mt2266_attach, adap->fe, tun_i2c, | |
298 | &stk7700d_mt2266_config[adap->id]) == NULL ? -ENODEV : 0;; | |
299 | } | |
300 | ||
6ca8f0b9 AC |
301 | /* STK7700-PH: Digital/Analog Hybrid Tuner, e.h. Cinergy HT USB HE */ |
302 | struct dibx000_agc_config xc3028_agc_config = { | |
303 | BAND_VHF | BAND_UHF, /* band_caps */ | |
304 | ||
305 | /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=0, | |
306 | * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0, | |
307 | * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */ | |
308 | (0 << 15) | (0 << 14) | (0 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | | |
309 | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), /* setup */ | |
310 | ||
311 | 712, /* inv_gain */ | |
312 | 21, /* time_stabiliz */ | |
313 | ||
314 | 0, /* alpha_level */ | |
315 | 118, /* thlock */ | |
316 | ||
317 | 0, /* wbd_inv */ | |
318 | 2867, /* wbd_ref */ | |
319 | 0, /* wbd_sel */ | |
320 | 2, /* wbd_alpha */ | |
321 | ||
322 | 0, /* agc1_max */ | |
323 | 0, /* agc1_min */ | |
324 | 39718, /* agc2_max */ | |
325 | 9930, /* agc2_min */ | |
326 | 0, /* agc1_pt1 */ | |
327 | 0, /* agc1_pt2 */ | |
328 | 0, /* agc1_pt3 */ | |
329 | 0, /* agc1_slope1 */ | |
330 | 0, /* agc1_slope2 */ | |
331 | 0, /* agc2_pt1 */ | |
332 | 128, /* agc2_pt2 */ | |
333 | 29, /* agc2_slope1 */ | |
334 | 29, /* agc2_slope2 */ | |
335 | ||
336 | 17, /* alpha_mant */ | |
337 | 27, /* alpha_exp */ | |
338 | 23, /* beta_mant */ | |
339 | 51, /* beta_exp */ | |
340 | ||
341 | 1, /* perform_agc_softsplit */ | |
342 | }; | |
343 | ||
344 | /* PLL Configuration for COFDM BW_MHz = 8.00 with external clock = 30.00 */ | |
345 | struct dibx000_bandwidth_config xc3028_bw_config = { | |
346 | 60000, 30000, /* internal, sampling */ | |
347 | 1, 8, 3, 1, 0, /* pll_cfg: prediv, ratio, range, reset, bypass */ | |
348 | 0, 0, 1, 1, 0, /* misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, | |
349 | modulo */ | |
350 | (3 << 14) | (1 << 12) | (524 << 0), /* sad_cfg: refsel, sel, freq_15k */ | |
351 | (1 << 25) | 5816102, /* ifreq = 5.200000 MHz */ | |
352 | 20452225, /* timf */ | |
353 | 30000000, /* xtal_hz */ | |
354 | }; | |
355 | ||
356 | static struct dib7000p_config stk7700ph_dib7700_xc3028_config = { | |
357 | .output_mpeg2_in_188_bytes = 1, | |
358 | .tuner_is_baseband = 1, | |
359 | ||
360 | .agc_config_count = 1, | |
361 | .agc = &xc3028_agc_config, | |
362 | .bw = &xc3028_bw_config, | |
363 | ||
364 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, | |
365 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, | |
366 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, | |
367 | }; | |
368 | ||
369 | static int stk7700ph_xc3028_callback(void *ptr, int command, int arg) | |
370 | { | |
371 | struct dvb_usb_adapter *adap = ptr; | |
372 | ||
373 | switch (command) { | |
374 | case XC2028_TUNER_RESET: | |
375 | /* Send the tuner in then out of reset */ | |
376 | dib7000p_set_gpio(adap->fe, 8, 0, 0); msleep(10); | |
377 | dib7000p_set_gpio(adap->fe, 8, 0, 1); | |
378 | break; | |
379 | case XC2028_RESET_CLK: | |
380 | break; | |
381 | default: | |
382 | err("%s: unknown command %d, arg %d\n", __func__, | |
383 | command, arg); | |
384 | return -EINVAL; | |
385 | } | |
386 | return 0; | |
387 | } | |
388 | ||
389 | static struct xc2028_ctrl stk7700ph_xc3028_ctrl = { | |
390 | .fname = XC2028_DEFAULT_FIRMWARE, | |
391 | .max_len = 64, | |
392 | .demod = XC3028_FE_DIBCOM52, | |
393 | }; | |
394 | ||
395 | static struct xc2028_config stk7700ph_xc3028_config = { | |
396 | .i2c_addr = 0x61, | |
397 | .callback = stk7700ph_xc3028_callback, | |
398 | .ctrl = &stk7700ph_xc3028_ctrl, | |
399 | }; | |
400 | ||
401 | static int stk7700ph_frontend_attach(struct dvb_usb_adapter *adap) | |
402 | { | |
403 | struct usb_device_descriptor *desc = &adap->dev->udev->descriptor; | |
404 | ||
405 | if (desc->idVendor == USB_VID_PINNACLE && | |
406 | desc->idProduct == USB_PID_PINNACLE_EXPRESSCARD_320CX) | |
407 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); | |
408 | else | |
409 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); | |
410 | msleep(20); | |
411 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); | |
412 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); | |
413 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); | |
414 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); | |
415 | msleep(10); | |
416 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); | |
417 | msleep(20); | |
418 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); | |
419 | msleep(10); | |
420 | ||
421 | dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, | |
422 | &stk7700ph_dib7700_xc3028_config); | |
423 | ||
424 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, | |
425 | &stk7700ph_dib7700_xc3028_config); | |
426 | ||
427 | return adap->fe == NULL ? -ENODEV : 0; | |
428 | } | |
429 | ||
430 | static int stk7700ph_tuner_attach(struct dvb_usb_adapter *adap) | |
431 | { | |
432 | struct i2c_adapter *tun_i2c; | |
433 | ||
434 | tun_i2c = dib7000p_get_i2c_master(adap->fe, | |
435 | DIBX000_I2C_INTERFACE_TUNER, 1); | |
436 | ||
437 | stk7700ph_xc3028_config.i2c_adap = tun_i2c; | |
438 | stk7700ph_xc3028_config.video_dev = adap; | |
439 | ||
440 | return dvb_attach(xc2028_attach, adap->fe, &stk7700ph_xc3028_config) | |
441 | == NULL ? -ENODEV : 0; | |
442 | } | |
443 | ||
54d75eba OD |
444 | #define DEFAULT_RC_INTERVAL 150 |
445 | ||
446 | static u8 rc_request[] = { REQUEST_POLL_RC, 0 }; | |
447 | ||
58e6f95e PB |
448 | /* Number of keypresses to ignore before start repeating */ |
449 | #define RC_REPEAT_DELAY 2 | |
450 | ||
82f3d559 | 451 | static int dib0700_rc_query(struct dvb_usb_device *d, u32 *event, int *state) |
54d75eba OD |
452 | { |
453 | u8 key[4]; | |
454 | int i; | |
455 | struct dvb_usb_rc_key *keymap = d->props.rc_key_map; | |
456 | struct dib0700_state *st = d->priv; | |
457 | *event = 0; | |
458 | *state = REMOTE_NO_KEY_PRESSED; | |
459 | i=dib0700_ctrl_rd(d,rc_request,2,key,4); | |
460 | if (i<=0) { | |
034d65ed | 461 | err("RC Query Failed"); |
89f4267d | 462 | return -1; |
54d75eba | 463 | } |
58e6f95e PB |
464 | |
465 | /* losing half of KEY_0 events from Philipps rc5 remotes.. */ | |
54d75eba | 466 | if (key[0]==0 && key[1]==0 && key[2]==0 && key[3]==0) return 0; |
58e6f95e PB |
467 | |
468 | /* 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]); */ | |
469 | ||
470 | dib0700_rc_setup(d); /* reset ir sensor data to prevent false events */ | |
471 | ||
472 | switch (dvb_usb_dib0700_ir_proto) { | |
473 | case 0: { | |
474 | /* NEC protocol sends repeat code as 0 0 0 FF */ | |
475 | if ((key[3-2] == 0x00) && (key[3-3] == 0x00) && | |
476 | (key[3] == 0xFF)) { | |
477 | st->rc_counter++; | |
478 | if (st->rc_counter > RC_REPEAT_DELAY) { | |
479 | *event = d->last_event; | |
480 | *state = REMOTE_KEY_PRESSED; | |
481 | st->rc_counter = RC_REPEAT_DELAY; | |
482 | } | |
483 | return 0; | |
484 | } | |
54d75eba | 485 | for (i=0;i<d->props.rc_key_map_size; i++) { |
89f4267d | 486 | if (keymap[i].custom == key[3-2] && keymap[i].data == key[3-3]) { |
58e6f95e PB |
487 | st->rc_counter = 0; |
488 | *event = keymap[i].event; | |
489 | *state = REMOTE_KEY_PRESSED; | |
490 | d->last_event = keymap[i].event; | |
491 | return 0; | |
492 | } | |
493 | } | |
494 | break; | |
495 | } | |
496 | default: { | |
497 | /* RC-5 protocol changes toggle bit on new keypress */ | |
498 | for (i = 0; i < d->props.rc_key_map_size; i++) { | |
499 | if (keymap[i].custom == key[3-2] && keymap[i].data == key[3-3]) { | |
500 | if (d->last_event == keymap[i].event && | |
501 | key[3-1] == st->rc_toggle) { | |
502 | st->rc_counter++; | |
503 | /* prevents unwanted double hits */ | |
504 | if (st->rc_counter > RC_REPEAT_DELAY) { | |
505 | *event = d->last_event; | |
506 | *state = REMOTE_KEY_PRESSED; | |
507 | st->rc_counter = RC_REPEAT_DELAY; | |
508 | } | |
509 | ||
510 | return 0; | |
511 | } | |
512 | st->rc_counter = 0; | |
54d75eba OD |
513 | *event = keymap[i].event; |
514 | *state = REMOTE_KEY_PRESSED; | |
58e6f95e PB |
515 | st->rc_toggle = key[3-1]; |
516 | d->last_event = keymap[i].event; | |
54d75eba OD |
517 | return 0; |
518 | } | |
519 | } | |
58e6f95e PB |
520 | break; |
521 | } | |
54d75eba | 522 | } |
58e6f95e PB |
523 | err("Unknown remote controller key: %2X %2X %2X %2X", (int) key[3-2], (int) key[3-3], (int) key[3-1], (int) key[3]); |
524 | d->last_event = 0; | |
54d75eba OD |
525 | return 0; |
526 | } | |
527 | ||
82f3d559 | 528 | static struct dvb_usb_rc_key dib0700_rc_keys[] = { |
54d75eba OD |
529 | /* Key codes for the tiny Pinnacle remote*/ |
530 | { 0x07, 0x00, KEY_MUTE }, | |
531 | { 0x07, 0x01, KEY_MENU }, // Pinnacle logo | |
532 | { 0x07, 0x39, KEY_POWER }, | |
533 | { 0x07, 0x03, KEY_VOLUMEUP }, | |
534 | { 0x07, 0x09, KEY_VOLUMEDOWN }, | |
535 | { 0x07, 0x06, KEY_CHANNELUP }, | |
536 | { 0x07, 0x0c, KEY_CHANNELDOWN }, | |
537 | { 0x07, 0x0f, KEY_1 }, | |
538 | { 0x07, 0x15, KEY_2 }, | |
539 | { 0x07, 0x10, KEY_3 }, | |
540 | { 0x07, 0x18, KEY_4 }, | |
541 | { 0x07, 0x1b, KEY_5 }, | |
542 | { 0x07, 0x1e, KEY_6 }, | |
543 | { 0x07, 0x11, KEY_7 }, | |
544 | { 0x07, 0x21, KEY_8 }, | |
545 | { 0x07, 0x12, KEY_9 }, | |
546 | { 0x07, 0x27, KEY_0 }, | |
547 | { 0x07, 0x24, KEY_SCREEN }, // 'Square' key | |
548 | { 0x07, 0x2a, KEY_TEXT }, // 'T' key | |
549 | { 0x07, 0x2d, KEY_REWIND }, | |
550 | { 0x07, 0x30, KEY_PLAY }, | |
551 | { 0x07, 0x33, KEY_FASTFORWARD }, | |
552 | { 0x07, 0x36, KEY_RECORD }, | |
553 | { 0x07, 0x3c, KEY_STOP }, | |
554 | { 0x07, 0x3f, KEY_CANCEL }, // '?' key | |
555 | /* Key codes for the Terratec Cinergy DT XS Diversity, similar to cinergyT2.c */ | |
556 | { 0xeb, 0x01, KEY_POWER }, | |
557 | { 0xeb, 0x02, KEY_1 }, | |
558 | { 0xeb, 0x03, KEY_2 }, | |
559 | { 0xeb, 0x04, KEY_3 }, | |
560 | { 0xeb, 0x05, KEY_4 }, | |
561 | { 0xeb, 0x06, KEY_5 }, | |
562 | { 0xeb, 0x07, KEY_6 }, | |
563 | { 0xeb, 0x08, KEY_7 }, | |
564 | { 0xeb, 0x09, KEY_8 }, | |
565 | { 0xeb, 0x0a, KEY_9 }, | |
566 | { 0xeb, 0x0b, KEY_VIDEO }, | |
567 | { 0xeb, 0x0c, KEY_0 }, | |
568 | { 0xeb, 0x0d, KEY_REFRESH }, | |
569 | { 0xeb, 0x0f, KEY_EPG }, | |
570 | { 0xeb, 0x10, KEY_UP }, | |
571 | { 0xeb, 0x11, KEY_LEFT }, | |
572 | { 0xeb, 0x12, KEY_OK }, | |
573 | { 0xeb, 0x13, KEY_RIGHT }, | |
574 | { 0xeb, 0x14, KEY_DOWN }, | |
575 | { 0xeb, 0x16, KEY_INFO }, | |
576 | { 0xeb, 0x17, KEY_RED }, | |
577 | { 0xeb, 0x18, KEY_GREEN }, | |
578 | { 0xeb, 0x19, KEY_YELLOW }, | |
579 | { 0xeb, 0x1a, KEY_BLUE }, | |
580 | { 0xeb, 0x1b, KEY_CHANNELUP }, | |
581 | { 0xeb, 0x1c, KEY_VOLUMEUP }, | |
7161f27f | 582 | { 0xeb, 0x1d, KEY_MUTE }, |
54d75eba OD |
583 | { 0xeb, 0x1e, KEY_VOLUMEDOWN }, |
584 | { 0xeb, 0x1f, KEY_CHANNELDOWN }, | |
585 | { 0xeb, 0x40, KEY_PAUSE }, | |
586 | { 0xeb, 0x41, KEY_HOME }, | |
587 | { 0xeb, 0x42, KEY_MENU }, /* DVD Menu */ | |
588 | { 0xeb, 0x43, KEY_SUBTITLE }, | |
589 | { 0xeb, 0x44, KEY_TEXT }, /* Teletext */ | |
590 | { 0xeb, 0x45, KEY_DELETE }, | |
591 | { 0xeb, 0x46, KEY_TV }, | |
592 | { 0xeb, 0x47, KEY_DVD }, | |
593 | { 0xeb, 0x48, KEY_STOP }, | |
594 | { 0xeb, 0x49, KEY_VIDEO }, | |
595 | { 0xeb, 0x4a, KEY_AUDIO }, /* Music */ | |
596 | { 0xeb, 0x4b, KEY_SCREEN }, /* Pic */ | |
597 | { 0xeb, 0x4c, KEY_PLAY }, | |
598 | { 0xeb, 0x4d, KEY_BACK }, | |
599 | { 0xeb, 0x4e, KEY_REWIND }, | |
600 | { 0xeb, 0x4f, KEY_FASTFORWARD }, | |
601 | { 0xeb, 0x54, KEY_PREVIOUS }, | |
602 | { 0xeb, 0x58, KEY_RECORD }, | |
7161f27f JG |
603 | { 0xeb, 0x5c, KEY_NEXT }, |
604 | ||
605 | /* Key codes for the Haupauge WinTV Nova-TD, copied from nova-t-usb2.c (Nova-T USB2) */ | |
606 | { 0x1e, 0x00, KEY_0 }, | |
607 | { 0x1e, 0x01, KEY_1 }, | |
608 | { 0x1e, 0x02, KEY_2 }, | |
609 | { 0x1e, 0x03, KEY_3 }, | |
610 | { 0x1e, 0x04, KEY_4 }, | |
611 | { 0x1e, 0x05, KEY_5 }, | |
612 | { 0x1e, 0x06, KEY_6 }, | |
613 | { 0x1e, 0x07, KEY_7 }, | |
614 | { 0x1e, 0x08, KEY_8 }, | |
615 | { 0x1e, 0x09, KEY_9 }, | |
616 | { 0x1e, 0x0a, KEY_KPASTERISK }, | |
617 | { 0x1e, 0x0b, KEY_RED }, | |
618 | { 0x1e, 0x0c, KEY_RADIO }, | |
619 | { 0x1e, 0x0d, KEY_MENU }, | |
620 | { 0x1e, 0x0e, KEY_GRAVE }, /* # */ | |
621 | { 0x1e, 0x0f, KEY_MUTE }, | |
622 | { 0x1e, 0x10, KEY_VOLUMEUP }, | |
623 | { 0x1e, 0x11, KEY_VOLUMEDOWN }, | |
624 | { 0x1e, 0x12, KEY_CHANNEL }, | |
625 | { 0x1e, 0x14, KEY_UP }, | |
626 | { 0x1e, 0x15, KEY_DOWN }, | |
627 | { 0x1e, 0x16, KEY_LEFT }, | |
628 | { 0x1e, 0x17, KEY_RIGHT }, | |
629 | { 0x1e, 0x18, KEY_VIDEO }, | |
630 | { 0x1e, 0x19, KEY_AUDIO }, | |
631 | { 0x1e, 0x1a, KEY_MEDIA }, | |
632 | { 0x1e, 0x1b, KEY_EPG }, | |
633 | { 0x1e, 0x1c, KEY_TV }, | |
634 | { 0x1e, 0x1e, KEY_NEXT }, | |
635 | { 0x1e, 0x1f, KEY_BACK }, | |
636 | { 0x1e, 0x20, KEY_CHANNELUP }, | |
637 | { 0x1e, 0x21, KEY_CHANNELDOWN }, | |
638 | { 0x1e, 0x24, KEY_LAST }, /* Skip backwards */ | |
639 | { 0x1e, 0x25, KEY_OK }, | |
640 | { 0x1e, 0x29, KEY_BLUE}, | |
641 | { 0x1e, 0x2e, KEY_GREEN }, | |
642 | { 0x1e, 0x30, KEY_PAUSE }, | |
643 | { 0x1e, 0x32, KEY_REWIND }, | |
644 | { 0x1e, 0x34, KEY_FASTFORWARD }, | |
645 | { 0x1e, 0x35, KEY_PLAY }, | |
646 | { 0x1e, 0x36, KEY_STOP }, | |
647 | { 0x1e, 0x37, KEY_RECORD }, | |
648 | { 0x1e, 0x38, KEY_YELLOW }, | |
649 | { 0x1e, 0x3b, KEY_GOTO }, | |
650 | { 0x1e, 0x3d, KEY_POWER }, | |
48e6a017 JB |
651 | |
652 | /* Key codes for the Leadtek Winfast DTV Dongle */ | |
653 | { 0x00, 0x42, KEY_POWER }, | |
654 | { 0x07, 0x7c, KEY_TUNER }, | |
655 | { 0x0f, 0x4e, KEY_PRINT }, /* PREVIEW */ | |
656 | { 0x08, 0x40, KEY_SCREEN }, /* full screen toggle*/ | |
657 | { 0x0f, 0x71, KEY_DOT }, /* frequency */ | |
658 | { 0x07, 0x43, KEY_0 }, | |
659 | { 0x0c, 0x41, KEY_1 }, | |
660 | { 0x04, 0x43, KEY_2 }, | |
661 | { 0x0b, 0x7f, KEY_3 }, | |
662 | { 0x0e, 0x41, KEY_4 }, | |
663 | { 0x06, 0x43, KEY_5 }, | |
664 | { 0x09, 0x7f, KEY_6 }, | |
665 | { 0x0d, 0x7e, KEY_7 }, | |
666 | { 0x05, 0x7c, KEY_8 }, | |
667 | { 0x0a, 0x40, KEY_9 }, | |
668 | { 0x0e, 0x4e, KEY_CLEAR }, | |
669 | { 0x04, 0x7c, KEY_CHANNEL }, /* show channel number */ | |
670 | { 0x0f, 0x41, KEY_LAST }, /* recall */ | |
671 | { 0x03, 0x42, KEY_MUTE }, | |
672 | { 0x06, 0x4c, KEY_RESERVED }, /* PIP button*/ | |
673 | { 0x01, 0x72, KEY_SHUFFLE }, /* SNAPSHOT */ | |
674 | { 0x0c, 0x4e, KEY_PLAYPAUSE }, /* TIMESHIFT */ | |
675 | { 0x0b, 0x70, KEY_RECORD }, | |
676 | { 0x03, 0x7d, KEY_VOLUMEUP }, | |
677 | { 0x01, 0x7d, KEY_VOLUMEDOWN }, | |
678 | { 0x02, 0x42, KEY_CHANNELUP }, | |
679 | { 0x00, 0x7d, KEY_CHANNELDOWN }, | |
82f3d559 | 680 | }; |
54d75eba | 681 | |
b7f54910 | 682 | /* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */ |
a75763ff | 683 | static struct dibx000_agc_config stk7700p_7000m_mt2060_agc_config = { |
69ea31e7 PB |
684 | BAND_UHF | BAND_VHF, // band_caps |
685 | ||
686 | /* 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, | |
687 | * 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 */ | |
688 | (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup | |
689 | ||
690 | 712, // inv_gain | |
691 | 41, // time_stabiliz | |
692 | ||
693 | 0, // alpha_level | |
694 | 118, // thlock | |
695 | ||
696 | 0, // wbd_inv | |
697 | 4095, // wbd_ref | |
698 | 0, // wbd_sel | |
699 | 0, // wbd_alpha | |
700 | ||
701 | 42598, // agc1_max | |
702 | 17694, // agc1_min | |
703 | 45875, // agc2_max | |
704 | 2621, // agc2_min | |
705 | 0, // agc1_pt1 | |
706 | 76, // agc1_pt2 | |
707 | 139, // agc1_pt3 | |
708 | 52, // agc1_slope1 | |
709 | 59, // agc1_slope2 | |
710 | 107, // agc2_pt1 | |
711 | 172, // agc2_pt2 | |
712 | 57, // agc2_slope1 | |
713 | 70, // agc2_slope2 | |
714 | ||
715 | 21, // alpha_mant | |
716 | 25, // alpha_exp | |
717 | 28, // beta_mant | |
718 | 48, // beta_exp | |
719 | ||
720 | 1, // perform_agc_softsplit | |
721 | { 0, // split_min | |
722 | 107, // split_max | |
723 | 51800, // global_split_min | |
724 | 24700 // global_split_max | |
725 | }, | |
726 | }; | |
727 | ||
a75763ff PB |
728 | static struct dibx000_agc_config stk7700p_7000p_mt2060_agc_config = { |
729 | BAND_UHF | BAND_VHF, | |
730 | ||
731 | /* 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, | |
732 | * 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 */ | |
733 | (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup | |
734 | ||
735 | 712, // inv_gain | |
736 | 41, // time_stabiliz | |
737 | ||
738 | 0, // alpha_level | |
739 | 118, // thlock | |
740 | ||
741 | 0, // wbd_inv | |
742 | 4095, // wbd_ref | |
743 | 0, // wbd_sel | |
744 | 0, // wbd_alpha | |
745 | ||
746 | 42598, // agc1_max | |
747 | 16384, // agc1_min | |
748 | 42598, // agc2_max | |
749 | 0, // agc2_min | |
750 | ||
751 | 0, // agc1_pt1 | |
752 | 137, // agc1_pt2 | |
753 | 255, // agc1_pt3 | |
754 | ||
755 | 0, // agc1_slope1 | |
756 | 255, // agc1_slope2 | |
757 | ||
758 | 0, // agc2_pt1 | |
759 | 0, // agc2_pt2 | |
760 | ||
761 | 0, // agc2_slope1 | |
762 | 41, // agc2_slope2 | |
763 | ||
764 | 15, // alpha_mant | |
765 | 25, // alpha_exp | |
766 | ||
767 | 28, // beta_mant | |
768 | 48, // beta_exp | |
769 | ||
770 | 0, // perform_agc_softsplit | |
771 | }; | |
772 | ||
773 | static struct dibx000_bandwidth_config stk7700p_pll_config = { | |
69ea31e7 PB |
774 | 60000, 30000, // internal, sampling |
775 | 1, 8, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass | |
776 | 0, 0, 1, 1, 0, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo | |
777 | (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k | |
778 | 60258167, // ifreq | |
779 | 20452225, // timf | |
3db78e59 | 780 | 30000000, // xtal |
69ea31e7 PB |
781 | }; |
782 | ||
783 | static struct dib7000m_config stk7700p_dib7000m_config = { | |
784 | .dvbt_mode = 1, | |
785 | .output_mpeg2_in_188_bytes = 1, | |
786 | .quartz_direct = 1, | |
787 | ||
788 | .agc_config_count = 1, | |
a75763ff PB |
789 | .agc = &stk7700p_7000m_mt2060_agc_config, |
790 | .bw = &stk7700p_pll_config, | |
791 | ||
792 | .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS, | |
793 | .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES, | |
794 | .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS, | |
795 | }; | |
796 | ||
797 | static struct dib7000p_config stk7700p_dib7000p_config = { | |
798 | .output_mpeg2_in_188_bytes = 1, | |
799 | ||
b6884a17 | 800 | .agc_config_count = 1, |
a75763ff PB |
801 | .agc = &stk7700p_7000p_mt2060_agc_config, |
802 | .bw = &stk7700p_pll_config, | |
69ea31e7 PB |
803 | |
804 | .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS, | |
805 | .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES, | |
806 | .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS, | |
b7f54910 PB |
807 | }; |
808 | ||
809 | static int stk7700p_frontend_attach(struct dvb_usb_adapter *adap) | |
810 | { | |
69ea31e7 | 811 | struct dib0700_state *st = adap->dev->priv; |
b7f54910 | 812 | /* unless there is no real power management in DVB - we leave the device on GPIO6 */ |
a75763ff PB |
813 | |
814 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); | |
815 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(50); | |
816 | ||
69ea31e7 | 817 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10); |
a75763ff PB |
818 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); |
819 | ||
b7f54910 | 820 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10); |
a75763ff PB |
821 | dib0700_ctrl_clock(adap->dev, 72, 1); |
822 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(100); | |
823 | ||
824 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); | |
b7f54910 | 825 | |
69ea31e7 | 826 | st->mt2060_if1[0] = 1220; |
a75763ff PB |
827 | |
828 | if (dib7000pc_detection(&adap->dev->i2c_adap)) { | |
829 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000p_config); | |
830 | st->is_dib7000pc = 1; | |
831 | } else | |
832 | adap->fe = dvb_attach(dib7000m_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000m_config); | |
833 | ||
834 | return adap->fe == NULL ? -ENODEV : 0; | |
b7f54910 PB |
835 | } |
836 | ||
69ea31e7 PB |
837 | static struct mt2060_config stk7700p_mt2060_config = { |
838 | 0x60 | |
839 | }; | |
840 | ||
b7f54910 PB |
841 | static int stk7700p_tuner_attach(struct dvb_usb_adapter *adap) |
842 | { | |
c52344fd | 843 | struct i2c_adapter *prim_i2c = &adap->dev->i2c_adap; |
69ea31e7 | 844 | struct dib0700_state *st = adap->dev->priv; |
a75763ff | 845 | struct i2c_adapter *tun_i2c; |
c52344fd OD |
846 | s8 a; |
847 | int if1=1220; | |
848 | if (adap->dev->udev->descriptor.idVendor == USB_VID_HAUPPAUGE && | |
849 | adap->dev->udev->descriptor.idProduct == USB_PID_HAUPPAUGE_NOVA_T_STICK) { | |
850 | if (!eeprom_read(prim_i2c,0x58,&a)) if1=1220+a; | |
851 | } | |
a75763ff PB |
852 | if (st->is_dib7000pc) |
853 | tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); | |
854 | else | |
855 | tun_i2c = dib7000m_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); | |
856 | ||
857 | return dvb_attach(mt2060_attach, adap->fe, tun_i2c, &stk7700p_mt2060_config, | |
c52344fd | 858 | if1) == NULL ? -ENODEV : 0; |
b7f54910 PB |
859 | } |
860 | ||
01373a5c PB |
861 | /* DIB7070 generic */ |
862 | static struct dibx000_agc_config dib7070_agc_config = { | |
863 | BAND_UHF | BAND_VHF | BAND_LBAND | BAND_SBAND, | |
864 | /* 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, | |
865 | * 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 */ | |
866 | (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), // setup | |
867 | ||
868 | 600, // inv_gain | |
869 | 10, // time_stabiliz | |
870 | ||
871 | 0, // alpha_level | |
872 | 118, // thlock | |
873 | ||
874 | 0, // wbd_inv | |
875 | 3530, // wbd_ref | |
876 | 1, // wbd_sel | |
877 | 5, // wbd_alpha | |
878 | ||
879 | 65535, // agc1_max | |
880 | 0, // agc1_min | |
881 | ||
882 | 65535, // agc2_max | |
883 | 0, // agc2_min | |
884 | ||
885 | 0, // agc1_pt1 | |
886 | 40, // agc1_pt2 | |
887 | 183, // agc1_pt3 | |
888 | 206, // agc1_slope1 | |
889 | 255, // agc1_slope2 | |
890 | 72, // agc2_pt1 | |
891 | 152, // agc2_pt2 | |
892 | 88, // agc2_slope1 | |
893 | 90, // agc2_slope2 | |
894 | ||
895 | 17, // alpha_mant | |
896 | 27, // alpha_exp | |
897 | 23, // beta_mant | |
898 | 51, // beta_exp | |
899 | ||
900 | 0, // perform_agc_softsplit | |
901 | }; | |
902 | ||
903 | static int dib7070_tuner_reset(struct dvb_frontend *fe, int onoff) | |
904 | { | |
905 | return dib7000p_set_gpio(fe, 8, 0, !onoff); | |
906 | } | |
907 | ||
908 | static int dib7070_tuner_sleep(struct dvb_frontend *fe, int onoff) | |
909 | { | |
910 | return dib7000p_set_gpio(fe, 9, 0, onoff); | |
911 | } | |
912 | ||
913 | static struct dib0070_config dib7070p_dib0070_config[2] = { | |
914 | { | |
915 | .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS, | |
916 | .reset = dib7070_tuner_reset, | |
917 | .sleep = dib7070_tuner_sleep, | |
918 | .clock_khz = 12000, | |
919 | .clock_pad_drive = 4 | |
920 | }, { | |
921 | .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS, | |
922 | .reset = dib7070_tuner_reset, | |
923 | .sleep = dib7070_tuner_sleep, | |
924 | .clock_khz = 12000, | |
925 | ||
926 | } | |
927 | }; | |
928 | ||
929 | static int dib7070_set_param_override(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep) | |
930 | { | |
931 | struct dvb_usb_adapter *adap = fe->dvb->priv; | |
932 | struct dib0700_adapter_state *state = adap->priv; | |
933 | ||
934 | u16 offset; | |
935 | u8 band = BAND_OF_FREQUENCY(fep->frequency/1000); | |
936 | switch (band) { | |
937 | case BAND_VHF: offset = 950; break; | |
938 | case BAND_UHF: | |
939 | default: offset = 550; break; | |
940 | } | |
941 | deb_info("WBD for DiB7000P: %d\n", offset + dib0070_wbd_offset(fe)); | |
942 | dib7000p_set_wbd_ref(fe, offset + dib0070_wbd_offset(fe)); | |
943 | return state->set_param_save(fe, fep); | |
944 | } | |
945 | ||
946 | static int dib7070p_tuner_attach(struct dvb_usb_adapter *adap) | |
947 | { | |
948 | struct dib0700_adapter_state *st = adap->priv; | |
949 | struct i2c_adapter *tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1); | |
950 | ||
951 | if (adap->id == 0) { | |
952 | if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, &dib7070p_dib0070_config[0]) == NULL) | |
953 | return -ENODEV; | |
954 | } else { | |
955 | if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, &dib7070p_dib0070_config[1]) == NULL) | |
956 | return -ENODEV; | |
957 | } | |
958 | ||
959 | st->set_param_save = adap->fe->ops.tuner_ops.set_params; | |
960 | adap->fe->ops.tuner_ops.set_params = dib7070_set_param_override; | |
961 | return 0; | |
962 | } | |
963 | ||
964 | static struct dibx000_bandwidth_config dib7070_bw_config_12_mhz = { | |
965 | 60000, 15000, // internal, sampling | |
966 | 1, 20, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass | |
967 | 0, 0, 1, 1, 2, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo | |
968 | (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k | |
969 | (0 << 25) | 0, // ifreq = 0.000000 MHz | |
970 | 20452225, // timf | |
971 | 12000000, // xtal_hz | |
972 | }; | |
973 | ||
974 | static struct dib7000p_config dib7070p_dib7000p_config = { | |
975 | .output_mpeg2_in_188_bytes = 1, | |
976 | ||
977 | .agc_config_count = 1, | |
978 | .agc = &dib7070_agc_config, | |
979 | .bw = &dib7070_bw_config_12_mhz, | |
3cb2c39d PB |
980 | .tuner_is_baseband = 1, |
981 | .spur_protect = 1, | |
01373a5c PB |
982 | |
983 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, | |
984 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, | |
985 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, | |
986 | ||
987 | .hostbus_diversity = 1, | |
988 | }; | |
989 | ||
990 | /* STK7070P */ | |
991 | static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap) | |
992 | { | |
6ca8f0b9 AC |
993 | if (adap->dev->udev->descriptor.idVendor == USB_VID_PINNACLE && |
994 | adap->dev->udev->descriptor.idProduct == USB_PID_PINNACLE_PCTV72E) | |
995 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); | |
996 | else | |
01373a5c PB |
997 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); |
998 | msleep(10); | |
999 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); | |
1000 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); | |
1001 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); | |
1002 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); | |
1003 | ||
1004 | dib0700_ctrl_clock(adap->dev, 72, 1); | |
1005 | ||
1006 | msleep(10); | |
1007 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); | |
1008 | msleep(10); | |
1009 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); | |
1010 | ||
6ca8f0b9 AC |
1011 | dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, |
1012 | &dib7070p_dib7000p_config); | |
01373a5c | 1013 | |
6ca8f0b9 AC |
1014 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, |
1015 | &dib7070p_dib7000p_config); | |
01373a5c PB |
1016 | return adap->fe == NULL ? -ENODEV : 0; |
1017 | } | |
1018 | ||
1019 | /* STK7070PD */ | |
1020 | static struct dib7000p_config stk7070pd_dib7000p_config[2] = { | |
1021 | { | |
1022 | .output_mpeg2_in_188_bytes = 1, | |
1023 | ||
1024 | .agc_config_count = 1, | |
1025 | .agc = &dib7070_agc_config, | |
1026 | .bw = &dib7070_bw_config_12_mhz, | |
3cb2c39d PB |
1027 | .tuner_is_baseband = 1, |
1028 | .spur_protect = 1, | |
01373a5c PB |
1029 | |
1030 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, | |
1031 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, | |
1032 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, | |
1033 | ||
1034 | .hostbus_diversity = 1, | |
1035 | }, { | |
1036 | .output_mpeg2_in_188_bytes = 1, | |
1037 | ||
1038 | .agc_config_count = 1, | |
1039 | .agc = &dib7070_agc_config, | |
1040 | .bw = &dib7070_bw_config_12_mhz, | |
3cb2c39d PB |
1041 | .tuner_is_baseband = 1, |
1042 | .spur_protect = 1, | |
01373a5c PB |
1043 | |
1044 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, | |
1045 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, | |
1046 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, | |
1047 | ||
1048 | .hostbus_diversity = 1, | |
1049 | } | |
1050 | }; | |
1051 | ||
1052 | static int stk7070pd_frontend_attach0(struct dvb_usb_adapter *adap) | |
1053 | { | |
1054 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); | |
1055 | msleep(10); | |
1056 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); | |
1057 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); | |
1058 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); | |
1059 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); | |
1060 | ||
1061 | dib0700_ctrl_clock(adap->dev, 72, 1); | |
1062 | ||
1063 | msleep(10); | |
1064 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); | |
1065 | msleep(10); | |
1066 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); | |
1067 | ||
1068 | dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 2, 18, stk7070pd_dib7000p_config); | |
1069 | ||
1070 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, &stk7070pd_dib7000p_config[0]); | |
1071 | return adap->fe == NULL ? -ENODEV : 0; | |
1072 | } | |
1073 | ||
1074 | static int stk7070pd_frontend_attach1(struct dvb_usb_adapter *adap) | |
1075 | { | |
1076 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x82, &stk7070pd_dib7000p_config[1]); | |
1077 | return adap->fe == NULL ? -ENODEV : 0; | |
1078 | } | |
1079 | ||
1080 | /* DVB-USB and USB stuff follows */ | |
b7f54910 | 1081 | struct usb_device_id dib0700_usb_id_table[] = { |
01373a5c | 1082 | /* 0 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P) }, |
6ca8f0b9 AC |
1083 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P_PC) }, |
1084 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500) }, | |
1085 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500_2) }, | |
1086 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK) }, | |
01373a5c | 1087 | /* 5 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR) }, |
6ca8f0b9 AC |
1088 | { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500) }, |
1089 | { USB_DEVICE(USB_VID_UNIWILL, USB_PID_UNIWILL_STK7700P) }, | |
1090 | { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_STK7700P) }, | |
1091 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_2) }, | |
01373a5c | 1092 | /* 10 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR_2) }, |
6ca8f0b9 AC |
1093 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV2000E) }, |
1094 | { USB_DEVICE(USB_VID_TERRATEC, | |
1095 | USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY) }, | |
1096 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_TD_STICK) }, | |
1097 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700D) }, | |
01373a5c | 1098 | /* 15 */{ USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070P) }, |
6ca8f0b9 AC |
1099 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV_DVB_T_FLASH) }, |
1100 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070PD) }, | |
1101 | { USB_DEVICE(USB_VID_PINNACLE, | |
1102 | USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T) }, | |
1103 | { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500_PC) }, | |
fa3b877e | 1104 | /* 20 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_EXPRESS) }, |
6ca8f0b9 AC |
1105 | { USB_DEVICE(USB_VID_GIGABYTE, USB_PID_GIGABYTE_U7000) }, |
1106 | { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14BR) }, | |
1107 | { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3000) }, | |
1108 | { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3100) }, | |
1109 | /* 25 */{ USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_3) }, | |
1110 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_MYTV_T) }, | |
1111 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_HT_USB_XE) }, | |
1112 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_EXPRESSCARD_320CX) }, | |
1113 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV72E) }, | |
1114 | /* 30 */{ USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV73E) }, | |
1115 | { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_EC372S) }, | |
1116 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_HT_EXPRESS) }, | |
1117 | { 0 } /* Terminating entry */ | |
b7f54910 PB |
1118 | }; |
1119 | MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table); | |
1120 | ||
1121 | #define DIB0700_DEFAULT_DEVICE_PROPERTIES \ | |
1122 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, \ | |
1123 | .usb_ctrl = DEVICE_SPECIFIC, \ | |
74c78a26 | 1124 | .firmware = "dvb-usb-dib0700-1.10.fw", \ |
b7f54910 | 1125 | .download_firmware = dib0700_download_firmware, \ |
6958effe | 1126 | .no_reconnect = 1, \ |
b7f54910 | 1127 | .size_of_priv = sizeof(struct dib0700_state), \ |
6958effe PB |
1128 | .i2c_algo = &dib0700_i2c_algo, \ |
1129 | .identify_state = dib0700_identify_state | |
b7f54910 PB |
1130 | |
1131 | #define DIB0700_DEFAULT_STREAMING_CONFIG(ep) \ | |
1132 | .streaming_ctrl = dib0700_streaming_ctrl, \ | |
1133 | .stream = { \ | |
1134 | .type = USB_BULK, \ | |
1135 | .count = 4, \ | |
1136 | .endpoint = ep, \ | |
1137 | .u = { \ | |
1138 | .bulk = { \ | |
1139 | .buffersize = 39480, \ | |
1140 | } \ | |
1141 | } \ | |
1142 | } | |
1143 | ||
1144 | struct dvb_usb_device_properties dib0700_devices[] = { | |
1145 | { | |
1146 | DIB0700_DEFAULT_DEVICE_PROPERTIES, | |
1147 | ||
1148 | .num_adapters = 1, | |
1149 | .adapter = { | |
1150 | { | |
1151 | .frontend_attach = stk7700p_frontend_attach, | |
1152 | .tuner_attach = stk7700p_tuner_attach, | |
1153 | ||
1154 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), | |
1155 | }, | |
1156 | }, | |
1157 | ||
67053a40 | 1158 | .num_device_descs = 8, |
b7f54910 PB |
1159 | .devices = { |
1160 | { "DiBcom STK7700P reference design", | |
49a1376c | 1161 | { &dib0700_usb_id_table[0], &dib0700_usb_id_table[1] }, |
b7f54910 PB |
1162 | { NULL }, |
1163 | }, | |
1164 | { "Hauppauge Nova-T Stick", | |
f9aeba45 | 1165 | { &dib0700_usb_id_table[4], &dib0700_usb_id_table[9], NULL }, |
b7f54910 PB |
1166 | { NULL }, |
1167 | }, | |
1168 | { "AVerMedia AVerTV DVB-T Volar", | |
ced8feca | 1169 | { &dib0700_usb_id_table[5], &dib0700_usb_id_table[10] }, |
b7f54910 PB |
1170 | { NULL }, |
1171 | }, | |
49a1376c | 1172 | { "Compro Videomate U500", |
1f8ca4b3 | 1173 | { &dib0700_usb_id_table[6], &dib0700_usb_id_table[19] }, |
49a1376c | 1174 | { NULL }, |
0ce215e1 HS |
1175 | }, |
1176 | { "Uniwill STK7700P based (Hama and others)", | |
1177 | { &dib0700_usb_id_table[7], NULL }, | |
1178 | { NULL }, | |
8637a875 MK |
1179 | }, |
1180 | { "Leadtek Winfast DTV Dongle (STK7700P based)", | |
1181 | { &dib0700_usb_id_table[8], NULL }, | |
1182 | { NULL }, | |
fa3b877e JS |
1183 | }, |
1184 | { "AVerMedia AVerTV DVB-T Express", | |
1185 | { &dib0700_usb_id_table[20] }, | |
1186 | { NULL }, | |
67053a40 | 1187 | }, |
67053a40 | 1188 | { "Gigabyte U7000", |
1189 | { &dib0700_usb_id_table[21], NULL }, | |
1190 | { NULL }, | |
49a1376c | 1191 | } |
b1139e35 DS |
1192 | }, |
1193 | ||
1194 | .rc_interval = DEFAULT_RC_INTERVAL, | |
1195 | .rc_key_map = dib0700_rc_keys, | |
1196 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), | |
1197 | .rc_query = dib0700_rc_query | |
b7f54910 PB |
1198 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
1199 | ||
1200 | .num_adapters = 2, | |
1201 | .adapter = { | |
1202 | { | |
1203 | .frontend_attach = bristol_frontend_attach, | |
1204 | .tuner_attach = bristol_tuner_attach, | |
1205 | ||
1206 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), | |
1207 | }, { | |
1208 | .frontend_attach = bristol_frontend_attach, | |
1209 | .tuner_attach = bristol_tuner_attach, | |
1210 | ||
1211 | DIB0700_DEFAULT_STREAMING_CONFIG(0x03), | |
1212 | } | |
1213 | }, | |
1214 | ||
1215 | .num_device_descs = 1, | |
1216 | .devices = { | |
1217 | { "Hauppauge Nova-T 500 Dual DVB-T", | |
49a1376c | 1218 | { &dib0700_usb_id_table[2], &dib0700_usb_id_table[3], NULL }, |
b7f54910 PB |
1219 | { NULL }, |
1220 | }, | |
82f3d559 JG |
1221 | }, |
1222 | ||
1223 | .rc_interval = DEFAULT_RC_INTERVAL, | |
1224 | .rc_key_map = dib0700_rc_keys, | |
8779737b | 1225 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
82f3d559 | 1226 | .rc_query = dib0700_rc_query |
54d75eba OD |
1227 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
1228 | ||
1229 | .num_adapters = 2, | |
1230 | .adapter = { | |
1231 | { | |
1232 | .frontend_attach = stk7700d_frontend_attach, | |
1233 | .tuner_attach = stk7700d_tuner_attach, | |
1234 | ||
1235 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), | |
1236 | }, { | |
1237 | .frontend_attach = stk7700d_frontend_attach, | |
1238 | .tuner_attach = stk7700d_tuner_attach, | |
1239 | ||
1240 | DIB0700_DEFAULT_STREAMING_CONFIG(0x03), | |
1241 | } | |
1242 | }, | |
1243 | ||
b6884a17 | 1244 | .num_device_descs = 4, |
54d75eba OD |
1245 | .devices = { |
1246 | { "Pinnacle PCTV 2000e", | |
1247 | { &dib0700_usb_id_table[11], NULL }, | |
1248 | { NULL }, | |
1249 | }, | |
1250 | { "Terratec Cinergy DT XS Diversity", | |
1251 | { &dib0700_usb_id_table[12], NULL }, | |
1252 | { NULL }, | |
1253 | }, | |
faebb914 | 1254 | { "Hauppauge Nova-TD Stick/Elgato Eye-TV Diversity", |
54d75eba OD |
1255 | { &dib0700_usb_id_table[13], NULL }, |
1256 | { NULL }, | |
1257 | }, | |
01373a5c | 1258 | { "DiBcom STK7700D reference design", |
b6884a17 PB |
1259 | { &dib0700_usb_id_table[14], NULL }, |
1260 | { NULL }, | |
67053a40 | 1261 | } |
54d75eba | 1262 | }, |
82f3d559 | 1263 | |
54d75eba | 1264 | .rc_interval = DEFAULT_RC_INTERVAL, |
82f3d559 | 1265 | .rc_key_map = dib0700_rc_keys, |
8779737b | 1266 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
82f3d559 | 1267 | .rc_query = dib0700_rc_query |
01373a5c | 1268 | |
132c3188 DG |
1269 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
1270 | ||
1271 | .num_adapters = 1, | |
1272 | .adapter = { | |
1273 | { | |
1274 | .frontend_attach = stk7700P2_frontend_attach, | |
1275 | .tuner_attach = stk7700d_tuner_attach, | |
1276 | ||
1277 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), | |
1278 | }, | |
1279 | }, | |
1280 | ||
6ca8f0b9 | 1281 | .num_device_descs = 2, |
132c3188 DG |
1282 | .devices = { |
1283 | { "ASUS My Cinema U3000 Mini DVBT Tuner", | |
1284 | { &dib0700_usb_id_table[23], NULL }, | |
1285 | { NULL }, | |
1286 | }, | |
6ca8f0b9 AC |
1287 | { "Yuan EC372S", |
1288 | { &dib0700_usb_id_table[31], NULL }, | |
1289 | { NULL }, | |
1290 | } | |
132c3188 | 1291 | } |
01373a5c PB |
1292 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
1293 | ||
1294 | .num_adapters = 1, | |
1295 | .adapter = { | |
1296 | { | |
1297 | .frontend_attach = stk7070p_frontend_attach, | |
1298 | .tuner_attach = dib7070p_tuner_attach, | |
1299 | ||
1300 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), | |
1301 | ||
1302 | .size_of_priv = sizeof(struct dib0700_adapter_state), | |
1303 | }, | |
1304 | }, | |
1305 | ||
6ca8f0b9 | 1306 | .num_device_descs = 8, |
01373a5c PB |
1307 | .devices = { |
1308 | { "DiBcom STK7070P reference design", | |
1309 | { &dib0700_usb_id_table[15], NULL }, | |
1310 | { NULL }, | |
1311 | }, | |
1312 | { "Pinnacle PCTV DVB-T Flash Stick", | |
1313 | { &dib0700_usb_id_table[16], NULL }, | |
1314 | { NULL }, | |
1315 | }, | |
7999a816 YL |
1316 | { "Artec T14BR DVB-T", |
1317 | { &dib0700_usb_id_table[22], NULL }, | |
1318 | { NULL }, | |
132c3188 DG |
1319 | }, |
1320 | { "ASUS My Cinema U3100 Mini DVBT Tuner", | |
1321 | { &dib0700_usb_id_table[24], NULL }, | |
1322 | { NULL }, | |
1323 | }, | |
c7637b1a TT |
1324 | { "Hauppauge Nova-T Stick", |
1325 | { &dib0700_usb_id_table[25], NULL }, | |
1326 | { NULL }, | |
1327 | }, | |
13b83b5d DS |
1328 | { "Hauppauge Nova-T MyTV.t", |
1329 | { &dib0700_usb_id_table[26], NULL }, | |
1330 | { NULL }, | |
1331 | }, | |
6ca8f0b9 AC |
1332 | { "Pinnacle PCTV 72e", |
1333 | { &dib0700_usb_id_table[29], NULL }, | |
1334 | { NULL }, | |
1335 | }, | |
1336 | { "Pinnacle PCTV 73e", | |
1337 | { &dib0700_usb_id_table[30], NULL }, | |
1338 | { NULL }, | |
1339 | }, | |
c7637b1a TT |
1340 | }, |
1341 | ||
1342 | .rc_interval = DEFAULT_RC_INTERVAL, | |
1343 | .rc_key_map = dib0700_rc_keys, | |
1344 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), | |
1345 | .rc_query = dib0700_rc_query | |
1346 | ||
01373a5c PB |
1347 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
1348 | ||
1349 | .num_adapters = 2, | |
1350 | .adapter = { | |
1351 | { | |
1352 | .frontend_attach = stk7070pd_frontend_attach0, | |
1353 | .tuner_attach = dib7070p_tuner_attach, | |
1354 | ||
1355 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), | |
1356 | ||
1357 | .size_of_priv = sizeof(struct dib0700_adapter_state), | |
1358 | }, { | |
1359 | .frontend_attach = stk7070pd_frontend_attach1, | |
1360 | .tuner_attach = dib7070p_tuner_attach, | |
1361 | ||
1362 | DIB0700_DEFAULT_STREAMING_CONFIG(0x03), | |
1363 | ||
1364 | .size_of_priv = sizeof(struct dib0700_adapter_state), | |
1365 | } | |
1366 | }, | |
1367 | ||
1368 | .num_device_descs = 2, | |
1369 | .devices = { | |
1370 | { "DiBcom STK7070PD reference design", | |
1371 | { &dib0700_usb_id_table[17], NULL }, | |
1372 | { NULL }, | |
1373 | }, | |
1374 | { "Pinnacle PCTV Dual DVB-T Diversity Stick", | |
1375 | { &dib0700_usb_id_table[18], NULL }, | |
1376 | { NULL }, | |
67053a40 | 1377 | } |
01373a5c | 1378 | } |
6ca8f0b9 AC |
1379 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
1380 | ||
1381 | .num_adapters = 1, | |
1382 | .adapter = { | |
1383 | { | |
1384 | .frontend_attach = stk7700ph_frontend_attach, | |
1385 | .tuner_attach = stk7700ph_tuner_attach, | |
1386 | ||
1387 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), | |
1388 | ||
1389 | .size_of_priv = sizeof(struct | |
1390 | dib0700_adapter_state), | |
1391 | }, | |
1392 | }, | |
1393 | ||
1394 | .num_device_descs = 3, | |
1395 | .devices = { | |
1396 | { "Terratec Cinergy HT USB XE", | |
1397 | { &dib0700_usb_id_table[27], NULL }, | |
1398 | { NULL }, | |
1399 | }, | |
1400 | { "Pinnacle Expresscard 320cx", | |
1401 | { &dib0700_usb_id_table[28], NULL }, | |
1402 | { NULL }, | |
1403 | }, | |
1404 | { "Terratec Cinergy HT Express", | |
1405 | { &dib0700_usb_id_table[32], NULL }, | |
1406 | { NULL }, | |
1407 | }, | |
1408 | }, | |
1409 | .rc_interval = DEFAULT_RC_INTERVAL, | |
1410 | .rc_key_map = dib0700_rc_keys, | |
1411 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), | |
1412 | .rc_query = dib0700_rc_query | |
01373a5c | 1413 | }, |
b7f54910 PB |
1414 | }; |
1415 | ||
1416 | int dib0700_device_count = ARRAY_SIZE(dib0700_devices); |