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
11 #include "dib3000mc.h"
16 #include "tuner-xc2028.h"
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).");
24 struct dib0700_adapter_state {
25 int (*set_param_save) (struct dvb_frontend *, struct dvb_frontend_parameters *);
28 /* Hauppauge Nova-T 500 (aka Bristol)
29 * has a LNA on GPIO0 which is enabled by setting 1 */
30 static struct mt2060_config bristol_mt2060_config[2] = {
39 static struct dibx000_agc_config bristol_dib3000p_mt2060_agc_config = {
40 .band_caps = BAND_VHF | BAND_UHF,
41 .setup = (1 << 8) | (5 << 5) | (0 << 4) | (0 << 3) | (0 << 2) | (2 << 0),
61 static struct dib3000mc_config bristol_dib3000mc_config[2] = {
62 { .agc = &bristol_dib3000p_mt2060_agc_config,
64 .ln_adc_level = 0x1cc7,
65 .output_mpeg2_in_188_bytes = 1,
67 { .agc = &bristol_dib3000p_mt2060_agc_config,
69 .ln_adc_level = 0x1cc7,
70 .output_mpeg2_in_188_bytes = 1,
74 static int bristol_frontend_attach(struct dvb_usb_adapter *adap)
76 struct dib0700_state *st = adap->dev->priv;
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);
83 if (force_lna_activation)
84 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
86 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 0);
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);
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;
98 static int eeprom_read(struct i2c_adapter *adap,u8 adrs,u8 *pval)
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 },
104 if (i2c_transfer(adap, msg, 2) != 2) return -EREMOTEIO;
108 static int bristol_tuner_attach(struct dvb_usb_adapter *adap)
110 struct i2c_adapter *prim_i2c = &adap->dev->i2c_adap;
111 struct i2c_adapter *tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe, 1);
114 if (adap->dev->udev->descriptor.idVendor == cpu_to_le16(USB_VID_HAUPPAUGE) &&
115 adap->dev->udev->descriptor.idProduct == cpu_to_le16(USB_PID_HAUPPAUGE_NOVA_T_500_2)) {
116 if (!eeprom_read(prim_i2c,0x59 + adap->id,&a)) if1=1220+a;
118 return dvb_attach(mt2060_attach,adap->fe, tun_i2c,&bristol_mt2060_config[adap->id],
119 if1) == NULL ? -ENODEV : 0;
122 /* STK7700D: Pinnacle/Terratec/Hauppauge Dual DVB-T Diversity */
125 static struct dibx000_agc_config stk7700d_7000p_mt2266_agc_config[2] = {
127 BAND_UHF, // band_caps
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
164 1, // perform_agc_softsplit
166 BAND_VHF | BAND_LBAND, // band_caps
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
203 1, // perform_agc_softsplit
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
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,
221 .agc_config_count = 2,
222 .agc = stk7700d_7000p_mt2266_agc_config,
223 .bw = &stk7700d_mt2266_pll_config,
225 .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
226 .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
227 .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
229 { .output_mpeg2_in_188_bytes = 1,
230 .hostbus_diversity = 1,
231 .tuner_is_baseband = 1,
233 .agc_config_count = 2,
234 .agc = stk7700d_7000p_mt2266_agc_config,
235 .bw = &stk7700d_mt2266_pll_config,
237 .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
238 .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
239 .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
243 static struct mt2266_config stk7700d_mt2266_config[2] = {
244 { .i2c_address = 0x60
246 { .i2c_address = 0x60
250 static int stk7700P2_frontend_attach(struct dvb_usb_adapter *adap)
253 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
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);
260 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
262 dib7000p_i2c_enumeration(&adap->dev->i2c_adap,1,18,stk7700d_dib7000p_mt2266_config);
265 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap,0x80+(adap->id << 1),
266 &stk7700d_dib7000p_mt2266_config[adap->id]);
268 return adap->fe == NULL ? -ENODEV : 0;
271 static int stk7700d_frontend_attach(struct dvb_usb_adapter *adap)
274 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
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);
281 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
283 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
284 dib7000p_i2c_enumeration(&adap->dev->i2c_adap,2,18,stk7700d_dib7000p_mt2266_config);
287 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap,0x80+(adap->id << 1),
288 &stk7700d_dib7000p_mt2266_config[adap->id]);
290 return adap->fe == NULL ? -ENODEV : 0;
293 static int stk7700d_tuner_attach(struct dvb_usb_adapter *adap)
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;;
301 /* STK7700-PH: Digital/Analog Hybrid Tuner, e.h. Cinergy HT USB HE */
302 static struct dibx000_agc_config xc3028_agc_config = {
303 BAND_VHF | BAND_UHF, /* band_caps */
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 */
312 21, /* time_stabiliz */
324 39718, /* agc2_max */
333 29, /* agc2_slope1 */
334 29, /* agc2_slope2 */
341 1, /* perform_agc_softsplit */
344 /* PLL Configuration for COFDM BW_MHz = 8.00 with external clock = 30.00 */
345 static 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,
350 (3 << 14) | (1 << 12) | (524 << 0), /* sad_cfg: refsel, sel, freq_15k */
351 (1 << 25) | 5816102, /* ifreq = 5.200000 MHz */
353 30000000, /* xtal_hz */
356 static struct dib7000p_config stk7700ph_dib7700_xc3028_config = {
357 .output_mpeg2_in_188_bytes = 1,
358 .tuner_is_baseband = 1,
360 .agc_config_count = 1,
361 .agc = &xc3028_agc_config,
362 .bw = &xc3028_bw_config,
364 .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
365 .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
366 .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
369 static int stk7700ph_xc3028_callback(void *ptr, int command, int arg)
371 struct dvb_usb_adapter *adap = ptr;
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);
379 case XC2028_RESET_CLK:
382 err("%s: unknown command %d, arg %d\n", __func__,
389 static struct xc2028_ctrl stk7700ph_xc3028_ctrl = {
390 .fname = XC2028_DEFAULT_FIRMWARE,
392 .demod = XC3028_FE_DIBCOM52,
395 static struct xc2028_config stk7700ph_xc3028_config = {
397 .callback = stk7700ph_xc3028_callback,
398 .ctrl = &stk7700ph_xc3028_ctrl,
401 static int stk7700ph_frontend_attach(struct dvb_usb_adapter *adap)
403 struct usb_device_descriptor *desc = &adap->dev->udev->descriptor;
405 if (desc->idVendor == cpu_to_le16(USB_VID_PINNACLE) &&
406 desc->idProduct == cpu_to_le16(USB_PID_PINNACLE_EXPRESSCARD_320CX))
407 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0);
409 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
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);
416 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
418 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
421 dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18,
422 &stk7700ph_dib7700_xc3028_config);
424 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80,
425 &stk7700ph_dib7700_xc3028_config);
427 return adap->fe == NULL ? -ENODEV : 0;
430 static int stk7700ph_tuner_attach(struct dvb_usb_adapter *adap)
432 struct i2c_adapter *tun_i2c;
434 tun_i2c = dib7000p_get_i2c_master(adap->fe,
435 DIBX000_I2C_INTERFACE_TUNER, 1);
437 stk7700ph_xc3028_config.i2c_adap = tun_i2c;
438 stk7700ph_xc3028_config.video_dev = adap;
440 return dvb_attach(xc2028_attach, adap->fe, &stk7700ph_xc3028_config)
441 == NULL ? -ENODEV : 0;
444 #define DEFAULT_RC_INTERVAL 150
446 static u8 rc_request[] = { REQUEST_POLL_RC, 0 };
448 /* Number of keypresses to ignore before start repeating */
449 #define RC_REPEAT_DELAY 2
451 static int dib0700_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
455 struct dvb_usb_rc_key *keymap = d->props.rc_key_map;
456 struct dib0700_state *st = d->priv;
458 *state = REMOTE_NO_KEY_PRESSED;
459 i=dib0700_ctrl_rd(d,rc_request,2,key,4);
461 err("RC Query Failed");
465 /* losing half of KEY_0 events from Philipps rc5 remotes.. */
466 if (key[0]==0 && key[1]==0 && key[2]==0 && key[3]==0) return 0;
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]); */
470 dib0700_rc_setup(d); /* reset ir sensor data to prevent false events */
472 switch (dvb_usb_dib0700_ir_proto) {
474 /* NEC protocol sends repeat code as 0 0 0 FF */
475 if ((key[3-2] == 0x00) && (key[3-3] == 0x00) &&
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;
485 for (i=0;i<d->props.rc_key_map_size; i++) {
486 if (keymap[i].custom == key[3-2] && keymap[i].data == key[3-3]) {
488 *event = keymap[i].event;
489 *state = REMOTE_KEY_PRESSED;
490 d->last_event = keymap[i].event;
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) {
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;
513 *event = keymap[i].event;
514 *state = REMOTE_KEY_PRESSED;
515 st->rc_toggle = key[3-1];
516 d->last_event = keymap[i].event;
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]);
528 static struct dvb_usb_rc_key dib0700_rc_keys[] = {
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 },
582 { 0xeb, 0x1d, KEY_MUTE },
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 },
603 { 0xeb, 0x5c, KEY_NEXT },
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 },
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 },
682 /* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */
683 static struct dibx000_agc_config stk7700p_7000m_mt2060_agc_config = {
684 BAND_UHF | BAND_VHF, // band_caps
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
720 1, // perform_agc_softsplit
723 51800, // global_split_min
724 24700 // global_split_max
728 static struct dibx000_agc_config stk7700p_7000p_mt2060_agc_config = {
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
770 0, // perform_agc_softsplit
773 static struct dibx000_bandwidth_config stk7700p_pll_config = {
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
783 static struct dib7000m_config stk7700p_dib7000m_config = {
785 .output_mpeg2_in_188_bytes = 1,
788 .agc_config_count = 1,
789 .agc = &stk7700p_7000m_mt2060_agc_config,
790 .bw = &stk7700p_pll_config,
792 .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS,
793 .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES,
794 .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS,
797 static struct dib7000p_config stk7700p_dib7000p_config = {
798 .output_mpeg2_in_188_bytes = 1,
800 .agc_config_count = 1,
801 .agc = &stk7700p_7000p_mt2060_agc_config,
802 .bw = &stk7700p_pll_config,
804 .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS,
805 .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES,
806 .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS,
809 static int stk7700p_frontend_attach(struct dvb_usb_adapter *adap)
811 struct dib0700_state *st = adap->dev->priv;
812 /* unless there is no real power management in DVB - we leave the device on GPIO6 */
814 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
815 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(50);
817 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10);
818 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
820 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10);
821 dib0700_ctrl_clock(adap->dev, 72, 1);
822 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(100);
824 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
826 st->mt2060_if1[0] = 1220;
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;
832 adap->fe = dvb_attach(dib7000m_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000m_config);
834 return adap->fe == NULL ? -ENODEV : 0;
837 static struct mt2060_config stk7700p_mt2060_config = {
841 static int stk7700p_tuner_attach(struct dvb_usb_adapter *adap)
843 struct i2c_adapter *prim_i2c = &adap->dev->i2c_adap;
844 struct dib0700_state *st = adap->dev->priv;
845 struct i2c_adapter *tun_i2c;
848 if (adap->dev->udev->descriptor.idVendor == cpu_to_le16(USB_VID_HAUPPAUGE) &&
849 adap->dev->udev->descriptor.idProduct == cpu_to_le16(USB_PID_HAUPPAUGE_NOVA_T_STICK)) {
850 if (!eeprom_read(prim_i2c,0x58,&a)) if1=1220+a;
852 if (st->is_dib7000pc)
853 tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1);
855 tun_i2c = dib7000m_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1);
857 return dvb_attach(mt2060_attach, adap->fe, tun_i2c, &stk7700p_mt2060_config,
858 if1) == NULL ? -ENODEV : 0;
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
900 0, // perform_agc_softsplit
903 static int dib7070_tuner_reset(struct dvb_frontend *fe, int onoff)
905 return dib7000p_set_gpio(fe, 8, 0, !onoff);
908 static int dib7070_tuner_sleep(struct dvb_frontend *fe, int onoff)
910 return dib7000p_set_gpio(fe, 9, 0, onoff);
913 static struct dib0070_config dib7070p_dib0070_config[2] = {
915 .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS,
916 .reset = dib7070_tuner_reset,
917 .sleep = dib7070_tuner_sleep,
921 .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS,
922 .reset = dib7070_tuner_reset,
923 .sleep = dib7070_tuner_sleep,
929 static int dib7070_set_param_override(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep)
931 struct dvb_usb_adapter *adap = fe->dvb->priv;
932 struct dib0700_adapter_state *state = adap->priv;
935 u8 band = BAND_OF_FREQUENCY(fep->frequency/1000);
937 case BAND_VHF: offset = 950; break;
939 default: offset = 550; break;
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);
946 static int dib7070p_tuner_attach(struct dvb_usb_adapter *adap)
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);
952 if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, &dib7070p_dib0070_config[0]) == NULL)
955 if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, &dib7070p_dib0070_config[1]) == NULL)
959 st->set_param_save = adap->fe->ops.tuner_ops.set_params;
960 adap->fe->ops.tuner_ops.set_params = dib7070_set_param_override;
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
974 static struct dib7000p_config dib7070p_dib7000p_config = {
975 .output_mpeg2_in_188_bytes = 1,
977 .agc_config_count = 1,
978 .agc = &dib7070_agc_config,
979 .bw = &dib7070_bw_config_12_mhz,
980 .tuner_is_baseband = 1,
983 .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
984 .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
985 .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
987 .hostbus_diversity = 1,
991 static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap)
993 struct usb_device_descriptor *p = &adap->dev->udev->descriptor;
994 if (p->idVendor == cpu_to_le16(USB_VID_PINNACLE) &&
995 p->idProduct == cpu_to_le16(USB_PID_PINNACLE_PCTV72E))
996 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0);
998 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
1000 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
1001 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
1002 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
1003 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
1005 dib0700_ctrl_clock(adap->dev, 72, 1);
1008 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
1010 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
1012 dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18,
1013 &dib7070p_dib7000p_config);
1015 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80,
1016 &dib7070p_dib7000p_config);
1017 return adap->fe == NULL ? -ENODEV : 0;
1021 static struct dib7000p_config stk7070pd_dib7000p_config[2] = {
1023 .output_mpeg2_in_188_bytes = 1,
1025 .agc_config_count = 1,
1026 .agc = &dib7070_agc_config,
1027 .bw = &dib7070_bw_config_12_mhz,
1028 .tuner_is_baseband = 1,
1031 .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
1032 .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
1033 .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
1035 .hostbus_diversity = 1,
1037 .output_mpeg2_in_188_bytes = 1,
1039 .agc_config_count = 1,
1040 .agc = &dib7070_agc_config,
1041 .bw = &dib7070_bw_config_12_mhz,
1042 .tuner_is_baseband = 1,
1045 .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
1046 .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
1047 .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
1049 .hostbus_diversity = 1,
1053 static int stk7070pd_frontend_attach0(struct dvb_usb_adapter *adap)
1055 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
1057 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
1058 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
1059 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
1060 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
1062 dib0700_ctrl_clock(adap->dev, 72, 1);
1065 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
1067 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
1069 dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 2, 18, stk7070pd_dib7000p_config);
1071 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, &stk7070pd_dib7000p_config[0]);
1072 return adap->fe == NULL ? -ENODEV : 0;
1075 static int stk7070pd_frontend_attach1(struct dvb_usb_adapter *adap)
1077 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x82, &stk7070pd_dib7000p_config[1]);
1078 return adap->fe == NULL ? -ENODEV : 0;
1081 /* DVB-USB and USB stuff follows */
1082 struct usb_device_id dib0700_usb_id_table[] = {
1083 /* 0 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P) },
1084 { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P_PC) },
1085 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500) },
1086 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500_2) },
1087 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK) },
1088 /* 5 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR) },
1089 { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500) },
1090 { USB_DEVICE(USB_VID_UNIWILL, USB_PID_UNIWILL_STK7700P) },
1091 { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_STK7700P) },
1092 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_2) },
1093 /* 10 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR_2) },
1094 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV2000E) },
1095 { USB_DEVICE(USB_VID_TERRATEC,
1096 USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY) },
1097 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_TD_STICK) },
1098 { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700D) },
1099 /* 15 */{ USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070P) },
1100 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV_DVB_T_FLASH) },
1101 { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070PD) },
1102 { USB_DEVICE(USB_VID_PINNACLE,
1103 USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T) },
1104 { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500_PC) },
1105 /* 20 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_EXPRESS) },
1106 { USB_DEVICE(USB_VID_GIGABYTE, USB_PID_GIGABYTE_U7000) },
1107 { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14BR) },
1108 { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3000) },
1109 { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3100) },
1110 /* 25 */{ USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_3) },
1111 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_MYTV_T) },
1112 { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_HT_USB_XE) },
1113 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_EXPRESSCARD_320CX) },
1114 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV72E) },
1115 /* 30 */{ USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV73E) },
1116 { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_EC372S) },
1117 { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_HT_EXPRESS) },
1118 { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_XXS) },
1119 { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_STK7700P_2) },
1120 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_TD_STICK_52009) },
1121 { 0 } /* Terminating entry */
1123 MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table);
1125 #define DIB0700_DEFAULT_DEVICE_PROPERTIES \
1126 .caps = DVB_USB_IS_AN_I2C_ADAPTER, \
1127 .usb_ctrl = DEVICE_SPECIFIC, \
1128 .firmware = "dvb-usb-dib0700-1.10.fw", \
1129 .download_firmware = dib0700_download_firmware, \
1130 .no_reconnect = 1, \
1131 .size_of_priv = sizeof(struct dib0700_state), \
1132 .i2c_algo = &dib0700_i2c_algo, \
1133 .identify_state = dib0700_identify_state
1135 #define DIB0700_DEFAULT_STREAMING_CONFIG(ep) \
1136 .streaming_ctrl = dib0700_streaming_ctrl, \
1143 .buffersize = 39480, \
1148 struct dvb_usb_device_properties dib0700_devices[] = {
1150 DIB0700_DEFAULT_DEVICE_PROPERTIES,
1155 .frontend_attach = stk7700p_frontend_attach,
1156 .tuner_attach = stk7700p_tuner_attach,
1158 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
1162 .num_device_descs = 8,
1164 { "DiBcom STK7700P reference design",
1165 { &dib0700_usb_id_table[0], &dib0700_usb_id_table[1] },
1168 { "Hauppauge Nova-T Stick",
1169 { &dib0700_usb_id_table[4], &dib0700_usb_id_table[9], NULL },
1172 { "AVerMedia AVerTV DVB-T Volar",
1173 { &dib0700_usb_id_table[5], &dib0700_usb_id_table[10] },
1176 { "Compro Videomate U500",
1177 { &dib0700_usb_id_table[6], &dib0700_usb_id_table[19] },
1180 { "Uniwill STK7700P based (Hama and others)",
1181 { &dib0700_usb_id_table[7], NULL },
1184 { "Leadtek Winfast DTV Dongle (STK7700P based)",
1185 { &dib0700_usb_id_table[8], &dib0700_usb_id_table[34] },
1188 { "AVerMedia AVerTV DVB-T Express",
1189 { &dib0700_usb_id_table[20] },
1193 { &dib0700_usb_id_table[21], NULL },
1198 .rc_interval = DEFAULT_RC_INTERVAL,
1199 .rc_key_map = dib0700_rc_keys,
1200 .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys),
1201 .rc_query = dib0700_rc_query
1202 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
1207 .frontend_attach = bristol_frontend_attach,
1208 .tuner_attach = bristol_tuner_attach,
1210 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
1212 .frontend_attach = bristol_frontend_attach,
1213 .tuner_attach = bristol_tuner_attach,
1215 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
1219 .num_device_descs = 1,
1221 { "Hauppauge Nova-T 500 Dual DVB-T",
1222 { &dib0700_usb_id_table[2], &dib0700_usb_id_table[3], NULL },
1227 .rc_interval = DEFAULT_RC_INTERVAL,
1228 .rc_key_map = dib0700_rc_keys,
1229 .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys),
1230 .rc_query = dib0700_rc_query
1231 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
1236 .frontend_attach = stk7700d_frontend_attach,
1237 .tuner_attach = stk7700d_tuner_attach,
1239 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
1241 .frontend_attach = stk7700d_frontend_attach,
1242 .tuner_attach = stk7700d_tuner_attach,
1244 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
1248 .num_device_descs = 4,
1250 { "Pinnacle PCTV 2000e",
1251 { &dib0700_usb_id_table[11], NULL },
1254 { "Terratec Cinergy DT XS Diversity",
1255 { &dib0700_usb_id_table[12], NULL },
1258 { "Hauppauge Nova-TD Stick/Elgato Eye-TV Diversity",
1259 { &dib0700_usb_id_table[13], NULL },
1262 { "DiBcom STK7700D reference design",
1263 { &dib0700_usb_id_table[14], NULL },
1268 .rc_interval = DEFAULT_RC_INTERVAL,
1269 .rc_key_map = dib0700_rc_keys,
1270 .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys),
1271 .rc_query = dib0700_rc_query
1273 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
1278 .frontend_attach = stk7700P2_frontend_attach,
1279 .tuner_attach = stk7700d_tuner_attach,
1281 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
1285 .num_device_descs = 2,
1287 { "ASUS My Cinema U3000 Mini DVBT Tuner",
1288 { &dib0700_usb_id_table[23], NULL },
1292 { &dib0700_usb_id_table[31], NULL },
1296 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
1301 .frontend_attach = stk7070p_frontend_attach,
1302 .tuner_attach = dib7070p_tuner_attach,
1304 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
1306 .size_of_priv = sizeof(struct dib0700_adapter_state),
1310 .num_device_descs = 9,
1312 { "DiBcom STK7070P reference design",
1313 { &dib0700_usb_id_table[15], NULL },
1316 { "Pinnacle PCTV DVB-T Flash Stick",
1317 { &dib0700_usb_id_table[16], NULL },
1320 { "Artec T14BR DVB-T",
1321 { &dib0700_usb_id_table[22], NULL },
1324 { "ASUS My Cinema U3100 Mini DVBT Tuner",
1325 { &dib0700_usb_id_table[24], NULL },
1328 { "Hauppauge Nova-T Stick",
1329 { &dib0700_usb_id_table[25], NULL },
1332 { "Hauppauge Nova-T MyTV.t",
1333 { &dib0700_usb_id_table[26], NULL },
1336 { "Pinnacle PCTV 72e",
1337 { &dib0700_usb_id_table[29], NULL },
1340 { "Pinnacle PCTV 73e",
1341 { &dib0700_usb_id_table[30], NULL },
1344 { "Terratec Cinergy T USB XXS",
1345 { &dib0700_usb_id_table[33], NULL },
1350 .rc_interval = DEFAULT_RC_INTERVAL,
1351 .rc_key_map = dib0700_rc_keys,
1352 .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys),
1353 .rc_query = dib0700_rc_query
1355 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
1360 .frontend_attach = stk7070pd_frontend_attach0,
1361 .tuner_attach = dib7070p_tuner_attach,
1363 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
1365 .size_of_priv = sizeof(struct dib0700_adapter_state),
1367 .frontend_attach = stk7070pd_frontend_attach1,
1368 .tuner_attach = dib7070p_tuner_attach,
1370 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
1372 .size_of_priv = sizeof(struct dib0700_adapter_state),
1376 .num_device_descs = 3,
1378 { "DiBcom STK7070PD reference design",
1379 { &dib0700_usb_id_table[17], NULL },
1382 { "Pinnacle PCTV Dual DVB-T Diversity Stick",
1383 { &dib0700_usb_id_table[18], NULL },
1386 { "Hauppauge Nova-TD Stick (52009)",
1387 { &dib0700_usb_id_table[35], NULL },
1391 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
1396 .frontend_attach = stk7700ph_frontend_attach,
1397 .tuner_attach = stk7700ph_tuner_attach,
1399 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
1401 .size_of_priv = sizeof(struct
1402 dib0700_adapter_state),
1406 .num_device_descs = 3,
1408 { "Terratec Cinergy HT USB XE",
1409 { &dib0700_usb_id_table[27], NULL },
1412 { "Pinnacle Expresscard 320cx",
1413 { &dib0700_usb_id_table[28], NULL },
1416 { "Terratec Cinergy HT Express",
1417 { &dib0700_usb_id_table[32], NULL },
1421 .rc_interval = DEFAULT_RC_INTERVAL,
1422 .rc_key_map = dib0700_rc_keys,
1423 .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys),
1424 .rc_query = dib0700_rc_query
1428 int dib0700_device_count = ARRAY_SIZE(dib0700_devices);