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-9 DiBcom, SA et al
11 #include "dib3000mc.h"
17 #include "tuner-xc2028.h"
25 static int force_lna_activation
;
26 module_param(force_lna_activation
, int, 0644);
27 MODULE_PARM_DESC(force_lna_activation
, "force the activation of Low-Noise-Amplifyer(s) (LNA), "
28 "if applicable for the device (default: 0=automatic/off).");
30 struct dib0700_adapter_state
{
31 int (*set_param_save
) (struct dvb_frontend
*, struct dvb_frontend_parameters
*);
34 /* Hauppauge Nova-T 500 (aka Bristol)
35 * has a LNA on GPIO0 which is enabled by setting 1 */
36 static struct mt2060_config bristol_mt2060_config
[2] = {
46 static struct dibx000_agc_config bristol_dib3000p_mt2060_agc_config
= {
47 .band_caps
= BAND_VHF
| BAND_UHF
,
48 .setup
= (1 << 8) | (5 << 5) | (0 << 4) | (0 << 3) | (0 << 2) | (2 << 0),
68 static struct dib3000mc_config bristol_dib3000mc_config
[2] = {
69 { .agc
= &bristol_dib3000p_mt2060_agc_config
,
71 .ln_adc_level
= 0x1cc7,
72 .output_mpeg2_in_188_bytes
= 1,
74 { .agc
= &bristol_dib3000p_mt2060_agc_config
,
76 .ln_adc_level
= 0x1cc7,
77 .output_mpeg2_in_188_bytes
= 1,
81 static int bristol_frontend_attach(struct dvb_usb_adapter
*adap
)
83 struct dib0700_state
*st
= adap
->dev
->priv
;
85 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0); msleep(10);
86 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1); msleep(10);
87 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0); msleep(10);
88 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1); msleep(10);
90 if (force_lna_activation
)
91 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
93 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 0);
95 if (dib3000mc_i2c_enumeration(&adap
->dev
->i2c_adap
, 2, DEFAULT_DIB3000P_I2C_ADDRESS
, bristol_dib3000mc_config
) != 0) {
96 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0); msleep(10);
100 st
->mt2060_if1
[adap
->id
] = 1220;
101 return (adap
->fe
= dvb_attach(dib3000mc_attach
, &adap
->dev
->i2c_adap
,
102 (10 + adap
->id
) << 1, &bristol_dib3000mc_config
[adap
->id
])) == NULL
? -ENODEV
: 0;
105 static int eeprom_read(struct i2c_adapter
*adap
,u8 adrs
,u8
*pval
)
107 struct i2c_msg msg
[2] = {
108 { .addr
= 0x50, .flags
= 0, .buf
= &adrs
, .len
= 1 },
109 { .addr
= 0x50, .flags
= I2C_M_RD
, .buf
= pval
, .len
= 1 },
111 if (i2c_transfer(adap
, msg
, 2) != 2) return -EREMOTEIO
;
115 static int bristol_tuner_attach(struct dvb_usb_adapter
*adap
)
117 struct i2c_adapter
*prim_i2c
= &adap
->dev
->i2c_adap
;
118 struct i2c_adapter
*tun_i2c
= dib3000mc_get_tuner_i2c_master(adap
->fe
, 1);
121 if (adap
->dev
->udev
->descriptor
.idVendor
== cpu_to_le16(USB_VID_HAUPPAUGE
) &&
122 adap
->dev
->udev
->descriptor
.idProduct
== cpu_to_le16(USB_PID_HAUPPAUGE_NOVA_T_500_2
)) {
123 if (!eeprom_read(prim_i2c
,0x59 + adap
->id
,&a
)) if1
=1220+a
;
125 return dvb_attach(mt2060_attach
,adap
->fe
, tun_i2c
,&bristol_mt2060_config
[adap
->id
],
126 if1
) == NULL
? -ENODEV
: 0;
129 /* STK7700D: Pinnacle/Terratec/Hauppauge Dual DVB-T Diversity */
132 static struct dibx000_agc_config stk7700d_7000p_mt2266_agc_config
[2] = {
136 /* 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,
137 * 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 */
138 (0 << 15) | (0 << 14) | (1 << 11) | (1 << 10) | (1 << 9) | (0 << 8)
139 | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
174 BAND_VHF
| BAND_LBAND
,
176 /* 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,
177 * 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 */
178 (0 << 15) | (0 << 14) | (1 << 11) | (1 << 10) | (1 << 9) | (0 << 8)
179 | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0),
216 static struct dibx000_bandwidth_config stk7700d_mt2266_pll_config
= {
220 (3 << 14) | (1 << 12) | (524 << 0),
225 static struct dib7000p_config stk7700d_dib7000p_mt2266_config
[] = {
226 { .output_mpeg2_in_188_bytes
= 1,
227 .hostbus_diversity
= 1,
228 .tuner_is_baseband
= 1,
230 .agc_config_count
= 2,
231 .agc
= stk7700d_7000p_mt2266_agc_config
,
232 .bw
= &stk7700d_mt2266_pll_config
,
234 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
235 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
236 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
238 { .output_mpeg2_in_188_bytes
= 1,
239 .hostbus_diversity
= 1,
240 .tuner_is_baseband
= 1,
242 .agc_config_count
= 2,
243 .agc
= stk7700d_7000p_mt2266_agc_config
,
244 .bw
= &stk7700d_mt2266_pll_config
,
246 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
247 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
248 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
252 static struct mt2266_config stk7700d_mt2266_config
[2] = {
253 { .i2c_address
= 0x60
255 { .i2c_address
= 0x60
259 static int stk7700P2_frontend_attach(struct dvb_usb_adapter
*adap
)
262 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
264 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
265 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
266 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
267 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
269 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
271 if (dib7000p_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 18,
272 stk7700d_dib7000p_mt2266_config
)
274 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", __func__
);
279 adap
->fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
,0x80+(adap
->id
<< 1),
280 &stk7700d_dib7000p_mt2266_config
[adap
->id
]);
282 return adap
->fe
== NULL
? -ENODEV
: 0;
285 static int stk7700d_frontend_attach(struct dvb_usb_adapter
*adap
)
288 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
290 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
291 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
292 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
293 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
295 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
297 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
298 if (dib7000p_i2c_enumeration(&adap
->dev
->i2c_adap
, 2, 18,
299 stk7700d_dib7000p_mt2266_config
)
301 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", __func__
);
306 adap
->fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
,0x80+(adap
->id
<< 1),
307 &stk7700d_dib7000p_mt2266_config
[adap
->id
]);
309 return adap
->fe
== NULL
? -ENODEV
: 0;
312 static int stk7700d_tuner_attach(struct dvb_usb_adapter
*adap
)
314 struct i2c_adapter
*tun_i2c
;
315 tun_i2c
= dib7000p_get_i2c_master(adap
->fe
, DIBX000_I2C_INTERFACE_TUNER
, 1);
316 return dvb_attach(mt2266_attach
, adap
->fe
, tun_i2c
,
317 &stk7700d_mt2266_config
[adap
->id
]) == NULL
? -ENODEV
: 0;
320 /* STK7700-PH: Digital/Analog Hybrid Tuner, e.h. Cinergy HT USB HE */
321 static struct dibx000_agc_config xc3028_agc_config
= {
322 BAND_VHF
| BAND_UHF
, /* band_caps */
324 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=0,
325 * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
326 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */
327 (0 << 15) | (0 << 14) | (0 << 11) | (0 << 10) | (0 << 9) | (0 << 8) |
328 (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), /* setup */
331 21, /* time_stabiliz */
343 39718, /* agc2_max */
352 29, /* agc2_slope1 */
353 29, /* agc2_slope2 */
360 1, /* perform_agc_softsplit */
363 /* PLL Configuration for COFDM BW_MHz = 8.00 with external clock = 30.00 */
364 static struct dibx000_bandwidth_config xc3028_bw_config
= {
365 60000, 30000, /* internal, sampling */
366 1, 8, 3, 1, 0, /* pll_cfg: prediv, ratio, range, reset, bypass */
367 0, 0, 1, 1, 0, /* misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc,
369 (3 << 14) | (1 << 12) | (524 << 0), /* sad_cfg: refsel, sel, freq_15k */
370 (1 << 25) | 5816102, /* ifreq = 5.200000 MHz */
372 30000000, /* xtal_hz */
375 static struct dib7000p_config stk7700ph_dib7700_xc3028_config
= {
376 .output_mpeg2_in_188_bytes
= 1,
377 .tuner_is_baseband
= 1,
379 .agc_config_count
= 1,
380 .agc
= &xc3028_agc_config
,
381 .bw
= &xc3028_bw_config
,
383 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
384 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
385 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
388 static int stk7700ph_xc3028_callback(void *ptr
, int component
,
389 int command
, int arg
)
391 struct dvb_usb_adapter
*adap
= ptr
;
394 case XC2028_TUNER_RESET
:
395 /* Send the tuner in then out of reset */
396 dib7000p_set_gpio(adap
->fe
, 8, 0, 0); msleep(10);
397 dib7000p_set_gpio(adap
->fe
, 8, 0, 1);
399 case XC2028_RESET_CLK
:
402 err("%s: unknown command %d, arg %d\n", __func__
,
409 static struct xc2028_ctrl stk7700ph_xc3028_ctrl
= {
410 .fname
= XC2028_DEFAULT_FIRMWARE
,
412 .demod
= XC3028_FE_DIBCOM52
,
415 static struct xc2028_config stk7700ph_xc3028_config
= {
417 .ctrl
= &stk7700ph_xc3028_ctrl
,
420 static int stk7700ph_frontend_attach(struct dvb_usb_adapter
*adap
)
422 struct usb_device_descriptor
*desc
= &adap
->dev
->udev
->descriptor
;
424 if (desc
->idVendor
== cpu_to_le16(USB_VID_PINNACLE
) &&
425 desc
->idProduct
== cpu_to_le16(USB_PID_PINNACLE_EXPRESSCARD_320CX
))
426 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0);
428 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
430 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
431 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
432 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
433 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
435 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
437 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
440 if (dib7000p_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 18,
441 &stk7700ph_dib7700_xc3028_config
) != 0) {
442 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n",
447 adap
->fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
, 0x80,
448 &stk7700ph_dib7700_xc3028_config
);
450 return adap
->fe
== NULL
? -ENODEV
: 0;
453 static int stk7700ph_tuner_attach(struct dvb_usb_adapter
*adap
)
455 struct i2c_adapter
*tun_i2c
;
457 tun_i2c
= dib7000p_get_i2c_master(adap
->fe
,
458 DIBX000_I2C_INTERFACE_TUNER
, 1);
460 stk7700ph_xc3028_config
.i2c_adap
= tun_i2c
;
462 /* FIXME: generalize & move to common area */
463 adap
->fe
->callback
= stk7700ph_xc3028_callback
;
465 return dvb_attach(xc2028_attach
, adap
->fe
, &stk7700ph_xc3028_config
)
466 == NULL
? -ENODEV
: 0;
469 #define DEFAULT_RC_INTERVAL 50
471 static u8 rc_request
[] = { REQUEST_POLL_RC
, 0 };
473 /* Number of keypresses to ignore before start repeating */
474 #define RC_REPEAT_DELAY 6
477 * This function is used only when firmware is < 1.20 version. Newer
478 * firmwares use bulk mode, with functions implemented at dib0700_core,
479 * at dib0700_rc_urb_completion()
481 static int dib0700_rc_query_old_firmware(struct dvb_usb_device
*d
)
487 struct dib0700_state
*st
= d
->priv
;
489 if (st
->fw_version
>= 0x10200) {
490 /* For 1.20 firmware , We need to keep the RC polling
491 callback so we can reuse the input device setup in
492 dvb-usb-remote.c. However, the actual work is being done
493 in the bulk URB completion handler. */
497 i
= dib0700_ctrl_rd(d
, rc_request
, 2, key
, 4);
499 err("RC Query Failed");
503 /* losing half of KEY_0 events from Philipps rc5 remotes.. */
504 if (key
[0] == 0 && key
[1] == 0 && key
[2] == 0 && key
[3] == 0)
507 /* 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]); */
509 dib0700_rc_setup(d
); /* reset ir sensor data to prevent false events */
512 switch (d
->props
.rc
.core
.protocol
) {
514 /* NEC protocol sends repeat code as 0 0 0 FF */
515 if ((key
[3-2] == 0x00) && (key
[3-3] == 0x00) &&
517 keycode
= d
->last_event
;
519 keycode
= key
[3-2] << 8 | key
[3-3];
520 d
->last_event
= keycode
;
523 rc_keydown(d
->rc_dev
, keycode
, 0);
526 /* RC-5 protocol changes toggle bit on new keypress */
527 keycode
= key
[3-2] << 8 | key
[3-3];
529 rc_keydown(d
->rc_dev
, keycode
, toggle
);
536 /* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */
537 static struct dibx000_agc_config stk7700p_7000m_mt2060_agc_config
= {
540 /* 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,
541 * 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 */
542 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8)
543 | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0),
583 static struct dibx000_agc_config stk7700p_7000p_mt2060_agc_config
= {
586 /* 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,
587 * 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 */
588 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8)
589 | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0),
629 static struct dibx000_bandwidth_config stk7700p_pll_config
= {
633 (3 << 14) | (1 << 12) | (524 << 0),
639 static struct dib7000m_config stk7700p_dib7000m_config
= {
641 .output_mpeg2_in_188_bytes
= 1,
644 .agc_config_count
= 1,
645 .agc
= &stk7700p_7000m_mt2060_agc_config
,
646 .bw
= &stk7700p_pll_config
,
648 .gpio_dir
= DIB7000M_GPIO_DEFAULT_DIRECTIONS
,
649 .gpio_val
= DIB7000M_GPIO_DEFAULT_VALUES
,
650 .gpio_pwm_pos
= DIB7000M_GPIO_DEFAULT_PWM_POS
,
653 static struct dib7000p_config stk7700p_dib7000p_config
= {
654 .output_mpeg2_in_188_bytes
= 1,
656 .agc_config_count
= 1,
657 .agc
= &stk7700p_7000p_mt2060_agc_config
,
658 .bw
= &stk7700p_pll_config
,
660 .gpio_dir
= DIB7000M_GPIO_DEFAULT_DIRECTIONS
,
661 .gpio_val
= DIB7000M_GPIO_DEFAULT_VALUES
,
662 .gpio_pwm_pos
= DIB7000M_GPIO_DEFAULT_PWM_POS
,
665 static int stk7700p_frontend_attach(struct dvb_usb_adapter
*adap
)
667 struct dib0700_state
*st
= adap
->dev
->priv
;
668 /* unless there is no real power management in DVB - we leave the device on GPIO6 */
670 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
671 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0); msleep(50);
673 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1); msleep(10);
674 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
676 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0); msleep(10);
677 dib0700_ctrl_clock(adap
->dev
, 72, 1);
678 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1); msleep(100);
680 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
682 st
->mt2060_if1
[0] = 1220;
684 if (dib7000pc_detection(&adap
->dev
->i2c_adap
)) {
685 adap
->fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
, 18, &stk7700p_dib7000p_config
);
686 st
->is_dib7000pc
= 1;
688 adap
->fe
= dvb_attach(dib7000m_attach
, &adap
->dev
->i2c_adap
, 18, &stk7700p_dib7000m_config
);
690 return adap
->fe
== NULL
? -ENODEV
: 0;
693 static struct mt2060_config stk7700p_mt2060_config
= {
697 static int stk7700p_tuner_attach(struct dvb_usb_adapter
*adap
)
699 struct i2c_adapter
*prim_i2c
= &adap
->dev
->i2c_adap
;
700 struct dib0700_state
*st
= adap
->dev
->priv
;
701 struct i2c_adapter
*tun_i2c
;
704 if (adap
->dev
->udev
->descriptor
.idVendor
== cpu_to_le16(USB_VID_HAUPPAUGE
) &&
705 adap
->dev
->udev
->descriptor
.idProduct
== cpu_to_le16(USB_PID_HAUPPAUGE_NOVA_T_STICK
)) {
706 if (!eeprom_read(prim_i2c
,0x58,&a
)) if1
=1220+a
;
708 if (st
->is_dib7000pc
)
709 tun_i2c
= dib7000p_get_i2c_master(adap
->fe
, DIBX000_I2C_INTERFACE_TUNER
, 1);
711 tun_i2c
= dib7000m_get_i2c_master(adap
->fe
, DIBX000_I2C_INTERFACE_TUNER
, 1);
713 return dvb_attach(mt2060_attach
, adap
->fe
, tun_i2c
, &stk7700p_mt2060_config
,
714 if1
) == NULL
? -ENODEV
: 0;
717 /* DIB7070 generic */
718 static struct dibx000_agc_config dib7070_agc_config
= {
719 BAND_UHF
| BAND_VHF
| BAND_LBAND
| BAND_SBAND
,
720 /* 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,
721 * 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 */
722 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8)
723 | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
760 static int dib7070_tuner_reset(struct dvb_frontend
*fe
, int onoff
)
762 deb_info("reset: %d", onoff
);
763 return dib7000p_set_gpio(fe
, 8, 0, !onoff
);
766 static int dib7070_tuner_sleep(struct dvb_frontend
*fe
, int onoff
)
768 deb_info("sleep: %d", onoff
);
769 return dib7000p_set_gpio(fe
, 9, 0, onoff
);
772 static struct dib0070_config dib7070p_dib0070_config
[2] = {
774 .i2c_address
= DEFAULT_DIB0070_I2C_ADDRESS
,
775 .reset
= dib7070_tuner_reset
,
776 .sleep
= dib7070_tuner_sleep
,
778 .clock_pad_drive
= 4,
781 .i2c_address
= DEFAULT_DIB0070_I2C_ADDRESS
,
782 .reset
= dib7070_tuner_reset
,
783 .sleep
= dib7070_tuner_sleep
,
789 static struct dib0070_config dib7770p_dib0070_config
= {
790 .i2c_address
= DEFAULT_DIB0070_I2C_ADDRESS
,
791 .reset
= dib7070_tuner_reset
,
792 .sleep
= dib7070_tuner_sleep
,
794 .clock_pad_drive
= 0,
799 static int dib7070_set_param_override(struct dvb_frontend
*fe
, struct dvb_frontend_parameters
*fep
)
801 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
802 struct dib0700_adapter_state
*state
= adap
->priv
;
805 u8 band
= BAND_OF_FREQUENCY(fep
->frequency
/1000);
807 case BAND_VHF
: offset
= 950; break;
809 default: offset
= 550; break;
811 deb_info("WBD for DiB7000P: %d\n", offset
+ dib0070_wbd_offset(fe
));
812 dib7000p_set_wbd_ref(fe
, offset
+ dib0070_wbd_offset(fe
));
813 return state
->set_param_save(fe
, fep
);
816 static int dib7770_set_param_override(struct dvb_frontend
*fe
,
817 struct dvb_frontend_parameters
*fep
)
819 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
820 struct dib0700_adapter_state
*state
= adap
->priv
;
823 u8 band
= BAND_OF_FREQUENCY(fep
->frequency
/1000);
826 dib7000p_set_gpio(fe
, 0, 0, 1);
831 dib7000p_set_gpio(fe
, 0, 0, 0);
835 deb_info("WBD for DiB7000P: %d\n", offset
+ dib0070_wbd_offset(fe
));
836 dib7000p_set_wbd_ref(fe
, offset
+ dib0070_wbd_offset(fe
));
837 return state
->set_param_save(fe
, fep
);
840 static int dib7770p_tuner_attach(struct dvb_usb_adapter
*adap
)
842 struct dib0700_adapter_state
*st
= adap
->priv
;
843 struct i2c_adapter
*tun_i2c
= dib7000p_get_i2c_master(adap
->fe
,
844 DIBX000_I2C_INTERFACE_TUNER
, 1);
846 if (dvb_attach(dib0070_attach
, adap
->fe
, tun_i2c
,
847 &dib7770p_dib0070_config
) == NULL
)
850 st
->set_param_save
= adap
->fe
->ops
.tuner_ops
.set_params
;
851 adap
->fe
->ops
.tuner_ops
.set_params
= dib7770_set_param_override
;
855 static int dib7070p_tuner_attach(struct dvb_usb_adapter
*adap
)
857 struct dib0700_adapter_state
*st
= adap
->priv
;
858 struct i2c_adapter
*tun_i2c
= dib7000p_get_i2c_master(adap
->fe
, DIBX000_I2C_INTERFACE_TUNER
, 1);
861 if (dvb_attach(dib0070_attach
, adap
->fe
, tun_i2c
, &dib7070p_dib0070_config
[0]) == NULL
)
864 if (dvb_attach(dib0070_attach
, adap
->fe
, tun_i2c
, &dib7070p_dib0070_config
[1]) == NULL
)
868 st
->set_param_save
= adap
->fe
->ops
.tuner_ops
.set_params
;
869 adap
->fe
->ops
.tuner_ops
.set_params
= dib7070_set_param_override
;
873 static int stk70x0p_pid_filter(struct dvb_usb_adapter
*adapter
, int index
, u16 pid
, int onoff
)
875 return dib7000p_pid_filter(adapter
->fe
, index
, pid
, onoff
);
878 static int stk70x0p_pid_filter_ctrl(struct dvb_usb_adapter
*adapter
, int onoff
)
880 return dib7000p_pid_filter_ctrl(adapter
->fe
, onoff
);
883 static struct dibx000_bandwidth_config dib7070_bw_config_12_mhz
= {
887 (3 << 14) | (1 << 12) | (524 << 0),
893 static struct dib7000p_config dib7070p_dib7000p_config
= {
894 .output_mpeg2_in_188_bytes
= 1,
896 .agc_config_count
= 1,
897 .agc
= &dib7070_agc_config
,
898 .bw
= &dib7070_bw_config_12_mhz
,
899 .tuner_is_baseband
= 1,
902 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
903 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
904 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
906 .hostbus_diversity
= 1,
910 static int stk7070p_frontend_attach(struct dvb_usb_adapter
*adap
)
912 struct usb_device_descriptor
*p
= &adap
->dev
->udev
->descriptor
;
913 if (p
->idVendor
== cpu_to_le16(USB_VID_PINNACLE
) &&
914 p
->idProduct
== cpu_to_le16(USB_PID_PINNACLE_PCTV72E
))
915 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0);
917 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
919 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
920 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
921 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
922 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
924 dib0700_ctrl_clock(adap
->dev
, 72, 1);
927 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
929 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
931 if (dib7000p_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 18,
932 &dib7070p_dib7000p_config
) != 0) {
933 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n",
938 adap
->fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
, 0x80,
939 &dib7070p_dib7000p_config
);
940 return adap
->fe
== NULL
? -ENODEV
: 0;
944 static struct dib7000p_config dib7770p_dib7000p_config
= {
945 .output_mpeg2_in_188_bytes
= 1,
947 .agc_config_count
= 1,
948 .agc
= &dib7070_agc_config
,
949 .bw
= &dib7070_bw_config_12_mhz
,
950 .tuner_is_baseband
= 1,
953 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
954 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
955 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
957 .hostbus_diversity
= 1,
958 .enable_current_mirror
= 1,
959 .disable_sample_and_hold
= 0,
962 static int stk7770p_frontend_attach(struct dvb_usb_adapter
*adap
)
964 struct usb_device_descriptor
*p
= &adap
->dev
->udev
->descriptor
;
965 if (p
->idVendor
== cpu_to_le16(USB_VID_PINNACLE
) &&
966 p
->idProduct
== cpu_to_le16(USB_PID_PINNACLE_PCTV72E
))
967 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0);
969 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
971 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
972 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
973 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
974 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
976 dib0700_ctrl_clock(adap
->dev
, 72, 1);
979 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
981 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
983 if (dib7000p_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 18,
984 &dib7770p_dib7000p_config
) != 0) {
985 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n",
990 adap
->fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
, 0x80,
991 &dib7770p_dib7000p_config
);
992 return adap
->fe
== NULL
? -ENODEV
: 0;
995 /* DIB807x generic */
996 static struct dibx000_agc_config dib807x_agc_config
[2] = {
999 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0,
1000 * P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0,
1001 * P_agc_inv_pwm2=0,P_agc_inh_dc_rv_est=0,
1002 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5,
1004 (0 << 15) | (0 << 14) | (7 << 11) | (0 << 10) | (0 << 9) |
1005 (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) |
1006 (0 << 0), /* setup*/
1009 10, /* time_stabiliz*/
1019 65535, /* agc1_max*/
1022 65535, /* agc2_max*/
1028 206, /* agc1_slope1*/
1029 255, /* agc1_slope2*/
1032 88, /* agc2_slope1*/
1033 90, /* agc2_slope2*/
1040 0, /* perform_agc_softsplit*/
1043 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0,
1044 * P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0,
1045 * P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
1046 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5,
1048 (0 << 15) | (0 << 14) | (1 << 11) | (0 << 10) | (0 << 9) |
1049 (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) |
1050 (0 << 0), /* setup */
1053 10, /* time_stabiliz*/
1063 65535, /* agc1_max*/
1066 65535, /* agc2_max*/
1072 206, /* agc1_slope1*/
1073 255, /* agc1_slope2*/
1076 88, /* agc2_slope1*/
1077 90, /* agc2_slope2*/
1084 0, /* perform_agc_softsplit*/
1088 static struct dibx000_bandwidth_config dib807x_bw_config_12_mhz
= {
1089 60000, 15000, /* internal, sampling*/
1090 1, 20, 3, 1, 0, /* pll_cfg: prediv, ratio, range, reset, bypass*/
1091 0, 0, 1, 1, 2, /* misc: refdiv, bypclk_div, IO_CLK_en_core,
1093 (3 << 14) | (1 << 12) | (599 << 0), /* sad_cfg: refsel, sel, freq_15k*/
1094 (0 << 25) | 0, /* ifreq = 0.000000 MHz*/
1096 12000000, /* xtal_hz*/
1099 static struct dib8000_config dib807x_dib8000_config
[2] = {
1101 .output_mpeg2_in_188_bytes
= 1,
1103 .agc_config_count
= 2,
1104 .agc
= dib807x_agc_config
,
1105 .pll
= &dib807x_bw_config_12_mhz
,
1106 .tuner_is_baseband
= 1,
1108 .gpio_dir
= DIB8000_GPIO_DEFAULT_DIRECTIONS
,
1109 .gpio_val
= DIB8000_GPIO_DEFAULT_VALUES
,
1110 .gpio_pwm_pos
= DIB8000_GPIO_DEFAULT_PWM_POS
,
1112 .hostbus_diversity
= 1,
1114 .agc_control
= &dib0070_ctrl_agc_filter
,
1115 .output_mode
= OUTMODE_MPEG2_FIFO
,
1118 .output_mpeg2_in_188_bytes
= 1,
1120 .agc_config_count
= 2,
1121 .agc
= dib807x_agc_config
,
1122 .pll
= &dib807x_bw_config_12_mhz
,
1123 .tuner_is_baseband
= 1,
1125 .gpio_dir
= DIB8000_GPIO_DEFAULT_DIRECTIONS
,
1126 .gpio_val
= DIB8000_GPIO_DEFAULT_VALUES
,
1127 .gpio_pwm_pos
= DIB8000_GPIO_DEFAULT_PWM_POS
,
1129 .hostbus_diversity
= 1,
1130 .agc_control
= &dib0070_ctrl_agc_filter
,
1131 .output_mode
= OUTMODE_MPEG2_FIFO
,
1136 static int dib80xx_tuner_reset(struct dvb_frontend
*fe
, int onoff
)
1138 return dib8000_set_gpio(fe
, 5, 0, !onoff
);
1141 static int dib80xx_tuner_sleep(struct dvb_frontend
*fe
, int onoff
)
1143 return dib8000_set_gpio(fe
, 0, 0, onoff
);
1146 static const struct dib0070_wbd_gain_cfg dib8070_wbd_gain_cfg
[] = {
1151 static struct dib0070_config dib807x_dib0070_config
[2] = {
1153 .i2c_address
= DEFAULT_DIB0070_I2C_ADDRESS
,
1154 .reset
= dib80xx_tuner_reset
,
1155 .sleep
= dib80xx_tuner_sleep
,
1157 .clock_pad_drive
= 4,
1159 .force_crystal_mode
= 1,
1160 .enable_third_order_filter
= 1,
1162 .wbd_gain
= dib8070_wbd_gain_cfg
,
1163 .osc_buffer_state
= 0,
1164 .freq_offset_khz_uhf
= -100,
1165 .freq_offset_khz_vhf
= -100,
1167 .i2c_address
= DEFAULT_DIB0070_I2C_ADDRESS
,
1168 .reset
= dib80xx_tuner_reset
,
1169 .sleep
= dib80xx_tuner_sleep
,
1171 .clock_pad_drive
= 2,
1173 .force_crystal_mode
= 1,
1174 .enable_third_order_filter
= 1,
1176 .wbd_gain
= dib8070_wbd_gain_cfg
,
1177 .osc_buffer_state
= 0,
1178 .freq_offset_khz_uhf
= -25,
1179 .freq_offset_khz_vhf
= -25,
1183 static int dib807x_set_param_override(struct dvb_frontend
*fe
,
1184 struct dvb_frontend_parameters
*fep
)
1186 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
1187 struct dib0700_adapter_state
*state
= adap
->priv
;
1189 u16 offset
= dib0070_wbd_offset(fe
);
1190 u8 band
= BAND_OF_FREQUENCY(fep
->frequency
/1000);
1195 case BAND_UHF
: /* fall-thru wanted */
1197 offset
+= 250; break;
1199 deb_info("WBD for DiB8000: %d\n", offset
);
1200 dib8000_set_wbd_ref(fe
, offset
);
1202 return state
->set_param_save(fe
, fep
);
1205 static int dib807x_tuner_attach(struct dvb_usb_adapter
*adap
)
1207 struct dib0700_adapter_state
*st
= adap
->priv
;
1208 struct i2c_adapter
*tun_i2c
= dib8000_get_i2c_master(adap
->fe
,
1209 DIBX000_I2C_INTERFACE_TUNER
, 1);
1211 if (adap
->id
== 0) {
1212 if (dvb_attach(dib0070_attach
, adap
->fe
, tun_i2c
,
1213 &dib807x_dib0070_config
[0]) == NULL
)
1216 if (dvb_attach(dib0070_attach
, adap
->fe
, tun_i2c
,
1217 &dib807x_dib0070_config
[1]) == NULL
)
1221 st
->set_param_save
= adap
->fe
->ops
.tuner_ops
.set_params
;
1222 adap
->fe
->ops
.tuner_ops
.set_params
= dib807x_set_param_override
;
1226 static int stk80xx_pid_filter(struct dvb_usb_adapter
*adapter
, int index
,
1229 return dib8000_pid_filter(adapter
->fe
, index
, pid
, onoff
);
1232 static int stk80xx_pid_filter_ctrl(struct dvb_usb_adapter
*adapter
,
1235 return dib8000_pid_filter_ctrl(adapter
->fe
, onoff
);
1239 static int stk807x_frontend_attach(struct dvb_usb_adapter
*adap
)
1241 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
1243 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
1244 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
1245 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
1247 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
1249 dib0700_ctrl_clock(adap
->dev
, 72, 1);
1252 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
1254 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
1256 dib8000_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 18,
1259 adap
->fe
= dvb_attach(dib8000_attach
, &adap
->dev
->i2c_adap
, 0x80,
1260 &dib807x_dib8000_config
[0]);
1262 return adap
->fe
== NULL
? -ENODEV
: 0;
1266 static int stk807xpvr_frontend_attach0(struct dvb_usb_adapter
*adap
)
1268 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0);
1270 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
1272 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
1273 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
1274 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
1276 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
1278 dib0700_ctrl_clock(adap
->dev
, 72, 1);
1281 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
1283 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
1285 /* initialize IC 0 */
1286 dib8000_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 0x22, 0x80);
1288 adap
->fe
= dvb_attach(dib8000_attach
, &adap
->dev
->i2c_adap
, 0x80,
1289 &dib807x_dib8000_config
[0]);
1291 return adap
->fe
== NULL
? -ENODEV
: 0;
1294 static int stk807xpvr_frontend_attach1(struct dvb_usb_adapter
*adap
)
1296 /* initialize IC 1 */
1297 dib8000_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 0x12, 0x82);
1299 adap
->fe
= dvb_attach(dib8000_attach
, &adap
->dev
->i2c_adap
, 0x82,
1300 &dib807x_dib8000_config
[1]);
1302 return adap
->fe
== NULL
? -ENODEV
: 0;
1306 struct dibx000_agc_config dib8090_agc_config
[2] = {
1308 BAND_UHF
| BAND_VHF
| BAND_LBAND
| BAND_SBAND
,
1309 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1,
1310 * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
1311 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0 */
1312 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8)
1313 | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
1351 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1,
1352 * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
1353 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0 */
1354 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8)
1355 | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
1393 static struct dibx000_bandwidth_config dib8090_pll_config_12mhz
= {
1397 (3 << 14) | (1 << 12) | (599 << 0),
1403 static int dib8090_get_adc_power(struct dvb_frontend
*fe
)
1405 return dib8000_get_adc_power(fe
, 1);
1408 static struct dib8000_config dib809x_dib8000_config
= {
1409 .output_mpeg2_in_188_bytes
= 1,
1411 .agc_config_count
= 2,
1412 .agc
= dib8090_agc_config
,
1413 .agc_control
= dib0090_dcc_freq
,
1414 .pll
= &dib8090_pll_config_12mhz
,
1415 .tuner_is_baseband
= 1,
1417 .gpio_dir
= DIB8000_GPIO_DEFAULT_DIRECTIONS
,
1418 .gpio_val
= DIB8000_GPIO_DEFAULT_VALUES
,
1419 .gpio_pwm_pos
= DIB8000_GPIO_DEFAULT_PWM_POS
,
1421 .hostbus_diversity
= 1,
1423 .output_mode
= OUTMODE_MPEG2_FIFO
,
1425 .diversity_delay
= 144,
1429 static struct dib0090_config dib809x_dib0090_config
= {
1433 .io
.pll_loopdiv
= 20,
1434 .io
.adc_clock_ratio
= 8,
1435 .io
.pll_int_loop_filt
= 0,
1436 .io
.clock_khz
= 12000,
1437 .reset
= dib80xx_tuner_reset
,
1438 .sleep
= dib80xx_tuner_sleep
,
1441 .i2c_address
= DEFAULT_DIB0090_I2C_ADDRESS
,
1442 .wbd_vhf_offset
= 100,
1443 .wbd_cband_offset
= 450,
1446 .get_adc_power
= dib8090_get_adc_power
,
1447 .freq_offset_khz_uhf
= 0,
1448 .freq_offset_khz_vhf
= -143,
1451 static int dib8096_set_param_override(struct dvb_frontend
*fe
,
1452 struct dvb_frontend_parameters
*fep
)
1454 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
1455 struct dib0700_adapter_state
*state
= adap
->priv
;
1456 u8 band
= BAND_OF_FREQUENCY(fep
->frequency
/1000);
1459 enum frontend_tune_state tune_state
= CT_SHUTDOWN
;
1460 u16 ltgain
, rf_gain_limit
;
1462 ret
= state
->set_param_save(fe
, fep
);
1477 offset
+= (dib0090_get_wbd_offset(fe
) * 8 * 18 / 33 + 1) / 2;
1478 dib8000_set_wbd_ref(fe
, offset
);
1481 if (band
== BAND_CBAND
) {
1482 deb_info("tuning in CBAND - soft-AGC startup\n");
1483 /* TODO specific wbd target for dib0090 - needed for startup ? */
1484 dib0090_set_tune_state(fe
, CT_AGC_START
);
1486 ret
= dib0090_gain_control(fe
);
1488 tune_state
= dib0090_get_tune_state(fe
);
1489 if (tune_state
== CT_AGC_STEP_0
)
1490 dib8000_set_gpio(fe
, 6, 0, 1);
1491 else if (tune_state
== CT_AGC_STEP_1
) {
1492 dib0090_get_current_gain(fe
, NULL
, NULL
, &rf_gain_limit
, <gain
);
1493 if (rf_gain_limit
== 0)
1494 dib8000_set_gpio(fe
, 6, 0, 0);
1496 } while (tune_state
< CT_AGC_STOP
);
1497 dib0090_pwm_gain_reset(fe
);
1498 dib8000_pwm_agc_reset(fe
);
1499 dib8000_set_tune_state(fe
, CT_DEMOD_START
);
1501 deb_info("not tuning in CBAND - standard AGC startup\n");
1502 dib0090_pwm_gain_reset(fe
);
1508 static int dib809x_tuner_attach(struct dvb_usb_adapter
*adap
)
1510 struct dib0700_adapter_state
*st
= adap
->priv
;
1511 struct i2c_adapter
*tun_i2c
= dib8000_get_i2c_master(adap
->fe
, DIBX000_I2C_INTERFACE_TUNER
, 1);
1513 if (dvb_attach(dib0090_register
, adap
->fe
, tun_i2c
, &dib809x_dib0090_config
) == NULL
)
1516 st
->set_param_save
= adap
->fe
->ops
.tuner_ops
.set_params
;
1517 adap
->fe
->ops
.tuner_ops
.set_params
= dib8096_set_param_override
;
1521 static int stk809x_frontend_attach(struct dvb_usb_adapter
*adap
)
1523 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
1525 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
1526 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
1527 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
1529 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
1531 dib0700_ctrl_clock(adap
->dev
, 72, 1);
1534 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
1536 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
1538 dib8000_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 18, 0x80);
1540 adap
->fe
= dvb_attach(dib8000_attach
, &adap
->dev
->i2c_adap
, 0x80, &dib809x_dib8000_config
);
1542 return adap
->fe
== NULL
? -ENODEV
: 0;
1546 static struct dib7000p_config stk7070pd_dib7000p_config
[2] = {
1548 .output_mpeg2_in_188_bytes
= 1,
1550 .agc_config_count
= 1,
1551 .agc
= &dib7070_agc_config
,
1552 .bw
= &dib7070_bw_config_12_mhz
,
1553 .tuner_is_baseband
= 1,
1556 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
1557 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
1558 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
1560 .hostbus_diversity
= 1,
1562 .output_mpeg2_in_188_bytes
= 1,
1564 .agc_config_count
= 1,
1565 .agc
= &dib7070_agc_config
,
1566 .bw
= &dib7070_bw_config_12_mhz
,
1567 .tuner_is_baseband
= 1,
1570 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
1571 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
1572 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
1574 .hostbus_diversity
= 1,
1578 static int stk7070pd_frontend_attach0(struct dvb_usb_adapter
*adap
)
1580 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
1582 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
1583 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
1584 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
1585 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
1587 dib0700_ctrl_clock(adap
->dev
, 72, 1);
1590 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
1592 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
1594 if (dib7000p_i2c_enumeration(&adap
->dev
->i2c_adap
, 2, 18,
1595 stk7070pd_dib7000p_config
) != 0) {
1596 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n",
1601 adap
->fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
, 0x80, &stk7070pd_dib7000p_config
[0]);
1602 return adap
->fe
== NULL
? -ENODEV
: 0;
1605 static int stk7070pd_frontend_attach1(struct dvb_usb_adapter
*adap
)
1607 adap
->fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
, 0x82, &stk7070pd_dib7000p_config
[1]);
1608 return adap
->fe
== NULL
? -ENODEV
: 0;
1612 static struct s5h1411_config pinnacle_801e_config
= {
1613 .output_mode
= S5H1411_PARALLEL_OUTPUT
,
1614 .gpio
= S5H1411_GPIO_OFF
,
1615 .mpeg_timing
= S5H1411_MPEGTIMING_NONCONTINOUS_NONINVERTING_CLOCK
,
1616 .qam_if
= S5H1411_IF_44000
,
1617 .vsb_if
= S5H1411_IF_44000
,
1618 .inversion
= S5H1411_INVERSION_OFF
,
1619 .status_mode
= S5H1411_DEMODLOCKING
1622 /* Pinnacle PCTV HD Pro 801e GPIOs map:
1623 GPIO0 - currently unknown
1624 GPIO1 - xc5000 tuner reset
1625 GPIO2 - CX25843 sleep
1626 GPIO3 - currently unknown
1627 GPIO4 - currently unknown
1628 GPIO6 - currently unknown
1629 GPIO7 - currently unknown
1630 GPIO9 - currently unknown
1631 GPIO10 - CX25843 reset
1633 static int s5h1411_frontend_attach(struct dvb_usb_adapter
*adap
)
1635 struct dib0700_state
*st
= adap
->dev
->priv
;
1637 /* Make use of the new i2c functions from FW 1.20 */
1638 st
->fw_use_new_i2c_api
= 1;
1640 /* The s5h1411 requires the dib0700 to not be in master mode */
1641 st
->disable_streaming_master_mode
= 1;
1643 /* All msleep values taken from Windows USB trace */
1644 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 0);
1645 dib0700_set_gpio(adap
->dev
, GPIO3
, GPIO_OUT
, 0);
1646 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
1648 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
1650 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
1652 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
1653 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
1654 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
1655 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
1656 dib0700_set_gpio(adap
->dev
, GPIO2
, GPIO_OUT
, 0);
1659 /* Put the CX25843 to sleep for now since we're in digital mode */
1660 dib0700_set_gpio(adap
->dev
, GPIO2
, GPIO_OUT
, 1);
1662 /* GPIOs are initialized, do the attach */
1663 adap
->fe
= dvb_attach(s5h1411_attach
, &pinnacle_801e_config
,
1664 &adap
->dev
->i2c_adap
);
1665 return adap
->fe
== NULL
? -ENODEV
: 0;
1668 static int dib0700_xc5000_tuner_callback(void *priv
, int component
,
1669 int command
, int arg
)
1671 struct dvb_usb_adapter
*adap
= priv
;
1673 if (command
== XC5000_TUNER_RESET
) {
1674 /* Reset the tuner */
1675 dib0700_set_gpio(adap
->dev
, GPIO1
, GPIO_OUT
, 0);
1677 dib0700_set_gpio(adap
->dev
, GPIO1
, GPIO_OUT
, 1);
1680 err("xc5000: unknown tuner callback command: %d\n", command
);
1687 static struct xc5000_config s5h1411_xc5000_tunerconfig
= {
1688 .i2c_address
= 0x64,
1692 static int xc5000_tuner_attach(struct dvb_usb_adapter
*adap
)
1694 /* FIXME: generalize & move to common area */
1695 adap
->fe
->callback
= dib0700_xc5000_tuner_callback
;
1697 return dvb_attach(xc5000_attach
, adap
->fe
, &adap
->dev
->i2c_adap
,
1698 &s5h1411_xc5000_tunerconfig
)
1699 == NULL
? -ENODEV
: 0;
1702 static struct lgdt3305_config hcw_lgdt3305_config
= {
1704 .mpeg_mode
= LGDT3305_MPEG_PARALLEL
,
1705 .tpclk_edge
= LGDT3305_TPCLK_FALLING_EDGE
,
1706 .tpvalid_polarity
= LGDT3305_TP_VALID_LOW
,
1708 .spectral_inversion
= 1,
1711 .usref_8vsb
= 0x0500,
1714 static struct mxl5007t_config hcw_mxl5007t_config
= {
1715 .xtal_freq_hz
= MxL_XTAL_25_MHZ
,
1716 .if_freq_hz
= MxL_IF_6_MHZ
,
1721 GPIO0 - LNA_CTR (H: LNA power enabled, L: LNA power disabled)
1722 GPIO1 - ANT_SEL (H: VPA, L: MCX)
1728 MXL is behind LG's i2c repeater. LG is on SCL2/SDA2 gpios on the DIB
1730 static int lgdt3305_frontend_attach(struct dvb_usb_adapter
*adap
)
1732 struct dib0700_state
*st
= adap
->dev
->priv
;
1734 /* Make use of the new i2c functions from FW 1.20 */
1735 st
->fw_use_new_i2c_api
= 1;
1737 st
->disable_streaming_master_mode
= 1;
1739 /* fe power enable */
1740 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0);
1742 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
1746 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
1748 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
1750 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
1753 adap
->fe
= dvb_attach(lgdt3305_attach
,
1754 &hcw_lgdt3305_config
,
1755 &adap
->dev
->i2c_adap
);
1757 return adap
->fe
== NULL
? -ENODEV
: 0;
1760 static int mxl5007t_tuner_attach(struct dvb_usb_adapter
*adap
)
1762 return dvb_attach(mxl5007t_attach
, adap
->fe
,
1763 &adap
->dev
->i2c_adap
, 0x60,
1764 &hcw_mxl5007t_config
) == NULL
? -ENODEV
: 0;
1768 /* DVB-USB and USB stuff follows */
1769 struct usb_device_id dib0700_usb_id_table
[] = {
1770 /* 0 */ { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK7700P
) },
1771 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK7700P_PC
) },
1772 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_T_500
) },
1773 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_T_500_2
) },
1774 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_T_STICK
) },
1775 /* 5 */ { USB_DEVICE(USB_VID_AVERMEDIA
, USB_PID_AVERMEDIA_VOLAR
) },
1776 { USB_DEVICE(USB_VID_COMPRO
, USB_PID_COMPRO_VIDEOMATE_U500
) },
1777 { USB_DEVICE(USB_VID_UNIWILL
, USB_PID_UNIWILL_STK7700P
) },
1778 { USB_DEVICE(USB_VID_LEADTEK
, USB_PID_WINFAST_DTV_DONGLE_STK7700P
) },
1779 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_T_STICK_2
) },
1780 /* 10 */{ USB_DEVICE(USB_VID_AVERMEDIA
, USB_PID_AVERMEDIA_VOLAR_2
) },
1781 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV2000E
) },
1782 { USB_DEVICE(USB_VID_TERRATEC
,
1783 USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY
) },
1784 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_TD_STICK
) },
1785 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK7700D
) },
1786 /* 15 */{ USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK7070P
) },
1787 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV_DVB_T_FLASH
) },
1788 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK7070PD
) },
1789 { USB_DEVICE(USB_VID_PINNACLE
,
1790 USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T
) },
1791 { USB_DEVICE(USB_VID_COMPRO
, USB_PID_COMPRO_VIDEOMATE_U500_PC
) },
1792 /* 20 */{ USB_DEVICE(USB_VID_AVERMEDIA
, USB_PID_AVERMEDIA_EXPRESS
) },
1793 { USB_DEVICE(USB_VID_GIGABYTE
, USB_PID_GIGABYTE_U7000
) },
1794 { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC
, USB_PID_ARTEC_T14BR
) },
1795 { USB_DEVICE(USB_VID_ASUS
, USB_PID_ASUS_U3000
) },
1796 { USB_DEVICE(USB_VID_ASUS
, USB_PID_ASUS_U3100
) },
1797 /* 25 */{ USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_T_STICK_3
) },
1798 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_MYTV_T
) },
1799 { USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_CINERGY_HT_USB_XE
) },
1800 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_EXPRESSCARD_320CX
) },
1801 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV72E
) },
1802 /* 30 */{ USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV73E
) },
1803 { USB_DEVICE(USB_VID_YUAN
, USB_PID_YUAN_EC372S
) },
1804 { USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_CINERGY_HT_EXPRESS
) },
1805 { USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_CINERGY_T_XXS
) },
1806 { USB_DEVICE(USB_VID_LEADTEK
, USB_PID_WINFAST_DTV_DONGLE_STK7700P_2
) },
1807 /* 35 */{ USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_TD_STICK_52009
) },
1808 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_T_500_3
) },
1809 { USB_DEVICE(USB_VID_GIGABYTE
, USB_PID_GIGABYTE_U8000
) },
1810 { USB_DEVICE(USB_VID_YUAN
, USB_PID_YUAN_STK7700PH
) },
1811 { USB_DEVICE(USB_VID_ASUS
, USB_PID_ASUS_U3000H
) },
1812 /* 40 */{ USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV801E
) },
1813 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV801E_SE
) },
1814 { USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_CINERGY_T_EXPRESS
) },
1815 { USB_DEVICE(USB_VID_TERRATEC
,
1816 USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY_2
) },
1817 { USB_DEVICE(USB_VID_SONY
, USB_PID_SONY_PLAYTV
) },
1818 /* 45 */{ USB_DEVICE(USB_VID_YUAN
, USB_PID_YUAN_PD378S
) },
1819 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_TIGER_ATSC
) },
1820 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_TIGER_ATSC_B210
) },
1821 { USB_DEVICE(USB_VID_YUAN
, USB_PID_YUAN_MC770
) },
1822 { USB_DEVICE(USB_VID_ELGATO
, USB_PID_ELGATO_EYETV_DTT
) },
1823 /* 50 */{ USB_DEVICE(USB_VID_ELGATO
, USB_PID_ELGATO_EYETV_DTT_Dlx
) },
1824 { USB_DEVICE(USB_VID_LEADTEK
, USB_PID_WINFAST_DTV_DONGLE_H
) },
1825 { USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_T3
) },
1826 { USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_T5
) },
1827 { USB_DEVICE(USB_VID_YUAN
, USB_PID_YUAN_STK7700D
) },
1828 /* 55 */{ USB_DEVICE(USB_VID_YUAN
, USB_PID_YUAN_STK7700D_2
) },
1829 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV73A
) },
1830 { USB_DEVICE(USB_VID_PCTV
, USB_PID_PINNACLE_PCTV73ESE
) },
1831 { USB_DEVICE(USB_VID_PCTV
, USB_PID_PINNACLE_PCTV282E
) },
1832 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK7770P
) },
1833 /* 60 */{ USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_CINERGY_T_XXS_2
) },
1834 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK807XPVR
) },
1835 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK807XP
) },
1836 { USB_DEVICE_VER(USB_VID_PIXELVIEW
, USB_PID_PIXELVIEW_SBTVD
, 0x000, 0x3f00) },
1837 { USB_DEVICE(USB_VID_EVOLUTEPC
, USB_PID_TVWAY_PLUS
) },
1838 /* 65 */{ USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV73ESE
) },
1839 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV282E
) },
1840 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK8096GP
) },
1841 { USB_DEVICE(USB_VID_ELGATO
, USB_PID_ELGATO_EYETV_DIVERSITY
) },
1842 { 0 } /* Terminating entry */
1844 MODULE_DEVICE_TABLE(usb
, dib0700_usb_id_table
);
1846 #define DIB0700_DEFAULT_DEVICE_PROPERTIES \
1847 .caps = DVB_USB_IS_AN_I2C_ADAPTER, \
1848 .usb_ctrl = DEVICE_SPECIFIC, \
1849 .firmware = "dvb-usb-dib0700-1.20.fw", \
1850 .download_firmware = dib0700_download_firmware, \
1851 .no_reconnect = 1, \
1852 .size_of_priv = sizeof(struct dib0700_state), \
1853 .i2c_algo = &dib0700_i2c_algo, \
1854 .identify_state = dib0700_identify_state
1856 #define DIB0700_DEFAULT_STREAMING_CONFIG(ep) \
1857 .streaming_ctrl = dib0700_streaming_ctrl, \
1864 .buffersize = 39480, \
1869 struct dvb_usb_device_properties dib0700_devices
[] = {
1871 DIB0700_DEFAULT_DEVICE_PROPERTIES
,
1876 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
1877 .pid_filter_count
= 32,
1878 .pid_filter
= stk70x0p_pid_filter
,
1879 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
1880 .frontend_attach
= stk7700p_frontend_attach
,
1881 .tuner_attach
= stk7700p_tuner_attach
,
1883 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
1887 .num_device_descs
= 8,
1889 { "DiBcom STK7700P reference design",
1890 { &dib0700_usb_id_table
[0], &dib0700_usb_id_table
[1] },
1893 { "Hauppauge Nova-T Stick",
1894 { &dib0700_usb_id_table
[4], &dib0700_usb_id_table
[9], NULL
},
1897 { "AVerMedia AVerTV DVB-T Volar",
1898 { &dib0700_usb_id_table
[5], &dib0700_usb_id_table
[10] },
1901 { "Compro Videomate U500",
1902 { &dib0700_usb_id_table
[6], &dib0700_usb_id_table
[19] },
1905 { "Uniwill STK7700P based (Hama and others)",
1906 { &dib0700_usb_id_table
[7], NULL
},
1909 { "Leadtek Winfast DTV Dongle (STK7700P based)",
1910 { &dib0700_usb_id_table
[8], &dib0700_usb_id_table
[34] },
1913 { "AVerMedia AVerTV DVB-T Express",
1914 { &dib0700_usb_id_table
[20] },
1918 { &dib0700_usb_id_table
[21], NULL
},
1924 .rc_interval
= DEFAULT_RC_INTERVAL
,
1925 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
1926 .rc_query
= dib0700_rc_query_old_firmware
,
1927 .allowed_protos
= RC_TYPE_RC5
|
1930 .change_protocol
= dib0700_change_protocol
,
1932 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
1937 .frontend_attach
= bristol_frontend_attach
,
1938 .tuner_attach
= bristol_tuner_attach
,
1940 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
1942 .frontend_attach
= bristol_frontend_attach
,
1943 .tuner_attach
= bristol_tuner_attach
,
1945 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
1949 .num_device_descs
= 1,
1951 { "Hauppauge Nova-T 500 Dual DVB-T",
1952 { &dib0700_usb_id_table
[2], &dib0700_usb_id_table
[3], NULL
},
1958 .rc_interval
= DEFAULT_RC_INTERVAL
,
1959 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
1960 .rc_query
= dib0700_rc_query_old_firmware
,
1961 .allowed_protos
= RC_TYPE_RC5
|
1964 .change_protocol
= dib0700_change_protocol
,
1966 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
1971 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
1972 .pid_filter_count
= 32,
1973 .pid_filter
= stk70x0p_pid_filter
,
1974 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
1975 .frontend_attach
= stk7700d_frontend_attach
,
1976 .tuner_attach
= stk7700d_tuner_attach
,
1978 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
1980 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
1981 .pid_filter_count
= 32,
1982 .pid_filter
= stk70x0p_pid_filter
,
1983 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
1984 .frontend_attach
= stk7700d_frontend_attach
,
1985 .tuner_attach
= stk7700d_tuner_attach
,
1987 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
1991 .num_device_descs
= 5,
1993 { "Pinnacle PCTV 2000e",
1994 { &dib0700_usb_id_table
[11], NULL
},
1997 { "Terratec Cinergy DT XS Diversity",
1998 { &dib0700_usb_id_table
[12], NULL
},
2001 { "Hauppauge Nova-TD Stick/Elgato Eye-TV Diversity",
2002 { &dib0700_usb_id_table
[13], NULL
},
2005 { "DiBcom STK7700D reference design",
2006 { &dib0700_usb_id_table
[14], NULL
},
2009 { "YUAN High-Tech DiBcom STK7700D",
2010 { &dib0700_usb_id_table
[55], NULL
},
2017 .rc_interval
= DEFAULT_RC_INTERVAL
,
2018 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
2019 .rc_query
= dib0700_rc_query_old_firmware
,
2020 .allowed_protos
= RC_TYPE_RC5
|
2023 .change_protocol
= dib0700_change_protocol
,
2025 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
2030 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
2031 .pid_filter_count
= 32,
2032 .pid_filter
= stk70x0p_pid_filter
,
2033 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
2034 .frontend_attach
= stk7700P2_frontend_attach
,
2035 .tuner_attach
= stk7700d_tuner_attach
,
2037 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
2041 .num_device_descs
= 3,
2043 { "ASUS My Cinema U3000 Mini DVBT Tuner",
2044 { &dib0700_usb_id_table
[23], NULL
},
2048 { &dib0700_usb_id_table
[31], NULL
},
2051 { "Terratec Cinergy T Express",
2052 { &dib0700_usb_id_table
[42], NULL
},
2058 .rc_interval
= DEFAULT_RC_INTERVAL
,
2059 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
2060 .module_name
= "dib0700",
2061 .rc_query
= dib0700_rc_query_old_firmware
,
2062 .allowed_protos
= RC_TYPE_RC5
|
2065 .change_protocol
= dib0700_change_protocol
,
2067 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
2072 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
2073 .pid_filter_count
= 32,
2074 .pid_filter
= stk70x0p_pid_filter
,
2075 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
2076 .frontend_attach
= stk7070p_frontend_attach
,
2077 .tuner_attach
= dib7070p_tuner_attach
,
2079 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
2081 .size_of_priv
= sizeof(struct dib0700_adapter_state
),
2085 .num_device_descs
= 11,
2087 { "DiBcom STK7070P reference design",
2088 { &dib0700_usb_id_table
[15], NULL
},
2091 { "Pinnacle PCTV DVB-T Flash Stick",
2092 { &dib0700_usb_id_table
[16], NULL
},
2095 { "Artec T14BR DVB-T",
2096 { &dib0700_usb_id_table
[22], NULL
},
2099 { "ASUS My Cinema U3100 Mini DVBT Tuner",
2100 { &dib0700_usb_id_table
[24], NULL
},
2103 { "Hauppauge Nova-T Stick",
2104 { &dib0700_usb_id_table
[25], NULL
},
2107 { "Hauppauge Nova-T MyTV.t",
2108 { &dib0700_usb_id_table
[26], NULL
},
2111 { "Pinnacle PCTV 72e",
2112 { &dib0700_usb_id_table
[29], NULL
},
2115 { "Pinnacle PCTV 73e",
2116 { &dib0700_usb_id_table
[30], NULL
},
2119 { "Elgato EyeTV DTT",
2120 { &dib0700_usb_id_table
[49], NULL
},
2124 { &dib0700_usb_id_table
[45], NULL
},
2127 { "Elgato EyeTV Dtt Dlx PD378S",
2128 { &dib0700_usb_id_table
[50], NULL
},
2134 .rc_interval
= DEFAULT_RC_INTERVAL
,
2135 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
2136 .module_name
= "dib0700",
2137 .rc_query
= dib0700_rc_query_old_firmware
,
2138 .allowed_protos
= RC_TYPE_RC5
|
2141 .change_protocol
= dib0700_change_protocol
,
2143 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
2148 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
2149 .pid_filter_count
= 32,
2150 .pid_filter
= stk70x0p_pid_filter
,
2151 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
2152 .frontend_attach
= stk7070p_frontend_attach
,
2153 .tuner_attach
= dib7070p_tuner_attach
,
2155 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
2157 .size_of_priv
= sizeof(struct dib0700_adapter_state
),
2161 .num_device_descs
= 3,
2163 { "Pinnacle PCTV 73A",
2164 { &dib0700_usb_id_table
[56], NULL
},
2167 { "Pinnacle PCTV 73e SE",
2168 { &dib0700_usb_id_table
[57], &dib0700_usb_id_table
[65], NULL
},
2171 { "Pinnacle PCTV 282e",
2172 { &dib0700_usb_id_table
[58], &dib0700_usb_id_table
[66], NULL
},
2178 .rc_interval
= DEFAULT_RC_INTERVAL
,
2179 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
2180 .module_name
= "dib0700",
2181 .rc_query
= dib0700_rc_query_old_firmware
,
2182 .allowed_protos
= RC_TYPE_RC5
|
2185 .change_protocol
= dib0700_change_protocol
,
2187 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
2192 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
2193 .pid_filter_count
= 32,
2194 .pid_filter
= stk70x0p_pid_filter
,
2195 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
2196 .frontend_attach
= stk7070pd_frontend_attach0
,
2197 .tuner_attach
= dib7070p_tuner_attach
,
2199 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
2201 .size_of_priv
= sizeof(struct dib0700_adapter_state
),
2203 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
2204 .pid_filter_count
= 32,
2205 .pid_filter
= stk70x0p_pid_filter
,
2206 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
2207 .frontend_attach
= stk7070pd_frontend_attach1
,
2208 .tuner_attach
= dib7070p_tuner_attach
,
2210 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
2212 .size_of_priv
= sizeof(struct dib0700_adapter_state
),
2216 .num_device_descs
= 6,
2218 { "DiBcom STK7070PD reference design",
2219 { &dib0700_usb_id_table
[17], NULL
},
2222 { "Pinnacle PCTV Dual DVB-T Diversity Stick",
2223 { &dib0700_usb_id_table
[18], NULL
},
2226 { "Hauppauge Nova-TD Stick (52009)",
2227 { &dib0700_usb_id_table
[35], NULL
},
2230 { "Hauppauge Nova-TD-500 (84xxx)",
2231 { &dib0700_usb_id_table
[36], NULL
},
2234 { "Terratec Cinergy DT USB XS Diversity/ T5",
2235 { &dib0700_usb_id_table
[43],
2236 &dib0700_usb_id_table
[53], NULL
},
2240 { &dib0700_usb_id_table
[44], NULL
},
2246 .rc_interval
= DEFAULT_RC_INTERVAL
,
2247 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
2248 .module_name
= "dib0700",
2249 .rc_query
= dib0700_rc_query_old_firmware
,
2250 .allowed_protos
= RC_TYPE_RC5
|
2253 .change_protocol
= dib0700_change_protocol
,
2255 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
2260 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
2261 .pid_filter_count
= 32,
2262 .pid_filter
= stk70x0p_pid_filter
,
2263 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
2264 .frontend_attach
= stk7070pd_frontend_attach0
,
2265 .tuner_attach
= dib7070p_tuner_attach
,
2267 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
2269 .size_of_priv
= sizeof(struct dib0700_adapter_state
),
2271 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
2272 .pid_filter_count
= 32,
2273 .pid_filter
= stk70x0p_pid_filter
,
2274 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
2275 .frontend_attach
= stk7070pd_frontend_attach1
,
2276 .tuner_attach
= dib7070p_tuner_attach
,
2278 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
2280 .size_of_priv
= sizeof(struct dib0700_adapter_state
),
2284 .num_device_descs
= 1,
2286 { "Elgato EyeTV Diversity",
2287 { &dib0700_usb_id_table
[68], NULL
},
2293 .rc_interval
= DEFAULT_RC_INTERVAL
,
2294 .rc_codes
= RC_MAP_DIB0700_NEC_TABLE
,
2295 .module_name
= "dib0700",
2296 .rc_query
= dib0700_rc_query_old_firmware
,
2297 .allowed_protos
= RC_TYPE_RC5
|
2300 .change_protocol
= dib0700_change_protocol
,
2302 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
2307 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
2308 .pid_filter_count
= 32,
2309 .pid_filter
= stk70x0p_pid_filter
,
2310 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
2311 .frontend_attach
= stk7700ph_frontend_attach
,
2312 .tuner_attach
= stk7700ph_tuner_attach
,
2314 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
2316 .size_of_priv
= sizeof(struct
2317 dib0700_adapter_state
),
2321 .num_device_descs
= 9,
2323 { "Terratec Cinergy HT USB XE",
2324 { &dib0700_usb_id_table
[27], NULL
},
2327 { "Pinnacle Expresscard 320cx",
2328 { &dib0700_usb_id_table
[28], NULL
},
2331 { "Terratec Cinergy HT Express",
2332 { &dib0700_usb_id_table
[32], NULL
},
2335 { "Gigabyte U8000-RH",
2336 { &dib0700_usb_id_table
[37], NULL
},
2339 { "YUAN High-Tech STK7700PH",
2340 { &dib0700_usb_id_table
[38], NULL
},
2343 { "Asus My Cinema-U3000Hybrid",
2344 { &dib0700_usb_id_table
[39], NULL
},
2347 { "YUAN High-Tech MC770",
2348 { &dib0700_usb_id_table
[48], NULL
},
2351 { "Leadtek WinFast DTV Dongle H",
2352 { &dib0700_usb_id_table
[51], NULL
},
2355 { "YUAN High-Tech STK7700D",
2356 { &dib0700_usb_id_table
[54], NULL
},
2362 .rc_interval
= DEFAULT_RC_INTERVAL
,
2363 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
2364 .module_name
= "dib0700",
2365 .rc_query
= dib0700_rc_query_old_firmware
,
2366 .allowed_protos
= RC_TYPE_RC5
|
2369 .change_protocol
= dib0700_change_protocol
,
2371 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
2375 .frontend_attach
= s5h1411_frontend_attach
,
2376 .tuner_attach
= xc5000_tuner_attach
,
2378 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
2380 .size_of_priv
= sizeof(struct
2381 dib0700_adapter_state
),
2385 .num_device_descs
= 2,
2387 { "Pinnacle PCTV HD Pro USB Stick",
2388 { &dib0700_usb_id_table
[40], NULL
},
2391 { "Pinnacle PCTV HD USB Stick",
2392 { &dib0700_usb_id_table
[41], NULL
},
2398 .rc_interval
= DEFAULT_RC_INTERVAL
,
2399 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
2400 .module_name
= "dib0700",
2401 .rc_query
= dib0700_rc_query_old_firmware
,
2402 .allowed_protos
= RC_TYPE_RC5
|
2405 .change_protocol
= dib0700_change_protocol
,
2407 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
2411 .frontend_attach
= lgdt3305_frontend_attach
,
2412 .tuner_attach
= mxl5007t_tuner_attach
,
2414 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
2416 .size_of_priv
= sizeof(struct
2417 dib0700_adapter_state
),
2421 .num_device_descs
= 2,
2423 { "Hauppauge ATSC MiniCard (B200)",
2424 { &dib0700_usb_id_table
[46], NULL
},
2427 { "Hauppauge ATSC MiniCard (B210)",
2428 { &dib0700_usb_id_table
[47], NULL
},
2432 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
2437 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
2438 .pid_filter_count
= 32,
2439 .pid_filter
= stk70x0p_pid_filter
,
2440 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
2441 .frontend_attach
= stk7770p_frontend_attach
,
2442 .tuner_attach
= dib7770p_tuner_attach
,
2444 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
2447 sizeof(struct dib0700_adapter_state
),
2451 .num_device_descs
= 2,
2453 { "DiBcom STK7770P reference design",
2454 { &dib0700_usb_id_table
[59], NULL
},
2457 { "Terratec Cinergy T USB XXS (HD)/ T3",
2458 { &dib0700_usb_id_table
[33],
2459 &dib0700_usb_id_table
[52],
2460 &dib0700_usb_id_table
[60], NULL
},
2466 .rc_interval
= DEFAULT_RC_INTERVAL
,
2467 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
2468 .module_name
= "dib0700",
2469 .rc_query
= dib0700_rc_query_old_firmware
,
2470 .allowed_protos
= RC_TYPE_RC5
|
2473 .change_protocol
= dib0700_change_protocol
,
2475 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
2479 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
2480 .pid_filter_count
= 32,
2481 .pid_filter
= stk80xx_pid_filter
,
2482 .pid_filter_ctrl
= stk80xx_pid_filter_ctrl
,
2483 .frontend_attach
= stk807x_frontend_attach
,
2484 .tuner_attach
= dib807x_tuner_attach
,
2486 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
2489 sizeof(struct dib0700_adapter_state
),
2493 .num_device_descs
= 3,
2495 { "DiBcom STK807xP reference design",
2496 { &dib0700_usb_id_table
[62], NULL
},
2499 { "Prolink Pixelview SBTVD",
2500 { &dib0700_usb_id_table
[63], NULL
},
2503 { "EvolutePC TVWay+",
2504 { &dib0700_usb_id_table
[64], NULL
},
2510 .rc_interval
= DEFAULT_RC_INTERVAL
,
2511 .rc_codes
= RC_MAP_DIB0700_NEC_TABLE
,
2512 .module_name
= "dib0700",
2513 .rc_query
= dib0700_rc_query_old_firmware
,
2514 .allowed_protos
= RC_TYPE_RC5
|
2517 .change_protocol
= dib0700_change_protocol
,
2519 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
2523 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
2524 .pid_filter_count
= 32,
2525 .pid_filter
= stk80xx_pid_filter
,
2526 .pid_filter_ctrl
= stk80xx_pid_filter_ctrl
,
2527 .frontend_attach
= stk807xpvr_frontend_attach0
,
2528 .tuner_attach
= dib807x_tuner_attach
,
2530 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
2533 sizeof(struct dib0700_adapter_state
),
2536 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
2537 .pid_filter_count
= 32,
2538 .pid_filter
= stk80xx_pid_filter
,
2539 .pid_filter_ctrl
= stk80xx_pid_filter_ctrl
,
2540 .frontend_attach
= stk807xpvr_frontend_attach1
,
2541 .tuner_attach
= dib807x_tuner_attach
,
2543 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
2546 sizeof(struct dib0700_adapter_state
),
2550 .num_device_descs
= 1,
2552 { "DiBcom STK807xPVR reference design",
2553 { &dib0700_usb_id_table
[61], NULL
},
2559 .rc_interval
= DEFAULT_RC_INTERVAL
,
2560 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
2561 .module_name
= "dib0700",
2562 .rc_query
= dib0700_rc_query_old_firmware
,
2563 .allowed_protos
= RC_TYPE_RC5
|
2566 .change_protocol
= dib0700_change_protocol
,
2568 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
2572 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
2573 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
2574 .pid_filter_count
= 32,
2575 .pid_filter
= stk80xx_pid_filter
,
2576 .pid_filter_ctrl
= stk80xx_pid_filter_ctrl
,
2577 .frontend_attach
= stk809x_frontend_attach
,
2578 .tuner_attach
= dib809x_tuner_attach
,
2580 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
2583 sizeof(struct dib0700_adapter_state
),
2587 .num_device_descs
= 1,
2589 { "DiBcom STK8096GP reference design",
2590 { &dib0700_usb_id_table
[67], NULL
},
2596 .rc_interval
= DEFAULT_RC_INTERVAL
,
2597 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
2598 .module_name
= "dib0700",
2599 .rc_query
= dib0700_rc_query_old_firmware
,
2600 .allowed_protos
= RC_TYPE_RC5
|
2603 .change_protocol
= dib0700_change_protocol
,
2608 int dib0700_device_count
= ARRAY_SIZE(dib0700_devices
);