V4L/DVB (7069): Support for myTV.t
[linux-2.6/verdex.git] / drivers / media / dvb / dvb-usb / dib0700_devices.c
blob36d29f9d2f6816849f382b8c3218d84ac507bfd1
1 /* Linux driver for devices based on the DiBcom DiB0700 USB bridge
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.
7 * Copyright (C) 2005-7 DiBcom, SA
8 */
9 #include "dib0700.h"
11 #include "dib3000mc.h"
12 #include "dib7000m.h"
13 #include "dib7000p.h"
14 #include "mt2060.h"
15 #include "mt2266.h"
16 #include "dib0070.h"
18 static int force_lna_activation;
19 module_param(force_lna_activation, int, 0644);
20 MODULE_PARM_DESC(force_lna_activation, "force the activation of Low-Noise-Amplifyer(s) (LNA), "
21 "if applicable for the device (default: 0=automatic/off).");
23 struct dib0700_adapter_state {
24 int (*set_param_save) (struct dvb_frontend *, struct dvb_frontend_parameters *);
27 /* Hauppauge Nova-T 500 (aka Bristol)
28 * has a LNA on GPIO0 which is enabled by setting 1 */
29 static struct mt2060_config bristol_mt2060_config[2] = {
31 .i2c_address = 0x60,
32 .clock_out = 3,
33 }, {
34 .i2c_address = 0x61,
38 static struct dibx000_agc_config bristol_dib3000p_mt2060_agc_config = {
39 .band_caps = BAND_VHF | BAND_UHF,
40 .setup = (1 << 8) | (5 << 5) | (0 << 4) | (0 << 3) | (0 << 2) | (2 << 0),
42 .agc1_max = 42598,
43 .agc1_min = 17694,
44 .agc2_max = 45875,
45 .agc2_min = 0,
47 .agc1_pt1 = 0,
48 .agc1_pt2 = 59,
50 .agc1_slope1 = 0,
51 .agc1_slope2 = 69,
53 .agc2_pt1 = 0,
54 .agc2_pt2 = 59,
56 .agc2_slope1 = 111,
57 .agc2_slope2 = 28,
60 static 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,
66 { .agc = &bristol_dib3000p_mt2060_agc_config,
67 .max_time = 0x196,
68 .ln_adc_level = 0x1cc7,
69 .output_mpeg2_in_188_bytes = 1,
73 static int bristol_frontend_attach(struct dvb_usb_adapter *adap)
75 struct dib0700_state *st = adap->dev->priv;
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);
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);
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;
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;
97 static int bristol_tuner_attach(struct dvb_usb_adapter *adap)
99 struct dib0700_state *st = adap->dev->priv;
100 struct i2c_adapter *tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe, 1);
101 return dvb_attach(mt2060_attach,adap->fe, tun_i2c, &bristol_mt2060_config[adap->id],
102 st->mt2060_if1[adap->id]) == NULL ? -ENODEV : 0;
105 /* STK7700D: Pinnacle/Terratec/Hauppauge Dual DVB-T Diversity */
107 /* MT226x */
108 static struct dibx000_agc_config stk7700d_7000p_mt2266_agc_config[2] = {
110 BAND_UHF, // band_caps
112 /* 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,
113 * 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 */
114 (0 << 15) | (0 << 14) | (1 << 11) | (1 << 10) | (1 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), // setup
116 1130, // inv_gain
117 21, // time_stabiliz
119 0, // alpha_level
120 118, // thlock
122 0, // wbd_inv
123 3530, // wbd_ref
124 1, // wbd_sel
125 0, // wbd_alpha
127 65535, // agc1_max
128 33770, // agc1_min
129 65535, // agc2_max
130 23592, // agc2_min
132 0, // agc1_pt1
133 62, // agc1_pt2
134 255, // agc1_pt3
135 64, // agc1_slope1
136 64, // agc1_slope2
137 132, // agc2_pt1
138 192, // agc2_pt2
139 80, // agc2_slope1
140 80, // agc2_slope2
142 17, // alpha_mant
143 27, // alpha_exp
144 23, // beta_mant
145 51, // beta_exp
147 1, // perform_agc_softsplit
148 }, {
149 BAND_VHF | BAND_LBAND, // band_caps
151 /* 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,
152 * 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 */
153 (0 << 15) | (0 << 14) | (1 << 11) | (1 << 10) | (1 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup
155 2372, // inv_gain
156 21, // time_stabiliz
158 0, // alpha_level
159 118, // thlock
161 0, // wbd_inv
162 3530, // wbd_ref
163 1, // wbd_sel
164 0, // wbd_alpha
166 65535, // agc1_max
167 0, // agc1_min
168 65535, // agc2_max
169 23592, // agc2_min
171 0, // agc1_pt1
172 128, // agc1_pt2
173 128, // agc1_pt3
174 128, // agc1_slope1
175 0, // agc1_slope2
176 128, // agc2_pt1
177 253, // agc2_pt2
178 81, // agc2_slope1
179 0, // agc2_slope2
181 17, // alpha_mant
182 27, // alpha_exp
183 23, // beta_mant
184 51, // beta_exp
186 1, // perform_agc_softsplit
190 static struct dibx000_bandwidth_config stk7700d_mt2266_pll_config = {
191 60000, 30000, // internal, sampling
192 1, 8, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass
193 0, 0, 1, 1, 2, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo
194 (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k
195 0, // ifreq
196 20452225, // timf
199 static struct dib7000p_config stk7700d_dib7000p_mt2266_config[] = {
200 { .output_mpeg2_in_188_bytes = 1,
201 .hostbus_diversity = 1,
202 .tuner_is_baseband = 1,
204 .agc_config_count = 2,
205 .agc = stk7700d_7000p_mt2266_agc_config,
206 .bw = &stk7700d_mt2266_pll_config,
208 .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
209 .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
210 .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
212 { .output_mpeg2_in_188_bytes = 1,
213 .hostbus_diversity = 1,
214 .tuner_is_baseband = 1,
216 .agc_config_count = 2,
217 .agc = stk7700d_7000p_mt2266_agc_config,
218 .bw = &stk7700d_mt2266_pll_config,
220 .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
221 .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
222 .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
226 static struct mt2266_config stk7700d_mt2266_config[2] = {
227 { .i2c_address = 0x60
229 { .i2c_address = 0x60
233 static int stk7700P2_frontend_attach(struct dvb_usb_adapter *adap)
235 if (adap->id == 0) {
236 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
237 msleep(10);
238 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
239 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
240 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
241 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
242 msleep(10);
243 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
244 msleep(10);
245 dib7000p_i2c_enumeration(&adap->dev->i2c_adap,1,18,stk7700d_dib7000p_mt2266_config);
248 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap,0x80+(adap->id << 1),
249 &stk7700d_dib7000p_mt2266_config[adap->id]);
251 return adap->fe == NULL ? -ENODEV : 0;
254 static int stk7700d_frontend_attach(struct dvb_usb_adapter *adap)
256 if (adap->id == 0) {
257 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
258 msleep(10);
259 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
260 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
261 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
262 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
263 msleep(10);
264 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
265 msleep(10);
266 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
267 dib7000p_i2c_enumeration(&adap->dev->i2c_adap,2,18,stk7700d_dib7000p_mt2266_config);
270 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap,0x80+(adap->id << 1),
271 &stk7700d_dib7000p_mt2266_config[adap->id]);
273 return adap->fe == NULL ? -ENODEV : 0;
276 static int stk7700d_tuner_attach(struct dvb_usb_adapter *adap)
278 struct i2c_adapter *tun_i2c;
279 tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1);
280 return dvb_attach(mt2266_attach, adap->fe, tun_i2c,
281 &stk7700d_mt2266_config[adap->id]) == NULL ? -ENODEV : 0;;
284 #define DEFAULT_RC_INTERVAL 150
286 static u8 rc_request[] = { REQUEST_POLL_RC, 0 };
288 static int dib0700_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
290 u8 key[4];
291 int i;
292 struct dvb_usb_rc_key *keymap = d->props.rc_key_map;
293 struct dib0700_state *st = d->priv;
294 *event = 0;
295 *state = REMOTE_NO_KEY_PRESSED;
296 i=dib0700_ctrl_rd(d,rc_request,2,key,4);
297 if (i<=0) {
298 err("RC Query Failed");
299 return -1;
301 if (key[0]==0 && key[1]==0 && key[2]==0 && key[3]==0) return 0;
302 if (key[3-1]!=st->rc_toggle) {
303 for (i=0;i<d->props.rc_key_map_size; i++) {
304 if (keymap[i].custom == key[3-2] && keymap[i].data == key[3-3]) {
305 *event = keymap[i].event;
306 *state = REMOTE_KEY_PRESSED;
307 st->rc_toggle=key[3-1];
308 return 0;
311 err("Unknown remote controller key : %2X %2X",(int)key[3-2],(int)key[3-3]);
313 return 0;
316 static struct dvb_usb_rc_key dib0700_rc_keys[] = {
317 /* Key codes for the tiny Pinnacle remote*/
318 { 0x07, 0x00, KEY_MUTE },
319 { 0x07, 0x01, KEY_MENU }, // Pinnacle logo
320 { 0x07, 0x39, KEY_POWER },
321 { 0x07, 0x03, KEY_VOLUMEUP },
322 { 0x07, 0x09, KEY_VOLUMEDOWN },
323 { 0x07, 0x06, KEY_CHANNELUP },
324 { 0x07, 0x0c, KEY_CHANNELDOWN },
325 { 0x07, 0x0f, KEY_1 },
326 { 0x07, 0x15, KEY_2 },
327 { 0x07, 0x10, KEY_3 },
328 { 0x07, 0x18, KEY_4 },
329 { 0x07, 0x1b, KEY_5 },
330 { 0x07, 0x1e, KEY_6 },
331 { 0x07, 0x11, KEY_7 },
332 { 0x07, 0x21, KEY_8 },
333 { 0x07, 0x12, KEY_9 },
334 { 0x07, 0x27, KEY_0 },
335 { 0x07, 0x24, KEY_SCREEN }, // 'Square' key
336 { 0x07, 0x2a, KEY_TEXT }, // 'T' key
337 { 0x07, 0x2d, KEY_REWIND },
338 { 0x07, 0x30, KEY_PLAY },
339 { 0x07, 0x33, KEY_FASTFORWARD },
340 { 0x07, 0x36, KEY_RECORD },
341 { 0x07, 0x3c, KEY_STOP },
342 { 0x07, 0x3f, KEY_CANCEL }, // '?' key
343 /* Key codes for the Terratec Cinergy DT XS Diversity, similar to cinergyT2.c */
344 { 0xeb, 0x01, KEY_POWER },
345 { 0xeb, 0x02, KEY_1 },
346 { 0xeb, 0x03, KEY_2 },
347 { 0xeb, 0x04, KEY_3 },
348 { 0xeb, 0x05, KEY_4 },
349 { 0xeb, 0x06, KEY_5 },
350 { 0xeb, 0x07, KEY_6 },
351 { 0xeb, 0x08, KEY_7 },
352 { 0xeb, 0x09, KEY_8 },
353 { 0xeb, 0x0a, KEY_9 },
354 { 0xeb, 0x0b, KEY_VIDEO },
355 { 0xeb, 0x0c, KEY_0 },
356 { 0xeb, 0x0d, KEY_REFRESH },
357 { 0xeb, 0x0f, KEY_EPG },
358 { 0xeb, 0x10, KEY_UP },
359 { 0xeb, 0x11, KEY_LEFT },
360 { 0xeb, 0x12, KEY_OK },
361 { 0xeb, 0x13, KEY_RIGHT },
362 { 0xeb, 0x14, KEY_DOWN },
363 { 0xeb, 0x16, KEY_INFO },
364 { 0xeb, 0x17, KEY_RED },
365 { 0xeb, 0x18, KEY_GREEN },
366 { 0xeb, 0x19, KEY_YELLOW },
367 { 0xeb, 0x1a, KEY_BLUE },
368 { 0xeb, 0x1b, KEY_CHANNELUP },
369 { 0xeb, 0x1c, KEY_VOLUMEUP },
370 { 0xeb, 0x1d, KEY_MUTE },
371 { 0xeb, 0x1e, KEY_VOLUMEDOWN },
372 { 0xeb, 0x1f, KEY_CHANNELDOWN },
373 { 0xeb, 0x40, KEY_PAUSE },
374 { 0xeb, 0x41, KEY_HOME },
375 { 0xeb, 0x42, KEY_MENU }, /* DVD Menu */
376 { 0xeb, 0x43, KEY_SUBTITLE },
377 { 0xeb, 0x44, KEY_TEXT }, /* Teletext */
378 { 0xeb, 0x45, KEY_DELETE },
379 { 0xeb, 0x46, KEY_TV },
380 { 0xeb, 0x47, KEY_DVD },
381 { 0xeb, 0x48, KEY_STOP },
382 { 0xeb, 0x49, KEY_VIDEO },
383 { 0xeb, 0x4a, KEY_AUDIO }, /* Music */
384 { 0xeb, 0x4b, KEY_SCREEN }, /* Pic */
385 { 0xeb, 0x4c, KEY_PLAY },
386 { 0xeb, 0x4d, KEY_BACK },
387 { 0xeb, 0x4e, KEY_REWIND },
388 { 0xeb, 0x4f, KEY_FASTFORWARD },
389 { 0xeb, 0x54, KEY_PREVIOUS },
390 { 0xeb, 0x58, KEY_RECORD },
391 { 0xeb, 0x5c, KEY_NEXT },
393 /* Key codes for the Haupauge WinTV Nova-TD, copied from nova-t-usb2.c (Nova-T USB2) */
394 { 0x1e, 0x00, KEY_0 },
395 { 0x1e, 0x01, KEY_1 },
396 { 0x1e, 0x02, KEY_2 },
397 { 0x1e, 0x03, KEY_3 },
398 { 0x1e, 0x04, KEY_4 },
399 { 0x1e, 0x05, KEY_5 },
400 { 0x1e, 0x06, KEY_6 },
401 { 0x1e, 0x07, KEY_7 },
402 { 0x1e, 0x08, KEY_8 },
403 { 0x1e, 0x09, KEY_9 },
404 { 0x1e, 0x0a, KEY_KPASTERISK },
405 { 0x1e, 0x0b, KEY_RED },
406 { 0x1e, 0x0c, KEY_RADIO },
407 { 0x1e, 0x0d, KEY_MENU },
408 { 0x1e, 0x0e, KEY_GRAVE }, /* # */
409 { 0x1e, 0x0f, KEY_MUTE },
410 { 0x1e, 0x10, KEY_VOLUMEUP },
411 { 0x1e, 0x11, KEY_VOLUMEDOWN },
412 { 0x1e, 0x12, KEY_CHANNEL },
413 { 0x1e, 0x14, KEY_UP },
414 { 0x1e, 0x15, KEY_DOWN },
415 { 0x1e, 0x16, KEY_LEFT },
416 { 0x1e, 0x17, KEY_RIGHT },
417 { 0x1e, 0x18, KEY_VIDEO },
418 { 0x1e, 0x19, KEY_AUDIO },
419 { 0x1e, 0x1a, KEY_MEDIA },
420 { 0x1e, 0x1b, KEY_EPG },
421 { 0x1e, 0x1c, KEY_TV },
422 { 0x1e, 0x1e, KEY_NEXT },
423 { 0x1e, 0x1f, KEY_BACK },
424 { 0x1e, 0x20, KEY_CHANNELUP },
425 { 0x1e, 0x21, KEY_CHANNELDOWN },
426 { 0x1e, 0x24, KEY_LAST }, /* Skip backwards */
427 { 0x1e, 0x25, KEY_OK },
428 { 0x1e, 0x29, KEY_BLUE},
429 { 0x1e, 0x2e, KEY_GREEN },
430 { 0x1e, 0x30, KEY_PAUSE },
431 { 0x1e, 0x32, KEY_REWIND },
432 { 0x1e, 0x34, KEY_FASTFORWARD },
433 { 0x1e, 0x35, KEY_PLAY },
434 { 0x1e, 0x36, KEY_STOP },
435 { 0x1e, 0x37, KEY_RECORD },
436 { 0x1e, 0x38, KEY_YELLOW },
437 { 0x1e, 0x3b, KEY_GOTO },
438 { 0x1e, 0x3d, KEY_POWER },
440 /* Key codes for the Leadtek Winfast DTV Dongle */
441 { 0x00, 0x42, KEY_POWER },
442 { 0x07, 0x7c, KEY_TUNER },
443 { 0x0f, 0x4e, KEY_PRINT }, /* PREVIEW */
444 { 0x08, 0x40, KEY_SCREEN }, /* full screen toggle*/
445 { 0x0f, 0x71, KEY_DOT }, /* frequency */
446 { 0x07, 0x43, KEY_0 },
447 { 0x0c, 0x41, KEY_1 },
448 { 0x04, 0x43, KEY_2 },
449 { 0x0b, 0x7f, KEY_3 },
450 { 0x0e, 0x41, KEY_4 },
451 { 0x06, 0x43, KEY_5 },
452 { 0x09, 0x7f, KEY_6 },
453 { 0x0d, 0x7e, KEY_7 },
454 { 0x05, 0x7c, KEY_8 },
455 { 0x0a, 0x40, KEY_9 },
456 { 0x0e, 0x4e, KEY_CLEAR },
457 { 0x04, 0x7c, KEY_CHANNEL }, /* show channel number */
458 { 0x0f, 0x41, KEY_LAST }, /* recall */
459 { 0x03, 0x42, KEY_MUTE },
460 { 0x06, 0x4c, KEY_RESERVED }, /* PIP button*/
461 { 0x01, 0x72, KEY_SHUFFLE }, /* SNAPSHOT */
462 { 0x0c, 0x4e, KEY_PLAYPAUSE }, /* TIMESHIFT */
463 { 0x0b, 0x70, KEY_RECORD },
464 { 0x03, 0x7d, KEY_VOLUMEUP },
465 { 0x01, 0x7d, KEY_VOLUMEDOWN },
466 { 0x02, 0x42, KEY_CHANNELUP },
467 { 0x00, 0x7d, KEY_CHANNELDOWN },
470 /* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */
471 static struct dibx000_agc_config stk7700p_7000m_mt2060_agc_config = {
472 BAND_UHF | BAND_VHF, // band_caps
474 /* 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,
475 * 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 */
476 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup
478 712, // inv_gain
479 41, // time_stabiliz
481 0, // alpha_level
482 118, // thlock
484 0, // wbd_inv
485 4095, // wbd_ref
486 0, // wbd_sel
487 0, // wbd_alpha
489 42598, // agc1_max
490 17694, // agc1_min
491 45875, // agc2_max
492 2621, // agc2_min
493 0, // agc1_pt1
494 76, // agc1_pt2
495 139, // agc1_pt3
496 52, // agc1_slope1
497 59, // agc1_slope2
498 107, // agc2_pt1
499 172, // agc2_pt2
500 57, // agc2_slope1
501 70, // agc2_slope2
503 21, // alpha_mant
504 25, // alpha_exp
505 28, // beta_mant
506 48, // beta_exp
508 1, // perform_agc_softsplit
509 { 0, // split_min
510 107, // split_max
511 51800, // global_split_min
512 24700 // global_split_max
516 static struct dibx000_agc_config stk7700p_7000p_mt2060_agc_config = {
517 BAND_UHF | BAND_VHF,
519 /* 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,
520 * 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 */
521 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup
523 712, // inv_gain
524 41, // time_stabiliz
526 0, // alpha_level
527 118, // thlock
529 0, // wbd_inv
530 4095, // wbd_ref
531 0, // wbd_sel
532 0, // wbd_alpha
534 42598, // agc1_max
535 16384, // agc1_min
536 42598, // agc2_max
537 0, // agc2_min
539 0, // agc1_pt1
540 137, // agc1_pt2
541 255, // agc1_pt3
543 0, // agc1_slope1
544 255, // agc1_slope2
546 0, // agc2_pt1
547 0, // agc2_pt2
549 0, // agc2_slope1
550 41, // agc2_slope2
552 15, // alpha_mant
553 25, // alpha_exp
555 28, // beta_mant
556 48, // beta_exp
558 0, // perform_agc_softsplit
561 static struct dibx000_bandwidth_config stk7700p_pll_config = {
562 60000, 30000, // internal, sampling
563 1, 8, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass
564 0, 0, 1, 1, 0, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo
565 (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k
566 60258167, // ifreq
567 20452225, // timf
568 30000000, // xtal
571 static struct dib7000m_config stk7700p_dib7000m_config = {
572 .dvbt_mode = 1,
573 .output_mpeg2_in_188_bytes = 1,
574 .quartz_direct = 1,
576 .agc_config_count = 1,
577 .agc = &stk7700p_7000m_mt2060_agc_config,
578 .bw = &stk7700p_pll_config,
580 .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS,
581 .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES,
582 .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS,
585 static struct dib7000p_config stk7700p_dib7000p_config = {
586 .output_mpeg2_in_188_bytes = 1,
588 .agc_config_count = 1,
589 .agc = &stk7700p_7000p_mt2060_agc_config,
590 .bw = &stk7700p_pll_config,
592 .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS,
593 .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES,
594 .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS,
597 static int stk7700p_frontend_attach(struct dvb_usb_adapter *adap)
599 struct dib0700_state *st = adap->dev->priv;
600 /* unless there is no real power management in DVB - we leave the device on GPIO6 */
602 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
603 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(50);
605 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10);
606 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
608 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10);
609 dib0700_ctrl_clock(adap->dev, 72, 1);
610 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(100);
612 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
614 st->mt2060_if1[0] = 1220;
616 if (dib7000pc_detection(&adap->dev->i2c_adap)) {
617 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000p_config);
618 st->is_dib7000pc = 1;
619 } else
620 adap->fe = dvb_attach(dib7000m_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000m_config);
622 return adap->fe == NULL ? -ENODEV : 0;
625 static struct mt2060_config stk7700p_mt2060_config = {
626 0x60
629 static int stk7700p_tuner_attach(struct dvb_usb_adapter *adap)
631 struct dib0700_state *st = adap->dev->priv;
632 struct i2c_adapter *tun_i2c;
634 if (st->is_dib7000pc)
635 tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1);
636 else
637 tun_i2c = dib7000m_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1);
639 return dvb_attach(mt2060_attach, adap->fe, tun_i2c, &stk7700p_mt2060_config,
640 st->mt2060_if1[0]) == NULL ? -ENODEV : 0;
643 /* DIB7070 generic */
644 static struct dibx000_agc_config dib7070_agc_config = {
645 BAND_UHF | BAND_VHF | BAND_LBAND | BAND_SBAND,
646 /* 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,
647 * 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 */
648 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), // setup
650 600, // inv_gain
651 10, // time_stabiliz
653 0, // alpha_level
654 118, // thlock
656 0, // wbd_inv
657 3530, // wbd_ref
658 1, // wbd_sel
659 5, // wbd_alpha
661 65535, // agc1_max
662 0, // agc1_min
664 65535, // agc2_max
665 0, // agc2_min
667 0, // agc1_pt1
668 40, // agc1_pt2
669 183, // agc1_pt3
670 206, // agc1_slope1
671 255, // agc1_slope2
672 72, // agc2_pt1
673 152, // agc2_pt2
674 88, // agc2_slope1
675 90, // agc2_slope2
677 17, // alpha_mant
678 27, // alpha_exp
679 23, // beta_mant
680 51, // beta_exp
682 0, // perform_agc_softsplit
685 static int dib7070_tuner_reset(struct dvb_frontend *fe, int onoff)
687 return dib7000p_set_gpio(fe, 8, 0, !onoff);
690 static int dib7070_tuner_sleep(struct dvb_frontend *fe, int onoff)
692 return dib7000p_set_gpio(fe, 9, 0, onoff);
695 static struct dib0070_config dib7070p_dib0070_config[2] = {
697 .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS,
698 .reset = dib7070_tuner_reset,
699 .sleep = dib7070_tuner_sleep,
700 .clock_khz = 12000,
701 .clock_pad_drive = 4
702 }, {
703 .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS,
704 .reset = dib7070_tuner_reset,
705 .sleep = dib7070_tuner_sleep,
706 .clock_khz = 12000,
711 static int dib7070_set_param_override(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep)
713 struct dvb_usb_adapter *adap = fe->dvb->priv;
714 struct dib0700_adapter_state *state = adap->priv;
716 u16 offset;
717 u8 band = BAND_OF_FREQUENCY(fep->frequency/1000);
718 switch (band) {
719 case BAND_VHF: offset = 950; break;
720 case BAND_UHF:
721 default: offset = 550; break;
723 deb_info("WBD for DiB7000P: %d\n", offset + dib0070_wbd_offset(fe));
724 dib7000p_set_wbd_ref(fe, offset + dib0070_wbd_offset(fe));
725 return state->set_param_save(fe, fep);
728 static int dib7070p_tuner_attach(struct dvb_usb_adapter *adap)
730 struct dib0700_adapter_state *st = adap->priv;
731 struct i2c_adapter *tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1);
733 if (adap->id == 0) {
734 if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, &dib7070p_dib0070_config[0]) == NULL)
735 return -ENODEV;
736 } else {
737 if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, &dib7070p_dib0070_config[1]) == NULL)
738 return -ENODEV;
741 st->set_param_save = adap->fe->ops.tuner_ops.set_params;
742 adap->fe->ops.tuner_ops.set_params = dib7070_set_param_override;
743 return 0;
746 static struct dibx000_bandwidth_config dib7070_bw_config_12_mhz = {
747 60000, 15000, // internal, sampling
748 1, 20, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass
749 0, 0, 1, 1, 2, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo
750 (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k
751 (0 << 25) | 0, // ifreq = 0.000000 MHz
752 20452225, // timf
753 12000000, // xtal_hz
756 static struct dib7000p_config dib7070p_dib7000p_config = {
757 .output_mpeg2_in_188_bytes = 1,
759 .agc_config_count = 1,
760 .agc = &dib7070_agc_config,
761 .bw = &dib7070_bw_config_12_mhz,
763 .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
764 .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
765 .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
767 .hostbus_diversity = 1,
770 /* STK7070P */
771 static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap)
773 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
774 msleep(10);
775 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
776 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
777 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
778 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
780 dib0700_ctrl_clock(adap->dev, 72, 1);
782 msleep(10);
783 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
784 msleep(10);
785 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
787 dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, &dib7070p_dib7000p_config);
789 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, &dib7070p_dib7000p_config);
790 return adap->fe == NULL ? -ENODEV : 0;
793 /* STK7070PD */
794 static struct dib7000p_config stk7070pd_dib7000p_config[2] = {
796 .output_mpeg2_in_188_bytes = 1,
798 .agc_config_count = 1,
799 .agc = &dib7070_agc_config,
800 .bw = &dib7070_bw_config_12_mhz,
802 .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
803 .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
804 .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
806 .hostbus_diversity = 1,
807 }, {
808 .output_mpeg2_in_188_bytes = 1,
810 .agc_config_count = 1,
811 .agc = &dib7070_agc_config,
812 .bw = &dib7070_bw_config_12_mhz,
814 .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
815 .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
816 .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
818 .hostbus_diversity = 1,
822 static int stk7070pd_frontend_attach0(struct dvb_usb_adapter *adap)
824 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
825 msleep(10);
826 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
827 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
828 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
829 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
831 dib0700_ctrl_clock(adap->dev, 72, 1);
833 msleep(10);
834 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
835 msleep(10);
836 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
838 dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 2, 18, stk7070pd_dib7000p_config);
840 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, &stk7070pd_dib7000p_config[0]);
841 return adap->fe == NULL ? -ENODEV : 0;
844 static int stk7070pd_frontend_attach1(struct dvb_usb_adapter *adap)
846 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x82, &stk7070pd_dib7000p_config[1]);
847 return adap->fe == NULL ? -ENODEV : 0;
850 /* DVB-USB and USB stuff follows */
851 struct usb_device_id dib0700_usb_id_table[] = {
852 /* 0 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P) },
853 { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P_PC) },
855 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500) },
856 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500_2) },
857 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK) },
858 /* 5 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR) },
859 { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500) },
860 { USB_DEVICE(USB_VID_UNIWILL, USB_PID_UNIWILL_STK7700P) },
861 { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_STK7700P) },
862 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_2) },
863 /* 10 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR_2) },
864 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV2000E) },
865 { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY) },
866 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_TD_STICK) },
867 { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700D) },
868 /* 15 */{ USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070P) },
869 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV_DVB_T_FLASH) },
870 { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070PD) },
871 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T) },
872 { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500_PC) },
873 /* 20 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_EXPRESS) },
874 { USB_DEVICE(USB_VID_GIGABYTE, USB_PID_GIGABYTE_U7000) },
875 { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14BR) },
876 { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3000) },
877 { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3100) },
878 /* 25 */ { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_3) },
879 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_MYTV_T) },
880 { 0 } /* Terminating entry */
882 MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table);
884 #define DIB0700_DEFAULT_DEVICE_PROPERTIES \
885 .caps = DVB_USB_IS_AN_I2C_ADAPTER, \
886 .usb_ctrl = DEVICE_SPECIFIC, \
887 .firmware = "dvb-usb-dib0700-1.10.fw", \
888 .download_firmware = dib0700_download_firmware, \
889 .no_reconnect = 1, \
890 .size_of_priv = sizeof(struct dib0700_state), \
891 .i2c_algo = &dib0700_i2c_algo, \
892 .identify_state = dib0700_identify_state
894 #define DIB0700_DEFAULT_STREAMING_CONFIG(ep) \
895 .streaming_ctrl = dib0700_streaming_ctrl, \
896 .stream = { \
897 .type = USB_BULK, \
898 .count = 4, \
899 .endpoint = ep, \
900 .u = { \
901 .bulk = { \
902 .buffersize = 39480, \
907 struct dvb_usb_device_properties dib0700_devices[] = {
909 DIB0700_DEFAULT_DEVICE_PROPERTIES,
911 .num_adapters = 1,
912 .adapter = {
914 .frontend_attach = stk7700p_frontend_attach,
915 .tuner_attach = stk7700p_tuner_attach,
917 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
921 .num_device_descs = 8,
922 .devices = {
923 { "DiBcom STK7700P reference design",
924 { &dib0700_usb_id_table[0], &dib0700_usb_id_table[1] },
925 { NULL },
927 { "Hauppauge Nova-T Stick",
928 { &dib0700_usb_id_table[4], &dib0700_usb_id_table[9], NULL },
929 { NULL },
931 { "AVerMedia AVerTV DVB-T Volar",
932 { &dib0700_usb_id_table[5], &dib0700_usb_id_table[10] },
933 { NULL },
935 { "Compro Videomate U500",
936 { &dib0700_usb_id_table[6], &dib0700_usb_id_table[19] },
937 { NULL },
939 { "Uniwill STK7700P based (Hama and others)",
940 { &dib0700_usb_id_table[7], NULL },
941 { NULL },
943 { "Leadtek Winfast DTV Dongle (STK7700P based)",
944 { &dib0700_usb_id_table[8], NULL },
945 { NULL },
947 { "AVerMedia AVerTV DVB-T Express",
948 { &dib0700_usb_id_table[20] },
949 { NULL },
951 { "Gigabyte U7000",
952 { &dib0700_usb_id_table[21], NULL },
953 { NULL },
957 .rc_interval = DEFAULT_RC_INTERVAL,
958 .rc_key_map = dib0700_rc_keys,
959 .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys),
960 .rc_query = dib0700_rc_query
961 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
963 .num_adapters = 2,
964 .adapter = {
966 .frontend_attach = bristol_frontend_attach,
967 .tuner_attach = bristol_tuner_attach,
969 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
970 }, {
971 .frontend_attach = bristol_frontend_attach,
972 .tuner_attach = bristol_tuner_attach,
974 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
978 .num_device_descs = 1,
979 .devices = {
980 { "Hauppauge Nova-T 500 Dual DVB-T",
981 { &dib0700_usb_id_table[2], &dib0700_usb_id_table[3], NULL },
982 { NULL },
986 .rc_interval = DEFAULT_RC_INTERVAL,
987 .rc_key_map = dib0700_rc_keys,
988 .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys),
989 .rc_query = dib0700_rc_query
990 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
992 .num_adapters = 2,
993 .adapter = {
995 .frontend_attach = stk7700d_frontend_attach,
996 .tuner_attach = stk7700d_tuner_attach,
998 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
999 }, {
1000 .frontend_attach = stk7700d_frontend_attach,
1001 .tuner_attach = stk7700d_tuner_attach,
1003 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
1007 .num_device_descs = 4,
1008 .devices = {
1009 { "Pinnacle PCTV 2000e",
1010 { &dib0700_usb_id_table[11], NULL },
1011 { NULL },
1013 { "Terratec Cinergy DT XS Diversity",
1014 { &dib0700_usb_id_table[12], NULL },
1015 { NULL },
1017 { "Hauppauge Nova-TD Stick/Elgato Eye-TV Diversity",
1018 { &dib0700_usb_id_table[13], NULL },
1019 { NULL },
1021 { "DiBcom STK7700D reference design",
1022 { &dib0700_usb_id_table[14], NULL },
1023 { NULL },
1027 .rc_interval = DEFAULT_RC_INTERVAL,
1028 .rc_key_map = dib0700_rc_keys,
1029 .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys),
1030 .rc_query = dib0700_rc_query
1032 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
1034 .num_adapters = 1,
1035 .adapter = {
1037 .frontend_attach = stk7700P2_frontend_attach,
1038 .tuner_attach = stk7700d_tuner_attach,
1040 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
1044 .num_device_descs = 1,
1045 .devices = {
1046 { "ASUS My Cinema U3000 Mini DVBT Tuner",
1047 { &dib0700_usb_id_table[23], NULL },
1048 { NULL },
1051 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
1053 .num_adapters = 1,
1054 .adapter = {
1056 .frontend_attach = stk7070p_frontend_attach,
1057 .tuner_attach = dib7070p_tuner_attach,
1059 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
1061 .size_of_priv = sizeof(struct dib0700_adapter_state),
1065 .num_device_descs = 6,
1066 .devices = {
1067 { "DiBcom STK7070P reference design",
1068 { &dib0700_usb_id_table[15], NULL },
1069 { NULL },
1071 { "Pinnacle PCTV DVB-T Flash Stick",
1072 { &dib0700_usb_id_table[16], NULL },
1073 { NULL },
1075 { "Artec T14BR DVB-T",
1076 { &dib0700_usb_id_table[22], NULL },
1077 { NULL },
1079 { "ASUS My Cinema U3100 Mini DVBT Tuner",
1080 { &dib0700_usb_id_table[24], NULL },
1081 { NULL },
1083 { "Hauppauge Nova-T Stick",
1084 { &dib0700_usb_id_table[25], NULL },
1085 { NULL },
1087 { "Hauppauge Nova-T MyTV.t",
1088 { &dib0700_usb_id_table[26], NULL },
1089 { NULL },
1093 .rc_interval = DEFAULT_RC_INTERVAL,
1094 .rc_key_map = dib0700_rc_keys,
1095 .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys),
1096 .rc_query = dib0700_rc_query
1098 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
1100 .num_adapters = 2,
1101 .adapter = {
1103 .frontend_attach = stk7070pd_frontend_attach0,
1104 .tuner_attach = dib7070p_tuner_attach,
1106 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
1108 .size_of_priv = sizeof(struct dib0700_adapter_state),
1109 }, {
1110 .frontend_attach = stk7070pd_frontend_attach1,
1111 .tuner_attach = dib7070p_tuner_attach,
1113 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
1115 .size_of_priv = sizeof(struct dib0700_adapter_state),
1119 .num_device_descs = 2,
1120 .devices = {
1121 { "DiBcom STK7070PD reference design",
1122 { &dib0700_usb_id_table[17], NULL },
1123 { NULL },
1125 { "Pinnacle PCTV Dual DVB-T Diversity Stick",
1126 { &dib0700_usb_id_table[18], NULL },
1127 { NULL },
1133 int dib0700_device_count = ARRAY_SIZE(dib0700_devices);