blob: e06acd1fecb61b9f3bf2676f0a16375f9101e907 [file] [log] [blame]
Patrick Boettcherb7f54912006-09-19 12:51:37 -03001/* Linux driver for devices based on the DiBcom DiB0700 USB bridge
2 *
3 * This program is free software; you can redistribute it and/or modify it
4 * under the terms of the GNU General Public License as published by the Free
5 * Software Foundation, version 2.
6 *
Patrick Boettcherba3fe3a2009-09-16 09:51:30 -03007 * Copyright (C) 2005-9 DiBcom, SA et al
Patrick Boettcherb7f54912006-09-19 12:51:37 -03008 */
9#include "dib0700.h"
10
11#include "dib3000mc.h"
Patrick Boettcher91bb9be2006-12-02 21:15:51 -020012#include "dib7000m.h"
Patrick Boettchera75763f2006-10-18 08:34:16 -030013#include "dib7000p.h"
Patrick Boettcherba3fe3a2009-09-16 09:51:30 -030014#include "dib8000.h"
Patrick Boettcherb7f54912006-09-19 12:51:37 -030015#include "mt2060.h"
Olivier DANET54d75eb2007-07-25 14:42:54 -030016#include "mt2266.h"
Albert Comerma6ca8f0b2008-03-29 21:35:57 -030017#include "tuner-xc2028.h"
Devin Heitmuellercb22cb52008-09-08 05:42:42 -030018#include "xc5000.h"
19#include "s5h1411.h"
Patrick Boettcher01373a52007-07-30 12:49:04 -030020#include "dib0070.h"
Olivier Grenie03245a52009-12-04 13:27:57 -030021#include "dib0090.h"
Michael Krufkyce904bc2009-01-19 01:12:55 -030022#include "lgdt3305.h"
23#include "mxl5007t.h"
Patrick Boettcherb7f54912006-09-19 12:51:37 -030024
Patrick Boettcher7fb3fc02006-09-20 04:37:18 -030025static int force_lna_activation;
26module_param(force_lna_activation, int, 0644);
27MODULE_PARM_DESC(force_lna_activation, "force the activation of Low-Noise-Amplifyer(s) (LNA), "
28 "if applicable for the device (default: 0=automatic/off).");
29
Patrick Boettcher01373a52007-07-30 12:49:04 -030030struct dib0700_adapter_state {
31 int (*set_param_save) (struct dvb_frontend *, struct dvb_frontend_parameters *);
32};
33
34/* Hauppauge Nova-T 500 (aka Bristol)
Patrick Boettcherb7f54912006-09-19 12:51:37 -030035 * has a LNA on GPIO0 which is enabled by setting 1 */
36static struct mt2060_config bristol_mt2060_config[2] = {
37 {
38 .i2c_address = 0x60,
Patrick Boettcher303cbea2006-09-19 12:51:56 -030039 .clock_out = 3,
Patrick Boettcherb7f54912006-09-19 12:51:37 -030040 }, {
41 .i2c_address = 0x61,
42 }
43};
44
Devin Heitmueller99afb982008-11-15 07:13:07 -030045
Patrick Boettcherb7f54912006-09-19 12:51:37 -030046static struct dibx000_agc_config bristol_dib3000p_mt2060_agc_config = {
47 .band_caps = BAND_VHF | BAND_UHF,
Patrick Boettcher01b4bf32006-09-19 12:51:53 -030048 .setup = (1 << 8) | (5 << 5) | (0 << 4) | (0 << 3) | (0 << 2) | (2 << 0),
Patrick Boettcherb7f54912006-09-19 12:51:37 -030049
Patrick Boettcher6958eff2006-09-19 12:51:40 -030050 .agc1_max = 42598,
51 .agc1_min = 17694,
52 .agc2_max = 45875,
53 .agc2_min = 0,
Patrick Boettcherb7f54912006-09-19 12:51:37 -030054
Patrick Boettcher6958eff2006-09-19 12:51:40 -030055 .agc1_pt1 = 0,
56 .agc1_pt2 = 59,
Patrick Boettcherb7f54912006-09-19 12:51:37 -030057
Patrick Boettcher6958eff2006-09-19 12:51:40 -030058 .agc1_slope1 = 0,
59 .agc1_slope2 = 69,
Patrick Boettcherb7f54912006-09-19 12:51:37 -030060
61 .agc2_pt1 = 0,
Patrick Boettcher6958eff2006-09-19 12:51:40 -030062 .agc2_pt2 = 59,
Patrick Boettcherb7f54912006-09-19 12:51:37 -030063
Patrick Boettcher6958eff2006-09-19 12:51:40 -030064 .agc2_slope1 = 111,
65 .agc2_slope2 = 28,
Patrick Boettcherb7f54912006-09-19 12:51:37 -030066};
67
68static struct dib3000mc_config bristol_dib3000mc_config[2] = {
69 { .agc = &bristol_dib3000p_mt2060_agc_config,
70 .max_time = 0x196,
71 .ln_adc_level = 0x1cc7,
72 .output_mpeg2_in_188_bytes = 1,
73 },
74 { .agc = &bristol_dib3000p_mt2060_agc_config,
75 .max_time = 0x196,
76 .ln_adc_level = 0x1cc7,
77 .output_mpeg2_in_188_bytes = 1,
78 }
79};
80
81static int bristol_frontend_attach(struct dvb_usb_adapter *adap)
82{
Patrick Boettcher6958eff2006-09-19 12:51:40 -030083 struct dib0700_state *st = adap->dev->priv;
Patrick Boettcherb7f54912006-09-19 12:51:37 -030084 if (adap->id == 0) {
85 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(10);
86 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10);
87 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10);
88 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(10);
89
Patrick Boettcher7fb3fc02006-09-20 04:37:18 -030090 if (force_lna_activation)
91 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
92 else
93 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 0);
Patrick Boettcher6958eff2006-09-19 12:51:40 -030094
Patrick Boettcherb7f54912006-09-19 12:51:37 -030095 if (dib3000mc_i2c_enumeration(&adap->dev->i2c_adap, 2, DEFAULT_DIB3000P_I2C_ADDRESS, bristol_dib3000mc_config) != 0) {
96 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(10);
97 return -ENODEV;
98 }
99 }
Patrick Boettcher6958eff2006-09-19 12:51:40 -0300100 st->mt2060_if1[adap->id] = 1220;
101 return (adap->fe = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap,
102 (10 + adap->id) << 1, &bristol_dib3000mc_config[adap->id])) == NULL ? -ENODEV : 0;
Patrick Boettcherb7f54912006-09-19 12:51:37 -0300103}
104
Patrick Boettcher4a2b1082008-01-25 07:32:58 -0300105static int eeprom_read(struct i2c_adapter *adap,u8 adrs,u8 *pval)
Olivier DANETc52344f2008-01-25 06:50:07 -0300106{
107 struct i2c_msg msg[2] = {
108 { .addr = 0x50, .flags = 0, .buf = &adrs, .len = 1 },
109 { .addr = 0x50, .flags = I2C_M_RD, .buf = pval, .len = 1 },
110 };
111 if (i2c_transfer(adap, msg, 2) != 2) return -EREMOTEIO;
112 return 0;
113}
114
Patrick Boettcherb7f54912006-09-19 12:51:37 -0300115static int bristol_tuner_attach(struct dvb_usb_adapter *adap)
116{
Olivier DANETc52344f2008-01-25 06:50:07 -0300117 struct i2c_adapter *prim_i2c = &adap->dev->i2c_adap;
Patrick Boettcherb7f54912006-09-19 12:51:37 -0300118 struct i2c_adapter *tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe, 1);
Olivier DANETc52344f2008-01-25 06:50:07 -0300119 s8 a;
120 int if1=1220;
Al Viroda5ee482008-05-21 00:31:21 -0300121 if (adap->dev->udev->descriptor.idVendor == cpu_to_le16(USB_VID_HAUPPAUGE) &&
122 adap->dev->udev->descriptor.idProduct == cpu_to_le16(USB_PID_HAUPPAUGE_NOVA_T_500_2)) {
Olivier DANETc52344f2008-01-25 06:50:07 -0300123 if (!eeprom_read(prim_i2c,0x59 + adap->id,&a)) if1=1220+a;
124 }
125 return dvb_attach(mt2060_attach,adap->fe, tun_i2c,&bristol_mt2060_config[adap->id],
126 if1) == NULL ? -ENODEV : 0;
Patrick Boettcherb7f54912006-09-19 12:51:37 -0300127}
128
Patrick Boettcher01373a52007-07-30 12:49:04 -0300129/* STK7700D: Pinnacle/Terratec/Hauppauge Dual DVB-T Diversity */
Olivier DANET54d75eb2007-07-25 14:42:54 -0300130
Patrick Boettcherb6884a12007-07-27 10:08:51 -0300131/* MT226x */
132static struct dibx000_agc_config stk7700d_7000p_mt2266_agc_config[2] = {
133 {
Olivier Grenie9c783032009-12-07 07:49:40 -0300134 BAND_UHF,
Olivier DANET54d75eb2007-07-25 14:42:54 -0300135
Patrick Boettcherb6884a12007-07-27 10:08:51 -0300136 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1, P_agc_inv_pwm1=1, P_agc_inv_pwm2=1,
137 * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */
Olivier Grenie9c783032009-12-07 07:49:40 -0300138 (0 << 15) | (0 << 14) | (1 << 11) | (1 << 10) | (1 << 9) | (0 << 8)
139 | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
Olivier DANET54d75eb2007-07-25 14:42:54 -0300140
Olivier Grenie9c783032009-12-07 07:49:40 -0300141 1130,
142 21,
Olivier DANET54d75eb2007-07-25 14:42:54 -0300143
Olivier Grenie9c783032009-12-07 07:49:40 -0300144 0,
145 118,
Olivier DANET54d75eb2007-07-25 14:42:54 -0300146
Olivier Grenie9c783032009-12-07 07:49:40 -0300147 0,
148 3530,
149 1,
150 0,
Olivier DANET54d75eb2007-07-25 14:42:54 -0300151
Olivier Grenie9c783032009-12-07 07:49:40 -0300152 65535,
153 33770,
154 65535,
155 23592,
Olivier DANET54d75eb2007-07-25 14:42:54 -0300156
Olivier Grenie9c783032009-12-07 07:49:40 -0300157 0,
158 62,
159 255,
160 64,
161 64,
162 132,
163 192,
164 80,
165 80,
Patrick Boettcherb6884a12007-07-27 10:08:51 -0300166
Olivier Grenie9c783032009-12-07 07:49:40 -0300167 17,
168 27,
169 23,
170 51,
Patrick Boettcherb6884a12007-07-27 10:08:51 -0300171
Olivier Grenie9c783032009-12-07 07:49:40 -0300172 1,
Patrick Boettcherb6884a12007-07-27 10:08:51 -0300173 }, {
Olivier Grenie9c783032009-12-07 07:49:40 -0300174 BAND_VHF | BAND_LBAND,
Patrick Boettcherb6884a12007-07-27 10:08:51 -0300175
176 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1, P_agc_inv_pwm1=1, P_agc_inv_pwm2=1,
177 * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */
Olivier Grenie9c783032009-12-07 07:49:40 -0300178 (0 << 15) | (0 << 14) | (1 << 11) | (1 << 10) | (1 << 9) | (0 << 8)
179 | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0),
Patrick Boettcherb6884a12007-07-27 10:08:51 -0300180
Olivier Grenie9c783032009-12-07 07:49:40 -0300181 2372,
182 21,
Patrick Boettcherb6884a12007-07-27 10:08:51 -0300183
Olivier Grenie9c783032009-12-07 07:49:40 -0300184 0,
185 118,
Patrick Boettcherb6884a12007-07-27 10:08:51 -0300186
Olivier Grenie9c783032009-12-07 07:49:40 -0300187 0,
188 3530,
189 1,
190 0,
Patrick Boettcherb6884a12007-07-27 10:08:51 -0300191
Olivier Grenie9c783032009-12-07 07:49:40 -0300192 65535,
193 0,
194 65535,
195 23592,
Patrick Boettcherb6884a12007-07-27 10:08:51 -0300196
Olivier Grenie9c783032009-12-07 07:49:40 -0300197 0,
198 128,
199 128,
200 128,
201 0,
202 128,
203 253,
204 81,
205 0,
Patrick Boettcherb6884a12007-07-27 10:08:51 -0300206
Olivier Grenie9c783032009-12-07 07:49:40 -0300207 17,
208 27,
209 23,
210 51,
Patrick Boettcherb6884a12007-07-27 10:08:51 -0300211
Olivier Grenie9c783032009-12-07 07:49:40 -0300212 1,
Patrick Boettcherb6884a12007-07-27 10:08:51 -0300213 }
Olivier DANET54d75eb2007-07-25 14:42:54 -0300214};
215
216static struct dibx000_bandwidth_config stk7700d_mt2266_pll_config = {
Olivier Grenie9c783032009-12-07 07:49:40 -0300217 60000, 30000,
218 1, 8, 3, 1, 0,
219 0, 0, 1, 1, 2,
220 (3 << 14) | (1 << 12) | (524 << 0),
221 0,
222 20452225,
Olivier DANET54d75eb2007-07-25 14:42:54 -0300223};
224
225static struct dib7000p_config stk7700d_dib7000p_mt2266_config[] = {
226 { .output_mpeg2_in_188_bytes = 1,
227 .hostbus_diversity = 1,
228 .tuner_is_baseband = 1,
229
Patrick Boettcherb6884a12007-07-27 10:08:51 -0300230 .agc_config_count = 2,
231 .agc = stk7700d_7000p_mt2266_agc_config,
Olivier DANET54d75eb2007-07-25 14:42:54 -0300232 .bw = &stk7700d_mt2266_pll_config,
233
Patrick Boettcherb6884a12007-07-27 10:08:51 -0300234 .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
235 .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
236 .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
Olivier DANET54d75eb2007-07-25 14:42:54 -0300237 },
238 { .output_mpeg2_in_188_bytes = 1,
239 .hostbus_diversity = 1,
240 .tuner_is_baseband = 1,
241
Patrick Boettcherb6884a12007-07-27 10:08:51 -0300242 .agc_config_count = 2,
243 .agc = stk7700d_7000p_mt2266_agc_config,
Olivier DANET54d75eb2007-07-25 14:42:54 -0300244 .bw = &stk7700d_mt2266_pll_config,
245
Patrick Boettcherb6884a12007-07-27 10:08:51 -0300246 .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
247 .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
248 .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
Olivier DANET54d75eb2007-07-25 14:42:54 -0300249 }
250};
251
252static struct mt2266_config stk7700d_mt2266_config[2] = {
253 { .i2c_address = 0x60
254 },
255 { .i2c_address = 0x60
256 }
257};
258
Daniel Gimpelevich132c3182008-01-25 06:02:42 -0300259static int stk7700P2_frontend_attach(struct dvb_usb_adapter *adap)
260{
261 if (adap->id == 0) {
262 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
263 msleep(10);
264 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
265 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
266 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
267 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
268 msleep(10);
269 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
270 msleep(10);
Devin Heitmueller83c4fdf2009-01-21 01:55:45 -0300271 if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18,
272 stk7700d_dib7000p_mt2266_config)
273 != 0) {
274 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", __func__);
275 return -ENODEV;
276 }
Daniel Gimpelevich132c3182008-01-25 06:02:42 -0300277 }
278
279 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap,0x80+(adap->id << 1),
280 &stk7700d_dib7000p_mt2266_config[adap->id]);
281
282 return adap->fe == NULL ? -ENODEV : 0;
283}
284
Olivier DANET54d75eb2007-07-25 14:42:54 -0300285static int stk7700d_frontend_attach(struct dvb_usb_adapter *adap)
286{
287 if (adap->id == 0) {
288 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
289 msleep(10);
290 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
291 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
292 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
293 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
294 msleep(10);
295 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
296 msleep(10);
297 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
Devin Heitmueller83c4fdf2009-01-21 01:55:45 -0300298 if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 2, 18,
299 stk7700d_dib7000p_mt2266_config)
300 != 0) {
301 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", __func__);
302 return -ENODEV;
303 }
Olivier DANET54d75eb2007-07-25 14:42:54 -0300304 }
305
306 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap,0x80+(adap->id << 1),
307 &stk7700d_dib7000p_mt2266_config[adap->id]);
308
309 return adap->fe == NULL ? -ENODEV : 0;
310}
311
312static int stk7700d_tuner_attach(struct dvb_usb_adapter *adap)
313{
314 struct i2c_adapter *tun_i2c;
315 tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1);
316 return dvb_attach(mt2266_attach, adap->fe, tun_i2c,
Joe Perches1ebcad72009-07-02 15:57:09 -0300317 &stk7700d_mt2266_config[adap->id]) == NULL ? -ENODEV : 0;
Olivier DANET54d75eb2007-07-25 14:42:54 -0300318}
319
Albert Comerma6ca8f0b2008-03-29 21:35:57 -0300320/* STK7700-PH: Digital/Analog Hybrid Tuner, e.h. Cinergy HT USB HE */
Harvey Harrisonb1721d02008-04-25 19:03:08 -0700321static struct dibx000_agc_config xc3028_agc_config = {
Albert Comerma6ca8f0b2008-03-29 21:35:57 -0300322 BAND_VHF | BAND_UHF, /* band_caps */
323
324 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=0,
325 * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
326 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */
327 (0 << 15) | (0 << 14) | (0 << 11) | (0 << 10) | (0 << 9) | (0 << 8) |
328 (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), /* setup */
329
330 712, /* inv_gain */
331 21, /* time_stabiliz */
332
333 0, /* alpha_level */
334 118, /* thlock */
335
336 0, /* wbd_inv */
337 2867, /* wbd_ref */
338 0, /* wbd_sel */
339 2, /* wbd_alpha */
340
341 0, /* agc1_max */
342 0, /* agc1_min */
343 39718, /* agc2_max */
344 9930, /* agc2_min */
345 0, /* agc1_pt1 */
346 0, /* agc1_pt2 */
347 0, /* agc1_pt3 */
348 0, /* agc1_slope1 */
349 0, /* agc1_slope2 */
350 0, /* agc2_pt1 */
351 128, /* agc2_pt2 */
352 29, /* agc2_slope1 */
353 29, /* agc2_slope2 */
354
355 17, /* alpha_mant */
356 27, /* alpha_exp */
357 23, /* beta_mant */
358 51, /* beta_exp */
359
360 1, /* perform_agc_softsplit */
361};
362
363/* PLL Configuration for COFDM BW_MHz = 8.00 with external clock = 30.00 */
Harvey Harrisonb1721d02008-04-25 19:03:08 -0700364static struct dibx000_bandwidth_config xc3028_bw_config = {
Albert Comerma6ca8f0b2008-03-29 21:35:57 -0300365 60000, 30000, /* internal, sampling */
366 1, 8, 3, 1, 0, /* pll_cfg: prediv, ratio, range, reset, bypass */
367 0, 0, 1, 1, 0, /* misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc,
368 modulo */
369 (3 << 14) | (1 << 12) | (524 << 0), /* sad_cfg: refsel, sel, freq_15k */
370 (1 << 25) | 5816102, /* ifreq = 5.200000 MHz */
371 20452225, /* timf */
372 30000000, /* xtal_hz */
373};
374
375static struct dib7000p_config stk7700ph_dib7700_xc3028_config = {
376 .output_mpeg2_in_188_bytes = 1,
377 .tuner_is_baseband = 1,
378
379 .agc_config_count = 1,
380 .agc = &xc3028_agc_config,
381 .bw = &xc3028_bw_config,
382
383 .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
384 .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
385 .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
386};
387
Michael Krufkyd7cba042008-09-12 13:31:45 -0300388static int stk7700ph_xc3028_callback(void *ptr, int component,
389 int command, int arg)
Albert Comerma6ca8f0b2008-03-29 21:35:57 -0300390{
391 struct dvb_usb_adapter *adap = ptr;
392
393 switch (command) {
394 case XC2028_TUNER_RESET:
395 /* Send the tuner in then out of reset */
396 dib7000p_set_gpio(adap->fe, 8, 0, 0); msleep(10);
397 dib7000p_set_gpio(adap->fe, 8, 0, 1);
398 break;
399 case XC2028_RESET_CLK:
400 break;
401 default:
402 err("%s: unknown command %d, arg %d\n", __func__,
403 command, arg);
404 return -EINVAL;
405 }
406 return 0;
407}
408
409static struct xc2028_ctrl stk7700ph_xc3028_ctrl = {
410 .fname = XC2028_DEFAULT_FIRMWARE,
411 .max_len = 64,
412 .demod = XC3028_FE_DIBCOM52,
413};
414
415static struct xc2028_config stk7700ph_xc3028_config = {
416 .i2c_addr = 0x61,
Albert Comerma6ca8f0b2008-03-29 21:35:57 -0300417 .ctrl = &stk7700ph_xc3028_ctrl,
418};
419
420static int stk7700ph_frontend_attach(struct dvb_usb_adapter *adap)
421{
422 struct usb_device_descriptor *desc = &adap->dev->udev->descriptor;
423
Al Viroda5ee482008-05-21 00:31:21 -0300424 if (desc->idVendor == cpu_to_le16(USB_VID_PINNACLE) &&
425 desc->idProduct == cpu_to_le16(USB_PID_PINNACLE_EXPRESSCARD_320CX))
Albert Comerma6ca8f0b2008-03-29 21:35:57 -0300426 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0);
427 else
428 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
429 msleep(20);
430 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
431 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
432 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
433 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
434 msleep(10);
435 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
436 msleep(20);
437 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
438 msleep(10);
439
Devin Heitmueller83c4fdf2009-01-21 01:55:45 -0300440 if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18,
441 &stk7700ph_dib7700_xc3028_config) != 0) {
442 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n",
443 __func__);
444 return -ENODEV;
445 }
Albert Comerma6ca8f0b2008-03-29 21:35:57 -0300446
447 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80,
448 &stk7700ph_dib7700_xc3028_config);
449
450 return adap->fe == NULL ? -ENODEV : 0;
451}
452
453static int stk7700ph_tuner_attach(struct dvb_usb_adapter *adap)
454{
455 struct i2c_adapter *tun_i2c;
456
457 tun_i2c = dib7000p_get_i2c_master(adap->fe,
458 DIBX000_I2C_INTERFACE_TUNER, 1);
459
460 stk7700ph_xc3028_config.i2c_adap = tun_i2c;
Michael Krufkyd7cba042008-09-12 13:31:45 -0300461
462 /* FIXME: generalize & move to common area */
463 adap->fe->callback = stk7700ph_xc3028_callback;
Albert Comerma6ca8f0b2008-03-29 21:35:57 -0300464
465 return dvb_attach(xc2028_attach, adap->fe, &stk7700ph_xc3028_config)
466 == NULL ? -ENODEV : 0;
467}
468
Devin Heitmueller4b330be2008-12-01 06:51:14 -0300469#define DEFAULT_RC_INTERVAL 50
Olivier DANET54d75eb2007-07-25 14:42:54 -0300470
471static u8 rc_request[] = { REQUEST_POLL_RC, 0 };
472
Patrick Boettcher58e6f952008-03-29 21:37:01 -0300473/* Number of keypresses to ignore before start repeating */
Devin Heitmueller4b330be2008-12-01 06:51:14 -0300474#define RC_REPEAT_DELAY 6
Patrick Boettcher58e6f952008-03-29 21:37:01 -0300475
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -0300476/*
477 * This function is used only when firmware is < 1.20 version. Newer
478 * firmwares use bulk mode, with functions implemented at dib0700_core,
479 * at dib0700_rc_urb_completion()
480 */
481static int dib0700_rc_query_old_firmware(struct dvb_usb_device *d)
Olivier DANET54d75eb2007-07-25 14:42:54 -0300482{
483 u8 key[4];
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -0300484 u32 keycode;
485 u8 toggle;
Olivier DANET54d75eb2007-07-25 14:42:54 -0300486 int i;
Olivier DANET54d75eb2007-07-25 14:42:54 -0300487 struct dib0700_state *st = d->priv;
Devin Heitmueller6a207102010-01-04 02:43:19 -0300488
Devin Heitmueller6a207102010-01-04 02:43:19 -0300489 if (st->fw_version >= 0x10200) {
490 /* For 1.20 firmware , We need to keep the RC polling
491 callback so we can reuse the input device setup in
492 dvb-usb-remote.c. However, the actual work is being done
493 in the bulk URB completion handler. */
494 return 0;
495 }
496
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -0300497 i = dib0700_ctrl_rd(d, rc_request, 2, key, 4);
498 if (i <= 0) {
Janne Grunau034d65e2007-07-31 08:48:40 -0300499 err("RC Query Failed");
Janne Grunau89f42672007-07-31 19:45:13 -0300500 return -1;
Olivier DANET54d75eb2007-07-25 14:42:54 -0300501 }
Patrick Boettcher58e6f952008-03-29 21:37:01 -0300502
503 /* losing half of KEY_0 events from Philipps rc5 remotes.. */
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -0300504 if (key[0] == 0 && key[1] == 0 && key[2] == 0 && key[3] == 0)
505 return 0;
Patrick Boettcher58e6f952008-03-29 21:37:01 -0300506
507 /* info("%d: %2X %2X %2X %2X",dvb_usb_dib0700_ir_proto,(int)key[3-2],(int)key[3-3],(int)key[3-1],(int)key[3]); */
508
509 dib0700_rc_setup(d); /* reset ir sensor data to prevent false events */
510
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -0300511 d->last_event = 0;
Mauro Carvalho Chehab0ffd1ab2010-08-01 09:37:23 -0300512 switch (d->props.rc.core.protocol) {
513 case IR_TYPE_NEC:
Patrick Boettcher58e6f952008-03-29 21:37:01 -0300514 /* NEC protocol sends repeat code as 0 0 0 FF */
515 if ((key[3-2] == 0x00) && (key[3-3] == 0x00) &&
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -0300516 (key[3] == 0xff))
517 keycode = d->last_event;
518 else {
519 keycode = key[3-2] << 8 | key[3-3];
520 d->last_event = keycode;
Patrick Boettcher58e6f952008-03-29 21:37:01 -0300521 }
Patrick Boettcher58e6f952008-03-29 21:37:01 -0300522
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -0300523 ir_keydown(d->rc_input_dev, keycode, 0);
524 break;
525 default:
526 /* RC-5 protocol changes toggle bit on new keypress */
527 keycode = key[3-2] << 8 | key[3-3];
528 toggle = key[3-1];
529 ir_keydown(d->rc_input_dev, keycode, toggle);
530
Patrick Boettcher58e6f952008-03-29 21:37:01 -0300531 break;
532 }
Olivier DANET54d75eb2007-07-25 14:42:54 -0300533 return 0;
534}
535
Patrick Boettcherb7f54912006-09-19 12:51:37 -0300536/* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */
Patrick Boettchera75763f2006-10-18 08:34:16 -0300537static struct dibx000_agc_config stk7700p_7000m_mt2060_agc_config = {
Olivier Grenie9c783032009-12-07 07:49:40 -0300538 BAND_UHF | BAND_VHF,
Patrick Boettcher69ea31e2006-10-17 18:28:14 -0300539
540 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=5, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0,
541 * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */
Olivier Grenie9c783032009-12-07 07:49:40 -0300542 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8)
543 | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0),
Patrick Boettcher69ea31e2006-10-17 18:28:14 -0300544
Olivier Grenie9c783032009-12-07 07:49:40 -0300545 712,
546 41,
Patrick Boettcher69ea31e2006-10-17 18:28:14 -0300547
Olivier Grenie9c783032009-12-07 07:49:40 -0300548 0,
549 118,
Patrick Boettcher69ea31e2006-10-17 18:28:14 -0300550
Olivier Grenie9c783032009-12-07 07:49:40 -0300551 0,
552 4095,
553 0,
554 0,
Patrick Boettcher69ea31e2006-10-17 18:28:14 -0300555
Olivier Grenie9c783032009-12-07 07:49:40 -0300556 42598,
557 17694,
558 45875,
559 2621,
560 0,
561 76,
562 139,
563 52,
564 59,
565 107,
566 172,
567 57,
568 70,
Patrick Boettcher69ea31e2006-10-17 18:28:14 -0300569
Olivier Grenie9c783032009-12-07 07:49:40 -0300570 21,
571 25,
572 28,
573 48,
Patrick Boettcher69ea31e2006-10-17 18:28:14 -0300574
Olivier Grenie9c783032009-12-07 07:49:40 -0300575 1,
576 { 0,
577 107,
578 51800,
579 24700
Patrick Boettcher69ea31e2006-10-17 18:28:14 -0300580 },
Patrick Boettcherb7f54912006-09-19 12:51:37 -0300581};
Patrick Boettcher69ea31e2006-10-17 18:28:14 -0300582
Patrick Boettchera75763f2006-10-18 08:34:16 -0300583static struct dibx000_agc_config stk7700p_7000p_mt2060_agc_config = {
584 BAND_UHF | BAND_VHF,
585
586 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=5, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0,
587 * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */
Olivier Grenie9c783032009-12-07 07:49:40 -0300588 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8)
589 | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0),
Patrick Boettchera75763f2006-10-18 08:34:16 -0300590
Olivier Grenie9c783032009-12-07 07:49:40 -0300591 712,
592 41,
Patrick Boettchera75763f2006-10-18 08:34:16 -0300593
Olivier Grenie9c783032009-12-07 07:49:40 -0300594 0,
595 118,
Patrick Boettchera75763f2006-10-18 08:34:16 -0300596
Olivier Grenie9c783032009-12-07 07:49:40 -0300597 0,
598 4095,
599 0,
600 0,
Patrick Boettchera75763f2006-10-18 08:34:16 -0300601
Olivier Grenie9c783032009-12-07 07:49:40 -0300602 42598,
603 16384,
604 42598,
605 0,
Patrick Boettchera75763f2006-10-18 08:34:16 -0300606
Olivier Grenie9c783032009-12-07 07:49:40 -0300607 0,
608 137,
609 255,
Patrick Boettchera75763f2006-10-18 08:34:16 -0300610
Olivier Grenie9c783032009-12-07 07:49:40 -0300611 0,
612 255,
Patrick Boettchera75763f2006-10-18 08:34:16 -0300613
Olivier Grenie9c783032009-12-07 07:49:40 -0300614 0,
615 0,
Patrick Boettchera75763f2006-10-18 08:34:16 -0300616
Olivier Grenie9c783032009-12-07 07:49:40 -0300617 0,
618 41,
Patrick Boettchera75763f2006-10-18 08:34:16 -0300619
Olivier Grenie9c783032009-12-07 07:49:40 -0300620 15,
621 25,
Patrick Boettchera75763f2006-10-18 08:34:16 -0300622
Olivier Grenie9c783032009-12-07 07:49:40 -0300623 28,
624 48,
Patrick Boettchera75763f2006-10-18 08:34:16 -0300625
Olivier Grenie9c783032009-12-07 07:49:40 -0300626 0,
Patrick Boettchera75763f2006-10-18 08:34:16 -0300627};
628
629static struct dibx000_bandwidth_config stk7700p_pll_config = {
Olivier Grenie9c783032009-12-07 07:49:40 -0300630 60000, 30000,
631 1, 8, 3, 1, 0,
632 0, 0, 1, 1, 0,
633 (3 << 14) | (1 << 12) | (524 << 0),
634 60258167,
635 20452225,
636 30000000,
Patrick Boettcher69ea31e2006-10-17 18:28:14 -0300637};
638
639static struct dib7000m_config stk7700p_dib7000m_config = {
640 .dvbt_mode = 1,
641 .output_mpeg2_in_188_bytes = 1,
642 .quartz_direct = 1,
643
644 .agc_config_count = 1,
Patrick Boettchera75763f2006-10-18 08:34:16 -0300645 .agc = &stk7700p_7000m_mt2060_agc_config,
646 .bw = &stk7700p_pll_config,
647
648 .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS,
649 .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES,
650 .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS,
651};
652
653static struct dib7000p_config stk7700p_dib7000p_config = {
654 .output_mpeg2_in_188_bytes = 1,
655
Patrick Boettcherb6884a12007-07-27 10:08:51 -0300656 .agc_config_count = 1,
Patrick Boettchera75763f2006-10-18 08:34:16 -0300657 .agc = &stk7700p_7000p_mt2060_agc_config,
658 .bw = &stk7700p_pll_config,
Patrick Boettcher69ea31e2006-10-17 18:28:14 -0300659
660 .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS,
661 .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES,
662 .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS,
663};
Patrick Boettcherb7f54912006-09-19 12:51:37 -0300664
665static int stk7700p_frontend_attach(struct dvb_usb_adapter *adap)
666{
Patrick Boettcher69ea31e2006-10-17 18:28:14 -0300667 struct dib0700_state *st = adap->dev->priv;
Patrick Boettcherb7f54912006-09-19 12:51:37 -0300668 /* unless there is no real power management in DVB - we leave the device on GPIO6 */
Patrick Boettchera75763f2006-10-18 08:34:16 -0300669
670 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
671 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(50);
672
Patrick Boettcher69ea31e2006-10-17 18:28:14 -0300673 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10);
Patrick Boettchera75763f2006-10-18 08:34:16 -0300674 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
675
Patrick Boettcherb7f54912006-09-19 12:51:37 -0300676 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10);
Patrick Boettchera75763f2006-10-18 08:34:16 -0300677 dib0700_ctrl_clock(adap->dev, 72, 1);
678 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(100);
679
680 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
Patrick Boettcherb7f54912006-09-19 12:51:37 -0300681
Patrick Boettcher69ea31e2006-10-17 18:28:14 -0300682 st->mt2060_if1[0] = 1220;
Patrick Boettchera75763f2006-10-18 08:34:16 -0300683
684 if (dib7000pc_detection(&adap->dev->i2c_adap)) {
685 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000p_config);
686 st->is_dib7000pc = 1;
687 } else
688 adap->fe = dvb_attach(dib7000m_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000m_config);
689
690 return adap->fe == NULL ? -ENODEV : 0;
Patrick Boettcherb7f54912006-09-19 12:51:37 -0300691}
692
Patrick Boettcher69ea31e2006-10-17 18:28:14 -0300693static struct mt2060_config stk7700p_mt2060_config = {
694 0x60
695};
696
Patrick Boettcherb7f54912006-09-19 12:51:37 -0300697static int stk7700p_tuner_attach(struct dvb_usb_adapter *adap)
698{
Olivier DANETc52344f2008-01-25 06:50:07 -0300699 struct i2c_adapter *prim_i2c = &adap->dev->i2c_adap;
Patrick Boettcher69ea31e2006-10-17 18:28:14 -0300700 struct dib0700_state *st = adap->dev->priv;
Patrick Boettchera75763f2006-10-18 08:34:16 -0300701 struct i2c_adapter *tun_i2c;
Olivier DANETc52344f2008-01-25 06:50:07 -0300702 s8 a;
703 int if1=1220;
Al Viroda5ee482008-05-21 00:31:21 -0300704 if (adap->dev->udev->descriptor.idVendor == cpu_to_le16(USB_VID_HAUPPAUGE) &&
705 adap->dev->udev->descriptor.idProduct == cpu_to_le16(USB_PID_HAUPPAUGE_NOVA_T_STICK)) {
Olivier DANETc52344f2008-01-25 06:50:07 -0300706 if (!eeprom_read(prim_i2c,0x58,&a)) if1=1220+a;
707 }
Patrick Boettchera75763f2006-10-18 08:34:16 -0300708 if (st->is_dib7000pc)
709 tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1);
710 else
711 tun_i2c = dib7000m_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1);
712
713 return dvb_attach(mt2060_attach, adap->fe, tun_i2c, &stk7700p_mt2060_config,
Olivier DANETc52344f2008-01-25 06:50:07 -0300714 if1) == NULL ? -ENODEV : 0;
Patrick Boettcherb7f54912006-09-19 12:51:37 -0300715}
716
Patrick Boettcher01373a52007-07-30 12:49:04 -0300717/* DIB7070 generic */
718static struct dibx000_agc_config dib7070_agc_config = {
719 BAND_UHF | BAND_VHF | BAND_LBAND | BAND_SBAND,
720 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=5, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0,
721 * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0 */
Olivier Grenie9c783032009-12-07 07:49:40 -0300722 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8)
723 | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
Patrick Boettcher01373a52007-07-30 12:49:04 -0300724
Olivier Grenie9c783032009-12-07 07:49:40 -0300725 600,
726 10,
Patrick Boettcher01373a52007-07-30 12:49:04 -0300727
Olivier Grenie9c783032009-12-07 07:49:40 -0300728 0,
729 118,
Patrick Boettcher01373a52007-07-30 12:49:04 -0300730
Olivier Grenie9c783032009-12-07 07:49:40 -0300731 0,
732 3530,
733 1,
734 5,
Patrick Boettcher01373a52007-07-30 12:49:04 -0300735
Olivier Grenie9c783032009-12-07 07:49:40 -0300736 65535,
737 0,
Patrick Boettcher01373a52007-07-30 12:49:04 -0300738
Olivier Grenie9c783032009-12-07 07:49:40 -0300739 65535,
740 0,
Patrick Boettcher01373a52007-07-30 12:49:04 -0300741
Olivier Grenie9c783032009-12-07 07:49:40 -0300742 0,
743 40,
744 183,
745 206,
746 255,
747 72,
748 152,
749 88,
750 90,
Patrick Boettcher01373a52007-07-30 12:49:04 -0300751
Olivier Grenie9c783032009-12-07 07:49:40 -0300752 17,
753 27,
754 23,
755 51,
Patrick Boettcher01373a52007-07-30 12:49:04 -0300756
Olivier Grenie9c783032009-12-07 07:49:40 -0300757 0,
Patrick Boettcher01373a52007-07-30 12:49:04 -0300758};
759
760static int dib7070_tuner_reset(struct dvb_frontend *fe, int onoff)
761{
Patrick Boettcher7e5ce652009-08-03 13:43:40 -0300762 deb_info("reset: %d", onoff);
Patrick Boettcher01373a52007-07-30 12:49:04 -0300763 return dib7000p_set_gpio(fe, 8, 0, !onoff);
764}
765
766static int dib7070_tuner_sleep(struct dvb_frontend *fe, int onoff)
767{
Patrick Boettcher7e5ce652009-08-03 13:43:40 -0300768 deb_info("sleep: %d", onoff);
Patrick Boettcher01373a52007-07-30 12:49:04 -0300769 return dib7000p_set_gpio(fe, 9, 0, onoff);
770}
771
772static struct dib0070_config dib7070p_dib0070_config[2] = {
773 {
774 .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS,
775 .reset = dib7070_tuner_reset,
776 .sleep = dib7070_tuner_sleep,
777 .clock_khz = 12000,
Patrick Boettcher7e5ce652009-08-03 13:43:40 -0300778 .clock_pad_drive = 4,
779 .charge_pump = 2,
Patrick Boettcher01373a52007-07-30 12:49:04 -0300780 }, {
781 .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS,
782 .reset = dib7070_tuner_reset,
783 .sleep = dib7070_tuner_sleep,
784 .clock_khz = 12000,
Patrick Boettcher7e5ce652009-08-03 13:43:40 -0300785 .charge_pump = 2,
Patrick Boettcher01373a52007-07-30 12:49:04 -0300786 }
787};
788
Olivier Grenied300bd62009-09-15 06:55:35 -0300789static struct dib0070_config dib7770p_dib0070_config = {
790 .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS,
791 .reset = dib7070_tuner_reset,
792 .sleep = dib7070_tuner_sleep,
793 .clock_khz = 12000,
794 .clock_pad_drive = 0,
795 .flip_chip = 1,
Olivier Grenieeac1fe12009-09-23 13:41:27 -0300796 .charge_pump = 2,
Olivier Grenied300bd62009-09-15 06:55:35 -0300797};
798
Patrick Boettcher01373a52007-07-30 12:49:04 -0300799static int dib7070_set_param_override(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep)
800{
801 struct dvb_usb_adapter *adap = fe->dvb->priv;
802 struct dib0700_adapter_state *state = adap->priv;
803
804 u16 offset;
805 u8 band = BAND_OF_FREQUENCY(fep->frequency/1000);
806 switch (band) {
807 case BAND_VHF: offset = 950; break;
808 case BAND_UHF:
809 default: offset = 550; break;
810 }
811 deb_info("WBD for DiB7000P: %d\n", offset + dib0070_wbd_offset(fe));
812 dib7000p_set_wbd_ref(fe, offset + dib0070_wbd_offset(fe));
813 return state->set_param_save(fe, fep);
814}
815
Olivier Grenied300bd62009-09-15 06:55:35 -0300816static int dib7770_set_param_override(struct dvb_frontend *fe,
817 struct dvb_frontend_parameters *fep)
818{
819 struct dvb_usb_adapter *adap = fe->dvb->priv;
820 struct dib0700_adapter_state *state = adap->priv;
821
822 u16 offset;
823 u8 band = BAND_OF_FREQUENCY(fep->frequency/1000);
824 switch (band) {
825 case BAND_VHF:
826 dib7000p_set_gpio(fe, 0, 0, 1);
827 offset = 850;
828 break;
829 case BAND_UHF:
830 default:
831 dib7000p_set_gpio(fe, 0, 0, 0);
832 offset = 250;
833 break;
834 }
835 deb_info("WBD for DiB7000P: %d\n", offset + dib0070_wbd_offset(fe));
836 dib7000p_set_wbd_ref(fe, offset + dib0070_wbd_offset(fe));
837 return state->set_param_save(fe, fep);
838}
839
840static int dib7770p_tuner_attach(struct dvb_usb_adapter *adap)
841{
842 struct dib0700_adapter_state *st = adap->priv;
843 struct i2c_adapter *tun_i2c = dib7000p_get_i2c_master(adap->fe,
844 DIBX000_I2C_INTERFACE_TUNER, 1);
845
846 if (dvb_attach(dib0070_attach, adap->fe, tun_i2c,
847 &dib7770p_dib0070_config) == NULL)
848 return -ENODEV;
849
850 st->set_param_save = adap->fe->ops.tuner_ops.set_params;
851 adap->fe->ops.tuner_ops.set_params = dib7770_set_param_override;
852 return 0;
853}
854
Patrick Boettcher01373a52007-07-30 12:49:04 -0300855static int dib7070p_tuner_attach(struct dvb_usb_adapter *adap)
856{
857 struct dib0700_adapter_state *st = adap->priv;
858 struct i2c_adapter *tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1);
859
860 if (adap->id == 0) {
861 if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, &dib7070p_dib0070_config[0]) == NULL)
862 return -ENODEV;
863 } else {
864 if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, &dib7070p_dib0070_config[1]) == NULL)
865 return -ENODEV;
866 }
867
868 st->set_param_save = adap->fe->ops.tuner_ops.set_params;
869 adap->fe->ops.tuner_ops.set_params = dib7070_set_param_override;
870 return 0;
871}
872
Olivier Grenief8731f42009-09-18 04:08:43 -0300873static int stk70x0p_pid_filter(struct dvb_usb_adapter *adapter, int index, u16 pid, int onoff)
874{
875 return dib7000p_pid_filter(adapter->fe, index, pid, onoff);
876}
877
878static int stk70x0p_pid_filter_ctrl(struct dvb_usb_adapter *adapter, int onoff)
879{
880 return dib7000p_pid_filter_ctrl(adapter->fe, onoff);
881}
882
Patrick Boettcher01373a52007-07-30 12:49:04 -0300883static struct dibx000_bandwidth_config dib7070_bw_config_12_mhz = {
Olivier Grenie9c783032009-12-07 07:49:40 -0300884 60000, 15000,
885 1, 20, 3, 1, 0,
886 0, 0, 1, 1, 2,
887 (3 << 14) | (1 << 12) | (524 << 0),
888 (0 << 25) | 0,
889 20452225,
890 12000000,
Patrick Boettcher01373a52007-07-30 12:49:04 -0300891};
892
893static struct dib7000p_config dib7070p_dib7000p_config = {
894 .output_mpeg2_in_188_bytes = 1,
895
896 .agc_config_count = 1,
897 .agc = &dib7070_agc_config,
898 .bw = &dib7070_bw_config_12_mhz,
Patrick Boettcher3cb2c392008-01-25 07:25:20 -0300899 .tuner_is_baseband = 1,
900 .spur_protect = 1,
Patrick Boettcher01373a52007-07-30 12:49:04 -0300901
902 .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
903 .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
904 .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
905
906 .hostbus_diversity = 1,
907};
908
909/* STK7070P */
910static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap)
911{
Al Viroda5ee482008-05-21 00:31:21 -0300912 struct usb_device_descriptor *p = &adap->dev->udev->descriptor;
913 if (p->idVendor == cpu_to_le16(USB_VID_PINNACLE) &&
914 p->idProduct == cpu_to_le16(USB_PID_PINNACLE_PCTV72E))
915 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0);
Albert Comerma6ca8f0b2008-03-29 21:35:57 -0300916 else
Al Viroda5ee482008-05-21 00:31:21 -0300917 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
Patrick Boettcher01373a52007-07-30 12:49:04 -0300918 msleep(10);
919 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
920 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
921 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
922 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
923
924 dib0700_ctrl_clock(adap->dev, 72, 1);
925
926 msleep(10);
927 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
928 msleep(10);
929 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
930
Devin Heitmueller83c4fdf2009-01-21 01:55:45 -0300931 if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18,
932 &dib7070p_dib7000p_config) != 0) {
933 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n",
934 __func__);
935 return -ENODEV;
936 }
Patrick Boettcher01373a52007-07-30 12:49:04 -0300937
Albert Comerma6ca8f0b2008-03-29 21:35:57 -0300938 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80,
939 &dib7070p_dib7000p_config);
Patrick Boettcher01373a52007-07-30 12:49:04 -0300940 return adap->fe == NULL ? -ENODEV : 0;
941}
942
Olivier Grenie90e12ce2010-09-07 12:50:45 -0300943/* STK7770P */
944static struct dib7000p_config dib7770p_dib7000p_config = {
945 .output_mpeg2_in_188_bytes = 1,
946
947 .agc_config_count = 1,
948 .agc = &dib7070_agc_config,
949 .bw = &dib7070_bw_config_12_mhz,
950 .tuner_is_baseband = 1,
951 .spur_protect = 1,
952
953 .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
954 .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
955 .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
956
957 .hostbus_diversity = 1,
958 .enable_current_mirror = 1,
Olivier Grenie970d14c2010-09-07 12:50:46 -0300959 .disable_sample_and_hold = 0,
Olivier Grenie90e12ce2010-09-07 12:50:45 -0300960};
961
962static int stk7770p_frontend_attach(struct dvb_usb_adapter *adap)
963{
964 struct usb_device_descriptor *p = &adap->dev->udev->descriptor;
965 if (p->idVendor == cpu_to_le16(USB_VID_PINNACLE) &&
966 p->idProduct == cpu_to_le16(USB_PID_PINNACLE_PCTV72E))
967 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0);
968 else
969 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
970 msleep(10);
971 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
972 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
973 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
974 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
975
976 dib0700_ctrl_clock(adap->dev, 72, 1);
977
978 msleep(10);
979 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
980 msleep(10);
981 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
982
983 if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18,
984 &dib7770p_dib7000p_config) != 0) {
985 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n",
986 __func__);
987 return -ENODEV;
988 }
989
990 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80,
991 &dib7770p_dib7000p_config);
992 return adap->fe == NULL ? -ENODEV : 0;
993}
994
Patrick Boettcherba3fe3a2009-09-16 09:51:30 -0300995/* DIB807x generic */
996static struct dibx000_agc_config dib807x_agc_config[2] = {
997 {
998 BAND_VHF,
999 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0,
1000 * P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0,
1001 * P_agc_inv_pwm2=0,P_agc_inh_dc_rv_est=0,
1002 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5,
1003 * P_agc_write=0 */
1004 (0 << 15) | (0 << 14) | (7 << 11) | (0 << 10) | (0 << 9) |
1005 (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) |
1006 (0 << 0), /* setup*/
1007
1008 600, /* inv_gain*/
1009 10, /* time_stabiliz*/
1010
1011 0, /* alpha_level*/
1012 118, /* thlock*/
1013
1014 0, /* wbd_inv*/
1015 3530, /* wbd_ref*/
1016 1, /* wbd_sel*/
1017 5, /* wbd_alpha*/
1018
1019 65535, /* agc1_max*/
1020 0, /* agc1_min*/
1021
1022 65535, /* agc2_max*/
1023 0, /* agc2_min*/
1024
1025 0, /* agc1_pt1*/
1026 40, /* agc1_pt2*/
1027 183, /* agc1_pt3*/
1028 206, /* agc1_slope1*/
1029 255, /* agc1_slope2*/
1030 72, /* agc2_pt1*/
1031 152, /* agc2_pt2*/
1032 88, /* agc2_slope1*/
1033 90, /* agc2_slope2*/
1034
1035 17, /* alpha_mant*/
1036 27, /* alpha_exp*/
1037 23, /* beta_mant*/
1038 51, /* beta_exp*/
1039
1040 0, /* perform_agc_softsplit*/
1041 }, {
1042 BAND_UHF,
1043 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0,
1044 * P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0,
1045 * P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
1046 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5,
1047 * P_agc_write=0 */
1048 (0 << 15) | (0 << 14) | (1 << 11) | (0 << 10) | (0 << 9) |
1049 (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) |
1050 (0 << 0), /* setup */
1051
1052 600, /* inv_gain*/
1053 10, /* time_stabiliz*/
1054
1055 0, /* alpha_level*/
1056 118, /* thlock*/
1057
1058 0, /* wbd_inv*/
1059 3530, /* wbd_ref*/
1060 1, /* wbd_sel*/
1061 5, /* wbd_alpha*/
1062
1063 65535, /* agc1_max*/
1064 0, /* agc1_min*/
1065
1066 65535, /* agc2_max*/
1067 0, /* agc2_min*/
1068
1069 0, /* agc1_pt1*/
1070 40, /* agc1_pt2*/
1071 183, /* agc1_pt3*/
1072 206, /* agc1_slope1*/
1073 255, /* agc1_slope2*/
1074 72, /* agc2_pt1*/
1075 152, /* agc2_pt2*/
1076 88, /* agc2_slope1*/
1077 90, /* agc2_slope2*/
1078
1079 17, /* alpha_mant*/
1080 27, /* alpha_exp*/
1081 23, /* beta_mant*/
1082 51, /* beta_exp*/
1083
1084 0, /* perform_agc_softsplit*/
1085 }
1086};
1087
1088static struct dibx000_bandwidth_config dib807x_bw_config_12_mhz = {
1089 60000, 15000, /* internal, sampling*/
1090 1, 20, 3, 1, 0, /* pll_cfg: prediv, ratio, range, reset, bypass*/
1091 0, 0, 1, 1, 2, /* misc: refdiv, bypclk_div, IO_CLK_en_core,
1092 ADClkSrc, modulo */
1093 (3 << 14) | (1 << 12) | (599 << 0), /* sad_cfg: refsel, sel, freq_15k*/
1094 (0 << 25) | 0, /* ifreq = 0.000000 MHz*/
1095 18179755, /* timf*/
1096 12000000, /* xtal_hz*/
1097};
1098
1099static struct dib8000_config dib807x_dib8000_config[2] = {
1100 {
1101 .output_mpeg2_in_188_bytes = 1,
1102
1103 .agc_config_count = 2,
1104 .agc = dib807x_agc_config,
1105 .pll = &dib807x_bw_config_12_mhz,
1106 .tuner_is_baseband = 1,
1107
1108 .gpio_dir = DIB8000_GPIO_DEFAULT_DIRECTIONS,
1109 .gpio_val = DIB8000_GPIO_DEFAULT_VALUES,
1110 .gpio_pwm_pos = DIB8000_GPIO_DEFAULT_PWM_POS,
1111
1112 .hostbus_diversity = 1,
1113 .div_cfg = 1,
1114 .agc_control = &dib0070_ctrl_agc_filter,
1115 .output_mode = OUTMODE_MPEG2_FIFO,
1116 .drives = 0x2d98,
1117 }, {
1118 .output_mpeg2_in_188_bytes = 1,
1119
1120 .agc_config_count = 2,
1121 .agc = dib807x_agc_config,
1122 .pll = &dib807x_bw_config_12_mhz,
1123 .tuner_is_baseband = 1,
1124
1125 .gpio_dir = DIB8000_GPIO_DEFAULT_DIRECTIONS,
1126 .gpio_val = DIB8000_GPIO_DEFAULT_VALUES,
1127 .gpio_pwm_pos = DIB8000_GPIO_DEFAULT_PWM_POS,
1128
1129 .hostbus_diversity = 1,
1130 .agc_control = &dib0070_ctrl_agc_filter,
1131 .output_mode = OUTMODE_MPEG2_FIFO,
1132 .drives = 0x2d98,
1133 }
1134};
1135
Olivier Grenie03245a52009-12-04 13:27:57 -03001136static int dib80xx_tuner_reset(struct dvb_frontend *fe, int onoff)
Patrick Boettcherba3fe3a2009-09-16 09:51:30 -03001137{
1138 return dib8000_set_gpio(fe, 5, 0, !onoff);
1139}
1140
Olivier Grenie03245a52009-12-04 13:27:57 -03001141static int dib80xx_tuner_sleep(struct dvb_frontend *fe, int onoff)
Patrick Boettcherba3fe3a2009-09-16 09:51:30 -03001142{
1143 return dib8000_set_gpio(fe, 0, 0, onoff);
1144}
1145
1146static const struct dib0070_wbd_gain_cfg dib8070_wbd_gain_cfg[] = {
1147 { 240, 7},
1148 { 0xffff, 6},
1149};
1150
1151static struct dib0070_config dib807x_dib0070_config[2] = {
1152 {
1153 .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS,
Olivier Grenie03245a52009-12-04 13:27:57 -03001154 .reset = dib80xx_tuner_reset,
1155 .sleep = dib80xx_tuner_sleep,
Patrick Boettcherba3fe3a2009-09-16 09:51:30 -03001156 .clock_khz = 12000,
1157 .clock_pad_drive = 4,
1158 .vga_filter = 1,
1159 .force_crystal_mode = 1,
1160 .enable_third_order_filter = 1,
1161 .charge_pump = 0,
1162 .wbd_gain = dib8070_wbd_gain_cfg,
1163 .osc_buffer_state = 0,
1164 .freq_offset_khz_uhf = -100,
1165 .freq_offset_khz_vhf = -100,
1166 }, {
1167 .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS,
Olivier Grenie03245a52009-12-04 13:27:57 -03001168 .reset = dib80xx_tuner_reset,
1169 .sleep = dib80xx_tuner_sleep,
Patrick Boettcherba3fe3a2009-09-16 09:51:30 -03001170 .clock_khz = 12000,
1171 .clock_pad_drive = 2,
1172 .vga_filter = 1,
1173 .force_crystal_mode = 1,
1174 .enable_third_order_filter = 1,
1175 .charge_pump = 0,
1176 .wbd_gain = dib8070_wbd_gain_cfg,
1177 .osc_buffer_state = 0,
1178 .freq_offset_khz_uhf = -25,
1179 .freq_offset_khz_vhf = -25,
1180 }
1181};
1182
1183static int dib807x_set_param_override(struct dvb_frontend *fe,
1184 struct dvb_frontend_parameters *fep)
1185{
1186 struct dvb_usb_adapter *adap = fe->dvb->priv;
1187 struct dib0700_adapter_state *state = adap->priv;
1188
1189 u16 offset = dib0070_wbd_offset(fe);
1190 u8 band = BAND_OF_FREQUENCY(fep->frequency/1000);
1191 switch (band) {
1192 case BAND_VHF:
1193 offset += 750;
1194 break;
1195 case BAND_UHF: /* fall-thru wanted */
1196 default:
1197 offset += 250; break;
1198 }
1199 deb_info("WBD for DiB8000: %d\n", offset);
1200 dib8000_set_wbd_ref(fe, offset);
1201
1202 return state->set_param_save(fe, fep);
1203}
1204
1205static int dib807x_tuner_attach(struct dvb_usb_adapter *adap)
1206{
1207 struct dib0700_adapter_state *st = adap->priv;
1208 struct i2c_adapter *tun_i2c = dib8000_get_i2c_master(adap->fe,
1209 DIBX000_I2C_INTERFACE_TUNER, 1);
1210
1211 if (adap->id == 0) {
1212 if (dvb_attach(dib0070_attach, adap->fe, tun_i2c,
1213 &dib807x_dib0070_config[0]) == NULL)
1214 return -ENODEV;
1215 } else {
1216 if (dvb_attach(dib0070_attach, adap->fe, tun_i2c,
1217 &dib807x_dib0070_config[1]) == NULL)
1218 return -ENODEV;
1219 }
1220
1221 st->set_param_save = adap->fe->ops.tuner_ops.set_params;
1222 adap->fe->ops.tuner_ops.set_params = dib807x_set_param_override;
1223 return 0;
1224}
1225
Olivier Grenie9c783032009-12-07 07:49:40 -03001226static int stk80xx_pid_filter(struct dvb_usb_adapter *adapter, int index,
1227 u16 pid, int onoff)
Olivier Grenief8731f42009-09-18 04:08:43 -03001228{
1229 return dib8000_pid_filter(adapter->fe, index, pid, onoff);
1230}
1231
Olivier Grenie9c783032009-12-07 07:49:40 -03001232static int stk80xx_pid_filter_ctrl(struct dvb_usb_adapter *adapter,
1233 int onoff)
Olivier Grenief8731f42009-09-18 04:08:43 -03001234{
1235 return dib8000_pid_filter_ctrl(adapter->fe, onoff);
1236}
Patrick Boettcherba3fe3a2009-09-16 09:51:30 -03001237
1238/* STK807x */
1239static int stk807x_frontend_attach(struct dvb_usb_adapter *adap)
1240{
1241 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
1242 msleep(10);
1243 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
1244 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
1245 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
1246
1247 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
1248
1249 dib0700_ctrl_clock(adap->dev, 72, 1);
1250
1251 msleep(10);
1252 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
1253 msleep(10);
1254 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
1255
1256 dib8000_i2c_enumeration(&adap->dev->i2c_adap, 1, 18,
1257 0x80);
1258
1259 adap->fe = dvb_attach(dib8000_attach, &adap->dev->i2c_adap, 0x80,
1260 &dib807x_dib8000_config[0]);
1261
1262 return adap->fe == NULL ? -ENODEV : 0;
1263}
1264
1265/* STK807xPVR */
1266static int stk807xpvr_frontend_attach0(struct dvb_usb_adapter *adap)
1267{
1268 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0);
1269 msleep(30);
1270 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
1271 msleep(500);
1272 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
1273 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
1274 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
1275
1276 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
1277
1278 dib0700_ctrl_clock(adap->dev, 72, 1);
1279
1280 msleep(10);
1281 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
1282 msleep(10);
1283 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
1284
1285 /* initialize IC 0 */
Olivier Grenie9542f502009-12-07 08:09:04 -03001286 dib8000_i2c_enumeration(&adap->dev->i2c_adap, 1, 0x22, 0x80);
Patrick Boettcherba3fe3a2009-09-16 09:51:30 -03001287
1288 adap->fe = dvb_attach(dib8000_attach, &adap->dev->i2c_adap, 0x80,
1289 &dib807x_dib8000_config[0]);
1290
1291 return adap->fe == NULL ? -ENODEV : 0;
1292}
1293
1294static int stk807xpvr_frontend_attach1(struct dvb_usb_adapter *adap)
1295{
1296 /* initialize IC 1 */
Olivier Grenie9542f502009-12-07 08:09:04 -03001297 dib8000_i2c_enumeration(&adap->dev->i2c_adap, 1, 0x12, 0x82);
Patrick Boettcherba3fe3a2009-09-16 09:51:30 -03001298
1299 adap->fe = dvb_attach(dib8000_attach, &adap->dev->i2c_adap, 0x82,
1300 &dib807x_dib8000_config[1]);
1301
1302 return adap->fe == NULL ? -ENODEV : 0;
1303}
1304
Olivier Grenie03245a52009-12-04 13:27:57 -03001305/* STK8096GP */
1306struct dibx000_agc_config dib8090_agc_config[2] = {
1307 {
1308 BAND_UHF | BAND_VHF | BAND_LBAND | BAND_SBAND,
Olivier Grenie9c783032009-12-07 07:49:40 -03001309 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1,
1310 * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
1311 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0 */
1312 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8)
1313 | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
Olivier Grenie03245a52009-12-04 13:27:57 -03001314
Olivier Grenie9c783032009-12-07 07:49:40 -03001315 787,
1316 10,
Olivier Grenie03245a52009-12-04 13:27:57 -03001317
Olivier Grenie9c783032009-12-07 07:49:40 -03001318 0,
1319 118,
Olivier Grenie03245a52009-12-04 13:27:57 -03001320
Olivier Grenie9c783032009-12-07 07:49:40 -03001321 0,
1322 3530,
1323 1,
1324 5,
Olivier Grenie03245a52009-12-04 13:27:57 -03001325
Olivier Grenie9c783032009-12-07 07:49:40 -03001326 65535,
1327 0,
Olivier Grenie03245a52009-12-04 13:27:57 -03001328
Olivier Grenie9c783032009-12-07 07:49:40 -03001329 65535,
1330 0,
Olivier Grenie03245a52009-12-04 13:27:57 -03001331
Olivier Grenie9c783032009-12-07 07:49:40 -03001332 0,
1333 32,
1334 114,
1335 143,
1336 144,
1337 114,
1338 227,
1339 116,
1340 117,
Olivier Grenie03245a52009-12-04 13:27:57 -03001341
Olivier Grenie9c783032009-12-07 07:49:40 -03001342 28,
1343 26,
1344 31,
1345 51,
Olivier Grenie03245a52009-12-04 13:27:57 -03001346
Olivier Grenie9c783032009-12-07 07:49:40 -03001347 0,
Olivier Grenie03245a52009-12-04 13:27:57 -03001348 },
1349 {
1350 BAND_CBAND,
Olivier Grenie9c783032009-12-07 07:49:40 -03001351 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1,
1352 * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
1353 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0 */
1354 (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8)
1355 | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
Olivier Grenie03245a52009-12-04 13:27:57 -03001356
Olivier Grenie9c783032009-12-07 07:49:40 -03001357 787,
1358 10,
Olivier Grenie03245a52009-12-04 13:27:57 -03001359
Olivier Grenie9c783032009-12-07 07:49:40 -03001360 0,
1361 118,
Olivier Grenie03245a52009-12-04 13:27:57 -03001362
Olivier Grenie9c783032009-12-07 07:49:40 -03001363 0,
1364 3530,
1365 1,
1366 5,
Olivier Grenie03245a52009-12-04 13:27:57 -03001367
Olivier Grenie9c783032009-12-07 07:49:40 -03001368 0,
1369 0,
Olivier Grenie03245a52009-12-04 13:27:57 -03001370
Olivier Grenie9c783032009-12-07 07:49:40 -03001371 65535,
1372 0,
Olivier Grenie03245a52009-12-04 13:27:57 -03001373
Olivier Grenie9c783032009-12-07 07:49:40 -03001374 0,
1375 32,
1376 114,
1377 143,
1378 144,
1379 114,
1380 227,
1381 116,
1382 117,
Olivier Grenie03245a52009-12-04 13:27:57 -03001383
Olivier Grenie9c783032009-12-07 07:49:40 -03001384 28,
1385 26,
1386 31,
1387 51,
Olivier Grenie03245a52009-12-04 13:27:57 -03001388
Olivier Grenie9c783032009-12-07 07:49:40 -03001389 0,
Olivier Grenie03245a52009-12-04 13:27:57 -03001390 }
1391};
1392
1393static struct dibx000_bandwidth_config dib8090_pll_config_12mhz = {
Olivier Grenie9c783032009-12-07 07:49:40 -03001394 54000, 13500,
1395 1, 18, 3, 1, 0,
1396 0, 0, 1, 1, 2,
1397 (3 << 14) | (1 << 12) | (599 << 0),
1398 (0 << 25) | 0,
1399 20199727,
1400 12000000,
Olivier Grenie03245a52009-12-04 13:27:57 -03001401};
1402
1403static int dib8090_get_adc_power(struct dvb_frontend *fe)
1404{
1405 return dib8000_get_adc_power(fe, 1);
1406}
1407
1408static struct dib8000_config dib809x_dib8000_config = {
1409 .output_mpeg2_in_188_bytes = 1,
1410
1411 .agc_config_count = 2,
1412 .agc = dib8090_agc_config,
1413 .agc_control = dib0090_dcc_freq,
1414 .pll = &dib8090_pll_config_12mhz,
1415 .tuner_is_baseband = 1,
1416
1417 .gpio_dir = DIB8000_GPIO_DEFAULT_DIRECTIONS,
1418 .gpio_val = DIB8000_GPIO_DEFAULT_VALUES,
1419 .gpio_pwm_pos = DIB8000_GPIO_DEFAULT_PWM_POS,
1420
1421 .hostbus_diversity = 1,
1422 .div_cfg = 0x31,
1423 .output_mode = OUTMODE_MPEG2_FIFO,
1424 .drives = 0x2d98,
1425 .diversity_delay = 144,
1426 .refclksel = 3,
1427};
1428
1429static struct dib0090_config dib809x_dib0090_config = {
1430 .io.pll_bypass = 1,
1431 .io.pll_range = 1,
1432 .io.pll_prediv = 1,
1433 .io.pll_loopdiv = 20,
1434 .io.adc_clock_ratio = 8,
1435 .io.pll_int_loop_filt = 0,
1436 .io.clock_khz = 12000,
1437 .reset = dib80xx_tuner_reset,
1438 .sleep = dib80xx_tuner_sleep,
1439 .clkouttobamse = 1,
1440 .analog_output = 1,
1441 .i2c_address = DEFAULT_DIB0090_I2C_ADDRESS,
1442 .wbd_vhf_offset = 100,
1443 .wbd_cband_offset = 450,
1444 .use_pwm_agc = 1,
1445 .clkoutdrive = 1,
1446 .get_adc_power = dib8090_get_adc_power,
1447 .freq_offset_khz_uhf = 0,
1448 .freq_offset_khz_vhf = -143,
1449};
1450
1451static int dib8096_set_param_override(struct dvb_frontend *fe,
1452 struct dvb_frontend_parameters *fep)
1453{
1454 struct dvb_usb_adapter *adap = fe->dvb->priv;
1455 struct dib0700_adapter_state *state = adap->priv;
1456 u8 band = BAND_OF_FREQUENCY(fep->frequency/1000);
1457 u16 offset;
1458 int ret = 0;
1459 enum frontend_tune_state tune_state = CT_SHUTDOWN;
1460 u16 ltgain, rf_gain_limit;
1461
1462 ret = state->set_param_save(fe, fep);
1463 if (ret < 0)
1464 return ret;
1465
1466 switch (band) {
Olivier Grenie9c783032009-12-07 07:49:40 -03001467 case BAND_VHF:
Olivier Grenie03245a52009-12-04 13:27:57 -03001468 offset = 100;
1469 break;
Olivier Grenie9c783032009-12-07 07:49:40 -03001470 case BAND_UHF:
Olivier Grenie03245a52009-12-04 13:27:57 -03001471 offset = 550;
1472 break;
Olivier Grenie9c783032009-12-07 07:49:40 -03001473 default:
Olivier Grenie03245a52009-12-04 13:27:57 -03001474 offset = 0;
1475 break;
1476 }
1477 offset += (dib0090_get_wbd_offset(fe) * 8 * 18 / 33 + 1) / 2;
1478 dib8000_set_wbd_ref(fe, offset);
1479
1480
Olivier Grenie9c783032009-12-07 07:49:40 -03001481 if (band == BAND_CBAND) {
Olivier Grenie03245a52009-12-04 13:27:57 -03001482 deb_info("tuning in CBAND - soft-AGC startup\n");
1483 /* TODO specific wbd target for dib0090 - needed for startup ? */
1484 dib0090_set_tune_state(fe, CT_AGC_START);
Olivier Grenie9c783032009-12-07 07:49:40 -03001485 do {
1486 ret = dib0090_gain_control(fe);
1487 msleep(ret);
1488 tune_state = dib0090_get_tune_state(fe);
1489 if (tune_state == CT_AGC_STEP_0)
1490 dib8000_set_gpio(fe, 6, 0, 1);
1491 else if (tune_state == CT_AGC_STEP_1) {
1492 dib0090_get_current_gain(fe, NULL, NULL, &rf_gain_limit, &ltgain);
1493 if (rf_gain_limit == 0)
1494 dib8000_set_gpio(fe, 6, 0, 0);
1495 }
1496 } while (tune_state < CT_AGC_STOP);
Olivier Grenie03245a52009-12-04 13:27:57 -03001497 dib0090_pwm_gain_reset(fe);
1498 dib8000_pwm_agc_reset(fe);
1499 dib8000_set_tune_state(fe, CT_DEMOD_START);
Olivier Grenie9c783032009-12-07 07:49:40 -03001500 } else {
Olivier Grenie03245a52009-12-04 13:27:57 -03001501 deb_info("not tuning in CBAND - standard AGC startup\n");
1502 dib0090_pwm_gain_reset(fe);
1503 }
1504
1505 return 0;
1506}
1507
1508static int dib809x_tuner_attach(struct dvb_usb_adapter *adap)
1509{
1510 struct dib0700_adapter_state *st = adap->priv;
1511 struct i2c_adapter *tun_i2c = dib8000_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1);
1512
1513 if (dvb_attach(dib0090_register, adap->fe, tun_i2c, &dib809x_dib0090_config) == NULL)
1514 return -ENODEV;
1515
1516 st->set_param_save = adap->fe->ops.tuner_ops.set_params;
1517 adap->fe->ops.tuner_ops.set_params = dib8096_set_param_override;
1518 return 0;
1519}
1520
1521static int stk809x_frontend_attach(struct dvb_usb_adapter *adap)
1522{
1523 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
1524 msleep(10);
1525 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
1526 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
1527 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
1528
1529 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
1530
1531 dib0700_ctrl_clock(adap->dev, 72, 1);
1532
1533 msleep(10);
1534 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
1535 msleep(10);
1536 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
1537
1538 dib8000_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, 0x80);
1539
1540 adap->fe = dvb_attach(dib8000_attach, &adap->dev->i2c_adap, 0x80, &dib809x_dib8000_config);
1541
1542 return adap->fe == NULL ? -ENODEV : 0;
1543}
Patrick Boettcherba3fe3a2009-09-16 09:51:30 -03001544
Patrick Boettcher01373a52007-07-30 12:49:04 -03001545/* STK7070PD */
1546static struct dib7000p_config stk7070pd_dib7000p_config[2] = {
1547 {
1548 .output_mpeg2_in_188_bytes = 1,
1549
1550 .agc_config_count = 1,
1551 .agc = &dib7070_agc_config,
1552 .bw = &dib7070_bw_config_12_mhz,
Patrick Boettcher3cb2c392008-01-25 07:25:20 -03001553 .tuner_is_baseband = 1,
1554 .spur_protect = 1,
Patrick Boettcher01373a52007-07-30 12:49:04 -03001555
1556 .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
1557 .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
1558 .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
1559
1560 .hostbus_diversity = 1,
1561 }, {
1562 .output_mpeg2_in_188_bytes = 1,
1563
1564 .agc_config_count = 1,
1565 .agc = &dib7070_agc_config,
1566 .bw = &dib7070_bw_config_12_mhz,
Patrick Boettcher3cb2c392008-01-25 07:25:20 -03001567 .tuner_is_baseband = 1,
1568 .spur_protect = 1,
Patrick Boettcher01373a52007-07-30 12:49:04 -03001569
1570 .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
1571 .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
1572 .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
1573
1574 .hostbus_diversity = 1,
1575 }
1576};
1577
1578static int stk7070pd_frontend_attach0(struct dvb_usb_adapter *adap)
1579{
1580 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
1581 msleep(10);
1582 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
1583 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
1584 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
1585 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
1586
1587 dib0700_ctrl_clock(adap->dev, 72, 1);
1588
1589 msleep(10);
1590 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
1591 msleep(10);
1592 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
1593
Devin Heitmueller83c4fdf2009-01-21 01:55:45 -03001594 if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 2, 18,
1595 stk7070pd_dib7000p_config) != 0) {
1596 err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n",
1597 __func__);
1598 return -ENODEV;
1599 }
Patrick Boettcher01373a52007-07-30 12:49:04 -03001600
1601 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, &stk7070pd_dib7000p_config[0]);
1602 return adap->fe == NULL ? -ENODEV : 0;
1603}
1604
1605static int stk7070pd_frontend_attach1(struct dvb_usb_adapter *adap)
1606{
1607 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x82, &stk7070pd_dib7000p_config[1]);
1608 return adap->fe == NULL ? -ENODEV : 0;
1609}
1610
Devin Heitmuellercb22cb52008-09-08 05:42:42 -03001611/* S5H1411 */
1612static struct s5h1411_config pinnacle_801e_config = {
1613 .output_mode = S5H1411_PARALLEL_OUTPUT,
1614 .gpio = S5H1411_GPIO_OFF,
1615 .mpeg_timing = S5H1411_MPEGTIMING_NONCONTINOUS_NONINVERTING_CLOCK,
1616 .qam_if = S5H1411_IF_44000,
1617 .vsb_if = S5H1411_IF_44000,
1618 .inversion = S5H1411_INVERSION_OFF,
1619 .status_mode = S5H1411_DEMODLOCKING
1620};
1621
1622/* Pinnacle PCTV HD Pro 801e GPIOs map:
1623 GPIO0 - currently unknown
1624 GPIO1 - xc5000 tuner reset
1625 GPIO2 - CX25843 sleep
1626 GPIO3 - currently unknown
1627 GPIO4 - currently unknown
1628 GPIO6 - currently unknown
1629 GPIO7 - currently unknown
1630 GPIO9 - currently unknown
1631 GPIO10 - CX25843 reset
1632 */
1633static int s5h1411_frontend_attach(struct dvb_usb_adapter *adap)
1634{
1635 struct dib0700_state *st = adap->dev->priv;
1636
1637 /* Make use of the new i2c functions from FW 1.20 */
1638 st->fw_use_new_i2c_api = 1;
1639
1640 /* The s5h1411 requires the dib0700 to not be in master mode */
1641 st->disable_streaming_master_mode = 1;
1642
1643 /* All msleep values taken from Windows USB trace */
1644 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 0);
1645 dib0700_set_gpio(adap->dev, GPIO3, GPIO_OUT, 0);
1646 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
1647 msleep(400);
1648 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
1649 msleep(60);
1650 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
1651 msleep(30);
1652 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
1653 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
1654 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
1655 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
1656 dib0700_set_gpio(adap->dev, GPIO2, GPIO_OUT, 0);
1657 msleep(30);
1658
1659 /* Put the CX25843 to sleep for now since we're in digital mode */
1660 dib0700_set_gpio(adap->dev, GPIO2, GPIO_OUT, 1);
1661
1662 /* GPIOs are initialized, do the attach */
1663 adap->fe = dvb_attach(s5h1411_attach, &pinnacle_801e_config,
1664 &adap->dev->i2c_adap);
1665 return adap->fe == NULL ? -ENODEV : 0;
1666}
1667
Michael Krufky767f3b32008-09-25 09:47:07 -03001668static int dib0700_xc5000_tuner_callback(void *priv, int component,
1669 int command, int arg)
Devin Heitmuellercb22cb52008-09-08 05:42:42 -03001670{
1671 struct dvb_usb_adapter *adap = priv;
1672
Devin Heitmueller79025a92008-10-06 12:07:48 -03001673 if (command == XC5000_TUNER_RESET) {
1674 /* Reset the tuner */
1675 dib0700_set_gpio(adap->dev, GPIO1, GPIO_OUT, 0);
Devin Heitmuellerf0f46332009-05-04 21:57:41 -03001676 msleep(10);
Devin Heitmueller79025a92008-10-06 12:07:48 -03001677 dib0700_set_gpio(adap->dev, GPIO1, GPIO_OUT, 1);
Devin Heitmuellerf0f46332009-05-04 21:57:41 -03001678 msleep(10);
Devin Heitmueller79025a92008-10-06 12:07:48 -03001679 } else {
1680 err("xc5000: unknown tuner callback command: %d\n", command);
1681 return -EINVAL;
1682 }
Devin Heitmuellercb22cb52008-09-08 05:42:42 -03001683
1684 return 0;
1685}
1686
1687static struct xc5000_config s5h1411_xc5000_tunerconfig = {
1688 .i2c_address = 0x64,
1689 .if_khz = 5380,
Devin Heitmuellercb22cb52008-09-08 05:42:42 -03001690};
1691
1692static int xc5000_tuner_attach(struct dvb_usb_adapter *adap)
1693{
Devin Heitmueller79025a92008-10-06 12:07:48 -03001694 /* FIXME: generalize & move to common area */
1695 adap->fe->callback = dib0700_xc5000_tuner_callback;
1696
Devin Heitmuellercb22cb52008-09-08 05:42:42 -03001697 return dvb_attach(xc5000_attach, adap->fe, &adap->dev->i2c_adap,
Michael Krufky767f3b32008-09-25 09:47:07 -03001698 &s5h1411_xc5000_tunerconfig)
Devin Heitmuellercb22cb52008-09-08 05:42:42 -03001699 == NULL ? -ENODEV : 0;
1700}
1701
Michael Krufkyce904bc2009-01-19 01:12:55 -03001702static struct lgdt3305_config hcw_lgdt3305_config = {
1703 .i2c_addr = 0x0e,
1704 .mpeg_mode = LGDT3305_MPEG_PARALLEL,
1705 .tpclk_edge = LGDT3305_TPCLK_FALLING_EDGE,
1706 .tpvalid_polarity = LGDT3305_TP_VALID_LOW,
1707 .deny_i2c_rptr = 0,
1708 .spectral_inversion = 1,
1709 .qam_if_khz = 6000,
1710 .vsb_if_khz = 6000,
1711 .usref_8vsb = 0x0500,
1712};
1713
1714static struct mxl5007t_config hcw_mxl5007t_config = {
1715 .xtal_freq_hz = MxL_XTAL_25_MHZ,
1716 .if_freq_hz = MxL_IF_6_MHZ,
1717 .invert_if = 1,
1718};
1719
1720/* TIGER-ATSC map:
1721 GPIO0 - LNA_CTR (H: LNA power enabled, L: LNA power disabled)
1722 GPIO1 - ANT_SEL (H: VPA, L: MCX)
1723 GPIO4 - SCL2
1724 GPIO6 - EN_TUNER
1725 GPIO7 - SDA2
1726 GPIO10 - DEM_RST
1727
1728 MXL is behind LG's i2c repeater. LG is on SCL2/SDA2 gpios on the DIB
1729 */
1730static int lgdt3305_frontend_attach(struct dvb_usb_adapter *adap)
1731{
1732 struct dib0700_state *st = adap->dev->priv;
1733
1734 /* Make use of the new i2c functions from FW 1.20 */
1735 st->fw_use_new_i2c_api = 1;
1736
1737 st->disable_streaming_master_mode = 1;
1738
1739 /* fe power enable */
1740 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0);
1741 msleep(30);
1742 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
1743 msleep(30);
1744
1745 /* demod reset */
1746 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
1747 msleep(30);
1748 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
1749 msleep(30);
1750 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
1751 msleep(30);
1752
1753 adap->fe = dvb_attach(lgdt3305_attach,
1754 &hcw_lgdt3305_config,
1755 &adap->dev->i2c_adap);
1756
1757 return adap->fe == NULL ? -ENODEV : 0;
1758}
1759
1760static int mxl5007t_tuner_attach(struct dvb_usb_adapter *adap)
1761{
1762 return dvb_attach(mxl5007t_attach, adap->fe,
1763 &adap->dev->i2c_adap, 0x60,
1764 &hcw_mxl5007t_config) == NULL ? -ENODEV : 0;
1765}
1766
1767
Patrick Boettcher01373a52007-07-30 12:49:04 -03001768/* DVB-USB and USB stuff follows */
Patrick Boettcherb7f54912006-09-19 12:51:37 -03001769struct usb_device_id dib0700_usb_id_table[] = {
Patrick Boettcher01373a52007-07-30 12:49:04 -03001770/* 0 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P) },
Albert Comerma6ca8f0b2008-03-29 21:35:57 -03001771 { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P_PC) },
1772 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500) },
1773 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500_2) },
1774 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK) },
Patrick Boettcher01373a52007-07-30 12:49:04 -03001775/* 5 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR) },
Albert Comerma6ca8f0b2008-03-29 21:35:57 -03001776 { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500) },
1777 { USB_DEVICE(USB_VID_UNIWILL, USB_PID_UNIWILL_STK7700P) },
1778 { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_STK7700P) },
1779 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_2) },
Patrick Boettcher01373a52007-07-30 12:49:04 -03001780/* 10 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR_2) },
Albert Comerma6ca8f0b2008-03-29 21:35:57 -03001781 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV2000E) },
1782 { USB_DEVICE(USB_VID_TERRATEC,
1783 USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY) },
1784 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_TD_STICK) },
1785 { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700D) },
Patrick Boettcher01373a52007-07-30 12:49:04 -03001786/* 15 */{ USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070P) },
Albert Comerma6ca8f0b2008-03-29 21:35:57 -03001787 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV_DVB_T_FLASH) },
1788 { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070PD) },
1789 { USB_DEVICE(USB_VID_PINNACLE,
1790 USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T) },
1791 { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500_PC) },
Joachim Steigerfa3b8772007-10-08 20:08:46 -03001792/* 20 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_EXPRESS) },
Albert Comerma6ca8f0b2008-03-29 21:35:57 -03001793 { USB_DEVICE(USB_VID_GIGABYTE, USB_PID_GIGABYTE_U7000) },
1794 { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14BR) },
1795 { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3000) },
1796 { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3100) },
1797/* 25 */{ USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_3) },
1798 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_MYTV_T) },
1799 { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_HT_USB_XE) },
1800 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_EXPRESSCARD_320CX) },
1801 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV72E) },
1802/* 30 */{ USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV73E) },
1803 { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_EC372S) },
1804 { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_HT_EXPRESS) },
Alexander Simondc888072008-03-29 21:37:54 -03001805 { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_XXS) },
Darryl Green5da4e2c2008-03-29 21:47:43 -03001806 { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_STK7700P_2) },
Michael Krufkyaf2a8872008-09-03 17:12:24 -03001807/* 35 */{ USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_TD_STICK_52009) },
Michael Krufky9a0c04a2008-09-03 17:12:24 -03001808 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500_3) },
Finn Thain17a370b2008-09-06 13:42:47 -03001809 { USB_DEVICE(USB_VID_GIGABYTE, USB_PID_GIGABYTE_U8000) },
Daniel Oliveira Nascimento8751aaa2008-09-07 12:39:44 -03001810 { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_STK7700PH) },
Albert Comerma57697432008-09-07 12:43:33 -03001811 { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3000H) },
Devin Heitmuellercb22cb52008-09-08 05:42:42 -03001812/* 40 */{ USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV801E) },
Devin Heitmuellerd2fc3bf2008-09-25 06:22:23 -03001813 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV801E_SE) },
Yusuf Altinbb1b0822009-01-08 07:58:45 -03001814 { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_EXPRESS) },
Nicolas Fournierdb4b2d12009-01-13 07:15:25 -03001815 { USB_DEVICE(USB_VID_TERRATEC,
1816 USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY_2) },
sebastian.blanes@gmail.com0a6e1ed2009-02-24 14:51:43 -03001817 { USB_DEVICE(USB_VID_SONY, USB_PID_SONY_PLAYTV) },
Pascal Terjan9abb6e62009-02-26 10:31:41 -03001818/* 45 */{ USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_PD378S) },
Michael Krufkyce904bc2009-01-19 01:12:55 -03001819 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_TIGER_ATSC) },
1820 { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_TIGER_ATSC_B210) },
Xoan Loureiro16ba1ee2009-03-29 08:43:36 -03001821 { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_MC770) },
Klaus Flittner919a5482009-03-29 09:12:06 -03001822 { USB_DEVICE(USB_VID_ELGATO, USB_PID_ELGATO_EYETV_DTT) },
Armin Schenker513846e2009-04-20 11:57:49 -03001823/* 50 */{ USB_DEVICE(USB_VID_ELGATO, USB_PID_ELGATO_EYETV_DTT_Dlx) },
tomas petrf0f4ae72009-05-20 05:28:05 -03001824 { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_H) },
Patrick Boettchera9b8fe32009-05-20 05:35:02 -03001825 { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_T3) },
1826 { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_T5) },
Pete Hildebrandtc53d83c2009-08-05 11:46:38 -03001827 { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_STK7700D) },
Olivier Grenie74b76f22009-09-02 08:19:19 -03001828/* 55 */{ USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_STK7700D_2) },
1829 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV73A) },
Patrick Boettchere4147532009-11-30 13:52:57 -03001830 { USB_DEVICE(USB_VID_PCTV, USB_PID_PINNACLE_PCTV73ESE) },
1831 { USB_DEVICE(USB_VID_PCTV, USB_PID_PINNACLE_PCTV282E) },
Olivier Grenied300bd62009-09-15 06:55:35 -03001832 { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7770P) },
Patrick Boettcherdb481382009-09-15 07:16:51 -03001833/* 60 */{ USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_XXS_2) },
Patrick Boettcherba3fe3a2009-09-16 09:51:30 -03001834 { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK807XPVR) },
1835 { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK807XP) },
Mauro Carvalho Chehab3bfb3172010-09-03 10:50:24 -03001836 { USB_DEVICE_VER(USB_VID_PIXELVIEW, USB_PID_PIXELVIEW_SBTVD, 0x000, 0x3f00) },
S?rgio Fortier8a378e82009-09-28 04:19:21 -03001837 { USB_DEVICE(USB_VID_EVOLUTEPC, USB_PID_TVWAY_PLUS) },
Patrick Boettcher20232c42009-12-01 12:08:56 -03001838/* 65 */{ USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV73ESE) },
Patrick Boettchere4147532009-11-30 13:52:57 -03001839 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV282E) },
Olivier Grenie03245a52009-12-04 13:27:57 -03001840 { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK8096GP) },
Michael Müller84e2f032010-04-26 22:18:57 -03001841 { USB_DEVICE(USB_VID_ELGATO, USB_PID_ELGATO_EYETV_DIVERSITY) },
Albert Comerma6ca8f0b2008-03-29 21:35:57 -03001842 { 0 } /* Terminating entry */
Patrick Boettcherb7f54912006-09-19 12:51:37 -03001843};
1844MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table);
1845
1846#define DIB0700_DEFAULT_DEVICE_PROPERTIES \
1847 .caps = DVB_USB_IS_AN_I2C_ADAPTER, \
1848 .usb_ctrl = DEVICE_SPECIFIC, \
Devin Heitmuellerbdc203e2008-09-06 13:45:27 -03001849 .firmware = "dvb-usb-dib0700-1.20.fw", \
Patrick Boettcherb7f54912006-09-19 12:51:37 -03001850 .download_firmware = dib0700_download_firmware, \
Patrick Boettcher6958eff2006-09-19 12:51:40 -03001851 .no_reconnect = 1, \
Patrick Boettcherb7f54912006-09-19 12:51:37 -03001852 .size_of_priv = sizeof(struct dib0700_state), \
Patrick Boettcher6958eff2006-09-19 12:51:40 -03001853 .i2c_algo = &dib0700_i2c_algo, \
1854 .identify_state = dib0700_identify_state
Patrick Boettcherb7f54912006-09-19 12:51:37 -03001855
1856#define DIB0700_DEFAULT_STREAMING_CONFIG(ep) \
1857 .streaming_ctrl = dib0700_streaming_ctrl, \
1858 .stream = { \
1859 .type = USB_BULK, \
1860 .count = 4, \
1861 .endpoint = ep, \
1862 .u = { \
1863 .bulk = { \
1864 .buffersize = 39480, \
1865 } \
1866 } \
1867 }
1868
1869struct dvb_usb_device_properties dib0700_devices[] = {
1870 {
1871 DIB0700_DEFAULT_DEVICE_PROPERTIES,
1872
1873 .num_adapters = 1,
1874 .adapter = {
1875 {
Olivier Grenief8731f42009-09-18 04:08:43 -03001876 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
1877 .pid_filter_count = 32,
1878 .pid_filter = stk70x0p_pid_filter,
1879 .pid_filter_ctrl = stk70x0p_pid_filter_ctrl,
Patrick Boettcherb7f54912006-09-19 12:51:37 -03001880 .frontend_attach = stk7700p_frontend_attach,
1881 .tuner_attach = stk7700p_tuner_attach,
1882
1883 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
1884 },
1885 },
1886
dominik67053a42007-11-10 19:23:31 -03001887 .num_device_descs = 8,
Patrick Boettcherb7f54912006-09-19 12:51:37 -03001888 .devices = {
1889 { "DiBcom STK7700P reference design",
Tomi Koivulahti49a13762006-10-19 07:27:19 -03001890 { &dib0700_usb_id_table[0], &dib0700_usb_id_table[1] },
Patrick Boettcherb7f54912006-09-19 12:51:37 -03001891 { NULL },
1892 },
1893 { "Hauppauge Nova-T Stick",
Stefan Trabyf9aeba42006-11-12 13:02:51 -03001894 { &dib0700_usb_id_table[4], &dib0700_usb_id_table[9], NULL },
Patrick Boettcherb7f54912006-09-19 12:51:37 -03001895 { NULL },
1896 },
Tomi Koivulahti49a13762006-10-19 07:27:19 -03001897 { "AVerMedia AVerTV DVB-T Volar",
Jose Carlos Garcia Sogoced8fec2006-11-14 05:01:47 -03001898 { &dib0700_usb_id_table[5], &dib0700_usb_id_table[10] },
Tomi Koivulahti49a13762006-10-19 07:27:19 -03001899 { NULL },
1900 },
1901 { "Compro Videomate U500",
Patrick Boettcher1f8ca4b2007-07-30 14:24:37 -03001902 { &dib0700_usb_id_table[6], &dib0700_usb_id_table[19] },
Tomi Koivulahti49a13762006-10-19 07:27:19 -03001903 { NULL },
Henning Schroeer0ce215e2006-10-19 07:58:22 -03001904 },
1905 { "Uniwill STK7700P based (Hama and others)",
1906 { &dib0700_usb_id_table[7], NULL },
1907 { NULL },
Michael Krufky8637a872006-11-08 16:47:32 -03001908 },
1909 { "Leadtek Winfast DTV Dongle (STK7700P based)",
Patrick Boettcher1e13c8f2009-09-19 05:24:40 -03001910 { &dib0700_usb_id_table[8], &dib0700_usb_id_table[34] },
Michael Krufky8637a872006-11-08 16:47:32 -03001911 { NULL },
Joachim Steigerfa3b8772007-10-08 20:08:46 -03001912 },
1913 { "AVerMedia AVerTV DVB-T Express",
1914 { &dib0700_usb_id_table[20] },
1915 { NULL },
dominik67053a42007-11-10 19:23:31 -03001916 },
dominik67053a42007-11-10 19:23:31 -03001917 { "Gigabyte U7000",
1918 { &dib0700_usb_id_table[21], NULL },
1919 { NULL },
Tomi Koivulahti49a13762006-10-19 07:27:19 -03001920 }
Darren Saltb1139e32007-08-18 18:05:31 -03001921 },
1922
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -03001923 .rc.core = {
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03001924 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab5af935c2010-08-01 08:02:35 -03001925 .rc_codes = RC_MAP_DIB0700_RC5_TABLE,
Mauro Carvalho Chehab0ffd1ab2010-08-01 09:37:23 -03001926 .rc_query = dib0700_rc_query_old_firmware,
1927 .rc_props = {
1928 .allowed_protos = IR_TYPE_RC5 |
1929 IR_TYPE_RC6 |
1930 IR_TYPE_NEC,
1931 .change_protocol = dib0700_change_protocol,
1932 },
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03001933 },
Patrick Boettcherb7f54912006-09-19 12:51:37 -03001934 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
1935
1936 .num_adapters = 2,
1937 .adapter = {
1938 {
1939 .frontend_attach = bristol_frontend_attach,
1940 .tuner_attach = bristol_tuner_attach,
1941
1942 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
1943 }, {
1944 .frontend_attach = bristol_frontend_attach,
1945 .tuner_attach = bristol_tuner_attach,
1946
1947 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
1948 }
1949 },
1950
1951 .num_device_descs = 1,
1952 .devices = {
1953 { "Hauppauge Nova-T 500 Dual DVB-T",
Tomi Koivulahti49a13762006-10-19 07:27:19 -03001954 { &dib0700_usb_id_table[2], &dib0700_usb_id_table[3], NULL },
Patrick Boettcherb7f54912006-09-19 12:51:37 -03001955 { NULL },
1956 },
Janne Grunau82f3d552007-07-30 13:50:28 -03001957 },
1958
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -03001959 .rc.core = {
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03001960 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab5af935c2010-08-01 08:02:35 -03001961 .rc_codes = RC_MAP_DIB0700_RC5_TABLE,
Mauro Carvalho Chehab0ffd1ab2010-08-01 09:37:23 -03001962 .rc_query = dib0700_rc_query_old_firmware,
1963 .rc_props = {
1964 .allowed_protos = IR_TYPE_RC5 |
1965 IR_TYPE_RC6 |
1966 IR_TYPE_NEC,
1967 .change_protocol = dib0700_change_protocol,
1968 },
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03001969 },
Olivier DANET54d75eb2007-07-25 14:42:54 -03001970 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
1971
1972 .num_adapters = 2,
1973 .adapter = {
1974 {
Olivier Grenief8731f42009-09-18 04:08:43 -03001975 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
1976 .pid_filter_count = 32,
1977 .pid_filter = stk70x0p_pid_filter,
1978 .pid_filter_ctrl = stk70x0p_pid_filter_ctrl,
Olivier DANET54d75eb2007-07-25 14:42:54 -03001979 .frontend_attach = stk7700d_frontend_attach,
1980 .tuner_attach = stk7700d_tuner_attach,
1981
1982 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
1983 }, {
Olivier Grenief8731f42009-09-18 04:08:43 -03001984 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
1985 .pid_filter_count = 32,
1986 .pid_filter = stk70x0p_pid_filter,
1987 .pid_filter_ctrl = stk70x0p_pid_filter_ctrl,
Olivier DANET54d75eb2007-07-25 14:42:54 -03001988 .frontend_attach = stk7700d_frontend_attach,
1989 .tuner_attach = stk7700d_tuner_attach,
1990
1991 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
1992 }
1993 },
1994
James A Webb200e8612009-08-04 02:38:05 -03001995 .num_device_descs = 5,
Olivier DANET54d75eb2007-07-25 14:42:54 -03001996 .devices = {
1997 { "Pinnacle PCTV 2000e",
1998 { &dib0700_usb_id_table[11], NULL },
1999 { NULL },
2000 },
2001 { "Terratec Cinergy DT XS Diversity",
2002 { &dib0700_usb_id_table[12], NULL },
2003 { NULL },
2004 },
Darren Saltfaebb912007-08-18 18:04:00 -03002005 { "Hauppauge Nova-TD Stick/Elgato Eye-TV Diversity",
Olivier DANET54d75eb2007-07-25 14:42:54 -03002006 { &dib0700_usb_id_table[13], NULL },
2007 { NULL },
2008 },
Patrick Boettcher01373a52007-07-30 12:49:04 -03002009 { "DiBcom STK7700D reference design",
Patrick Boettcherb6884a12007-07-27 10:08:51 -03002010 { &dib0700_usb_id_table[14], NULL },
2011 { NULL },
Yusuf Altinbb1b0822009-01-08 07:58:45 -03002012 },
James A Webb200e8612009-08-04 02:38:05 -03002013 { "YUAN High-Tech DiBcom STK7700D",
2014 { &dib0700_usb_id_table[55], NULL },
2015 { NULL },
2016 },
Yusuf Altinbb1b0822009-01-08 07:58:45 -03002017
Olivier DANET54d75eb2007-07-25 14:42:54 -03002018 },
Janne Grunau82f3d552007-07-30 13:50:28 -03002019
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -03002020 .rc.core = {
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03002021 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab5af935c2010-08-01 08:02:35 -03002022 .rc_codes = RC_MAP_DIB0700_RC5_TABLE,
Mauro Carvalho Chehab0ffd1ab2010-08-01 09:37:23 -03002023 .rc_query = dib0700_rc_query_old_firmware,
2024 .rc_props = {
2025 .allowed_protos = IR_TYPE_RC5 |
2026 IR_TYPE_RC6 |
2027 IR_TYPE_NEC,
2028 .change_protocol = dib0700_change_protocol,
2029 },
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03002030 },
Patrick Boettcher01373a52007-07-30 12:49:04 -03002031 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
2032
2033 .num_adapters = 1,
2034 .adapter = {
2035 {
Olivier Grenief8731f42009-09-18 04:08:43 -03002036 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
2037 .pid_filter_count = 32,
2038 .pid_filter = stk70x0p_pid_filter,
2039 .pid_filter_ctrl = stk70x0p_pid_filter_ctrl,
Daniel Gimpelevich132c3182008-01-25 06:02:42 -03002040 .frontend_attach = stk7700P2_frontend_attach,
2041 .tuner_attach = stk7700d_tuner_attach,
2042
2043 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
2044 },
2045 },
2046
Yusuf Altinbb1b0822009-01-08 07:58:45 -03002047 .num_device_descs = 3,
Daniel Gimpelevich132c3182008-01-25 06:02:42 -03002048 .devices = {
2049 { "ASUS My Cinema U3000 Mini DVBT Tuner",
2050 { &dib0700_usb_id_table[23], NULL },
2051 { NULL },
2052 },
Albert Comerma6ca8f0b2008-03-29 21:35:57 -03002053 { "Yuan EC372S",
2054 { &dib0700_usb_id_table[31], NULL },
2055 { NULL },
Yusuf Altinbb1b0822009-01-08 07:58:45 -03002056 },
2057 { "Terratec Cinergy T Express",
2058 { &dib0700_usb_id_table[42], NULL },
2059 { NULL },
Albert Comerma6ca8f0b2008-03-29 21:35:57 -03002060 }
Chris Rankin48aa7392008-09-25 06:52:24 -03002061 },
2062
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -03002063 .rc.core = {
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03002064 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab5af935c2010-08-01 08:02:35 -03002065 .rc_codes = RC_MAP_DIB0700_RC5_TABLE,
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -03002066 .module_name = "dib0700",
Mauro Carvalho Chehab0ffd1ab2010-08-01 09:37:23 -03002067 .rc_query = dib0700_rc_query_old_firmware,
2068 .rc_props = {
2069 .allowed_protos = IR_TYPE_RC5 |
2070 IR_TYPE_RC6 |
2071 IR_TYPE_NEC,
2072 .change_protocol = dib0700_change_protocol,
2073 },
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03002074 },
Daniel Gimpelevich132c3182008-01-25 06:02:42 -03002075 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
2076
2077 .num_adapters = 1,
2078 .adapter = {
2079 {
Olivier Grenief8731f42009-09-18 04:08:43 -03002080 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
2081 .pid_filter_count = 32,
2082 .pid_filter = stk70x0p_pid_filter,
2083 .pid_filter_ctrl = stk70x0p_pid_filter_ctrl,
Patrick Boettcher01373a52007-07-30 12:49:04 -03002084 .frontend_attach = stk7070p_frontend_attach,
2085 .tuner_attach = dib7070p_tuner_attach,
2086
2087 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
2088
2089 .size_of_priv = sizeof(struct dib0700_adapter_state),
2090 },
2091 },
2092
Patrick Boettcher1e13c8f2009-09-19 05:24:40 -03002093 .num_device_descs = 11,
Patrick Boettcher01373a52007-07-30 12:49:04 -03002094 .devices = {
2095 { "DiBcom STK7070P reference design",
2096 { &dib0700_usb_id_table[15], NULL },
2097 { NULL },
2098 },
2099 { "Pinnacle PCTV DVB-T Flash Stick",
2100 { &dib0700_usb_id_table[16], NULL },
2101 { NULL },
2102 },
Yousef Lamlum7999a812008-01-25 05:51:48 -03002103 { "Artec T14BR DVB-T",
2104 { &dib0700_usb_id_table[22], NULL },
2105 { NULL },
Daniel Gimpelevich132c3182008-01-25 06:02:42 -03002106 },
2107 { "ASUS My Cinema U3100 Mini DVBT Tuner",
2108 { &dib0700_usb_id_table[24], NULL },
2109 { NULL },
2110 },
Tim Taubertc7637b12008-01-25 06:16:36 -03002111 { "Hauppauge Nova-T Stick",
2112 { &dib0700_usb_id_table[25], NULL },
2113 { NULL },
2114 },
Darren Salt13b83b52008-01-25 06:20:02 -03002115 { "Hauppauge Nova-T MyTV.t",
2116 { &dib0700_usb_id_table[26], NULL },
2117 { NULL },
2118 },
Albert Comerma6ca8f0b2008-03-29 21:35:57 -03002119 { "Pinnacle PCTV 72e",
2120 { &dib0700_usb_id_table[29], NULL },
2121 { NULL },
2122 },
2123 { "Pinnacle PCTV 73e",
2124 { &dib0700_usb_id_table[30], NULL },
2125 { NULL },
2126 },
Klaus Flittner919a5482009-03-29 09:12:06 -03002127 { "Elgato EyeTV DTT",
2128 { &dib0700_usb_id_table[49], NULL },
2129 { NULL },
2130 },
Pascal Terjan9abb6e62009-02-26 10:31:41 -03002131 { "Yuan PD378S",
2132 { &dib0700_usb_id_table[45], NULL },
2133 { NULL },
2134 },
Armin Schenker513846e2009-04-20 11:57:49 -03002135 { "Elgato EyeTV Dtt Dlx PD378S",
2136 { &dib0700_usb_id_table[50], NULL },
2137 { NULL },
2138 },
Tim Taubertc7637b12008-01-25 06:16:36 -03002139 },
2140
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -03002141 .rc.core = {
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03002142 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab5af935c2010-08-01 08:02:35 -03002143 .rc_codes = RC_MAP_DIB0700_RC5_TABLE,
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -03002144 .module_name = "dib0700",
Mauro Carvalho Chehab0ffd1ab2010-08-01 09:37:23 -03002145 .rc_query = dib0700_rc_query_old_firmware,
2146 .rc_props = {
2147 .allowed_protos = IR_TYPE_RC5 |
2148 IR_TYPE_RC6 |
2149 IR_TYPE_NEC,
2150 .change_protocol = dib0700_change_protocol,
2151 },
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03002152 },
Patrick Boettcher01373a52007-07-30 12:49:04 -03002153 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
2154
Olivier Grenie74b76f22009-09-02 08:19:19 -03002155 .num_adapters = 1,
2156 .adapter = {
2157 {
Mauro Carvalho Chehab648732f2009-11-04 12:11:43 -02002158 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
2159 .pid_filter_count = 32,
2160 .pid_filter = stk70x0p_pid_filter,
2161 .pid_filter_ctrl = stk70x0p_pid_filter_ctrl,
Olivier Grenie74b76f22009-09-02 08:19:19 -03002162 .frontend_attach = stk7070p_frontend_attach,
2163 .tuner_attach = dib7070p_tuner_attach,
2164
2165 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
2166
2167 .size_of_priv = sizeof(struct dib0700_adapter_state),
2168 },
2169 },
2170
Patrick Boettcher20232c42009-12-01 12:08:56 -03002171 .num_device_descs = 3,
Olivier Grenie74b76f22009-09-02 08:19:19 -03002172 .devices = {
2173 { "Pinnacle PCTV 73A",
2174 { &dib0700_usb_id_table[56], NULL },
2175 { NULL },
2176 },
2177 { "Pinnacle PCTV 73e SE",
Patrick Boettcher20232c42009-12-01 12:08:56 -03002178 { &dib0700_usb_id_table[57], &dib0700_usb_id_table[65], NULL },
Olivier Grenie74b76f22009-09-02 08:19:19 -03002179 { NULL },
2180 },
2181 { "Pinnacle PCTV 282e",
Patrick Boettcher20232c42009-12-01 12:08:56 -03002182 { &dib0700_usb_id_table[58], &dib0700_usb_id_table[66], NULL },
Olivier Grenie74b76f22009-09-02 08:19:19 -03002183 { NULL },
2184 },
2185 },
2186
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -03002187 .rc.core = {
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03002188 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab5af935c2010-08-01 08:02:35 -03002189 .rc_codes = RC_MAP_DIB0700_RC5_TABLE,
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -03002190 .module_name = "dib0700",
Mauro Carvalho Chehab0ffd1ab2010-08-01 09:37:23 -03002191 .rc_query = dib0700_rc_query_old_firmware,
2192 .rc_props = {
2193 .allowed_protos = IR_TYPE_RC5 |
2194 IR_TYPE_RC6 |
2195 IR_TYPE_NEC,
2196 .change_protocol = dib0700_change_protocol,
2197 },
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03002198 },
Olivier Grenie74b76f22009-09-02 08:19:19 -03002199 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
2200
Patrick Boettcher01373a52007-07-30 12:49:04 -03002201 .num_adapters = 2,
2202 .adapter = {
2203 {
Olivier Grenief8731f42009-09-18 04:08:43 -03002204 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
2205 .pid_filter_count = 32,
2206 .pid_filter = stk70x0p_pid_filter,
2207 .pid_filter_ctrl = stk70x0p_pid_filter_ctrl,
Patrick Boettcher01373a52007-07-30 12:49:04 -03002208 .frontend_attach = stk7070pd_frontend_attach0,
2209 .tuner_attach = dib7070p_tuner_attach,
2210
2211 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
2212
2213 .size_of_priv = sizeof(struct dib0700_adapter_state),
2214 }, {
Olivier Grenief8731f42009-09-18 04:08:43 -03002215 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
2216 .pid_filter_count = 32,
2217 .pid_filter = stk70x0p_pid_filter,
2218 .pid_filter_ctrl = stk70x0p_pid_filter_ctrl,
Patrick Boettcher01373a52007-07-30 12:49:04 -03002219 .frontend_attach = stk7070pd_frontend_attach1,
2220 .tuner_attach = dib7070p_tuner_attach,
2221
2222 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
2223
2224 .size_of_priv = sizeof(struct dib0700_adapter_state),
2225 }
2226 },
2227
Mauro Carvalho Chehab5af935c2010-08-01 08:02:35 -03002228 .num_device_descs = 6,
Patrick Boettcher01373a52007-07-30 12:49:04 -03002229 .devices = {
2230 { "DiBcom STK7070PD reference design",
2231 { &dib0700_usb_id_table[17], NULL },
2232 { NULL },
2233 },
2234 { "Pinnacle PCTV Dual DVB-T Diversity Stick",
2235 { &dib0700_usb_id_table[18], NULL },
2236 { NULL },
Michael Krufkyd01eb2d2008-07-03 23:43:36 -03002237 },
2238 { "Hauppauge Nova-TD Stick (52009)",
2239 { &dib0700_usb_id_table[35], NULL },
2240 { NULL },
Michael Krufky9a0c04a2008-09-03 17:12:24 -03002241 },
2242 { "Hauppauge Nova-TD-500 (84xxx)",
2243 { &dib0700_usb_id_table[36], NULL },
2244 { NULL },
Nicolas Fournierdb4b2d12009-01-13 07:15:25 -03002245 },
Patrick Boettchera9b8fe32009-05-20 05:35:02 -03002246 { "Terratec Cinergy DT USB XS Diversity/ T5",
2247 { &dib0700_usb_id_table[43],
2248 &dib0700_usb_id_table[53], NULL},
Nicolas Fournierdb4b2d12009-01-13 07:15:25 -03002249 { NULL },
sebastian.blanes@gmail.com0a6e1ed2009-02-24 14:51:43 -03002250 },
2251 { "Sony PlayTV",
2252 { &dib0700_usb_id_table[44], NULL },
2253 { NULL },
Michael Müller84e2f032010-04-26 22:18:57 -03002254 },
Mauro Carvalho Chehab5af935c2010-08-01 08:02:35 -03002255 },
2256
2257 .rc.core = {
2258 .rc_interval = DEFAULT_RC_INTERVAL,
2259 .rc_codes = RC_MAP_DIB0700_RC5_TABLE,
2260 .module_name = "dib0700",
Mauro Carvalho Chehab0ffd1ab2010-08-01 09:37:23 -03002261 .rc_query = dib0700_rc_query_old_firmware,
2262 .rc_props = {
2263 .allowed_protos = IR_TYPE_RC5 |
2264 IR_TYPE_RC6 |
2265 IR_TYPE_NEC,
2266 .change_protocol = dib0700_change_protocol,
2267 },
Mauro Carvalho Chehab5af935c2010-08-01 08:02:35 -03002268 },
2269 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
2270
2271 .num_adapters = 2,
2272 .adapter = {
2273 {
2274 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
2275 .pid_filter_count = 32,
2276 .pid_filter = stk70x0p_pid_filter,
2277 .pid_filter_ctrl = stk70x0p_pid_filter_ctrl,
2278 .frontend_attach = stk7070pd_frontend_attach0,
2279 .tuner_attach = dib7070p_tuner_attach,
2280
2281 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
2282
2283 .size_of_priv = sizeof(struct dib0700_adapter_state),
2284 }, {
2285 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
2286 .pid_filter_count = 32,
2287 .pid_filter = stk70x0p_pid_filter,
2288 .pid_filter_ctrl = stk70x0p_pid_filter_ctrl,
2289 .frontend_attach = stk7070pd_frontend_attach1,
2290 .tuner_attach = dib7070p_tuner_attach,
2291
2292 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
2293
2294 .size_of_priv = sizeof(struct dib0700_adapter_state),
2295 }
2296 },
2297
2298 .num_device_descs = 1,
2299 .devices = {
Michael Müller84e2f032010-04-26 22:18:57 -03002300 { "Elgato EyeTV Diversity",
2301 { &dib0700_usb_id_table[68], NULL },
2302 { NULL },
2303 },
Arne Luehrsc985a8d2009-01-21 01:37:20 -03002304 },
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03002305
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -03002306 .rc.core = {
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03002307 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab5af935c2010-08-01 08:02:35 -03002308 .rc_codes = RC_MAP_DIB0700_NEC_TABLE,
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -03002309 .module_name = "dib0700",
Mauro Carvalho Chehab0ffd1ab2010-08-01 09:37:23 -03002310 .rc_query = dib0700_rc_query_old_firmware,
2311 .rc_props = {
2312 .allowed_protos = IR_TYPE_RC5 |
2313 IR_TYPE_RC6 |
2314 IR_TYPE_NEC,
2315 .change_protocol = dib0700_change_protocol,
2316 },
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03002317 },
Albert Comerma6ca8f0b2008-03-29 21:35:57 -03002318 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
2319
2320 .num_adapters = 1,
2321 .adapter = {
2322 {
Olivier Grenief8731f42009-09-18 04:08:43 -03002323 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
2324 .pid_filter_count = 32,
2325 .pid_filter = stk70x0p_pid_filter,
2326 .pid_filter_ctrl = stk70x0p_pid_filter_ctrl,
Albert Comerma6ca8f0b2008-03-29 21:35:57 -03002327 .frontend_attach = stk7700ph_frontend_attach,
2328 .tuner_attach = stk7700ph_tuner_attach,
2329
2330 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
2331
2332 .size_of_priv = sizeof(struct
2333 dib0700_adapter_state),
2334 },
2335 },
2336
Pete Hildebrandtc53d83c2009-08-05 11:46:38 -03002337 .num_device_descs = 9,
Albert Comerma6ca8f0b2008-03-29 21:35:57 -03002338 .devices = {
2339 { "Terratec Cinergy HT USB XE",
2340 { &dib0700_usb_id_table[27], NULL },
2341 { NULL },
2342 },
2343 { "Pinnacle Expresscard 320cx",
2344 { &dib0700_usb_id_table[28], NULL },
2345 { NULL },
2346 },
2347 { "Terratec Cinergy HT Express",
2348 { &dib0700_usb_id_table[32], NULL },
2349 { NULL },
2350 },
Finn Thain17a370b2008-09-06 13:42:47 -03002351 { "Gigabyte U8000-RH",
2352 { &dib0700_usb_id_table[37], NULL },
2353 { NULL },
2354 },
Daniel Oliveira Nascimento8751aaa2008-09-07 12:39:44 -03002355 { "YUAN High-Tech STK7700PH",
2356 { &dib0700_usb_id_table[38], NULL },
2357 { NULL },
2358 },
Albert Comerma57697432008-09-07 12:43:33 -03002359 { "Asus My Cinema-U3000Hybrid",
2360 { &dib0700_usb_id_table[39], NULL },
2361 { NULL },
2362 },
Xoan Loureiro16ba1ee2009-03-29 08:43:36 -03002363 { "YUAN High-Tech MC770",
2364 { &dib0700_usb_id_table[48], NULL },
2365 { NULL },
2366 },
tomas petrf0f4ae72009-05-20 05:28:05 -03002367 { "Leadtek WinFast DTV Dongle H",
2368 { &dib0700_usb_id_table[51], NULL },
2369 { NULL },
2370 },
Pete Hildebrandtc53d83c2009-08-05 11:46:38 -03002371 { "YUAN High-Tech STK7700D",
2372 { &dib0700_usb_id_table[54], NULL },
2373 { NULL },
2374 },
Albert Comerma6ca8f0b2008-03-29 21:35:57 -03002375 },
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03002376
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -03002377 .rc.core = {
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03002378 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab5af935c2010-08-01 08:02:35 -03002379 .rc_codes = RC_MAP_DIB0700_RC5_TABLE,
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -03002380 .module_name = "dib0700",
Mauro Carvalho Chehab0ffd1ab2010-08-01 09:37:23 -03002381 .rc_query = dib0700_rc_query_old_firmware,
2382 .rc_props = {
2383 .allowed_protos = IR_TYPE_RC5 |
2384 IR_TYPE_RC6 |
2385 IR_TYPE_NEC,
2386 .change_protocol = dib0700_change_protocol,
2387 },
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03002388 },
Devin Heitmuellercb22cb52008-09-08 05:42:42 -03002389 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
2390 .num_adapters = 1,
2391 .adapter = {
2392 {
2393 .frontend_attach = s5h1411_frontend_attach,
2394 .tuner_attach = xc5000_tuner_attach,
2395
2396 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
2397
2398 .size_of_priv = sizeof(struct
2399 dib0700_adapter_state),
2400 },
2401 },
2402
Devin Heitmuellerd2fc3bf2008-09-25 06:22:23 -03002403 .num_device_descs = 2,
Devin Heitmuellercb22cb52008-09-08 05:42:42 -03002404 .devices = {
2405 { "Pinnacle PCTV HD Pro USB Stick",
2406 { &dib0700_usb_id_table[40], NULL },
2407 { NULL },
2408 },
Devin Heitmuellerd2fc3bf2008-09-25 06:22:23 -03002409 { "Pinnacle PCTV HD USB Stick",
2410 { &dib0700_usb_id_table[41], NULL },
2411 { NULL },
2412 },
Devin Heitmuellercb22cb52008-09-08 05:42:42 -03002413 },
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -03002414
2415 .rc.core = {
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03002416 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab5af935c2010-08-01 08:02:35 -03002417 .rc_codes = RC_MAP_DIB0700_RC5_TABLE,
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -03002418 .module_name = "dib0700",
Mauro Carvalho Chehab0ffd1ab2010-08-01 09:37:23 -03002419 .rc_query = dib0700_rc_query_old_firmware,
2420 .rc_props = {
2421 .allowed_protos = IR_TYPE_RC5 |
2422 IR_TYPE_RC6 |
2423 IR_TYPE_NEC,
2424 .change_protocol = dib0700_change_protocol,
2425 },
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03002426 },
Michael Krufkyce904bc2009-01-19 01:12:55 -03002427 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
2428 .num_adapters = 1,
2429 .adapter = {
2430 {
2431 .frontend_attach = lgdt3305_frontend_attach,
2432 .tuner_attach = mxl5007t_tuner_attach,
2433
2434 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
2435
2436 .size_of_priv = sizeof(struct
2437 dib0700_adapter_state),
2438 },
2439 },
2440
2441 .num_device_descs = 2,
2442 .devices = {
2443 { "Hauppauge ATSC MiniCard (B200)",
2444 { &dib0700_usb_id_table[46], NULL },
2445 { NULL },
2446 },
2447 { "Hauppauge ATSC MiniCard (B210)",
2448 { &dib0700_usb_id_table[47], NULL },
2449 { NULL },
2450 },
2451 },
Olivier Grenied300bd62009-09-15 06:55:35 -03002452 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
2453
2454 .num_adapters = 1,
2455 .adapter = {
2456 {
Olivier Grenief8731f42009-09-18 04:08:43 -03002457 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
2458 .pid_filter_count = 32,
2459 .pid_filter = stk70x0p_pid_filter,
2460 .pid_filter_ctrl = stk70x0p_pid_filter_ctrl,
Olivier Grenie90e12ce2010-09-07 12:50:45 -03002461 .frontend_attach = stk7770p_frontend_attach,
Olivier Grenied300bd62009-09-15 06:55:35 -03002462 .tuner_attach = dib7770p_tuner_attach,
2463
2464 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
2465
2466 .size_of_priv =
Patrick Boettcherdb481382009-09-15 07:16:51 -03002467 sizeof(struct dib0700_adapter_state),
Olivier Grenied300bd62009-09-15 06:55:35 -03002468 },
2469 },
2470
Patrick Boettcherdb481382009-09-15 07:16:51 -03002471 .num_device_descs = 2,
Olivier Grenied300bd62009-09-15 06:55:35 -03002472 .devices = {
2473 { "DiBcom STK7770P reference design",
2474 { &dib0700_usb_id_table[59], NULL },
2475 { NULL },
2476 },
Patrick Boettcher1e13c8f2009-09-19 05:24:40 -03002477 { "Terratec Cinergy T USB XXS (HD)/ T3",
2478 { &dib0700_usb_id_table[33],
2479 &dib0700_usb_id_table[52],
2480 &dib0700_usb_id_table[60], NULL},
Patrick Boettcherdb481382009-09-15 07:16:51 -03002481 { NULL },
2482 },
Olivier Grenied300bd62009-09-15 06:55:35 -03002483 },
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -03002484
2485 .rc.core = {
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03002486 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab5af935c2010-08-01 08:02:35 -03002487 .rc_codes = RC_MAP_DIB0700_RC5_TABLE,
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -03002488 .module_name = "dib0700",
Mauro Carvalho Chehab0ffd1ab2010-08-01 09:37:23 -03002489 .rc_query = dib0700_rc_query_old_firmware,
2490 .rc_props = {
2491 .allowed_protos = IR_TYPE_RC5 |
2492 IR_TYPE_RC6 |
2493 IR_TYPE_NEC,
2494 .change_protocol = dib0700_change_protocol,
2495 },
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03002496 },
Patrick Boettcherba3fe3a2009-09-16 09:51:30 -03002497 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
2498 .num_adapters = 1,
2499 .adapter = {
2500 {
Olivier Grenief8731f42009-09-18 04:08:43 -03002501 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
2502 .pid_filter_count = 32,
Olivier Grenie03245a52009-12-04 13:27:57 -03002503 .pid_filter = stk80xx_pid_filter,
2504 .pid_filter_ctrl = stk80xx_pid_filter_ctrl,
Patrick Boettcherba3fe3a2009-09-16 09:51:30 -03002505 .frontend_attach = stk807x_frontend_attach,
2506 .tuner_attach = dib807x_tuner_attach,
2507
2508 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
2509
2510 .size_of_priv =
2511 sizeof(struct dib0700_adapter_state),
2512 },
2513 },
2514
S?rgio Fortier8a378e82009-09-28 04:19:21 -03002515 .num_device_descs = 3,
Patrick Boettcherba3fe3a2009-09-16 09:51:30 -03002516 .devices = {
2517 { "DiBcom STK807xP reference design",
2518 { &dib0700_usb_id_table[62], NULL },
2519 { NULL },
2520 },
Mauro Carvalho Chehabaaeab302009-09-16 09:18:26 -03002521 { "Prolink Pixelview SBTVD",
2522 { &dib0700_usb_id_table[63], NULL },
2523 { NULL },
2524 },
S?rgio Fortier8a378e82009-09-28 04:19:21 -03002525 { "EvolutePC TVWay+",
2526 { &dib0700_usb_id_table[64], NULL },
2527 { NULL },
2528 },
Patrick Boettcherba3fe3a2009-09-16 09:51:30 -03002529 },
2530
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -03002531 .rc.core = {
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03002532 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab5af935c2010-08-01 08:02:35 -03002533 .rc_codes = RC_MAP_DIB0700_NEC_TABLE,
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -03002534 .module_name = "dib0700",
Mauro Carvalho Chehab0ffd1ab2010-08-01 09:37:23 -03002535 .rc_query = dib0700_rc_query_old_firmware,
2536 .rc_props = {
2537 .allowed_protos = IR_TYPE_RC5 |
2538 IR_TYPE_RC6 |
2539 IR_TYPE_NEC,
2540 .change_protocol = dib0700_change_protocol,
2541 },
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03002542 },
Patrick Boettcherba3fe3a2009-09-16 09:51:30 -03002543 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
2544 .num_adapters = 2,
2545 .adapter = {
2546 {
Olivier Grenief8731f42009-09-18 04:08:43 -03002547 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
2548 .pid_filter_count = 32,
Olivier Grenie03245a52009-12-04 13:27:57 -03002549 .pid_filter = stk80xx_pid_filter,
2550 .pid_filter_ctrl = stk80xx_pid_filter_ctrl,
Patrick Boettcherba3fe3a2009-09-16 09:51:30 -03002551 .frontend_attach = stk807xpvr_frontend_attach0,
2552 .tuner_attach = dib807x_tuner_attach,
2553
2554 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
2555
2556 .size_of_priv =
2557 sizeof(struct dib0700_adapter_state),
2558 },
2559 {
Olivier Grenief8731f42009-09-18 04:08:43 -03002560 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
2561 .pid_filter_count = 32,
Olivier Grenie03245a52009-12-04 13:27:57 -03002562 .pid_filter = stk80xx_pid_filter,
2563 .pid_filter_ctrl = stk80xx_pid_filter_ctrl,
Patrick Boettcherba3fe3a2009-09-16 09:51:30 -03002564 .frontend_attach = stk807xpvr_frontend_attach1,
2565 .tuner_attach = dib807x_tuner_attach,
2566
2567 DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
2568
2569 .size_of_priv =
2570 sizeof(struct dib0700_adapter_state),
2571 },
2572 },
2573
2574 .num_device_descs = 1,
2575 .devices = {
2576 { "DiBcom STK807xPVR reference design",
2577 { &dib0700_usb_id_table[61], NULL },
2578 { NULL },
2579 },
2580 },
2581
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -03002582 .rc.core = {
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03002583 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab5af935c2010-08-01 08:02:35 -03002584 .rc_codes = RC_MAP_DIB0700_RC5_TABLE,
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -03002585 .module_name = "dib0700",
Mauro Carvalho Chehab0ffd1ab2010-08-01 09:37:23 -03002586 .rc_query = dib0700_rc_query_old_firmware,
2587 .rc_props = {
2588 .allowed_protos = IR_TYPE_RC5 |
2589 IR_TYPE_RC6 |
2590 IR_TYPE_NEC,
2591 .change_protocol = dib0700_change_protocol,
2592 },
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03002593 },
Olivier Grenie03245a52009-12-04 13:27:57 -03002594 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
2595 .num_adapters = 1,
2596 .adapter = {
2597 {
2598 .caps = DVB_USB_ADAP_HAS_PID_FILTER |
2599 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
2600 .pid_filter_count = 32,
2601 .pid_filter = stk80xx_pid_filter,
2602 .pid_filter_ctrl = stk80xx_pid_filter_ctrl,
2603 .frontend_attach = stk809x_frontend_attach,
2604 .tuner_attach = dib809x_tuner_attach,
2605
2606 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
2607
2608 .size_of_priv =
2609 sizeof(struct dib0700_adapter_state),
2610 },
2611 },
2612
2613 .num_device_descs = 1,
2614 .devices = {
2615 { "DiBcom STK8096GP reference design",
2616 { &dib0700_usb_id_table[67], NULL },
2617 { NULL },
2618 },
2619 },
2620
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -03002621 .rc.core = {
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03002622 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab5af935c2010-08-01 08:02:35 -03002623 .rc_codes = RC_MAP_DIB0700_RC5_TABLE,
Mauro Carvalho Chehab72b39312010-07-31 22:56:00 -03002624 .module_name = "dib0700",
Mauro Carvalho Chehab0ffd1ab2010-08-01 09:37:23 -03002625 .rc_query = dib0700_rc_query_old_firmware,
2626 .rc_props = {
2627 .allowed_protos = IR_TYPE_RC5 |
2628 IR_TYPE_RC6 |
2629 IR_TYPE_NEC,
2630 .change_protocol = dib0700_change_protocol,
2631 },
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03002632 },
Patrick Boettcher01373a52007-07-30 12:49:04 -03002633 },
Patrick Boettcherb7f54912006-09-19 12:51:37 -03002634};
2635
2636int dib0700_device_count = ARRAY_SIZE(dib0700_devices);