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 void dib8090_agc_control(struct dvb_frontend
*fe
, u8 restart
)
1436 deb_info("AGC control callback: %i\n", restart
);
1437 dib0090_dcc_freq(fe
, restart
);
1439 if (restart
== 0) /* before AGC startup */
1440 dib0090_set_dc_servo(fe
, 1);
1443 static struct dib8000_config dib809x_dib8000_config
[2] = {
1445 .output_mpeg2_in_188_bytes
= 1,
1447 .agc_config_count
= 2,
1448 .agc
= dib8090_agc_config
,
1449 .agc_control
= dib8090_agc_control
,
1450 .pll
= &dib8090_pll_config_12mhz
,
1451 .tuner_is_baseband
= 1,
1453 .gpio_dir
= DIB8000_GPIO_DEFAULT_DIRECTIONS
,
1454 .gpio_val
= DIB8000_GPIO_DEFAULT_VALUES
,
1455 .gpio_pwm_pos
= DIB8000_GPIO_DEFAULT_PWM_POS
,
1457 .hostbus_diversity
= 1,
1459 .output_mode
= OUTMODE_MPEG2_FIFO
,
1461 .diversity_delay
= 48,
1464 .output_mpeg2_in_188_bytes
= 1,
1466 .agc_config_count
= 2,
1467 .agc
= dib8090_agc_config
,
1468 .agc_control
= dib8090_agc_control
,
1469 .pll
= &dib8090_pll_config_12mhz
,
1470 .tuner_is_baseband
= 1,
1472 .gpio_dir
= DIB8000_GPIO_DEFAULT_DIRECTIONS
,
1473 .gpio_val
= DIB8000_GPIO_DEFAULT_VALUES
,
1474 .gpio_pwm_pos
= DIB8000_GPIO_DEFAULT_PWM_POS
,
1476 .hostbus_diversity
= 1,
1478 .output_mode
= OUTMODE_DIVERSITY
,
1480 .diversity_delay
= 1,
1485 static struct dib0090_wbd_slope dib8090_wbd_table
[] = {
1486 /* max freq ; cold slope ; cold offset ; warm slope ; warm offset ; wbd gain */
1487 { 120, 0, 500, 0, 500, 4 }, /* CBAND */
1488 { 170, 0, 450, 0, 450, 4 }, /* CBAND */
1489 { 380, 48, 373, 28, 259, 6 }, /* VHF */
1490 { 860, 34, 700, 36, 616, 6 }, /* high UHF */
1491 { 0xFFFF, 34, 700, 36, 616, 6 }, /* default */
1494 static struct dib0090_config dib809x_dib0090_config
= {
1498 .io
.pll_loopdiv
= 20,
1499 .io
.adc_clock_ratio
= 8,
1500 .io
.pll_int_loop_filt
= 0,
1501 .io
.clock_khz
= 12000,
1502 .reset
= dib80xx_tuner_reset
,
1503 .sleep
= dib80xx_tuner_sleep
,
1506 .i2c_address
= DEFAULT_DIB0090_I2C_ADDRESS
,
1509 .get_adc_power
= dib8090_get_adc_power
,
1510 .freq_offset_khz_uhf
= -63,
1511 .freq_offset_khz_vhf
= -143,
1512 .wbd
= dib8090_wbd_table
,
1513 .fref_clock_ratio
= 6,
1516 static u8
dib8090_compute_pll_parameters(struct dvb_frontend
*fe
)
1518 u8 optimal_pll_ratio
= 20;
1519 u32 freq_adc
, ratio
, rest
, max
= 0;
1522 for (pll_ratio
= 17; pll_ratio
<= 20; pll_ratio
++) {
1523 freq_adc
= 12 * pll_ratio
* (1 << 8) / 16;
1524 ratio
= ((fe
->dtv_property_cache
.frequency
/ 1000) * (1 << 8) / 1000) / freq_adc
;
1525 rest
= ((fe
->dtv_property_cache
.frequency
/ 1000) * (1 << 8) / 1000) - ratio
* freq_adc
;
1527 if (rest
> freq_adc
/ 2)
1528 rest
= freq_adc
- rest
;
1529 deb_info("PLL ratio=%i rest=%i\n", pll_ratio
, rest
);
1530 if ((rest
> max
) && (rest
> 717)) {
1531 optimal_pll_ratio
= pll_ratio
;
1535 deb_info("optimal PLL ratio=%i\n", optimal_pll_ratio
);
1537 return optimal_pll_ratio
;
1540 static int dib8096_set_param_override(struct dvb_frontend
*fe
)
1542 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
1543 struct dib0700_adapter_state
*state
= adap
->priv
;
1544 u8 pll_ratio
, band
= BAND_OF_FREQUENCY(fe
->dtv_property_cache
.frequency
/ 1000);
1545 u16 target
, ltgain
, rf_gain_limit
;
1548 enum frontend_tune_state tune_state
= CT_SHUTDOWN
;
1552 deb_info("Warning : Rf frequency (%iHz) is not in the supported range, using VHF switch ", fe
->dtv_property_cache
.frequency
);
1554 dib8000_set_gpio(fe
, 3, 0, 1);
1557 dib8000_set_gpio(fe
, 3, 0, 0);
1561 ret
= state
->set_param_save(fe
);
1565 if (fe
->dtv_property_cache
.bandwidth_hz
!= 6000000) {
1566 deb_info("only 6MHz bandwidth is supported\n");
1570 /** Update PLL if needed ratio **/
1571 dib8000_update_pll(fe
, &dib8090_pll_config_12mhz
, fe
->dtv_property_cache
.bandwidth_hz
/ 1000, 0);
1573 /** Get optimize PLL ratio to remove spurious **/
1574 pll_ratio
= dib8090_compute_pll_parameters(fe
);
1575 if (pll_ratio
== 17)
1577 else if (pll_ratio
== 18)
1579 else if (pll_ratio
== 19)
1584 /** Update ratio **/
1585 dib8000_update_pll(fe
, &dib8090_pll_config_12mhz
, fe
->dtv_property_cache
.bandwidth_hz
/ 1000, pll_ratio
);
1587 dib8000_ctrl_timf(fe
, DEMOD_TIMF_SET
, timf
);
1589 if (band
!= BAND_CBAND
) {
1590 /* dib0090_get_wbd_target is returning any possible temperature compensated wbd-target */
1591 target
= (dib0090_get_wbd_target(fe
) * 8 * 18 / 33 + 1) / 2;
1592 dib8000_set_wbd_ref(fe
, target
);
1595 if (band
== BAND_CBAND
) {
1596 deb_info("tuning in CBAND - soft-AGC startup\n");
1597 dib0090_set_tune_state(fe
, CT_AGC_START
);
1600 ret
= dib0090_gain_control(fe
);
1602 tune_state
= dib0090_get_tune_state(fe
);
1603 if (tune_state
== CT_AGC_STEP_0
)
1604 dib8000_set_gpio(fe
, 6, 0, 1);
1605 else if (tune_state
== CT_AGC_STEP_1
) {
1606 dib0090_get_current_gain(fe
, NULL
, NULL
, &rf_gain_limit
, <gain
);
1607 if (rf_gain_limit
< 2000) /* activate the external attenuator in case of very high input power */
1608 dib8000_set_gpio(fe
, 6, 0, 0);
1610 } while (tune_state
< CT_AGC_STOP
);
1612 deb_info("switching to PWM AGC\n");
1613 dib0090_pwm_gain_reset(fe
);
1614 dib8000_pwm_agc_reset(fe
);
1615 dib8000_set_tune_state(fe
, CT_DEMOD_START
);
1617 /* for everything else than CBAND we are using standard AGC */
1618 deb_info("not tuning in CBAND - standard AGC startup\n");
1619 dib0090_pwm_gain_reset(fe
);
1625 static int dib809x_tuner_attach(struct dvb_usb_adapter
*adap
)
1627 struct dib0700_adapter_state
*st
= adap
->priv
;
1628 struct i2c_adapter
*tun_i2c
= dib8000_get_i2c_master(adap
->fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_TUNER
, 1);
1630 if (dvb_attach(dib0090_register
, adap
->fe_adap
[0].fe
, tun_i2c
, &dib809x_dib0090_config
) == NULL
)
1633 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
1634 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib8096_set_param_override
;
1638 static int stk809x_frontend_attach(struct dvb_usb_adapter
*adap
)
1640 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
1642 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
1643 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
1644 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
1646 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
1648 dib0700_ctrl_clock(adap
->dev
, 72, 1);
1651 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
1653 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
1655 dib8000_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 18, 0x80, 0);
1657 adap
->fe_adap
[0].fe
= dvb_attach(dib8000_attach
, &adap
->dev
->i2c_adap
, 0x80, &dib809x_dib8000_config
[0]);
1659 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
1662 static int nim8096md_tuner_attach(struct dvb_usb_adapter
*adap
)
1664 struct dib0700_adapter_state
*st
= adap
->priv
;
1665 struct i2c_adapter
*tun_i2c
;
1666 struct dvb_frontend
*fe_slave
= dib8000_get_slave_frontend(adap
->fe_adap
[0].fe
, 1);
1669 tun_i2c
= dib8000_get_i2c_master(fe_slave
, DIBX000_I2C_INTERFACE_TUNER
, 1);
1670 if (dvb_attach(dib0090_register
, fe_slave
, tun_i2c
, &dib809x_dib0090_config
) == NULL
)
1672 fe_slave
->dvb
= adap
->fe_adap
[0].fe
->dvb
;
1673 fe_slave
->ops
.tuner_ops
.set_params
= dib8096_set_param_override
;
1675 tun_i2c
= dib8000_get_i2c_master(adap
->fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_TUNER
, 1);
1676 if (dvb_attach(dib0090_register
, adap
->fe_adap
[0].fe
, tun_i2c
, &dib809x_dib0090_config
) == NULL
)
1679 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
1680 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib8096_set_param_override
;
1685 static int nim8096md_frontend_attach(struct dvb_usb_adapter
*adap
)
1687 struct dvb_frontend
*fe_slave
;
1689 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0);
1691 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
1693 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
1694 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
1695 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
1697 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
1699 dib0700_ctrl_clock(adap
->dev
, 72, 1);
1702 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
1704 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
1706 dib8000_i2c_enumeration(&adap
->dev
->i2c_adap
, 2, 18, 0x80, 0);
1708 adap
->fe_adap
[0].fe
= dvb_attach(dib8000_attach
, &adap
->dev
->i2c_adap
, 0x80, &dib809x_dib8000_config
[0]);
1709 if (adap
->fe_adap
[0].fe
== NULL
)
1712 fe_slave
= dvb_attach(dib8000_attach
, &adap
->dev
->i2c_adap
, 0x82, &dib809x_dib8000_config
[1]);
1713 dib8000_set_slave_frontend(adap
->fe_adap
[0].fe
, fe_slave
);
1715 return fe_slave
== NULL
? -ENODEV
: 0;
1719 static struct dibx000_agc_config dib8096p_agc_config
[2] = {
1721 .band_caps
= BAND_UHF
,
1722 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0,
1723 P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0,
1724 P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
1725 P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5,
1727 .setup
= (0 << 15) | (0 << 14) | (5 << 11)
1728 | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5)
1729 | (0 << 4) | (5 << 1) | (0 << 0),
1732 .time_stabiliz
= 10,
1763 .perform_agc_softsplit
= 0,
1765 .band_caps
= BAND_FM
| BAND_VHF
| BAND_CBAND
,
1766 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0,
1767 P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0,
1768 P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
1769 P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5,
1771 .setup
= (0 << 15) | (0 << 14) | (5 << 11)
1772 | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5)
1773 | (0 << 4) | (5 << 1) | (0 << 0),
1776 .time_stabiliz
= 10,
1807 .perform_agc_softsplit
= 0,
1811 static struct dibx000_bandwidth_config dib8096p_clock_config_12_mhz
= {
1815 (3 << 14) | (1 << 12) | (524 << 0),
1821 static struct dib8000_config tfe8096p_dib8000_config
= {
1822 .output_mpeg2_in_188_bytes
= 1,
1823 .hostbus_diversity
= 1,
1826 .agc_config_count
= 2,
1827 .agc
= dib8096p_agc_config
,
1828 .pll
= &dib8096p_clock_config_12_mhz
,
1830 .gpio_dir
= DIB8000_GPIO_DEFAULT_DIRECTIONS
,
1831 .gpio_val
= DIB8000_GPIO_DEFAULT_VALUES
,
1832 .gpio_pwm_pos
= DIB8000_GPIO_DEFAULT_PWM_POS
,
1834 .agc_control
= NULL
,
1835 .diversity_delay
= 48,
1836 .output_mode
= OUTMODE_MPEG2_FIFO
,
1840 static struct dib0090_wbd_slope dib8096p_wbd_table
[] = {
1841 { 380, 81, 850, 64, 540, 4},
1842 { 860, 51, 866, 21, 375, 4},
1843 {1700, 0, 250, 0, 100, 6},
1844 {2600, 0, 250, 0, 100, 6},
1845 { 0xFFFF, 0, 0, 0, 0, 0},
1848 static const struct dib0090_config tfe8096p_dib0090_config
= {
1849 .io
.clock_khz
= 12000,
1853 .io
.pll_loopdiv
= 6,
1854 .io
.adc_clock_ratio
= 0,
1855 .io
.pll_int_loop_filt
= 0,
1856 .reset
= dib8096p_tuner_sleep
,
1857 .sleep
= dib8096p_tuner_sleep
,
1859 .freq_offset_khz_uhf
= -143,
1860 .freq_offset_khz_vhf
= -143,
1862 .get_adc_power
= dib8090_get_adc_power
,
1867 .wbd_vhf_offset
= 0,
1868 .wbd_cband_offset
= 0,
1872 .fref_clock_ratio
= 1,
1874 .wbd
= dib8096p_wbd_table
,
1876 .ls_cfg_pad_drv
= 0,
1880 .force_cband_input
= 0,
1883 struct dibx090p_adc
{
1884 u32 freq
; /* RF freq MHz */
1885 u32 timf
; /* New Timf */
1886 u32 pll_loopdiv
; /* New prediv */
1887 u32 pll_prediv
; /* New loopdiv */
1890 struct dibx090p_best_adc
{
1896 static int dib8096p_get_best_sampling(struct dvb_frontend
*fe
, struct dibx090p_best_adc
*adc
)
1898 u8 spur
= 0, prediv
= 0, loopdiv
= 0, min_prediv
= 1, max_prediv
= 1;
1900 u16 fcp_min
= 1900; /* PLL, Minimum Frequency of phase comparator (KHz) */
1901 u16 fcp_max
= 20000; /* PLL, Maximum Frequency of phase comparator (KHz) */
1902 u32 fmem_max
= 140000; /* 140MHz max SDRAM freq */
1903 u32 fdem_min
= 66000;
1904 u32 fcp
= 0, fs
= 0, fdem
= 0, fmem
= 0;
1905 u32 harmonic_id
= 0;
1908 adc
->pll_loopdiv
= loopdiv
;
1909 adc
->pll_prediv
= prediv
;
1911 deb_info("bandwidth = %d", fe
->dtv_property_cache
.bandwidth_hz
);
1913 /* Find Min and Max prediv */
1914 while ((xtal
/ max_prediv
) >= fcp_min
)
1918 min_prediv
= max_prediv
;
1919 while ((xtal
/ min_prediv
) <= fcp_max
) {
1921 if (min_prediv
== 1)
1924 deb_info("MIN prediv = %d : MAX prediv = %d", min_prediv
, max_prediv
);
1928 for (prediv
= min_prediv
; prediv
< max_prediv
; prediv
++) {
1929 fcp
= xtal
/ prediv
;
1930 if (fcp
> fcp_min
&& fcp
< fcp_max
) {
1931 for (loopdiv
= 1; loopdiv
< 64; loopdiv
++) {
1932 fmem
= ((xtal
/prediv
) * loopdiv
);
1936 /* test min/max system restrictions */
1937 if ((fdem
>= fdem_min
) && (fmem
<= fmem_max
) && (fs
>= fe
->dtv_property_cache
.bandwidth_hz
/ 1000)) {
1939 /* test fs harmonics positions */
1940 for (harmonic_id
= (fe
->dtv_property_cache
.frequency
/ (1000 * fs
)); harmonic_id
<= ((fe
->dtv_property_cache
.frequency
/ (1000 * fs
)) + 1); harmonic_id
++) {
1941 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)))) {
1948 adc
->pll_loopdiv
= loopdiv
;
1949 adc
->pll_prediv
= prediv
;
1950 adc
->timf
= (4260880253U / fdem
) * (1 << 8);
1951 adc
->timf
+= ((4260880253U % fdem
) << 8) / fdem
;
1953 deb_info("RF %6d; BW %6d; Xtal %6d; Fmem %6d; Fdem %6d; Fs %6d; Prediv %2d; Loopdiv %2d; Timf %8d;", fe
->dtv_property_cache
.frequency
, fe
->dtv_property_cache
.bandwidth_hz
, xtal
, fmem
, fdem
, fs
, prediv
, loopdiv
, adc
->timf
);
1963 if (adc
->pll_loopdiv
== 0 && adc
->pll_prediv
== 0)
1968 static int dib8096p_agc_startup(struct dvb_frontend
*fe
)
1970 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
1971 struct dib0700_adapter_state
*state
= adap
->priv
;
1972 struct dibx000_bandwidth_config pll
;
1973 struct dibx090p_best_adc adc
;
1977 ret
= state
->set_param_save(fe
);
1980 memset(&pll
, 0, sizeof(struct dibx000_bandwidth_config
));
1982 dib0090_pwm_gain_reset(fe
);
1983 /* dib0090_get_wbd_target is returning any possible
1984 temperature compensated wbd-target */
1985 target
= (dib0090_get_wbd_target(fe
) * 8 + 1) / 2;
1986 dib8000_set_wbd_ref(fe
, target
);
1988 if (dib8096p_get_best_sampling(fe
, &adc
) == 0) {
1989 pll
.pll_ratio
= adc
.pll_loopdiv
;
1990 pll
.pll_prediv
= adc
.pll_prediv
;
1992 dib0700_set_i2c_speed(adap
->dev
, 200);
1993 dib8000_update_pll(fe
, &pll
, fe
->dtv_property_cache
.bandwidth_hz
/ 1000, 0);
1994 dib8000_ctrl_timf(fe
, DEMOD_TIMF_SET
, adc
.timf
);
1995 dib0700_set_i2c_speed(adap
->dev
, 1000);
2000 static int tfe8096p_frontend_attach(struct dvb_usb_adapter
*adap
)
2002 struct dib0700_state
*st
= adap
->dev
->priv
;
2005 dib0700_get_version(adap
->dev
, NULL
, NULL
, &fw_version
, NULL
);
2006 if (fw_version
>= 0x10200)
2007 st
->fw_use_new_i2c_api
= 1;
2009 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
2011 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
2012 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
2013 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
2015 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
2017 dib0700_ctrl_clock(adap
->dev
, 72, 1);
2020 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
2022 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
2024 dib8000_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 0x10, 0x80, 1);
2026 adap
->fe_adap
[0].fe
= dvb_attach(dib8000_attach
,
2027 &adap
->dev
->i2c_adap
, 0x80, &tfe8096p_dib8000_config
);
2029 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
2032 static int tfe8096p_tuner_attach(struct dvb_usb_adapter
*adap
)
2034 struct dib0700_adapter_state
*st
= adap
->priv
;
2035 struct i2c_adapter
*tun_i2c
= dib8096p_get_i2c_tuner(adap
->fe_adap
[0].fe
);
2037 if (dvb_attach(dib0090_register
, adap
->fe_adap
[0].fe
, tun_i2c
,
2038 &tfe8096p_dib0090_config
) == NULL
)
2041 dib8000_set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 1);
2043 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
2044 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib8096p_agc_startup
;
2049 static int dib90x0_pid_filter(struct dvb_usb_adapter
*adapter
, int index
, u16 pid
, int onoff
)
2051 return dib9000_fw_pid_filter(adapter
->fe_adap
[0].fe
, index
, pid
, onoff
);
2054 static int dib90x0_pid_filter_ctrl(struct dvb_usb_adapter
*adapter
, int onoff
)
2056 return dib9000_fw_pid_filter_ctrl(adapter
->fe_adap
[0].fe
, onoff
);
2059 static int dib90x0_tuner_reset(struct dvb_frontend
*fe
, int onoff
)
2061 return dib9000_set_gpio(fe
, 5, 0, !onoff
);
2064 static int dib90x0_tuner_sleep(struct dvb_frontend
*fe
, int onoff
)
2066 return dib9000_set_gpio(fe
, 0, 0, onoff
);
2069 static int dib01x0_pmu_update(struct i2c_adapter
*i2c
, u16
*data
, u8 len
)
2071 u8 wb
[4] = { 0xc >> 8, 0xc & 0xff, 0, 0 };
2073 struct i2c_msg msg
[2] = {
2074 {.addr
= 0x1e >> 1, .flags
= 0, .buf
= wb
, .len
= 2},
2075 {.addr
= 0x1e >> 1, .flags
= I2C_M_RD
, .buf
= rb
, .len
= 2},
2079 dibx000_i2c_set_speed(i2c
, 250);
2081 if (i2c_transfer(i2c
, msg
, 2) != 2)
2084 switch (rb
[0] << 8 | rb
[1]) {
2086 deb_info("Found DiB0170 rev1: This version of DiB0170 is not supported any longer.\n");
2089 deb_info("Found DiB0170 rev2");
2092 deb_info("Found DiB0190 rev2");
2095 deb_info("DiB01x0 not found");
2099 for (index_data
= 0; index_data
< len
; index_data
+= 2) {
2100 wb
[2] = (data
[index_data
+ 1] >> 8) & 0xff;
2101 wb
[3] = (data
[index_data
+ 1]) & 0xff;
2103 if (data
[index_data
] == 0) {
2104 wb
[0] = (data
[index_data
] >> 8) & 0xff;
2105 wb
[1] = (data
[index_data
]) & 0xff;
2107 if (i2c_transfer(i2c
, msg
, 2) != 2)
2110 wb
[3] |= rb
[1] & ~(3 << 4);
2113 wb
[0] = (data
[index_data
] >> 8)&0xff;
2114 wb
[1] = (data
[index_data
])&0xff;
2116 if (i2c_transfer(i2c
, &msg
[0], 1) != 1)
2122 static struct dib9000_config stk9090m_config
= {
2123 .output_mpeg2_in_188_bytes
= 1,
2124 .output_mode
= OUTMODE_MPEG2_FIFO
,
2125 .vcxo_timer
= 279620,
2126 .timing_frequency
= 20452225,
2127 .demod_clock_khz
= 60000,
2128 .xtal_clock_khz
= 30000,
2129 .if_drives
= (0 << 15) | (1 << 13) | (0 << 12) | (3 << 10) | (0 << 9) | (1 << 7) | (0 << 6) | (0 << 4) | (1 << 3) | (1 << 1) | (0),
2133 { 240, { BOARD_GPIO_COMPONENT_DEMOD
, BOARD_GPIO_FUNCTION_SUBBAND_GPIO
, 0x0008, 0x0000, 0x0008 } }, /* GPIO 3 to 1 for VHF */
2134 { 890, { BOARD_GPIO_COMPONENT_DEMOD
, BOARD_GPIO_FUNCTION_SUBBAND_GPIO
, 0x0008, 0x0000, 0x0000 } }, /* GPIO 3 to 0 for UHF */
2139 { .component
= BOARD_GPIO_COMPONENT_DEMOD
, .function
= BOARD_GPIO_FUNCTION_COMPONENT_ON
, .mask
= 0x10 | 0x21, .direction
= 0 & ~0x21, .value
= (0x10 & ~0x1) | 0x20 },
2140 { .component
= BOARD_GPIO_COMPONENT_DEMOD
, .function
= BOARD_GPIO_FUNCTION_COMPONENT_OFF
, .mask
= 0x10 | 0x21, .direction
= 0 & ~0x21, .value
= 0 | 0x21 },
2144 static struct dib9000_config nim9090md_config
[2] = {
2146 .output_mpeg2_in_188_bytes
= 1,
2147 .output_mode
= OUTMODE_MPEG2_FIFO
,
2148 .vcxo_timer
= 279620,
2149 .timing_frequency
= 20452225,
2150 .demod_clock_khz
= 60000,
2151 .xtal_clock_khz
= 30000,
2152 .if_drives
= (0 << 15) | (1 << 13) | (0 << 12) | (3 << 10) | (0 << 9) | (1 << 7) | (0 << 6) | (0 << 4) | (1 << 3) | (1 << 1) | (0),
2154 .output_mpeg2_in_188_bytes
= 1,
2155 .output_mode
= OUTMODE_DIVERSITY
,
2156 .vcxo_timer
= 279620,
2157 .timing_frequency
= 20452225,
2158 .demod_clock_khz
= 60000,
2159 .xtal_clock_khz
= 30000,
2160 .if_drives
= (0 << 15) | (1 << 13) | (0 << 12) | (3 << 10) | (0 << 9) | (1 << 7) | (0 << 6) | (0 << 4) | (1 << 3) | (1 << 1) | (0),
2164 { 240, { BOARD_GPIO_COMPONENT_DEMOD
, BOARD_GPIO_FUNCTION_SUBBAND_GPIO
, 0x0006, 0x0000, 0x0006 } }, /* GPIO 1 and 2 to 1 for VHF */
2165 { 890, { BOARD_GPIO_COMPONENT_DEMOD
, BOARD_GPIO_FUNCTION_SUBBAND_GPIO
, 0x0006, 0x0000, 0x0000 } }, /* GPIO 1 and 2 to 0 for UHF */
2170 { .component
= BOARD_GPIO_COMPONENT_DEMOD
, .function
= BOARD_GPIO_FUNCTION_COMPONENT_ON
, .mask
= 0x10 | 0x21, .direction
= 0 & ~0x21, .value
= (0x10 & ~0x1) | 0x20 },
2171 { .component
= BOARD_GPIO_COMPONENT_DEMOD
, .function
= BOARD_GPIO_FUNCTION_COMPONENT_OFF
, .mask
= 0x10 | 0x21, .direction
= 0 & ~0x21, .value
= 0 | 0x21 },
2176 static struct dib0090_config dib9090_dib0090_config
= {
2180 .io
.pll_loopdiv
= 8,
2181 .io
.adc_clock_ratio
= 8,
2182 .io
.pll_int_loop_filt
= 0,
2183 .io
.clock_khz
= 30000,
2184 .reset
= dib90x0_tuner_reset
,
2185 .sleep
= dib90x0_tuner_sleep
,
2190 .freq_offset_khz_uhf
= 0,
2191 .freq_offset_khz_vhf
= 0,
2194 static struct dib0090_config nim9090md_dib0090_config
[2] = {
2199 .io
.pll_loopdiv
= 8,
2200 .io
.adc_clock_ratio
= 8,
2201 .io
.pll_int_loop_filt
= 0,
2202 .io
.clock_khz
= 30000,
2203 .reset
= dib90x0_tuner_reset
,
2204 .sleep
= dib90x0_tuner_sleep
,
2209 .freq_offset_khz_uhf
= 0,
2210 .freq_offset_khz_vhf
= 0,
2215 .io
.pll_loopdiv
= 8,
2216 .io
.adc_clock_ratio
= 8,
2217 .io
.pll_int_loop_filt
= 0,
2218 .io
.clock_khz
= 30000,
2219 .reset
= dib90x0_tuner_reset
,
2220 .sleep
= dib90x0_tuner_sleep
,
2225 .freq_offset_khz_uhf
= 0,
2226 .freq_offset_khz_vhf
= 0,
2231 static int stk9090m_frontend_attach(struct dvb_usb_adapter
*adap
)
2233 struct dib0700_adapter_state
*state
= adap
->priv
;
2234 struct dib0700_state
*st
= adap
->dev
->priv
;
2237 /* Make use of the new i2c functions from FW 1.20 */
2238 dib0700_get_version(adap
->dev
, NULL
, NULL
, &fw_version
, NULL
);
2239 if (fw_version
>= 0x10200)
2240 st
->fw_use_new_i2c_api
= 1;
2241 dib0700_set_i2c_speed(adap
->dev
, 340);
2243 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
2245 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
2246 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
2247 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
2248 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
2250 dib0700_ctrl_clock(adap
->dev
, 72, 1);
2253 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
2255 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
2257 dib9000_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 0x10, 0x80);
2259 if (request_firmware(&state
->frontend_firmware
, "dib9090.fw", &adap
->dev
->udev
->dev
)) {
2260 deb_info("%s: Upload failed. (file not found?)\n", __func__
);
2263 deb_info("%s: firmware read %Zu bytes.\n", __func__
, state
->frontend_firmware
->size
);
2265 stk9090m_config
.microcode_B_fe_size
= state
->frontend_firmware
->size
;
2266 stk9090m_config
.microcode_B_fe_buffer
= state
->frontend_firmware
->data
;
2268 adap
->fe_adap
[0].fe
= dvb_attach(dib9000_attach
, &adap
->dev
->i2c_adap
, 0x80, &stk9090m_config
);
2270 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
2273 static int dib9090_tuner_attach(struct dvb_usb_adapter
*adap
)
2275 struct dib0700_adapter_state
*state
= adap
->priv
;
2276 struct i2c_adapter
*i2c
= dib9000_get_tuner_interface(adap
->fe_adap
[0].fe
);
2277 u16 data_dib190
[10] = {
2285 if (dvb_attach(dib0090_fw_register
, adap
->fe_adap
[0].fe
, i2c
, &dib9090_dib0090_config
) == NULL
)
2287 i2c
= dib9000_get_i2c_master(adap
->fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_GPIO_1_2
, 0);
2288 if (dib01x0_pmu_update(i2c
, data_dib190
, 10) != 0)
2290 dib0700_set_i2c_speed(adap
->dev
, 1500);
2291 if (dib9000_firmware_post_pll_init(adap
->fe_adap
[0].fe
) < 0)
2293 release_firmware(state
->frontend_firmware
);
2297 static int nim9090md_frontend_attach(struct dvb_usb_adapter
*adap
)
2299 struct dib0700_adapter_state
*state
= adap
->priv
;
2300 struct dib0700_state
*st
= adap
->dev
->priv
;
2301 struct i2c_adapter
*i2c
;
2302 struct dvb_frontend
*fe_slave
;
2305 /* Make use of the new i2c functions from FW 1.20 */
2306 dib0700_get_version(adap
->dev
, NULL
, NULL
, &fw_version
, NULL
);
2307 if (fw_version
>= 0x10200)
2308 st
->fw_use_new_i2c_api
= 1;
2309 dib0700_set_i2c_speed(adap
->dev
, 340);
2311 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
2313 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
2314 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
2315 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
2316 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
2318 dib0700_ctrl_clock(adap
->dev
, 72, 1);
2321 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
2323 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
2325 if (request_firmware(&state
->frontend_firmware
, "dib9090.fw", &adap
->dev
->udev
->dev
)) {
2326 deb_info("%s: Upload failed. (file not found?)\n", __func__
);
2329 deb_info("%s: firmware read %Zu bytes.\n", __func__
, state
->frontend_firmware
->size
);
2331 nim9090md_config
[0].microcode_B_fe_size
= state
->frontend_firmware
->size
;
2332 nim9090md_config
[0].microcode_B_fe_buffer
= state
->frontend_firmware
->data
;
2333 nim9090md_config
[1].microcode_B_fe_size
= state
->frontend_firmware
->size
;
2334 nim9090md_config
[1].microcode_B_fe_buffer
= state
->frontend_firmware
->data
;
2336 dib9000_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 0x20, 0x80);
2337 adap
->fe_adap
[0].fe
= dvb_attach(dib9000_attach
, &adap
->dev
->i2c_adap
, 0x80, &nim9090md_config
[0]);
2339 if (adap
->fe_adap
[0].fe
== NULL
)
2342 i2c
= dib9000_get_i2c_master(adap
->fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_GPIO_3_4
, 0);
2343 dib9000_i2c_enumeration(i2c
, 1, 0x12, 0x82);
2345 fe_slave
= dvb_attach(dib9000_attach
, i2c
, 0x82, &nim9090md_config
[1]);
2346 dib9000_set_slave_frontend(adap
->fe_adap
[0].fe
, fe_slave
);
2348 return fe_slave
== NULL
? -ENODEV
: 0;
2351 static int nim9090md_tuner_attach(struct dvb_usb_adapter
*adap
)
2353 struct dib0700_adapter_state
*state
= adap
->priv
;
2354 struct i2c_adapter
*i2c
;
2355 struct dvb_frontend
*fe_slave
;
2356 u16 data_dib190
[10] = {
2363 i2c
= dib9000_get_tuner_interface(adap
->fe_adap
[0].fe
);
2364 if (dvb_attach(dib0090_fw_register
, adap
->fe_adap
[0].fe
, i2c
, &nim9090md_dib0090_config
[0]) == NULL
)
2366 i2c
= dib9000_get_i2c_master(adap
->fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_GPIO_1_2
, 0);
2367 if (dib01x0_pmu_update(i2c
, data_dib190
, 10) < 0)
2370 dib0700_set_i2c_speed(adap
->dev
, 1500);
2371 if (dib9000_firmware_post_pll_init(adap
->fe_adap
[0].fe
) < 0)
2374 fe_slave
= dib9000_get_slave_frontend(adap
->fe_adap
[0].fe
, 1);
2375 if (fe_slave
!= NULL
) {
2376 i2c
= dib9000_get_component_bus_interface(adap
->fe_adap
[0].fe
);
2377 dib9000_set_i2c_adapter(fe_slave
, i2c
);
2379 i2c
= dib9000_get_tuner_interface(fe_slave
);
2380 if (dvb_attach(dib0090_fw_register
, fe_slave
, i2c
, &nim9090md_dib0090_config
[1]) == NULL
)
2382 fe_slave
->dvb
= adap
->fe_adap
[0].fe
->dvb
;
2383 dib9000_fw_set_component_bus_speed(adap
->fe_adap
[0].fe
, 1500);
2384 if (dib9000_firmware_post_pll_init(fe_slave
) < 0)
2387 release_firmware(state
->frontend_firmware
);
2393 static int dib7090p_get_best_sampling(struct dvb_frontend
*fe
, struct dibx090p_best_adc
*adc
)
2395 u8 spur
= 0, prediv
= 0, loopdiv
= 0, min_prediv
= 1, max_prediv
= 1;
2398 u32 fcp_min
= 1900; /* PLL Minimum Frequency comparator KHz */
2399 u32 fcp_max
= 20000; /* PLL Maximum Frequency comparator KHz */
2400 u32 fdem_max
= 76000;
2401 u32 fdem_min
= 69500;
2402 u32 fcp
= 0, fs
= 0, fdem
= 0;
2403 u32 harmonic_id
= 0;
2405 adc
->pll_loopdiv
= loopdiv
;
2406 adc
->pll_prediv
= prediv
;
2409 deb_info("bandwidth = %d fdem_min =%d", fe
->dtv_property_cache
.bandwidth_hz
, fdem_min
);
2411 /* Find Min and Max prediv */
2412 while ((xtal
/max_prediv
) >= fcp_min
)
2416 min_prediv
= max_prediv
;
2417 while ((xtal
/min_prediv
) <= fcp_max
) {
2419 if (min_prediv
== 1)
2422 deb_info("MIN prediv = %d : MAX prediv = %d", min_prediv
, max_prediv
);
2426 for (prediv
= min_prediv
; prediv
< max_prediv
; prediv
++) {
2427 fcp
= xtal
/ prediv
;
2428 if (fcp
> fcp_min
&& fcp
< fcp_max
) {
2429 for (loopdiv
= 1 ; loopdiv
< 64 ; loopdiv
++) {
2430 fdem
= ((xtal
/prediv
) * loopdiv
);
2432 /* test min/max system restrictions */
2434 if ((fdem
>= fdem_min
) && (fdem
<= fdem_max
) && (fs
>= fe
->dtv_property_cache
.bandwidth_hz
/1000)) {
2436 /* test fs harmonics positions */
2437 for (harmonic_id
= (fe
->dtv_property_cache
.frequency
/ (1000*fs
)) ; harmonic_id
<= ((fe
->dtv_property_cache
.frequency
/ (1000*fs
))+1) ; harmonic_id
++) {
2438 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)))) {
2445 adc
->pll_loopdiv
= loopdiv
;
2446 adc
->pll_prediv
= prediv
;
2447 adc
->timf
= 2396745143UL/fdem
*(1 << 9);
2448 adc
->timf
+= ((2396745143UL%fdem
) << 9)/fdem
;
2449 deb_info("loopdiv=%i prediv=%i timf=%i", loopdiv
, prediv
, adc
->timf
);
2460 if (adc
->pll_loopdiv
== 0 && adc
->pll_prediv
== 0)
2466 static int dib7090_agc_startup(struct dvb_frontend
*fe
)
2468 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
2469 struct dib0700_adapter_state
*state
= adap
->priv
;
2470 struct dibx000_bandwidth_config pll
;
2472 struct dibx090p_best_adc adc
;
2475 ret
= state
->set_param_save(fe
);
2479 memset(&pll
, 0, sizeof(struct dibx000_bandwidth_config
));
2480 dib0090_pwm_gain_reset(fe
);
2481 target
= (dib0090_get_wbd_target(fe
) * 8 + 1) / 2;
2482 dib7000p_set_wbd_ref(fe
, target
);
2484 if (dib7090p_get_best_sampling(fe
, &adc
) == 0) {
2485 pll
.pll_ratio
= adc
.pll_loopdiv
;
2486 pll
.pll_prediv
= adc
.pll_prediv
;
2488 dib7000p_update_pll(fe
, &pll
);
2489 dib7000p_ctrl_timf(fe
, DEMOD_TIMF_SET
, adc
.timf
);
2494 static int dib7090_agc_restart(struct dvb_frontend
*fe
, u8 restart
)
2496 deb_info("AGC restart callback: %d", restart
);
2497 if (restart
== 0) /* before AGC startup */
2498 dib0090_set_dc_servo(fe
, 1);
2502 static int tfe7790p_update_lna(struct dvb_frontend
*fe
, u16 agc_global
)
2504 deb_info("update LNA: agc global=%i", agc_global
);
2506 if (agc_global
< 25000) {
2507 dib7000p_set_gpio(fe
, 8, 0, 0);
2508 dib7000p_set_agc1_min(fe
, 0);
2510 dib7000p_set_gpio(fe
, 8, 0, 1);
2511 dib7000p_set_agc1_min(fe
, 32768);
2517 static struct dib0090_wbd_slope dib7090_wbd_table
[] = {
2518 { 380, 81, 850, 64, 540, 4},
2519 { 860, 51, 866, 21, 375, 4},
2520 {1700, 0, 250, 0, 100, 6},
2521 {2600, 0, 250, 0, 100, 6},
2522 { 0xFFFF, 0, 0, 0, 0, 0},
2525 static struct dibx000_agc_config dib7090_agc_config
[2] = {
2527 .band_caps
= BAND_UHF
,
2528 /* 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,
2529 * 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 */
2530 .setup
= (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
2533 .time_stabiliz
= 10,
2564 .perform_agc_softsplit
= 0,
2566 .band_caps
= BAND_FM
| BAND_VHF
| BAND_CBAND
,
2567 /* 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,
2568 * 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 */
2569 .setup
= (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
2572 .time_stabiliz
= 10,
2603 .perform_agc_softsplit
= 0,
2607 static struct dibx000_bandwidth_config dib7090_clock_config_12_mhz
= {
2611 (3 << 14) | (1 << 12) | (524 << 0),
2617 static struct dib7000p_config nim7090_dib7000p_config
= {
2618 .output_mpeg2_in_188_bytes
= 1,
2619 .hostbus_diversity
= 1,
2620 .tuner_is_baseband
= 1,
2621 .update_lna
= tfe7790p_update_lna
, /* GPIO used is the same as TFE7790 */
2623 .agc_config_count
= 2,
2624 .agc
= dib7090_agc_config
,
2626 .bw
= &dib7090_clock_config_12_mhz
,
2628 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
2629 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
2630 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
2634 .agc_control
= dib7090_agc_restart
,
2637 .disable_sample_and_hold
= 0,
2638 .enable_current_mirror
= 0,
2639 .diversity_delay
= 0,
2641 .output_mode
= OUTMODE_MPEG2_FIFO
,
2645 static int tfe7090p_pvr_update_lna(struct dvb_frontend
*fe
, u16 agc_global
)
2647 deb_info("TFE7090P-PVR update LNA: agc global=%i", agc_global
);
2648 if (agc_global
< 25000) {
2649 dib7000p_set_gpio(fe
, 5, 0, 0);
2650 dib7000p_set_agc1_min(fe
, 0);
2652 dib7000p_set_gpio(fe
, 5, 0, 1);
2653 dib7000p_set_agc1_min(fe
, 32768);
2659 static struct dib7000p_config tfe7090pvr_dib7000p_config
[2] = {
2661 .output_mpeg2_in_188_bytes
= 1,
2662 .hostbus_diversity
= 1,
2663 .tuner_is_baseband
= 1,
2664 .update_lna
= tfe7090p_pvr_update_lna
,
2666 .agc_config_count
= 2,
2667 .agc
= dib7090_agc_config
,
2669 .bw
= &dib7090_clock_config_12_mhz
,
2671 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
2672 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
2673 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
2677 .agc_control
= dib7090_agc_restart
,
2680 .disable_sample_and_hold
= 0,
2681 .enable_current_mirror
= 0,
2682 .diversity_delay
= 0,
2684 .output_mode
= OUTMODE_MPEG2_PAR_GATED_CLK
,
2685 .default_i2c_addr
= 0x90,
2688 .output_mpeg2_in_188_bytes
= 1,
2689 .hostbus_diversity
= 1,
2690 .tuner_is_baseband
= 1,
2691 .update_lna
= tfe7090p_pvr_update_lna
,
2693 .agc_config_count
= 2,
2694 .agc
= dib7090_agc_config
,
2696 .bw
= &dib7090_clock_config_12_mhz
,
2698 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
2699 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
2700 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
2704 .agc_control
= dib7090_agc_restart
,
2707 .disable_sample_and_hold
= 0,
2708 .enable_current_mirror
= 0,
2709 .diversity_delay
= 0,
2711 .output_mode
= OUTMODE_MPEG2_PAR_GATED_CLK
,
2712 .default_i2c_addr
= 0x92,
2717 static const struct dib0090_config nim7090_dib0090_config
= {
2718 .io
.clock_khz
= 12000,
2722 .io
.pll_loopdiv
= 6,
2723 .io
.adc_clock_ratio
= 0,
2724 .io
.pll_int_loop_filt
= 0,
2725 .reset
= dib7090_tuner_sleep
,
2726 .sleep
= dib7090_tuner_sleep
,
2728 .freq_offset_khz_uhf
= 0,
2729 .freq_offset_khz_vhf
= 0,
2731 .get_adc_power
= dib7090_get_adc_power
,
2736 .wbd_vhf_offset
= 0,
2737 .wbd_cband_offset
= 0,
2741 .fref_clock_ratio
= 0,
2743 .wbd
= dib7090_wbd_table
,
2745 .ls_cfg_pad_drv
= 0,
2751 static struct dib7000p_config tfe7790p_dib7000p_config
= {
2752 .output_mpeg2_in_188_bytes
= 1,
2753 .hostbus_diversity
= 1,
2754 .tuner_is_baseband
= 1,
2755 .update_lna
= tfe7790p_update_lna
,
2757 .agc_config_count
= 2,
2758 .agc
= dib7090_agc_config
,
2760 .bw
= &dib7090_clock_config_12_mhz
,
2762 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
2763 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
2764 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
2768 .agc_control
= dib7090_agc_restart
,
2771 .disable_sample_and_hold
= 0,
2772 .enable_current_mirror
= 0,
2773 .diversity_delay
= 0,
2775 .output_mode
= OUTMODE_MPEG2_PAR_GATED_CLK
,
2779 static const struct dib0090_config tfe7790p_dib0090_config
= {
2780 .io
.clock_khz
= 12000,
2784 .io
.pll_loopdiv
= 6,
2785 .io
.adc_clock_ratio
= 0,
2786 .io
.pll_int_loop_filt
= 0,
2787 .reset
= dib7090_tuner_sleep
,
2788 .sleep
= dib7090_tuner_sleep
,
2790 .freq_offset_khz_uhf
= 0,
2791 .freq_offset_khz_vhf
= 0,
2793 .get_adc_power
= dib7090_get_adc_power
,
2798 .wbd_vhf_offset
= 0,
2799 .wbd_cband_offset
= 0,
2803 .fref_clock_ratio
= 0,
2805 .wbd
= dib7090_wbd_table
,
2807 .ls_cfg_pad_drv
= 0,
2811 .force_cband_input
= 0,
2813 .force_crystal_mode
= 1,
2816 static const struct dib0090_config tfe7090pvr_dib0090_config
[2] = {
2818 .io
.clock_khz
= 12000,
2822 .io
.pll_loopdiv
= 6,
2823 .io
.adc_clock_ratio
= 0,
2824 .io
.pll_int_loop_filt
= 0,
2825 .reset
= dib7090_tuner_sleep
,
2826 .sleep
= dib7090_tuner_sleep
,
2828 .freq_offset_khz_uhf
= 50,
2829 .freq_offset_khz_vhf
= 70,
2831 .get_adc_power
= dib7090_get_adc_power
,
2836 .wbd_vhf_offset
= 0,
2837 .wbd_cband_offset
= 0,
2841 .fref_clock_ratio
= 0,
2843 .wbd
= dib7090_wbd_table
,
2845 .ls_cfg_pad_drv
= 0,
2850 .io
.clock_khz
= 12000,
2854 .io
.pll_loopdiv
= 6,
2855 .io
.adc_clock_ratio
= 0,
2856 .io
.pll_int_loop_filt
= 0,
2857 .reset
= dib7090_tuner_sleep
,
2858 .sleep
= dib7090_tuner_sleep
,
2860 .freq_offset_khz_uhf
= -50,
2861 .freq_offset_khz_vhf
= -70,
2863 .get_adc_power
= dib7090_get_adc_power
,
2868 .wbd_vhf_offset
= 0,
2869 .wbd_cband_offset
= 0,
2873 .fref_clock_ratio
= 0,
2875 .wbd
= dib7090_wbd_table
,
2877 .ls_cfg_pad_drv
= 0,
2884 static int nim7090_frontend_attach(struct dvb_usb_adapter
*adap
)
2886 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
2888 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
2889 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
2890 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
2891 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
2894 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
2896 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
2898 if (dib7000p_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 0x10, &nim7090_dib7000p_config
) != 0) {
2899 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", __func__
);
2902 adap
->fe_adap
[0].fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
, 0x80, &nim7090_dib7000p_config
);
2904 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
2907 static int nim7090_tuner_attach(struct dvb_usb_adapter
*adap
)
2909 struct dib0700_adapter_state
*st
= adap
->priv
;
2910 struct i2c_adapter
*tun_i2c
= dib7090_get_i2c_tuner(adap
->fe_adap
[0].fe
);
2912 if (dvb_attach(dib0090_register
, adap
->fe_adap
[0].fe
, tun_i2c
, &nim7090_dib0090_config
) == NULL
)
2915 dib7000p_set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 1);
2917 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
2918 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib7090_agc_startup
;
2922 static int tfe7090pvr_frontend0_attach(struct dvb_usb_adapter
*adap
)
2924 struct dib0700_state
*st
= adap
->dev
->priv
;
2926 /* The TFE7090 requires the dib0700 to not be in master mode */
2927 st
->disable_streaming_master_mode
= 1;
2929 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
2931 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
2932 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
2933 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
2934 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
2937 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
2939 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
2941 /* initialize IC 0 */
2942 if (dib7000p_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 0x20, &tfe7090pvr_dib7000p_config
[0]) != 0) {
2943 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", __func__
);
2947 dib0700_set_i2c_speed(adap
->dev
, 340);
2948 adap
->fe_adap
[0].fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
, 0x90, &tfe7090pvr_dib7000p_config
[0]);
2949 if (adap
->fe_adap
[0].fe
== NULL
)
2952 dib7090_slave_reset(adap
->fe_adap
[0].fe
);
2957 static int tfe7090pvr_frontend1_attach(struct dvb_usb_adapter
*adap
)
2959 struct i2c_adapter
*i2c
;
2961 if (adap
->dev
->adapter
[0].fe_adap
[0].fe
== NULL
) {
2962 err("the master dib7090 has to be initialized first");
2963 return -ENODEV
; /* the master device has not been initialized */
2966 i2c
= dib7000p_get_i2c_master(adap
->dev
->adapter
[0].fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_GPIO_6_7
, 1);
2967 if (dib7000p_i2c_enumeration(i2c
, 1, 0x10, &tfe7090pvr_dib7000p_config
[1]) != 0) {
2968 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", __func__
);
2972 adap
->fe_adap
[0].fe
= dvb_attach(dib7000p_attach
, i2c
, 0x92, &tfe7090pvr_dib7000p_config
[1]);
2973 dib0700_set_i2c_speed(adap
->dev
, 200);
2975 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
2978 static int tfe7090pvr_tuner0_attach(struct dvb_usb_adapter
*adap
)
2980 struct dib0700_adapter_state
*st
= adap
->priv
;
2981 struct i2c_adapter
*tun_i2c
= dib7090_get_i2c_tuner(adap
->fe_adap
[0].fe
);
2983 if (dvb_attach(dib0090_register
, adap
->fe_adap
[0].fe
, tun_i2c
, &tfe7090pvr_dib0090_config
[0]) == NULL
)
2986 dib7000p_set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 1);
2988 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
2989 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib7090_agc_startup
;
2993 static int tfe7090pvr_tuner1_attach(struct dvb_usb_adapter
*adap
)
2995 struct dib0700_adapter_state
*st
= adap
->priv
;
2996 struct i2c_adapter
*tun_i2c
= dib7090_get_i2c_tuner(adap
->fe_adap
[0].fe
);
2998 if (dvb_attach(dib0090_register
, adap
->fe_adap
[0].fe
, tun_i2c
, &tfe7090pvr_dib0090_config
[1]) == NULL
)
3001 dib7000p_set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 1);
3003 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
3004 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib7090_agc_startup
;
3008 static int tfe7790p_frontend_attach(struct dvb_usb_adapter
*adap
)
3010 struct dib0700_state
*st
= adap
->dev
->priv
;
3012 /* The TFE7790P requires the dib0700 to not be in master mode */
3013 st
->disable_streaming_master_mode
= 1;
3015 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
3017 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
3018 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
3019 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
3020 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
3022 dib0700_ctrl_clock(adap
->dev
, 72, 1);
3023 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
3025 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
3027 if (dib7000p_i2c_enumeration(&adap
->dev
->i2c_adap
,
3028 1, 0x10, &tfe7790p_dib7000p_config
) != 0) {
3029 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n",
3033 adap
->fe_adap
[0].fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
,
3034 0x80, &tfe7790p_dib7000p_config
);
3036 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
3039 static int tfe7790p_tuner_attach(struct dvb_usb_adapter
*adap
)
3041 struct dib0700_adapter_state
*st
= adap
->priv
;
3042 struct i2c_adapter
*tun_i2c
=
3043 dib7090_get_i2c_tuner(adap
->fe_adap
[0].fe
);
3045 if (dvb_attach(dib0090_register
, adap
->fe_adap
[0].fe
, tun_i2c
,
3046 &tfe7790p_dib0090_config
) == NULL
)
3049 dib7000p_set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 1);
3051 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
3052 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib7090_agc_startup
;
3057 static struct dib7000p_config stk7070pd_dib7000p_config
[2] = {
3059 .output_mpeg2_in_188_bytes
= 1,
3061 .agc_config_count
= 1,
3062 .agc
= &dib7070_agc_config
,
3063 .bw
= &dib7070_bw_config_12_mhz
,
3064 .tuner_is_baseband
= 1,
3067 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
3068 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
3069 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
3071 .hostbus_diversity
= 1,
3073 .output_mpeg2_in_188_bytes
= 1,
3075 .agc_config_count
= 1,
3076 .agc
= &dib7070_agc_config
,
3077 .bw
= &dib7070_bw_config_12_mhz
,
3078 .tuner_is_baseband
= 1,
3081 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
3082 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
3083 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
3085 .hostbus_diversity
= 1,
3089 static void stk7070pd_init(struct dvb_usb_device
*dev
)
3091 dib0700_set_gpio(dev
, GPIO6
, GPIO_OUT
, 1);
3093 dib0700_set_gpio(dev
, GPIO9
, GPIO_OUT
, 1);
3094 dib0700_set_gpio(dev
, GPIO4
, GPIO_OUT
, 1);
3095 dib0700_set_gpio(dev
, GPIO7
, GPIO_OUT
, 1);
3096 dib0700_set_gpio(dev
, GPIO10
, GPIO_OUT
, 0);
3098 dib0700_ctrl_clock(dev
, 72, 1);
3101 dib0700_set_gpio(dev
, GPIO10
, GPIO_OUT
, 1);
3104 static int stk7070pd_frontend_attach0(struct dvb_usb_adapter
*adap
)
3106 stk7070pd_init(adap
->dev
);
3109 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
3111 if (dib7000p_i2c_enumeration(&adap
->dev
->i2c_adap
, 2, 18,
3112 stk7070pd_dib7000p_config
) != 0) {
3113 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n",
3118 adap
->fe_adap
[0].fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
, 0x80, &stk7070pd_dib7000p_config
[0]);
3119 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
3122 static int stk7070pd_frontend_attach1(struct dvb_usb_adapter
*adap
)
3124 adap
->fe_adap
[0].fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
, 0x82, &stk7070pd_dib7000p_config
[1]);
3125 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
3128 static int novatd_read_status_override(struct dvb_frontend
*fe
,
3131 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
3132 struct dvb_usb_device
*dev
= adap
->dev
;
3133 struct dib0700_state
*state
= dev
->priv
;
3136 ret
= state
->read_status(fe
, stat
);
3139 dib0700_set_gpio(dev
, adap
->id
== 0 ? GPIO1
: GPIO0
, GPIO_OUT
,
3140 !!(*stat
& FE_HAS_LOCK
));
3145 static int novatd_sleep_override(struct dvb_frontend
* fe
)
3147 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
3148 struct dvb_usb_device
*dev
= adap
->dev
;
3149 struct dib0700_state
*state
= dev
->priv
;
3152 dib0700_set_gpio(dev
, adap
->id
== 0 ? GPIO1
: GPIO0
, GPIO_OUT
, 0);
3154 return state
->sleep(fe
);
3158 * novatd_frontend_attach - Nova-TD specific attach
3160 * Nova-TD has GPIO0, 1 and 2 for LEDs. So do not fiddle with them except for
3161 * information purposes.
3163 static int novatd_frontend_attach(struct dvb_usb_adapter
*adap
)
3165 struct dvb_usb_device
*dev
= adap
->dev
;
3166 struct dib0700_state
*st
= dev
->priv
;
3168 if (adap
->id
== 0) {
3169 stk7070pd_init(dev
);
3171 /* turn the power LED on, the other two off (just in case) */
3172 dib0700_set_gpio(dev
, GPIO0
, GPIO_OUT
, 0);
3173 dib0700_set_gpio(dev
, GPIO1
, GPIO_OUT
, 0);
3174 dib0700_set_gpio(dev
, GPIO2
, GPIO_OUT
, 1);
3176 if (dib7000p_i2c_enumeration(&dev
->i2c_adap
, 2, 18,
3177 stk7070pd_dib7000p_config
) != 0) {
3178 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n",
3184 adap
->fe_adap
[0].fe
= dvb_attach(dib7000p_attach
, &dev
->i2c_adap
,
3185 adap
->id
== 0 ? 0x80 : 0x82,
3186 &stk7070pd_dib7000p_config
[adap
->id
]);
3188 if (adap
->fe_adap
[0].fe
== NULL
)
3191 st
->read_status
= adap
->fe_adap
[0].fe
->ops
.read_status
;
3192 adap
->fe_adap
[0].fe
->ops
.read_status
= novatd_read_status_override
;
3193 st
->sleep
= adap
->fe_adap
[0].fe
->ops
.sleep
;
3194 adap
->fe_adap
[0].fe
->ops
.sleep
= novatd_sleep_override
;
3200 static struct s5h1411_config pinnacle_801e_config
= {
3201 .output_mode
= S5H1411_PARALLEL_OUTPUT
,
3202 .gpio
= S5H1411_GPIO_OFF
,
3203 .mpeg_timing
= S5H1411_MPEGTIMING_NONCONTINOUS_NONINVERTING_CLOCK
,
3204 .qam_if
= S5H1411_IF_44000
,
3205 .vsb_if
= S5H1411_IF_44000
,
3206 .inversion
= S5H1411_INVERSION_OFF
,
3207 .status_mode
= S5H1411_DEMODLOCKING
3210 /* Pinnacle PCTV HD Pro 801e GPIOs map:
3211 GPIO0 - currently unknown
3212 GPIO1 - xc5000 tuner reset
3213 GPIO2 - CX25843 sleep
3214 GPIO3 - currently unknown
3215 GPIO4 - currently unknown
3216 GPIO6 - currently unknown
3217 GPIO7 - currently unknown
3218 GPIO9 - currently unknown
3219 GPIO10 - CX25843 reset
3221 static int s5h1411_frontend_attach(struct dvb_usb_adapter
*adap
)
3223 struct dib0700_state
*st
= adap
->dev
->priv
;
3225 /* Make use of the new i2c functions from FW 1.20 */
3226 st
->fw_use_new_i2c_api
= 1;
3228 /* The s5h1411 requires the dib0700 to not be in master mode */
3229 st
->disable_streaming_master_mode
= 1;
3231 /* All msleep values taken from Windows USB trace */
3232 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 0);
3233 dib0700_set_gpio(adap
->dev
, GPIO3
, GPIO_OUT
, 0);
3234 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
3236 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
3238 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
3240 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
3241 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
3242 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
3243 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
3244 dib0700_set_gpio(adap
->dev
, GPIO2
, GPIO_OUT
, 0);
3247 /* Put the CX25843 to sleep for now since we're in digital mode */
3248 dib0700_set_gpio(adap
->dev
, GPIO2
, GPIO_OUT
, 1);
3250 /* GPIOs are initialized, do the attach */
3251 adap
->fe_adap
[0].fe
= dvb_attach(s5h1411_attach
, &pinnacle_801e_config
,
3252 &adap
->dev
->i2c_adap
);
3253 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
3256 static int dib0700_xc5000_tuner_callback(void *priv
, int component
,
3257 int command
, int arg
)
3259 struct dvb_usb_adapter
*adap
= priv
;
3261 if (command
== XC5000_TUNER_RESET
) {
3262 /* Reset the tuner */
3263 dib0700_set_gpio(adap
->dev
, GPIO1
, GPIO_OUT
, 0);
3265 dib0700_set_gpio(adap
->dev
, GPIO1
, GPIO_OUT
, 1);
3268 err("xc5000: unknown tuner callback command: %d\n", command
);
3275 static struct xc5000_config s5h1411_xc5000_tunerconfig
= {
3276 .i2c_address
= 0x64,
3280 static int xc5000_tuner_attach(struct dvb_usb_adapter
*adap
)
3282 /* FIXME: generalize & move to common area */
3283 adap
->fe_adap
[0].fe
->callback
= dib0700_xc5000_tuner_callback
;
3285 return dvb_attach(xc5000_attach
, adap
->fe_adap
[0].fe
, &adap
->dev
->i2c_adap
,
3286 &s5h1411_xc5000_tunerconfig
)
3287 == NULL
? -ENODEV
: 0;
3290 static int dib0700_xc4000_tuner_callback(void *priv
, int component
,
3291 int command
, int arg
)
3293 struct dvb_usb_adapter
*adap
= priv
;
3295 if (command
== XC4000_TUNER_RESET
) {
3296 /* Reset the tuner */
3297 dib7000p_set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 0);
3299 dib7000p_set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 1);
3301 err("xc4000: unknown tuner callback command: %d\n", command
);
3308 static struct dibx000_agc_config stk7700p_7000p_xc4000_agc_config
= {
3309 .band_caps
= BAND_UHF
| BAND_VHF
,
3312 .time_stabiliz
= 0x15,
3313 .alpha_level
= 0x00,
3326 .agc1_slope1
= 0x00,
3327 .agc1_slope2
= 0x00,
3330 .agc2_slope1
= 0x1d,
3331 .agc2_slope2
= 0x1d,
3336 .perform_agc_softsplit
= 0x00,
3339 static struct dibx000_bandwidth_config stk7700p_xc4000_pll_config
= {
3340 60000, 30000, /* internal, sampling */
3341 1, 8, 3, 1, 0, /* pll_cfg: prediv, ratio, range, reset, bypass */
3342 0, 0, 1, 1, 0, /* misc: refdiv, bypclk_div, IO_CLK_en_core, */
3343 /* ADClkSrc, modulo */
3344 (3 << 14) | (1 << 12) | 524, /* sad_cfg: refsel, sel, freq_15k */
3345 39370534, /* ifreq */
3346 20452225, /* timf */
3350 /* FIXME: none of these inputs are validated yet */
3351 static struct dib7000p_config pctv_340e_config
= {
3352 .output_mpeg2_in_188_bytes
= 1,
3354 .agc_config_count
= 1,
3355 .agc
= &stk7700p_7000p_xc4000_agc_config
,
3356 .bw
= &stk7700p_xc4000_pll_config
,
3358 .gpio_dir
= DIB7000M_GPIO_DEFAULT_DIRECTIONS
,
3359 .gpio_val
= DIB7000M_GPIO_DEFAULT_VALUES
,
3360 .gpio_pwm_pos
= DIB7000M_GPIO_DEFAULT_PWM_POS
,
3363 /* PCTV 340e GPIOs map:
3365 GPIO2 - CX25843 sleep
3366 GPIO3 - CS5340 reset
3368 GPIO6 - Power Supply
3369 GPIO8 - LNA (1=off 0=on)
3370 GPIO10 - CX25843 reset
3372 GPIO8 - xc4000 reset
3374 static int pctv340e_frontend_attach(struct dvb_usb_adapter
*adap
)
3376 struct dib0700_state
*st
= adap
->dev
->priv
;
3378 /* Power Supply on */
3379 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0);
3381 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
3382 msleep(100); /* Allow power supply to settle before probing */
3385 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
3386 msleep(1); /* cx25843 datasheet say 350us required */
3387 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
3389 /* LNA off for now */
3390 dib0700_set_gpio(adap
->dev
, GPIO8
, GPIO_OUT
, 1);
3392 /* Put the CX25843 to sleep for now since we're in digital mode */
3393 dib0700_set_gpio(adap
->dev
, GPIO2
, GPIO_OUT
, 1);
3395 /* FIXME: not verified yet */
3396 dib0700_ctrl_clock(adap
->dev
, 72, 1);
3400 if (dib7000pc_detection(&adap
->dev
->i2c_adap
) == 0) {
3401 /* Demodulator not found for some reason? */
3405 adap
->fe_adap
[0].fe
= dvb_attach(dib7000p_attach
, &adap
->dev
->i2c_adap
, 0x12,
3407 st
->is_dib7000pc
= 1;
3409 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
3412 static struct xc4000_config dib7000p_xc4000_tunerconfig
= {
3413 .i2c_address
= 0x61,
3416 .set_smoothedcvbs
= 0,
3420 static int xc4000_tuner_attach(struct dvb_usb_adapter
*adap
)
3422 struct i2c_adapter
*tun_i2c
;
3424 /* The xc4000 is not on the main i2c bus */
3425 tun_i2c
= dib7000p_get_i2c_master(adap
->fe_adap
[0].fe
,
3426 DIBX000_I2C_INTERFACE_TUNER
, 1);
3427 if (tun_i2c
== NULL
) {
3428 printk(KERN_ERR
"Could not reach tuner i2c bus\n");
3432 /* Setup the reset callback */
3433 adap
->fe_adap
[0].fe
->callback
= dib0700_xc4000_tuner_callback
;
3435 return dvb_attach(xc4000_attach
, adap
->fe_adap
[0].fe
, tun_i2c
,
3436 &dib7000p_xc4000_tunerconfig
)
3437 == NULL
? -ENODEV
: 0;
3440 static struct lgdt3305_config hcw_lgdt3305_config
= {
3442 .mpeg_mode
= LGDT3305_MPEG_PARALLEL
,
3443 .tpclk_edge
= LGDT3305_TPCLK_FALLING_EDGE
,
3444 .tpvalid_polarity
= LGDT3305_TP_VALID_LOW
,
3446 .spectral_inversion
= 1,
3449 .usref_8vsb
= 0x0500,
3452 static struct mxl5007t_config hcw_mxl5007t_config
= {
3453 .xtal_freq_hz
= MxL_XTAL_25_MHZ
,
3454 .if_freq_hz
= MxL_IF_6_MHZ
,
3459 GPIO0 - LNA_CTR (H: LNA power enabled, L: LNA power disabled)
3460 GPIO1 - ANT_SEL (H: VPA, L: MCX)
3466 MXL is behind LG's i2c repeater. LG is on SCL2/SDA2 gpios on the DIB
3468 static int lgdt3305_frontend_attach(struct dvb_usb_adapter
*adap
)
3470 struct dib0700_state
*st
= adap
->dev
->priv
;
3472 /* Make use of the new i2c functions from FW 1.20 */
3473 st
->fw_use_new_i2c_api
= 1;
3475 st
->disable_streaming_master_mode
= 1;
3477 /* fe power enable */
3478 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0);
3480 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
3484 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
3486 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
3488 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
3491 adap
->fe_adap
[0].fe
= dvb_attach(lgdt3305_attach
,
3492 &hcw_lgdt3305_config
,
3493 &adap
->dev
->i2c_adap
);
3495 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
3498 static int mxl5007t_tuner_attach(struct dvb_usb_adapter
*adap
)
3500 return dvb_attach(mxl5007t_attach
, adap
->fe_adap
[0].fe
,
3501 &adap
->dev
->i2c_adap
, 0x60,
3502 &hcw_mxl5007t_config
) == NULL
? -ENODEV
: 0;
3506 /* DVB-USB and USB stuff follows */
3507 struct usb_device_id dib0700_usb_id_table
[] = {
3508 /* 0 */ { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK7700P
) },
3509 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK7700P_PC
) },
3510 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_T_500
) },
3511 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_T_500_2
) },
3512 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_T_STICK
) },
3513 /* 5 */ { USB_DEVICE(USB_VID_AVERMEDIA
, USB_PID_AVERMEDIA_VOLAR
) },
3514 { USB_DEVICE(USB_VID_COMPRO
, USB_PID_COMPRO_VIDEOMATE_U500
) },
3515 { USB_DEVICE(USB_VID_UNIWILL
, USB_PID_UNIWILL_STK7700P
) },
3516 { USB_DEVICE(USB_VID_LEADTEK
, USB_PID_WINFAST_DTV_DONGLE_STK7700P
) },
3517 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_T_STICK_2
) },
3518 /* 10 */{ USB_DEVICE(USB_VID_AVERMEDIA
, USB_PID_AVERMEDIA_VOLAR_2
) },
3519 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV2000E
) },
3520 { USB_DEVICE(USB_VID_TERRATEC
,
3521 USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY
) },
3522 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_TD_STICK
) },
3523 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK7700D
) },
3524 /* 15 */{ USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK7070P
) },
3525 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV_DVB_T_FLASH
) },
3526 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK7070PD
) },
3527 { USB_DEVICE(USB_VID_PINNACLE
,
3528 USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T
) },
3529 { USB_DEVICE(USB_VID_COMPRO
, USB_PID_COMPRO_VIDEOMATE_U500_PC
) },
3530 /* 20 */{ USB_DEVICE(USB_VID_AVERMEDIA
, USB_PID_AVERMEDIA_EXPRESS
) },
3531 { USB_DEVICE(USB_VID_GIGABYTE
, USB_PID_GIGABYTE_U7000
) },
3532 { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC
, USB_PID_ARTEC_T14BR
) },
3533 { USB_DEVICE(USB_VID_ASUS
, USB_PID_ASUS_U3000
) },
3534 { USB_DEVICE(USB_VID_ASUS
, USB_PID_ASUS_U3100
) },
3535 /* 25 */{ USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_T_STICK_3
) },
3536 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_MYTV_T
) },
3537 { USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_CINERGY_HT_USB_XE
) },
3538 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_EXPRESSCARD_320CX
) },
3539 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV72E
) },
3540 /* 30 */{ USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV73E
) },
3541 { USB_DEVICE(USB_VID_YUAN
, USB_PID_YUAN_EC372S
) },
3542 { USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_CINERGY_HT_EXPRESS
) },
3543 { USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_CINERGY_T_XXS
) },
3544 { USB_DEVICE(USB_VID_LEADTEK
, USB_PID_WINFAST_DTV_DONGLE_STK7700P_2
) },
3545 /* 35 */{ USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_TD_STICK_52009
) },
3546 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_T_500_3
) },
3547 { USB_DEVICE(USB_VID_GIGABYTE
, USB_PID_GIGABYTE_U8000
) },
3548 { USB_DEVICE(USB_VID_YUAN
, USB_PID_YUAN_STK7700PH
) },
3549 { USB_DEVICE(USB_VID_ASUS
, USB_PID_ASUS_U3000H
) },
3550 /* 40 */{ USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV801E
) },
3551 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV801E_SE
) },
3552 { USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_CINERGY_T_EXPRESS
) },
3553 { USB_DEVICE(USB_VID_TERRATEC
,
3554 USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY_2
) },
3555 { USB_DEVICE(USB_VID_SONY
, USB_PID_SONY_PLAYTV
) },
3556 /* 45 */{ USB_DEVICE(USB_VID_YUAN
, USB_PID_YUAN_PD378S
) },
3557 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_TIGER_ATSC
) },
3558 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_TIGER_ATSC_B210
) },
3559 { USB_DEVICE(USB_VID_YUAN
, USB_PID_YUAN_MC770
) },
3560 { USB_DEVICE(USB_VID_ELGATO
, USB_PID_ELGATO_EYETV_DTT
) },
3561 /* 50 */{ USB_DEVICE(USB_VID_ELGATO
, USB_PID_ELGATO_EYETV_DTT_Dlx
) },
3562 { USB_DEVICE(USB_VID_LEADTEK
, USB_PID_WINFAST_DTV_DONGLE_H
) },
3563 { USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_T3
) },
3564 { USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_T5
) },
3565 { USB_DEVICE(USB_VID_YUAN
, USB_PID_YUAN_STK7700D
) },
3566 /* 55 */{ USB_DEVICE(USB_VID_YUAN
, USB_PID_YUAN_STK7700D_2
) },
3567 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV73A
) },
3568 { USB_DEVICE(USB_VID_PCTV
, USB_PID_PINNACLE_PCTV73ESE
) },
3569 { USB_DEVICE(USB_VID_PCTV
, USB_PID_PINNACLE_PCTV282E
) },
3570 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK7770P
) },
3571 /* 60 */{ USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_CINERGY_T_XXS_2
) },
3572 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK807XPVR
) },
3573 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK807XP
) },
3574 { USB_DEVICE_VER(USB_VID_PIXELVIEW
, USB_PID_PIXELVIEW_SBTVD
, 0x000, 0x3f00) },
3575 { USB_DEVICE(USB_VID_EVOLUTEPC
, USB_PID_TVWAY_PLUS
) },
3576 /* 65 */{ USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV73ESE
) },
3577 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV282E
) },
3578 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK8096GP
) },
3579 { USB_DEVICE(USB_VID_ELGATO
, USB_PID_ELGATO_EYETV_DIVERSITY
) },
3580 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_NIM9090M
) },
3581 /* 70 */{ USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_NIM8096MD
) },
3582 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_NIM9090MD
) },
3583 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_NIM7090
) },
3584 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_TFE7090PVR
) },
3585 { USB_DEVICE(USB_VID_TECHNISAT
, USB_PID_TECHNISAT_AIRSTAR_TELESTICK_2
) },
3586 /* 75 */{ USB_DEVICE(USB_VID_MEDION
, USB_PID_CREATIX_CTX1921
) },
3587 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV340E
) },
3588 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV340E_SE
) },
3589 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_TFE7790P
) },
3590 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_TFE8096P
) },
3591 /* 80 */{ USB_DEVICE(USB_VID_ELGATO
, USB_PID_ELGATO_EYETV_DTT_2
) },
3592 { 0 } /* Terminating entry */
3594 MODULE_DEVICE_TABLE(usb
, dib0700_usb_id_table
);
3596 #define DIB0700_DEFAULT_DEVICE_PROPERTIES \
3597 .caps = DVB_USB_IS_AN_I2C_ADAPTER, \
3598 .usb_ctrl = DEVICE_SPECIFIC, \
3599 .firmware = "dvb-usb-dib0700-1.20.fw", \
3600 .download_firmware = dib0700_download_firmware, \
3601 .no_reconnect = 1, \
3602 .size_of_priv = sizeof(struct dib0700_state), \
3603 .i2c_algo = &dib0700_i2c_algo, \
3604 .identify_state = dib0700_identify_state
3606 #define DIB0700_DEFAULT_STREAMING_CONFIG(ep) \
3607 .streaming_ctrl = dib0700_streaming_ctrl, \
3614 .buffersize = 39480, \
3619 struct dvb_usb_device_properties dib0700_devices
[] = {
3621 DIB0700_DEFAULT_DEVICE_PROPERTIES
,
3628 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
3629 .pid_filter_count
= 32,
3630 .pid_filter
= stk7700p_pid_filter
,
3631 .pid_filter_ctrl
= stk7700p_pid_filter_ctrl
,
3632 .frontend_attach
= stk7700p_frontend_attach
,
3633 .tuner_attach
= stk7700p_tuner_attach
,
3635 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
3640 .num_device_descs
= 8,
3642 { "DiBcom STK7700P reference design",
3643 { &dib0700_usb_id_table
[0], &dib0700_usb_id_table
[1] },
3646 { "Hauppauge Nova-T Stick",
3647 { &dib0700_usb_id_table
[4], &dib0700_usb_id_table
[9], NULL
},
3650 { "AVerMedia AVerTV DVB-T Volar",
3651 { &dib0700_usb_id_table
[5], &dib0700_usb_id_table
[10] },
3654 { "Compro Videomate U500",
3655 { &dib0700_usb_id_table
[6], &dib0700_usb_id_table
[19] },
3658 { "Uniwill STK7700P based (Hama and others)",
3659 { &dib0700_usb_id_table
[7], NULL
},
3662 { "Leadtek Winfast DTV Dongle (STK7700P based)",
3663 { &dib0700_usb_id_table
[8], &dib0700_usb_id_table
[34] },
3666 { "AVerMedia AVerTV DVB-T Express",
3667 { &dib0700_usb_id_table
[20] },
3671 { &dib0700_usb_id_table
[21], NULL
},
3677 .rc_interval
= DEFAULT_RC_INTERVAL
,
3678 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
3679 .rc_query
= dib0700_rc_query_old_firmware
,
3680 .allowed_protos
= RC_BIT_RC5
|
3683 .change_protocol
= dib0700_change_protocol
,
3685 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
3692 .frontend_attach
= bristol_frontend_attach
,
3693 .tuner_attach
= bristol_tuner_attach
,
3695 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
3700 .frontend_attach
= bristol_frontend_attach
,
3701 .tuner_attach
= bristol_tuner_attach
,
3703 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
3708 .num_device_descs
= 1,
3710 { "Hauppauge Nova-T 500 Dual DVB-T",
3711 { &dib0700_usb_id_table
[2], &dib0700_usb_id_table
[3], NULL
},
3717 .rc_interval
= DEFAULT_RC_INTERVAL
,
3718 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
3719 .rc_query
= dib0700_rc_query_old_firmware
,
3720 .allowed_protos
= RC_BIT_RC5
|
3723 .change_protocol
= dib0700_change_protocol
,
3725 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
3732 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
3733 .pid_filter_count
= 32,
3734 .pid_filter
= stk70x0p_pid_filter
,
3735 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
3736 .frontend_attach
= stk7700d_frontend_attach
,
3737 .tuner_attach
= stk7700d_tuner_attach
,
3739 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
3744 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
3745 .pid_filter_count
= 32,
3746 .pid_filter
= stk70x0p_pid_filter
,
3747 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
3748 .frontend_attach
= stk7700d_frontend_attach
,
3749 .tuner_attach
= stk7700d_tuner_attach
,
3751 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
3756 .num_device_descs
= 5,
3758 { "Pinnacle PCTV 2000e",
3759 { &dib0700_usb_id_table
[11], NULL
},
3762 { "Terratec Cinergy DT XS Diversity",
3763 { &dib0700_usb_id_table
[12], NULL
},
3766 { "Hauppauge Nova-TD Stick/Elgato Eye-TV Diversity",
3767 { &dib0700_usb_id_table
[13], NULL
},
3770 { "DiBcom STK7700D reference design",
3771 { &dib0700_usb_id_table
[14], NULL
},
3774 { "YUAN High-Tech DiBcom STK7700D",
3775 { &dib0700_usb_id_table
[55], NULL
},
3782 .rc_interval
= DEFAULT_RC_INTERVAL
,
3783 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
3784 .rc_query
= dib0700_rc_query_old_firmware
,
3785 .allowed_protos
= RC_BIT_RC5
|
3788 .change_protocol
= dib0700_change_protocol
,
3790 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
3797 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
3798 .pid_filter_count
= 32,
3799 .pid_filter
= stk70x0p_pid_filter
,
3800 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
3801 .frontend_attach
= stk7700P2_frontend_attach
,
3802 .tuner_attach
= stk7700d_tuner_attach
,
3804 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
3809 .num_device_descs
= 3,
3811 { "ASUS My Cinema U3000 Mini DVBT Tuner",
3812 { &dib0700_usb_id_table
[23], NULL
},
3816 { &dib0700_usb_id_table
[31], NULL
},
3819 { "Terratec Cinergy T Express",
3820 { &dib0700_usb_id_table
[42], NULL
},
3826 .rc_interval
= DEFAULT_RC_INTERVAL
,
3827 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
3828 .module_name
= "dib0700",
3829 .rc_query
= dib0700_rc_query_old_firmware
,
3830 .allowed_protos
= RC_BIT_RC5
|
3833 .change_protocol
= dib0700_change_protocol
,
3835 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
3842 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
3843 .pid_filter_count
= 32,
3844 .pid_filter
= stk70x0p_pid_filter
,
3845 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
3846 .frontend_attach
= stk7070p_frontend_attach
,
3847 .tuner_attach
= dib7070p_tuner_attach
,
3849 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
3851 .size_of_priv
= sizeof(struct dib0700_adapter_state
),
3855 .num_device_descs
= 12,
3857 { "DiBcom STK7070P reference design",
3858 { &dib0700_usb_id_table
[15], NULL
},
3861 { "Pinnacle PCTV DVB-T Flash Stick",
3862 { &dib0700_usb_id_table
[16], NULL
},
3865 { "Artec T14BR DVB-T",
3866 { &dib0700_usb_id_table
[22], NULL
},
3869 { "ASUS My Cinema U3100 Mini DVBT Tuner",
3870 { &dib0700_usb_id_table
[24], NULL
},
3873 { "Hauppauge Nova-T Stick",
3874 { &dib0700_usb_id_table
[25], NULL
},
3877 { "Hauppauge Nova-T MyTV.t",
3878 { &dib0700_usb_id_table
[26], NULL
},
3881 { "Pinnacle PCTV 72e",
3882 { &dib0700_usb_id_table
[29], NULL
},
3885 { "Pinnacle PCTV 73e",
3886 { &dib0700_usb_id_table
[30], NULL
},
3889 { "Elgato EyeTV DTT",
3890 { &dib0700_usb_id_table
[49], NULL
},
3894 { &dib0700_usb_id_table
[45], NULL
},
3897 { "Elgato EyeTV Dtt Dlx PD378S",
3898 { &dib0700_usb_id_table
[50], NULL
},
3901 { "Elgato EyeTV DTT rev. 2",
3902 { &dib0700_usb_id_table
[80], NULL
},
3908 .rc_interval
= DEFAULT_RC_INTERVAL
,
3909 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
3910 .module_name
= "dib0700",
3911 .rc_query
= dib0700_rc_query_old_firmware
,
3912 .allowed_protos
= RC_BIT_RC5
|
3915 .change_protocol
= dib0700_change_protocol
,
3917 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
3924 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
3925 .pid_filter_count
= 32,
3926 .pid_filter
= stk70x0p_pid_filter
,
3927 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
3928 .frontend_attach
= stk7070p_frontend_attach
,
3929 .tuner_attach
= dib7070p_tuner_attach
,
3931 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
3933 .size_of_priv
= sizeof(struct dib0700_adapter_state
),
3937 .num_device_descs
= 3,
3939 { "Pinnacle PCTV 73A",
3940 { &dib0700_usb_id_table
[56], NULL
},
3943 { "Pinnacle PCTV 73e SE",
3944 { &dib0700_usb_id_table
[57], &dib0700_usb_id_table
[65], NULL
},
3947 { "Pinnacle PCTV 282e",
3948 { &dib0700_usb_id_table
[58], &dib0700_usb_id_table
[66], NULL
},
3954 .rc_interval
= DEFAULT_RC_INTERVAL
,
3955 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
3956 .module_name
= "dib0700",
3957 .rc_query
= dib0700_rc_query_old_firmware
,
3958 .allowed_protos
= RC_BIT_RC5
|
3961 .change_protocol
= dib0700_change_protocol
,
3963 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
3970 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
3971 .pid_filter_count
= 32,
3972 .pid_filter
= stk70x0p_pid_filter
,
3973 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
3974 .frontend_attach
= novatd_frontend_attach
,
3975 .tuner_attach
= dib7070p_tuner_attach
,
3977 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
3979 .size_of_priv
= sizeof(struct dib0700_adapter_state
),
3983 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
3984 .pid_filter_count
= 32,
3985 .pid_filter
= stk70x0p_pid_filter
,
3986 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
3987 .frontend_attach
= novatd_frontend_attach
,
3988 .tuner_attach
= dib7070p_tuner_attach
,
3990 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
3992 .size_of_priv
= sizeof(struct dib0700_adapter_state
),
3996 .num_device_descs
= 1,
3998 { "Hauppauge Nova-TD Stick (52009)",
3999 { &dib0700_usb_id_table
[35], NULL
},
4005 .rc_interval
= DEFAULT_RC_INTERVAL
,
4006 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4007 .module_name
= "dib0700",
4008 .rc_query
= dib0700_rc_query_old_firmware
,
4009 .allowed_protos
= RC_BIT_RC5
|
4012 .change_protocol
= dib0700_change_protocol
,
4014 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4021 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4022 .pid_filter_count
= 32,
4023 .pid_filter
= stk70x0p_pid_filter
,
4024 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4025 .frontend_attach
= stk7070pd_frontend_attach0
,
4026 .tuner_attach
= dib7070p_tuner_attach
,
4028 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4030 .size_of_priv
= sizeof(struct dib0700_adapter_state
),
4034 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4035 .pid_filter_count
= 32,
4036 .pid_filter
= stk70x0p_pid_filter
,
4037 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4038 .frontend_attach
= stk7070pd_frontend_attach1
,
4039 .tuner_attach
= dib7070p_tuner_attach
,
4041 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
4043 .size_of_priv
= sizeof(struct dib0700_adapter_state
),
4047 .num_device_descs
= 5,
4049 { "DiBcom STK7070PD reference design",
4050 { &dib0700_usb_id_table
[17], NULL
},
4053 { "Pinnacle PCTV Dual DVB-T Diversity Stick",
4054 { &dib0700_usb_id_table
[18], NULL
},
4057 { "Hauppauge Nova-TD-500 (84xxx)",
4058 { &dib0700_usb_id_table
[36], NULL
},
4061 { "Terratec Cinergy DT USB XS Diversity/ T5",
4062 { &dib0700_usb_id_table
[43],
4063 &dib0700_usb_id_table
[53], NULL
},
4067 { &dib0700_usb_id_table
[44], NULL
},
4073 .rc_interval
= DEFAULT_RC_INTERVAL
,
4074 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4075 .module_name
= "dib0700",
4076 .rc_query
= dib0700_rc_query_old_firmware
,
4077 .allowed_protos
= RC_BIT_RC5
|
4080 .change_protocol
= dib0700_change_protocol
,
4082 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4089 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4090 .pid_filter_count
= 32,
4091 .pid_filter
= stk70x0p_pid_filter
,
4092 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4093 .frontend_attach
= stk7070pd_frontend_attach0
,
4094 .tuner_attach
= dib7070p_tuner_attach
,
4096 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4098 .size_of_priv
= sizeof(struct dib0700_adapter_state
),
4102 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4103 .pid_filter_count
= 32,
4104 .pid_filter
= stk70x0p_pid_filter
,
4105 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4106 .frontend_attach
= stk7070pd_frontend_attach1
,
4107 .tuner_attach
= dib7070p_tuner_attach
,
4109 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
4111 .size_of_priv
= sizeof(struct dib0700_adapter_state
),
4115 .num_device_descs
= 1,
4117 { "Elgato EyeTV Diversity",
4118 { &dib0700_usb_id_table
[68], NULL
},
4124 .rc_interval
= DEFAULT_RC_INTERVAL
,
4125 .rc_codes
= RC_MAP_DIB0700_NEC_TABLE
,
4126 .module_name
= "dib0700",
4127 .rc_query
= dib0700_rc_query_old_firmware
,
4128 .allowed_protos
= RC_BIT_RC5
|
4131 .change_protocol
= dib0700_change_protocol
,
4133 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4140 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4141 .pid_filter_count
= 32,
4142 .pid_filter
= stk70x0p_pid_filter
,
4143 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4144 .frontend_attach
= stk7700ph_frontend_attach
,
4145 .tuner_attach
= stk7700ph_tuner_attach
,
4147 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4149 .size_of_priv
= sizeof(struct
4150 dib0700_adapter_state
),
4154 .num_device_descs
= 9,
4156 { "Terratec Cinergy HT USB XE",
4157 { &dib0700_usb_id_table
[27], NULL
},
4160 { "Pinnacle Expresscard 320cx",
4161 { &dib0700_usb_id_table
[28], NULL
},
4164 { "Terratec Cinergy HT Express",
4165 { &dib0700_usb_id_table
[32], NULL
},
4168 { "Gigabyte U8000-RH",
4169 { &dib0700_usb_id_table
[37], NULL
},
4172 { "YUAN High-Tech STK7700PH",
4173 { &dib0700_usb_id_table
[38], NULL
},
4176 { "Asus My Cinema-U3000Hybrid",
4177 { &dib0700_usb_id_table
[39], NULL
},
4180 { "YUAN High-Tech MC770",
4181 { &dib0700_usb_id_table
[48], NULL
},
4184 { "Leadtek WinFast DTV Dongle H",
4185 { &dib0700_usb_id_table
[51], NULL
},
4188 { "YUAN High-Tech STK7700D",
4189 { &dib0700_usb_id_table
[54], NULL
},
4195 .rc_interval
= DEFAULT_RC_INTERVAL
,
4196 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4197 .module_name
= "dib0700",
4198 .rc_query
= dib0700_rc_query_old_firmware
,
4199 .allowed_protos
= RC_BIT_RC5
|
4202 .change_protocol
= dib0700_change_protocol
,
4204 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4210 .frontend_attach
= s5h1411_frontend_attach
,
4211 .tuner_attach
= xc5000_tuner_attach
,
4213 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4215 .size_of_priv
= sizeof(struct
4216 dib0700_adapter_state
),
4220 .num_device_descs
= 2,
4222 { "Pinnacle PCTV HD Pro USB Stick",
4223 { &dib0700_usb_id_table
[40], NULL
},
4226 { "Pinnacle PCTV HD USB Stick",
4227 { &dib0700_usb_id_table
[41], NULL
},
4233 .rc_interval
= DEFAULT_RC_INTERVAL
,
4234 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4235 .module_name
= "dib0700",
4236 .rc_query
= dib0700_rc_query_old_firmware
,
4237 .allowed_protos
= RC_BIT_RC5
|
4240 .change_protocol
= dib0700_change_protocol
,
4242 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4248 .frontend_attach
= lgdt3305_frontend_attach
,
4249 .tuner_attach
= mxl5007t_tuner_attach
,
4251 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4253 .size_of_priv
= sizeof(struct
4254 dib0700_adapter_state
),
4258 .num_device_descs
= 2,
4260 { "Hauppauge ATSC MiniCard (B200)",
4261 { &dib0700_usb_id_table
[46], NULL
},
4264 { "Hauppauge ATSC MiniCard (B210)",
4265 { &dib0700_usb_id_table
[47], NULL
},
4269 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4276 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4277 .pid_filter_count
= 32,
4278 .pid_filter
= stk70x0p_pid_filter
,
4279 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4280 .frontend_attach
= stk7770p_frontend_attach
,
4281 .tuner_attach
= dib7770p_tuner_attach
,
4283 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4286 sizeof(struct dib0700_adapter_state
),
4290 .num_device_descs
= 4,
4292 { "DiBcom STK7770P reference design",
4293 { &dib0700_usb_id_table
[59], NULL
},
4296 { "Terratec Cinergy T USB XXS (HD)/ T3",
4297 { &dib0700_usb_id_table
[33],
4298 &dib0700_usb_id_table
[52],
4299 &dib0700_usb_id_table
[60], NULL
},
4302 { "TechniSat AirStar TeleStick 2",
4303 { &dib0700_usb_id_table
[74], NULL
},
4306 { "Medion CTX1921 DVB-T USB",
4307 { &dib0700_usb_id_table
[75], NULL
},
4313 .rc_interval
= DEFAULT_RC_INTERVAL
,
4314 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4315 .module_name
= "dib0700",
4316 .rc_query
= dib0700_rc_query_old_firmware
,
4317 .allowed_protos
= RC_BIT_RC5
|
4320 .change_protocol
= dib0700_change_protocol
,
4322 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4328 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4329 .pid_filter_count
= 32,
4330 .pid_filter
= stk80xx_pid_filter
,
4331 .pid_filter_ctrl
= stk80xx_pid_filter_ctrl
,
4332 .frontend_attach
= stk807x_frontend_attach
,
4333 .tuner_attach
= dib807x_tuner_attach
,
4335 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4338 sizeof(struct dib0700_adapter_state
),
4342 .num_device_descs
= 3,
4344 { "DiBcom STK807xP reference design",
4345 { &dib0700_usb_id_table
[62], NULL
},
4348 { "Prolink Pixelview SBTVD",
4349 { &dib0700_usb_id_table
[63], NULL
},
4352 { "EvolutePC TVWay+",
4353 { &dib0700_usb_id_table
[64], NULL
},
4359 .rc_interval
= DEFAULT_RC_INTERVAL
,
4360 .rc_codes
= RC_MAP_DIB0700_NEC_TABLE
,
4361 .module_name
= "dib0700",
4362 .rc_query
= dib0700_rc_query_old_firmware
,
4363 .allowed_protos
= RC_BIT_RC5
|
4366 .change_protocol
= dib0700_change_protocol
,
4368 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4374 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4375 .pid_filter_count
= 32,
4376 .pid_filter
= stk80xx_pid_filter
,
4377 .pid_filter_ctrl
= stk80xx_pid_filter_ctrl
,
4378 .frontend_attach
= stk807xpvr_frontend_attach0
,
4379 .tuner_attach
= dib807x_tuner_attach
,
4381 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4384 sizeof(struct dib0700_adapter_state
),
4389 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4390 .pid_filter_count
= 32,
4391 .pid_filter
= stk80xx_pid_filter
,
4392 .pid_filter_ctrl
= stk80xx_pid_filter_ctrl
,
4393 .frontend_attach
= stk807xpvr_frontend_attach1
,
4394 .tuner_attach
= dib807x_tuner_attach
,
4396 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
4399 sizeof(struct dib0700_adapter_state
),
4403 .num_device_descs
= 1,
4405 { "DiBcom STK807xPVR reference design",
4406 { &dib0700_usb_id_table
[61], NULL
},
4412 .rc_interval
= DEFAULT_RC_INTERVAL
,
4413 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4414 .module_name
= "dib0700",
4415 .rc_query
= dib0700_rc_query_old_firmware
,
4416 .allowed_protos
= RC_BIT_RC5
|
4419 .change_protocol
= dib0700_change_protocol
,
4421 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4427 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4428 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4429 .pid_filter_count
= 32,
4430 .pid_filter
= stk80xx_pid_filter
,
4431 .pid_filter_ctrl
= stk80xx_pid_filter_ctrl
,
4432 .frontend_attach
= stk809x_frontend_attach
,
4433 .tuner_attach
= dib809x_tuner_attach
,
4435 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4438 sizeof(struct dib0700_adapter_state
),
4442 .num_device_descs
= 1,
4444 { "DiBcom STK8096GP reference design",
4445 { &dib0700_usb_id_table
[67], NULL
},
4451 .rc_interval
= DEFAULT_RC_INTERVAL
,
4452 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4453 .module_name
= "dib0700",
4454 .rc_query
= dib0700_rc_query_old_firmware
,
4455 .allowed_protos
= RC_BIT_RC5
|
4458 .change_protocol
= dib0700_change_protocol
,
4460 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4466 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4467 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4468 .pid_filter_count
= 32,
4469 .pid_filter
= dib90x0_pid_filter
,
4470 .pid_filter_ctrl
= dib90x0_pid_filter_ctrl
,
4471 .frontend_attach
= stk9090m_frontend_attach
,
4472 .tuner_attach
= dib9090_tuner_attach
,
4474 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4477 sizeof(struct dib0700_adapter_state
),
4481 .num_device_descs
= 1,
4483 { "DiBcom STK9090M reference design",
4484 { &dib0700_usb_id_table
[69], NULL
},
4490 .rc_interval
= DEFAULT_RC_INTERVAL
,
4491 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4492 .module_name
= "dib0700",
4493 .rc_query
= dib0700_rc_query_old_firmware
,
4494 .allowed_protos
= RC_BIT_RC5
|
4497 .change_protocol
= dib0700_change_protocol
,
4499 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4505 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4506 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4507 .pid_filter_count
= 32,
4508 .pid_filter
= stk80xx_pid_filter
,
4509 .pid_filter_ctrl
= stk80xx_pid_filter_ctrl
,
4510 .frontend_attach
= nim8096md_frontend_attach
,
4511 .tuner_attach
= nim8096md_tuner_attach
,
4513 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4516 sizeof(struct dib0700_adapter_state
),
4520 .num_device_descs
= 1,
4522 { "DiBcom NIM8096MD reference design",
4523 { &dib0700_usb_id_table
[70], NULL
},
4529 .rc_interval
= DEFAULT_RC_INTERVAL
,
4530 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4531 .module_name
= "dib0700",
4532 .rc_query
= dib0700_rc_query_old_firmware
,
4533 .allowed_protos
= RC_BIT_RC5
|
4536 .change_protocol
= dib0700_change_protocol
,
4538 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4544 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4545 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4546 .pid_filter_count
= 32,
4547 .pid_filter
= dib90x0_pid_filter
,
4548 .pid_filter_ctrl
= dib90x0_pid_filter_ctrl
,
4549 .frontend_attach
= nim9090md_frontend_attach
,
4550 .tuner_attach
= nim9090md_tuner_attach
,
4552 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4555 sizeof(struct dib0700_adapter_state
),
4559 .num_device_descs
= 1,
4561 { "DiBcom NIM9090MD reference design",
4562 { &dib0700_usb_id_table
[71], NULL
},
4568 .rc_interval
= DEFAULT_RC_INTERVAL
,
4569 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4570 .module_name
= "dib0700",
4571 .rc_query
= dib0700_rc_query_old_firmware
,
4572 .allowed_protos
= RC_BIT_RC5
|
4575 .change_protocol
= dib0700_change_protocol
,
4577 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4583 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4584 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4585 .pid_filter_count
= 32,
4586 .pid_filter
= stk70x0p_pid_filter
,
4587 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4588 .frontend_attach
= nim7090_frontend_attach
,
4589 .tuner_attach
= nim7090_tuner_attach
,
4591 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4594 sizeof(struct dib0700_adapter_state
),
4598 .num_device_descs
= 1,
4600 { "DiBcom NIM7090 reference design",
4601 { &dib0700_usb_id_table
[72], NULL
},
4607 .rc_interval
= DEFAULT_RC_INTERVAL
,
4608 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4609 .module_name
= "dib0700",
4610 .rc_query
= dib0700_rc_query_old_firmware
,
4611 .allowed_protos
= RC_BIT_RC5
|
4614 .change_protocol
= dib0700_change_protocol
,
4616 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4622 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4623 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4624 .pid_filter_count
= 32,
4625 .pid_filter
= stk70x0p_pid_filter
,
4626 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4627 .frontend_attach
= tfe7090pvr_frontend0_attach
,
4628 .tuner_attach
= tfe7090pvr_tuner0_attach
,
4630 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
4633 sizeof(struct dib0700_adapter_state
),
4638 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4639 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4640 .pid_filter_count
= 32,
4641 .pid_filter
= stk70x0p_pid_filter
,
4642 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4643 .frontend_attach
= tfe7090pvr_frontend1_attach
,
4644 .tuner_attach
= tfe7090pvr_tuner1_attach
,
4646 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4649 sizeof(struct dib0700_adapter_state
),
4653 .num_device_descs
= 1,
4655 { "DiBcom TFE7090PVR reference design",
4656 { &dib0700_usb_id_table
[73], NULL
},
4662 .rc_interval
= DEFAULT_RC_INTERVAL
,
4663 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4664 .module_name
= "dib0700",
4665 .rc_query
= dib0700_rc_query_old_firmware
,
4666 .allowed_protos
= RC_BIT_RC5
|
4669 .change_protocol
= dib0700_change_protocol
,
4671 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4677 .frontend_attach
= pctv340e_frontend_attach
,
4678 .tuner_attach
= xc4000_tuner_attach
,
4680 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4682 .size_of_priv
= sizeof(struct
4683 dib0700_adapter_state
),
4687 .num_device_descs
= 2,
4689 { "Pinnacle PCTV 340e HD Pro USB Stick",
4690 { &dib0700_usb_id_table
[76], NULL
},
4693 { "Pinnacle PCTV Hybrid Stick Solo",
4694 { &dib0700_usb_id_table
[77], NULL
},
4699 .rc_interval
= DEFAULT_RC_INTERVAL
,
4700 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4701 .module_name
= "dib0700",
4702 .rc_query
= dib0700_rc_query_old_firmware
,
4703 .allowed_protos
= RC_BIT_RC5
|
4706 .change_protocol
= dib0700_change_protocol
,
4708 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4714 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4715 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4716 .pid_filter_count
= 32,
4717 .pid_filter
= stk70x0p_pid_filter
,
4718 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4719 .frontend_attach
= tfe7790p_frontend_attach
,
4720 .tuner_attach
= tfe7790p_tuner_attach
,
4722 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
4726 sizeof(struct dib0700_adapter_state
),
4730 .num_device_descs
= 1,
4732 { "DiBcom TFE7790P reference design",
4733 { &dib0700_usb_id_table
[78], NULL
},
4739 .rc_interval
= DEFAULT_RC_INTERVAL
,
4740 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4741 .module_name
= "dib0700",
4742 .rc_query
= dib0700_rc_query_old_firmware
,
4743 .allowed_protos
= RC_BIT_RC5
|
4746 .change_protocol
= dib0700_change_protocol
,
4748 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4754 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4755 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4756 .pid_filter_count
= 32,
4757 .pid_filter
= stk80xx_pid_filter
,
4758 .pid_filter_ctrl
= stk80xx_pid_filter_ctrl
,
4759 .frontend_attach
= tfe8096p_frontend_attach
,
4760 .tuner_attach
= tfe8096p_tuner_attach
,
4762 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4767 sizeof(struct dib0700_adapter_state
),
4771 .num_device_descs
= 1,
4773 { "DiBcom TFE8096P reference design",
4774 { &dib0700_usb_id_table
[79], NULL
},
4780 .rc_interval
= DEFAULT_RC_INTERVAL
,
4781 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4782 .module_name
= "dib0700",
4783 .rc_query
= dib0700_rc_query_old_firmware
,
4784 .allowed_protos
= RC_BIT_RC5
|
4787 .change_protocol
= dib0700_change_protocol
,
4792 int dib0700_device_count
= ARRAY_SIZE(dib0700_devices
);