blob: 043cadae08594f62ed1dead95e77439e728a3a2d [file] [log] [blame]
Johannes Stezenbach776338e2005-06-23 22:02:35 -07001/* DVB USB compliant linux driver for mobile DVB-T USB devices based on
2 * reference designs made by DiBcom (http://www.dibcom.fr/) (DiB3000M-B)
3 *
4 * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de)
5 *
6 * based on GPL code from DiBcom, which has
7 * Copyright (C) 2004 Amaury Demol for DiBcom (ademol@dibcom.fr)
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the Free
11 * Software Foundation, version 2.
12 *
13 * see Documentation/dvb/README.dvb-usb for more information
14 */
15#include "dibusb.h"
16
Michael Krufky6c08d9292007-06-12 12:43:25 -030017static int dib3000mb_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
18{
19 struct dvb_usb_adapter *adap = fe->dvb->priv;
20 struct dibusb_state *st = adap->priv;
21
22 return st->ops.tuner_pass_ctrl(fe, enable, st->tuner_addr);
23}
24
Patrick Boettcher4d43e132006-09-30 06:53:48 -030025static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_adapter *adap)
Johannes Stezenbach776338e2005-06-23 22:02:35 -070026{
27 struct dib3000_config demod_cfg;
Patrick Boettcher4d43e132006-09-30 06:53:48 -030028 struct dibusb_state *st = adap->priv;
Johannes Stezenbach776338e2005-06-23 22:02:35 -070029
30 demod_cfg.demod_address = 0x8;
Johannes Stezenbach776338e2005-06-23 22:02:35 -070031
Michael Krufky79d3a8b2007-05-09 14:52:52 -030032 if ((adap->fe = dvb_attach(dib3000mb_attach, &demod_cfg,
33 &adap->dev->i2c_adap, &st->ops)) == NULL)
Johannes Stezenbach776338e2005-06-23 22:02:35 -070034 return -ENODEV;
Adrian Bunk56760f02006-08-15 11:38:40 -030035
Michael Krufky6c08d9292007-06-12 12:43:25 -030036 adap->fe->ops.i2c_gate_ctrl = dib3000mb_i2c_gate_ctrl;
Johannes Stezenbach776338e2005-06-23 22:02:35 -070037
38 return 0;
39}
40
Patrick Boettcher4d43e132006-09-30 06:53:48 -030041static int dibusb_thomson_tuner_attach(struct dvb_usb_adapter *adap)
Patrick Boettcher8945c8c2005-07-07 17:58:07 -070042{
Michael Krufky6c08d9292007-06-12 12:43:25 -030043 struct dibusb_state *st = adap->priv;
44
45 st->tuner_addr = 0x61;
46
Michael Krufkyfbfee862007-05-09 15:58:17 -030047 dvb_attach(dvb_pll_attach, adap->fe, 0x61, &adap->dev->i2c_adap,
Michael Krufky47a99912007-06-12 16:10:51 -030048 DVB_PLL_TUA6010XS);
Michael Krufkyfbfee862007-05-09 15:58:17 -030049 return 0;
50}
51
52static int dibusb_panasonic_tuner_attach(struct dvb_usb_adapter *adap)
53{
Michael Krufky6c08d9292007-06-12 12:43:25 -030054 struct dibusb_state *st = adap->priv;
55
56 st->tuner_addr = 0x60;
57
Michael Krufkyfbfee862007-05-09 15:58:17 -030058 dvb_attach(dvb_pll_attach, adap->fe, 0x60, &adap->dev->i2c_adap,
Michael Krufky47a99912007-06-12 16:10:51 -030059 DVB_PLL_TDA665X);
Patrick Boettcher8945c8c2005-07-07 17:58:07 -070060 return 0;
61}
62
63/* Some of the Artec 1.1 device aren't equipped with the default tuner
Johannes Stezenbach776338e2005-06-23 22:02:35 -070064 * (Thomson Cable), but with a Panasonic ENV77H11D5. This function figures
65 * this out. */
Patrick Boettcher4d43e132006-09-30 06:53:48 -030066static int dibusb_tuner_probe_and_attach(struct dvb_usb_adapter *adap)
Johannes Stezenbach776338e2005-06-23 22:02:35 -070067{
68 u8 b[2] = { 0,0 }, b2[1];
69 int ret = 0;
70 struct i2c_msg msg[2] = {
71 { .flags = 0, .buf = b, .len = 2 },
72 { .flags = I2C_M_RD, .buf = b2, .len = 1 },
73 };
Michael Krufky6c08d9292007-06-12 12:43:25 -030074 struct dibusb_state *st = adap->priv;
Johannes Stezenbach776338e2005-06-23 22:02:35 -070075
76 /* the Panasonic sits on I2C addrass 0x60, the Thomson on 0x61 */
Michael Krufky096bb772007-06-22 17:41:07 -030077 msg[0].addr = msg[1].addr = st->tuner_addr = 0x60;
Johannes Stezenbach776338e2005-06-23 22:02:35 -070078
Michael Krufky6c08d9292007-06-12 12:43:25 -030079 if (adap->fe->ops.i2c_gate_ctrl)
80 adap->fe->ops.i2c_gate_ctrl(adap->fe,1);
Johannes Stezenbach776338e2005-06-23 22:02:35 -070081
Patrick Boettcher4d43e132006-09-30 06:53:48 -030082 if (i2c_transfer(&adap->dev->i2c_adap, msg, 2) != 2) {
Johannes Stezenbach776338e2005-06-23 22:02:35 -070083 err("tuner i2c write failed.");
84 ret = -EREMOTEIO;
85 }
86
Michael Krufky6c08d9292007-06-12 12:43:25 -030087 if (adap->fe->ops.i2c_gate_ctrl)
88 adap->fe->ops.i2c_gate_ctrl(adap->fe,0);
Johannes Stezenbach776338e2005-06-23 22:02:35 -070089
90 if (b2[0] == 0xfe) {
Marc Koschewski11570202006-01-09 18:21:36 -020091 info("This device has the Thomson Cable onboard. Which is default.");
Michael Krufkyfbfee862007-05-09 15:58:17 -030092 ret = dibusb_thomson_tuner_attach(adap);
Johannes Stezenbach776338e2005-06-23 22:02:35 -070093 } else {
Marc Koschewski11570202006-01-09 18:21:36 -020094 info("This device has the Panasonic ENV77H11D5 onboard.");
Michael Krufkyfbfee862007-05-09 15:58:17 -030095 ret = dibusb_panasonic_tuner_attach(adap);
Johannes Stezenbach776338e2005-06-23 22:02:35 -070096 }
97
98 return ret;
99}
100
101/* USB Driver stuff */
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300102static struct dvb_usb_device_properties dibusb1_1_properties;
103static struct dvb_usb_device_properties dibusb1_1_an2235_properties;
104static struct dvb_usb_device_properties dibusb2_0b_properties;
105static struct dvb_usb_device_properties artec_t1_usb2_properties;
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700106
107static int dibusb_probe(struct usb_interface *intf,
108 const struct usb_device_id *id)
109{
Patrick Boettcher47dc3d62005-09-09 13:02:47 -0700110 if (dvb_usb_device_init(intf,&dibusb1_1_properties,THIS_MODULE,NULL) == 0 ||
111 dvb_usb_device_init(intf,&dibusb1_1_an2235_properties,THIS_MODULE,NULL) == 0 ||
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800112 dvb_usb_device_init(intf,&dibusb2_0b_properties,THIS_MODULE,NULL) == 0 ||
113 dvb_usb_device_init(intf,&artec_t1_usb2_properties,THIS_MODULE,NULL) == 0)
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700114 return 0;
115
116 return -EINVAL;
117}
118
119/* do not change the order of the ID table */
120static struct usb_device_id dibusb_dib3000mb_table [] = {
Marc Koschewski11570202006-01-09 18:21:36 -0200121/* 00 */ { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_AVERMEDIA_DVBT_USB_COLD) },
122/* 01 */ { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_AVERMEDIA_DVBT_USB_WARM) },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700123/* 02 */ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_DVBU2000_COLD) },
124/* 03 */ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_DVBU2000_WARM) },
125/* 04 */ { USB_DEVICE(USB_VID_COMPRO_UNK, USB_PID_COMPRO_DVBU2000_UNK_COLD) },
126/* 05 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3000_COLD) },
127/* 06 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3000_WARM) },
Marc Koschewski11570202006-01-09 18:21:36 -0200128/* 07 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_KWORLD_VSTREAM_COLD) },
129/* 08 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_KWORLD_VSTREAM_WARM) },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700130/* 09 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB_COLD) },
131/* 10 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB_WARM) },
132/* 11 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_DIBCOM_MOD3000_COLD) },
133/* 12 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_DIBCOM_MOD3000_WARM) },
134/* 13 */ { USB_DEVICE(USB_VID_HYPER_PALTEK, USB_PID_UNK_HYPER_PALTEK_COLD) },
135/* 14 */ { USB_DEVICE(USB_VID_HYPER_PALTEK, USB_PID_UNK_HYPER_PALTEK_WARM) },
136/* 15 */ { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_TWINHAN_VP7041_COLD) },
137/* 16 */ { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_TWINHAN_VP7041_WARM) },
138/* 17 */ { USB_DEVICE(USB_VID_TWINHAN, USB_PID_TWINHAN_VP7041_COLD) },
139/* 18 */ { USB_DEVICE(USB_VID_TWINHAN, USB_PID_TWINHAN_VP7041_WARM) },
Marc Koschewski11570202006-01-09 18:21:36 -0200140/* 19 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_COLD) },
141/* 20 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_WARM) },
142/* 21 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_AN2235_COLD) },
143/* 22 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_AN2235_WARM) },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700144/* 23 */ { USB_DEVICE(USB_VID_ADSTECH, USB_PID_ADSTECH_USB2_COLD) },
Patrick Boettcher8945c8c2005-07-07 17:58:07 -0700145
146/* device ID with default DIBUSB2_0-firmware and with the hacked firmware */
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700147/* 24 */ { USB_DEVICE(USB_VID_ADSTECH, USB_PID_ADSTECH_USB2_WARM) },
Marc Koschewski11570202006-01-09 18:21:36 -0200148/* 25 */ { USB_DEVICE(USB_VID_KYE, USB_PID_KYE_DVB_T_COLD) },
149/* 26 */ { USB_DEVICE(USB_VID_KYE, USB_PID_KYE_DVB_T_WARM) },
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700150
Patrick Boettchere69339d2005-09-09 13:02:42 -0700151/* 27 */ { USB_DEVICE(USB_VID_KWORLD, USB_PID_KWORLD_VSTREAM_COLD) },
152
Marc Koschewski11570202006-01-09 18:21:36 -0200153/* 28 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_COLD) },
154/* 29 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_WARM) },
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800155
Marc Koschewski11570202006-01-09 18:21:36 -0200156/*
157 * XXX: As Artec just 'forgot' to program the EEPROM on some Artec T1 devices
158 * we don't catch these faulty IDs (namely 'Cypress FX1 USB controller') that
159 * have been left on the device. If you don't have such a device but an Artec
160 * device that's supposed to work with this driver but is not detected by it,
161 * free to enable CONFIG_DVB_USB_DIBUSB_MB_FAULTY via your kernel config.
162 */
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700163
Marc Koschewski11570202006-01-09 18:21:36 -0200164#ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800165/* 30 */ { USB_DEVICE(USB_VID_ANCHOR, USB_PID_ULTIMA_TVBOX_ANCHOR_COLD) },
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700166#endif
Marc Koschewski11570202006-01-09 18:21:36 -0200167
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700168 { } /* Terminating entry */
169};
170MODULE_DEVICE_TABLE (usb, dibusb_dib3000mb_table);
171
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300172static struct dvb_usb_device_properties dibusb1_1_properties = {
173 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700174
175 .usb_ctrl = CYPRESS_AN2135,
176
177 .firmware = "dvb-usb-dibusb-5.0.0.11.fw",
178
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300179 .num_adapters = 1,
180 .adapter = {
181 {
182 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
183 .pid_filter_count = 16,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700184
Patrick Boettcher01451e72006-10-13 11:34:46 -0300185 .streaming_ctrl = dibusb_streaming_ctrl,
186 .pid_filter = dibusb_pid_filter,
187 .pid_filter_ctrl = dibusb_pid_filter_ctrl,
188 .frontend_attach = dibusb_dib3000mb_frontend_attach,
189 .tuner_attach = dibusb_tuner_probe_and_attach,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700190
Patrick Boettcher01451e72006-10-13 11:34:46 -0300191 /* parameter for the MPEG2-data transfer */
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300192 .stream = {
193 .type = USB_BULK,
Patrick Boettcher01451e72006-10-13 11:34:46 -0300194 .count = 7,
195 .endpoint = 0x02,
196 .u = {
197 .bulk = {
198 .buffersize = 4096,
199 }
200 }
201 },
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300202 .size_of_priv = sizeof(struct dibusb_state),
203 }
204 },
205
206 .power_ctrl = dibusb_power_ctrl,
207
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700208 .rc_interval = DEFAULT_RC_INTERVAL,
209 .rc_key_map = dibusb_rc_keys,
Sergei Hallera841e1f2006-05-14 10:47:21 -0300210 .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700211 .rc_query = dibusb_rc_query,
212
213 .i2c_algo = &dibusb_i2c_algo,
214
215 .generic_bulk_ctrl_endpoint = 0x01,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700216
Patrick Boettcher2f7f96b2005-07-07 17:58:16 -0700217 .num_device_descs = 9,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700218 .devices = {
219 { "AVerMedia AverTV DVBT USB1.1",
220 { &dibusb_dib3000mb_table[0], NULL },
221 { &dibusb_dib3000mb_table[1], NULL },
222 },
223 { "Compro Videomate DVB-U2000 - DVB-T USB1.1 (please confirm to linux-dvb)",
224 { &dibusb_dib3000mb_table[2], &dibusb_dib3000mb_table[4], NULL},
225 { &dibusb_dib3000mb_table[3], NULL },
226 },
227 { "DiBcom USB1.1 DVB-T reference design (MOD3000)",
228 { &dibusb_dib3000mb_table[5], NULL },
229 { &dibusb_dib3000mb_table[6], NULL },
230 },
231 { "KWorld V-Stream XPERT DTV - DVB-T USB1.1",
232 { &dibusb_dib3000mb_table[7], NULL },
233 { &dibusb_dib3000mb_table[8], NULL },
234 },
235 { "Grandtec USB1.1 DVB-T",
236 { &dibusb_dib3000mb_table[9], &dibusb_dib3000mb_table[11], NULL },
237 { &dibusb_dib3000mb_table[10], &dibusb_dib3000mb_table[12], NULL },
238 },
239 { "Unkown USB1.1 DVB-T device ???? please report the name to the author",
240 { &dibusb_dib3000mb_table[13], NULL },
241 { &dibusb_dib3000mb_table[14], NULL },
242 },
243 { "TwinhanDTV USB-Ter USB1.1 / Magic Box I / HAMA USB1.1 DVB-T device",
244 { &dibusb_dib3000mb_table[15], &dibusb_dib3000mb_table[17], NULL},
245 { &dibusb_dib3000mb_table[16], &dibusb_dib3000mb_table[18], NULL},
246 },
247 { "Artec T1 USB1.1 TVBOX with AN2135",
248 { &dibusb_dib3000mb_table[19], NULL },
249 { &dibusb_dib3000mb_table[20], NULL },
250 },
Patrick Boettcher2f7f96b2005-07-07 17:58:16 -0700251 { "VideoWalker DVB-T USB",
252 { &dibusb_dib3000mb_table[25], NULL },
253 { &dibusb_dib3000mb_table[26], NULL },
254 },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700255 }
256};
257
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300258static struct dvb_usb_device_properties dibusb1_1_an2235_properties = {
259 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700260 .usb_ctrl = CYPRESS_AN2235,
261
262 .firmware = "dvb-usb-dibusb-an2235-01.fw",
263
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300264 .num_adapters = 1,
265 .adapter = {
266 {
267 .caps = DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF | DVB_USB_ADAP_HAS_PID_FILTER,
268 .pid_filter_count = 16,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700269
Patrick Boettcher01451e72006-10-13 11:34:46 -0300270 .streaming_ctrl = dibusb_streaming_ctrl,
271 .pid_filter = dibusb_pid_filter,
272 .pid_filter_ctrl = dibusb_pid_filter_ctrl,
273 .frontend_attach = dibusb_dib3000mb_frontend_attach,
274 .tuner_attach = dibusb_tuner_probe_and_attach,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700275
Patrick Boettcher01451e72006-10-13 11:34:46 -0300276 /* parameter for the MPEG2-data transfer */
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300277 .stream = {
278 .type = USB_BULK,
Patrick Boettcher01451e72006-10-13 11:34:46 -0300279 .count = 7,
280 .endpoint = 0x02,
281 .u = {
282 .bulk = {
283 .buffersize = 4096,
284 }
285 }
286 },
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300287 .size_of_priv = sizeof(struct dibusb_state),
288 },
289 },
290 .power_ctrl = dibusb_power_ctrl,
291
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700292 .rc_interval = DEFAULT_RC_INTERVAL,
293 .rc_key_map = dibusb_rc_keys,
Sergei Hallera841e1f2006-05-14 10:47:21 -0300294 .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700295 .rc_query = dibusb_rc_query,
296
297 .i2c_algo = &dibusb_i2c_algo,
298
299 .generic_bulk_ctrl_endpoint = 0x01,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700300
Marc Koschewski11570202006-01-09 18:21:36 -0200301#ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700302 .num_device_descs = 2,
303#else
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700304 .num_device_descs = 1,
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700305#endif
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700306 .devices = {
307 { "Artec T1 USB1.1 TVBOX with AN2235",
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700308 { &dibusb_dib3000mb_table[21], NULL },
Alistair Buxton83905b02006-09-10 12:09:22 -0300309 { &dibusb_dib3000mb_table[22], NULL },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700310 },
Marc Koschewski11570202006-01-09 18:21:36 -0200311#ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700312 { "Artec T1 USB1.1 TVBOX with AN2235 (faulty USB IDs)",
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800313 { &dibusb_dib3000mb_table[30], NULL },
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700314 { NULL },
315 },
Marc Koschewski11570202006-01-09 18:21:36 -0200316 { NULL },
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700317#endif
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700318 }
319};
320
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300321static struct dvb_usb_device_properties dibusb2_0b_properties = {
322 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
Patrick Boettcherc251ef62005-07-07 17:58:14 -0700323
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700324 .usb_ctrl = CYPRESS_FX2,
325
Patrick Boettcher8945c8c2005-07-07 17:58:07 -0700326 .firmware = "dvb-usb-adstech-usb2-02.fw",
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700327
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300328 .num_adapters = 1,
329 .adapter = {
330 {
331 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
332 .pid_filter_count = 16,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700333
Patrick Boettcher01451e72006-10-13 11:34:46 -0300334 .streaming_ctrl = dibusb2_0_streaming_ctrl,
335 .pid_filter = dibusb_pid_filter,
336 .pid_filter_ctrl = dibusb_pid_filter_ctrl,
337 .frontend_attach = dibusb_dib3000mb_frontend_attach,
338 .tuner_attach = dibusb_thomson_tuner_attach,
339
340 /* parameter for the MPEG2-data transfer */
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300341 .stream = {
342 .type = USB_BULK,
Patrick Boettcher01451e72006-10-13 11:34:46 -0300343 .count = 7,
344 .endpoint = 0x06,
345 .u = {
346 .bulk = {
347 .buffersize = 4096,
348 }
349 }
350 },
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300351 .size_of_priv = sizeof(struct dibusb_state),
352 }
353 },
354 .power_ctrl = dibusb2_0_power_ctrl,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700355
356 .rc_interval = DEFAULT_RC_INTERVAL,
357 .rc_key_map = dibusb_rc_keys,
Sergei Hallera841e1f2006-05-14 10:47:21 -0300358 .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700359 .rc_query = dibusb_rc_query,
360
361 .i2c_algo = &dibusb_i2c_algo,
362
363 .generic_bulk_ctrl_endpoint = 0x01,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700364
Patrick Boettchere69339d2005-09-09 13:02:42 -0700365 .num_device_descs = 2,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700366 .devices = {
Patrick Boettchere69339d2005-09-09 13:02:42 -0700367 { "KWorld/ADSTech Instant DVB-T USB2.0",
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700368 { &dibusb_dib3000mb_table[23], NULL },
Patrick Boettcher8945c8c2005-07-07 17:58:07 -0700369 { &dibusb_dib3000mb_table[24], NULL },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700370 },
Patrick Boettchere69339d2005-09-09 13:02:42 -0700371 { "KWorld Xpert DVB-T USB2.0",
372 { &dibusb_dib3000mb_table[27], NULL },
373 { NULL }
374 },
Marc Koschewski11570202006-01-09 18:21:36 -0200375 { NULL },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700376 }
377};
378
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300379static struct dvb_usb_device_properties artec_t1_usb2_properties = {
380 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800381
382 .usb_ctrl = CYPRESS_FX2,
383
384 .firmware = "dvb-usb-dibusb-6.0.0.8.fw",
385
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300386 .num_adapters = 1,
387 .adapter = {
388 {
389 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
390 .pid_filter_count = 16,
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800391
Patrick Boettcher01451e72006-10-13 11:34:46 -0300392 .streaming_ctrl = dibusb2_0_streaming_ctrl,
393 .pid_filter = dibusb_pid_filter,
394 .pid_filter_ctrl = dibusb_pid_filter_ctrl,
395 .frontend_attach = dibusb_dib3000mb_frontend_attach,
396 .tuner_attach = dibusb_tuner_probe_and_attach,
397 /* parameter for the MPEG2-data transfer */
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300398 .stream = {
399 .type = USB_BULK,
Patrick Boettcher01451e72006-10-13 11:34:46 -0300400 .count = 7,
401 .endpoint = 0x06,
402 .u = {
403 .bulk = {
404 .buffersize = 4096,
405 }
406 }
407 },
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300408 .size_of_priv = sizeof(struct dibusb_state),
409 }
410 },
411 .power_ctrl = dibusb2_0_power_ctrl,
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800412
413 .rc_interval = DEFAULT_RC_INTERVAL,
414 .rc_key_map = dibusb_rc_keys,
Sergei Hallera841e1f2006-05-14 10:47:21 -0300415 .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800416 .rc_query = dibusb_rc_query,
417
418 .i2c_algo = &dibusb_i2c_algo,
419
420 .generic_bulk_ctrl_endpoint = 0x01,
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800421
422 .num_device_descs = 1,
423 .devices = {
424 { "Artec T1 USB2.0",
425 { &dibusb_dib3000mb_table[28], NULL },
426 { &dibusb_dib3000mb_table[29], NULL },
427 },
Marc Koschewski11570202006-01-09 18:21:36 -0200428 { NULL },
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800429 }
430};
431
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700432static struct usb_driver dibusb_driver = {
Patrick Boettcher63b5c1c2005-07-07 17:58:30 -0700433 .name = "dvb_usb_dibusb_mb",
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700434 .probe = dibusb_probe,
435 .disconnect = dvb_usb_device_exit,
436 .id_table = dibusb_dib3000mb_table,
437};
438
439/* module stuff */
440static int __init dibusb_module_init(void)
441{
442 int result;
443 if ((result = usb_register(&dibusb_driver))) {
444 err("usb_register failed. Error number %d",result);
445 return result;
446 }
447
448 return 0;
449}
450
451static void __exit dibusb_module_exit(void)
452{
453 /* deregister this driver from the USB subsystem */
454 usb_deregister(&dibusb_driver);
455}
456
457module_init (dibusb_module_init);
458module_exit (dibusb_module_exit);
459
460MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
461MODULE_DESCRIPTION("Driver for DiBcom USB DVB-T devices (DiB3000M-B based)");
462MODULE_VERSION("1.0");
463MODULE_LICENSE("GPL");