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