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"
18 #include "tuner-xc2028.h"
27 static int force_lna_activation
;
28 module_param(force_lna_activation
, int, 0644);
29 MODULE_PARM_DESC(force_lna_activation
, "force the activation of Low-Noise-Amplifyer(s) (LNA), "
30 "if applicable for the device (default: 0=automatic/off).");
32 struct dib0700_adapter_state
{
33 int (*set_param_save
) (struct dvb_frontend
*);
34 const struct firmware
*frontend_firmware
;
37 /* Hauppauge Nova-T 500 (aka Bristol)
38 * has a LNA on GPIO0 which is enabled by setting 1 */
39 static struct mt2060_config bristol_mt2060_config
[2] = {
49 static struct dibx000_agc_config bristol_dib3000p_mt2060_agc_config
= {
50 .band_caps
= BAND_VHF
| BAND_UHF
,
51 .setup
= (1 << 8) | (5 << 5) | (0 << 4) | (0 << 3) | (0 << 2) | (2 << 0),
71 static struct dib3000mc_config bristol_dib3000mc_config
[2] = {
72 { .agc
= &bristol_dib3000p_mt2060_agc_config
,
74 .ln_adc_level
= 0x1cc7,
75 .output_mpeg2_in_188_bytes
= 1,
77 { .agc
= &bristol_dib3000p_mt2060_agc_config
,
79 .ln_adc_level
= 0x1cc7,
80 .output_mpeg2_in_188_bytes
= 1,
84 static int bristol_frontend_attach(struct dvb_usb_adapter
*adap
)
86 struct dib0700_state
*st
= adap
->dev
->priv
;
88 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0); msleep(10);
89 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1); msleep(10);
90 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0); msleep(10);
91 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1); msleep(10);
93 if (force_lna_activation
)
94 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
96 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 0);
98 if (dib3000mc_i2c_enumeration(&adap
->dev
->i2c_adap
, 2, DEFAULT_DIB3000P_I2C_ADDRESS
, bristol_dib3000mc_config
) != 0) {
99 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0); msleep(10);
103 st
->mt2060_if1
[adap
->id
] = 1220;
104 return (adap
->fe_adap
[0].fe
= dvb_attach(dib3000mc_attach
, &adap
->dev
->i2c_adap
,
105 (10 + adap
->id
) << 1, &bristol_dib3000mc_config
[adap
->id
])) == NULL
? -ENODEV
: 0;
108 static int eeprom_read(struct i2c_adapter
*adap
,u8 adrs
,u8
*pval
)
110 struct i2c_msg msg
[2] = {
111 { .addr
= 0x50, .flags
= 0, .buf
= &adrs
, .len
= 1 },
112 { .addr
= 0x50, .flags
= I2C_M_RD
, .buf
= pval
, .len
= 1 },
114 if (i2c_transfer(adap
, msg
, 2) != 2) return -EREMOTEIO
;
118 static int bristol_tuner_attach(struct dvb_usb_adapter
*adap
)
120 struct i2c_adapter
*prim_i2c
= &adap
->dev
->i2c_adap
;
121 struct i2c_adapter
*tun_i2c
= dib3000mc_get_tuner_i2c_master(adap
->fe_adap
[0].fe
, 1);
124 if (adap
->dev
->udev
->descriptor
.idVendor
== cpu_to_le16(USB_VID_HAUPPAUGE
) &&
125 adap
->dev
->udev
->descriptor
.idProduct
== cpu_to_le16(USB_PID_HAUPPAUGE_NOVA_T_500_2
)) {
126 if (!eeprom_read(prim_i2c
,0x59 + adap
->id
,&a
)) if1
=1220+a
;
128 return dvb_attach(mt2060_attach
, adap
->fe_adap
[0].fe
, tun_i2c
,
129 &bristol_mt2060_config
[adap
->id
], if1
) == NULL
?
133 /* STK7700D: Pinnacle/Terratec/Hauppauge Dual DVB-T Diversity */
136 static struct dibx000_agc_config stk7700d_7000p_mt2266_agc_config
[2] = {
140 /* 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,
141 * 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 */
142 (0 << 15) | (0 << 14) | (1 << 11) | (1 << 10) | (1 << 9) | (0 << 8)
143 | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
178 BAND_VHF
| BAND_LBAND
,
180 /* 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,
181 * 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 */
182 (0 << 15) | (0 << 14) | (1 << 11) | (1 << 10) | (1 << 9) | (0 << 8)
183 | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0),
220 static struct dibx000_bandwidth_config stk7700d_mt2266_pll_config
= {
224 (3 << 14) | (1 << 12) | (524 << 0),
229 static struct dib7000p_config stk7700d_dib7000p_mt2266_config
[] = {
230 { .output_mpeg2_in_188_bytes
= 1,
231 .hostbus_diversity
= 1,
232 .tuner_is_baseband
= 1,
234 .agc_config_count
= 2,
235 .agc
= stk7700d_7000p_mt2266_agc_config
,
236 .bw
= &stk7700d_mt2266_pll_config
,
238 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
239 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
240 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
242 { .output_mpeg2_in_188_bytes
= 1,
243 .hostbus_diversity
= 1,
244 .tuner_is_baseband
= 1,
246 .agc_config_count
= 2,
247 .agc
= stk7700d_7000p_mt2266_agc_config
,
248 .bw
= &stk7700d_mt2266_pll_config
,
250 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
251 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
252 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
256 static struct mt2266_config stk7700d_mt2266_config
[2] = {
257 { .i2c_address
= 0x60
259 { .i2c_address
= 0x60
263 static int stk7700P2_frontend_attach(struct dvb_usb_adapter
*adap
)
266 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
268 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
269 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
270 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
271 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
273 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
275 if (dib7000p_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 18,
276 stk7700d_dib7000p_mt2266_config
)
278 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", __func__
);
283 adap
->fe_adap
[0].fe
=
284 dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
,
285 0x80 + (adap
->id
<< 1),
286 &stk7700d_dib7000p_mt2266_config
[adap
->id
]);
288 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
291 static int stk7700d_frontend_attach(struct dvb_usb_adapter
*adap
)
294 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
296 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
297 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
298 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
299 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
301 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
303 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
304 if (dib7000p_i2c_enumeration(&adap
->dev
->i2c_adap
, 2, 18,
305 stk7700d_dib7000p_mt2266_config
)
307 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", __func__
);
312 adap
->fe_adap
[0].fe
=
313 dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
,
314 0x80 + (adap
->id
<< 1),
315 &stk7700d_dib7000p_mt2266_config
[adap
->id
]);
317 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
320 static int stk7700d_tuner_attach(struct dvb_usb_adapter
*adap
)
322 struct i2c_adapter
*tun_i2c
;
323 tun_i2c
= dib7000p_get_i2c_master(adap
->fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_TUNER
, 1);
324 return dvb_attach(mt2266_attach
, adap
->fe_adap
[0].fe
, tun_i2c
,
325 &stk7700d_mt2266_config
[adap
->id
]) == NULL
? -ENODEV
: 0;
328 /* STK7700-PH: Digital/Analog Hybrid Tuner, e.h. Cinergy HT USB HE */
329 static struct dibx000_agc_config xc3028_agc_config
= {
330 BAND_VHF
| BAND_UHF
, /* band_caps */
332 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=0,
333 * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
334 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */
335 (0 << 15) | (0 << 14) | (0 << 11) | (0 << 10) | (0 << 9) | (0 << 8) |
336 (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), /* setup */
339 21, /* time_stabiliz */
351 39718, /* agc2_max */
360 29, /* agc2_slope1 */
361 29, /* agc2_slope2 */
368 1, /* perform_agc_softsplit */
371 /* PLL Configuration for COFDM BW_MHz = 8.00 with external clock = 30.00 */
372 static struct dibx000_bandwidth_config xc3028_bw_config
= {
373 60000, 30000, /* internal, sampling */
374 1, 8, 3, 1, 0, /* pll_cfg: prediv, ratio, range, reset, bypass */
375 0, 0, 1, 1, 0, /* misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc,
377 (3 << 14) | (1 << 12) | (524 << 0), /* sad_cfg: refsel, sel, freq_15k */
378 (1 << 25) | 5816102, /* ifreq = 5.200000 MHz */
380 30000000, /* xtal_hz */
383 static struct dib7000p_config stk7700ph_dib7700_xc3028_config
= {
384 .output_mpeg2_in_188_bytes
= 1,
385 .tuner_is_baseband
= 1,
387 .agc_config_count
= 1,
388 .agc
= &xc3028_agc_config
,
389 .bw
= &xc3028_bw_config
,
391 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
392 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
393 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
396 static int stk7700ph_xc3028_callback(void *ptr
, int component
,
397 int command
, int arg
)
399 struct dvb_usb_adapter
*adap
= ptr
;
402 case XC2028_TUNER_RESET
:
403 /* Send the tuner in then out of reset */
404 dib7000p_set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 0); msleep(10);
405 dib7000p_set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 1);
407 case XC2028_RESET_CLK
:
410 err("%s: unknown command %d, arg %d\n", __func__
,
417 static struct xc2028_ctrl stk7700ph_xc3028_ctrl
= {
418 .fname
= XC2028_DEFAULT_FIRMWARE
,
420 .demod
= XC3028_FE_DIBCOM52
,
423 static struct xc2028_config stk7700ph_xc3028_config
= {
425 .ctrl
= &stk7700ph_xc3028_ctrl
,
428 static int stk7700ph_frontend_attach(struct dvb_usb_adapter
*adap
)
430 struct usb_device_descriptor
*desc
= &adap
->dev
->udev
->descriptor
;
432 if (desc
->idVendor
== cpu_to_le16(USB_VID_PINNACLE
) &&
433 desc
->idProduct
== cpu_to_le16(USB_PID_PINNACLE_EXPRESSCARD_320CX
))
434 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0);
436 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
438 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
439 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
440 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
441 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
443 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
445 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
448 if (dib7000p_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 18,
449 &stk7700ph_dib7700_xc3028_config
) != 0) {
450 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n",
455 adap
->fe_adap
[0].fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
, 0x80,
456 &stk7700ph_dib7700_xc3028_config
);
458 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
461 static int stk7700ph_tuner_attach(struct dvb_usb_adapter
*adap
)
463 struct i2c_adapter
*tun_i2c
;
465 tun_i2c
= dib7000p_get_i2c_master(adap
->fe_adap
[0].fe
,
466 DIBX000_I2C_INTERFACE_TUNER
, 1);
468 stk7700ph_xc3028_config
.i2c_adap
= tun_i2c
;
470 /* FIXME: generalize & move to common area */
471 adap
->fe_adap
[0].fe
->callback
= stk7700ph_xc3028_callback
;
473 return dvb_attach(xc2028_attach
, adap
->fe_adap
[0].fe
, &stk7700ph_xc3028_config
)
474 == NULL
? -ENODEV
: 0;
477 #define DEFAULT_RC_INTERVAL 50
479 static u8 rc_request
[] = { REQUEST_POLL_RC
, 0 };
481 /* Number of keypresses to ignore before start repeating */
482 #define RC_REPEAT_DELAY 6
485 * This function is used only when firmware is < 1.20 version. Newer
486 * firmwares use bulk mode, with functions implemented at dib0700_core,
487 * at dib0700_rc_urb_completion()
489 static int dib0700_rc_query_old_firmware(struct dvb_usb_device
*d
)
495 struct dib0700_state
*st
= d
->priv
;
497 if (st
->fw_version
>= 0x10200) {
498 /* For 1.20 firmware , We need to keep the RC polling
499 callback so we can reuse the input device setup in
500 dvb-usb-remote.c. However, the actual work is being done
501 in the bulk URB completion handler. */
505 i
= dib0700_ctrl_rd(d
, rc_request
, 2, key
, 4);
507 err("RC Query Failed");
511 /* losing half of KEY_0 events from Philipps rc5 remotes.. */
512 if (key
[0] == 0 && key
[1] == 0 && key
[2] == 0 && key
[3] == 0)
515 /* 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]); */
517 dib0700_rc_setup(d
); /* reset ir sensor data to prevent false events */
520 switch (d
->props
.rc
.core
.protocol
) {
522 /* NEC protocol sends repeat code as 0 0 0 FF */
523 if ((key
[3-2] == 0x00) && (key
[3-3] == 0x00) &&
525 keycode
= d
->last_event
;
527 keycode
= key
[3-2] << 8 | key
[3-3];
528 d
->last_event
= keycode
;
531 rc_keydown(d
->rc_dev
, keycode
, 0);
534 /* RC-5 protocol changes toggle bit on new keypress */
535 keycode
= key
[3-2] << 8 | key
[3-3];
537 rc_keydown(d
->rc_dev
, keycode
, toggle
);
544 /* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */
545 static struct dibx000_agc_config stk7700p_7000m_mt2060_agc_config
= {
548 /* 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,
549 * 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 */
550 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8)
551 | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0),
591 static struct dibx000_agc_config stk7700p_7000p_mt2060_agc_config
= {
594 /* 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,
595 * 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 */
596 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8)
597 | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0),
637 static struct dibx000_bandwidth_config stk7700p_pll_config
= {
641 (3 << 14) | (1 << 12) | (524 << 0),
647 static struct dib7000m_config stk7700p_dib7000m_config
= {
649 .output_mpeg2_in_188_bytes
= 1,
652 .agc_config_count
= 1,
653 .agc
= &stk7700p_7000m_mt2060_agc_config
,
654 .bw
= &stk7700p_pll_config
,
656 .gpio_dir
= DIB7000M_GPIO_DEFAULT_DIRECTIONS
,
657 .gpio_val
= DIB7000M_GPIO_DEFAULT_VALUES
,
658 .gpio_pwm_pos
= DIB7000M_GPIO_DEFAULT_PWM_POS
,
661 static struct dib7000p_config stk7700p_dib7000p_config
= {
662 .output_mpeg2_in_188_bytes
= 1,
664 .agc_config_count
= 1,
665 .agc
= &stk7700p_7000p_mt2060_agc_config
,
666 .bw
= &stk7700p_pll_config
,
668 .gpio_dir
= DIB7000M_GPIO_DEFAULT_DIRECTIONS
,
669 .gpio_val
= DIB7000M_GPIO_DEFAULT_VALUES
,
670 .gpio_pwm_pos
= DIB7000M_GPIO_DEFAULT_PWM_POS
,
673 static int stk7700p_frontend_attach(struct dvb_usb_adapter
*adap
)
675 struct dib0700_state
*st
= adap
->dev
->priv
;
676 /* unless there is no real power management in DVB - we leave the device on GPIO6 */
678 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
679 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0); msleep(50);
681 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1); msleep(10);
682 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
684 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0); msleep(10);
685 dib0700_ctrl_clock(adap
->dev
, 72, 1);
686 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1); msleep(100);
688 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
690 st
->mt2060_if1
[0] = 1220;
692 if (dib7000pc_detection(&adap
->dev
->i2c_adap
)) {
693 adap
->fe_adap
[0].fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
, 18, &stk7700p_dib7000p_config
);
694 st
->is_dib7000pc
= 1;
696 adap
->fe_adap
[0].fe
= dvb_attach(dib7000m_attach
, &adap
->dev
->i2c_adap
, 18, &stk7700p_dib7000m_config
);
698 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
701 static struct mt2060_config stk7700p_mt2060_config
= {
705 static int stk7700p_tuner_attach(struct dvb_usb_adapter
*adap
)
707 struct i2c_adapter
*prim_i2c
= &adap
->dev
->i2c_adap
;
708 struct dib0700_state
*st
= adap
->dev
->priv
;
709 struct i2c_adapter
*tun_i2c
;
712 if (adap
->dev
->udev
->descriptor
.idVendor
== cpu_to_le16(USB_VID_HAUPPAUGE
) &&
713 adap
->dev
->udev
->descriptor
.idProduct
== cpu_to_le16(USB_PID_HAUPPAUGE_NOVA_T_STICK
)) {
714 if (!eeprom_read(prim_i2c
,0x58,&a
)) if1
=1220+a
;
716 if (st
->is_dib7000pc
)
717 tun_i2c
= dib7000p_get_i2c_master(adap
->fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_TUNER
, 1);
719 tun_i2c
= dib7000m_get_i2c_master(adap
->fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_TUNER
, 1);
721 return dvb_attach(mt2060_attach
, adap
->fe_adap
[0].fe
, tun_i2c
, &stk7700p_mt2060_config
,
722 if1
) == NULL
? -ENODEV
: 0;
725 /* DIB7070 generic */
726 static struct dibx000_agc_config dib7070_agc_config
= {
727 BAND_UHF
| BAND_VHF
| BAND_LBAND
| BAND_SBAND
,
728 /* 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,
729 * 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 */
730 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8)
731 | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
768 static int dib7070_tuner_reset(struct dvb_frontend
*fe
, int onoff
)
770 deb_info("reset: %d", onoff
);
771 return dib7000p_set_gpio(fe
, 8, 0, !onoff
);
774 static int dib7070_tuner_sleep(struct dvb_frontend
*fe
, int onoff
)
776 deb_info("sleep: %d", onoff
);
777 return dib7000p_set_gpio(fe
, 9, 0, onoff
);
780 static struct dib0070_config dib7070p_dib0070_config
[2] = {
782 .i2c_address
= DEFAULT_DIB0070_I2C_ADDRESS
,
783 .reset
= dib7070_tuner_reset
,
784 .sleep
= dib7070_tuner_sleep
,
786 .clock_pad_drive
= 4,
789 .i2c_address
= DEFAULT_DIB0070_I2C_ADDRESS
,
790 .reset
= dib7070_tuner_reset
,
791 .sleep
= dib7070_tuner_sleep
,
797 static struct dib0070_config dib7770p_dib0070_config
= {
798 .i2c_address
= DEFAULT_DIB0070_I2C_ADDRESS
,
799 .reset
= dib7070_tuner_reset
,
800 .sleep
= dib7070_tuner_sleep
,
802 .clock_pad_drive
= 0,
807 static int dib7070_set_param_override(struct dvb_frontend
*fe
)
809 struct dtv_frontend_properties
*p
= &fe
->dtv_property_cache
;
810 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
811 struct dib0700_adapter_state
*state
= adap
->priv
;
814 u8 band
= BAND_OF_FREQUENCY(p
->frequency
/1000);
816 case BAND_VHF
: offset
= 950; break;
818 default: offset
= 550; break;
820 deb_info("WBD for DiB7000P: %d\n", offset
+ dib0070_wbd_offset(fe
));
821 dib7000p_set_wbd_ref(fe
, offset
+ dib0070_wbd_offset(fe
));
822 return state
->set_param_save(fe
);
825 static int dib7770_set_param_override(struct dvb_frontend
*fe
)
827 struct dtv_frontend_properties
*p
= &fe
->dtv_property_cache
;
828 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
829 struct dib0700_adapter_state
*state
= adap
->priv
;
832 u8 band
= BAND_OF_FREQUENCY(p
->frequency
/1000);
835 dib7000p_set_gpio(fe
, 0, 0, 1);
840 dib7000p_set_gpio(fe
, 0, 0, 0);
844 deb_info("WBD for DiB7000P: %d\n", offset
+ dib0070_wbd_offset(fe
));
845 dib7000p_set_wbd_ref(fe
, offset
+ dib0070_wbd_offset(fe
));
846 return state
->set_param_save(fe
);
849 static int dib7770p_tuner_attach(struct dvb_usb_adapter
*adap
)
851 struct dib0700_adapter_state
*st
= adap
->priv
;
852 struct i2c_adapter
*tun_i2c
= dib7000p_get_i2c_master(adap
->fe_adap
[0].fe
,
853 DIBX000_I2C_INTERFACE_TUNER
, 1);
855 if (dvb_attach(dib0070_attach
, adap
->fe_adap
[0].fe
, tun_i2c
,
856 &dib7770p_dib0070_config
) == NULL
)
859 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
860 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib7770_set_param_override
;
864 static int dib7070p_tuner_attach(struct dvb_usb_adapter
*adap
)
866 struct dib0700_adapter_state
*st
= adap
->priv
;
867 struct i2c_adapter
*tun_i2c
= dib7000p_get_i2c_master(adap
->fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_TUNER
, 1);
870 if (dvb_attach(dib0070_attach
, adap
->fe_adap
[0].fe
, tun_i2c
, &dib7070p_dib0070_config
[0]) == NULL
)
873 if (dvb_attach(dib0070_attach
, adap
->fe_adap
[0].fe
, tun_i2c
, &dib7070p_dib0070_config
[1]) == NULL
)
877 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
878 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib7070_set_param_override
;
882 static int stk7700p_pid_filter(struct dvb_usb_adapter
*adapter
, int index
,
885 struct dib0700_state
*st
= adapter
->dev
->priv
;
886 if (st
->is_dib7000pc
)
887 return dib7000p_pid_filter(adapter
->fe_adap
[0].fe
, index
, pid
, onoff
);
888 return dib7000m_pid_filter(adapter
->fe_adap
[0].fe
, index
, pid
, onoff
);
891 static int stk7700p_pid_filter_ctrl(struct dvb_usb_adapter
*adapter
, int onoff
)
893 struct dib0700_state
*st
= adapter
->dev
->priv
;
894 if (st
->is_dib7000pc
)
895 return dib7000p_pid_filter_ctrl(adapter
->fe_adap
[0].fe
, onoff
);
896 return dib7000m_pid_filter_ctrl(adapter
->fe_adap
[0].fe
, onoff
);
899 static int stk70x0p_pid_filter(struct dvb_usb_adapter
*adapter
, int index
, u16 pid
, int onoff
)
901 return dib7000p_pid_filter(adapter
->fe_adap
[0].fe
, index
, pid
, onoff
);
904 static int stk70x0p_pid_filter_ctrl(struct dvb_usb_adapter
*adapter
, int onoff
)
906 return dib7000p_pid_filter_ctrl(adapter
->fe_adap
[0].fe
, onoff
);
909 static struct dibx000_bandwidth_config dib7070_bw_config_12_mhz
= {
913 (3 << 14) | (1 << 12) | (524 << 0),
919 static struct dib7000p_config dib7070p_dib7000p_config
= {
920 .output_mpeg2_in_188_bytes
= 1,
922 .agc_config_count
= 1,
923 .agc
= &dib7070_agc_config
,
924 .bw
= &dib7070_bw_config_12_mhz
,
925 .tuner_is_baseband
= 1,
928 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
929 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
930 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
932 .hostbus_diversity
= 1,
936 static int stk7070p_frontend_attach(struct dvb_usb_adapter
*adap
)
938 struct usb_device_descriptor
*p
= &adap
->dev
->udev
->descriptor
;
939 if (p
->idVendor
== cpu_to_le16(USB_VID_PINNACLE
) &&
940 p
->idProduct
== cpu_to_le16(USB_PID_PINNACLE_PCTV72E
))
941 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0);
943 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
945 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
946 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
947 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
948 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
950 dib0700_ctrl_clock(adap
->dev
, 72, 1);
953 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
955 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
957 if (dib7000p_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 18,
958 &dib7070p_dib7000p_config
) != 0) {
959 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n",
964 adap
->fe_adap
[0].fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
, 0x80,
965 &dib7070p_dib7000p_config
);
966 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
970 static struct dib7000p_config dib7770p_dib7000p_config
= {
971 .output_mpeg2_in_188_bytes
= 1,
973 .agc_config_count
= 1,
974 .agc
= &dib7070_agc_config
,
975 .bw
= &dib7070_bw_config_12_mhz
,
976 .tuner_is_baseband
= 1,
979 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
980 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
981 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
983 .hostbus_diversity
= 1,
984 .enable_current_mirror
= 1,
985 .disable_sample_and_hold
= 0,
988 static int stk7770p_frontend_attach(struct dvb_usb_adapter
*adap
)
990 struct usb_device_descriptor
*p
= &adap
->dev
->udev
->descriptor
;
991 if (p
->idVendor
== cpu_to_le16(USB_VID_PINNACLE
) &&
992 p
->idProduct
== cpu_to_le16(USB_PID_PINNACLE_PCTV72E
))
993 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0);
995 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
997 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
998 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
999 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
1000 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
1002 dib0700_ctrl_clock(adap
->dev
, 72, 1);
1005 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
1007 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
1009 if (dib7000p_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 18,
1010 &dib7770p_dib7000p_config
) != 0) {
1011 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n",
1016 adap
->fe_adap
[0].fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
, 0x80,
1017 &dib7770p_dib7000p_config
);
1018 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
1021 /* DIB807x generic */
1022 static struct dibx000_agc_config dib807x_agc_config
[2] = {
1025 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0,
1026 * P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0,
1027 * P_agc_inv_pwm2=0,P_agc_inh_dc_rv_est=0,
1028 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5,
1030 (0 << 15) | (0 << 14) | (7 << 11) | (0 << 10) | (0 << 9) |
1031 (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) |
1032 (0 << 0), /* setup*/
1035 10, /* time_stabiliz*/
1045 65535, /* agc1_max*/
1048 65535, /* agc2_max*/
1054 206, /* agc1_slope1*/
1055 255, /* agc1_slope2*/
1058 88, /* agc2_slope1*/
1059 90, /* agc2_slope2*/
1066 0, /* perform_agc_softsplit*/
1069 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0,
1070 * P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0,
1071 * P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
1072 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5,
1074 (0 << 15) | (0 << 14) | (1 << 11) | (0 << 10) | (0 << 9) |
1075 (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) |
1076 (0 << 0), /* setup */
1079 10, /* time_stabiliz*/
1089 65535, /* agc1_max*/
1092 65535, /* agc2_max*/
1098 206, /* agc1_slope1*/
1099 255, /* agc1_slope2*/
1102 88, /* agc2_slope1*/
1103 90, /* agc2_slope2*/
1110 0, /* perform_agc_softsplit*/
1114 static struct dibx000_bandwidth_config dib807x_bw_config_12_mhz
= {
1115 60000, 15000, /* internal, sampling*/
1116 1, 20, 3, 1, 0, /* pll_cfg: prediv, ratio, range, reset, bypass*/
1117 0, 0, 1, 1, 2, /* misc: refdiv, bypclk_div, IO_CLK_en_core,
1119 (3 << 14) | (1 << 12) | (599 << 0), /* sad_cfg: refsel, sel, freq_15k*/
1120 (0 << 25) | 0, /* ifreq = 0.000000 MHz*/
1122 12000000, /* xtal_hz*/
1125 static struct dib8000_config dib807x_dib8000_config
[2] = {
1127 .output_mpeg2_in_188_bytes
= 1,
1129 .agc_config_count
= 2,
1130 .agc
= dib807x_agc_config
,
1131 .pll
= &dib807x_bw_config_12_mhz
,
1132 .tuner_is_baseband
= 1,
1134 .gpio_dir
= DIB8000_GPIO_DEFAULT_DIRECTIONS
,
1135 .gpio_val
= DIB8000_GPIO_DEFAULT_VALUES
,
1136 .gpio_pwm_pos
= DIB8000_GPIO_DEFAULT_PWM_POS
,
1138 .hostbus_diversity
= 1,
1140 .agc_control
= &dib0070_ctrl_agc_filter
,
1141 .output_mode
= OUTMODE_MPEG2_FIFO
,
1144 .output_mpeg2_in_188_bytes
= 1,
1146 .agc_config_count
= 2,
1147 .agc
= dib807x_agc_config
,
1148 .pll
= &dib807x_bw_config_12_mhz
,
1149 .tuner_is_baseband
= 1,
1151 .gpio_dir
= DIB8000_GPIO_DEFAULT_DIRECTIONS
,
1152 .gpio_val
= DIB8000_GPIO_DEFAULT_VALUES
,
1153 .gpio_pwm_pos
= DIB8000_GPIO_DEFAULT_PWM_POS
,
1155 .hostbus_diversity
= 1,
1156 .agc_control
= &dib0070_ctrl_agc_filter
,
1157 .output_mode
= OUTMODE_MPEG2_FIFO
,
1162 static int dib80xx_tuner_reset(struct dvb_frontend
*fe
, int onoff
)
1164 return dib8000_set_gpio(fe
, 5, 0, !onoff
);
1167 static int dib80xx_tuner_sleep(struct dvb_frontend
*fe
, int onoff
)
1169 return dib8000_set_gpio(fe
, 0, 0, onoff
);
1172 static const struct dib0070_wbd_gain_cfg dib8070_wbd_gain_cfg
[] = {
1177 static struct dib0070_config dib807x_dib0070_config
[2] = {
1179 .i2c_address
= DEFAULT_DIB0070_I2C_ADDRESS
,
1180 .reset
= dib80xx_tuner_reset
,
1181 .sleep
= dib80xx_tuner_sleep
,
1183 .clock_pad_drive
= 4,
1185 .force_crystal_mode
= 1,
1186 .enable_third_order_filter
= 1,
1188 .wbd_gain
= dib8070_wbd_gain_cfg
,
1189 .osc_buffer_state
= 0,
1190 .freq_offset_khz_uhf
= -100,
1191 .freq_offset_khz_vhf
= -100,
1193 .i2c_address
= DEFAULT_DIB0070_I2C_ADDRESS
,
1194 .reset
= dib80xx_tuner_reset
,
1195 .sleep
= dib80xx_tuner_sleep
,
1197 .clock_pad_drive
= 2,
1199 .force_crystal_mode
= 1,
1200 .enable_third_order_filter
= 1,
1202 .wbd_gain
= dib8070_wbd_gain_cfg
,
1203 .osc_buffer_state
= 0,
1204 .freq_offset_khz_uhf
= -25,
1205 .freq_offset_khz_vhf
= -25,
1209 static int dib807x_set_param_override(struct dvb_frontend
*fe
)
1211 struct dtv_frontend_properties
*p
= &fe
->dtv_property_cache
;
1212 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
1213 struct dib0700_adapter_state
*state
= adap
->priv
;
1215 u16 offset
= dib0070_wbd_offset(fe
);
1216 u8 band
= BAND_OF_FREQUENCY(p
->frequency
/1000);
1221 case BAND_UHF
: /* fall-thru wanted */
1223 offset
+= 250; break;
1225 deb_info("WBD for DiB8000: %d\n", offset
);
1226 dib8000_set_wbd_ref(fe
, offset
);
1228 return state
->set_param_save(fe
);
1231 static int dib807x_tuner_attach(struct dvb_usb_adapter
*adap
)
1233 struct dib0700_adapter_state
*st
= adap
->priv
;
1234 struct i2c_adapter
*tun_i2c
= dib8000_get_i2c_master(adap
->fe_adap
[0].fe
,
1235 DIBX000_I2C_INTERFACE_TUNER
, 1);
1237 if (adap
->id
== 0) {
1238 if (dvb_attach(dib0070_attach
, adap
->fe_adap
[0].fe
, tun_i2c
,
1239 &dib807x_dib0070_config
[0]) == NULL
)
1242 if (dvb_attach(dib0070_attach
, adap
->fe_adap
[0].fe
, tun_i2c
,
1243 &dib807x_dib0070_config
[1]) == NULL
)
1247 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
1248 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib807x_set_param_override
;
1252 static int stk80xx_pid_filter(struct dvb_usb_adapter
*adapter
, int index
,
1255 return dib8000_pid_filter(adapter
->fe_adap
[0].fe
, index
, pid
, onoff
);
1258 static int stk80xx_pid_filter_ctrl(struct dvb_usb_adapter
*adapter
,
1261 return dib8000_pid_filter_ctrl(adapter
->fe_adap
[0].fe
, onoff
);
1265 static int stk807x_frontend_attach(struct dvb_usb_adapter
*adap
)
1267 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
1269 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
1270 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
1271 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
1273 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
1275 dib0700_ctrl_clock(adap
->dev
, 72, 1);
1278 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
1280 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
1282 dib8000_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 18,
1285 adap
->fe_adap
[0].fe
= dvb_attach(dib8000_attach
, &adap
->dev
->i2c_adap
, 0x80,
1286 &dib807x_dib8000_config
[0]);
1288 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
1292 static int stk807xpvr_frontend_attach0(struct dvb_usb_adapter
*adap
)
1294 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0);
1296 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
1298 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
1299 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
1300 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
1302 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
1304 dib0700_ctrl_clock(adap
->dev
, 72, 1);
1307 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
1309 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
1311 /* initialize IC 0 */
1312 dib8000_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 0x22, 0x80, 0);
1314 adap
->fe_adap
[0].fe
= dvb_attach(dib8000_attach
, &adap
->dev
->i2c_adap
, 0x80,
1315 &dib807x_dib8000_config
[0]);
1317 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
1320 static int stk807xpvr_frontend_attach1(struct dvb_usb_adapter
*adap
)
1322 /* initialize IC 1 */
1323 dib8000_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 0x12, 0x82, 0);
1325 adap
->fe_adap
[0].fe
= dvb_attach(dib8000_attach
, &adap
->dev
->i2c_adap
, 0x82,
1326 &dib807x_dib8000_config
[1]);
1328 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
1332 static struct dibx000_agc_config dib8090_agc_config
[2] = {
1334 BAND_UHF
| BAND_VHF
| BAND_LBAND
| BAND_SBAND
,
1335 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1,
1336 * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
1337 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0 */
1338 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8)
1339 | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
1377 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1,
1378 * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
1379 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0 */
1380 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8)
1381 | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
1419 static struct dibx000_bandwidth_config dib8090_pll_config_12mhz
= {
1423 (3 << 14) | (1 << 12) | (599 << 0),
1429 static int dib8090_get_adc_power(struct dvb_frontend
*fe
)
1431 return dib8000_get_adc_power(fe
, 1);
1434 static struct dib8000_config dib809x_dib8000_config
[2] = {
1436 .output_mpeg2_in_188_bytes
= 1,
1438 .agc_config_count
= 2,
1439 .agc
= dib8090_agc_config
,
1440 .agc_control
= dib0090_dcc_freq
,
1441 .pll
= &dib8090_pll_config_12mhz
,
1442 .tuner_is_baseband
= 1,
1444 .gpio_dir
= DIB8000_GPIO_DEFAULT_DIRECTIONS
,
1445 .gpio_val
= DIB8000_GPIO_DEFAULT_VALUES
,
1446 .gpio_pwm_pos
= DIB8000_GPIO_DEFAULT_PWM_POS
,
1448 .hostbus_diversity
= 1,
1450 .output_mode
= OUTMODE_MPEG2_FIFO
,
1452 .diversity_delay
= 48,
1455 .output_mpeg2_in_188_bytes
= 1,
1457 .agc_config_count
= 2,
1458 .agc
= dib8090_agc_config
,
1459 .agc_control
= dib0090_dcc_freq
,
1460 .pll
= &dib8090_pll_config_12mhz
,
1461 .tuner_is_baseband
= 1,
1463 .gpio_dir
= DIB8000_GPIO_DEFAULT_DIRECTIONS
,
1464 .gpio_val
= DIB8000_GPIO_DEFAULT_VALUES
,
1465 .gpio_pwm_pos
= DIB8000_GPIO_DEFAULT_PWM_POS
,
1467 .hostbus_diversity
= 1,
1469 .output_mode
= OUTMODE_DIVERSITY
,
1471 .diversity_delay
= 1,
1476 static struct dib0090_wbd_slope dib8090_wbd_table
[] = {
1477 /* max freq ; cold slope ; cold offset ; warm slope ; warm offset ; wbd gain */
1478 { 120, 0, 500, 0, 500, 4 }, /* CBAND */
1479 { 170, 0, 450, 0, 450, 4 }, /* CBAND */
1480 { 380, 48, 373, 28, 259, 6 }, /* VHF */
1481 { 860, 34, 700, 36, 616, 6 }, /* high UHF */
1482 { 0xFFFF, 34, 700, 36, 616, 6 }, /* default */
1485 static struct dib0090_config dib809x_dib0090_config
= {
1489 .io
.pll_loopdiv
= 20,
1490 .io
.adc_clock_ratio
= 8,
1491 .io
.pll_int_loop_filt
= 0,
1492 .io
.clock_khz
= 12000,
1493 .reset
= dib80xx_tuner_reset
,
1494 .sleep
= dib80xx_tuner_sleep
,
1497 .i2c_address
= DEFAULT_DIB0090_I2C_ADDRESS
,
1500 .get_adc_power
= dib8090_get_adc_power
,
1501 .freq_offset_khz_uhf
= -63,
1502 .freq_offset_khz_vhf
= -143,
1503 .wbd
= dib8090_wbd_table
,
1504 .fref_clock_ratio
= 6,
1507 static int dib8096_set_param_override(struct dvb_frontend
*fe
)
1509 struct dtv_frontend_properties
*p
= &fe
->dtv_property_cache
;
1510 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
1511 struct dib0700_adapter_state
*state
= adap
->priv
;
1512 u8 band
= BAND_OF_FREQUENCY(p
->frequency
/1000);
1515 enum frontend_tune_state tune_state
= CT_SHUTDOWN
;
1516 u16 ltgain
, rf_gain_limit
;
1518 ret
= state
->set_param_save(fe
);
1522 target
= (dib0090_get_wbd_target(fe
) * 8 * 18 / 33 + 1) / 2;
1523 dib8000_set_wbd_ref(fe
, target
);
1526 if (band
== BAND_CBAND
) {
1527 deb_info("tuning in CBAND - soft-AGC startup\n");
1528 dib0090_set_tune_state(fe
, CT_AGC_START
);
1530 ret
= dib0090_gain_control(fe
);
1532 tune_state
= dib0090_get_tune_state(fe
);
1533 if (tune_state
== CT_AGC_STEP_0
)
1534 dib8000_set_gpio(fe
, 6, 0, 1);
1535 else if (tune_state
== CT_AGC_STEP_1
) {
1536 dib0090_get_current_gain(fe
, NULL
, NULL
, &rf_gain_limit
, <gain
);
1537 if (rf_gain_limit
== 0)
1538 dib8000_set_gpio(fe
, 6, 0, 0);
1540 } while (tune_state
< CT_AGC_STOP
);
1541 dib0090_pwm_gain_reset(fe
);
1542 dib8000_pwm_agc_reset(fe
);
1543 dib8000_set_tune_state(fe
, CT_DEMOD_START
);
1545 deb_info("not tuning in CBAND - standard AGC startup\n");
1546 dib0090_pwm_gain_reset(fe
);
1552 static int dib809x_tuner_attach(struct dvb_usb_adapter
*adap
)
1554 struct dib0700_adapter_state
*st
= adap
->priv
;
1555 struct i2c_adapter
*tun_i2c
= dib8000_get_i2c_master(adap
->fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_TUNER
, 1);
1557 if (dvb_attach(dib0090_register
, adap
->fe_adap
[0].fe
, tun_i2c
, &dib809x_dib0090_config
) == NULL
)
1560 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
1561 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib8096_set_param_override
;
1565 static int stk809x_frontend_attach(struct dvb_usb_adapter
*adap
)
1567 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
1569 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
1570 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
1571 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
1573 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
1575 dib0700_ctrl_clock(adap
->dev
, 72, 1);
1578 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
1580 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
1582 dib8000_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 18, 0x80, 0);
1584 adap
->fe_adap
[0].fe
= dvb_attach(dib8000_attach
, &adap
->dev
->i2c_adap
, 0x80, &dib809x_dib8000_config
[0]);
1586 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
1589 static int nim8096md_tuner_attach(struct dvb_usb_adapter
*adap
)
1591 struct dib0700_adapter_state
*st
= adap
->priv
;
1592 struct i2c_adapter
*tun_i2c
;
1593 struct dvb_frontend
*fe_slave
= dib8000_get_slave_frontend(adap
->fe_adap
[0].fe
, 1);
1596 tun_i2c
= dib8000_get_i2c_master(fe_slave
, DIBX000_I2C_INTERFACE_TUNER
, 1);
1597 if (dvb_attach(dib0090_register
, fe_slave
, tun_i2c
, &dib809x_dib0090_config
) == NULL
)
1599 fe_slave
->dvb
= adap
->fe_adap
[0].fe
->dvb
;
1600 fe_slave
->ops
.tuner_ops
.set_params
= dib8096_set_param_override
;
1602 tun_i2c
= dib8000_get_i2c_master(adap
->fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_TUNER
, 1);
1603 if (dvb_attach(dib0090_register
, adap
->fe_adap
[0].fe
, tun_i2c
, &dib809x_dib0090_config
) == NULL
)
1606 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
1607 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib8096_set_param_override
;
1612 static int nim8096md_frontend_attach(struct dvb_usb_adapter
*adap
)
1614 struct dvb_frontend
*fe_slave
;
1616 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0);
1618 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
1620 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
1621 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
1622 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
1624 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
1626 dib0700_ctrl_clock(adap
->dev
, 72, 1);
1629 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
1631 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
1633 dib8000_i2c_enumeration(&adap
->dev
->i2c_adap
, 2, 18, 0x80, 0);
1635 adap
->fe_adap
[0].fe
= dvb_attach(dib8000_attach
, &adap
->dev
->i2c_adap
, 0x80, &dib809x_dib8000_config
[0]);
1636 if (adap
->fe_adap
[0].fe
== NULL
)
1639 fe_slave
= dvb_attach(dib8000_attach
, &adap
->dev
->i2c_adap
, 0x82, &dib809x_dib8000_config
[1]);
1640 dib8000_set_slave_frontend(adap
->fe_adap
[0].fe
, fe_slave
);
1642 return fe_slave
== NULL
? -ENODEV
: 0;
1646 static struct dibx000_agc_config dib8096p_agc_config
[2] = {
1648 .band_caps
= BAND_UHF
,
1649 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0,
1650 P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0,
1651 P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
1652 P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5,
1654 .setup
= (0 << 15) | (0 << 14) | (5 << 11)
1655 | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5)
1656 | (0 << 4) | (5 << 1) | (0 << 0),
1659 .time_stabiliz
= 10,
1690 .perform_agc_softsplit
= 0,
1692 .band_caps
= BAND_FM
| BAND_VHF
| BAND_CBAND
,
1693 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0,
1694 P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0,
1695 P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
1696 P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5,
1698 .setup
= (0 << 15) | (0 << 14) | (5 << 11)
1699 | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5)
1700 | (0 << 4) | (5 << 1) | (0 << 0),
1703 .time_stabiliz
= 10,
1734 .perform_agc_softsplit
= 0,
1738 static struct dibx000_bandwidth_config dib8096p_clock_config_12_mhz
= {
1742 (3 << 14) | (1 << 12) | (524 << 0),
1748 static struct dib8000_config tfe8096p_dib8000_config
= {
1749 .output_mpeg2_in_188_bytes
= 1,
1750 .hostbus_diversity
= 1,
1753 .agc_config_count
= 2,
1754 .agc
= dib8096p_agc_config
,
1755 .pll
= &dib8096p_clock_config_12_mhz
,
1757 .gpio_dir
= DIB8000_GPIO_DEFAULT_DIRECTIONS
,
1758 .gpio_val
= DIB8000_GPIO_DEFAULT_VALUES
,
1759 .gpio_pwm_pos
= DIB8000_GPIO_DEFAULT_PWM_POS
,
1761 .agc_control
= NULL
,
1762 .diversity_delay
= 48,
1763 .output_mode
= OUTMODE_MPEG2_FIFO
,
1767 static struct dib0090_wbd_slope dib8096p_wbd_table
[] = {
1768 { 380, 81, 850, 64, 540, 4},
1769 { 860, 51, 866, 21, 375, 4},
1770 {1700, 0, 250, 0, 100, 6},
1771 {2600, 0, 250, 0, 100, 6},
1772 { 0xFFFF, 0, 0, 0, 0, 0},
1775 static const struct dib0090_config tfe8096p_dib0090_config
= {
1776 .io
.clock_khz
= 12000,
1780 .io
.pll_loopdiv
= 6,
1781 .io
.adc_clock_ratio
= 0,
1782 .io
.pll_int_loop_filt
= 0,
1783 .reset
= dib8096p_tuner_sleep
,
1784 .sleep
= dib8096p_tuner_sleep
,
1786 .freq_offset_khz_uhf
= -143,
1787 .freq_offset_khz_vhf
= -143,
1789 .get_adc_power
= dib8090_get_adc_power
,
1794 .wbd_vhf_offset
= 0,
1795 .wbd_cband_offset
= 0,
1799 .fref_clock_ratio
= 1,
1801 .wbd
= dib8096p_wbd_table
,
1803 .ls_cfg_pad_drv
= 0,
1807 .force_cband_input
= 0,
1810 struct dibx090p_adc
{
1811 u32 freq
; /* RF freq MHz */
1812 u32 timf
; /* New Timf */
1813 u32 pll_loopdiv
; /* New prediv */
1814 u32 pll_prediv
; /* New loopdiv */
1817 struct dibx090p_adc dib8090p_adc_tab
[] = {
1818 { 50000, 17043521, 16, 3}, /* 64 MHz */
1819 {878000, 20199729, 9, 1}, /* 60 MHz */
1820 {0xffffffff, 0, 0, 0}, /* 60 MHz */
1823 static int dib8096p_agc_startup(struct dvb_frontend
*fe
)
1825 struct dtv_frontend_properties
*p
= &fe
->dtv_property_cache
;
1826 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
1827 struct dib0700_adapter_state
*state
= adap
->priv
;
1828 struct dibx000_bandwidth_config pll
;
1830 int better_sampling_freq
= 0, ret
;
1831 struct dibx090p_adc
*adc_table
= &dib8090p_adc_tab
[0];
1833 ret
= state
->set_param_save(fe
);
1836 memset(&pll
, 0, sizeof(struct dibx000_bandwidth_config
));
1838 dib0090_pwm_gain_reset(fe
);
1839 /* dib0090_get_wbd_target is returning any possible
1840 temperature compensated wbd-target */
1841 target
= (dib0090_get_wbd_target(fe
) * 8 + 1) / 2;
1842 dib8000_set_wbd_ref(fe
, target
);
1845 while (p
->frequency
/ 1000 > adc_table
->freq
) {
1846 better_sampling_freq
= 1;
1850 if ((adc_table
->freq
!= 0xffffffff) && better_sampling_freq
) {
1851 pll
.pll_ratio
= adc_table
->pll_loopdiv
;
1852 pll
.pll_prediv
= adc_table
->pll_prediv
;
1853 dib8000_update_pll(fe
, &pll
);
1854 dib8000_ctrl_timf(fe
, DEMOD_TIMF_SET
, adc_table
->timf
);
1859 static int tfe8096p_frontend_attach(struct dvb_usb_adapter
*adap
)
1861 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
1863 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
1864 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
1865 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
1867 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
1869 dib0700_ctrl_clock(adap
->dev
, 72, 1);
1872 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
1874 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
1876 dib8000_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 0x10, 0x80, 1);
1878 adap
->fe_adap
[0].fe
= dvb_attach(dib8000_attach
,
1879 &adap
->dev
->i2c_adap
, 0x80, &tfe8096p_dib8000_config
);
1881 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
1884 static int tfe8096p_tuner_attach(struct dvb_usb_adapter
*adap
)
1886 struct dib0700_adapter_state
*st
= adap
->priv
;
1887 struct i2c_adapter
*tun_i2c
= dib8096p_get_i2c_tuner(adap
->fe_adap
[0].fe
);
1889 if (dvb_attach(dib0090_register
, adap
->fe_adap
[0].fe
, tun_i2c
,
1890 &tfe8096p_dib0090_config
) == NULL
)
1893 dib8000_set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 1);
1895 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
1896 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib8096p_agc_startup
;
1901 static int dib90x0_pid_filter(struct dvb_usb_adapter
*adapter
, int index
, u16 pid
, int onoff
)
1903 return dib9000_fw_pid_filter(adapter
->fe_adap
[0].fe
, index
, pid
, onoff
);
1906 static int dib90x0_pid_filter_ctrl(struct dvb_usb_adapter
*adapter
, int onoff
)
1908 return dib9000_fw_pid_filter_ctrl(adapter
->fe_adap
[0].fe
, onoff
);
1911 static int dib90x0_tuner_reset(struct dvb_frontend
*fe
, int onoff
)
1913 return dib9000_set_gpio(fe
, 5, 0, !onoff
);
1916 static int dib90x0_tuner_sleep(struct dvb_frontend
*fe
, int onoff
)
1918 return dib9000_set_gpio(fe
, 0, 0, onoff
);
1921 static int dib01x0_pmu_update(struct i2c_adapter
*i2c
, u16
*data
, u8 len
)
1923 u8 wb
[4] = { 0xc >> 8, 0xc & 0xff, 0, 0 };
1925 struct i2c_msg msg
[2] = {
1926 {.addr
= 0x1e >> 1, .flags
= 0, .buf
= wb
, .len
= 2},
1927 {.addr
= 0x1e >> 1, .flags
= I2C_M_RD
, .buf
= rb
, .len
= 2},
1931 dibx000_i2c_set_speed(i2c
, 250);
1933 if (i2c_transfer(i2c
, msg
, 2) != 2)
1936 switch (rb
[0] << 8 | rb
[1]) {
1938 deb_info("Found DiB0170 rev1: This version of DiB0170 is not supported any longer.\n");
1941 deb_info("Found DiB0170 rev2");
1944 deb_info("Found DiB0190 rev2");
1947 deb_info("DiB01x0 not found");
1951 for (index_data
= 0; index_data
< len
; index_data
+= 2) {
1952 wb
[2] = (data
[index_data
+ 1] >> 8) & 0xff;
1953 wb
[3] = (data
[index_data
+ 1]) & 0xff;
1955 if (data
[index_data
] == 0) {
1956 wb
[0] = (data
[index_data
] >> 8) & 0xff;
1957 wb
[1] = (data
[index_data
]) & 0xff;
1959 if (i2c_transfer(i2c
, msg
, 2) != 2)
1962 wb
[3] |= rb
[1] & ~(3 << 4);
1965 wb
[0] = (data
[index_data
] >> 8)&0xff;
1966 wb
[1] = (data
[index_data
])&0xff;
1968 if (i2c_transfer(i2c
, &msg
[0], 1) != 1)
1974 static struct dib9000_config stk9090m_config
= {
1975 .output_mpeg2_in_188_bytes
= 1,
1976 .output_mode
= OUTMODE_MPEG2_FIFO
,
1977 .vcxo_timer
= 279620,
1978 .timing_frequency
= 20452225,
1979 .demod_clock_khz
= 60000,
1980 .xtal_clock_khz
= 30000,
1981 .if_drives
= (0 << 15) | (1 << 13) | (0 << 12) | (3 << 10) | (0 << 9) | (1 << 7) | (0 << 6) | (0 << 4) | (1 << 3) | (1 << 1) | (0),
1985 { 240, { BOARD_GPIO_COMPONENT_DEMOD
, BOARD_GPIO_FUNCTION_SUBBAND_GPIO
, 0x0008, 0x0000, 0x0008 } }, /* GPIO 3 to 1 for VHF */
1986 { 890, { BOARD_GPIO_COMPONENT_DEMOD
, BOARD_GPIO_FUNCTION_SUBBAND_GPIO
, 0x0008, 0x0000, 0x0000 } }, /* GPIO 3 to 0 for UHF */
1991 { .component
= BOARD_GPIO_COMPONENT_DEMOD
, .function
= BOARD_GPIO_FUNCTION_COMPONENT_ON
, .mask
= 0x10 | 0x21, .direction
= 0 & ~0x21, .value
= (0x10 & ~0x1) | 0x20 },
1992 { .component
= BOARD_GPIO_COMPONENT_DEMOD
, .function
= BOARD_GPIO_FUNCTION_COMPONENT_OFF
, .mask
= 0x10 | 0x21, .direction
= 0 & ~0x21, .value
= 0 | 0x21 },
1996 static struct dib9000_config nim9090md_config
[2] = {
1998 .output_mpeg2_in_188_bytes
= 1,
1999 .output_mode
= OUTMODE_MPEG2_FIFO
,
2000 .vcxo_timer
= 279620,
2001 .timing_frequency
= 20452225,
2002 .demod_clock_khz
= 60000,
2003 .xtal_clock_khz
= 30000,
2004 .if_drives
= (0 << 15) | (1 << 13) | (0 << 12) | (3 << 10) | (0 << 9) | (1 << 7) | (0 << 6) | (0 << 4) | (1 << 3) | (1 << 1) | (0),
2006 .output_mpeg2_in_188_bytes
= 1,
2007 .output_mode
= OUTMODE_DIVERSITY
,
2008 .vcxo_timer
= 279620,
2009 .timing_frequency
= 20452225,
2010 .demod_clock_khz
= 60000,
2011 .xtal_clock_khz
= 30000,
2012 .if_drives
= (0 << 15) | (1 << 13) | (0 << 12) | (3 << 10) | (0 << 9) | (1 << 7) | (0 << 6) | (0 << 4) | (1 << 3) | (1 << 1) | (0),
2016 { 240, { BOARD_GPIO_COMPONENT_DEMOD
, BOARD_GPIO_FUNCTION_SUBBAND_GPIO
, 0x0006, 0x0000, 0x0006 } }, /* GPIO 1 and 2 to 1 for VHF */
2017 { 890, { BOARD_GPIO_COMPONENT_DEMOD
, BOARD_GPIO_FUNCTION_SUBBAND_GPIO
, 0x0006, 0x0000, 0x0000 } }, /* GPIO 1 and 2 to 0 for UHF */
2022 { .component
= BOARD_GPIO_COMPONENT_DEMOD
, .function
= BOARD_GPIO_FUNCTION_COMPONENT_ON
, .mask
= 0x10 | 0x21, .direction
= 0 & ~0x21, .value
= (0x10 & ~0x1) | 0x20 },
2023 { .component
= BOARD_GPIO_COMPONENT_DEMOD
, .function
= BOARD_GPIO_FUNCTION_COMPONENT_OFF
, .mask
= 0x10 | 0x21, .direction
= 0 & ~0x21, .value
= 0 | 0x21 },
2028 static struct dib0090_config dib9090_dib0090_config
= {
2032 .io
.pll_loopdiv
= 8,
2033 .io
.adc_clock_ratio
= 8,
2034 .io
.pll_int_loop_filt
= 0,
2035 .io
.clock_khz
= 30000,
2036 .reset
= dib90x0_tuner_reset
,
2037 .sleep
= dib90x0_tuner_sleep
,
2042 .freq_offset_khz_uhf
= 0,
2043 .freq_offset_khz_vhf
= 0,
2046 static struct dib0090_config nim9090md_dib0090_config
[2] = {
2051 .io
.pll_loopdiv
= 8,
2052 .io
.adc_clock_ratio
= 8,
2053 .io
.pll_int_loop_filt
= 0,
2054 .io
.clock_khz
= 30000,
2055 .reset
= dib90x0_tuner_reset
,
2056 .sleep
= dib90x0_tuner_sleep
,
2061 .freq_offset_khz_uhf
= 0,
2062 .freq_offset_khz_vhf
= 0,
2067 .io
.pll_loopdiv
= 8,
2068 .io
.adc_clock_ratio
= 8,
2069 .io
.pll_int_loop_filt
= 0,
2070 .io
.clock_khz
= 30000,
2071 .reset
= dib90x0_tuner_reset
,
2072 .sleep
= dib90x0_tuner_sleep
,
2077 .freq_offset_khz_uhf
= 0,
2078 .freq_offset_khz_vhf
= 0,
2083 static int stk9090m_frontend_attach(struct dvb_usb_adapter
*adap
)
2085 struct dib0700_adapter_state
*state
= adap
->priv
;
2086 struct dib0700_state
*st
= adap
->dev
->priv
;
2089 /* Make use of the new i2c functions from FW 1.20 */
2090 dib0700_get_version(adap
->dev
, NULL
, NULL
, &fw_version
, NULL
);
2091 if (fw_version
>= 0x10200)
2092 st
->fw_use_new_i2c_api
= 1;
2093 dib0700_set_i2c_speed(adap
->dev
, 340);
2095 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
2097 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
2098 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
2099 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
2100 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
2102 dib0700_ctrl_clock(adap
->dev
, 72, 1);
2105 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
2107 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
2109 dib9000_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 0x10, 0x80);
2111 if (request_firmware(&state
->frontend_firmware
, "dib9090.fw", &adap
->dev
->udev
->dev
)) {
2112 deb_info("%s: Upload failed. (file not found?)\n", __func__
);
2115 deb_info("%s: firmware read %Zu bytes.\n", __func__
, state
->frontend_firmware
->size
);
2117 stk9090m_config
.microcode_B_fe_size
= state
->frontend_firmware
->size
;
2118 stk9090m_config
.microcode_B_fe_buffer
= state
->frontend_firmware
->data
;
2120 adap
->fe_adap
[0].fe
= dvb_attach(dib9000_attach
, &adap
->dev
->i2c_adap
, 0x80, &stk9090m_config
);
2122 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
2125 static int dib9090_tuner_attach(struct dvb_usb_adapter
*adap
)
2127 struct dib0700_adapter_state
*state
= adap
->priv
;
2128 struct i2c_adapter
*i2c
= dib9000_get_tuner_interface(adap
->fe_adap
[0].fe
);
2129 u16 data_dib190
[10] = {
2137 if (dvb_attach(dib0090_fw_register
, adap
->fe_adap
[0].fe
, i2c
, &dib9090_dib0090_config
) == NULL
)
2139 i2c
= dib9000_get_i2c_master(adap
->fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_GPIO_1_2
, 0);
2140 if (dib01x0_pmu_update(i2c
, data_dib190
, 10) != 0)
2142 dib0700_set_i2c_speed(adap
->dev
, 1500);
2143 if (dib9000_firmware_post_pll_init(adap
->fe_adap
[0].fe
) < 0)
2145 release_firmware(state
->frontend_firmware
);
2149 static int nim9090md_frontend_attach(struct dvb_usb_adapter
*adap
)
2151 struct dib0700_adapter_state
*state
= adap
->priv
;
2152 struct dib0700_state
*st
= adap
->dev
->priv
;
2153 struct i2c_adapter
*i2c
;
2154 struct dvb_frontend
*fe_slave
;
2157 /* Make use of the new i2c functions from FW 1.20 */
2158 dib0700_get_version(adap
->dev
, NULL
, NULL
, &fw_version
, NULL
);
2159 if (fw_version
>= 0x10200)
2160 st
->fw_use_new_i2c_api
= 1;
2161 dib0700_set_i2c_speed(adap
->dev
, 340);
2163 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
2165 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
2166 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
2167 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
2168 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
2170 dib0700_ctrl_clock(adap
->dev
, 72, 1);
2173 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
2175 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
2177 if (request_firmware(&state
->frontend_firmware
, "dib9090.fw", &adap
->dev
->udev
->dev
)) {
2178 deb_info("%s: Upload failed. (file not found?)\n", __func__
);
2181 deb_info("%s: firmware read %Zu bytes.\n", __func__
, state
->frontend_firmware
->size
);
2183 nim9090md_config
[0].microcode_B_fe_size
= state
->frontend_firmware
->size
;
2184 nim9090md_config
[0].microcode_B_fe_buffer
= state
->frontend_firmware
->data
;
2185 nim9090md_config
[1].microcode_B_fe_size
= state
->frontend_firmware
->size
;
2186 nim9090md_config
[1].microcode_B_fe_buffer
= state
->frontend_firmware
->data
;
2188 dib9000_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 0x20, 0x80);
2189 adap
->fe_adap
[0].fe
= dvb_attach(dib9000_attach
, &adap
->dev
->i2c_adap
, 0x80, &nim9090md_config
[0]);
2191 if (adap
->fe_adap
[0].fe
== NULL
)
2194 i2c
= dib9000_get_i2c_master(adap
->fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_GPIO_3_4
, 0);
2195 dib9000_i2c_enumeration(i2c
, 1, 0x12, 0x82);
2197 fe_slave
= dvb_attach(dib9000_attach
, i2c
, 0x82, &nim9090md_config
[1]);
2198 dib9000_set_slave_frontend(adap
->fe_adap
[0].fe
, fe_slave
);
2200 return fe_slave
== NULL
? -ENODEV
: 0;
2203 static int nim9090md_tuner_attach(struct dvb_usb_adapter
*adap
)
2205 struct dib0700_adapter_state
*state
= adap
->priv
;
2206 struct i2c_adapter
*i2c
;
2207 struct dvb_frontend
*fe_slave
;
2208 u16 data_dib190
[10] = {
2215 i2c
= dib9000_get_tuner_interface(adap
->fe_adap
[0].fe
);
2216 if (dvb_attach(dib0090_fw_register
, adap
->fe_adap
[0].fe
, i2c
, &nim9090md_dib0090_config
[0]) == NULL
)
2218 i2c
= dib9000_get_i2c_master(adap
->fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_GPIO_1_2
, 0);
2219 if (dib01x0_pmu_update(i2c
, data_dib190
, 10) < 0)
2222 dib0700_set_i2c_speed(adap
->dev
, 1500);
2223 if (dib9000_firmware_post_pll_init(adap
->fe_adap
[0].fe
) < 0)
2226 fe_slave
= dib9000_get_slave_frontend(adap
->fe_adap
[0].fe
, 1);
2227 if (fe_slave
!= NULL
) {
2228 i2c
= dib9000_get_component_bus_interface(adap
->fe_adap
[0].fe
);
2229 dib9000_set_i2c_adapter(fe_slave
, i2c
);
2231 i2c
= dib9000_get_tuner_interface(fe_slave
);
2232 if (dvb_attach(dib0090_fw_register
, fe_slave
, i2c
, &nim9090md_dib0090_config
[1]) == NULL
)
2234 fe_slave
->dvb
= adap
->fe_adap
[0].fe
->dvb
;
2235 dib9000_fw_set_component_bus_speed(adap
->fe_adap
[0].fe
, 1500);
2236 if (dib9000_firmware_post_pll_init(fe_slave
) < 0)
2239 release_firmware(state
->frontend_firmware
);
2245 struct dib7090p_best_adc
{
2251 static int dib7090p_get_best_sampling(struct dvb_frontend
*fe
, struct dib7090p_best_adc
*adc
)
2253 u8 spur
= 0, prediv
= 0, loopdiv
= 0, min_prediv
= 1, max_prediv
= 1;
2256 u32 fcp_min
= 1900; /* PLL Minimum Frequency comparator KHz */
2257 u32 fcp_max
= 20000; /* PLL Maximum Frequency comparator KHz */
2258 u32 fdem_max
= 76000;
2259 u32 fdem_min
= 69500;
2260 u32 fcp
= 0, fs
= 0, fdem
= 0;
2261 u32 harmonic_id
= 0;
2263 adc
->pll_loopdiv
= loopdiv
;
2264 adc
->pll_prediv
= prediv
;
2267 deb_info("bandwidth = %d fdem_min =%d", fe
->dtv_property_cache
.bandwidth_hz
, fdem_min
);
2269 /* Find Min and Max prediv */
2270 while ((xtal
/max_prediv
) >= fcp_min
)
2274 min_prediv
= max_prediv
;
2275 while ((xtal
/min_prediv
) <= fcp_max
) {
2277 if (min_prediv
== 1)
2280 deb_info("MIN prediv = %d : MAX prediv = %d", min_prediv
, max_prediv
);
2284 for (prediv
= min_prediv
; prediv
< max_prediv
; prediv
++) {
2285 fcp
= xtal
/ prediv
;
2286 if (fcp
> fcp_min
&& fcp
< fcp_max
) {
2287 for (loopdiv
= 1 ; loopdiv
< 64 ; loopdiv
++) {
2288 fdem
= ((xtal
/prediv
) * loopdiv
);
2290 /* test min/max system restrictions */
2292 if ((fdem
>= fdem_min
) && (fdem
<= fdem_max
) && (fs
>= fe
->dtv_property_cache
.bandwidth_hz
/1000)) {
2294 /* test fs harmonics positions */
2295 for (harmonic_id
= (fe
->dtv_property_cache
.frequency
/ (1000*fs
)) ; harmonic_id
<= ((fe
->dtv_property_cache
.frequency
/ (1000*fs
))+1) ; harmonic_id
++) {
2296 if (((fs
*harmonic_id
) >= ((fe
->dtv_property_cache
.frequency
/1000) - (fe
->dtv_property_cache
.bandwidth_hz
/2000))) && ((fs
*harmonic_id
) <= ((fe
->dtv_property_cache
.frequency
/1000) + (fe
->dtv_property_cache
.bandwidth_hz
/2000)))) {
2303 adc
->pll_loopdiv
= loopdiv
;
2304 adc
->pll_prediv
= prediv
;
2305 adc
->timf
= 2396745143UL/fdem
*(1 << 9);
2306 adc
->timf
+= ((2396745143UL%fdem
) << 9)/fdem
;
2307 deb_info("loopdiv=%i prediv=%i timf=%i", loopdiv
, prediv
, adc
->timf
);
2318 if (adc
->pll_loopdiv
== 0 && adc
->pll_prediv
== 0)
2324 static int dib7090_agc_startup(struct dvb_frontend
*fe
)
2326 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
2327 struct dib0700_adapter_state
*state
= adap
->priv
;
2328 struct dibx000_bandwidth_config pll
;
2330 struct dib7090p_best_adc adc
;
2333 ret
= state
->set_param_save(fe
);
2337 memset(&pll
, 0, sizeof(struct dibx000_bandwidth_config
));
2338 dib0090_pwm_gain_reset(fe
);
2339 target
= (dib0090_get_wbd_target(fe
) * 8 + 1) / 2;
2340 dib7000p_set_wbd_ref(fe
, target
);
2342 if (dib7090p_get_best_sampling(fe
, &adc
) == 0) {
2343 pll
.pll_ratio
= adc
.pll_loopdiv
;
2344 pll
.pll_prediv
= adc
.pll_prediv
;
2346 dib7000p_update_pll(fe
, &pll
);
2347 dib7000p_ctrl_timf(fe
, DEMOD_TIMF_SET
, adc
.timf
);
2352 static int dib7090_agc_restart(struct dvb_frontend
*fe
, u8 restart
)
2354 deb_info("AGC restart callback: %d", restart
);
2355 if (restart
== 0) /* before AGC startup */
2356 dib0090_set_dc_servo(fe
, 1);
2360 static int dib7090e_update_lna(struct dvb_frontend
*fe
, u16 agc_global
)
2362 u16 agc1
= 0, agc2
, wbd
= 0, wbd_target
, wbd_offset
, threshold_agc1
;
2365 if ((fe
->dtv_property_cache
.frequency
) < 400000000)
2366 threshold_agc1
= 25000;
2368 threshold_agc1
= 30000;
2370 wbd_target
= (dib0090_get_wbd_target(fe
)*8+1)/2;
2371 wbd_offset
= dib0090_get_wbd_offset(fe
);
2372 dib7000p_get_agc_values(fe
, NULL
, &agc1
, &agc2
, &wbd
);
2373 wbd_delta
= (s16
)wbd
- (((s16
)wbd_offset
+10)*4) ;
2375 deb_info("update lna, agc_global=%d agc1=%d agc2=%d",
2376 agc_global
, agc1
, agc2
);
2377 deb_info("update lna, wbd=%d wbd target=%d wbd offset=%d wbd delta=%d",
2378 wbd
, wbd_target
, wbd_offset
, wbd_delta
);
2380 if ((agc1
< threshold_agc1
) && (wbd_delta
> 0)) {
2381 dib0090_set_switch(fe
, 1, 1, 1);
2382 dib0090_set_vga(fe
, 0);
2383 dib0090_update_rframp_7090(fe
, 0);
2384 dib0090_update_tuning_table_7090(fe
, 0);
2386 dib0090_set_vga(fe
, 1);
2387 dib0090_update_rframp_7090(fe
, 1);
2388 dib0090_update_tuning_table_7090(fe
, 1);
2389 dib0090_set_switch(fe
, 0, 0, 0);
2395 static struct dib0090_wbd_slope dib7090_wbd_table
[] = {
2396 { 380, 81, 850, 64, 540, 4},
2397 { 860, 51, 866, 21, 375, 4},
2398 {1700, 0, 250, 0, 100, 6},
2399 {2600, 0, 250, 0, 100, 6},
2400 { 0xFFFF, 0, 0, 0, 0, 0},
2403 static struct dib0090_wbd_slope dib7090e_wbd_table
[] = {
2404 { 380, 81, 850, 64, 540, 4},
2405 { 700, 51, 866, 21, 320, 4},
2406 { 860, 48, 666, 18, 330, 6},
2407 {1700, 0, 250, 0, 100, 6},
2408 {2600, 0, 250, 0, 100, 6},
2409 { 0xFFFF, 0, 0, 0, 0, 0},
2412 static struct dibx000_agc_config dib7090_agc_config
[2] = {
2414 .band_caps
= BAND_UHF
,
2415 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0,
2416 * 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 */
2417 .setup
= (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
2420 .time_stabiliz
= 10,
2451 .perform_agc_softsplit
= 0,
2453 .band_caps
= BAND_FM
| BAND_VHF
| BAND_CBAND
,
2454 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0,
2455 * 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 */
2456 .setup
= (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
2459 .time_stabiliz
= 10,
2490 .perform_agc_softsplit
= 0,
2494 static struct dibx000_bandwidth_config dib7090_clock_config_12_mhz
= {
2498 (3 << 14) | (1 << 12) | (524 << 0),
2504 static struct dib7000p_config nim7090_dib7000p_config
= {
2505 .output_mpeg2_in_188_bytes
= 1,
2506 .hostbus_diversity
= 1,
2507 .tuner_is_baseband
= 1,
2510 .agc_config_count
= 2,
2511 .agc
= dib7090_agc_config
,
2513 .bw
= &dib7090_clock_config_12_mhz
,
2515 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
2516 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
2517 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
2521 .agc_control
= dib7090_agc_restart
,
2524 .disable_sample_and_hold
= 0,
2525 .enable_current_mirror
= 0,
2526 .diversity_delay
= 0,
2528 .output_mode
= OUTMODE_MPEG2_FIFO
,
2532 static struct dib7000p_config tfe7090pvr_dib7000p_config
[2] = {
2534 .output_mpeg2_in_188_bytes
= 1,
2535 .hostbus_diversity
= 1,
2536 .tuner_is_baseband
= 1,
2539 .agc_config_count
= 2,
2540 .agc
= dib7090_agc_config
,
2542 .bw
= &dib7090_clock_config_12_mhz
,
2544 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
2545 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
2546 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
2550 .agc_control
= dib7090_agc_restart
,
2553 .disable_sample_and_hold
= 0,
2554 .enable_current_mirror
= 0,
2555 .diversity_delay
= 0,
2557 .output_mode
= OUTMODE_MPEG2_PAR_GATED_CLK
,
2558 .default_i2c_addr
= 0x90,
2561 .output_mpeg2_in_188_bytes
= 1,
2562 .hostbus_diversity
= 1,
2563 .tuner_is_baseband
= 1,
2566 .agc_config_count
= 2,
2567 .agc
= dib7090_agc_config
,
2569 .bw
= &dib7090_clock_config_12_mhz
,
2571 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
2572 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
2573 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
2577 .agc_control
= dib7090_agc_restart
,
2580 .disable_sample_and_hold
= 0,
2581 .enable_current_mirror
= 0,
2582 .diversity_delay
= 0,
2584 .output_mode
= OUTMODE_MPEG2_PAR_GATED_CLK
,
2585 .default_i2c_addr
= 0x92,
2590 static struct dib7000p_config tfe7090e_dib7000p_config
= {
2591 .output_mpeg2_in_188_bytes
= 1,
2592 .hostbus_diversity
= 1,
2593 .tuner_is_baseband
= 1,
2594 .update_lna
= dib7090e_update_lna
,
2596 .agc_config_count
= 2,
2597 .agc
= dib7090_agc_config
,
2599 .bw
= &dib7090_clock_config_12_mhz
,
2601 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
2602 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
2603 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
2607 .agc_control
= dib7090_agc_restart
,
2610 .disable_sample_and_hold
= 0,
2611 .enable_current_mirror
= 0,
2612 .diversity_delay
= 0,
2614 .output_mode
= OUTMODE_MPEG2_FIFO
,
2618 static const struct dib0090_config nim7090_dib0090_config
= {
2619 .io
.clock_khz
= 12000,
2623 .io
.pll_loopdiv
= 6,
2624 .io
.adc_clock_ratio
= 0,
2625 .io
.pll_int_loop_filt
= 0,
2626 .reset
= dib7090_tuner_sleep
,
2627 .sleep
= dib7090_tuner_sleep
,
2629 .freq_offset_khz_uhf
= 0,
2630 .freq_offset_khz_vhf
= 0,
2632 .get_adc_power
= dib7090_get_adc_power
,
2637 .wbd_vhf_offset
= 0,
2638 .wbd_cband_offset
= 0,
2642 .fref_clock_ratio
= 0,
2644 .wbd
= dib7090_wbd_table
,
2646 .ls_cfg_pad_drv
= 0,
2652 static const struct dib0090_config tfe7090e_dib0090_config
= {
2653 .io
.clock_khz
= 12000,
2657 .io
.pll_loopdiv
= 6,
2658 .io
.adc_clock_ratio
= 0,
2659 .io
.pll_int_loop_filt
= 0,
2660 .reset
= dib7090_tuner_sleep
,
2661 .sleep
= dib7090_tuner_sleep
,
2663 .freq_offset_khz_uhf
= 0,
2664 .freq_offset_khz_vhf
= 0,
2666 .get_adc_power
= dib7090_get_adc_power
,
2671 .wbd_vhf_offset
= 0,
2672 .wbd_cband_offset
= 0,
2676 .fref_clock_ratio
= 0,
2678 .wbd
= dib7090e_wbd_table
,
2680 .ls_cfg_pad_drv
= 0,
2684 .force_cband_input
= 1,
2688 static struct dib7000p_config tfe7790e_dib7000p_config
= {
2689 .output_mpeg2_in_188_bytes
= 1,
2690 .hostbus_diversity
= 1,
2691 .tuner_is_baseband
= 1,
2692 .update_lna
= dib7090e_update_lna
,
2694 .agc_config_count
= 2,
2695 .agc
= dib7090_agc_config
,
2697 .bw
= &dib7090_clock_config_12_mhz
,
2699 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
2700 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
2701 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
2705 .agc_control
= dib7090_agc_restart
,
2708 .disable_sample_and_hold
= 0,
2709 .enable_current_mirror
= 0,
2710 .diversity_delay
= 0,
2712 .output_mode
= OUTMODE_MPEG2_PAR_GATED_CLK
,
2716 static const struct dib0090_config tfe7790e_dib0090_config
= {
2717 .io
.clock_khz
= 12000,
2721 .io
.pll_loopdiv
= 6,
2722 .io
.adc_clock_ratio
= 0,
2723 .io
.pll_int_loop_filt
= 0,
2724 .reset
= dib7090_tuner_sleep
,
2725 .sleep
= dib7090_tuner_sleep
,
2727 .freq_offset_khz_uhf
= 0,
2728 .freq_offset_khz_vhf
= 0,
2730 .get_adc_power
= dib7090_get_adc_power
,
2735 .wbd_vhf_offset
= 0,
2736 .wbd_cband_offset
= 0,
2740 .fref_clock_ratio
= 0,
2742 .wbd
= dib7090e_wbd_table
,
2744 .ls_cfg_pad_drv
= 0,
2748 .force_cband_input
= 1,
2750 .force_crystal_mode
= 1,
2753 static const struct dib0090_config tfe7090pvr_dib0090_config
[2] = {
2755 .io
.clock_khz
= 12000,
2759 .io
.pll_loopdiv
= 6,
2760 .io
.adc_clock_ratio
= 0,
2761 .io
.pll_int_loop_filt
= 0,
2762 .reset
= dib7090_tuner_sleep
,
2763 .sleep
= dib7090_tuner_sleep
,
2765 .freq_offset_khz_uhf
= 50,
2766 .freq_offset_khz_vhf
= 70,
2768 .get_adc_power
= dib7090_get_adc_power
,
2773 .wbd_vhf_offset
= 0,
2774 .wbd_cband_offset
= 0,
2778 .fref_clock_ratio
= 0,
2780 .wbd
= dib7090_wbd_table
,
2782 .ls_cfg_pad_drv
= 0,
2787 .io
.clock_khz
= 12000,
2791 .io
.pll_loopdiv
= 6,
2792 .io
.adc_clock_ratio
= 0,
2793 .io
.pll_int_loop_filt
= 0,
2794 .reset
= dib7090_tuner_sleep
,
2795 .sleep
= dib7090_tuner_sleep
,
2797 .freq_offset_khz_uhf
= -50,
2798 .freq_offset_khz_vhf
= -70,
2800 .get_adc_power
= dib7090_get_adc_power
,
2805 .wbd_vhf_offset
= 0,
2806 .wbd_cband_offset
= 0,
2810 .fref_clock_ratio
= 0,
2812 .wbd
= dib7090_wbd_table
,
2814 .ls_cfg_pad_drv
= 0,
2821 static int nim7090_frontend_attach(struct dvb_usb_adapter
*adap
)
2823 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
2825 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
2826 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
2827 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
2828 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
2831 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
2833 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
2835 if (dib7000p_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 0x10, &nim7090_dib7000p_config
) != 0) {
2836 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", __func__
);
2839 adap
->fe_adap
[0].fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
, 0x80, &nim7090_dib7000p_config
);
2841 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
2844 static int nim7090_tuner_attach(struct dvb_usb_adapter
*adap
)
2846 struct dib0700_adapter_state
*st
= adap
->priv
;
2847 struct i2c_adapter
*tun_i2c
= dib7090_get_i2c_tuner(adap
->fe_adap
[0].fe
);
2849 if (dvb_attach(dib0090_register
, adap
->fe_adap
[0].fe
, tun_i2c
, &nim7090_dib0090_config
) == NULL
)
2852 dib7000p_set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 1);
2854 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
2855 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib7090_agc_startup
;
2859 static int tfe7090pvr_frontend0_attach(struct dvb_usb_adapter
*adap
)
2861 struct dib0700_state
*st
= adap
->dev
->priv
;
2863 /* The TFE7090 requires the dib0700 to not be in master mode */
2864 st
->disable_streaming_master_mode
= 1;
2866 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
2868 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
2869 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
2870 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
2871 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
2874 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
2876 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
2878 /* initialize IC 0 */
2879 if (dib7000p_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 0x20, &tfe7090pvr_dib7000p_config
[0]) != 0) {
2880 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", __func__
);
2884 dib0700_set_i2c_speed(adap
->dev
, 340);
2885 adap
->fe_adap
[0].fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
, 0x90, &tfe7090pvr_dib7000p_config
[0]);
2886 if (adap
->fe_adap
[0].fe
== NULL
)
2889 dib7090_slave_reset(adap
->fe_adap
[0].fe
);
2894 static int tfe7090pvr_frontend1_attach(struct dvb_usb_adapter
*adap
)
2896 struct i2c_adapter
*i2c
;
2898 if (adap
->dev
->adapter
[0].fe_adap
[0].fe
== NULL
) {
2899 err("the master dib7090 has to be initialized first");
2900 return -ENODEV
; /* the master device has not been initialized */
2903 i2c
= dib7000p_get_i2c_master(adap
->dev
->adapter
[0].fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_GPIO_6_7
, 1);
2904 if (dib7000p_i2c_enumeration(i2c
, 1, 0x10, &tfe7090pvr_dib7000p_config
[1]) != 0) {
2905 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", __func__
);
2909 adap
->fe_adap
[0].fe
= dvb_attach(dib7000p_attach
, i2c
, 0x92, &tfe7090pvr_dib7000p_config
[1]);
2910 dib0700_set_i2c_speed(adap
->dev
, 200);
2912 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
2915 static int tfe7090pvr_tuner0_attach(struct dvb_usb_adapter
*adap
)
2917 struct dib0700_adapter_state
*st
= adap
->priv
;
2918 struct i2c_adapter
*tun_i2c
= dib7090_get_i2c_tuner(adap
->fe_adap
[0].fe
);
2920 if (dvb_attach(dib0090_register
, adap
->fe_adap
[0].fe
, tun_i2c
, &tfe7090pvr_dib0090_config
[0]) == NULL
)
2923 dib7000p_set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 1);
2925 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
2926 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib7090_agc_startup
;
2930 static int tfe7090pvr_tuner1_attach(struct dvb_usb_adapter
*adap
)
2932 struct dib0700_adapter_state
*st
= adap
->priv
;
2933 struct i2c_adapter
*tun_i2c
= dib7090_get_i2c_tuner(adap
->fe_adap
[0].fe
);
2935 if (dvb_attach(dib0090_register
, adap
->fe_adap
[0].fe
, tun_i2c
, &tfe7090pvr_dib0090_config
[1]) == NULL
)
2938 dib7000p_set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 1);
2940 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
2941 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib7090_agc_startup
;
2945 static int tfe7090e_frontend_attach(struct dvb_usb_adapter
*adap
)
2947 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
2949 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
2950 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
2951 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
2952 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
2955 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
2957 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
2959 if (dib7000p_i2c_enumeration(&adap
->dev
->i2c_adap
,
2960 1, 0x10, &tfe7090e_dib7000p_config
) != 0) {
2961 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n",
2965 adap
->fe_adap
[0].fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
,
2966 0x80, &tfe7090e_dib7000p_config
);
2968 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
2971 static int tfe7790e_frontend_attach(struct dvb_usb_adapter
*adap
)
2973 struct dib0700_state
*st
= adap
->dev
->priv
;
2975 /* The TFE7790E requires the dib0700 to not be in master mode */
2976 st
->disable_streaming_master_mode
= 1;
2978 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
2980 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
2981 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
2982 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
2983 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
2985 dib0700_ctrl_clock(adap
->dev
, 72, 1);
2986 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
2988 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
2990 if (dib7000p_i2c_enumeration(&adap
->dev
->i2c_adap
,
2991 1, 0x10, &tfe7790e_dib7000p_config
) != 0) {
2992 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n",
2996 adap
->fe_adap
[0].fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
,
2997 0x80, &tfe7790e_dib7000p_config
);
2999 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
3002 static int tfe7790e_tuner_attach(struct dvb_usb_adapter
*adap
)
3004 struct dib0700_adapter_state
*st
= adap
->priv
;
3005 struct i2c_adapter
*tun_i2c
=
3006 dib7090_get_i2c_tuner(adap
->fe_adap
[0].fe
);
3008 if (dvb_attach(dib0090_register
, adap
->fe_adap
[0].fe
, tun_i2c
,
3009 &tfe7790e_dib0090_config
) == NULL
)
3012 dib7000p_set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 1);
3014 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
3015 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib7090_agc_startup
;
3019 static int tfe7090e_tuner_attach(struct dvb_usb_adapter
*adap
)
3021 struct dib0700_adapter_state
*st
= adap
->priv
;
3022 struct i2c_adapter
*tun_i2c
=
3023 dib7090_get_i2c_tuner(adap
->fe_adap
[0].fe
);
3025 if (dvb_attach(dib0090_register
, adap
->fe_adap
[0].fe
, tun_i2c
,
3026 &tfe7090e_dib0090_config
) == NULL
)
3029 dib7000p_set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 1);
3031 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
3032 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib7090_agc_startup
;
3037 static struct dib7000p_config stk7070pd_dib7000p_config
[2] = {
3039 .output_mpeg2_in_188_bytes
= 1,
3041 .agc_config_count
= 1,
3042 .agc
= &dib7070_agc_config
,
3043 .bw
= &dib7070_bw_config_12_mhz
,
3044 .tuner_is_baseband
= 1,
3047 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
3048 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
3049 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
3051 .hostbus_diversity
= 1,
3053 .output_mpeg2_in_188_bytes
= 1,
3055 .agc_config_count
= 1,
3056 .agc
= &dib7070_agc_config
,
3057 .bw
= &dib7070_bw_config_12_mhz
,
3058 .tuner_is_baseband
= 1,
3061 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
3062 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
3063 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
3065 .hostbus_diversity
= 1,
3069 static void stk7070pd_init(struct dvb_usb_device
*dev
)
3071 dib0700_set_gpio(dev
, GPIO6
, GPIO_OUT
, 1);
3073 dib0700_set_gpio(dev
, GPIO9
, GPIO_OUT
, 1);
3074 dib0700_set_gpio(dev
, GPIO4
, GPIO_OUT
, 1);
3075 dib0700_set_gpio(dev
, GPIO7
, GPIO_OUT
, 1);
3076 dib0700_set_gpio(dev
, GPIO10
, GPIO_OUT
, 0);
3078 dib0700_ctrl_clock(dev
, 72, 1);
3081 dib0700_set_gpio(dev
, GPIO10
, GPIO_OUT
, 1);
3084 static int stk7070pd_frontend_attach0(struct dvb_usb_adapter
*adap
)
3086 stk7070pd_init(adap
->dev
);
3089 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
3091 if (dib7000p_i2c_enumeration(&adap
->dev
->i2c_adap
, 2, 18,
3092 stk7070pd_dib7000p_config
) != 0) {
3093 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n",
3098 adap
->fe_adap
[0].fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
, 0x80, &stk7070pd_dib7000p_config
[0]);
3099 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
3102 static int stk7070pd_frontend_attach1(struct dvb_usb_adapter
*adap
)
3104 adap
->fe_adap
[0].fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
, 0x82, &stk7070pd_dib7000p_config
[1]);
3105 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
3108 static int novatd_read_status_override(struct dvb_frontend
*fe
,
3111 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
3112 struct dvb_usb_device
*dev
= adap
->dev
;
3113 struct dib0700_state
*state
= dev
->priv
;
3116 ret
= state
->read_status(fe
, stat
);
3119 dib0700_set_gpio(dev
, adap
->id
== 0 ? GPIO1
: GPIO0
, GPIO_OUT
,
3120 !!(*stat
& FE_HAS_LOCK
));
3125 static int novatd_sleep_override(struct dvb_frontend
* fe
)
3127 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
3128 struct dvb_usb_device
*dev
= adap
->dev
;
3129 struct dib0700_state
*state
= dev
->priv
;
3132 dib0700_set_gpio(dev
, adap
->id
== 0 ? GPIO1
: GPIO0
, GPIO_OUT
, 0);
3134 return state
->sleep(fe
);
3138 * novatd_frontend_attach - Nova-TD specific attach
3140 * Nova-TD has GPIO0, 1 and 2 for LEDs. So do not fiddle with them except for
3141 * information purposes.
3143 static int novatd_frontend_attach(struct dvb_usb_adapter
*adap
)
3145 struct dvb_usb_device
*dev
= adap
->dev
;
3146 struct dib0700_state
*st
= dev
->priv
;
3148 if (adap
->id
== 0) {
3149 stk7070pd_init(dev
);
3151 /* turn the power LED on, the other two off (just in case) */
3152 dib0700_set_gpio(dev
, GPIO0
, GPIO_OUT
, 0);
3153 dib0700_set_gpio(dev
, GPIO1
, GPIO_OUT
, 0);
3154 dib0700_set_gpio(dev
, GPIO2
, GPIO_OUT
, 1);
3156 if (dib7000p_i2c_enumeration(&dev
->i2c_adap
, 2, 18,
3157 stk7070pd_dib7000p_config
) != 0) {
3158 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n",
3164 adap
->fe_adap
[0].fe
= dvb_attach(dib7000p_attach
, &dev
->i2c_adap
,
3165 adap
->id
== 0 ? 0x80 : 0x82,
3166 &stk7070pd_dib7000p_config
[adap
->id
]);
3168 if (adap
->fe_adap
[0].fe
== NULL
)
3171 st
->read_status
= adap
->fe_adap
[0].fe
->ops
.read_status
;
3172 adap
->fe_adap
[0].fe
->ops
.read_status
= novatd_read_status_override
;
3173 st
->sleep
= adap
->fe_adap
[0].fe
->ops
.sleep
;
3174 adap
->fe_adap
[0].fe
->ops
.sleep
= novatd_sleep_override
;
3180 static struct s5h1411_config pinnacle_801e_config
= {
3181 .output_mode
= S5H1411_PARALLEL_OUTPUT
,
3182 .gpio
= S5H1411_GPIO_OFF
,
3183 .mpeg_timing
= S5H1411_MPEGTIMING_NONCONTINOUS_NONINVERTING_CLOCK
,
3184 .qam_if
= S5H1411_IF_44000
,
3185 .vsb_if
= S5H1411_IF_44000
,
3186 .inversion
= S5H1411_INVERSION_OFF
,
3187 .status_mode
= S5H1411_DEMODLOCKING
3190 /* Pinnacle PCTV HD Pro 801e GPIOs map:
3191 GPIO0 - currently unknown
3192 GPIO1 - xc5000 tuner reset
3193 GPIO2 - CX25843 sleep
3194 GPIO3 - currently unknown
3195 GPIO4 - currently unknown
3196 GPIO6 - currently unknown
3197 GPIO7 - currently unknown
3198 GPIO9 - currently unknown
3199 GPIO10 - CX25843 reset
3201 static int s5h1411_frontend_attach(struct dvb_usb_adapter
*adap
)
3203 struct dib0700_state
*st
= adap
->dev
->priv
;
3205 /* Make use of the new i2c functions from FW 1.20 */
3206 st
->fw_use_new_i2c_api
= 1;
3208 /* The s5h1411 requires the dib0700 to not be in master mode */
3209 st
->disable_streaming_master_mode
= 1;
3211 /* All msleep values taken from Windows USB trace */
3212 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 0);
3213 dib0700_set_gpio(adap
->dev
, GPIO3
, GPIO_OUT
, 0);
3214 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
3216 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
3218 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
3220 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
3221 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
3222 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
3223 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
3224 dib0700_set_gpio(adap
->dev
, GPIO2
, GPIO_OUT
, 0);
3227 /* Put the CX25843 to sleep for now since we're in digital mode */
3228 dib0700_set_gpio(adap
->dev
, GPIO2
, GPIO_OUT
, 1);
3230 /* GPIOs are initialized, do the attach */
3231 adap
->fe_adap
[0].fe
= dvb_attach(s5h1411_attach
, &pinnacle_801e_config
,
3232 &adap
->dev
->i2c_adap
);
3233 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
3236 static int dib0700_xc5000_tuner_callback(void *priv
, int component
,
3237 int command
, int arg
)
3239 struct dvb_usb_adapter
*adap
= priv
;
3241 if (command
== XC5000_TUNER_RESET
) {
3242 /* Reset the tuner */
3243 dib0700_set_gpio(adap
->dev
, GPIO1
, GPIO_OUT
, 0);
3245 dib0700_set_gpio(adap
->dev
, GPIO1
, GPIO_OUT
, 1);
3248 err("xc5000: unknown tuner callback command: %d\n", command
);
3255 static struct xc5000_config s5h1411_xc5000_tunerconfig
= {
3256 .i2c_address
= 0x64,
3260 static int xc5000_tuner_attach(struct dvb_usb_adapter
*adap
)
3262 /* FIXME: generalize & move to common area */
3263 adap
->fe_adap
[0].fe
->callback
= dib0700_xc5000_tuner_callback
;
3265 return dvb_attach(xc5000_attach
, adap
->fe_adap
[0].fe
, &adap
->dev
->i2c_adap
,
3266 &s5h1411_xc5000_tunerconfig
)
3267 == NULL
? -ENODEV
: 0;
3270 static int dib0700_xc4000_tuner_callback(void *priv
, int component
,
3271 int command
, int arg
)
3273 struct dvb_usb_adapter
*adap
= priv
;
3275 if (command
== XC4000_TUNER_RESET
) {
3276 /* Reset the tuner */
3277 dib7000p_set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 0);
3279 dib7000p_set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 1);
3281 err("xc4000: unknown tuner callback command: %d\n", command
);
3288 static struct dibx000_agc_config stk7700p_7000p_xc4000_agc_config
= {
3289 .band_caps
= BAND_UHF
| BAND_VHF
,
3292 .time_stabiliz
= 0x15,
3293 .alpha_level
= 0x00,
3306 .agc1_slope1
= 0x00,
3307 .agc1_slope2
= 0x00,
3310 .agc2_slope1
= 0x1d,
3311 .agc2_slope2
= 0x1d,
3316 .perform_agc_softsplit
= 0x00,
3319 static struct dibx000_bandwidth_config stk7700p_xc4000_pll_config
= {
3320 60000, 30000, /* internal, sampling */
3321 1, 8, 3, 1, 0, /* pll_cfg: prediv, ratio, range, reset, bypass */
3322 0, 0, 1, 1, 0, /* misc: refdiv, bypclk_div, IO_CLK_en_core, */
3323 /* ADClkSrc, modulo */
3324 (3 << 14) | (1 << 12) | 524, /* sad_cfg: refsel, sel, freq_15k */
3325 39370534, /* ifreq */
3326 20452225, /* timf */
3330 /* FIXME: none of these inputs are validated yet */
3331 static struct dib7000p_config pctv_340e_config
= {
3332 .output_mpeg2_in_188_bytes
= 1,
3334 .agc_config_count
= 1,
3335 .agc
= &stk7700p_7000p_xc4000_agc_config
,
3336 .bw
= &stk7700p_xc4000_pll_config
,
3338 .gpio_dir
= DIB7000M_GPIO_DEFAULT_DIRECTIONS
,
3339 .gpio_val
= DIB7000M_GPIO_DEFAULT_VALUES
,
3340 .gpio_pwm_pos
= DIB7000M_GPIO_DEFAULT_PWM_POS
,
3343 /* PCTV 340e GPIOs map:
3345 GPIO2 - CX25843 sleep
3346 GPIO3 - CS5340 reset
3348 GPIO6 - Power Supply
3349 GPIO8 - LNA (1=off 0=on)
3350 GPIO10 - CX25843 reset
3352 GPIO8 - xc4000 reset
3354 static int pctv340e_frontend_attach(struct dvb_usb_adapter
*adap
)
3356 struct dib0700_state
*st
= adap
->dev
->priv
;
3358 /* Power Supply on */
3359 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0);
3361 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
3362 msleep(100); /* Allow power supply to settle before probing */
3365 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
3366 msleep(1); /* cx25843 datasheet say 350us required */
3367 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
3369 /* LNA off for now */
3370 dib0700_set_gpio(adap
->dev
, GPIO8
, GPIO_OUT
, 1);
3372 /* Put the CX25843 to sleep for now since we're in digital mode */
3373 dib0700_set_gpio(adap
->dev
, GPIO2
, GPIO_OUT
, 1);
3375 /* FIXME: not verified yet */
3376 dib0700_ctrl_clock(adap
->dev
, 72, 1);
3380 if (dib7000pc_detection(&adap
->dev
->i2c_adap
) == 0) {
3381 /* Demodulator not found for some reason? */
3385 adap
->fe_adap
[0].fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
, 0x12,
3387 st
->is_dib7000pc
= 1;
3389 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
3392 static struct xc4000_config dib7000p_xc4000_tunerconfig
= {
3393 .i2c_address
= 0x61,
3396 .set_smoothedcvbs
= 0,
3400 static int xc4000_tuner_attach(struct dvb_usb_adapter
*adap
)
3402 struct i2c_adapter
*tun_i2c
;
3404 /* The xc4000 is not on the main i2c bus */
3405 tun_i2c
= dib7000p_get_i2c_master(adap
->fe_adap
[0].fe
,
3406 DIBX000_I2C_INTERFACE_TUNER
, 1);
3407 if (tun_i2c
== NULL
) {
3408 printk(KERN_ERR
"Could not reach tuner i2c bus\n");
3412 /* Setup the reset callback */
3413 adap
->fe_adap
[0].fe
->callback
= dib0700_xc4000_tuner_callback
;
3415 return dvb_attach(xc4000_attach
, adap
->fe_adap
[0].fe
, tun_i2c
,
3416 &dib7000p_xc4000_tunerconfig
)
3417 == NULL
? -ENODEV
: 0;
3420 static struct lgdt3305_config hcw_lgdt3305_config
= {
3422 .mpeg_mode
= LGDT3305_MPEG_PARALLEL
,
3423 .tpclk_edge
= LGDT3305_TPCLK_FALLING_EDGE
,
3424 .tpvalid_polarity
= LGDT3305_TP_VALID_LOW
,
3426 .spectral_inversion
= 1,
3429 .usref_8vsb
= 0x0500,
3432 static struct mxl5007t_config hcw_mxl5007t_config
= {
3433 .xtal_freq_hz
= MxL_XTAL_25_MHZ
,
3434 .if_freq_hz
= MxL_IF_6_MHZ
,
3439 GPIO0 - LNA_CTR (H: LNA power enabled, L: LNA power disabled)
3440 GPIO1 - ANT_SEL (H: VPA, L: MCX)
3446 MXL is behind LG's i2c repeater. LG is on SCL2/SDA2 gpios on the DIB
3448 static int lgdt3305_frontend_attach(struct dvb_usb_adapter
*adap
)
3450 struct dib0700_state
*st
= adap
->dev
->priv
;
3452 /* Make use of the new i2c functions from FW 1.20 */
3453 st
->fw_use_new_i2c_api
= 1;
3455 st
->disable_streaming_master_mode
= 1;
3457 /* fe power enable */
3458 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0);
3460 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
3464 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
3466 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
3468 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
3471 adap
->fe_adap
[0].fe
= dvb_attach(lgdt3305_attach
,
3472 &hcw_lgdt3305_config
,
3473 &adap
->dev
->i2c_adap
);
3475 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
3478 static int mxl5007t_tuner_attach(struct dvb_usb_adapter
*adap
)
3480 return dvb_attach(mxl5007t_attach
, adap
->fe_adap
[0].fe
,
3481 &adap
->dev
->i2c_adap
, 0x60,
3482 &hcw_mxl5007t_config
) == NULL
? -ENODEV
: 0;
3486 /* DVB-USB and USB stuff follows */
3487 struct usb_device_id dib0700_usb_id_table
[] = {
3488 /* 0 */ { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK7700P
) },
3489 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK7700P_PC
) },
3490 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_T_500
) },
3491 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_T_500_2
) },
3492 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_T_STICK
) },
3493 /* 5 */ { USB_DEVICE(USB_VID_AVERMEDIA
, USB_PID_AVERMEDIA_VOLAR
) },
3494 { USB_DEVICE(USB_VID_COMPRO
, USB_PID_COMPRO_VIDEOMATE_U500
) },
3495 { USB_DEVICE(USB_VID_UNIWILL
, USB_PID_UNIWILL_STK7700P
) },
3496 { USB_DEVICE(USB_VID_LEADTEK
, USB_PID_WINFAST_DTV_DONGLE_STK7700P
) },
3497 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_T_STICK_2
) },
3498 /* 10 */{ USB_DEVICE(USB_VID_AVERMEDIA
, USB_PID_AVERMEDIA_VOLAR_2
) },
3499 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV2000E
) },
3500 { USB_DEVICE(USB_VID_TERRATEC
,
3501 USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY
) },
3502 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_TD_STICK
) },
3503 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK7700D
) },
3504 /* 15 */{ USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK7070P
) },
3505 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV_DVB_T_FLASH
) },
3506 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK7070PD
) },
3507 { USB_DEVICE(USB_VID_PINNACLE
,
3508 USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T
) },
3509 { USB_DEVICE(USB_VID_COMPRO
, USB_PID_COMPRO_VIDEOMATE_U500_PC
) },
3510 /* 20 */{ USB_DEVICE(USB_VID_AVERMEDIA
, USB_PID_AVERMEDIA_EXPRESS
) },
3511 { USB_DEVICE(USB_VID_GIGABYTE
, USB_PID_GIGABYTE_U7000
) },
3512 { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC
, USB_PID_ARTEC_T14BR
) },
3513 { USB_DEVICE(USB_VID_ASUS
, USB_PID_ASUS_U3000
) },
3514 { USB_DEVICE(USB_VID_ASUS
, USB_PID_ASUS_U3100
) },
3515 /* 25 */{ USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_T_STICK_3
) },
3516 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_MYTV_T
) },
3517 { USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_CINERGY_HT_USB_XE
) },
3518 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_EXPRESSCARD_320CX
) },
3519 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV72E
) },
3520 /* 30 */{ USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV73E
) },
3521 { USB_DEVICE(USB_VID_YUAN
, USB_PID_YUAN_EC372S
) },
3522 { USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_CINERGY_HT_EXPRESS
) },
3523 { USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_CINERGY_T_XXS
) },
3524 { USB_DEVICE(USB_VID_LEADTEK
, USB_PID_WINFAST_DTV_DONGLE_STK7700P_2
) },
3525 /* 35 */{ USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_TD_STICK_52009
) },
3526 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_T_500_3
) },
3527 { USB_DEVICE(USB_VID_GIGABYTE
, USB_PID_GIGABYTE_U8000
) },
3528 { USB_DEVICE(USB_VID_YUAN
, USB_PID_YUAN_STK7700PH
) },
3529 { USB_DEVICE(USB_VID_ASUS
, USB_PID_ASUS_U3000H
) },
3530 /* 40 */{ USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV801E
) },
3531 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV801E_SE
) },
3532 { USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_CINERGY_T_EXPRESS
) },
3533 { USB_DEVICE(USB_VID_TERRATEC
,
3534 USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY_2
) },
3535 { USB_DEVICE(USB_VID_SONY
, USB_PID_SONY_PLAYTV
) },
3536 /* 45 */{ USB_DEVICE(USB_VID_YUAN
, USB_PID_YUAN_PD378S
) },
3537 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_TIGER_ATSC
) },
3538 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_TIGER_ATSC_B210
) },
3539 { USB_DEVICE(USB_VID_YUAN
, USB_PID_YUAN_MC770
) },
3540 { USB_DEVICE(USB_VID_ELGATO
, USB_PID_ELGATO_EYETV_DTT
) },
3541 /* 50 */{ USB_DEVICE(USB_VID_ELGATO
, USB_PID_ELGATO_EYETV_DTT_Dlx
) },
3542 { USB_DEVICE(USB_VID_LEADTEK
, USB_PID_WINFAST_DTV_DONGLE_H
) },
3543 { USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_T3
) },
3544 { USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_T5
) },
3545 { USB_DEVICE(USB_VID_YUAN
, USB_PID_YUAN_STK7700D
) },
3546 /* 55 */{ USB_DEVICE(USB_VID_YUAN
, USB_PID_YUAN_STK7700D_2
) },
3547 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV73A
) },
3548 { USB_DEVICE(USB_VID_PCTV
, USB_PID_PINNACLE_PCTV73ESE
) },
3549 { USB_DEVICE(USB_VID_PCTV
, USB_PID_PINNACLE_PCTV282E
) },
3550 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK7770P
) },
3551 /* 60 */{ USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_CINERGY_T_XXS_2
) },
3552 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK807XPVR
) },
3553 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK807XP
) },
3554 { USB_DEVICE_VER(USB_VID_PIXELVIEW
, USB_PID_PIXELVIEW_SBTVD
, 0x000, 0x3f00) },
3555 { USB_DEVICE(USB_VID_EVOLUTEPC
, USB_PID_TVWAY_PLUS
) },
3556 /* 65 */{ USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV73ESE
) },
3557 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV282E
) },
3558 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK8096GP
) },
3559 { USB_DEVICE(USB_VID_ELGATO
, USB_PID_ELGATO_EYETV_DIVERSITY
) },
3560 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_NIM9090M
) },
3561 /* 70 */{ USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_NIM8096MD
) },
3562 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_NIM9090MD
) },
3563 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_NIM7090
) },
3564 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_TFE7090PVR
) },
3565 { USB_DEVICE(USB_VID_TECHNISAT
, USB_PID_TECHNISAT_AIRSTAR_TELESTICK_2
) },
3566 /* 75 */{ USB_DEVICE(USB_VID_MEDION
, USB_PID_CREATIX_CTX1921
) },
3567 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV340E
) },
3568 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV340E_SE
) },
3569 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_TFE7090E
) },
3570 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_TFE7790E
) },
3571 /* 80 */{ USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_TFE8096P
) },
3572 { 0 } /* Terminating entry */
3574 MODULE_DEVICE_TABLE(usb
, dib0700_usb_id_table
);
3576 #define DIB0700_DEFAULT_DEVICE_PROPERTIES \
3577 .caps = DVB_USB_IS_AN_I2C_ADAPTER, \
3578 .usb_ctrl = DEVICE_SPECIFIC, \
3579 .firmware = "dvb-usb-dib0700-1.20.fw", \
3580 .download_firmware = dib0700_download_firmware, \
3581 .no_reconnect = 1, \
3582 .size_of_priv = sizeof(struct dib0700_state), \
3583 .i2c_algo = &dib0700_i2c_algo, \
3584 .identify_state = dib0700_identify_state
3586 #define DIB0700_DEFAULT_STREAMING_CONFIG(ep) \
3587 .streaming_ctrl = dib0700_streaming_ctrl, \
3594 .buffersize = 39480, \
3599 struct dvb_usb_device_properties dib0700_devices
[] = {
3601 DIB0700_DEFAULT_DEVICE_PROPERTIES
,
3608 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
3609 .pid_filter_count
= 32,
3610 .pid_filter
= stk7700p_pid_filter
,
3611 .pid_filter_ctrl
= stk7700p_pid_filter_ctrl
,
3612 .frontend_attach
= stk7700p_frontend_attach
,
3613 .tuner_attach
= stk7700p_tuner_attach
,
3615 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
3620 .num_device_descs
= 8,
3622 { "DiBcom STK7700P reference design",
3623 { &dib0700_usb_id_table
[0], &dib0700_usb_id_table
[1] },
3626 { "Hauppauge Nova-T Stick",
3627 { &dib0700_usb_id_table
[4], &dib0700_usb_id_table
[9], NULL
},
3630 { "AVerMedia AVerTV DVB-T Volar",
3631 { &dib0700_usb_id_table
[5], &dib0700_usb_id_table
[10] },
3634 { "Compro Videomate U500",
3635 { &dib0700_usb_id_table
[6], &dib0700_usb_id_table
[19] },
3638 { "Uniwill STK7700P based (Hama and others)",
3639 { &dib0700_usb_id_table
[7], NULL
},
3642 { "Leadtek Winfast DTV Dongle (STK7700P based)",
3643 { &dib0700_usb_id_table
[8], &dib0700_usb_id_table
[34] },
3646 { "AVerMedia AVerTV DVB-T Express",
3647 { &dib0700_usb_id_table
[20] },
3651 { &dib0700_usb_id_table
[21], NULL
},
3657 .rc_interval
= DEFAULT_RC_INTERVAL
,
3658 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
3659 .rc_query
= dib0700_rc_query_old_firmware
,
3660 .allowed_protos
= RC_TYPE_RC5
|
3663 .change_protocol
= dib0700_change_protocol
,
3665 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
3672 .frontend_attach
= bristol_frontend_attach
,
3673 .tuner_attach
= bristol_tuner_attach
,
3675 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
3680 .frontend_attach
= bristol_frontend_attach
,
3681 .tuner_attach
= bristol_tuner_attach
,
3683 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
3688 .num_device_descs
= 1,
3690 { "Hauppauge Nova-T 500 Dual DVB-T",
3691 { &dib0700_usb_id_table
[2], &dib0700_usb_id_table
[3], NULL
},
3697 .rc_interval
= DEFAULT_RC_INTERVAL
,
3698 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
3699 .rc_query
= dib0700_rc_query_old_firmware
,
3700 .allowed_protos
= RC_TYPE_RC5
|
3703 .change_protocol
= dib0700_change_protocol
,
3705 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
3712 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
3713 .pid_filter_count
= 32,
3714 .pid_filter
= stk70x0p_pid_filter
,
3715 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
3716 .frontend_attach
= stk7700d_frontend_attach
,
3717 .tuner_attach
= stk7700d_tuner_attach
,
3719 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
3724 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
3725 .pid_filter_count
= 32,
3726 .pid_filter
= stk70x0p_pid_filter
,
3727 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
3728 .frontend_attach
= stk7700d_frontend_attach
,
3729 .tuner_attach
= stk7700d_tuner_attach
,
3731 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
3736 .num_device_descs
= 5,
3738 { "Pinnacle PCTV 2000e",
3739 { &dib0700_usb_id_table
[11], NULL
},
3742 { "Terratec Cinergy DT XS Diversity",
3743 { &dib0700_usb_id_table
[12], NULL
},
3746 { "Hauppauge Nova-TD Stick/Elgato Eye-TV Diversity",
3747 { &dib0700_usb_id_table
[13], NULL
},
3750 { "DiBcom STK7700D reference design",
3751 { &dib0700_usb_id_table
[14], NULL
},
3754 { "YUAN High-Tech DiBcom STK7700D",
3755 { &dib0700_usb_id_table
[55], NULL
},
3762 .rc_interval
= DEFAULT_RC_INTERVAL
,
3763 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
3764 .rc_query
= dib0700_rc_query_old_firmware
,
3765 .allowed_protos
= RC_TYPE_RC5
|
3768 .change_protocol
= dib0700_change_protocol
,
3770 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
3777 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
3778 .pid_filter_count
= 32,
3779 .pid_filter
= stk70x0p_pid_filter
,
3780 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
3781 .frontend_attach
= stk7700P2_frontend_attach
,
3782 .tuner_attach
= stk7700d_tuner_attach
,
3784 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
3789 .num_device_descs
= 3,
3791 { "ASUS My Cinema U3000 Mini DVBT Tuner",
3792 { &dib0700_usb_id_table
[23], NULL
},
3796 { &dib0700_usb_id_table
[31], NULL
},
3799 { "Terratec Cinergy T Express",
3800 { &dib0700_usb_id_table
[42], NULL
},
3806 .rc_interval
= DEFAULT_RC_INTERVAL
,
3807 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
3808 .module_name
= "dib0700",
3809 .rc_query
= dib0700_rc_query_old_firmware
,
3810 .allowed_protos
= RC_TYPE_RC5
|
3813 .change_protocol
= dib0700_change_protocol
,
3815 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
3822 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
3823 .pid_filter_count
= 32,
3824 .pid_filter
= stk70x0p_pid_filter
,
3825 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
3826 .frontend_attach
= stk7070p_frontend_attach
,
3827 .tuner_attach
= dib7070p_tuner_attach
,
3829 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
3831 .size_of_priv
= sizeof(struct dib0700_adapter_state
),
3835 .num_device_descs
= 11,
3837 { "DiBcom STK7070P reference design",
3838 { &dib0700_usb_id_table
[15], NULL
},
3841 { "Pinnacle PCTV DVB-T Flash Stick",
3842 { &dib0700_usb_id_table
[16], NULL
},
3845 { "Artec T14BR DVB-T",
3846 { &dib0700_usb_id_table
[22], NULL
},
3849 { "ASUS My Cinema U3100 Mini DVBT Tuner",
3850 { &dib0700_usb_id_table
[24], NULL
},
3853 { "Hauppauge Nova-T Stick",
3854 { &dib0700_usb_id_table
[25], NULL
},
3857 { "Hauppauge Nova-T MyTV.t",
3858 { &dib0700_usb_id_table
[26], NULL
},
3861 { "Pinnacle PCTV 72e",
3862 { &dib0700_usb_id_table
[29], NULL
},
3865 { "Pinnacle PCTV 73e",
3866 { &dib0700_usb_id_table
[30], NULL
},
3869 { "Elgato EyeTV DTT",
3870 { &dib0700_usb_id_table
[49], NULL
},
3874 { &dib0700_usb_id_table
[45], NULL
},
3877 { "Elgato EyeTV Dtt Dlx PD378S",
3878 { &dib0700_usb_id_table
[50], NULL
},
3884 .rc_interval
= DEFAULT_RC_INTERVAL
,
3885 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
3886 .module_name
= "dib0700",
3887 .rc_query
= dib0700_rc_query_old_firmware
,
3888 .allowed_protos
= RC_TYPE_RC5
|
3891 .change_protocol
= dib0700_change_protocol
,
3893 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
3900 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
3901 .pid_filter_count
= 32,
3902 .pid_filter
= stk70x0p_pid_filter
,
3903 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
3904 .frontend_attach
= stk7070p_frontend_attach
,
3905 .tuner_attach
= dib7070p_tuner_attach
,
3907 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
3909 .size_of_priv
= sizeof(struct dib0700_adapter_state
),
3913 .num_device_descs
= 3,
3915 { "Pinnacle PCTV 73A",
3916 { &dib0700_usb_id_table
[56], NULL
},
3919 { "Pinnacle PCTV 73e SE",
3920 { &dib0700_usb_id_table
[57], &dib0700_usb_id_table
[65], NULL
},
3923 { "Pinnacle PCTV 282e",
3924 { &dib0700_usb_id_table
[58], &dib0700_usb_id_table
[66], NULL
},
3930 .rc_interval
= DEFAULT_RC_INTERVAL
,
3931 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
3932 .module_name
= "dib0700",
3933 .rc_query
= dib0700_rc_query_old_firmware
,
3934 .allowed_protos
= RC_TYPE_RC5
|
3937 .change_protocol
= dib0700_change_protocol
,
3939 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
3946 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
3947 .pid_filter_count
= 32,
3948 .pid_filter
= stk70x0p_pid_filter
,
3949 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
3950 .frontend_attach
= novatd_frontend_attach
,
3951 .tuner_attach
= dib7070p_tuner_attach
,
3953 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
3955 .size_of_priv
= sizeof(struct dib0700_adapter_state
),
3959 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
3960 .pid_filter_count
= 32,
3961 .pid_filter
= stk70x0p_pid_filter
,
3962 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
3963 .frontend_attach
= novatd_frontend_attach
,
3964 .tuner_attach
= dib7070p_tuner_attach
,
3966 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
3968 .size_of_priv
= sizeof(struct dib0700_adapter_state
),
3972 .num_device_descs
= 1,
3974 { "Hauppauge Nova-TD Stick (52009)",
3975 { &dib0700_usb_id_table
[35], NULL
},
3981 .rc_interval
= DEFAULT_RC_INTERVAL
,
3982 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
3983 .module_name
= "dib0700",
3984 .rc_query
= dib0700_rc_query_old_firmware
,
3985 .allowed_protos
= RC_TYPE_RC5
|
3988 .change_protocol
= dib0700_change_protocol
,
3990 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
3997 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
3998 .pid_filter_count
= 32,
3999 .pid_filter
= stk70x0p_pid_filter
,
4000 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4001 .frontend_attach
= stk7070pd_frontend_attach0
,
4002 .tuner_attach
= dib7070p_tuner_attach
,
4004 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4006 .size_of_priv
= sizeof(struct dib0700_adapter_state
),
4010 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4011 .pid_filter_count
= 32,
4012 .pid_filter
= stk70x0p_pid_filter
,
4013 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4014 .frontend_attach
= stk7070pd_frontend_attach1
,
4015 .tuner_attach
= dib7070p_tuner_attach
,
4017 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
4019 .size_of_priv
= sizeof(struct dib0700_adapter_state
),
4023 .num_device_descs
= 5,
4025 { "DiBcom STK7070PD reference design",
4026 { &dib0700_usb_id_table
[17], NULL
},
4029 { "Pinnacle PCTV Dual DVB-T Diversity Stick",
4030 { &dib0700_usb_id_table
[18], NULL
},
4033 { "Hauppauge Nova-TD-500 (84xxx)",
4034 { &dib0700_usb_id_table
[36], NULL
},
4037 { "Terratec Cinergy DT USB XS Diversity/ T5",
4038 { &dib0700_usb_id_table
[43],
4039 &dib0700_usb_id_table
[53], NULL
},
4043 { &dib0700_usb_id_table
[44], NULL
},
4049 .rc_interval
= DEFAULT_RC_INTERVAL
,
4050 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4051 .module_name
= "dib0700",
4052 .rc_query
= dib0700_rc_query_old_firmware
,
4053 .allowed_protos
= RC_TYPE_RC5
|
4056 .change_protocol
= dib0700_change_protocol
,
4058 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4065 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4066 .pid_filter_count
= 32,
4067 .pid_filter
= stk70x0p_pid_filter
,
4068 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4069 .frontend_attach
= stk7070pd_frontend_attach0
,
4070 .tuner_attach
= dib7070p_tuner_attach
,
4072 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4074 .size_of_priv
= sizeof(struct dib0700_adapter_state
),
4078 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4079 .pid_filter_count
= 32,
4080 .pid_filter
= stk70x0p_pid_filter
,
4081 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4082 .frontend_attach
= stk7070pd_frontend_attach1
,
4083 .tuner_attach
= dib7070p_tuner_attach
,
4085 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
4087 .size_of_priv
= sizeof(struct dib0700_adapter_state
),
4091 .num_device_descs
= 1,
4093 { "Elgato EyeTV Diversity",
4094 { &dib0700_usb_id_table
[68], NULL
},
4100 .rc_interval
= DEFAULT_RC_INTERVAL
,
4101 .rc_codes
= RC_MAP_DIB0700_NEC_TABLE
,
4102 .module_name
= "dib0700",
4103 .rc_query
= dib0700_rc_query_old_firmware
,
4104 .allowed_protos
= RC_TYPE_RC5
|
4107 .change_protocol
= dib0700_change_protocol
,
4109 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4116 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4117 .pid_filter_count
= 32,
4118 .pid_filter
= stk70x0p_pid_filter
,
4119 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4120 .frontend_attach
= stk7700ph_frontend_attach
,
4121 .tuner_attach
= stk7700ph_tuner_attach
,
4123 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4125 .size_of_priv
= sizeof(struct
4126 dib0700_adapter_state
),
4130 .num_device_descs
= 9,
4132 { "Terratec Cinergy HT USB XE",
4133 { &dib0700_usb_id_table
[27], NULL
},
4136 { "Pinnacle Expresscard 320cx",
4137 { &dib0700_usb_id_table
[28], NULL
},
4140 { "Terratec Cinergy HT Express",
4141 { &dib0700_usb_id_table
[32], NULL
},
4144 { "Gigabyte U8000-RH",
4145 { &dib0700_usb_id_table
[37], NULL
},
4148 { "YUAN High-Tech STK7700PH",
4149 { &dib0700_usb_id_table
[38], NULL
},
4152 { "Asus My Cinema-U3000Hybrid",
4153 { &dib0700_usb_id_table
[39], NULL
},
4156 { "YUAN High-Tech MC770",
4157 { &dib0700_usb_id_table
[48], NULL
},
4160 { "Leadtek WinFast DTV Dongle H",
4161 { &dib0700_usb_id_table
[51], NULL
},
4164 { "YUAN High-Tech STK7700D",
4165 { &dib0700_usb_id_table
[54], NULL
},
4171 .rc_interval
= DEFAULT_RC_INTERVAL
,
4172 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4173 .module_name
= "dib0700",
4174 .rc_query
= dib0700_rc_query_old_firmware
,
4175 .allowed_protos
= RC_TYPE_RC5
|
4178 .change_protocol
= dib0700_change_protocol
,
4180 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4186 .frontend_attach
= s5h1411_frontend_attach
,
4187 .tuner_attach
= xc5000_tuner_attach
,
4189 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4191 .size_of_priv
= sizeof(struct
4192 dib0700_adapter_state
),
4196 .num_device_descs
= 2,
4198 { "Pinnacle PCTV HD Pro USB Stick",
4199 { &dib0700_usb_id_table
[40], NULL
},
4202 { "Pinnacle PCTV HD USB Stick",
4203 { &dib0700_usb_id_table
[41], NULL
},
4209 .rc_interval
= DEFAULT_RC_INTERVAL
,
4210 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4211 .module_name
= "dib0700",
4212 .rc_query
= dib0700_rc_query_old_firmware
,
4213 .allowed_protos
= RC_TYPE_RC5
|
4216 .change_protocol
= dib0700_change_protocol
,
4218 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4224 .frontend_attach
= lgdt3305_frontend_attach
,
4225 .tuner_attach
= mxl5007t_tuner_attach
,
4227 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4229 .size_of_priv
= sizeof(struct
4230 dib0700_adapter_state
),
4234 .num_device_descs
= 2,
4236 { "Hauppauge ATSC MiniCard (B200)",
4237 { &dib0700_usb_id_table
[46], NULL
},
4240 { "Hauppauge ATSC MiniCard (B210)",
4241 { &dib0700_usb_id_table
[47], NULL
},
4245 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4252 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4253 .pid_filter_count
= 32,
4254 .pid_filter
= stk70x0p_pid_filter
,
4255 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4256 .frontend_attach
= stk7770p_frontend_attach
,
4257 .tuner_attach
= dib7770p_tuner_attach
,
4259 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4262 sizeof(struct dib0700_adapter_state
),
4266 .num_device_descs
= 4,
4268 { "DiBcom STK7770P reference design",
4269 { &dib0700_usb_id_table
[59], NULL
},
4272 { "Terratec Cinergy T USB XXS (HD)/ T3",
4273 { &dib0700_usb_id_table
[33],
4274 &dib0700_usb_id_table
[52],
4275 &dib0700_usb_id_table
[60], NULL
},
4278 { "TechniSat AirStar TeleStick 2",
4279 { &dib0700_usb_id_table
[74], NULL
},
4282 { "Medion CTX1921 DVB-T USB",
4283 { &dib0700_usb_id_table
[75], NULL
},
4289 .rc_interval
= DEFAULT_RC_INTERVAL
,
4290 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4291 .module_name
= "dib0700",
4292 .rc_query
= dib0700_rc_query_old_firmware
,
4293 .allowed_protos
= RC_TYPE_RC5
|
4296 .change_protocol
= dib0700_change_protocol
,
4298 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4304 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4305 .pid_filter_count
= 32,
4306 .pid_filter
= stk80xx_pid_filter
,
4307 .pid_filter_ctrl
= stk80xx_pid_filter_ctrl
,
4308 .frontend_attach
= stk807x_frontend_attach
,
4309 .tuner_attach
= dib807x_tuner_attach
,
4311 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4314 sizeof(struct dib0700_adapter_state
),
4318 .num_device_descs
= 3,
4320 { "DiBcom STK807xP reference design",
4321 { &dib0700_usb_id_table
[62], NULL
},
4324 { "Prolink Pixelview SBTVD",
4325 { &dib0700_usb_id_table
[63], NULL
},
4328 { "EvolutePC TVWay+",
4329 { &dib0700_usb_id_table
[64], NULL
},
4335 .rc_interval
= DEFAULT_RC_INTERVAL
,
4336 .rc_codes
= RC_MAP_DIB0700_NEC_TABLE
,
4337 .module_name
= "dib0700",
4338 .rc_query
= dib0700_rc_query_old_firmware
,
4339 .allowed_protos
= RC_TYPE_RC5
|
4342 .change_protocol
= dib0700_change_protocol
,
4344 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4350 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4351 .pid_filter_count
= 32,
4352 .pid_filter
= stk80xx_pid_filter
,
4353 .pid_filter_ctrl
= stk80xx_pid_filter_ctrl
,
4354 .frontend_attach
= stk807xpvr_frontend_attach0
,
4355 .tuner_attach
= dib807x_tuner_attach
,
4357 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4360 sizeof(struct dib0700_adapter_state
),
4365 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4366 .pid_filter_count
= 32,
4367 .pid_filter
= stk80xx_pid_filter
,
4368 .pid_filter_ctrl
= stk80xx_pid_filter_ctrl
,
4369 .frontend_attach
= stk807xpvr_frontend_attach1
,
4370 .tuner_attach
= dib807x_tuner_attach
,
4372 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
4375 sizeof(struct dib0700_adapter_state
),
4379 .num_device_descs
= 1,
4381 { "DiBcom STK807xPVR reference design",
4382 { &dib0700_usb_id_table
[61], NULL
},
4388 .rc_interval
= DEFAULT_RC_INTERVAL
,
4389 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4390 .module_name
= "dib0700",
4391 .rc_query
= dib0700_rc_query_old_firmware
,
4392 .allowed_protos
= RC_TYPE_RC5
|
4395 .change_protocol
= dib0700_change_protocol
,
4397 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4403 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4404 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4405 .pid_filter_count
= 32,
4406 .pid_filter
= stk80xx_pid_filter
,
4407 .pid_filter_ctrl
= stk80xx_pid_filter_ctrl
,
4408 .frontend_attach
= stk809x_frontend_attach
,
4409 .tuner_attach
= dib809x_tuner_attach
,
4411 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4414 sizeof(struct dib0700_adapter_state
),
4418 .num_device_descs
= 1,
4420 { "DiBcom STK8096GP reference design",
4421 { &dib0700_usb_id_table
[67], NULL
},
4427 .rc_interval
= DEFAULT_RC_INTERVAL
,
4428 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4429 .module_name
= "dib0700",
4430 .rc_query
= dib0700_rc_query_old_firmware
,
4431 .allowed_protos
= RC_TYPE_RC5
|
4434 .change_protocol
= dib0700_change_protocol
,
4436 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4442 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4443 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4444 .pid_filter_count
= 32,
4445 .pid_filter
= dib90x0_pid_filter
,
4446 .pid_filter_ctrl
= dib90x0_pid_filter_ctrl
,
4447 .frontend_attach
= stk9090m_frontend_attach
,
4448 .tuner_attach
= dib9090_tuner_attach
,
4450 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4453 sizeof(struct dib0700_adapter_state
),
4457 .num_device_descs
= 1,
4459 { "DiBcom STK9090M reference design",
4460 { &dib0700_usb_id_table
[69], NULL
},
4466 .rc_interval
= DEFAULT_RC_INTERVAL
,
4467 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4468 .module_name
= "dib0700",
4469 .rc_query
= dib0700_rc_query_old_firmware
,
4470 .allowed_protos
= RC_TYPE_RC5
|
4473 .change_protocol
= dib0700_change_protocol
,
4475 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4481 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4482 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4483 .pid_filter_count
= 32,
4484 .pid_filter
= stk80xx_pid_filter
,
4485 .pid_filter_ctrl
= stk80xx_pid_filter_ctrl
,
4486 .frontend_attach
= nim8096md_frontend_attach
,
4487 .tuner_attach
= nim8096md_tuner_attach
,
4489 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4492 sizeof(struct dib0700_adapter_state
),
4496 .num_device_descs
= 1,
4498 { "DiBcom NIM8096MD reference design",
4499 { &dib0700_usb_id_table
[70], NULL
},
4505 .rc_interval
= DEFAULT_RC_INTERVAL
,
4506 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4507 .module_name
= "dib0700",
4508 .rc_query
= dib0700_rc_query_old_firmware
,
4509 .allowed_protos
= RC_TYPE_RC5
|
4512 .change_protocol
= dib0700_change_protocol
,
4514 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4520 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4521 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4522 .pid_filter_count
= 32,
4523 .pid_filter
= dib90x0_pid_filter
,
4524 .pid_filter_ctrl
= dib90x0_pid_filter_ctrl
,
4525 .frontend_attach
= nim9090md_frontend_attach
,
4526 .tuner_attach
= nim9090md_tuner_attach
,
4528 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4531 sizeof(struct dib0700_adapter_state
),
4535 .num_device_descs
= 1,
4537 { "DiBcom NIM9090MD reference design",
4538 { &dib0700_usb_id_table
[71], NULL
},
4544 .rc_interval
= DEFAULT_RC_INTERVAL
,
4545 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4546 .module_name
= "dib0700",
4547 .rc_query
= dib0700_rc_query_old_firmware
,
4548 .allowed_protos
= RC_TYPE_RC5
|
4551 .change_protocol
= dib0700_change_protocol
,
4553 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4559 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4560 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4561 .pid_filter_count
= 32,
4562 .pid_filter
= stk70x0p_pid_filter
,
4563 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4564 .frontend_attach
= nim7090_frontend_attach
,
4565 .tuner_attach
= nim7090_tuner_attach
,
4567 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4570 sizeof(struct dib0700_adapter_state
),
4574 .num_device_descs
= 1,
4576 { "DiBcom NIM7090 reference design",
4577 { &dib0700_usb_id_table
[72], NULL
},
4583 .rc_interval
= DEFAULT_RC_INTERVAL
,
4584 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4585 .module_name
= "dib0700",
4586 .rc_query
= dib0700_rc_query_old_firmware
,
4587 .allowed_protos
= RC_TYPE_RC5
|
4590 .change_protocol
= dib0700_change_protocol
,
4592 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4598 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4599 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4600 .pid_filter_count
= 32,
4601 .pid_filter
= stk70x0p_pid_filter
,
4602 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4603 .frontend_attach
= tfe7090pvr_frontend0_attach
,
4604 .tuner_attach
= tfe7090pvr_tuner0_attach
,
4606 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
4609 sizeof(struct dib0700_adapter_state
),
4614 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4615 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4616 .pid_filter_count
= 32,
4617 .pid_filter
= stk70x0p_pid_filter
,
4618 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4619 .frontend_attach
= tfe7090pvr_frontend1_attach
,
4620 .tuner_attach
= tfe7090pvr_tuner1_attach
,
4622 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4625 sizeof(struct dib0700_adapter_state
),
4629 .num_device_descs
= 1,
4631 { "DiBcom TFE7090PVR reference design",
4632 { &dib0700_usb_id_table
[73], NULL
},
4638 .rc_interval
= DEFAULT_RC_INTERVAL
,
4639 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4640 .module_name
= "dib0700",
4641 .rc_query
= dib0700_rc_query_old_firmware
,
4642 .allowed_protos
= RC_TYPE_RC5
|
4645 .change_protocol
= dib0700_change_protocol
,
4647 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4653 .frontend_attach
= pctv340e_frontend_attach
,
4654 .tuner_attach
= xc4000_tuner_attach
,
4656 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4658 .size_of_priv
= sizeof(struct
4659 dib0700_adapter_state
),
4663 .num_device_descs
= 2,
4665 { "Pinnacle PCTV 340e HD Pro USB Stick",
4666 { &dib0700_usb_id_table
[76], NULL
},
4669 { "Pinnacle PCTV Hybrid Stick Solo",
4670 { &dib0700_usb_id_table
[77], NULL
},
4675 .rc_interval
= DEFAULT_RC_INTERVAL
,
4676 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4677 .module_name
= "dib0700",
4678 .rc_query
= dib0700_rc_query_old_firmware
,
4679 .allowed_protos
= RC_TYPE_RC5
|
4682 .change_protocol
= dib0700_change_protocol
,
4684 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4690 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4691 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4692 .pid_filter_count
= 32,
4693 .pid_filter
= stk70x0p_pid_filter
,
4694 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4695 .frontend_attach
= tfe7090e_frontend_attach
,
4696 .tuner_attach
= tfe7090e_tuner_attach
,
4698 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4702 sizeof(struct dib0700_adapter_state
),
4706 .num_device_descs
= 1,
4708 { "DiBcom TFE7090E reference design",
4709 { &dib0700_usb_id_table
[78], NULL
},
4715 .rc_interval
= DEFAULT_RC_INTERVAL
,
4716 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4717 .module_name
= "dib0700",
4718 .rc_query
= dib0700_rc_query_old_firmware
,
4719 .allowed_protos
= RC_TYPE_RC5
|
4722 .change_protocol
= dib0700_change_protocol
,
4724 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4730 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4731 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4732 .pid_filter_count
= 32,
4733 .pid_filter
= stk70x0p_pid_filter
,
4734 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4735 .frontend_attach
= tfe7790e_frontend_attach
,
4736 .tuner_attach
= tfe7790e_tuner_attach
,
4738 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
4742 sizeof(struct dib0700_adapter_state
),
4746 .num_device_descs
= 1,
4748 { "DiBcom TFE7790E reference design",
4749 { &dib0700_usb_id_table
[79], NULL
},
4755 .rc_interval
= DEFAULT_RC_INTERVAL
,
4756 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4757 .module_name
= "dib0700",
4758 .rc_query
= dib0700_rc_query_old_firmware
,
4759 .allowed_protos
= RC_TYPE_RC5
|
4762 .change_protocol
= dib0700_change_protocol
,
4764 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4770 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4771 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4772 .pid_filter_count
= 32,
4773 .pid_filter
= stk80xx_pid_filter
,
4774 .pid_filter_ctrl
= stk80xx_pid_filter_ctrl
,
4775 .frontend_attach
= tfe8096p_frontend_attach
,
4776 .tuner_attach
= tfe8096p_tuner_attach
,
4778 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4783 sizeof(struct dib0700_adapter_state
),
4787 .num_device_descs
= 1,
4789 { "DiBcom TFE8096P reference design",
4790 { &dib0700_usb_id_table
[80], NULL
},
4796 .rc_interval
= DEFAULT_RC_INTERVAL
,
4797 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4798 .module_name
= "dib0700",
4799 .rc_query
= dib0700_rc_query_old_firmware
,
4800 .allowed_protos
= RC_TYPE_RC5
|
4803 .change_protocol
= dib0700_change_protocol
,
4808 int dib0700_device_count
= ARRAY_SIZE(dib0700_devices
);