blob: a4ac37e0e98b692ccc4a72ea5f93c556bcaf1447 [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 Krufkyd4dd5ce2011-09-17 14:38:50 -030034 adap->fe_adap[0].fe = dvb_attach(dib3000mb_attach, &demod_cfg,
35 &adap->dev->i2c_adap, &st->ops);
36 if ((adap->fe_adap[0].fe) == NULL)
Johannes Stezenbach776338e2005-06-23 22:02:35 -070037 return -ENODEV;
Adrian Bunk56760f02006-08-15 11:38:40 -030038
Michael Krufky77eed212011-09-06 09:31:57 -030039 adap->fe_adap[0].fe->ops.i2c_gate_ctrl = dib3000mb_i2c_gate_ctrl;
Johannes Stezenbach776338e2005-06-23 22:02:35 -070040
41 return 0;
42}
43
Patrick Boettcher4d43e132006-09-30 06:53:48 -030044static int dibusb_thomson_tuner_attach(struct dvb_usb_adapter *adap)
Patrick Boettcher8945c8c2005-07-07 17:58:07 -070045{
Michael Krufky6c08d9292007-06-12 12:43:25 -030046 struct dibusb_state *st = adap->priv;
47
48 st->tuner_addr = 0x61;
49
Michael Krufky77eed212011-09-06 09:31:57 -030050 dvb_attach(dvb_pll_attach, adap->fe_adap[0].fe, 0x61, &adap->dev->i2c_adap,
Michael Krufky47a99912007-06-12 16:10:51 -030051 DVB_PLL_TUA6010XS);
Michael Krufkyfbfee862007-05-09 15:58:17 -030052 return 0;
53}
54
55static int dibusb_panasonic_tuner_attach(struct dvb_usb_adapter *adap)
56{
Michael Krufky6c08d9292007-06-12 12:43:25 -030057 struct dibusb_state *st = adap->priv;
58
59 st->tuner_addr = 0x60;
60
Michael Krufky77eed212011-09-06 09:31:57 -030061 dvb_attach(dvb_pll_attach, adap->fe_adap[0].fe, 0x60, &adap->dev->i2c_adap,
Michael Krufky47a99912007-06-12 16:10:51 -030062 DVB_PLL_TDA665X);
Patrick Boettcher8945c8c2005-07-07 17:58:07 -070063 return 0;
64}
65
66/* Some of the Artec 1.1 device aren't equipped with the default tuner
Johannes Stezenbach776338e2005-06-23 22:02:35 -070067 * (Thomson Cable), but with a Panasonic ENV77H11D5. This function figures
68 * this out. */
Patrick Boettcher4d43e132006-09-30 06:53:48 -030069static int dibusb_tuner_probe_and_attach(struct dvb_usb_adapter *adap)
Johannes Stezenbach776338e2005-06-23 22:02:35 -070070{
71 u8 b[2] = { 0,0 }, b2[1];
72 int ret = 0;
73 struct i2c_msg msg[2] = {
74 { .flags = 0, .buf = b, .len = 2 },
75 { .flags = I2C_M_RD, .buf = b2, .len = 1 },
76 };
Michael Krufky6c08d9292007-06-12 12:43:25 -030077 struct dibusb_state *st = adap->priv;
Johannes Stezenbach776338e2005-06-23 22:02:35 -070078
79 /* the Panasonic sits on I2C addrass 0x60, the Thomson on 0x61 */
Michael Krufky096bb772007-06-22 17:41:07 -030080 msg[0].addr = msg[1].addr = st->tuner_addr = 0x60;
Johannes Stezenbach776338e2005-06-23 22:02:35 -070081
Michael Krufky77eed212011-09-06 09:31:57 -030082 if (adap->fe_adap[0].fe->ops.i2c_gate_ctrl)
Michael Krufky45943032011-09-16 09:35:06 -030083 adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].fe, 1);
Johannes Stezenbach776338e2005-06-23 22:02:35 -070084
Patrick Boettcher4d43e132006-09-30 06:53:48 -030085 if (i2c_transfer(&adap->dev->i2c_adap, msg, 2) != 2) {
Johannes Stezenbach776338e2005-06-23 22:02:35 -070086 err("tuner i2c write failed.");
87 ret = -EREMOTEIO;
88 }
89
Michael Krufky77eed212011-09-06 09:31:57 -030090 if (adap->fe_adap[0].fe->ops.i2c_gate_ctrl)
Michael Krufky45943032011-09-16 09:35:06 -030091 adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].fe, 0);
Johannes Stezenbach776338e2005-06-23 22:02:35 -070092
93 if (b2[0] == 0xfe) {
Marc Koschewski11570202006-01-09 18:21:36 -020094 info("This device has the Thomson Cable onboard. Which is default.");
Michael Krufkyfbfee862007-05-09 15:58:17 -030095 ret = dibusb_thomson_tuner_attach(adap);
Johannes Stezenbach776338e2005-06-23 22:02:35 -070096 } else {
Marc Koschewski11570202006-01-09 18:21:36 -020097 info("This device has the Panasonic ENV77H11D5 onboard.");
Michael Krufkyfbfee862007-05-09 15:58:17 -030098 ret = dibusb_panasonic_tuner_attach(adap);
Johannes Stezenbach776338e2005-06-23 22:02:35 -070099 }
100
101 return ret;
102}
103
104/* USB Driver stuff */
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300105static struct dvb_usb_device_properties dibusb1_1_properties;
106static struct dvb_usb_device_properties dibusb1_1_an2235_properties;
107static struct dvb_usb_device_properties dibusb2_0b_properties;
108static struct dvb_usb_device_properties artec_t1_usb2_properties;
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700109
110static int dibusb_probe(struct usb_interface *intf,
111 const struct usb_device_id *id)
112{
Janne Grunau78e92002008-04-09 19:13:13 -0300113 if (0 == dvb_usb_device_init(intf, &dibusb1_1_properties,
114 THIS_MODULE, NULL, adapter_nr) ||
115 0 == dvb_usb_device_init(intf, &dibusb1_1_an2235_properties,
116 THIS_MODULE, NULL, adapter_nr) ||
117 0 == dvb_usb_device_init(intf, &dibusb2_0b_properties,
118 THIS_MODULE, NULL, adapter_nr) ||
119 0 == dvb_usb_device_init(intf, &artec_t1_usb2_properties,
120 THIS_MODULE, NULL, adapter_nr))
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700121 return 0;
122
123 return -EINVAL;
124}
125
126/* do not change the order of the ID table */
127static struct usb_device_id dibusb_dib3000mb_table [] = {
Marc Koschewski11570202006-01-09 18:21:36 -0200128/* 00 */ { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_AVERMEDIA_DVBT_USB_COLD) },
129/* 01 */ { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_AVERMEDIA_DVBT_USB_WARM) },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700130/* 02 */ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_DVBU2000_COLD) },
131/* 03 */ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_DVBU2000_WARM) },
132/* 04 */ { USB_DEVICE(USB_VID_COMPRO_UNK, USB_PID_COMPRO_DVBU2000_UNK_COLD) },
133/* 05 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3000_COLD) },
134/* 06 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3000_WARM) },
Marc Koschewski11570202006-01-09 18:21:36 -0200135/* 07 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_KWORLD_VSTREAM_COLD) },
136/* 08 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_KWORLD_VSTREAM_WARM) },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700137/* 09 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB_COLD) },
138/* 10 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB_WARM) },
139/* 11 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_DIBCOM_MOD3000_COLD) },
140/* 12 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_DIBCOM_MOD3000_WARM) },
141/* 13 */ { USB_DEVICE(USB_VID_HYPER_PALTEK, USB_PID_UNK_HYPER_PALTEK_COLD) },
142/* 14 */ { USB_DEVICE(USB_VID_HYPER_PALTEK, USB_PID_UNK_HYPER_PALTEK_WARM) },
143/* 15 */ { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_TWINHAN_VP7041_COLD) },
144/* 16 */ { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_TWINHAN_VP7041_WARM) },
145/* 17 */ { USB_DEVICE(USB_VID_TWINHAN, USB_PID_TWINHAN_VP7041_COLD) },
146/* 18 */ { USB_DEVICE(USB_VID_TWINHAN, USB_PID_TWINHAN_VP7041_WARM) },
Marc Koschewski11570202006-01-09 18:21:36 -0200147/* 19 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_COLD) },
148/* 20 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_WARM) },
149/* 21 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_AN2235_COLD) },
150/* 22 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_AN2235_WARM) },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700151/* 23 */ { USB_DEVICE(USB_VID_ADSTECH, USB_PID_ADSTECH_USB2_COLD) },
Patrick Boettcher8945c8c2005-07-07 17:58:07 -0700152
153/* device ID with default DIBUSB2_0-firmware and with the hacked firmware */
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700154/* 24 */ { USB_DEVICE(USB_VID_ADSTECH, USB_PID_ADSTECH_USB2_WARM) },
Marc Koschewski11570202006-01-09 18:21:36 -0200155/* 25 */ { USB_DEVICE(USB_VID_KYE, USB_PID_KYE_DVB_T_COLD) },
156/* 26 */ { USB_DEVICE(USB_VID_KYE, USB_PID_KYE_DVB_T_WARM) },
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700157
Patrick Boettchere69339d2005-09-09 13:02:42 -0700158/* 27 */ { USB_DEVICE(USB_VID_KWORLD, USB_PID_KWORLD_VSTREAM_COLD) },
159
Marc Koschewski11570202006-01-09 18:21:36 -0200160/* 28 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_COLD) },
161/* 29 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_WARM) },
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800162
Marc Koschewski11570202006-01-09 18:21:36 -0200163/*
164 * XXX: As Artec just 'forgot' to program the EEPROM on some Artec T1 devices
165 * we don't catch these faulty IDs (namely 'Cypress FX1 USB controller') that
166 * have been left on the device. If you don't have such a device but an Artec
167 * device that's supposed to work with this driver but is not detected by it,
168 * free to enable CONFIG_DVB_USB_DIBUSB_MB_FAULTY via your kernel config.
169 */
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700170
Marc Koschewski11570202006-01-09 18:21:36 -0200171#ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800172/* 30 */ { USB_DEVICE(USB_VID_ANCHOR, USB_PID_ULTIMA_TVBOX_ANCHOR_COLD) },
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700173#endif
Marc Koschewski11570202006-01-09 18:21:36 -0200174
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700175 { } /* Terminating entry */
176};
177MODULE_DEVICE_TABLE (usb, dibusb_dib3000mb_table);
178
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300179static struct dvb_usb_device_properties dibusb1_1_properties = {
180 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700181
182 .usb_ctrl = CYPRESS_AN2135,
183
184 .firmware = "dvb-usb-dibusb-5.0.0.11.fw",
185
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300186 .num_adapters = 1,
187 .adapter = {
188 {
Michael Krufky77eed212011-09-06 09:31:57 -0300189 .num_frontends = 1,
190 .fe = {{
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300191 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
192 .pid_filter_count = 16,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700193
Patrick Boettcher01451e72006-10-13 11:34:46 -0300194 .streaming_ctrl = dibusb_streaming_ctrl,
195 .pid_filter = dibusb_pid_filter,
196 .pid_filter_ctrl = dibusb_pid_filter_ctrl,
197 .frontend_attach = dibusb_dib3000mb_frontend_attach,
198 .tuner_attach = dibusb_tuner_probe_and_attach,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700199
Patrick Boettcher01451e72006-10-13 11:34:46 -0300200 /* parameter for the MPEG2-data transfer */
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300201 .stream = {
202 .type = USB_BULK,
Patrick Boettcher01451e72006-10-13 11:34:46 -0300203 .count = 7,
204 .endpoint = 0x02,
205 .u = {
206 .bulk = {
207 .buffersize = 4096,
208 }
209 }
210 },
Michael Krufky77eed212011-09-06 09:31:57 -0300211 }},
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300212 .size_of_priv = sizeof(struct dibusb_state),
213 }
214 },
215
216 .power_ctrl = dibusb_power_ctrl,
217
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -0300218 .rc.legacy = {
219 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -0300220 .rc_map_table = rc_map_dibusb_table,
221 .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 -0300222 .rc_query = dibusb_rc_query,
223 },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700224
225 .i2c_algo = &dibusb_i2c_algo,
226
227 .generic_bulk_ctrl_endpoint = 0x01,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700228
Patrick Boettcher2f7f96b2005-07-07 17:58:16 -0700229 .num_device_descs = 9,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700230 .devices = {
231 { "AVerMedia AverTV DVBT USB1.1",
232 { &dibusb_dib3000mb_table[0], NULL },
233 { &dibusb_dib3000mb_table[1], NULL },
234 },
235 { "Compro Videomate DVB-U2000 - DVB-T USB1.1 (please confirm to linux-dvb)",
236 { &dibusb_dib3000mb_table[2], &dibusb_dib3000mb_table[4], NULL},
237 { &dibusb_dib3000mb_table[3], NULL },
238 },
239 { "DiBcom USB1.1 DVB-T reference design (MOD3000)",
240 { &dibusb_dib3000mb_table[5], NULL },
241 { &dibusb_dib3000mb_table[6], NULL },
242 },
243 { "KWorld V-Stream XPERT DTV - DVB-T USB1.1",
244 { &dibusb_dib3000mb_table[7], NULL },
245 { &dibusb_dib3000mb_table[8], NULL },
246 },
247 { "Grandtec USB1.1 DVB-T",
248 { &dibusb_dib3000mb_table[9], &dibusb_dib3000mb_table[11], NULL },
249 { &dibusb_dib3000mb_table[10], &dibusb_dib3000mb_table[12], NULL },
250 },
André Goddard Rosaaf901ca2009-11-14 13:09:05 -0200251 { "Unknown USB1.1 DVB-T device ???? please report the name to the author",
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700252 { &dibusb_dib3000mb_table[13], NULL },
253 { &dibusb_dib3000mb_table[14], NULL },
254 },
255 { "TwinhanDTV USB-Ter USB1.1 / Magic Box I / HAMA USB1.1 DVB-T device",
256 { &dibusb_dib3000mb_table[15], &dibusb_dib3000mb_table[17], NULL},
257 { &dibusb_dib3000mb_table[16], &dibusb_dib3000mb_table[18], NULL},
258 },
259 { "Artec T1 USB1.1 TVBOX with AN2135",
260 { &dibusb_dib3000mb_table[19], NULL },
261 { &dibusb_dib3000mb_table[20], NULL },
262 },
Patrick Boettcher2f7f96b2005-07-07 17:58:16 -0700263 { "VideoWalker DVB-T USB",
264 { &dibusb_dib3000mb_table[25], NULL },
265 { &dibusb_dib3000mb_table[26], NULL },
266 },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700267 }
268};
269
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300270static struct dvb_usb_device_properties dibusb1_1_an2235_properties = {
271 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700272 .usb_ctrl = CYPRESS_AN2235,
273
274 .firmware = "dvb-usb-dibusb-an2235-01.fw",
275
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300276 .num_adapters = 1,
277 .adapter = {
278 {
Michael Krufky77eed212011-09-06 09:31:57 -0300279 .num_frontends = 1,
280 .fe = {{
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300281 .caps = DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF | DVB_USB_ADAP_HAS_PID_FILTER,
282 .pid_filter_count = 16,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700283
Patrick Boettcher01451e72006-10-13 11:34:46 -0300284 .streaming_ctrl = dibusb_streaming_ctrl,
285 .pid_filter = dibusb_pid_filter,
286 .pid_filter_ctrl = dibusb_pid_filter_ctrl,
287 .frontend_attach = dibusb_dib3000mb_frontend_attach,
288 .tuner_attach = dibusb_tuner_probe_and_attach,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700289
Patrick Boettcher01451e72006-10-13 11:34:46 -0300290 /* parameter for the MPEG2-data transfer */
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300291 .stream = {
292 .type = USB_BULK,
Patrick Boettcher01451e72006-10-13 11:34:46 -0300293 .count = 7,
294 .endpoint = 0x02,
295 .u = {
296 .bulk = {
297 .buffersize = 4096,
298 }
299 }
300 },
Michael Krufky77eed212011-09-06 09:31:57 -0300301 }},
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300302 .size_of_priv = sizeof(struct dibusb_state),
303 },
304 },
305 .power_ctrl = dibusb_power_ctrl,
306
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -0300307 .rc.legacy = {
308 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -0300309 .rc_map_table = rc_map_dibusb_table,
310 .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 -0300311 .rc_query = dibusb_rc_query,
312 },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700313
314 .i2c_algo = &dibusb_i2c_algo,
315
316 .generic_bulk_ctrl_endpoint = 0x01,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700317
Marc Koschewski11570202006-01-09 18:21:36 -0200318#ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700319 .num_device_descs = 2,
320#else
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700321 .num_device_descs = 1,
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700322#endif
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700323 .devices = {
324 { "Artec T1 USB1.1 TVBOX with AN2235",
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700325 { &dibusb_dib3000mb_table[21], NULL },
Alistair Buxton83905b02006-09-10 12:09:22 -0300326 { &dibusb_dib3000mb_table[22], NULL },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700327 },
Marc Koschewski11570202006-01-09 18:21:36 -0200328#ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700329 { "Artec T1 USB1.1 TVBOX with AN2235 (faulty USB IDs)",
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800330 { &dibusb_dib3000mb_table[30], NULL },
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700331 { NULL },
332 },
Marc Koschewski11570202006-01-09 18:21:36 -0200333 { NULL },
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700334#endif
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700335 }
336};
337
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300338static struct dvb_usb_device_properties dibusb2_0b_properties = {
339 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
Patrick Boettcherc251ef62005-07-07 17:58:14 -0700340
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700341 .usb_ctrl = CYPRESS_FX2,
342
Patrick Boettcher8945c8c2005-07-07 17:58:07 -0700343 .firmware = "dvb-usb-adstech-usb2-02.fw",
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700344
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300345 .num_adapters = 1,
346 .adapter = {
347 {
Michael Krufky77eed212011-09-06 09:31:57 -0300348 .num_frontends = 1,
349 .fe = {{
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300350 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
351 .pid_filter_count = 16,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700352
Patrick Boettcher01451e72006-10-13 11:34:46 -0300353 .streaming_ctrl = dibusb2_0_streaming_ctrl,
354 .pid_filter = dibusb_pid_filter,
355 .pid_filter_ctrl = dibusb_pid_filter_ctrl,
356 .frontend_attach = dibusb_dib3000mb_frontend_attach,
357 .tuner_attach = dibusb_thomson_tuner_attach,
358
359 /* parameter for the MPEG2-data transfer */
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300360 .stream = {
361 .type = USB_BULK,
Patrick Boettcher01451e72006-10-13 11:34:46 -0300362 .count = 7,
363 .endpoint = 0x06,
364 .u = {
365 .bulk = {
366 .buffersize = 4096,
367 }
368 }
369 },
Michael Krufky77eed212011-09-06 09:31:57 -0300370 }},
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300371 .size_of_priv = sizeof(struct dibusb_state),
372 }
373 },
374 .power_ctrl = dibusb2_0_power_ctrl,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700375
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -0300376 .rc.legacy = {
377 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -0300378 .rc_map_table = rc_map_dibusb_table,
379 .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 -0300380 .rc_query = dibusb_rc_query,
381 },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700382
383 .i2c_algo = &dibusb_i2c_algo,
384
385 .generic_bulk_ctrl_endpoint = 0x01,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700386
Patrick Boettchere69339d2005-09-09 13:02:42 -0700387 .num_device_descs = 2,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700388 .devices = {
Patrick Boettchere69339d2005-09-09 13:02:42 -0700389 { "KWorld/ADSTech Instant DVB-T USB2.0",
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700390 { &dibusb_dib3000mb_table[23], NULL },
Patrick Boettcher8945c8c2005-07-07 17:58:07 -0700391 { &dibusb_dib3000mb_table[24], NULL },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700392 },
Patrick Boettchere69339d2005-09-09 13:02:42 -0700393 { "KWorld Xpert DVB-T USB2.0",
394 { &dibusb_dib3000mb_table[27], NULL },
395 { NULL }
396 },
Marc Koschewski11570202006-01-09 18:21:36 -0200397 { NULL },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700398 }
399};
400
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300401static struct dvb_usb_device_properties artec_t1_usb2_properties = {
402 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800403
404 .usb_ctrl = CYPRESS_FX2,
405
406 .firmware = "dvb-usb-dibusb-6.0.0.8.fw",
407
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300408 .num_adapters = 1,
409 .adapter = {
410 {
Michael Krufky77eed212011-09-06 09:31:57 -0300411 .num_frontends = 1,
412 .fe = {{
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300413 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
414 .pid_filter_count = 16,
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800415
Patrick Boettcher01451e72006-10-13 11:34:46 -0300416 .streaming_ctrl = dibusb2_0_streaming_ctrl,
417 .pid_filter = dibusb_pid_filter,
418 .pid_filter_ctrl = dibusb_pid_filter_ctrl,
419 .frontend_attach = dibusb_dib3000mb_frontend_attach,
420 .tuner_attach = dibusb_tuner_probe_and_attach,
421 /* parameter for the MPEG2-data transfer */
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300422 .stream = {
423 .type = USB_BULK,
Patrick Boettcher01451e72006-10-13 11:34:46 -0300424 .count = 7,
425 .endpoint = 0x06,
426 .u = {
427 .bulk = {
428 .buffersize = 4096,
429 }
430 }
431 },
Michael Krufky77eed212011-09-06 09:31:57 -0300432 }},
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300433 .size_of_priv = sizeof(struct dibusb_state),
434 }
435 },
436 .power_ctrl = dibusb2_0_power_ctrl,
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800437
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -0300438 .rc.legacy = {
439 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -0300440 .rc_map_table = rc_map_dibusb_table,
441 .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 -0300442 .rc_query = dibusb_rc_query,
443 },
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800444
445 .i2c_algo = &dibusb_i2c_algo,
446
447 .generic_bulk_ctrl_endpoint = 0x01,
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800448
449 .num_device_descs = 1,
450 .devices = {
451 { "Artec T1 USB2.0",
452 { &dibusb_dib3000mb_table[28], NULL },
453 { &dibusb_dib3000mb_table[29], NULL },
454 },
Marc Koschewski11570202006-01-09 18:21:36 -0200455 { NULL },
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800456 }
457};
458
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700459static struct usb_driver dibusb_driver = {
Patrick Boettcher63b5c1c2005-07-07 17:58:30 -0700460 .name = "dvb_usb_dibusb_mb",
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700461 .probe = dibusb_probe,
462 .disconnect = dvb_usb_device_exit,
463 .id_table = dibusb_dib3000mb_table,
464};
465
Greg Kroah-Hartmanecb3b2b2011-11-18 09:46:12 -0800466module_usb_driver(dibusb_driver);
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700467
468MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
469MODULE_DESCRIPTION("Driver for DiBcom USB DVB-T devices (DiB3000M-B based)");
470MODULE_VERSION("1.0");
471MODULE_LICENSE("GPL");