blob: c65bfbfb64ea44faa0ffebce5f4704635bae8f80 [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
Janne Grunau78e92002008-04-09 19:13:13 -030017DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
18
Michael Krufky6c08d9292007-06-12 12:43:25 -030019static int dib3000mb_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
20{
21 struct dvb_usb_adapter *adap = fe->dvb->priv;
22 struct dibusb_state *st = adap->priv;
23
24 return st->ops.tuner_pass_ctrl(fe, enable, st->tuner_addr);
25}
26
Patrick Boettcher4d43e132006-09-30 06:53:48 -030027static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_adapter *adap)
Johannes Stezenbach776338e2005-06-23 22:02:35 -070028{
29 struct dib3000_config demod_cfg;
Patrick Boettcher4d43e132006-09-30 06:53:48 -030030 struct dibusb_state *st = adap->priv;
Johannes Stezenbach776338e2005-06-23 22:02:35 -070031
32 demod_cfg.demod_address = 0x8;
Johannes Stezenbach776338e2005-06-23 22:02:35 -070033
Michael Krufky77eed212011-09-06 09:31:57 -030034 if ((adap->fe_adap[0].fe = dvb_attach(dib3000mb_attach, &demod_cfg,
Michael Krufky79d3a8b2007-05-09 14:52:52 -030035 &adap->dev->i2c_adap, &st->ops)) == NULL)
Johannes Stezenbach776338e2005-06-23 22:02:35 -070036 return -ENODEV;
Adrian Bunk56760f02006-08-15 11:38:40 -030037
Michael Krufky77eed212011-09-06 09:31:57 -030038 adap->fe_adap[0].fe->ops.i2c_gate_ctrl = dib3000mb_i2c_gate_ctrl;
Johannes Stezenbach776338e2005-06-23 22:02:35 -070039
40 return 0;
41}
42
Patrick Boettcher4d43e132006-09-30 06:53:48 -030043static int dibusb_thomson_tuner_attach(struct dvb_usb_adapter *adap)
Patrick Boettcher8945c8c2005-07-07 17:58:07 -070044{
Michael Krufky6c08d9292007-06-12 12:43:25 -030045 struct dibusb_state *st = adap->priv;
46
47 st->tuner_addr = 0x61;
48
Michael Krufky77eed212011-09-06 09:31:57 -030049 dvb_attach(dvb_pll_attach, adap->fe_adap[0].fe, 0x61, &adap->dev->i2c_adap,
Michael Krufky47a99912007-06-12 16:10:51 -030050 DVB_PLL_TUA6010XS);
Michael Krufkyfbfee862007-05-09 15:58:17 -030051 return 0;
52}
53
54static int dibusb_panasonic_tuner_attach(struct dvb_usb_adapter *adap)
55{
Michael Krufky6c08d9292007-06-12 12:43:25 -030056 struct dibusb_state *st = adap->priv;
57
58 st->tuner_addr = 0x60;
59
Michael Krufky77eed212011-09-06 09:31:57 -030060 dvb_attach(dvb_pll_attach, adap->fe_adap[0].fe, 0x60, &adap->dev->i2c_adap,
Michael Krufky47a99912007-06-12 16:10:51 -030061 DVB_PLL_TDA665X);
Patrick Boettcher8945c8c2005-07-07 17:58:07 -070062 return 0;
63}
64
65/* Some of the Artec 1.1 device aren't equipped with the default tuner
Johannes Stezenbach776338e2005-06-23 22:02:35 -070066 * (Thomson Cable), but with a Panasonic ENV77H11D5. This function figures
67 * this out. */
Patrick Boettcher4d43e132006-09-30 06:53:48 -030068static int dibusb_tuner_probe_and_attach(struct dvb_usb_adapter *adap)
Johannes Stezenbach776338e2005-06-23 22:02:35 -070069{
70 u8 b[2] = { 0,0 }, b2[1];
71 int ret = 0;
72 struct i2c_msg msg[2] = {
73 { .flags = 0, .buf = b, .len = 2 },
74 { .flags = I2C_M_RD, .buf = b2, .len = 1 },
75 };
Michael Krufky6c08d9292007-06-12 12:43:25 -030076 struct dibusb_state *st = adap->priv;
Johannes Stezenbach776338e2005-06-23 22:02:35 -070077
78 /* the Panasonic sits on I2C addrass 0x60, the Thomson on 0x61 */
Michael Krufky096bb772007-06-22 17:41:07 -030079 msg[0].addr = msg[1].addr = st->tuner_addr = 0x60;
Johannes Stezenbach776338e2005-06-23 22:02:35 -070080
Michael Krufky77eed212011-09-06 09:31:57 -030081 if (adap->fe_adap[0].fe->ops.i2c_gate_ctrl)
Michael Krufky45943032011-09-16 09:35:06 -030082 adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].fe, 1);
Johannes Stezenbach776338e2005-06-23 22:02:35 -070083
Patrick Boettcher4d43e132006-09-30 06:53:48 -030084 if (i2c_transfer(&adap->dev->i2c_adap, msg, 2) != 2) {
Johannes Stezenbach776338e2005-06-23 22:02:35 -070085 err("tuner i2c write failed.");
86 ret = -EREMOTEIO;
87 }
88
Michael Krufky77eed212011-09-06 09:31:57 -030089 if (adap->fe_adap[0].fe->ops.i2c_gate_ctrl)
Michael Krufky45943032011-09-16 09:35:06 -030090 adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].fe, 0);
Johannes Stezenbach776338e2005-06-23 22:02:35 -070091
92 if (b2[0] == 0xfe) {
Marc Koschewski11570202006-01-09 18:21:36 -020093 info("This device has the Thomson Cable onboard. Which is default.");
Michael Krufkyfbfee862007-05-09 15:58:17 -030094 ret = dibusb_thomson_tuner_attach(adap);
Johannes Stezenbach776338e2005-06-23 22:02:35 -070095 } else {
Marc Koschewski11570202006-01-09 18:21:36 -020096 info("This device has the Panasonic ENV77H11D5 onboard.");
Michael Krufkyfbfee862007-05-09 15:58:17 -030097 ret = dibusb_panasonic_tuner_attach(adap);
Johannes Stezenbach776338e2005-06-23 22:02:35 -070098 }
99
100 return ret;
101}
102
103/* USB Driver stuff */
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300104static struct dvb_usb_device_properties dibusb1_1_properties;
105static struct dvb_usb_device_properties dibusb1_1_an2235_properties;
106static struct dvb_usb_device_properties dibusb2_0b_properties;
107static struct dvb_usb_device_properties artec_t1_usb2_properties;
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700108
109static int dibusb_probe(struct usb_interface *intf,
110 const struct usb_device_id *id)
111{
Janne Grunau78e92002008-04-09 19:13:13 -0300112 if (0 == dvb_usb_device_init(intf, &dibusb1_1_properties,
113 THIS_MODULE, NULL, adapter_nr) ||
114 0 == dvb_usb_device_init(intf, &dibusb1_1_an2235_properties,
115 THIS_MODULE, NULL, adapter_nr) ||
116 0 == dvb_usb_device_init(intf, &dibusb2_0b_properties,
117 THIS_MODULE, NULL, adapter_nr) ||
118 0 == dvb_usb_device_init(intf, &artec_t1_usb2_properties,
119 THIS_MODULE, NULL, adapter_nr))
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700120 return 0;
121
122 return -EINVAL;
123}
124
125/* do not change the order of the ID table */
126static struct usb_device_id dibusb_dib3000mb_table [] = {
Marc Koschewski11570202006-01-09 18:21:36 -0200127/* 00 */ { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_AVERMEDIA_DVBT_USB_COLD) },
128/* 01 */ { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_AVERMEDIA_DVBT_USB_WARM) },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700129/* 02 */ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_DVBU2000_COLD) },
130/* 03 */ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_DVBU2000_WARM) },
131/* 04 */ { USB_DEVICE(USB_VID_COMPRO_UNK, USB_PID_COMPRO_DVBU2000_UNK_COLD) },
132/* 05 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3000_COLD) },
133/* 06 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3000_WARM) },
Marc Koschewski11570202006-01-09 18:21:36 -0200134/* 07 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_KWORLD_VSTREAM_COLD) },
135/* 08 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_KWORLD_VSTREAM_WARM) },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700136/* 09 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB_COLD) },
137/* 10 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB_WARM) },
138/* 11 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_DIBCOM_MOD3000_COLD) },
139/* 12 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_DIBCOM_MOD3000_WARM) },
140/* 13 */ { USB_DEVICE(USB_VID_HYPER_PALTEK, USB_PID_UNK_HYPER_PALTEK_COLD) },
141/* 14 */ { USB_DEVICE(USB_VID_HYPER_PALTEK, USB_PID_UNK_HYPER_PALTEK_WARM) },
142/* 15 */ { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_TWINHAN_VP7041_COLD) },
143/* 16 */ { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_TWINHAN_VP7041_WARM) },
144/* 17 */ { USB_DEVICE(USB_VID_TWINHAN, USB_PID_TWINHAN_VP7041_COLD) },
145/* 18 */ { USB_DEVICE(USB_VID_TWINHAN, USB_PID_TWINHAN_VP7041_WARM) },
Marc Koschewski11570202006-01-09 18:21:36 -0200146/* 19 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_COLD) },
147/* 20 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_WARM) },
148/* 21 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_AN2235_COLD) },
149/* 22 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_AN2235_WARM) },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700150/* 23 */ { USB_DEVICE(USB_VID_ADSTECH, USB_PID_ADSTECH_USB2_COLD) },
Patrick Boettcher8945c8c2005-07-07 17:58:07 -0700151
152/* device ID with default DIBUSB2_0-firmware and with the hacked firmware */
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700153/* 24 */ { USB_DEVICE(USB_VID_ADSTECH, USB_PID_ADSTECH_USB2_WARM) },
Marc Koschewski11570202006-01-09 18:21:36 -0200154/* 25 */ { USB_DEVICE(USB_VID_KYE, USB_PID_KYE_DVB_T_COLD) },
155/* 26 */ { USB_DEVICE(USB_VID_KYE, USB_PID_KYE_DVB_T_WARM) },
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700156
Patrick Boettchere69339d2005-09-09 13:02:42 -0700157/* 27 */ { USB_DEVICE(USB_VID_KWORLD, USB_PID_KWORLD_VSTREAM_COLD) },
158
Marc Koschewski11570202006-01-09 18:21:36 -0200159/* 28 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_COLD) },
160/* 29 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_WARM) },
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800161
Marc Koschewski11570202006-01-09 18:21:36 -0200162/*
163 * XXX: As Artec just 'forgot' to program the EEPROM on some Artec T1 devices
164 * we don't catch these faulty IDs (namely 'Cypress FX1 USB controller') that
165 * have been left on the device. If you don't have such a device but an Artec
166 * device that's supposed to work with this driver but is not detected by it,
167 * free to enable CONFIG_DVB_USB_DIBUSB_MB_FAULTY via your kernel config.
168 */
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700169
Marc Koschewski11570202006-01-09 18:21:36 -0200170#ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800171/* 30 */ { USB_DEVICE(USB_VID_ANCHOR, USB_PID_ULTIMA_TVBOX_ANCHOR_COLD) },
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700172#endif
Marc Koschewski11570202006-01-09 18:21:36 -0200173
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700174 { } /* Terminating entry */
175};
176MODULE_DEVICE_TABLE (usb, dibusb_dib3000mb_table);
177
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300178static struct dvb_usb_device_properties dibusb1_1_properties = {
179 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700180
181 .usb_ctrl = CYPRESS_AN2135,
182
183 .firmware = "dvb-usb-dibusb-5.0.0.11.fw",
184
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300185 .num_adapters = 1,
186 .adapter = {
187 {
Michael Krufky77eed212011-09-06 09:31:57 -0300188 .num_frontends = 1,
189 .fe = {{
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300190 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
191 .pid_filter_count = 16,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700192
Patrick Boettcher01451e72006-10-13 11:34:46 -0300193 .streaming_ctrl = dibusb_streaming_ctrl,
194 .pid_filter = dibusb_pid_filter,
195 .pid_filter_ctrl = dibusb_pid_filter_ctrl,
196 .frontend_attach = dibusb_dib3000mb_frontend_attach,
197 .tuner_attach = dibusb_tuner_probe_and_attach,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700198
Patrick Boettcher01451e72006-10-13 11:34:46 -0300199 /* parameter for the MPEG2-data transfer */
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300200 .stream = {
201 .type = USB_BULK,
Patrick Boettcher01451e72006-10-13 11:34:46 -0300202 .count = 7,
203 .endpoint = 0x02,
204 .u = {
205 .bulk = {
206 .buffersize = 4096,
207 }
208 }
209 },
Michael Krufky77eed212011-09-06 09:31:57 -0300210 }},
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300211 .size_of_priv = sizeof(struct dibusb_state),
212 }
213 },
214
215 .power_ctrl = dibusb_power_ctrl,
216
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -0300217 .rc.legacy = {
218 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -0300219 .rc_map_table = rc_map_dibusb_table,
220 .rc_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -0300221 .rc_query = dibusb_rc_query,
222 },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700223
224 .i2c_algo = &dibusb_i2c_algo,
225
226 .generic_bulk_ctrl_endpoint = 0x01,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700227
Patrick Boettcher2f7f96b2005-07-07 17:58:16 -0700228 .num_device_descs = 9,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700229 .devices = {
230 { "AVerMedia AverTV DVBT USB1.1",
231 { &dibusb_dib3000mb_table[0], NULL },
232 { &dibusb_dib3000mb_table[1], NULL },
233 },
234 { "Compro Videomate DVB-U2000 - DVB-T USB1.1 (please confirm to linux-dvb)",
235 { &dibusb_dib3000mb_table[2], &dibusb_dib3000mb_table[4], NULL},
236 { &dibusb_dib3000mb_table[3], NULL },
237 },
238 { "DiBcom USB1.1 DVB-T reference design (MOD3000)",
239 { &dibusb_dib3000mb_table[5], NULL },
240 { &dibusb_dib3000mb_table[6], NULL },
241 },
242 { "KWorld V-Stream XPERT DTV - DVB-T USB1.1",
243 { &dibusb_dib3000mb_table[7], NULL },
244 { &dibusb_dib3000mb_table[8], NULL },
245 },
246 { "Grandtec USB1.1 DVB-T",
247 { &dibusb_dib3000mb_table[9], &dibusb_dib3000mb_table[11], NULL },
248 { &dibusb_dib3000mb_table[10], &dibusb_dib3000mb_table[12], NULL },
249 },
André Goddard Rosaaf901ca2009-11-14 13:09:05 -0200250 { "Unknown USB1.1 DVB-T device ???? please report the name to the author",
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700251 { &dibusb_dib3000mb_table[13], NULL },
252 { &dibusb_dib3000mb_table[14], NULL },
253 },
254 { "TwinhanDTV USB-Ter USB1.1 / Magic Box I / HAMA USB1.1 DVB-T device",
255 { &dibusb_dib3000mb_table[15], &dibusb_dib3000mb_table[17], NULL},
256 { &dibusb_dib3000mb_table[16], &dibusb_dib3000mb_table[18], NULL},
257 },
258 { "Artec T1 USB1.1 TVBOX with AN2135",
259 { &dibusb_dib3000mb_table[19], NULL },
260 { &dibusb_dib3000mb_table[20], NULL },
261 },
Patrick Boettcher2f7f96b2005-07-07 17:58:16 -0700262 { "VideoWalker DVB-T USB",
263 { &dibusb_dib3000mb_table[25], NULL },
264 { &dibusb_dib3000mb_table[26], NULL },
265 },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700266 }
267};
268
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300269static struct dvb_usb_device_properties dibusb1_1_an2235_properties = {
270 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700271 .usb_ctrl = CYPRESS_AN2235,
272
273 .firmware = "dvb-usb-dibusb-an2235-01.fw",
274
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300275 .num_adapters = 1,
276 .adapter = {
277 {
Michael Krufky77eed212011-09-06 09:31:57 -0300278 .num_frontends = 1,
279 .fe = {{
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300280 .caps = DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF | DVB_USB_ADAP_HAS_PID_FILTER,
281 .pid_filter_count = 16,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700282
Patrick Boettcher01451e72006-10-13 11:34:46 -0300283 .streaming_ctrl = dibusb_streaming_ctrl,
284 .pid_filter = dibusb_pid_filter,
285 .pid_filter_ctrl = dibusb_pid_filter_ctrl,
286 .frontend_attach = dibusb_dib3000mb_frontend_attach,
287 .tuner_attach = dibusb_tuner_probe_and_attach,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700288
Patrick Boettcher01451e72006-10-13 11:34:46 -0300289 /* parameter for the MPEG2-data transfer */
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300290 .stream = {
291 .type = USB_BULK,
Patrick Boettcher01451e72006-10-13 11:34:46 -0300292 .count = 7,
293 .endpoint = 0x02,
294 .u = {
295 .bulk = {
296 .buffersize = 4096,
297 }
298 }
299 },
Michael Krufky77eed212011-09-06 09:31:57 -0300300 }},
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300301 .size_of_priv = sizeof(struct dibusb_state),
302 },
303 },
304 .power_ctrl = dibusb_power_ctrl,
305
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -0300306 .rc.legacy = {
307 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -0300308 .rc_map_table = rc_map_dibusb_table,
309 .rc_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -0300310 .rc_query = dibusb_rc_query,
311 },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700312
313 .i2c_algo = &dibusb_i2c_algo,
314
315 .generic_bulk_ctrl_endpoint = 0x01,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700316
Marc Koschewski11570202006-01-09 18:21:36 -0200317#ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700318 .num_device_descs = 2,
319#else
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700320 .num_device_descs = 1,
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700321#endif
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700322 .devices = {
323 { "Artec T1 USB1.1 TVBOX with AN2235",
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700324 { &dibusb_dib3000mb_table[21], NULL },
Alistair Buxton83905b02006-09-10 12:09:22 -0300325 { &dibusb_dib3000mb_table[22], NULL },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700326 },
Marc Koschewski11570202006-01-09 18:21:36 -0200327#ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700328 { "Artec T1 USB1.1 TVBOX with AN2235 (faulty USB IDs)",
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800329 { &dibusb_dib3000mb_table[30], NULL },
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700330 { NULL },
331 },
Marc Koschewski11570202006-01-09 18:21:36 -0200332 { NULL },
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700333#endif
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700334 }
335};
336
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300337static struct dvb_usb_device_properties dibusb2_0b_properties = {
338 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
Patrick Boettcherc251ef62005-07-07 17:58:14 -0700339
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700340 .usb_ctrl = CYPRESS_FX2,
341
Patrick Boettcher8945c8c2005-07-07 17:58:07 -0700342 .firmware = "dvb-usb-adstech-usb2-02.fw",
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700343
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300344 .num_adapters = 1,
345 .adapter = {
346 {
Michael Krufky77eed212011-09-06 09:31:57 -0300347 .num_frontends = 1,
348 .fe = {{
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300349 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
350 .pid_filter_count = 16,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700351
Patrick Boettcher01451e72006-10-13 11:34:46 -0300352 .streaming_ctrl = dibusb2_0_streaming_ctrl,
353 .pid_filter = dibusb_pid_filter,
354 .pid_filter_ctrl = dibusb_pid_filter_ctrl,
355 .frontend_attach = dibusb_dib3000mb_frontend_attach,
356 .tuner_attach = dibusb_thomson_tuner_attach,
357
358 /* parameter for the MPEG2-data transfer */
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300359 .stream = {
360 .type = USB_BULK,
Patrick Boettcher01451e72006-10-13 11:34:46 -0300361 .count = 7,
362 .endpoint = 0x06,
363 .u = {
364 .bulk = {
365 .buffersize = 4096,
366 }
367 }
368 },
Michael Krufky77eed212011-09-06 09:31:57 -0300369 }},
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300370 .size_of_priv = sizeof(struct dibusb_state),
371 }
372 },
373 .power_ctrl = dibusb2_0_power_ctrl,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700374
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -0300375 .rc.legacy = {
376 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -0300377 .rc_map_table = rc_map_dibusb_table,
378 .rc_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -0300379 .rc_query = dibusb_rc_query,
380 },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700381
382 .i2c_algo = &dibusb_i2c_algo,
383
384 .generic_bulk_ctrl_endpoint = 0x01,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700385
Patrick Boettchere69339d2005-09-09 13:02:42 -0700386 .num_device_descs = 2,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700387 .devices = {
Patrick Boettchere69339d2005-09-09 13:02:42 -0700388 { "KWorld/ADSTech Instant DVB-T USB2.0",
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700389 { &dibusb_dib3000mb_table[23], NULL },
Patrick Boettcher8945c8c2005-07-07 17:58:07 -0700390 { &dibusb_dib3000mb_table[24], NULL },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700391 },
Patrick Boettchere69339d2005-09-09 13:02:42 -0700392 { "KWorld Xpert DVB-T USB2.0",
393 { &dibusb_dib3000mb_table[27], NULL },
394 { NULL }
395 },
Marc Koschewski11570202006-01-09 18:21:36 -0200396 { NULL },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700397 }
398};
399
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300400static struct dvb_usb_device_properties artec_t1_usb2_properties = {
401 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800402
403 .usb_ctrl = CYPRESS_FX2,
404
405 .firmware = "dvb-usb-dibusb-6.0.0.8.fw",
406
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300407 .num_adapters = 1,
408 .adapter = {
409 {
Michael Krufky77eed212011-09-06 09:31:57 -0300410 .num_frontends = 1,
411 .fe = {{
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300412 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
413 .pid_filter_count = 16,
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800414
Patrick Boettcher01451e72006-10-13 11:34:46 -0300415 .streaming_ctrl = dibusb2_0_streaming_ctrl,
416 .pid_filter = dibusb_pid_filter,
417 .pid_filter_ctrl = dibusb_pid_filter_ctrl,
418 .frontend_attach = dibusb_dib3000mb_frontend_attach,
419 .tuner_attach = dibusb_tuner_probe_and_attach,
420 /* parameter for the MPEG2-data transfer */
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300421 .stream = {
422 .type = USB_BULK,
Patrick Boettcher01451e72006-10-13 11:34:46 -0300423 .count = 7,
424 .endpoint = 0x06,
425 .u = {
426 .bulk = {
427 .buffersize = 4096,
428 }
429 }
430 },
Michael Krufky77eed212011-09-06 09:31:57 -0300431 }},
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300432 .size_of_priv = sizeof(struct dibusb_state),
433 }
434 },
435 .power_ctrl = dibusb2_0_power_ctrl,
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800436
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -0300437 .rc.legacy = {
438 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -0300439 .rc_map_table = rc_map_dibusb_table,
440 .rc_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -0300441 .rc_query = dibusb_rc_query,
442 },
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800443
444 .i2c_algo = &dibusb_i2c_algo,
445
446 .generic_bulk_ctrl_endpoint = 0x01,
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800447
448 .num_device_descs = 1,
449 .devices = {
450 { "Artec T1 USB2.0",
451 { &dibusb_dib3000mb_table[28], NULL },
452 { &dibusb_dib3000mb_table[29], NULL },
453 },
Marc Koschewski11570202006-01-09 18:21:36 -0200454 { NULL },
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800455 }
456};
457
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700458static struct usb_driver dibusb_driver = {
Patrick Boettcher63b5c1c2005-07-07 17:58:30 -0700459 .name = "dvb_usb_dibusb_mb",
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700460 .probe = dibusb_probe,
461 .disconnect = dvb_usb_device_exit,
462 .id_table = dibusb_dib3000mb_table,
463};
464
465/* module stuff */
466static int __init dibusb_module_init(void)
467{
468 int result;
469 if ((result = usb_register(&dibusb_driver))) {
470 err("usb_register failed. Error number %d",result);
471 return result;
472 }
473
474 return 0;
475}
476
477static void __exit dibusb_module_exit(void)
478{
479 /* deregister this driver from the USB subsystem */
480 usb_deregister(&dibusb_driver);
481}
482
483module_init (dibusb_module_init);
484module_exit (dibusb_module_exit);
485
486MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
487MODULE_DESCRIPTION("Driver for DiBcom USB DVB-T devices (DiB3000M-B based)");
488MODULE_VERSION("1.0");
489MODULE_LICENSE("GPL");