1 // SPDX-License-Identifier: GPL-2.0-only
2 /* Linux driver for devices based on the DiBcom DiB0700 USB bridge
4 * Copyright (C) 2005-9 DiBcom, SA et al
15 #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-Amplifier(s) (LNA), if applicable for the device (default: 0=automatic/off).");
31 struct dib0700_adapter_state
{
32 int (*set_param_save
) (struct dvb_frontend
*);
33 const struct firmware
*frontend_firmware
;
34 struct dib7000p_ops dib7000p_ops
;
35 struct dib8000_ops dib8000_ops
;
38 /* Hauppauge Nova-T 500 (aka Bristol)
39 * has a LNA on GPIO0 which is enabled by setting 1 */
40 static struct mt2060_config bristol_mt2060_config
[2] = {
50 static struct dibx000_agc_config bristol_dib3000p_mt2060_agc_config
= {
51 .band_caps
= BAND_VHF
| BAND_UHF
,
52 .setup
= (1 << 8) | (5 << 5) | (0 << 4) | (0 << 3) | (0 << 2) | (2 << 0),
72 static struct dib3000mc_config bristol_dib3000mc_config
[2] = {
73 { .agc
= &bristol_dib3000p_mt2060_agc_config
,
75 .ln_adc_level
= 0x1cc7,
76 .output_mpeg2_in_188_bytes
= 1,
78 { .agc
= &bristol_dib3000p_mt2060_agc_config
,
80 .ln_adc_level
= 0x1cc7,
81 .output_mpeg2_in_188_bytes
= 1,
85 static int bristol_frontend_attach(struct dvb_usb_adapter
*adap
)
87 struct dib0700_state
*st
= adap
->dev
->priv
;
89 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0); msleep(10);
90 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1); msleep(10);
91 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0); msleep(10);
92 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1); msleep(10);
94 if (force_lna_activation
)
95 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
97 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 0);
99 if (dib3000mc_i2c_enumeration(&adap
->dev
->i2c_adap
, 2, DEFAULT_DIB3000P_I2C_ADDRESS
, bristol_dib3000mc_config
) != 0) {
100 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0); msleep(10);
104 st
->mt2060_if1
[adap
->id
] = 1220;
105 return (adap
->fe_adap
[0].fe
= dvb_attach(dib3000mc_attach
, &adap
->dev
->i2c_adap
,
106 (10 + adap
->id
) << 1, &bristol_dib3000mc_config
[adap
->id
])) == NULL
? -ENODEV
: 0;
109 static int eeprom_read(struct i2c_adapter
*adap
,u8 adrs
,u8
*pval
)
111 struct i2c_msg msg
[2] = {
112 { .addr
= 0x50, .flags
= 0, .buf
= &adrs
, .len
= 1 },
113 { .addr
= 0x50, .flags
= I2C_M_RD
, .buf
= pval
, .len
= 1 },
115 if (i2c_transfer(adap
, msg
, 2) != 2) return -EREMOTEIO
;
119 static int bristol_tuner_attach(struct dvb_usb_adapter
*adap
)
121 struct i2c_adapter
*prim_i2c
= &adap
->dev
->i2c_adap
;
122 struct i2c_adapter
*tun_i2c
= dib3000mc_get_tuner_i2c_master(adap
->fe_adap
[0].fe
, 1);
125 if (adap
->dev
->udev
->descriptor
.idVendor
== cpu_to_le16(USB_VID_HAUPPAUGE
) &&
126 adap
->dev
->udev
->descriptor
.idProduct
== cpu_to_le16(USB_PID_HAUPPAUGE_NOVA_T_500_2
)) {
127 if (!eeprom_read(prim_i2c
,0x59 + adap
->id
,&a
)) if1
=1220+a
;
129 return dvb_attach(mt2060_attach
, adap
->fe_adap
[0].fe
, tun_i2c
,
130 &bristol_mt2060_config
[adap
->id
], if1
) == NULL
?
134 /* STK7700D: Pinnacle/Terratec/Hauppauge Dual DVB-T Diversity */
137 static struct dibx000_agc_config stk7700d_7000p_mt2266_agc_config
[2] = {
141 /* 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,
142 * 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 */
143 (0 << 15) | (0 << 14) | (1 << 11) | (1 << 10) | (1 << 9) | (0 << 8)
144 | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
179 BAND_VHF
| BAND_LBAND
,
181 /* 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,
182 * 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 */
183 (0 << 15) | (0 << 14) | (1 << 11) | (1 << 10) | (1 << 9) | (0 << 8)
184 | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0),
221 static struct dibx000_bandwidth_config stk7700d_mt2266_pll_config
= {
234 .sad_cfg
= (3 << 14) | (1 << 12) | (524 << 0),
239 static struct dib7000p_config stk7700d_dib7000p_mt2266_config
[] = {
240 { .output_mpeg2_in_188_bytes
= 1,
241 .hostbus_diversity
= 1,
242 .tuner_is_baseband
= 1,
244 .agc_config_count
= 2,
245 .agc
= stk7700d_7000p_mt2266_agc_config
,
246 .bw
= &stk7700d_mt2266_pll_config
,
248 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
249 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
250 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
252 { .output_mpeg2_in_188_bytes
= 1,
253 .hostbus_diversity
= 1,
254 .tuner_is_baseband
= 1,
256 .agc_config_count
= 2,
257 .agc
= stk7700d_7000p_mt2266_agc_config
,
258 .bw
= &stk7700d_mt2266_pll_config
,
260 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
261 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
262 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
266 static struct mt2266_config stk7700d_mt2266_config
[2] = {
267 { .i2c_address
= 0x60
269 { .i2c_address
= 0x60
273 static int stk7700P2_frontend_attach(struct dvb_usb_adapter
*adap
)
275 struct dib0700_adapter_state
*state
= adap
->priv
;
277 if (!dvb_attach(dib7000p_attach
, &state
->dib7000p_ops
))
281 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
283 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
284 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
285 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
286 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
288 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
290 if (state
->dib7000p_ops
.i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 18,
291 stk7700d_dib7000p_mt2266_config
)
293 err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__
);
294 dvb_detach(state
->dib7000p_ops
.set_wbd_ref
);
299 adap
->fe_adap
[0].fe
= state
->dib7000p_ops
.init(&adap
->dev
->i2c_adap
,
300 0x80 + (adap
->id
<< 1),
301 &stk7700d_dib7000p_mt2266_config
[adap
->id
]);
303 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
306 static int stk7700d_frontend_attach(struct dvb_usb_adapter
*adap
)
308 struct dib0700_adapter_state
*state
= adap
->priv
;
310 if (!dvb_attach(dib7000p_attach
, &state
->dib7000p_ops
))
314 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
316 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
317 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
318 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
319 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
321 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
323 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
324 if (state
->dib7000p_ops
.i2c_enumeration(&adap
->dev
->i2c_adap
, 2, 18,
325 stk7700d_dib7000p_mt2266_config
)
327 err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__
);
328 dvb_detach(state
->dib7000p_ops
.set_wbd_ref
);
333 adap
->fe_adap
[0].fe
= state
->dib7000p_ops
.init(&adap
->dev
->i2c_adap
,
334 0x80 + (adap
->id
<< 1),
335 &stk7700d_dib7000p_mt2266_config
[adap
->id
]);
337 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
340 static int stk7700d_tuner_attach(struct dvb_usb_adapter
*adap
)
342 struct i2c_adapter
*tun_i2c
;
343 struct dib0700_adapter_state
*state
= adap
->priv
;
345 tun_i2c
= state
->dib7000p_ops
.get_i2c_master(adap
->fe_adap
[0].fe
,
346 DIBX000_I2C_INTERFACE_TUNER
, 1);
347 return dvb_attach(mt2266_attach
, adap
->fe_adap
[0].fe
, tun_i2c
,
348 &stk7700d_mt2266_config
[adap
->id
]) == NULL
? -ENODEV
: 0;
351 /* STK7700-PH: Digital/Analog Hybrid Tuner, e.h. Cinergy HT USB HE */
352 static struct dibx000_agc_config xc3028_agc_config
= {
353 .band_caps
= BAND_VHF
| BAND_UHF
,
354 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=0,
355 * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
356 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */
357 .setup
= (0 << 15) | (0 << 14) | (0 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0),
383 .perform_agc_softsplit
= 1,
386 /* PLL Configuration for COFDM BW_MHz = 8.00 with external clock = 30.00 */
387 static struct dibx000_bandwidth_config xc3028_bw_config
= {
400 .sad_cfg
= (3 << 14) | (1 << 12) | (524 << 0), /* sad_cfg: refsel, sel, freq_15k */
401 .ifreq
= (1 << 25) | 5816102, /* ifreq = 5.200000 MHz */
406 static struct dib7000p_config stk7700ph_dib7700_xc3028_config
= {
407 .output_mpeg2_in_188_bytes
= 1,
408 .tuner_is_baseband
= 1,
410 .agc_config_count
= 1,
411 .agc
= &xc3028_agc_config
,
412 .bw
= &xc3028_bw_config
,
414 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
415 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
416 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
419 static int stk7700ph_xc3028_callback(void *ptr
, int component
,
420 int command
, int arg
)
422 struct dvb_usb_adapter
*adap
= ptr
;
423 struct dib0700_adapter_state
*state
= adap
->priv
;
426 case XC2028_TUNER_RESET
:
427 /* Send the tuner in then out of reset */
428 state
->dib7000p_ops
.set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 0);
430 state
->dib7000p_ops
.set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 1);
432 case XC2028_RESET_CLK
:
433 case XC2028_I2C_FLUSH
:
436 err("%s: unknown command %d, arg %d\n", __func__
,
443 static struct xc2028_ctrl stk7700ph_xc3028_ctrl
= {
444 .fname
= XC2028_DEFAULT_FIRMWARE
,
446 .demod
= XC3028_FE_DIBCOM52
,
449 static struct xc2028_config stk7700ph_xc3028_config
= {
451 .ctrl
= &stk7700ph_xc3028_ctrl
,
454 static int stk7700ph_frontend_attach(struct dvb_usb_adapter
*adap
)
456 struct usb_device_descriptor
*desc
= &adap
->dev
->udev
->descriptor
;
457 struct dib0700_adapter_state
*state
= adap
->priv
;
459 if (!dvb_attach(dib7000p_attach
, &state
->dib7000p_ops
))
462 if (desc
->idVendor
== cpu_to_le16(USB_VID_PINNACLE
) &&
463 desc
->idProduct
== cpu_to_le16(USB_PID_PINNACLE_EXPRESSCARD_320CX
))
464 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0);
466 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
468 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
469 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
470 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
471 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
473 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
475 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
478 if (state
->dib7000p_ops
.i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 18,
479 &stk7700ph_dib7700_xc3028_config
) != 0) {
480 err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n",
482 dvb_detach(state
->dib7000p_ops
.set_wbd_ref
);
486 adap
->fe_adap
[0].fe
= state
->dib7000p_ops
.init(&adap
->dev
->i2c_adap
, 0x80,
487 &stk7700ph_dib7700_xc3028_config
);
489 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
492 static int stk7700ph_tuner_attach(struct dvb_usb_adapter
*adap
)
494 struct i2c_adapter
*tun_i2c
;
495 struct dib0700_adapter_state
*state
= adap
->priv
;
497 tun_i2c
= state
->dib7000p_ops
.get_i2c_master(adap
->fe_adap
[0].fe
,
498 DIBX000_I2C_INTERFACE_TUNER
, 1);
500 stk7700ph_xc3028_config
.i2c_adap
= tun_i2c
;
502 /* FIXME: generalize & move to common area */
503 adap
->fe_adap
[0].fe
->callback
= stk7700ph_xc3028_callback
;
505 return dvb_attach(xc2028_attach
, adap
->fe_adap
[0].fe
, &stk7700ph_xc3028_config
)
506 == NULL
? -ENODEV
: 0;
509 #define DEFAULT_RC_INTERVAL 50
512 * This function is used only when firmware is < 1.20 version. Newer
513 * firmwares use bulk mode, with functions implemented at dib0700_core,
514 * at dib0700_rc_urb_completion()
516 static int dib0700_rc_query_old_firmware(struct dvb_usb_device
*d
)
518 enum rc_proto protocol
;
522 struct dib0700_state
*st
= d
->priv
;
524 if (st
->fw_version
>= 0x10200) {
525 /* For 1.20 firmware , We need to keep the RC polling
526 callback so we can reuse the input device setup in
527 dvb-usb-remote.c. However, the actual work is being done
528 in the bulk URB completion handler. */
532 st
->buf
[0] = REQUEST_POLL_RC
;
535 i
= dib0700_ctrl_rd(d
, st
->buf
, 2, st
->buf
, 4);
537 err("RC Query Failed");
541 /* losing half of KEY_0 events from Philipps rc5 remotes.. */
542 if (st
->buf
[0] == 0 && st
->buf
[1] == 0
543 && st
->buf
[2] == 0 && st
->buf
[3] == 0)
546 /* info("%d: %2X %2X %2X %2X",dvb_usb_dib0700_ir_proto,(int)st->buf[3 - 2],(int)st->buf[3 - 3],(int)st->buf[3 - 1],(int)st->buf[3]); */
548 dib0700_rc_setup(d
, NULL
); /* reset ir sensor data to prevent false events */
550 switch (d
->props
.rc
.core
.protocol
) {
551 case RC_PROTO_BIT_NEC
:
552 /* NEC protocol sends repeat code as 0 0 0 FF */
553 if ((st
->buf
[3 - 2] == 0x00) && (st
->buf
[3 - 3] == 0x00) &&
554 (st
->buf
[3] == 0xff)) {
555 rc_repeat(d
->rc_dev
);
559 protocol
= RC_PROTO_NEC
;
560 scancode
= RC_SCANCODE_NEC(st
->buf
[3 - 2], st
->buf
[3 - 3]);
565 /* RC-5 protocol changes toggle bit on new keypress */
566 protocol
= RC_PROTO_RC5
;
567 scancode
= RC_SCANCODE_RC5(st
->buf
[3 - 2], st
->buf
[3 - 3]);
568 toggle
= st
->buf
[3 - 1];
572 rc_keydown(d
->rc_dev
, protocol
, scancode
, toggle
);
576 /* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */
577 static struct dibx000_agc_config stk7700p_7000m_mt2060_agc_config
= {
580 /* 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,
581 * 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 */
582 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8)
583 | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0),
623 static struct dibx000_agc_config stk7700p_7000p_mt2060_agc_config
= {
624 .band_caps
= BAND_UHF
| BAND_VHF
,
625 /* 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,
626 * 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 */
627 .setup
= (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0),
653 .perform_agc_softsplit
= 0,
656 static struct dibx000_bandwidth_config stk7700p_pll_config
= {
669 .sad_cfg
= (3 << 14) | (1 << 12) | (524 << 0),
675 static struct dib7000m_config stk7700p_dib7000m_config
= {
677 .output_mpeg2_in_188_bytes
= 1,
680 .agc_config_count
= 1,
681 .agc
= &stk7700p_7000m_mt2060_agc_config
,
682 .bw
= &stk7700p_pll_config
,
684 .gpio_dir
= DIB7000M_GPIO_DEFAULT_DIRECTIONS
,
685 .gpio_val
= DIB7000M_GPIO_DEFAULT_VALUES
,
686 .gpio_pwm_pos
= DIB7000M_GPIO_DEFAULT_PWM_POS
,
689 static struct dib7000p_config stk7700p_dib7000p_config
= {
690 .output_mpeg2_in_188_bytes
= 1,
692 .agc_config_count
= 1,
693 .agc
= &stk7700p_7000p_mt2060_agc_config
,
694 .bw
= &stk7700p_pll_config
,
696 .gpio_dir
= DIB7000M_GPIO_DEFAULT_DIRECTIONS
,
697 .gpio_val
= DIB7000M_GPIO_DEFAULT_VALUES
,
698 .gpio_pwm_pos
= DIB7000M_GPIO_DEFAULT_PWM_POS
,
701 static int stk7700p_frontend_attach(struct dvb_usb_adapter
*adap
)
703 struct dib0700_state
*st
= adap
->dev
->priv
;
704 struct dib0700_adapter_state
*state
= adap
->priv
;
706 if (!dvb_attach(dib7000p_attach
, &state
->dib7000p_ops
))
709 /* unless there is no real power management in DVB - we leave the device on GPIO6 */
711 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
712 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0); msleep(50);
714 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1); msleep(10);
715 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
717 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0); msleep(10);
718 dib0700_ctrl_clock(adap
->dev
, 72, 1);
719 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1); msleep(100);
721 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
723 st
->mt2060_if1
[0] = 1220;
725 if (state
->dib7000p_ops
.dib7000pc_detection(&adap
->dev
->i2c_adap
)) {
726 adap
->fe_adap
[0].fe
= state
->dib7000p_ops
.init(&adap
->dev
->i2c_adap
, 18, &stk7700p_dib7000p_config
);
727 st
->is_dib7000pc
= 1;
729 memset(&state
->dib7000p_ops
, 0, sizeof(state
->dib7000p_ops
));
730 adap
->fe_adap
[0].fe
= dvb_attach(dib7000m_attach
, &adap
->dev
->i2c_adap
, 18, &stk7700p_dib7000m_config
);
733 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
736 static struct mt2060_config stk7700p_mt2060_config
= {
740 static int stk7700p_tuner_attach(struct dvb_usb_adapter
*adap
)
742 struct i2c_adapter
*prim_i2c
= &adap
->dev
->i2c_adap
;
743 struct dib0700_state
*st
= adap
->dev
->priv
;
744 struct i2c_adapter
*tun_i2c
;
745 struct dib0700_adapter_state
*state
= adap
->priv
;
749 if (adap
->dev
->udev
->descriptor
.idVendor
== cpu_to_le16(USB_VID_HAUPPAUGE
) &&
750 adap
->dev
->udev
->descriptor
.idProduct
== cpu_to_le16(USB_PID_HAUPPAUGE_NOVA_T_STICK
)) {
751 if (!eeprom_read(prim_i2c
,0x58,&a
)) if1
=1220+a
;
753 if (st
->is_dib7000pc
)
754 tun_i2c
= state
->dib7000p_ops
.get_i2c_master(adap
->fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_TUNER
, 1);
756 tun_i2c
= dib7000m_get_i2c_master(adap
->fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_TUNER
, 1);
758 return dvb_attach(mt2060_attach
, adap
->fe_adap
[0].fe
, tun_i2c
, &stk7700p_mt2060_config
,
759 if1
) == NULL
? -ENODEV
: 0;
762 /* DIB7070 generic */
763 static struct dibx000_agc_config dib7070_agc_config
= {
764 .band_caps
= BAND_UHF
| BAND_VHF
| BAND_LBAND
| BAND_SBAND
,
765 /* 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,
766 * 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 */
767 .setup
= (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
793 .perform_agc_softsplit
= 0,
796 static int dib7070_tuner_reset(struct dvb_frontend
*fe
, int onoff
)
798 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
799 struct dib0700_adapter_state
*state
= adap
->priv
;
801 deb_info("reset: %d", onoff
);
802 return state
->dib7000p_ops
.set_gpio(fe
, 8, 0, !onoff
);
805 static int dib7070_tuner_sleep(struct dvb_frontend
*fe
, int onoff
)
807 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
808 struct dib0700_adapter_state
*state
= adap
->priv
;
810 deb_info("sleep: %d", onoff
);
811 return state
->dib7000p_ops
.set_gpio(fe
, 9, 0, onoff
);
814 static struct dib0070_config dib7070p_dib0070_config
[2] = {
816 .i2c_address
= DEFAULT_DIB0070_I2C_ADDRESS
,
817 .reset
= dib7070_tuner_reset
,
818 .sleep
= dib7070_tuner_sleep
,
820 .clock_pad_drive
= 4,
823 .i2c_address
= DEFAULT_DIB0070_I2C_ADDRESS
,
824 .reset
= dib7070_tuner_reset
,
825 .sleep
= dib7070_tuner_sleep
,
831 static struct dib0070_config dib7770p_dib0070_config
= {
832 .i2c_address
= DEFAULT_DIB0070_I2C_ADDRESS
,
833 .reset
= dib7070_tuner_reset
,
834 .sleep
= dib7070_tuner_sleep
,
836 .clock_pad_drive
= 0,
841 static int dib7070_set_param_override(struct dvb_frontend
*fe
)
843 struct dtv_frontend_properties
*p
= &fe
->dtv_property_cache
;
844 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
845 struct dib0700_adapter_state
*state
= adap
->priv
;
848 u8 band
= BAND_OF_FREQUENCY(p
->frequency
/1000);
850 case BAND_VHF
: offset
= 950; break;
852 default: offset
= 550; break;
854 deb_info("WBD for DiB7000P: %d\n", offset
+ dib0070_wbd_offset(fe
));
855 state
->dib7000p_ops
.set_wbd_ref(fe
, offset
+ dib0070_wbd_offset(fe
));
856 return state
->set_param_save(fe
);
859 static int dib7770_set_param_override(struct dvb_frontend
*fe
)
861 struct dtv_frontend_properties
*p
= &fe
->dtv_property_cache
;
862 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
863 struct dib0700_adapter_state
*state
= adap
->priv
;
866 u8 band
= BAND_OF_FREQUENCY(p
->frequency
/1000);
869 state
->dib7000p_ops
.set_gpio(fe
, 0, 0, 1);
874 state
->dib7000p_ops
.set_gpio(fe
, 0, 0, 0);
878 deb_info("WBD for DiB7000P: %d\n", offset
+ dib0070_wbd_offset(fe
));
879 state
->dib7000p_ops
.set_wbd_ref(fe
, offset
+ dib0070_wbd_offset(fe
));
880 return state
->set_param_save(fe
);
883 static int dib7770p_tuner_attach(struct dvb_usb_adapter
*adap
)
885 struct dib0700_adapter_state
*st
= adap
->priv
;
886 struct i2c_adapter
*tun_i2c
= st
->dib7000p_ops
.get_i2c_master(adap
->fe_adap
[0].fe
,
887 DIBX000_I2C_INTERFACE_TUNER
, 1);
889 if (dvb_attach(dib0070_attach
, adap
->fe_adap
[0].fe
, tun_i2c
,
890 &dib7770p_dib0070_config
) == NULL
)
893 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
894 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib7770_set_param_override
;
898 static int dib7070p_tuner_attach(struct dvb_usb_adapter
*adap
)
900 struct dib0700_adapter_state
*st
= adap
->priv
;
901 struct i2c_adapter
*tun_i2c
= st
->dib7000p_ops
.get_i2c_master(adap
->fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_TUNER
, 1);
904 if (dvb_attach(dib0070_attach
, adap
->fe_adap
[0].fe
, tun_i2c
, &dib7070p_dib0070_config
[0]) == NULL
)
907 if (dvb_attach(dib0070_attach
, adap
->fe_adap
[0].fe
, tun_i2c
, &dib7070p_dib0070_config
[1]) == NULL
)
911 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
912 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib7070_set_param_override
;
916 static int stk7700p_pid_filter(struct dvb_usb_adapter
*adapter
, int index
,
919 struct dib0700_adapter_state
*state
= adapter
->priv
;
920 struct dib0700_state
*st
= adapter
->dev
->priv
;
922 if (st
->is_dib7000pc
)
923 return state
->dib7000p_ops
.pid_filter(adapter
->fe_adap
[0].fe
, index
, pid
, onoff
);
924 return dib7000m_pid_filter(adapter
->fe_adap
[0].fe
, index
, pid
, onoff
);
927 static int stk7700p_pid_filter_ctrl(struct dvb_usb_adapter
*adapter
, int onoff
)
929 struct dib0700_state
*st
= adapter
->dev
->priv
;
930 struct dib0700_adapter_state
*state
= adapter
->priv
;
931 if (st
->is_dib7000pc
)
932 return state
->dib7000p_ops
.pid_filter_ctrl(adapter
->fe_adap
[0].fe
, onoff
);
933 return dib7000m_pid_filter_ctrl(adapter
->fe_adap
[0].fe
, onoff
);
936 static int stk70x0p_pid_filter(struct dvb_usb_adapter
*adapter
, int index
, u16 pid
, int onoff
)
938 struct dib0700_adapter_state
*state
= adapter
->priv
;
939 return state
->dib7000p_ops
.pid_filter(adapter
->fe_adap
[0].fe
, index
, pid
, onoff
);
942 static int stk70x0p_pid_filter_ctrl(struct dvb_usb_adapter
*adapter
, int onoff
)
944 struct dib0700_adapter_state
*state
= adapter
->priv
;
945 return state
->dib7000p_ops
.pid_filter_ctrl(adapter
->fe_adap
[0].fe
, onoff
);
948 static struct dibx000_bandwidth_config dib7070_bw_config_12_mhz
= {
961 .sad_cfg
= (3 << 14) | (1 << 12) | (524 << 0),
962 .ifreq
= (0 << 25) | 0,
967 static struct dib7000p_config dib7070p_dib7000p_config
= {
968 .output_mpeg2_in_188_bytes
= 1,
970 .agc_config_count
= 1,
971 .agc
= &dib7070_agc_config
,
972 .bw
= &dib7070_bw_config_12_mhz
,
973 .tuner_is_baseband
= 1,
976 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
977 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
978 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
980 .hostbus_diversity
= 1,
984 static int stk7070p_frontend_attach(struct dvb_usb_adapter
*adap
)
986 struct usb_device_descriptor
*p
= &adap
->dev
->udev
->descriptor
;
987 struct dib0700_adapter_state
*state
= adap
->priv
;
989 if (!dvb_attach(dib7000p_attach
, &state
->dib7000p_ops
))
992 if (p
->idVendor
== cpu_to_le16(USB_VID_PINNACLE
) &&
993 p
->idProduct
== cpu_to_le16(USB_PID_PINNACLE_PCTV72E
))
994 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0);
996 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
998 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
999 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
1000 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
1001 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
1003 dib0700_ctrl_clock(adap
->dev
, 72, 1);
1006 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
1008 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
1010 if (state
->dib7000p_ops
.i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 18,
1011 &dib7070p_dib7000p_config
) != 0) {
1012 err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n",
1014 dvb_detach(state
->dib7000p_ops
.set_wbd_ref
);
1018 adap
->fe_adap
[0].fe
= state
->dib7000p_ops
.init(&adap
->dev
->i2c_adap
, 0x80,
1019 &dib7070p_dib7000p_config
);
1020 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
1024 static struct dib7000p_config dib7770p_dib7000p_config
= {
1025 .output_mpeg2_in_188_bytes
= 1,
1027 .agc_config_count
= 1,
1028 .agc
= &dib7070_agc_config
,
1029 .bw
= &dib7070_bw_config_12_mhz
,
1030 .tuner_is_baseband
= 1,
1033 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
1034 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
1035 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
1037 .hostbus_diversity
= 1,
1038 .enable_current_mirror
= 1,
1039 .disable_sample_and_hold
= 0,
1042 static int stk7770p_frontend_attach(struct dvb_usb_adapter
*adap
)
1044 struct usb_device_descriptor
*p
= &adap
->dev
->udev
->descriptor
;
1045 struct dib0700_adapter_state
*state
= adap
->priv
;
1047 if (!dvb_attach(dib7000p_attach
, &state
->dib7000p_ops
))
1050 if (p
->idVendor
== cpu_to_le16(USB_VID_PINNACLE
) &&
1051 p
->idProduct
== cpu_to_le16(USB_PID_PINNACLE_PCTV72E
))
1052 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0);
1054 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
1056 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
1057 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
1058 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
1059 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
1061 dib0700_ctrl_clock(adap
->dev
, 72, 1);
1064 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
1066 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
1068 if (state
->dib7000p_ops
.i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 18,
1069 &dib7770p_dib7000p_config
) != 0) {
1070 err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n",
1072 dvb_detach(state
->dib7000p_ops
.set_wbd_ref
);
1076 adap
->fe_adap
[0].fe
= state
->dib7000p_ops
.init(&adap
->dev
->i2c_adap
, 0x80,
1077 &dib7770p_dib7000p_config
);
1078 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
1081 /* DIB807x generic */
1082 static struct dibx000_agc_config dib807x_agc_config
[2] = {
1085 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0,
1086 * P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0,
1087 * P_agc_inv_pwm2=0,P_agc_inh_dc_rv_est=0,
1088 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5,
1090 (0 << 15) | (0 << 14) | (7 << 11) | (0 << 10) | (0 << 9) |
1091 (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) |
1092 (0 << 0), /* setup*/
1095 10, /* time_stabiliz*/
1105 65535, /* agc1_max*/
1108 65535, /* agc2_max*/
1114 206, /* agc1_slope1*/
1115 255, /* agc1_slope2*/
1118 88, /* agc2_slope1*/
1119 90, /* agc2_slope2*/
1126 0, /* perform_agc_softsplit*/
1129 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0,
1130 * P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0,
1131 * P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
1132 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5,
1134 (0 << 15) | (0 << 14) | (1 << 11) | (0 << 10) | (0 << 9) |
1135 (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) |
1136 (0 << 0), /* setup */
1139 10, /* time_stabiliz*/
1149 65535, /* agc1_max*/
1152 65535, /* agc2_max*/
1158 206, /* agc1_slope1*/
1159 255, /* agc1_slope2*/
1162 88, /* agc2_slope1*/
1163 90, /* agc2_slope2*/
1170 0, /* perform_agc_softsplit*/
1174 static struct dibx000_bandwidth_config dib807x_bw_config_12_mhz
= {
1184 .IO_CLK_en_core
= 1,
1187 .sad_cfg
= (3 << 14) | (1 << 12) | (599 << 0), /* sad_cfg: refsel, sel, freq_15k*/
1188 .ifreq
= (0 << 25) | 0, /* ifreq = 0.000000 MHz*/
1190 .xtal_hz
= 12000000,
1193 static struct dib8000_config dib807x_dib8000_config
[2] = {
1195 .output_mpeg2_in_188_bytes
= 1,
1197 .agc_config_count
= 2,
1198 .agc
= dib807x_agc_config
,
1199 .pll
= &dib807x_bw_config_12_mhz
,
1200 .tuner_is_baseband
= 1,
1202 .gpio_dir
= DIB8000_GPIO_DEFAULT_DIRECTIONS
,
1203 .gpio_val
= DIB8000_GPIO_DEFAULT_VALUES
,
1204 .gpio_pwm_pos
= DIB8000_GPIO_DEFAULT_PWM_POS
,
1206 .hostbus_diversity
= 1,
1208 .agc_control
= &dib0070_ctrl_agc_filter
,
1209 .output_mode
= OUTMODE_MPEG2_FIFO
,
1212 .output_mpeg2_in_188_bytes
= 1,
1214 .agc_config_count
= 2,
1215 .agc
= dib807x_agc_config
,
1216 .pll
= &dib807x_bw_config_12_mhz
,
1217 .tuner_is_baseband
= 1,
1219 .gpio_dir
= DIB8000_GPIO_DEFAULT_DIRECTIONS
,
1220 .gpio_val
= DIB8000_GPIO_DEFAULT_VALUES
,
1221 .gpio_pwm_pos
= DIB8000_GPIO_DEFAULT_PWM_POS
,
1223 .hostbus_diversity
= 1,
1224 .agc_control
= &dib0070_ctrl_agc_filter
,
1225 .output_mode
= OUTMODE_MPEG2_FIFO
,
1230 static int dib80xx_tuner_reset(struct dvb_frontend
*fe
, int onoff
)
1232 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
1233 struct dib0700_adapter_state
*state
= adap
->priv
;
1235 return state
->dib8000_ops
.set_gpio(fe
, 5, 0, !onoff
);
1238 static int dib80xx_tuner_sleep(struct dvb_frontend
*fe
, int onoff
)
1240 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
1241 struct dib0700_adapter_state
*state
= adap
->priv
;
1243 return state
->dib8000_ops
.set_gpio(fe
, 0, 0, onoff
);
1246 static const struct dib0070_wbd_gain_cfg dib8070_wbd_gain_cfg
[] = {
1251 static struct dib0070_config dib807x_dib0070_config
[2] = {
1253 .i2c_address
= DEFAULT_DIB0070_I2C_ADDRESS
,
1254 .reset
= dib80xx_tuner_reset
,
1255 .sleep
= dib80xx_tuner_sleep
,
1257 .clock_pad_drive
= 4,
1259 .force_crystal_mode
= 1,
1260 .enable_third_order_filter
= 1,
1262 .wbd_gain
= dib8070_wbd_gain_cfg
,
1263 .osc_buffer_state
= 0,
1264 .freq_offset_khz_uhf
= -100,
1265 .freq_offset_khz_vhf
= -100,
1267 .i2c_address
= DEFAULT_DIB0070_I2C_ADDRESS
,
1268 .reset
= dib80xx_tuner_reset
,
1269 .sleep
= dib80xx_tuner_sleep
,
1271 .clock_pad_drive
= 2,
1273 .force_crystal_mode
= 1,
1274 .enable_third_order_filter
= 1,
1276 .wbd_gain
= dib8070_wbd_gain_cfg
,
1277 .osc_buffer_state
= 0,
1278 .freq_offset_khz_uhf
= -25,
1279 .freq_offset_khz_vhf
= -25,
1283 static int dib807x_set_param_override(struct dvb_frontend
*fe
)
1285 struct dtv_frontend_properties
*p
= &fe
->dtv_property_cache
;
1286 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
1287 struct dib0700_adapter_state
*state
= adap
->priv
;
1289 u16 offset
= dib0070_wbd_offset(fe
);
1290 u8 band
= BAND_OF_FREQUENCY(p
->frequency
/1000);
1295 case BAND_UHF
: /* fall-thru wanted */
1297 offset
+= 250; break;
1299 deb_info("WBD for DiB8000: %d\n", offset
);
1300 state
->dib8000_ops
.set_wbd_ref(fe
, offset
);
1302 return state
->set_param_save(fe
);
1305 static int dib807x_tuner_attach(struct dvb_usb_adapter
*adap
)
1307 struct dib0700_adapter_state
*st
= adap
->priv
;
1308 struct i2c_adapter
*tun_i2c
= st
->dib8000_ops
.get_i2c_master(adap
->fe_adap
[0].fe
,
1309 DIBX000_I2C_INTERFACE_TUNER
, 1);
1311 if (adap
->id
== 0) {
1312 if (dvb_attach(dib0070_attach
, adap
->fe_adap
[0].fe
, tun_i2c
,
1313 &dib807x_dib0070_config
[0]) == NULL
)
1316 if (dvb_attach(dib0070_attach
, adap
->fe_adap
[0].fe
, tun_i2c
,
1317 &dib807x_dib0070_config
[1]) == NULL
)
1321 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
1322 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib807x_set_param_override
;
1326 static int stk80xx_pid_filter(struct dvb_usb_adapter
*adapter
, int index
,
1329 struct dib0700_adapter_state
*state
= adapter
->priv
;
1331 return state
->dib8000_ops
.pid_filter(adapter
->fe_adap
[0].fe
, index
, pid
, onoff
);
1334 static int stk80xx_pid_filter_ctrl(struct dvb_usb_adapter
*adapter
,
1337 struct dib0700_adapter_state
*state
= adapter
->priv
;
1339 return state
->dib8000_ops
.pid_filter_ctrl(adapter
->fe_adap
[0].fe
, onoff
);
1343 static int stk807x_frontend_attach(struct dvb_usb_adapter
*adap
)
1345 struct dib0700_adapter_state
*state
= adap
->priv
;
1347 if (!dvb_attach(dib8000_attach
, &state
->dib8000_ops
))
1350 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
1352 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
1353 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
1354 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
1356 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
1358 dib0700_ctrl_clock(adap
->dev
, 72, 1);
1361 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
1363 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
1365 state
->dib8000_ops
.i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 18,
1368 adap
->fe_adap
[0].fe
= state
->dib8000_ops
.init(&adap
->dev
->i2c_adap
, 0x80,
1369 &dib807x_dib8000_config
[0]);
1371 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
1375 static int stk807xpvr_frontend_attach0(struct dvb_usb_adapter
*adap
)
1377 struct dib0700_adapter_state
*state
= adap
->priv
;
1379 if (!dvb_attach(dib8000_attach
, &state
->dib8000_ops
))
1382 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0);
1384 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
1386 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
1387 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
1388 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
1390 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
1392 dib0700_ctrl_clock(adap
->dev
, 72, 1);
1395 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
1397 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
1399 /* initialize IC 0 */
1400 state
->dib8000_ops
.i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 0x22, 0x80, 0);
1402 adap
->fe_adap
[0].fe
= state
->dib8000_ops
.init(&adap
->dev
->i2c_adap
, 0x80,
1403 &dib807x_dib8000_config
[0]);
1405 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
1408 static int stk807xpvr_frontend_attach1(struct dvb_usb_adapter
*adap
)
1410 struct dib0700_adapter_state
*state
= adap
->priv
;
1412 if (!dvb_attach(dib8000_attach
, &state
->dib8000_ops
))
1415 /* initialize IC 1 */
1416 state
->dib8000_ops
.i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 0x12, 0x82, 0);
1418 adap
->fe_adap
[0].fe
= state
->dib8000_ops
.init(&adap
->dev
->i2c_adap
, 0x82,
1419 &dib807x_dib8000_config
[1]);
1421 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
1425 static struct dibx000_agc_config dib8090_agc_config
[2] = {
1427 .band_caps
= BAND_UHF
| BAND_VHF
| BAND_LBAND
| BAND_SBAND
,
1428 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1,
1429 * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
1430 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0 */
1431 .setup
= (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8)
1432 | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
1435 .time_stabiliz
= 10,
1466 .perform_agc_softsplit
= 0,
1469 .band_caps
= BAND_CBAND
,
1470 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1,
1471 * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
1472 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0 */
1473 .setup
= (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8)
1474 | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
1477 .time_stabiliz
= 10,
1508 .perform_agc_softsplit
= 0,
1512 static struct dibx000_bandwidth_config dib8090_pll_config_12mhz
= {
1524 .IO_CLK_en_core
= 1,
1528 .sad_cfg
= (3 << 14) | (1 << 12) | (599 << 0),
1530 .ifreq
= (0 << 25) | 0,
1533 .xtal_hz
= 12000000,
1536 static int dib8090_get_adc_power(struct dvb_frontend
*fe
)
1538 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
1539 struct dib0700_adapter_state
*state
= adap
->priv
;
1541 return state
->dib8000_ops
.get_adc_power(fe
, 1);
1544 static void dib8090_agc_control(struct dvb_frontend
*fe
, u8 restart
)
1546 deb_info("AGC control callback: %i\n", restart
);
1547 dib0090_dcc_freq(fe
, restart
);
1549 if (restart
== 0) /* before AGC startup */
1550 dib0090_set_dc_servo(fe
, 1);
1553 static struct dib8000_config dib809x_dib8000_config
[2] = {
1555 .output_mpeg2_in_188_bytes
= 1,
1557 .agc_config_count
= 2,
1558 .agc
= dib8090_agc_config
,
1559 .agc_control
= dib8090_agc_control
,
1560 .pll
= &dib8090_pll_config_12mhz
,
1561 .tuner_is_baseband
= 1,
1563 .gpio_dir
= DIB8000_GPIO_DEFAULT_DIRECTIONS
,
1564 .gpio_val
= DIB8000_GPIO_DEFAULT_VALUES
,
1565 .gpio_pwm_pos
= DIB8000_GPIO_DEFAULT_PWM_POS
,
1567 .hostbus_diversity
= 1,
1569 .output_mode
= OUTMODE_MPEG2_FIFO
,
1571 .diversity_delay
= 48,
1574 .output_mpeg2_in_188_bytes
= 1,
1576 .agc_config_count
= 2,
1577 .agc
= dib8090_agc_config
,
1578 .agc_control
= dib8090_agc_control
,
1579 .pll
= &dib8090_pll_config_12mhz
,
1580 .tuner_is_baseband
= 1,
1582 .gpio_dir
= DIB8000_GPIO_DEFAULT_DIRECTIONS
,
1583 .gpio_val
= DIB8000_GPIO_DEFAULT_VALUES
,
1584 .gpio_pwm_pos
= DIB8000_GPIO_DEFAULT_PWM_POS
,
1586 .hostbus_diversity
= 1,
1588 .output_mode
= OUTMODE_DIVERSITY
,
1590 .diversity_delay
= 1,
1595 static struct dib0090_wbd_slope dib8090_wbd_table
[] = {
1596 /* max freq ; cold slope ; cold offset ; warm slope ; warm offset ; wbd gain */
1597 { 120, 0, 500, 0, 500, 4 }, /* CBAND */
1598 { 170, 0, 450, 0, 450, 4 }, /* CBAND */
1599 { 380, 48, 373, 28, 259, 6 }, /* VHF */
1600 { 860, 34, 700, 36, 616, 6 }, /* high UHF */
1601 { 0xFFFF, 34, 700, 36, 616, 6 }, /* default */
1604 static struct dib0090_config dib809x_dib0090_config
= {
1608 .io
.pll_loopdiv
= 20,
1609 .io
.adc_clock_ratio
= 8,
1610 .io
.pll_int_loop_filt
= 0,
1611 .io
.clock_khz
= 12000,
1612 .reset
= dib80xx_tuner_reset
,
1613 .sleep
= dib80xx_tuner_sleep
,
1616 .i2c_address
= DEFAULT_DIB0090_I2C_ADDRESS
,
1619 .get_adc_power
= dib8090_get_adc_power
,
1620 .freq_offset_khz_uhf
= -63,
1621 .freq_offset_khz_vhf
= -143,
1622 .wbd
= dib8090_wbd_table
,
1623 .fref_clock_ratio
= 6,
1626 static u8
dib8090_compute_pll_parameters(struct dvb_frontend
*fe
)
1628 u8 optimal_pll_ratio
= 20;
1629 u32 freq_adc
, ratio
, rest
, max
= 0;
1632 for (pll_ratio
= 17; pll_ratio
<= 20; pll_ratio
++) {
1633 freq_adc
= 12 * pll_ratio
* (1 << 8) / 16;
1634 ratio
= ((fe
->dtv_property_cache
.frequency
/ 1000) * (1 << 8) / 1000) / freq_adc
;
1635 rest
= ((fe
->dtv_property_cache
.frequency
/ 1000) * (1 << 8) / 1000) - ratio
* freq_adc
;
1637 if (rest
> freq_adc
/ 2)
1638 rest
= freq_adc
- rest
;
1639 deb_info("PLL ratio=%i rest=%i\n", pll_ratio
, rest
);
1640 if ((rest
> max
) && (rest
> 717)) {
1641 optimal_pll_ratio
= pll_ratio
;
1645 deb_info("optimal PLL ratio=%i\n", optimal_pll_ratio
);
1647 return optimal_pll_ratio
;
1650 static int dib8096_set_param_override(struct dvb_frontend
*fe
)
1652 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
1653 struct dib0700_adapter_state
*state
= adap
->priv
;
1654 u8 pll_ratio
, band
= BAND_OF_FREQUENCY(fe
->dtv_property_cache
.frequency
/ 1000);
1655 u16 target
, ltgain
, rf_gain_limit
;
1658 enum frontend_tune_state tune_state
= CT_SHUTDOWN
;
1662 deb_info("Warning : Rf frequency (%iHz) is not in the supported range, using VHF switch ", fe
->dtv_property_cache
.frequency
);
1665 state
->dib8000_ops
.set_gpio(fe
, 3, 0, 1);
1668 state
->dib8000_ops
.set_gpio(fe
, 3, 0, 0);
1672 ret
= state
->set_param_save(fe
);
1676 if (fe
->dtv_property_cache
.bandwidth_hz
!= 6000000) {
1677 deb_info("only 6MHz bandwidth is supported\n");
1681 /* Update PLL if needed ratio */
1682 state
->dib8000_ops
.update_pll(fe
, &dib8090_pll_config_12mhz
, fe
->dtv_property_cache
.bandwidth_hz
/ 1000, 0);
1684 /* Get optimize PLL ratio to remove spurious */
1685 pll_ratio
= dib8090_compute_pll_parameters(fe
);
1686 if (pll_ratio
== 17)
1688 else if (pll_ratio
== 18)
1690 else if (pll_ratio
== 19)
1696 state
->dib8000_ops
.update_pll(fe
, &dib8090_pll_config_12mhz
, fe
->dtv_property_cache
.bandwidth_hz
/ 1000, pll_ratio
);
1698 state
->dib8000_ops
.ctrl_timf(fe
, DEMOD_TIMF_SET
, timf
);
1700 if (band
!= BAND_CBAND
) {
1701 /* dib0090_get_wbd_target is returning any possible temperature compensated wbd-target */
1702 target
= (dib0090_get_wbd_target(fe
) * 8 * 18 / 33 + 1) / 2;
1703 state
->dib8000_ops
.set_wbd_ref(fe
, target
);
1706 if (band
== BAND_CBAND
) {
1707 deb_info("tuning in CBAND - soft-AGC startup\n");
1708 dib0090_set_tune_state(fe
, CT_AGC_START
);
1711 ret
= dib0090_gain_control(fe
);
1713 tune_state
= dib0090_get_tune_state(fe
);
1714 if (tune_state
== CT_AGC_STEP_0
)
1715 state
->dib8000_ops
.set_gpio(fe
, 6, 0, 1);
1716 else if (tune_state
== CT_AGC_STEP_1
) {
1717 dib0090_get_current_gain(fe
, NULL
, NULL
, &rf_gain_limit
, <gain
);
1718 if (rf_gain_limit
< 2000) /* activate the external attenuator in case of very high input power */
1719 state
->dib8000_ops
.set_gpio(fe
, 6, 0, 0);
1721 } while (tune_state
< CT_AGC_STOP
);
1723 deb_info("switching to PWM AGC\n");
1724 dib0090_pwm_gain_reset(fe
);
1725 state
->dib8000_ops
.pwm_agc_reset(fe
);
1726 state
->dib8000_ops
.set_tune_state(fe
, CT_DEMOD_START
);
1728 /* for everything else than CBAND we are using standard AGC */
1729 deb_info("not tuning in CBAND - standard AGC startup\n");
1730 dib0090_pwm_gain_reset(fe
);
1736 static int dib809x_tuner_attach(struct dvb_usb_adapter
*adap
)
1738 struct dib0700_adapter_state
*st
= adap
->priv
;
1739 struct i2c_adapter
*tun_i2c
= st
->dib8000_ops
.get_i2c_master(adap
->fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_TUNER
, 1);
1741 if (adap
->id
== 0) {
1742 if (dvb_attach(dib0090_register
, adap
->fe_adap
[0].fe
, tun_i2c
, &dib809x_dib0090_config
) == NULL
)
1745 /* FIXME: check if it is fe_adap[1] */
1746 if (dvb_attach(dib0090_register
, adap
->fe_adap
[0].fe
, tun_i2c
, &dib809x_dib0090_config
) == NULL
)
1750 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
1751 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib8096_set_param_override
;
1755 static int stk809x_frontend_attach(struct dvb_usb_adapter
*adap
)
1757 struct dib0700_adapter_state
*state
= adap
->priv
;
1759 if (!dvb_attach(dib8000_attach
, &state
->dib8000_ops
))
1762 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
1764 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
1765 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
1766 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
1768 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
1770 dib0700_ctrl_clock(adap
->dev
, 72, 1);
1773 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
1775 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
1777 state
->dib8000_ops
.i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 18, 0x80, 0);
1779 adap
->fe_adap
[0].fe
= state
->dib8000_ops
.init(&adap
->dev
->i2c_adap
, 0x80, &dib809x_dib8000_config
[0]);
1781 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
1784 static int stk809x_frontend1_attach(struct dvb_usb_adapter
*adap
)
1786 struct dib0700_adapter_state
*state
= adap
->priv
;
1788 if (!dvb_attach(dib8000_attach
, &state
->dib8000_ops
))
1791 state
->dib8000_ops
.i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 0x10, 0x82, 0);
1793 adap
->fe_adap
[0].fe
= state
->dib8000_ops
.init(&adap
->dev
->i2c_adap
, 0x82, &dib809x_dib8000_config
[1]);
1795 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
1798 static int nim8096md_tuner_attach(struct dvb_usb_adapter
*adap
)
1800 struct dib0700_adapter_state
*st
= adap
->priv
;
1801 struct i2c_adapter
*tun_i2c
;
1802 struct dvb_frontend
*fe_slave
= st
->dib8000_ops
.get_slave_frontend(adap
->fe_adap
[0].fe
, 1);
1805 tun_i2c
= st
->dib8000_ops
.get_i2c_master(fe_slave
, DIBX000_I2C_INTERFACE_TUNER
, 1);
1806 if (dvb_attach(dib0090_register
, fe_slave
, tun_i2c
, &dib809x_dib0090_config
) == NULL
)
1808 fe_slave
->dvb
= adap
->fe_adap
[0].fe
->dvb
;
1809 fe_slave
->ops
.tuner_ops
.set_params
= dib8096_set_param_override
;
1811 tun_i2c
= st
->dib8000_ops
.get_i2c_master(adap
->fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_TUNER
, 1);
1812 if (dvb_attach(dib0090_register
, adap
->fe_adap
[0].fe
, tun_i2c
, &dib809x_dib0090_config
) == NULL
)
1815 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
1816 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib8096_set_param_override
;
1821 static int nim8096md_frontend_attach(struct dvb_usb_adapter
*adap
)
1823 struct dvb_frontend
*fe_slave
;
1824 struct dib0700_adapter_state
*state
= adap
->priv
;
1826 if (!dvb_attach(dib8000_attach
, &state
->dib8000_ops
))
1829 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0);
1831 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
1833 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
1834 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
1835 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
1837 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
1839 dib0700_ctrl_clock(adap
->dev
, 72, 1);
1842 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
1844 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
1846 state
->dib8000_ops
.i2c_enumeration(&adap
->dev
->i2c_adap
, 2, 18, 0x80, 0);
1848 adap
->fe_adap
[0].fe
= state
->dib8000_ops
.init(&adap
->dev
->i2c_adap
, 0x80, &dib809x_dib8000_config
[0]);
1849 if (adap
->fe_adap
[0].fe
== NULL
)
1852 /* Needed to increment refcount */
1853 if (!dvb_attach(dib8000_attach
, &state
->dib8000_ops
))
1856 fe_slave
= state
->dib8000_ops
.init(&adap
->dev
->i2c_adap
, 0x82, &dib809x_dib8000_config
[1]);
1857 state
->dib8000_ops
.set_slave_frontend(adap
->fe_adap
[0].fe
, fe_slave
);
1859 return fe_slave
== NULL
? -ENODEV
: 0;
1863 static struct dibx000_agc_config dib8096p_agc_config
[2] = {
1865 .band_caps
= BAND_UHF
,
1866 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0,
1867 P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0,
1868 P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
1869 P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5,
1871 .setup
= (0 << 15) | (0 << 14) | (5 << 11)
1872 | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5)
1873 | (0 << 4) | (5 << 1) | (0 << 0),
1876 .time_stabiliz
= 10,
1907 .perform_agc_softsplit
= 0,
1909 .band_caps
= BAND_FM
| BAND_VHF
| BAND_CBAND
,
1910 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0,
1911 P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0,
1912 P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
1913 P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5,
1915 .setup
= (0 << 15) | (0 << 14) | (5 << 11)
1916 | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5)
1917 | (0 << 4) | (5 << 1) | (0 << 0),
1920 .time_stabiliz
= 10,
1951 .perform_agc_softsplit
= 0,
1955 static struct dibx000_bandwidth_config dib8096p_clock_config_12_mhz
= {
1965 .IO_CLK_en_core
= 0,
1968 .sad_cfg
= (3 << 14) | (1 << 12) | (524 << 0),
1969 .ifreq
= (0 << 25) | 0,
1971 .xtal_hz
= 12000000,
1974 static struct dib8000_config tfe8096p_dib8000_config
= {
1975 .output_mpeg2_in_188_bytes
= 1,
1976 .hostbus_diversity
= 1,
1979 .agc_config_count
= 2,
1980 .agc
= dib8096p_agc_config
,
1981 .pll
= &dib8096p_clock_config_12_mhz
,
1983 .gpio_dir
= DIB8000_GPIO_DEFAULT_DIRECTIONS
,
1984 .gpio_val
= DIB8000_GPIO_DEFAULT_VALUES
,
1985 .gpio_pwm_pos
= DIB8000_GPIO_DEFAULT_PWM_POS
,
1987 .agc_control
= NULL
,
1988 .diversity_delay
= 48,
1989 .output_mode
= OUTMODE_MPEG2_FIFO
,
1993 static struct dib0090_wbd_slope dib8096p_wbd_table
[] = {
1994 { 380, 81, 850, 64, 540, 4},
1995 { 860, 51, 866, 21, 375, 4},
1996 {1700, 0, 250, 0, 100, 6},
1997 {2600, 0, 250, 0, 100, 6},
1998 { 0xFFFF, 0, 0, 0, 0, 0},
2001 static struct dib0090_config tfe8096p_dib0090_config
= {
2002 .io
.clock_khz
= 12000,
2006 .io
.pll_loopdiv
= 6,
2007 .io
.adc_clock_ratio
= 0,
2008 .io
.pll_int_loop_filt
= 0,
2010 .freq_offset_khz_uhf
= -143,
2011 .freq_offset_khz_vhf
= -143,
2013 .get_adc_power
= dib8090_get_adc_power
,
2018 .wbd_vhf_offset
= 0,
2019 .wbd_cband_offset
= 0,
2023 .fref_clock_ratio
= 1,
2025 .ls_cfg_pad_drv
= 0,
2029 .force_cband_input
= 0,
2032 struct dibx090p_adc
{
2033 u32 freq
; /* RF freq MHz */
2034 u32 timf
; /* New Timf */
2035 u32 pll_loopdiv
; /* New prediv */
2036 u32 pll_prediv
; /* New loopdiv */
2039 struct dibx090p_best_adc
{
2045 static int dib8096p_get_best_sampling(struct dvb_frontend
*fe
, struct dibx090p_best_adc
*adc
)
2047 u8 spur
= 0, prediv
= 0, loopdiv
= 0, min_prediv
= 1, max_prediv
= 1;
2049 u16 fcp_min
= 1900; /* PLL, Minimum Frequency of phase comparator (KHz) */
2050 u16 fcp_max
= 20000; /* PLL, Maximum Frequency of phase comparator (KHz) */
2051 u32 fmem_max
= 140000; /* 140MHz max SDRAM freq */
2052 u32 fdem_min
= 66000;
2053 u32 fcp
= 0, fs
= 0, fdem
= 0, fmem
= 0;
2054 u32 harmonic_id
= 0;
2057 adc
->pll_loopdiv
= loopdiv
;
2058 adc
->pll_prediv
= prediv
;
2060 deb_info("bandwidth = %d", fe
->dtv_property_cache
.bandwidth_hz
);
2062 /* Find Min and Max prediv */
2063 while ((xtal
/ max_prediv
) >= fcp_min
)
2067 min_prediv
= max_prediv
;
2068 while ((xtal
/ min_prediv
) <= fcp_max
) {
2070 if (min_prediv
== 1)
2073 deb_info("MIN prediv = %d : MAX prediv = %d", min_prediv
, max_prediv
);
2077 for (prediv
= min_prediv
; prediv
< max_prediv
; prediv
++) {
2078 fcp
= xtal
/ prediv
;
2079 if (fcp
> fcp_min
&& fcp
< fcp_max
) {
2080 for (loopdiv
= 1; loopdiv
< 64; loopdiv
++) {
2081 fmem
= ((xtal
/prediv
) * loopdiv
);
2085 /* test min/max system restrictions */
2086 if ((fdem
>= fdem_min
) && (fmem
<= fmem_max
) && (fs
>= fe
->dtv_property_cache
.bandwidth_hz
/ 1000)) {
2088 /* test fs harmonics positions */
2089 for (harmonic_id
= (fe
->dtv_property_cache
.frequency
/ (1000 * fs
)); harmonic_id
<= ((fe
->dtv_property_cache
.frequency
/ (1000 * fs
)) + 1); harmonic_id
++) {
2090 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)))) {
2097 adc
->pll_loopdiv
= loopdiv
;
2098 adc
->pll_prediv
= prediv
;
2099 adc
->timf
= (4260880253U / fdem
) * (1 << 8);
2100 adc
->timf
+= ((4260880253U % fdem
) << 8) / fdem
;
2102 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
);
2112 if (adc
->pll_loopdiv
== 0 && adc
->pll_prediv
== 0)
2117 static int dib8096p_agc_startup(struct dvb_frontend
*fe
)
2119 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
2120 struct dib0700_adapter_state
*state
= adap
->priv
;
2121 struct dibx000_bandwidth_config pll
;
2122 struct dibx090p_best_adc adc
;
2126 ret
= state
->set_param_save(fe
);
2129 memset(&pll
, 0, sizeof(struct dibx000_bandwidth_config
));
2131 dib0090_pwm_gain_reset(fe
);
2132 /* dib0090_get_wbd_target is returning any possible
2133 temperature compensated wbd-target */
2134 target
= (dib0090_get_wbd_target(fe
) * 8 + 1) / 2;
2135 state
->dib8000_ops
.set_wbd_ref(fe
, target
);
2137 if (dib8096p_get_best_sampling(fe
, &adc
) == 0) {
2138 pll
.pll_ratio
= adc
.pll_loopdiv
;
2139 pll
.pll_prediv
= adc
.pll_prediv
;
2141 dib0700_set_i2c_speed(adap
->dev
, 200);
2142 state
->dib8000_ops
.update_pll(fe
, &pll
, fe
->dtv_property_cache
.bandwidth_hz
/ 1000, 0);
2143 state
->dib8000_ops
.ctrl_timf(fe
, DEMOD_TIMF_SET
, adc
.timf
);
2144 dib0700_set_i2c_speed(adap
->dev
, 1000);
2149 static int tfe8096p_frontend_attach(struct dvb_usb_adapter
*adap
)
2151 struct dib0700_state
*st
= adap
->dev
->priv
;
2153 struct dib0700_adapter_state
*state
= adap
->priv
;
2155 if (!dvb_attach(dib8000_attach
, &state
->dib8000_ops
))
2158 dib0700_get_version(adap
->dev
, NULL
, NULL
, &fw_version
, NULL
);
2159 if (fw_version
>= 0x10200)
2160 st
->fw_use_new_i2c_api
= 1;
2162 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
2164 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
2165 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
2166 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
2168 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
2170 dib0700_ctrl_clock(adap
->dev
, 72, 1);
2173 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
2175 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
2177 state
->dib8000_ops
.i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 0x10, 0x80, 1);
2179 adap
->fe_adap
[0].fe
= state
->dib8000_ops
.init(&adap
->dev
->i2c_adap
,
2180 0x80, &tfe8096p_dib8000_config
);
2182 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
2185 static int tfe8096p_tuner_attach(struct dvb_usb_adapter
*adap
)
2187 struct dib0700_adapter_state
*st
= adap
->priv
;
2188 struct i2c_adapter
*tun_i2c
= st
->dib8000_ops
.get_i2c_tuner(adap
->fe_adap
[0].fe
);
2190 tfe8096p_dib0090_config
.reset
= st
->dib8000_ops
.tuner_sleep
;
2191 tfe8096p_dib0090_config
.sleep
= st
->dib8000_ops
.tuner_sleep
;
2192 tfe8096p_dib0090_config
.wbd
= dib8096p_wbd_table
;
2194 if (dvb_attach(dib0090_register
, adap
->fe_adap
[0].fe
, tun_i2c
,
2195 &tfe8096p_dib0090_config
) == NULL
)
2198 st
->dib8000_ops
.set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 1);
2200 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
2201 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib8096p_agc_startup
;
2206 static int dib90x0_pid_filter(struct dvb_usb_adapter
*adapter
, int index
, u16 pid
, int onoff
)
2208 return dib9000_fw_pid_filter(adapter
->fe_adap
[0].fe
, index
, pid
, onoff
);
2211 static int dib90x0_pid_filter_ctrl(struct dvb_usb_adapter
*adapter
, int onoff
)
2213 return dib9000_fw_pid_filter_ctrl(adapter
->fe_adap
[0].fe
, onoff
);
2216 static int dib90x0_tuner_reset(struct dvb_frontend
*fe
, int onoff
)
2218 return dib9000_set_gpio(fe
, 5, 0, !onoff
);
2221 static int dib90x0_tuner_sleep(struct dvb_frontend
*fe
, int onoff
)
2223 return dib9000_set_gpio(fe
, 0, 0, onoff
);
2226 static int dib01x0_pmu_update(struct i2c_adapter
*i2c
, u16
*data
, u8 len
)
2228 u8 wb
[4] = { 0xc >> 8, 0xc & 0xff, 0, 0 };
2230 struct i2c_msg msg
[2] = {
2231 {.addr
= 0x1e >> 1, .flags
= 0, .buf
= wb
, .len
= 2},
2232 {.addr
= 0x1e >> 1, .flags
= I2C_M_RD
, .buf
= rb
, .len
= 2},
2236 dibx000_i2c_set_speed(i2c
, 250);
2238 if (i2c_transfer(i2c
, msg
, 2) != 2)
2241 switch (rb
[0] << 8 | rb
[1]) {
2243 deb_info("Found DiB0170 rev1: This version of DiB0170 is not supported any longer.\n");
2246 deb_info("Found DiB0170 rev2");
2249 deb_info("Found DiB0190 rev2");
2252 deb_info("DiB01x0 not found");
2256 for (index_data
= 0; index_data
< len
; index_data
+= 2) {
2257 wb
[2] = (data
[index_data
+ 1] >> 8) & 0xff;
2258 wb
[3] = (data
[index_data
+ 1]) & 0xff;
2260 if (data
[index_data
] == 0) {
2261 wb
[0] = (data
[index_data
] >> 8) & 0xff;
2262 wb
[1] = (data
[index_data
]) & 0xff;
2264 if (i2c_transfer(i2c
, msg
, 2) != 2)
2267 wb
[3] |= rb
[1] & ~(3 << 4);
2270 wb
[0] = (data
[index_data
] >> 8)&0xff;
2271 wb
[1] = (data
[index_data
])&0xff;
2273 if (i2c_transfer(i2c
, &msg
[0], 1) != 1)
2279 static struct dib9000_config stk9090m_config
= {
2280 .output_mpeg2_in_188_bytes
= 1,
2281 .output_mode
= OUTMODE_MPEG2_FIFO
,
2282 .vcxo_timer
= 279620,
2283 .timing_frequency
= 20452225,
2284 .demod_clock_khz
= 60000,
2285 .xtal_clock_khz
= 30000,
2286 .if_drives
= (0 << 15) | (1 << 13) | (0 << 12) | (3 << 10) | (0 << 9) | (1 << 7) | (0 << 6) | (0 << 4) | (1 << 3) | (1 << 1) | (0),
2290 { 240, { BOARD_GPIO_COMPONENT_DEMOD
, BOARD_GPIO_FUNCTION_SUBBAND_GPIO
, 0x0008, 0x0000, 0x0008 } }, /* GPIO 3 to 1 for VHF */
2291 { 890, { BOARD_GPIO_COMPONENT_DEMOD
, BOARD_GPIO_FUNCTION_SUBBAND_GPIO
, 0x0008, 0x0000, 0x0000 } }, /* GPIO 3 to 0 for UHF */
2296 { .component
= BOARD_GPIO_COMPONENT_DEMOD
, .function
= BOARD_GPIO_FUNCTION_COMPONENT_ON
, .mask
= 0x10 | 0x21, .direction
= 0 & ~0x21, .value
= (0x10 & ~0x1) | 0x20 },
2297 { .component
= BOARD_GPIO_COMPONENT_DEMOD
, .function
= BOARD_GPIO_FUNCTION_COMPONENT_OFF
, .mask
= 0x10 | 0x21, .direction
= 0 & ~0x21, .value
= 0 | 0x21 },
2301 static struct dib9000_config nim9090md_config
[2] = {
2303 .output_mpeg2_in_188_bytes
= 1,
2304 .output_mode
= OUTMODE_MPEG2_FIFO
,
2305 .vcxo_timer
= 279620,
2306 .timing_frequency
= 20452225,
2307 .demod_clock_khz
= 60000,
2308 .xtal_clock_khz
= 30000,
2309 .if_drives
= (0 << 15) | (1 << 13) | (0 << 12) | (3 << 10) | (0 << 9) | (1 << 7) | (0 << 6) | (0 << 4) | (1 << 3) | (1 << 1) | (0),
2311 .output_mpeg2_in_188_bytes
= 1,
2312 .output_mode
= OUTMODE_DIVERSITY
,
2313 .vcxo_timer
= 279620,
2314 .timing_frequency
= 20452225,
2315 .demod_clock_khz
= 60000,
2316 .xtal_clock_khz
= 30000,
2317 .if_drives
= (0 << 15) | (1 << 13) | (0 << 12) | (3 << 10) | (0 << 9) | (1 << 7) | (0 << 6) | (0 << 4) | (1 << 3) | (1 << 1) | (0),
2321 { 240, { BOARD_GPIO_COMPONENT_DEMOD
, BOARD_GPIO_FUNCTION_SUBBAND_GPIO
, 0x0006, 0x0000, 0x0006 } }, /* GPIO 1 and 2 to 1 for VHF */
2322 { 890, { BOARD_GPIO_COMPONENT_DEMOD
, BOARD_GPIO_FUNCTION_SUBBAND_GPIO
, 0x0006, 0x0000, 0x0000 } }, /* GPIO 1 and 2 to 0 for UHF */
2327 { .component
= BOARD_GPIO_COMPONENT_DEMOD
, .function
= BOARD_GPIO_FUNCTION_COMPONENT_ON
, .mask
= 0x10 | 0x21, .direction
= 0 & ~0x21, .value
= (0x10 & ~0x1) | 0x20 },
2328 { .component
= BOARD_GPIO_COMPONENT_DEMOD
, .function
= BOARD_GPIO_FUNCTION_COMPONENT_OFF
, .mask
= 0x10 | 0x21, .direction
= 0 & ~0x21, .value
= 0 | 0x21 },
2333 static struct dib0090_config dib9090_dib0090_config
= {
2337 .io
.pll_loopdiv
= 8,
2338 .io
.adc_clock_ratio
= 8,
2339 .io
.pll_int_loop_filt
= 0,
2340 .io
.clock_khz
= 30000,
2341 .reset
= dib90x0_tuner_reset
,
2342 .sleep
= dib90x0_tuner_sleep
,
2347 .freq_offset_khz_uhf
= 0,
2348 .freq_offset_khz_vhf
= 0,
2351 static struct dib0090_config nim9090md_dib0090_config
[2] = {
2356 .io
.pll_loopdiv
= 8,
2357 .io
.adc_clock_ratio
= 8,
2358 .io
.pll_int_loop_filt
= 0,
2359 .io
.clock_khz
= 30000,
2360 .reset
= dib90x0_tuner_reset
,
2361 .sleep
= dib90x0_tuner_sleep
,
2366 .freq_offset_khz_uhf
= 0,
2367 .freq_offset_khz_vhf
= 0,
2372 .io
.pll_loopdiv
= 8,
2373 .io
.adc_clock_ratio
= 8,
2374 .io
.pll_int_loop_filt
= 0,
2375 .io
.clock_khz
= 30000,
2376 .reset
= dib90x0_tuner_reset
,
2377 .sleep
= dib90x0_tuner_sleep
,
2382 .freq_offset_khz_uhf
= 0,
2383 .freq_offset_khz_vhf
= 0,
2388 static int stk9090m_frontend_attach(struct dvb_usb_adapter
*adap
)
2390 struct dib0700_adapter_state
*state
= adap
->priv
;
2391 struct dib0700_state
*st
= adap
->dev
->priv
;
2394 /* Make use of the new i2c functions from FW 1.20 */
2395 dib0700_get_version(adap
->dev
, NULL
, NULL
, &fw_version
, NULL
);
2396 if (fw_version
>= 0x10200)
2397 st
->fw_use_new_i2c_api
= 1;
2398 dib0700_set_i2c_speed(adap
->dev
, 340);
2400 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
2402 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
2403 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
2404 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
2405 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
2407 dib0700_ctrl_clock(adap
->dev
, 72, 1);
2410 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
2412 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
2414 dib9000_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 0x10, 0x80);
2416 if (request_firmware(&state
->frontend_firmware
, "dib9090.fw", &adap
->dev
->udev
->dev
)) {
2417 deb_info("%s: Upload failed. (file not found?)\n", __func__
);
2420 deb_info("%s: firmware read %zu bytes.\n", __func__
, state
->frontend_firmware
->size
);
2422 stk9090m_config
.microcode_B_fe_size
= state
->frontend_firmware
->size
;
2423 stk9090m_config
.microcode_B_fe_buffer
= state
->frontend_firmware
->data
;
2425 adap
->fe_adap
[0].fe
= dvb_attach(dib9000_attach
, &adap
->dev
->i2c_adap
, 0x80, &stk9090m_config
);
2427 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
2430 static int dib9090_tuner_attach(struct dvb_usb_adapter
*adap
)
2432 struct dib0700_adapter_state
*state
= adap
->priv
;
2433 struct i2c_adapter
*i2c
= dib9000_get_tuner_interface(adap
->fe_adap
[0].fe
);
2434 u16 data_dib190
[10] = {
2442 if (!IS_ENABLED(CONFIG_DVB_DIB9000
))
2444 if (dvb_attach(dib0090_fw_register
, adap
->fe_adap
[0].fe
, i2c
, &dib9090_dib0090_config
) == NULL
)
2446 i2c
= dib9000_get_i2c_master(adap
->fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_GPIO_1_2
, 0);
2449 if (dib01x0_pmu_update(i2c
, data_dib190
, 10) != 0)
2451 dib0700_set_i2c_speed(adap
->dev
, 1500);
2452 if (dib9000_firmware_post_pll_init(adap
->fe_adap
[0].fe
) < 0)
2454 release_firmware(state
->frontend_firmware
);
2458 static int nim9090md_frontend_attach(struct dvb_usb_adapter
*adap
)
2460 struct dib0700_adapter_state
*state
= adap
->priv
;
2461 struct dib0700_state
*st
= adap
->dev
->priv
;
2462 struct i2c_adapter
*i2c
;
2463 struct dvb_frontend
*fe_slave
;
2466 /* Make use of the new i2c functions from FW 1.20 */
2467 dib0700_get_version(adap
->dev
, NULL
, NULL
, &fw_version
, NULL
);
2468 if (fw_version
>= 0x10200)
2469 st
->fw_use_new_i2c_api
= 1;
2470 dib0700_set_i2c_speed(adap
->dev
, 340);
2472 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
2474 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
2475 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
2476 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
2477 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
2479 dib0700_ctrl_clock(adap
->dev
, 72, 1);
2482 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
2484 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
2486 if (request_firmware(&state
->frontend_firmware
, "dib9090.fw", &adap
->dev
->udev
->dev
)) {
2487 deb_info("%s: Upload failed. (file not found?)\n", __func__
);
2490 deb_info("%s: firmware read %zu bytes.\n", __func__
, state
->frontend_firmware
->size
);
2492 nim9090md_config
[0].microcode_B_fe_size
= state
->frontend_firmware
->size
;
2493 nim9090md_config
[0].microcode_B_fe_buffer
= state
->frontend_firmware
->data
;
2494 nim9090md_config
[1].microcode_B_fe_size
= state
->frontend_firmware
->size
;
2495 nim9090md_config
[1].microcode_B_fe_buffer
= state
->frontend_firmware
->data
;
2497 dib9000_i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 0x20, 0x80);
2498 adap
->fe_adap
[0].fe
= dvb_attach(dib9000_attach
, &adap
->dev
->i2c_adap
, 0x80, &nim9090md_config
[0]);
2500 if (adap
->fe_adap
[0].fe
== NULL
)
2503 i2c
= dib9000_get_i2c_master(adap
->fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_GPIO_3_4
, 0);
2504 dib9000_i2c_enumeration(i2c
, 1, 0x12, 0x82);
2506 fe_slave
= dvb_attach(dib9000_attach
, i2c
, 0x82, &nim9090md_config
[1]);
2507 dib9000_set_slave_frontend(adap
->fe_adap
[0].fe
, fe_slave
);
2509 return fe_slave
== NULL
? -ENODEV
: 0;
2512 static int nim9090md_tuner_attach(struct dvb_usb_adapter
*adap
)
2514 struct dib0700_adapter_state
*state
= adap
->priv
;
2515 struct i2c_adapter
*i2c
;
2516 struct dvb_frontend
*fe_slave
;
2517 u16 data_dib190
[10] = {
2524 if (!IS_ENABLED(CONFIG_DVB_DIB9000
))
2526 i2c
= dib9000_get_tuner_interface(adap
->fe_adap
[0].fe
);
2527 if (dvb_attach(dib0090_fw_register
, adap
->fe_adap
[0].fe
, i2c
, &nim9090md_dib0090_config
[0]) == NULL
)
2529 i2c
= dib9000_get_i2c_master(adap
->fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_GPIO_1_2
, 0);
2532 if (dib01x0_pmu_update(i2c
, data_dib190
, 10) < 0)
2535 dib0700_set_i2c_speed(adap
->dev
, 1500);
2536 if (dib9000_firmware_post_pll_init(adap
->fe_adap
[0].fe
) < 0)
2539 fe_slave
= dib9000_get_slave_frontend(adap
->fe_adap
[0].fe
, 1);
2540 if (fe_slave
!= NULL
) {
2541 i2c
= dib9000_get_component_bus_interface(adap
->fe_adap
[0].fe
);
2542 dib9000_set_i2c_adapter(fe_slave
, i2c
);
2544 i2c
= dib9000_get_tuner_interface(fe_slave
);
2545 if (dvb_attach(dib0090_fw_register
, fe_slave
, i2c
, &nim9090md_dib0090_config
[1]) == NULL
)
2547 fe_slave
->dvb
= adap
->fe_adap
[0].fe
->dvb
;
2548 dib9000_fw_set_component_bus_speed(adap
->fe_adap
[0].fe
, 1500);
2549 if (dib9000_firmware_post_pll_init(fe_slave
) < 0)
2552 release_firmware(state
->frontend_firmware
);
2558 static int dib7090p_get_best_sampling(struct dvb_frontend
*fe
, struct dibx090p_best_adc
*adc
)
2560 u8 spur
= 0, prediv
= 0, loopdiv
= 0, min_prediv
= 1, max_prediv
= 1;
2563 u32 fcp_min
= 1900; /* PLL Minimum Frequency comparator KHz */
2564 u32 fcp_max
= 20000; /* PLL Maximum Frequency comparator KHz */
2565 u32 fdem_max
= 76000;
2566 u32 fdem_min
= 69500;
2567 u32 fcp
= 0, fs
= 0, fdem
= 0;
2568 u32 harmonic_id
= 0;
2570 adc
->pll_loopdiv
= loopdiv
;
2571 adc
->pll_prediv
= prediv
;
2574 deb_info("bandwidth = %d fdem_min =%d", fe
->dtv_property_cache
.bandwidth_hz
, fdem_min
);
2576 /* Find Min and Max prediv */
2577 while ((xtal
/max_prediv
) >= fcp_min
)
2581 min_prediv
= max_prediv
;
2582 while ((xtal
/min_prediv
) <= fcp_max
) {
2584 if (min_prediv
== 1)
2587 deb_info("MIN prediv = %d : MAX prediv = %d", min_prediv
, max_prediv
);
2591 for (prediv
= min_prediv
; prediv
< max_prediv
; prediv
++) {
2592 fcp
= xtal
/ prediv
;
2593 if (fcp
> fcp_min
&& fcp
< fcp_max
) {
2594 for (loopdiv
= 1 ; loopdiv
< 64 ; loopdiv
++) {
2595 fdem
= ((xtal
/prediv
) * loopdiv
);
2597 /* test min/max system restrictions */
2599 if ((fdem
>= fdem_min
) && (fdem
<= fdem_max
) && (fs
>= fe
->dtv_property_cache
.bandwidth_hz
/1000)) {
2601 /* test fs harmonics positions */
2602 for (harmonic_id
= (fe
->dtv_property_cache
.frequency
/ (1000*fs
)) ; harmonic_id
<= ((fe
->dtv_property_cache
.frequency
/ (1000*fs
))+1) ; harmonic_id
++) {
2603 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)))) {
2610 adc
->pll_loopdiv
= loopdiv
;
2611 adc
->pll_prediv
= prediv
;
2612 adc
->timf
= 2396745143UL/fdem
*(1 << 9);
2613 adc
->timf
+= ((2396745143UL%fdem
) << 9)/fdem
;
2614 deb_info("loopdiv=%i prediv=%i timf=%i", loopdiv
, prediv
, adc
->timf
);
2625 if (adc
->pll_loopdiv
== 0 && adc
->pll_prediv
== 0)
2631 static int dib7090_agc_startup(struct dvb_frontend
*fe
)
2633 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
2634 struct dib0700_adapter_state
*state
= adap
->priv
;
2635 struct dibx000_bandwidth_config pll
;
2637 struct dibx090p_best_adc adc
;
2640 ret
= state
->set_param_save(fe
);
2644 memset(&pll
, 0, sizeof(struct dibx000_bandwidth_config
));
2645 dib0090_pwm_gain_reset(fe
);
2646 target
= (dib0090_get_wbd_target(fe
) * 8 + 1) / 2;
2647 state
->dib7000p_ops
.set_wbd_ref(fe
, target
);
2649 if (dib7090p_get_best_sampling(fe
, &adc
) == 0) {
2650 pll
.pll_ratio
= adc
.pll_loopdiv
;
2651 pll
.pll_prediv
= adc
.pll_prediv
;
2653 state
->dib7000p_ops
.update_pll(fe
, &pll
);
2654 state
->dib7000p_ops
.ctrl_timf(fe
, DEMOD_TIMF_SET
, adc
.timf
);
2659 static int dib7090_agc_restart(struct dvb_frontend
*fe
, u8 restart
)
2661 deb_info("AGC restart callback: %d", restart
);
2662 if (restart
== 0) /* before AGC startup */
2663 dib0090_set_dc_servo(fe
, 1);
2667 static int tfe7790p_update_lna(struct dvb_frontend
*fe
, u16 agc_global
)
2669 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
2670 struct dib0700_adapter_state
*state
= adap
->priv
;
2672 deb_info("update LNA: agc global=%i", agc_global
);
2674 if (agc_global
< 25000) {
2675 state
->dib7000p_ops
.set_gpio(fe
, 8, 0, 0);
2676 state
->dib7000p_ops
.set_agc1_min(fe
, 0);
2678 state
->dib7000p_ops
.set_gpio(fe
, 8, 0, 1);
2679 state
->dib7000p_ops
.set_agc1_min(fe
, 32768);
2685 static struct dib0090_wbd_slope dib7090_wbd_table
[] = {
2686 { 380, 81, 850, 64, 540, 4},
2687 { 860, 51, 866, 21, 375, 4},
2688 {1700, 0, 250, 0, 100, 6},
2689 {2600, 0, 250, 0, 100, 6},
2690 { 0xFFFF, 0, 0, 0, 0, 0},
2693 static struct dibx000_agc_config dib7090_agc_config
[2] = {
2695 .band_caps
= BAND_UHF
,
2696 /* 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,
2697 * 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 */
2698 .setup
= (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
2701 .time_stabiliz
= 10,
2732 .perform_agc_softsplit
= 0,
2734 .band_caps
= BAND_FM
| BAND_VHF
| BAND_CBAND
,
2735 /* 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,
2736 * 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 */
2737 .setup
= (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
2740 .time_stabiliz
= 10,
2771 .perform_agc_softsplit
= 0,
2775 static struct dibx000_bandwidth_config dib7090_clock_config_12_mhz
= {
2785 .IO_CLK_en_core
= 1,
2788 .sad_cfg
= (3 << 14) | (1 << 12) | (524 << 0),
2789 .ifreq
= (0 << 25) | 0,
2791 .xtal_hz
= 15000000,
2794 static struct dib7000p_config nim7090_dib7000p_config
= {
2795 .output_mpeg2_in_188_bytes
= 1,
2796 .hostbus_diversity
= 1,
2797 .tuner_is_baseband
= 1,
2798 .update_lna
= tfe7790p_update_lna
, /* GPIO used is the same as TFE7790 */
2800 .agc_config_count
= 2,
2801 .agc
= dib7090_agc_config
,
2803 .bw
= &dib7090_clock_config_12_mhz
,
2805 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
2806 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
2807 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
2811 .agc_control
= dib7090_agc_restart
,
2814 .disable_sample_and_hold
= 0,
2815 .enable_current_mirror
= 0,
2816 .diversity_delay
= 0,
2818 .output_mode
= OUTMODE_MPEG2_FIFO
,
2822 static int tfe7090p_pvr_update_lna(struct dvb_frontend
*fe
, u16 agc_global
)
2824 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
2825 struct dib0700_adapter_state
*state
= adap
->priv
;
2827 deb_info("TFE7090P-PVR update LNA: agc global=%i", agc_global
);
2828 if (agc_global
< 25000) {
2829 state
->dib7000p_ops
.set_gpio(fe
, 5, 0, 0);
2830 state
->dib7000p_ops
.set_agc1_min(fe
, 0);
2832 state
->dib7000p_ops
.set_gpio(fe
, 5, 0, 1);
2833 state
->dib7000p_ops
.set_agc1_min(fe
, 32768);
2839 static struct dib7000p_config tfe7090pvr_dib7000p_config
[2] = {
2841 .output_mpeg2_in_188_bytes
= 1,
2842 .hostbus_diversity
= 1,
2843 .tuner_is_baseband
= 1,
2844 .update_lna
= tfe7090p_pvr_update_lna
,
2846 .agc_config_count
= 2,
2847 .agc
= dib7090_agc_config
,
2849 .bw
= &dib7090_clock_config_12_mhz
,
2851 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
2852 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
2853 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
2857 .agc_control
= dib7090_agc_restart
,
2860 .disable_sample_and_hold
= 0,
2861 .enable_current_mirror
= 0,
2862 .diversity_delay
= 0,
2864 .output_mode
= OUTMODE_MPEG2_PAR_GATED_CLK
,
2865 .default_i2c_addr
= 0x90,
2868 .output_mpeg2_in_188_bytes
= 1,
2869 .hostbus_diversity
= 1,
2870 .tuner_is_baseband
= 1,
2871 .update_lna
= tfe7090p_pvr_update_lna
,
2873 .agc_config_count
= 2,
2874 .agc
= dib7090_agc_config
,
2876 .bw
= &dib7090_clock_config_12_mhz
,
2878 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
2879 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
2880 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
2884 .agc_control
= dib7090_agc_restart
,
2887 .disable_sample_and_hold
= 0,
2888 .enable_current_mirror
= 0,
2889 .diversity_delay
= 0,
2891 .output_mode
= OUTMODE_MPEG2_PAR_GATED_CLK
,
2892 .default_i2c_addr
= 0x92,
2897 static struct dib0090_config nim7090_dib0090_config
= {
2898 .io
.clock_khz
= 12000,
2902 .io
.pll_loopdiv
= 6,
2903 .io
.adc_clock_ratio
= 0,
2904 .io
.pll_int_loop_filt
= 0,
2906 .freq_offset_khz_uhf
= 0,
2907 .freq_offset_khz_vhf
= 0,
2912 .wbd_vhf_offset
= 0,
2913 .wbd_cband_offset
= 0,
2917 .fref_clock_ratio
= 0,
2919 .wbd
= dib7090_wbd_table
,
2921 .ls_cfg_pad_drv
= 0,
2927 static struct dib7000p_config tfe7790p_dib7000p_config
= {
2928 .output_mpeg2_in_188_bytes
= 1,
2929 .hostbus_diversity
= 1,
2930 .tuner_is_baseband
= 1,
2931 .update_lna
= tfe7790p_update_lna
,
2933 .agc_config_count
= 2,
2934 .agc
= dib7090_agc_config
,
2936 .bw
= &dib7090_clock_config_12_mhz
,
2938 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
2939 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
2940 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
2944 .agc_control
= dib7090_agc_restart
,
2947 .disable_sample_and_hold
= 0,
2948 .enable_current_mirror
= 0,
2949 .diversity_delay
= 0,
2951 .output_mode
= OUTMODE_MPEG2_PAR_GATED_CLK
,
2955 static struct dib0090_config tfe7790p_dib0090_config
= {
2956 .io
.clock_khz
= 12000,
2960 .io
.pll_loopdiv
= 6,
2961 .io
.adc_clock_ratio
= 0,
2962 .io
.pll_int_loop_filt
= 0,
2964 .freq_offset_khz_uhf
= 0,
2965 .freq_offset_khz_vhf
= 0,
2970 .wbd_vhf_offset
= 0,
2971 .wbd_cband_offset
= 0,
2975 .fref_clock_ratio
= 0,
2977 .wbd
= dib7090_wbd_table
,
2979 .ls_cfg_pad_drv
= 0,
2983 .force_cband_input
= 0,
2985 .force_crystal_mode
= 1,
2988 static struct dib0090_config tfe7090pvr_dib0090_config
[2] = {
2990 .io
.clock_khz
= 12000,
2994 .io
.pll_loopdiv
= 6,
2995 .io
.adc_clock_ratio
= 0,
2996 .io
.pll_int_loop_filt
= 0,
2998 .freq_offset_khz_uhf
= 50,
2999 .freq_offset_khz_vhf
= 70,
3004 .wbd_vhf_offset
= 0,
3005 .wbd_cband_offset
= 0,
3009 .fref_clock_ratio
= 0,
3011 .wbd
= dib7090_wbd_table
,
3013 .ls_cfg_pad_drv
= 0,
3018 .io
.clock_khz
= 12000,
3022 .io
.pll_loopdiv
= 6,
3023 .io
.adc_clock_ratio
= 0,
3024 .io
.pll_int_loop_filt
= 0,
3026 .freq_offset_khz_uhf
= -50,
3027 .freq_offset_khz_vhf
= -70,
3032 .wbd_vhf_offset
= 0,
3033 .wbd_cband_offset
= 0,
3037 .fref_clock_ratio
= 0,
3039 .wbd
= dib7090_wbd_table
,
3041 .ls_cfg_pad_drv
= 0,
3048 static int nim7090_frontend_attach(struct dvb_usb_adapter
*adap
)
3050 struct dib0700_adapter_state
*state
= adap
->priv
;
3052 if (!dvb_attach(dib7000p_attach
, &state
->dib7000p_ops
))
3055 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
3057 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
3058 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
3059 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
3060 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
3063 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
3065 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
3067 if (state
->dib7000p_ops
.i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 0x10, &nim7090_dib7000p_config
) != 0) {
3068 err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__
);
3069 dvb_detach(state
->dib7000p_ops
.set_wbd_ref
);
3072 adap
->fe_adap
[0].fe
= state
->dib7000p_ops
.init(&adap
->dev
->i2c_adap
, 0x80, &nim7090_dib7000p_config
);
3074 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
3077 static int nim7090_tuner_attach(struct dvb_usb_adapter
*adap
)
3079 struct dib0700_adapter_state
*st
= adap
->priv
;
3080 struct i2c_adapter
*tun_i2c
= st
->dib7000p_ops
.get_i2c_tuner(adap
->fe_adap
[0].fe
);
3082 nim7090_dib0090_config
.reset
= st
->dib7000p_ops
.tuner_sleep
,
3083 nim7090_dib0090_config
.sleep
= st
->dib7000p_ops
.tuner_sleep
,
3084 nim7090_dib0090_config
.get_adc_power
= st
->dib7000p_ops
.get_adc_power
;
3086 if (dvb_attach(dib0090_register
, adap
->fe_adap
[0].fe
, tun_i2c
, &nim7090_dib0090_config
) == NULL
)
3089 st
->dib7000p_ops
.set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 1);
3091 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
3092 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib7090_agc_startup
;
3096 static int tfe7090pvr_frontend0_attach(struct dvb_usb_adapter
*adap
)
3098 struct dib0700_state
*st
= adap
->dev
->priv
;
3099 struct dib0700_adapter_state
*state
= adap
->priv
;
3101 if (!dvb_attach(dib7000p_attach
, &state
->dib7000p_ops
))
3104 /* The TFE7090 requires the dib0700 to not be in master mode */
3105 st
->disable_streaming_master_mode
= 1;
3107 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
3109 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
3110 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
3111 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
3112 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
3115 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
3117 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
3119 /* initialize IC 0 */
3120 if (state
->dib7000p_ops
.i2c_enumeration(&adap
->dev
->i2c_adap
, 1, 0x20, &tfe7090pvr_dib7000p_config
[0]) != 0) {
3121 err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__
);
3122 dvb_detach(state
->dib7000p_ops
.set_wbd_ref
);
3126 dib0700_set_i2c_speed(adap
->dev
, 340);
3127 adap
->fe_adap
[0].fe
= state
->dib7000p_ops
.init(&adap
->dev
->i2c_adap
, 0x90, &tfe7090pvr_dib7000p_config
[0]);
3128 if (adap
->fe_adap
[0].fe
== NULL
)
3131 state
->dib7000p_ops
.slave_reset(adap
->fe_adap
[0].fe
);
3136 static int tfe7090pvr_frontend1_attach(struct dvb_usb_adapter
*adap
)
3138 struct i2c_adapter
*i2c
;
3139 struct dib0700_adapter_state
*state
= adap
->priv
;
3141 if (adap
->dev
->adapter
[0].fe_adap
[0].fe
== NULL
) {
3142 err("the master dib7090 has to be initialized first");
3143 return -ENODEV
; /* the master device has not been initialized */
3146 if (!dvb_attach(dib7000p_attach
, &state
->dib7000p_ops
))
3149 i2c
= state
->dib7000p_ops
.get_i2c_master(adap
->dev
->adapter
[0].fe_adap
[0].fe
, DIBX000_I2C_INTERFACE_GPIO_6_7
, 1);
3150 if (state
->dib7000p_ops
.i2c_enumeration(i2c
, 1, 0x10, &tfe7090pvr_dib7000p_config
[1]) != 0) {
3151 err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__
);
3152 dvb_detach(state
->dib7000p_ops
.set_wbd_ref
);
3156 adap
->fe_adap
[0].fe
= state
->dib7000p_ops
.init(i2c
, 0x92, &tfe7090pvr_dib7000p_config
[1]);
3157 dib0700_set_i2c_speed(adap
->dev
, 200);
3159 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
3162 static int tfe7090pvr_tuner0_attach(struct dvb_usb_adapter
*adap
)
3164 struct dib0700_adapter_state
*st
= adap
->priv
;
3165 struct i2c_adapter
*tun_i2c
= st
->dib7000p_ops
.get_i2c_tuner(adap
->fe_adap
[0].fe
);
3167 tfe7090pvr_dib0090_config
[0].reset
= st
->dib7000p_ops
.tuner_sleep
;
3168 tfe7090pvr_dib0090_config
[0].sleep
= st
->dib7000p_ops
.tuner_sleep
;
3169 tfe7090pvr_dib0090_config
[0].get_adc_power
= st
->dib7000p_ops
.get_adc_power
;
3171 if (dvb_attach(dib0090_register
, adap
->fe_adap
[0].fe
, tun_i2c
, &tfe7090pvr_dib0090_config
[0]) == NULL
)
3174 st
->dib7000p_ops
.set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 1);
3176 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
3177 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib7090_agc_startup
;
3181 static int tfe7090pvr_tuner1_attach(struct dvb_usb_adapter
*adap
)
3183 struct dib0700_adapter_state
*st
= adap
->priv
;
3184 struct i2c_adapter
*tun_i2c
= st
->dib7000p_ops
.get_i2c_tuner(adap
->fe_adap
[0].fe
);
3186 tfe7090pvr_dib0090_config
[1].reset
= st
->dib7000p_ops
.tuner_sleep
;
3187 tfe7090pvr_dib0090_config
[1].sleep
= st
->dib7000p_ops
.tuner_sleep
;
3188 tfe7090pvr_dib0090_config
[1].get_adc_power
= st
->dib7000p_ops
.get_adc_power
;
3190 if (dvb_attach(dib0090_register
, adap
->fe_adap
[0].fe
, tun_i2c
, &tfe7090pvr_dib0090_config
[1]) == NULL
)
3193 st
->dib7000p_ops
.set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 1);
3195 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
3196 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib7090_agc_startup
;
3200 static int tfe7790p_frontend_attach(struct dvb_usb_adapter
*adap
)
3202 struct dib0700_state
*st
= adap
->dev
->priv
;
3203 struct dib0700_adapter_state
*state
= adap
->priv
;
3205 if (!dvb_attach(dib7000p_attach
, &state
->dib7000p_ops
))
3208 /* The TFE7790P requires the dib0700 to not be in master mode */
3209 st
->disable_streaming_master_mode
= 1;
3211 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
3213 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
3214 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
3215 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
3216 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
3218 dib0700_ctrl_clock(adap
->dev
, 72, 1);
3219 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
3221 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
3223 if (state
->dib7000p_ops
.i2c_enumeration(&adap
->dev
->i2c_adap
,
3224 1, 0x10, &tfe7790p_dib7000p_config
) != 0) {
3225 err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n",
3227 dvb_detach(state
->dib7000p_ops
.set_wbd_ref
);
3230 adap
->fe_adap
[0].fe
= state
->dib7000p_ops
.init(&adap
->dev
->i2c_adap
,
3231 0x80, &tfe7790p_dib7000p_config
);
3233 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
3236 static int tfe7790p_tuner_attach(struct dvb_usb_adapter
*adap
)
3238 struct dib0700_adapter_state
*st
= adap
->priv
;
3239 struct i2c_adapter
*tun_i2c
=
3240 st
->dib7000p_ops
.get_i2c_tuner(adap
->fe_adap
[0].fe
);
3243 tfe7790p_dib0090_config
.reset
= st
->dib7000p_ops
.tuner_sleep
;
3244 tfe7790p_dib0090_config
.sleep
= st
->dib7000p_ops
.tuner_sleep
;
3245 tfe7790p_dib0090_config
.get_adc_power
= st
->dib7000p_ops
.get_adc_power
;
3247 if (dvb_attach(dib0090_register
, adap
->fe_adap
[0].fe
, tun_i2c
,
3248 &tfe7790p_dib0090_config
) == NULL
)
3251 st
->dib7000p_ops
.set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 1);
3253 st
->set_param_save
= adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
;
3254 adap
->fe_adap
[0].fe
->ops
.tuner_ops
.set_params
= dib7090_agc_startup
;
3259 static struct dib7000p_config stk7070pd_dib7000p_config
[2] = {
3261 .output_mpeg2_in_188_bytes
= 1,
3263 .agc_config_count
= 1,
3264 .agc
= &dib7070_agc_config
,
3265 .bw
= &dib7070_bw_config_12_mhz
,
3266 .tuner_is_baseband
= 1,
3269 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
3270 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
3271 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
3273 .hostbus_diversity
= 1,
3275 .output_mpeg2_in_188_bytes
= 1,
3277 .agc_config_count
= 1,
3278 .agc
= &dib7070_agc_config
,
3279 .bw
= &dib7070_bw_config_12_mhz
,
3280 .tuner_is_baseband
= 1,
3283 .gpio_dir
= DIB7000P_GPIO_DEFAULT_DIRECTIONS
,
3284 .gpio_val
= DIB7000P_GPIO_DEFAULT_VALUES
,
3285 .gpio_pwm_pos
= DIB7000P_GPIO_DEFAULT_PWM_POS
,
3287 .hostbus_diversity
= 1,
3291 static void stk7070pd_init(struct dvb_usb_device
*dev
)
3293 dib0700_set_gpio(dev
, GPIO6
, GPIO_OUT
, 1);
3295 dib0700_set_gpio(dev
, GPIO9
, GPIO_OUT
, 1);
3296 dib0700_set_gpio(dev
, GPIO4
, GPIO_OUT
, 1);
3297 dib0700_set_gpio(dev
, GPIO7
, GPIO_OUT
, 1);
3298 dib0700_set_gpio(dev
, GPIO10
, GPIO_OUT
, 0);
3300 dib0700_ctrl_clock(dev
, 72, 1);
3303 dib0700_set_gpio(dev
, GPIO10
, GPIO_OUT
, 1);
3306 static int stk7070pd_frontend_attach0(struct dvb_usb_adapter
*adap
)
3308 struct dib0700_adapter_state
*state
= adap
->priv
;
3310 if (!dvb_attach(dib7000p_attach
, &state
->dib7000p_ops
))
3313 stk7070pd_init(adap
->dev
);
3316 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
3318 if (state
->dib7000p_ops
.i2c_enumeration(&adap
->dev
->i2c_adap
, 2, 18,
3319 stk7070pd_dib7000p_config
) != 0) {
3320 err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n",
3322 dvb_detach(state
->dib7000p_ops
.set_wbd_ref
);
3326 adap
->fe_adap
[0].fe
= state
->dib7000p_ops
.init(&adap
->dev
->i2c_adap
, 0x80, &stk7070pd_dib7000p_config
[0]);
3327 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
3330 static int stk7070pd_frontend_attach1(struct dvb_usb_adapter
*adap
)
3332 struct dib0700_adapter_state
*state
= adap
->priv
;
3334 if (!dvb_attach(dib7000p_attach
, &state
->dib7000p_ops
))
3337 adap
->fe_adap
[0].fe
= state
->dib7000p_ops
.init(&adap
->dev
->i2c_adap
, 0x82, &stk7070pd_dib7000p_config
[1]);
3338 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
3341 static int novatd_read_status_override(struct dvb_frontend
*fe
,
3342 enum fe_status
*stat
)
3344 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
3345 struct dvb_usb_device
*dev
= adap
->dev
;
3346 struct dib0700_state
*state
= dev
->priv
;
3349 ret
= state
->read_status(fe
, stat
);
3352 dib0700_set_gpio(dev
, adap
->id
== 0 ? GPIO1
: GPIO0
, GPIO_OUT
,
3353 !!(*stat
& FE_HAS_LOCK
));
3358 static int novatd_sleep_override(struct dvb_frontend
* fe
)
3360 struct dvb_usb_adapter
*adap
= fe
->dvb
->priv
;
3361 struct dvb_usb_device
*dev
= adap
->dev
;
3362 struct dib0700_state
*state
= dev
->priv
;
3365 dib0700_set_gpio(dev
, adap
->id
== 0 ? GPIO1
: GPIO0
, GPIO_OUT
, 0);
3367 return state
->sleep(fe
);
3371 * novatd_frontend_attach - Nova-TD specific attach
3373 * Nova-TD has GPIO0, 1 and 2 for LEDs. So do not fiddle with them except for
3374 * information purposes.
3376 static int novatd_frontend_attach(struct dvb_usb_adapter
*adap
)
3378 struct dvb_usb_device
*dev
= adap
->dev
;
3379 struct dib0700_state
*st
= dev
->priv
;
3380 struct dib0700_adapter_state
*state
= adap
->priv
;
3382 if (!dvb_attach(dib7000p_attach
, &state
->dib7000p_ops
))
3385 if (adap
->id
== 0) {
3386 stk7070pd_init(dev
);
3388 /* turn the power LED on, the other two off (just in case) */
3389 dib0700_set_gpio(dev
, GPIO0
, GPIO_OUT
, 0);
3390 dib0700_set_gpio(dev
, GPIO1
, GPIO_OUT
, 0);
3391 dib0700_set_gpio(dev
, GPIO2
, GPIO_OUT
, 1);
3393 if (state
->dib7000p_ops
.i2c_enumeration(&dev
->i2c_adap
, 2, 18,
3394 stk7070pd_dib7000p_config
) != 0) {
3395 err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n",
3397 dvb_detach(state
->dib7000p_ops
.set_wbd_ref
);
3402 adap
->fe_adap
[0].fe
= state
->dib7000p_ops
.init(&dev
->i2c_adap
,
3403 adap
->id
== 0 ? 0x80 : 0x82,
3404 &stk7070pd_dib7000p_config
[adap
->id
]);
3406 if (adap
->fe_adap
[0].fe
== NULL
)
3409 st
->read_status
= adap
->fe_adap
[0].fe
->ops
.read_status
;
3410 adap
->fe_adap
[0].fe
->ops
.read_status
= novatd_read_status_override
;
3411 st
->sleep
= adap
->fe_adap
[0].fe
->ops
.sleep
;
3412 adap
->fe_adap
[0].fe
->ops
.sleep
= novatd_sleep_override
;
3418 static struct s5h1411_config pinnacle_801e_config
= {
3419 .output_mode
= S5H1411_PARALLEL_OUTPUT
,
3420 .gpio
= S5H1411_GPIO_OFF
,
3421 .mpeg_timing
= S5H1411_MPEGTIMING_NONCONTINUOUS_NONINVERTING_CLOCK
,
3422 .qam_if
= S5H1411_IF_44000
,
3423 .vsb_if
= S5H1411_IF_44000
,
3424 .inversion
= S5H1411_INVERSION_OFF
,
3425 .status_mode
= S5H1411_DEMODLOCKING
3428 /* Pinnacle PCTV HD Pro 801e GPIOs map:
3429 GPIO0 - currently unknown
3430 GPIO1 - xc5000 tuner reset
3431 GPIO2 - CX25843 sleep
3432 GPIO3 - currently unknown
3433 GPIO4 - currently unknown
3434 GPIO6 - currently unknown
3435 GPIO7 - currently unknown
3436 GPIO9 - currently unknown
3437 GPIO10 - CX25843 reset
3439 static int s5h1411_frontend_attach(struct dvb_usb_adapter
*adap
)
3441 struct dib0700_state
*st
= adap
->dev
->priv
;
3443 /* Make use of the new i2c functions from FW 1.20 */
3444 st
->fw_use_new_i2c_api
= 1;
3446 /* The s5h1411 requires the dib0700 to not be in master mode */
3447 st
->disable_streaming_master_mode
= 1;
3449 /* All msleep values taken from Windows USB trace */
3450 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 0);
3451 dib0700_set_gpio(adap
->dev
, GPIO3
, GPIO_OUT
, 0);
3452 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
3454 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
3456 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
3458 dib0700_set_gpio(adap
->dev
, GPIO0
, GPIO_OUT
, 1);
3459 dib0700_set_gpio(adap
->dev
, GPIO9
, GPIO_OUT
, 1);
3460 dib0700_set_gpio(adap
->dev
, GPIO4
, GPIO_OUT
, 1);
3461 dib0700_set_gpio(adap
->dev
, GPIO7
, GPIO_OUT
, 1);
3462 dib0700_set_gpio(adap
->dev
, GPIO2
, GPIO_OUT
, 0);
3465 /* Put the CX25843 to sleep for now since we're in digital mode */
3466 dib0700_set_gpio(adap
->dev
, GPIO2
, GPIO_OUT
, 1);
3468 /* GPIOs are initialized, do the attach */
3469 adap
->fe_adap
[0].fe
= dvb_attach(s5h1411_attach
, &pinnacle_801e_config
,
3470 &adap
->dev
->i2c_adap
);
3471 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
3474 static int dib0700_xc5000_tuner_callback(void *priv
, int component
,
3475 int command
, int arg
)
3477 struct dvb_usb_adapter
*adap
= priv
;
3479 if (command
== XC5000_TUNER_RESET
) {
3480 /* Reset the tuner */
3481 dib0700_set_gpio(adap
->dev
, GPIO1
, GPIO_OUT
, 0);
3483 dib0700_set_gpio(adap
->dev
, GPIO1
, GPIO_OUT
, 1);
3486 err("xc5000: unknown tuner callback command: %d\n", command
);
3493 static struct xc5000_config s5h1411_xc5000_tunerconfig
= {
3494 .i2c_address
= 0x64,
3498 static int xc5000_tuner_attach(struct dvb_usb_adapter
*adap
)
3500 /* FIXME: generalize & move to common area */
3501 adap
->fe_adap
[0].fe
->callback
= dib0700_xc5000_tuner_callback
;
3503 return dvb_attach(xc5000_attach
, adap
->fe_adap
[0].fe
, &adap
->dev
->i2c_adap
,
3504 &s5h1411_xc5000_tunerconfig
)
3505 == NULL
? -ENODEV
: 0;
3508 static int dib0700_xc4000_tuner_callback(void *priv
, int component
,
3509 int command
, int arg
)
3511 struct dvb_usb_adapter
*adap
= priv
;
3512 struct dib0700_adapter_state
*state
= adap
->priv
;
3514 if (command
== XC4000_TUNER_RESET
) {
3515 /* Reset the tuner */
3516 state
->dib7000p_ops
.set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 0);
3518 state
->dib7000p_ops
.set_gpio(adap
->fe_adap
[0].fe
, 8, 0, 1);
3520 err("xc4000: unknown tuner callback command: %d\n", command
);
3527 static struct dibx000_agc_config stk7700p_7000p_xc4000_agc_config
= {
3528 .band_caps
= BAND_UHF
| BAND_VHF
,
3531 .time_stabiliz
= 0x15,
3532 .alpha_level
= 0x00,
3545 .agc1_slope1
= 0x00,
3546 .agc1_slope2
= 0x00,
3549 .agc2_slope1
= 0x1d,
3550 .agc2_slope2
= 0x1d,
3555 .perform_agc_softsplit
= 0x00,
3558 static struct dibx000_bandwidth_config stk7700p_xc4000_pll_config
= {
3568 .IO_CLK_en_core
= 1,
3571 .sad_cfg
= (3 << 14) | (1 << 12) | 524, /* sad_cfg: refsel, sel, freq_15k */
3577 /* FIXME: none of these inputs are validated yet */
3578 static struct dib7000p_config pctv_340e_config
= {
3579 .output_mpeg2_in_188_bytes
= 1,
3581 .agc_config_count
= 1,
3582 .agc
= &stk7700p_7000p_xc4000_agc_config
,
3583 .bw
= &stk7700p_xc4000_pll_config
,
3585 .gpio_dir
= DIB7000M_GPIO_DEFAULT_DIRECTIONS
,
3586 .gpio_val
= DIB7000M_GPIO_DEFAULT_VALUES
,
3587 .gpio_pwm_pos
= DIB7000M_GPIO_DEFAULT_PWM_POS
,
3590 /* PCTV 340e GPIOs map:
3592 GPIO2 - CX25843 sleep
3593 GPIO3 - CS5340 reset
3595 GPIO6 - Power Supply
3596 GPIO8 - LNA (1=off 0=on)
3597 GPIO10 - CX25843 reset
3599 GPIO8 - xc4000 reset
3601 static int pctv340e_frontend_attach(struct dvb_usb_adapter
*adap
)
3603 struct dib0700_state
*st
= adap
->dev
->priv
;
3604 struct dib0700_adapter_state
*state
= adap
->priv
;
3606 if (!dvb_attach(dib7000p_attach
, &state
->dib7000p_ops
))
3609 /* Power Supply on */
3610 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0);
3612 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
3613 msleep(100); /* Allow power supply to settle before probing */
3616 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
3617 msleep(1); /* cx25843 datasheet say 350us required */
3618 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
3620 /* LNA off for now */
3621 dib0700_set_gpio(adap
->dev
, GPIO8
, GPIO_OUT
, 1);
3623 /* Put the CX25843 to sleep for now since we're in digital mode */
3624 dib0700_set_gpio(adap
->dev
, GPIO2
, GPIO_OUT
, 1);
3626 /* FIXME: not verified yet */
3627 dib0700_ctrl_clock(adap
->dev
, 72, 1);
3631 if (state
->dib7000p_ops
.dib7000pc_detection(&adap
->dev
->i2c_adap
) == 0) {
3632 /* Demodulator not found for some reason? */
3633 dvb_detach(state
->dib7000p_ops
.set_wbd_ref
);
3637 adap
->fe_adap
[0].fe
= state
->dib7000p_ops
.init(&adap
->dev
->i2c_adap
, 0x12,
3639 st
->is_dib7000pc
= 1;
3641 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
3644 static struct xc4000_config dib7000p_xc4000_tunerconfig
= {
3645 .i2c_address
= 0x61,
3648 .set_smoothedcvbs
= 0,
3652 static int xc4000_tuner_attach(struct dvb_usb_adapter
*adap
)
3654 struct i2c_adapter
*tun_i2c
;
3655 struct dib0700_adapter_state
*state
= adap
->priv
;
3657 /* The xc4000 is not on the main i2c bus */
3658 tun_i2c
= state
->dib7000p_ops
.get_i2c_master(adap
->fe_adap
[0].fe
,
3659 DIBX000_I2C_INTERFACE_TUNER
, 1);
3660 if (tun_i2c
== NULL
) {
3661 printk(KERN_ERR
"Could not reach tuner i2c bus\n");
3665 /* Setup the reset callback */
3666 adap
->fe_adap
[0].fe
->callback
= dib0700_xc4000_tuner_callback
;
3668 return dvb_attach(xc4000_attach
, adap
->fe_adap
[0].fe
, tun_i2c
,
3669 &dib7000p_xc4000_tunerconfig
)
3670 == NULL
? -ENODEV
: 0;
3673 static struct lgdt3305_config hcw_lgdt3305_config
= {
3675 .mpeg_mode
= LGDT3305_MPEG_PARALLEL
,
3676 .tpclk_edge
= LGDT3305_TPCLK_FALLING_EDGE
,
3677 .tpvalid_polarity
= LGDT3305_TP_VALID_LOW
,
3679 .spectral_inversion
= 1,
3682 .usref_8vsb
= 0x0500,
3685 static struct mxl5007t_config hcw_mxl5007t_config
= {
3686 .xtal_freq_hz
= MxL_XTAL_25_MHZ
,
3687 .if_freq_hz
= MxL_IF_6_MHZ
,
3692 GPIO0 - LNA_CTR (H: LNA power enabled, L: LNA power disabled)
3693 GPIO1 - ANT_SEL (H: VPA, L: MCX)
3699 MXL is behind LG's i2c repeater. LG is on SCL2/SDA2 gpios on the DIB
3701 static int lgdt3305_frontend_attach(struct dvb_usb_adapter
*adap
)
3703 struct dib0700_state
*st
= adap
->dev
->priv
;
3705 /* Make use of the new i2c functions from FW 1.20 */
3706 st
->fw_use_new_i2c_api
= 1;
3708 st
->disable_streaming_master_mode
= 1;
3710 /* fe power enable */
3711 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0);
3713 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
3717 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
3719 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
3721 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
3724 adap
->fe_adap
[0].fe
= dvb_attach(lgdt3305_attach
,
3725 &hcw_lgdt3305_config
,
3726 &adap
->dev
->i2c_adap
);
3728 return adap
->fe_adap
[0].fe
== NULL
? -ENODEV
: 0;
3731 static int mxl5007t_tuner_attach(struct dvb_usb_adapter
*adap
)
3733 return dvb_attach(mxl5007t_attach
, adap
->fe_adap
[0].fe
,
3734 &adap
->dev
->i2c_adap
, 0x60,
3735 &hcw_mxl5007t_config
) == NULL
? -ENODEV
: 0;
3738 static int xbox_one_attach(struct dvb_usb_adapter
*adap
)
3740 struct dib0700_state
*st
= adap
->dev
->priv
;
3741 struct i2c_client
*client_demod
, *client_tuner
;
3742 struct dvb_usb_device
*d
= adap
->dev
;
3743 struct mn88472_config mn88472_config
= { };
3744 struct tda18250_config tda18250_config
;
3745 struct i2c_board_info info
;
3747 st
->fw_use_new_i2c_api
= 1;
3748 st
->disable_streaming_master_mode
= 1;
3750 /* fe power enable */
3751 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 0);
3753 dib0700_set_gpio(adap
->dev
, GPIO6
, GPIO_OUT
, 1);
3757 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
3759 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 0);
3761 dib0700_set_gpio(adap
->dev
, GPIO10
, GPIO_OUT
, 1);
3765 mn88472_config
.fe
= &adap
->fe_adap
[0].fe
;
3766 mn88472_config
.i2c_wr_max
= 22;
3767 mn88472_config
.xtal
= 20500000;
3768 mn88472_config
.ts_mode
= PARALLEL_TS_MODE
;
3769 mn88472_config
.ts_clock
= FIXED_TS_CLOCK
;
3770 memset(&info
, 0, sizeof(struct i2c_board_info
));
3771 strscpy(info
.type
, "mn88472", I2C_NAME_SIZE
);
3773 info
.platform_data
= &mn88472_config
;
3774 request_module(info
.type
);
3775 client_demod
= i2c_new_client_device(&d
->i2c_adap
, &info
);
3776 if (!i2c_client_has_driver(client_demod
))
3777 goto fail_demod_device
;
3778 if (!try_module_get(client_demod
->dev
.driver
->owner
))
3779 goto fail_demod_module
;
3781 st
->i2c_client_demod
= client_demod
;
3783 adap
->fe_adap
[0].fe
= mn88472_config
.get_dvb_frontend(client_demod
);
3786 memset(&tda18250_config
, 0, sizeof(tda18250_config
));
3787 tda18250_config
.if_dvbt_6
= 3950;
3788 tda18250_config
.if_dvbt_7
= 4450;
3789 tda18250_config
.if_dvbt_8
= 4950;
3790 tda18250_config
.if_dvbc_6
= 4950;
3791 tda18250_config
.if_dvbc_8
= 4950;
3792 tda18250_config
.if_atsc
= 4079;
3793 tda18250_config
.loopthrough
= true;
3794 tda18250_config
.xtal_freq
= TDA18250_XTAL_FREQ_27MHZ
;
3795 tda18250_config
.fe
= adap
->fe_adap
[0].fe
;
3797 memset(&info
, 0, sizeof(struct i2c_board_info
));
3798 strscpy(info
.type
, "tda18250", I2C_NAME_SIZE
);
3800 info
.platform_data
= &tda18250_config
;
3802 request_module(info
.type
);
3803 client_tuner
= i2c_new_client_device(&adap
->dev
->i2c_adap
, &info
);
3804 if (!i2c_client_has_driver(client_tuner
))
3805 goto fail_tuner_device
;
3806 if (!try_module_get(client_tuner
->dev
.driver
->owner
))
3807 goto fail_tuner_module
;
3809 st
->i2c_client_tuner
= client_tuner
;
3813 i2c_unregister_device(client_tuner
);
3815 module_put(client_demod
->dev
.driver
->owner
);
3817 i2c_unregister_device(client_demod
);
3823 /* DVB-USB and USB stuff follows */
3824 struct usb_device_id dib0700_usb_id_table
[] = {
3825 /* 0 */ { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK7700P
) },
3826 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK7700P_PC
) },
3827 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_T_500
) },
3828 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_T_500_2
) },
3829 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_T_STICK
) },
3830 /* 5 */ { USB_DEVICE(USB_VID_AVERMEDIA
, USB_PID_AVERMEDIA_VOLAR
) },
3831 { USB_DEVICE(USB_VID_COMPRO
, USB_PID_COMPRO_VIDEOMATE_U500
) },
3832 { USB_DEVICE(USB_VID_UNIWILL
, USB_PID_UNIWILL_STK7700P
) },
3833 { USB_DEVICE(USB_VID_LEADTEK
, USB_PID_WINFAST_DTV_DONGLE_STK7700P
) },
3834 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_T_STICK_2
) },
3835 /* 10 */{ USB_DEVICE(USB_VID_AVERMEDIA
, USB_PID_AVERMEDIA_VOLAR_2
) },
3836 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV2000E
) },
3837 { USB_DEVICE(USB_VID_TERRATEC
,
3838 USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY
) },
3839 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_TD_STICK
) },
3840 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK7700D
) },
3841 /* 15 */{ USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK7070P
) },
3842 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV_DVB_T_FLASH
) },
3843 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK7070PD
) },
3844 { USB_DEVICE(USB_VID_PINNACLE
,
3845 USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T
) },
3846 { USB_DEVICE(USB_VID_COMPRO
, USB_PID_COMPRO_VIDEOMATE_U500_PC
) },
3847 /* 20 */{ USB_DEVICE(USB_VID_AVERMEDIA
, USB_PID_AVERMEDIA_EXPRESS
) },
3848 { USB_DEVICE(USB_VID_GIGABYTE
, USB_PID_GIGABYTE_U7000
) },
3849 { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC
, USB_PID_ARTEC_T14BR
) },
3850 { USB_DEVICE(USB_VID_ASUS
, USB_PID_ASUS_U3000
) },
3851 { USB_DEVICE(USB_VID_ASUS
, USB_PID_ASUS_U3100
) },
3852 /* 25 */{ USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_T_STICK_3
) },
3853 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_MYTV_T
) },
3854 { USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_CINERGY_HT_USB_XE
) },
3855 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_EXPRESSCARD_320CX
) },
3856 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV72E
) },
3857 /* 30 */{ USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV73E
) },
3858 { USB_DEVICE(USB_VID_YUAN
, USB_PID_YUAN_EC372S
) },
3859 { USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_CINERGY_HT_EXPRESS
) },
3860 { USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_CINERGY_T_XXS
) },
3861 { USB_DEVICE(USB_VID_LEADTEK
, USB_PID_WINFAST_DTV_DONGLE_STK7700P_2
) },
3862 /* 35 */{ USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_TD_STICK_52009
) },
3863 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_NOVA_T_500_3
) },
3864 { USB_DEVICE(USB_VID_GIGABYTE
, USB_PID_GIGABYTE_U8000
) },
3865 { USB_DEVICE(USB_VID_YUAN
, USB_PID_YUAN_STK7700PH
) },
3866 { USB_DEVICE(USB_VID_ASUS
, USB_PID_ASUS_U3000H
) },
3867 /* 40 */{ USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV801E
) },
3868 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV801E_SE
) },
3869 { USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_CINERGY_T_EXPRESS
) },
3870 { USB_DEVICE(USB_VID_TERRATEC
,
3871 USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY_2
) },
3872 { USB_DEVICE(USB_VID_SONY
, USB_PID_SONY_PLAYTV
) },
3873 /* 45 */{ USB_DEVICE(USB_VID_YUAN
, USB_PID_YUAN_PD378S
) },
3874 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_TIGER_ATSC
) },
3875 { USB_DEVICE(USB_VID_HAUPPAUGE
, USB_PID_HAUPPAUGE_TIGER_ATSC_B210
) },
3876 { USB_DEVICE(USB_VID_YUAN
, USB_PID_YUAN_MC770
) },
3877 { USB_DEVICE(USB_VID_ELGATO
, USB_PID_ELGATO_EYETV_DTT
) },
3878 /* 50 */{ USB_DEVICE(USB_VID_ELGATO
, USB_PID_ELGATO_EYETV_DTT_Dlx
) },
3879 { USB_DEVICE(USB_VID_LEADTEK
, USB_PID_WINFAST_DTV_DONGLE_H
) },
3880 { USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_T3
) },
3881 { USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_T5
) },
3882 { USB_DEVICE(USB_VID_YUAN
, USB_PID_YUAN_STK7700D
) },
3883 /* 55 */{ USB_DEVICE(USB_VID_YUAN
, USB_PID_YUAN_STK7700D_2
) },
3884 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV73A
) },
3885 { USB_DEVICE(USB_VID_PCTV
, USB_PID_PINNACLE_PCTV73ESE
) },
3886 { USB_DEVICE(USB_VID_PCTV
, USB_PID_PINNACLE_PCTV282E
) },
3887 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK7770P
) },
3888 /* 60 */{ USB_DEVICE(USB_VID_TERRATEC
, USB_PID_TERRATEC_CINERGY_T_XXS_2
) },
3889 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK807XPVR
) },
3890 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK807XP
) },
3891 { USB_DEVICE_VER(USB_VID_PIXELVIEW
, USB_PID_PIXELVIEW_SBTVD
, 0x000, 0x3f00) },
3892 { USB_DEVICE(USB_VID_EVOLUTEPC
, USB_PID_TVWAY_PLUS
) },
3893 /* 65 */{ USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV73ESE
) },
3894 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV282E
) },
3895 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK8096GP
) },
3896 { USB_DEVICE(USB_VID_ELGATO
, USB_PID_ELGATO_EYETV_DIVERSITY
) },
3897 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_NIM9090M
) },
3898 /* 70 */{ USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_NIM8096MD
) },
3899 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_NIM9090MD
) },
3900 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_NIM7090
) },
3901 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_TFE7090PVR
) },
3902 { USB_DEVICE(USB_VID_TECHNISAT
, USB_PID_TECHNISAT_AIRSTAR_TELESTICK_2
) },
3903 /* 75 */{ USB_DEVICE(USB_VID_MEDION
, USB_PID_CREATIX_CTX1921
) },
3904 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV340E
) },
3905 { USB_DEVICE(USB_VID_PINNACLE
, USB_PID_PINNACLE_PCTV340E_SE
) },
3906 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_TFE7790P
) },
3907 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_TFE8096P
) },
3908 /* 80 */{ USB_DEVICE(USB_VID_ELGATO
, USB_PID_ELGATO_EYETV_DTT_2
) },
3909 { USB_DEVICE(USB_VID_PCTV
, USB_PID_PCTV_2002E
) },
3910 { USB_DEVICE(USB_VID_PCTV
, USB_PID_PCTV_2002E_SE
) },
3911 { USB_DEVICE(USB_VID_PCTV
, USB_PID_DIBCOM_STK8096PVR
) },
3912 { USB_DEVICE(USB_VID_DIBCOM
, USB_PID_DIBCOM_STK8096PVR
) },
3913 /* 85 */{ USB_DEVICE(USB_VID_HAMA
, USB_PID_HAMA_DVBT_HYBRID
) },
3914 { USB_DEVICE(USB_VID_MICROSOFT
, USB_PID_XBOX_ONE_TUNER
) },
3915 { 0 } /* Terminating entry */
3917 MODULE_DEVICE_TABLE(usb
, dib0700_usb_id_table
);
3919 #define DIB0700_DEFAULT_DEVICE_PROPERTIES \
3920 .caps = DVB_USB_IS_AN_I2C_ADAPTER, \
3921 .usb_ctrl = DEVICE_SPECIFIC, \
3922 .firmware = "dvb-usb-dib0700-1.20.fw", \
3923 .download_firmware = dib0700_download_firmware, \
3924 .no_reconnect = 1, \
3925 .size_of_priv = sizeof(struct dib0700_state), \
3926 .i2c_algo = &dib0700_i2c_algo, \
3927 .identify_state = dib0700_identify_state
3929 #define DIB0700_DEFAULT_STREAMING_CONFIG(ep) \
3930 .streaming_ctrl = dib0700_streaming_ctrl, \
3937 .buffersize = 39480, \
3942 #define DIB0700_NUM_FRONTENDS(n) \
3943 .num_frontends = n, \
3944 .size_of_priv = sizeof(struct dib0700_adapter_state)
3946 struct dvb_usb_device_properties dib0700_devices
[] = {
3948 DIB0700_DEFAULT_DEVICE_PROPERTIES
,
3953 DIB0700_NUM_FRONTENDS(1),
3955 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
3956 .pid_filter_count
= 32,
3957 .pid_filter
= stk7700p_pid_filter
,
3958 .pid_filter_ctrl
= stk7700p_pid_filter_ctrl
,
3959 .frontend_attach
= stk7700p_frontend_attach
,
3960 .tuner_attach
= stk7700p_tuner_attach
,
3962 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
3967 .num_device_descs
= 8,
3969 { "DiBcom STK7700P reference design",
3970 { &dib0700_usb_id_table
[0], &dib0700_usb_id_table
[1] },
3973 { "Hauppauge Nova-T Stick",
3974 { &dib0700_usb_id_table
[4], &dib0700_usb_id_table
[9], NULL
},
3977 { "AVerMedia AVerTV DVB-T Volar",
3978 { &dib0700_usb_id_table
[5], &dib0700_usb_id_table
[10] },
3981 { "Compro Videomate U500",
3982 { &dib0700_usb_id_table
[6], &dib0700_usb_id_table
[19] },
3985 { "Uniwill STK7700P based (Hama and others)",
3986 { &dib0700_usb_id_table
[7], NULL
},
3989 { "Leadtek Winfast DTV Dongle (STK7700P based)",
3990 { &dib0700_usb_id_table
[8], &dib0700_usb_id_table
[34] },
3993 { "AVerMedia AVerTV DVB-T Express",
3994 { &dib0700_usb_id_table
[20] },
3998 { &dib0700_usb_id_table
[21], NULL
},
4004 .rc_interval
= DEFAULT_RC_INTERVAL
,
4005 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4006 .rc_query
= dib0700_rc_query_old_firmware
,
4007 .allowed_protos
= RC_PROTO_BIT_RC5
|
4008 RC_PROTO_BIT_RC6_MCE
|
4010 .change_protocol
= dib0700_change_protocol
,
4012 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4017 DIB0700_NUM_FRONTENDS(1),
4019 .frontend_attach
= bristol_frontend_attach
,
4020 .tuner_attach
= bristol_tuner_attach
,
4022 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4025 DIB0700_NUM_FRONTENDS(1),
4027 .frontend_attach
= bristol_frontend_attach
,
4028 .tuner_attach
= bristol_tuner_attach
,
4030 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
4035 .num_device_descs
= 1,
4037 { "Hauppauge Nova-T 500 Dual DVB-T",
4038 { &dib0700_usb_id_table
[2], &dib0700_usb_id_table
[3], NULL
},
4044 .rc_interval
= DEFAULT_RC_INTERVAL
,
4045 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4046 .rc_query
= dib0700_rc_query_old_firmware
,
4047 .allowed_protos
= RC_PROTO_BIT_RC5
|
4048 RC_PROTO_BIT_RC6_MCE
|
4050 .change_protocol
= dib0700_change_protocol
,
4052 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4057 DIB0700_NUM_FRONTENDS(1),
4059 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4060 .pid_filter_count
= 32,
4061 .pid_filter
= stk70x0p_pid_filter
,
4062 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4063 .frontend_attach
= stk7700d_frontend_attach
,
4064 .tuner_attach
= stk7700d_tuner_attach
,
4066 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4069 DIB0700_NUM_FRONTENDS(1),
4071 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4072 .pid_filter_count
= 32,
4073 .pid_filter
= stk70x0p_pid_filter
,
4074 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4075 .frontend_attach
= stk7700d_frontend_attach
,
4076 .tuner_attach
= stk7700d_tuner_attach
,
4078 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
4083 .num_device_descs
= 5,
4085 { "Pinnacle PCTV 2000e",
4086 { &dib0700_usb_id_table
[11], NULL
},
4089 { "Terratec Cinergy DT XS Diversity",
4090 { &dib0700_usb_id_table
[12], NULL
},
4093 { "Hauppauge Nova-TD Stick/Elgato Eye-TV Diversity",
4094 { &dib0700_usb_id_table
[13], NULL
},
4097 { "DiBcom STK7700D reference design",
4098 { &dib0700_usb_id_table
[14], NULL
},
4101 { "YUAN High-Tech DiBcom STK7700D",
4102 { &dib0700_usb_id_table
[55], NULL
},
4109 .rc_interval
= DEFAULT_RC_INTERVAL
,
4110 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4111 .rc_query
= dib0700_rc_query_old_firmware
,
4112 .allowed_protos
= RC_PROTO_BIT_RC5
|
4113 RC_PROTO_BIT_RC6_MCE
|
4115 .change_protocol
= dib0700_change_protocol
,
4117 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4122 DIB0700_NUM_FRONTENDS(1),
4124 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4125 .pid_filter_count
= 32,
4126 .pid_filter
= stk70x0p_pid_filter
,
4127 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4128 .frontend_attach
= stk7700P2_frontend_attach
,
4129 .tuner_attach
= stk7700d_tuner_attach
,
4131 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4136 .num_device_descs
= 3,
4138 { "ASUS My Cinema U3000 Mini DVBT Tuner",
4139 { &dib0700_usb_id_table
[23], NULL
},
4143 { &dib0700_usb_id_table
[31], NULL
},
4146 { "Terratec Cinergy T Express",
4147 { &dib0700_usb_id_table
[42], NULL
},
4153 .rc_interval
= DEFAULT_RC_INTERVAL
,
4154 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4155 .module_name
= "dib0700",
4156 .rc_query
= dib0700_rc_query_old_firmware
,
4157 .allowed_protos
= RC_PROTO_BIT_RC5
|
4158 RC_PROTO_BIT_RC6_MCE
|
4160 .change_protocol
= dib0700_change_protocol
,
4162 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4167 DIB0700_NUM_FRONTENDS(1),
4169 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4170 .pid_filter_count
= 32,
4171 .pid_filter
= stk70x0p_pid_filter
,
4172 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4173 .frontend_attach
= stk7070p_frontend_attach
,
4174 .tuner_attach
= dib7070p_tuner_attach
,
4176 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4181 .num_device_descs
= 12,
4183 { "DiBcom STK7070P reference design",
4184 { &dib0700_usb_id_table
[15], NULL
},
4187 { "Pinnacle PCTV DVB-T Flash Stick",
4188 { &dib0700_usb_id_table
[16], NULL
},
4191 { "Artec T14BR DVB-T",
4192 { &dib0700_usb_id_table
[22], NULL
},
4195 { "ASUS My Cinema U3100 Mini DVBT Tuner",
4196 { &dib0700_usb_id_table
[24], NULL
},
4199 { "Hauppauge Nova-T Stick",
4200 { &dib0700_usb_id_table
[25], NULL
},
4203 { "Hauppauge Nova-T MyTV.t",
4204 { &dib0700_usb_id_table
[26], NULL
},
4207 { "Pinnacle PCTV 72e",
4208 { &dib0700_usb_id_table
[29], NULL
},
4211 { "Pinnacle PCTV 73e",
4212 { &dib0700_usb_id_table
[30], NULL
},
4215 { "Elgato EyeTV DTT",
4216 { &dib0700_usb_id_table
[49], NULL
},
4220 { &dib0700_usb_id_table
[45], NULL
},
4223 { "Elgato EyeTV Dtt Dlx PD378S",
4224 { &dib0700_usb_id_table
[50], NULL
},
4227 { "Elgato EyeTV DTT rev. 2",
4228 { &dib0700_usb_id_table
[80], NULL
},
4234 .rc_interval
= DEFAULT_RC_INTERVAL
,
4235 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4236 .module_name
= "dib0700",
4237 .rc_query
= dib0700_rc_query_old_firmware
,
4238 .allowed_protos
= RC_PROTO_BIT_RC5
|
4239 RC_PROTO_BIT_RC6_MCE
|
4241 .change_protocol
= dib0700_change_protocol
,
4243 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4248 DIB0700_NUM_FRONTENDS(1),
4250 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4251 .pid_filter_count
= 32,
4252 .pid_filter
= stk70x0p_pid_filter
,
4253 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4254 .frontend_attach
= stk7070p_frontend_attach
,
4255 .tuner_attach
= dib7070p_tuner_attach
,
4257 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4262 .num_device_descs
= 3,
4264 { "Pinnacle PCTV 73A",
4265 { &dib0700_usb_id_table
[56], NULL
},
4268 { "Pinnacle PCTV 73e SE",
4269 { &dib0700_usb_id_table
[57], &dib0700_usb_id_table
[65], NULL
},
4272 { "Pinnacle PCTV 282e",
4273 { &dib0700_usb_id_table
[58], &dib0700_usb_id_table
[66], NULL
},
4279 .rc_interval
= DEFAULT_RC_INTERVAL
,
4280 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4281 .module_name
= "dib0700",
4282 .rc_query
= dib0700_rc_query_old_firmware
,
4283 .allowed_protos
= RC_PROTO_BIT_RC5
|
4284 RC_PROTO_BIT_RC6_MCE
|
4286 .change_protocol
= dib0700_change_protocol
,
4288 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4293 DIB0700_NUM_FRONTENDS(1),
4295 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4296 .pid_filter_count
= 32,
4297 .pid_filter
= stk70x0p_pid_filter
,
4298 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4299 .frontend_attach
= novatd_frontend_attach
,
4300 .tuner_attach
= dib7070p_tuner_attach
,
4302 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4305 DIB0700_NUM_FRONTENDS(1),
4307 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4308 .pid_filter_count
= 32,
4309 .pid_filter
= stk70x0p_pid_filter
,
4310 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4311 .frontend_attach
= novatd_frontend_attach
,
4312 .tuner_attach
= dib7070p_tuner_attach
,
4314 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
4319 .num_device_descs
= 3,
4321 { "Hauppauge Nova-TD Stick (52009)",
4322 { &dib0700_usb_id_table
[35], NULL
},
4326 { &dib0700_usb_id_table
[81], NULL
},
4330 { &dib0700_usb_id_table
[82], NULL
},
4336 .rc_interval
= DEFAULT_RC_INTERVAL
,
4337 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4338 .module_name
= "dib0700",
4339 .rc_query
= dib0700_rc_query_old_firmware
,
4340 .allowed_protos
= RC_PROTO_BIT_RC5
|
4341 RC_PROTO_BIT_RC6_MCE
|
4343 .change_protocol
= dib0700_change_protocol
,
4345 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4350 DIB0700_NUM_FRONTENDS(1),
4352 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4353 .pid_filter_count
= 32,
4354 .pid_filter
= stk70x0p_pid_filter
,
4355 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4356 .frontend_attach
= stk7070pd_frontend_attach0
,
4357 .tuner_attach
= dib7070p_tuner_attach
,
4359 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4362 DIB0700_NUM_FRONTENDS(1),
4364 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4365 .pid_filter_count
= 32,
4366 .pid_filter
= stk70x0p_pid_filter
,
4367 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4368 .frontend_attach
= stk7070pd_frontend_attach1
,
4369 .tuner_attach
= dib7070p_tuner_attach
,
4371 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
4376 .num_device_descs
= 5,
4378 { "DiBcom STK7070PD reference design",
4379 { &dib0700_usb_id_table
[17], NULL
},
4382 { "Pinnacle PCTV Dual DVB-T Diversity Stick",
4383 { &dib0700_usb_id_table
[18], NULL
},
4386 { "Hauppauge Nova-TD-500 (84xxx)",
4387 { &dib0700_usb_id_table
[36], NULL
},
4390 { "Terratec Cinergy DT USB XS Diversity/ T5",
4391 { &dib0700_usb_id_table
[43],
4392 &dib0700_usb_id_table
[53], NULL
},
4396 { &dib0700_usb_id_table
[44], NULL
},
4402 .rc_interval
= DEFAULT_RC_INTERVAL
,
4403 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4404 .module_name
= "dib0700",
4405 .rc_query
= dib0700_rc_query_old_firmware
,
4406 .allowed_protos
= RC_PROTO_BIT_RC5
|
4407 RC_PROTO_BIT_RC6_MCE
|
4409 .change_protocol
= dib0700_change_protocol
,
4411 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4416 DIB0700_NUM_FRONTENDS(1),
4418 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4419 .pid_filter_count
= 32,
4420 .pid_filter
= stk70x0p_pid_filter
,
4421 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4422 .frontend_attach
= stk7070pd_frontend_attach0
,
4423 .tuner_attach
= dib7070p_tuner_attach
,
4425 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4428 DIB0700_NUM_FRONTENDS(1),
4430 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4431 .pid_filter_count
= 32,
4432 .pid_filter
= stk70x0p_pid_filter
,
4433 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4434 .frontend_attach
= stk7070pd_frontend_attach1
,
4435 .tuner_attach
= dib7070p_tuner_attach
,
4437 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
4442 .num_device_descs
= 1,
4444 { "Elgato EyeTV Diversity",
4445 { &dib0700_usb_id_table
[68], NULL
},
4451 .rc_interval
= DEFAULT_RC_INTERVAL
,
4452 .rc_codes
= RC_MAP_DIB0700_NEC_TABLE
,
4453 .module_name
= "dib0700",
4454 .rc_query
= dib0700_rc_query_old_firmware
,
4455 .allowed_protos
= RC_PROTO_BIT_RC5
|
4456 RC_PROTO_BIT_RC6_MCE
|
4458 .change_protocol
= dib0700_change_protocol
,
4460 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4465 DIB0700_NUM_FRONTENDS(1),
4467 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4468 .pid_filter_count
= 32,
4469 .pid_filter
= stk70x0p_pid_filter
,
4470 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4471 .frontend_attach
= stk7700ph_frontend_attach
,
4472 .tuner_attach
= stk7700ph_tuner_attach
,
4474 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4479 .num_device_descs
= 10,
4481 { "Terratec Cinergy HT USB XE",
4482 { &dib0700_usb_id_table
[27], NULL
},
4485 { "Pinnacle Expresscard 320cx",
4486 { &dib0700_usb_id_table
[28], NULL
},
4489 { "Terratec Cinergy HT Express",
4490 { &dib0700_usb_id_table
[32], NULL
},
4493 { "Gigabyte U8000-RH",
4494 { &dib0700_usb_id_table
[37], NULL
},
4497 { "YUAN High-Tech STK7700PH",
4498 { &dib0700_usb_id_table
[38], NULL
},
4501 { "Asus My Cinema-U3000Hybrid",
4502 { &dib0700_usb_id_table
[39], NULL
},
4505 { "YUAN High-Tech MC770",
4506 { &dib0700_usb_id_table
[48], NULL
},
4509 { "Leadtek WinFast DTV Dongle H",
4510 { &dib0700_usb_id_table
[51], NULL
},
4513 { "YUAN High-Tech STK7700D",
4514 { &dib0700_usb_id_table
[54], NULL
},
4517 { "Hama DVB=T Hybrid USB Stick",
4518 { &dib0700_usb_id_table
[85], NULL
},
4524 .rc_interval
= DEFAULT_RC_INTERVAL
,
4525 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4526 .module_name
= "dib0700",
4527 .rc_query
= dib0700_rc_query_old_firmware
,
4528 .allowed_protos
= RC_PROTO_BIT_RC5
|
4529 RC_PROTO_BIT_RC6_MCE
|
4531 .change_protocol
= dib0700_change_protocol
,
4533 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4537 DIB0700_NUM_FRONTENDS(1),
4539 .frontend_attach
= s5h1411_frontend_attach
,
4540 .tuner_attach
= xc5000_tuner_attach
,
4542 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4547 .num_device_descs
= 2,
4549 { "Pinnacle PCTV HD Pro USB Stick",
4550 { &dib0700_usb_id_table
[40], NULL
},
4553 { "Pinnacle PCTV HD USB Stick",
4554 { &dib0700_usb_id_table
[41], NULL
},
4560 .rc_interval
= DEFAULT_RC_INTERVAL
,
4561 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4562 .module_name
= "dib0700",
4563 .rc_query
= dib0700_rc_query_old_firmware
,
4564 .allowed_protos
= RC_PROTO_BIT_RC5
|
4565 RC_PROTO_BIT_RC6_MCE
|
4567 .change_protocol
= dib0700_change_protocol
,
4569 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4573 DIB0700_NUM_FRONTENDS(1),
4575 .frontend_attach
= lgdt3305_frontend_attach
,
4576 .tuner_attach
= mxl5007t_tuner_attach
,
4578 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4583 .num_device_descs
= 2,
4585 { "Hauppauge ATSC MiniCard (B200)",
4586 { &dib0700_usb_id_table
[46], NULL
},
4589 { "Hauppauge ATSC MiniCard (B210)",
4590 { &dib0700_usb_id_table
[47], NULL
},
4594 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4599 DIB0700_NUM_FRONTENDS(1),
4601 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4602 .pid_filter_count
= 32,
4603 .pid_filter
= stk70x0p_pid_filter
,
4604 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4605 .frontend_attach
= stk7770p_frontend_attach
,
4606 .tuner_attach
= dib7770p_tuner_attach
,
4608 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4613 .num_device_descs
= 4,
4615 { "DiBcom STK7770P reference design",
4616 { &dib0700_usb_id_table
[59], NULL
},
4619 { "Terratec Cinergy T USB XXS (HD)/ T3",
4620 { &dib0700_usb_id_table
[33],
4621 &dib0700_usb_id_table
[52],
4622 &dib0700_usb_id_table
[60], NULL
},
4625 { "TechniSat AirStar TeleStick 2",
4626 { &dib0700_usb_id_table
[74], NULL
},
4629 { "Medion CTX1921 DVB-T USB",
4630 { &dib0700_usb_id_table
[75], NULL
},
4636 .rc_interval
= DEFAULT_RC_INTERVAL
,
4637 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4638 .module_name
= "dib0700",
4639 .rc_query
= dib0700_rc_query_old_firmware
,
4640 .allowed_protos
= RC_PROTO_BIT_RC5
|
4641 RC_PROTO_BIT_RC6_MCE
|
4643 .change_protocol
= dib0700_change_protocol
,
4645 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4649 DIB0700_NUM_FRONTENDS(1),
4651 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4652 .pid_filter_count
= 32,
4653 .pid_filter
= stk80xx_pid_filter
,
4654 .pid_filter_ctrl
= stk80xx_pid_filter_ctrl
,
4655 .frontend_attach
= stk807x_frontend_attach
,
4656 .tuner_attach
= dib807x_tuner_attach
,
4658 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4663 .num_device_descs
= 3,
4665 { "DiBcom STK807xP reference design",
4666 { &dib0700_usb_id_table
[62], NULL
},
4669 { "Prolink Pixelview SBTVD",
4670 { &dib0700_usb_id_table
[63], NULL
},
4673 { "EvolutePC TVWay+",
4674 { &dib0700_usb_id_table
[64], NULL
},
4680 .rc_interval
= DEFAULT_RC_INTERVAL
,
4681 .rc_codes
= RC_MAP_DIB0700_NEC_TABLE
,
4682 .module_name
= "dib0700",
4683 .rc_query
= dib0700_rc_query_old_firmware
,
4684 .allowed_protos
= RC_PROTO_BIT_RC5
|
4685 RC_PROTO_BIT_RC6_MCE
|
4687 .change_protocol
= dib0700_change_protocol
,
4689 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4693 DIB0700_NUM_FRONTENDS(1),
4695 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4696 .pid_filter_count
= 32,
4697 .pid_filter
= stk80xx_pid_filter
,
4698 .pid_filter_ctrl
= stk80xx_pid_filter_ctrl
,
4699 .frontend_attach
= stk807xpvr_frontend_attach0
,
4700 .tuner_attach
= dib807x_tuner_attach
,
4702 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4706 DIB0700_NUM_FRONTENDS(1),
4708 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
| DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4709 .pid_filter_count
= 32,
4710 .pid_filter
= stk80xx_pid_filter
,
4711 .pid_filter_ctrl
= stk80xx_pid_filter_ctrl
,
4712 .frontend_attach
= stk807xpvr_frontend_attach1
,
4713 .tuner_attach
= dib807x_tuner_attach
,
4715 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
4720 .num_device_descs
= 1,
4722 { "DiBcom STK807xPVR reference design",
4723 { &dib0700_usb_id_table
[61], NULL
},
4729 .rc_interval
= DEFAULT_RC_INTERVAL
,
4730 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4731 .module_name
= "dib0700",
4732 .rc_query
= dib0700_rc_query_old_firmware
,
4733 .allowed_protos
= RC_PROTO_BIT_RC5
|
4734 RC_PROTO_BIT_RC6_MCE
|
4736 .change_protocol
= dib0700_change_protocol
,
4738 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4742 DIB0700_NUM_FRONTENDS(1),
4744 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4745 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4746 .pid_filter_count
= 32,
4747 .pid_filter
= stk80xx_pid_filter
,
4748 .pid_filter_ctrl
= stk80xx_pid_filter_ctrl
,
4749 .frontend_attach
= stk809x_frontend_attach
,
4750 .tuner_attach
= dib809x_tuner_attach
,
4752 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4757 .num_device_descs
= 1,
4759 { "DiBcom STK8096GP reference design",
4760 { &dib0700_usb_id_table
[67], NULL
},
4766 .rc_interval
= DEFAULT_RC_INTERVAL
,
4767 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4768 .module_name
= "dib0700",
4769 .rc_query
= dib0700_rc_query_old_firmware
,
4770 .allowed_protos
= RC_PROTO_BIT_RC5
|
4771 RC_PROTO_BIT_RC6_MCE
|
4773 .change_protocol
= dib0700_change_protocol
,
4775 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4779 DIB0700_NUM_FRONTENDS(1),
4781 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4782 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4783 .pid_filter_count
= 32,
4784 .pid_filter
= dib90x0_pid_filter
,
4785 .pid_filter_ctrl
= dib90x0_pid_filter_ctrl
,
4786 .frontend_attach
= stk9090m_frontend_attach
,
4787 .tuner_attach
= dib9090_tuner_attach
,
4789 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4794 .num_device_descs
= 1,
4796 { "DiBcom STK9090M reference design",
4797 { &dib0700_usb_id_table
[69], NULL
},
4803 .rc_interval
= DEFAULT_RC_INTERVAL
,
4804 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4805 .module_name
= "dib0700",
4806 .rc_query
= dib0700_rc_query_old_firmware
,
4807 .allowed_protos
= RC_PROTO_BIT_RC5
|
4808 RC_PROTO_BIT_RC6_MCE
|
4810 .change_protocol
= dib0700_change_protocol
,
4812 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4816 DIB0700_NUM_FRONTENDS(1),
4818 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4819 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4820 .pid_filter_count
= 32,
4821 .pid_filter
= stk80xx_pid_filter
,
4822 .pid_filter_ctrl
= stk80xx_pid_filter_ctrl
,
4823 .frontend_attach
= nim8096md_frontend_attach
,
4824 .tuner_attach
= nim8096md_tuner_attach
,
4826 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4831 .num_device_descs
= 1,
4833 { "DiBcom NIM8096MD reference design",
4834 { &dib0700_usb_id_table
[70], NULL
},
4840 .rc_interval
= DEFAULT_RC_INTERVAL
,
4841 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4842 .module_name
= "dib0700",
4843 .rc_query
= dib0700_rc_query_old_firmware
,
4844 .allowed_protos
= RC_PROTO_BIT_RC5
|
4845 RC_PROTO_BIT_RC6_MCE
|
4847 .change_protocol
= dib0700_change_protocol
,
4849 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4853 DIB0700_NUM_FRONTENDS(1),
4855 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4856 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4857 .pid_filter_count
= 32,
4858 .pid_filter
= dib90x0_pid_filter
,
4859 .pid_filter_ctrl
= dib90x0_pid_filter_ctrl
,
4860 .frontend_attach
= nim9090md_frontend_attach
,
4861 .tuner_attach
= nim9090md_tuner_attach
,
4863 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4868 .num_device_descs
= 1,
4870 { "DiBcom NIM9090MD reference design",
4871 { &dib0700_usb_id_table
[71], NULL
},
4877 .rc_interval
= DEFAULT_RC_INTERVAL
,
4878 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4879 .module_name
= "dib0700",
4880 .rc_query
= dib0700_rc_query_old_firmware
,
4881 .allowed_protos
= RC_PROTO_BIT_RC5
|
4882 RC_PROTO_BIT_RC6_MCE
|
4884 .change_protocol
= dib0700_change_protocol
,
4886 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4890 DIB0700_NUM_FRONTENDS(1),
4892 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4893 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4894 .pid_filter_count
= 32,
4895 .pid_filter
= stk70x0p_pid_filter
,
4896 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4897 .frontend_attach
= nim7090_frontend_attach
,
4898 .tuner_attach
= nim7090_tuner_attach
,
4900 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4905 .num_device_descs
= 1,
4907 { "DiBcom NIM7090 reference design",
4908 { &dib0700_usb_id_table
[72], NULL
},
4914 .rc_interval
= DEFAULT_RC_INTERVAL
,
4915 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4916 .module_name
= "dib0700",
4917 .rc_query
= dib0700_rc_query_old_firmware
,
4918 .allowed_protos
= RC_PROTO_BIT_RC5
|
4919 RC_PROTO_BIT_RC6_MCE
|
4921 .change_protocol
= dib0700_change_protocol
,
4923 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4927 DIB0700_NUM_FRONTENDS(1),
4929 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4930 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4931 .pid_filter_count
= 32,
4932 .pid_filter
= stk70x0p_pid_filter
,
4933 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4934 .frontend_attach
= tfe7090pvr_frontend0_attach
,
4935 .tuner_attach
= tfe7090pvr_tuner0_attach
,
4937 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
4941 DIB0700_NUM_FRONTENDS(1),
4943 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
4944 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
4945 .pid_filter_count
= 32,
4946 .pid_filter
= stk70x0p_pid_filter
,
4947 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
4948 .frontend_attach
= tfe7090pvr_frontend1_attach
,
4949 .tuner_attach
= tfe7090pvr_tuner1_attach
,
4951 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4956 .num_device_descs
= 1,
4958 { "DiBcom TFE7090PVR reference design",
4959 { &dib0700_usb_id_table
[73], NULL
},
4965 .rc_interval
= DEFAULT_RC_INTERVAL
,
4966 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
4967 .module_name
= "dib0700",
4968 .rc_query
= dib0700_rc_query_old_firmware
,
4969 .allowed_protos
= RC_PROTO_BIT_RC5
|
4970 RC_PROTO_BIT_RC6_MCE
|
4972 .change_protocol
= dib0700_change_protocol
,
4974 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
4978 DIB0700_NUM_FRONTENDS(1),
4980 .frontend_attach
= pctv340e_frontend_attach
,
4981 .tuner_attach
= xc4000_tuner_attach
,
4983 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
4988 .num_device_descs
= 2,
4990 { "Pinnacle PCTV 340e HD Pro USB Stick",
4991 { &dib0700_usb_id_table
[76], NULL
},
4994 { "Pinnacle PCTV Hybrid Stick Solo",
4995 { &dib0700_usb_id_table
[77], NULL
},
5000 .rc_interval
= DEFAULT_RC_INTERVAL
,
5001 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
5002 .module_name
= "dib0700",
5003 .rc_query
= dib0700_rc_query_old_firmware
,
5004 .allowed_protos
= RC_PROTO_BIT_RC5
|
5005 RC_PROTO_BIT_RC6_MCE
|
5007 .change_protocol
= dib0700_change_protocol
,
5009 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
5013 DIB0700_NUM_FRONTENDS(1),
5015 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
5016 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
5017 .pid_filter_count
= 32,
5018 .pid_filter
= stk70x0p_pid_filter
,
5019 .pid_filter_ctrl
= stk70x0p_pid_filter_ctrl
,
5020 .frontend_attach
= tfe7790p_frontend_attach
,
5021 .tuner_attach
= tfe7790p_tuner_attach
,
5023 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
5028 .num_device_descs
= 1,
5030 { "DiBcom TFE7790P reference design",
5031 { &dib0700_usb_id_table
[78], NULL
},
5037 .rc_interval
= DEFAULT_RC_INTERVAL
,
5038 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
5039 .module_name
= "dib0700",
5040 .rc_query
= dib0700_rc_query_old_firmware
,
5041 .allowed_protos
= RC_PROTO_BIT_RC5
|
5042 RC_PROTO_BIT_RC6_MCE
|
5044 .change_protocol
= dib0700_change_protocol
,
5046 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
5050 DIB0700_NUM_FRONTENDS(1),
5052 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
5053 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
5054 .pid_filter_count
= 32,
5055 .pid_filter
= stk80xx_pid_filter
,
5056 .pid_filter_ctrl
= stk80xx_pid_filter_ctrl
,
5057 .frontend_attach
= tfe8096p_frontend_attach
,
5058 .tuner_attach
= tfe8096p_tuner_attach
,
5060 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
5066 .num_device_descs
= 1,
5068 { "DiBcom TFE8096P reference design",
5069 { &dib0700_usb_id_table
[79], NULL
},
5075 .rc_interval
= DEFAULT_RC_INTERVAL
,
5076 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
5077 .module_name
= "dib0700",
5078 .rc_query
= dib0700_rc_query_old_firmware
,
5079 .allowed_protos
= RC_PROTO_BIT_RC5
|
5080 RC_PROTO_BIT_RC6_MCE
|
5082 .change_protocol
= dib0700_change_protocol
,
5084 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
5090 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
5091 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
5092 .pid_filter_count
= 32,
5093 .pid_filter
= stk80xx_pid_filter
,
5094 .pid_filter_ctrl
= stk80xx_pid_filter_ctrl
,
5095 .frontend_attach
= stk809x_frontend_attach
,
5096 .tuner_attach
= dib809x_tuner_attach
,
5098 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
5101 sizeof(struct dib0700_adapter_state
),
5105 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
5106 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
5107 .pid_filter_count
= 32,
5108 .pid_filter
= stk80xx_pid_filter
,
5109 .pid_filter_ctrl
= stk80xx_pid_filter_ctrl
,
5110 .frontend_attach
= stk809x_frontend1_attach
,
5111 .tuner_attach
= dib809x_tuner_attach
,
5113 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
5116 sizeof(struct dib0700_adapter_state
),
5119 .num_device_descs
= 1,
5121 { "DiBcom STK8096-PVR reference design",
5122 { &dib0700_usb_id_table
[83],
5123 &dib0700_usb_id_table
[84], NULL
},
5129 .rc_interval
= DEFAULT_RC_INTERVAL
,
5130 .rc_codes
= RC_MAP_DIB0700_RC5_TABLE
,
5131 .module_name
= "dib0700",
5132 .rc_query
= dib0700_rc_query_old_firmware
,
5133 .allowed_protos
= RC_PROTO_BIT_RC5
|
5134 RC_PROTO_BIT_RC6_MCE
|
5136 .change_protocol
= dib0700_change_protocol
,
5138 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES
,
5142 DIB0700_NUM_FRONTENDS(1),
5144 .frontend_attach
= xbox_one_attach
,
5146 DIB0700_DEFAULT_STREAMING_CONFIG(0x82),
5150 .num_device_descs
= 1,
5152 { "Microsoft Xbox One Digital TV Tuner",
5153 { &dib0700_usb_id_table
[86], NULL
},
5160 int dib0700_device_count
= ARRAY_SIZE(dib0700_devices
);