blob: e9dc27f7397032fd017dc3564257fee3762717ac [file] [log] [blame]
Thomas Gleixnerfc7669c2019-06-04 10:11:01 +02001// SPDX-License-Identifier: GPL-2.0-only
Johannes Stezenbach776338e2005-06-23 22:02:35 -07002/* DVB USB compliant linux driver for mobile DVB-T USB devices based on
3 * reference designs made by DiBcom (http://www.dibcom.fr/) (DiB3000M-B)
4 *
Patrick Boettcher99e44da2016-01-24 12:56:58 -02005 * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@posteo.de)
Johannes Stezenbach776338e2005-06-23 22:02:35 -07006 *
7 * based on GPL code from DiBcom, which has
Patrick Boettcher99e44da2016-01-24 12:56:58 -02008 * Copyright (C) 2004 Amaury Demol for DiBcom
Johannes Stezenbach776338e2005-06-23 22:02:35 -07009 *
Mauro Carvalho Chehab577a7ad2020-03-04 15:54:10 +010010 * see Documentation/driver-api/media/drivers/dvb-usb.rst for more information
Johannes Stezenbach776338e2005-06-23 22:02:35 -070011 */
12#include "dibusb.h"
13
Janne Grunau78e920062008-04-09 19:13:13 -030014DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
15
Michael Krufky6c08d9292007-06-12 12:43:25 -030016static int dib3000mb_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
17{
18 struct dvb_usb_adapter *adap = fe->dvb->priv;
19 struct dibusb_state *st = adap->priv;
20
21 return st->ops.tuner_pass_ctrl(fe, enable, st->tuner_addr);
22}
23
Patrick Boettcher4d43e132006-09-30 06:53:48 -030024static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_adapter *adap)
Johannes Stezenbach776338e2005-06-23 22:02:35 -070025{
26 struct dib3000_config demod_cfg;
Patrick Boettcher4d43e132006-09-30 06:53:48 -030027 struct dibusb_state *st = adap->priv;
Johannes Stezenbach776338e2005-06-23 22:02:35 -070028
29 demod_cfg.demod_address = 0x8;
Johannes Stezenbach776338e2005-06-23 22:02:35 -070030
Michael Krufkyd4dd5ce2011-09-17 14:38:50 -030031 adap->fe_adap[0].fe = dvb_attach(dib3000mb_attach, &demod_cfg,
32 &adap->dev->i2c_adap, &st->ops);
33 if ((adap->fe_adap[0].fe) == NULL)
Johannes Stezenbach776338e2005-06-23 22:02:35 -070034 return -ENODEV;
Adrian Bunk56760f02006-08-15 11:38:40 -030035
Michael Krufky77eed212011-09-06 09:31:57 -030036 adap->fe_adap[0].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 Krufky77eed212011-09-06 09:31:57 -030047 dvb_attach(dvb_pll_attach, adap->fe_adap[0].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 Krufky77eed212011-09-06 09:31:57 -030058 dvb_attach(dvb_pll_attach, adap->fe_adap[0].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 Krufky77eed212011-09-06 09:31:57 -030079 if (adap->fe_adap[0].fe->ops.i2c_gate_ctrl)
Michael Krufky45943032011-09-16 09:35:06 -030080 adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].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.");
Colin Ian King96f3a932020-02-10 18:51:33 +010084 return -EREMOTEIO;
Johannes Stezenbach776338e2005-06-23 22:02:35 -070085 }
86
Michael Krufky77eed212011-09-06 09:31:57 -030087 if (adap->fe_adap[0].fe->ops.i2c_gate_ctrl)
Michael Krufky45943032011-09-16 09:35:06 -030088 adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].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{
Janne Grunau78e920062008-04-09 19:13:13 -0300110 if (0 == dvb_usb_device_init(intf, &dibusb1_1_properties,
111 THIS_MODULE, NULL, adapter_nr) ||
112 0 == dvb_usb_device_init(intf, &dibusb1_1_an2235_properties,
113 THIS_MODULE, NULL, adapter_nr) ||
114 0 == dvb_usb_device_init(intf, &dibusb2_0b_properties,
115 THIS_MODULE, NULL, adapter_nr) ||
116 0 == dvb_usb_device_init(intf, &artec_t1_usb2_properties,
117 THIS_MODULE, NULL, adapter_nr))
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700118 return 0;
119
120 return -EINVAL;
121}
122
123/* do not change the order of the ID table */
124static struct usb_device_id dibusb_dib3000mb_table [] = {
Marc Koschewski11570202006-01-09 18:21:36 -0200125/* 00 */ { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_AVERMEDIA_DVBT_USB_COLD) },
126/* 01 */ { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_AVERMEDIA_DVBT_USB_WARM) },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700127/* 02 */ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_DVBU2000_COLD) },
128/* 03 */ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_DVBU2000_WARM) },
129/* 04 */ { USB_DEVICE(USB_VID_COMPRO_UNK, USB_PID_COMPRO_DVBU2000_UNK_COLD) },
130/* 05 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3000_COLD) },
131/* 06 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3000_WARM) },
Marc Koschewski11570202006-01-09 18:21:36 -0200132/* 07 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_KWORLD_VSTREAM_COLD) },
133/* 08 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_KWORLD_VSTREAM_WARM) },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700134/* 09 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB_COLD) },
135/* 10 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB_WARM) },
136/* 11 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_DIBCOM_MOD3000_COLD) },
137/* 12 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_DIBCOM_MOD3000_WARM) },
138/* 13 */ { USB_DEVICE(USB_VID_HYPER_PALTEK, USB_PID_UNK_HYPER_PALTEK_COLD) },
139/* 14 */ { USB_DEVICE(USB_VID_HYPER_PALTEK, USB_PID_UNK_HYPER_PALTEK_WARM) },
140/* 15 */ { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_TWINHAN_VP7041_COLD) },
141/* 16 */ { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_TWINHAN_VP7041_WARM) },
142/* 17 */ { USB_DEVICE(USB_VID_TWINHAN, USB_PID_TWINHAN_VP7041_COLD) },
143/* 18 */ { USB_DEVICE(USB_VID_TWINHAN, USB_PID_TWINHAN_VP7041_WARM) },
Marc Koschewski11570202006-01-09 18:21:36 -0200144/* 19 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_COLD) },
145/* 20 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_WARM) },
146/* 21 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_AN2235_COLD) },
147/* 22 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_AN2235_WARM) },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700148/* 23 */ { USB_DEVICE(USB_VID_ADSTECH, USB_PID_ADSTECH_USB2_COLD) },
Patrick Boettcher8945c8c2005-07-07 17:58:07 -0700149
150/* device ID with default DIBUSB2_0-firmware and with the hacked firmware */
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700151/* 24 */ { USB_DEVICE(USB_VID_ADSTECH, USB_PID_ADSTECH_USB2_WARM) },
Marc Koschewski11570202006-01-09 18:21:36 -0200152/* 25 */ { USB_DEVICE(USB_VID_KYE, USB_PID_KYE_DVB_T_COLD) },
153/* 26 */ { USB_DEVICE(USB_VID_KYE, USB_PID_KYE_DVB_T_WARM) },
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700154
Patrick Boettchere69339d2005-09-09 13:02:42 -0700155/* 27 */ { USB_DEVICE(USB_VID_KWORLD, USB_PID_KWORLD_VSTREAM_COLD) },
156
Marc Koschewski11570202006-01-09 18:21:36 -0200157/* 28 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_COLD) },
158/* 29 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_WARM) },
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800159
Marc Koschewski11570202006-01-09 18:21:36 -0200160/*
161 * XXX: As Artec just 'forgot' to program the EEPROM on some Artec T1 devices
162 * we don't catch these faulty IDs (namely 'Cypress FX1 USB controller') that
163 * have been left on the device. If you don't have such a device but an Artec
164 * device that's supposed to work with this driver but is not detected by it,
165 * free to enable CONFIG_DVB_USB_DIBUSB_MB_FAULTY via your kernel config.
166 */
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700167
Marc Koschewski11570202006-01-09 18:21:36 -0200168#ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800169/* 30 */ { USB_DEVICE(USB_VID_ANCHOR, USB_PID_ULTIMA_TVBOX_ANCHOR_COLD) },
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700170#endif
Marc Koschewski11570202006-01-09 18:21:36 -0200171
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700172 { } /* Terminating entry */
173};
174MODULE_DEVICE_TABLE (usb, dibusb_dib3000mb_table);
175
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300176static struct dvb_usb_device_properties dibusb1_1_properties = {
177 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700178
179 .usb_ctrl = CYPRESS_AN2135,
180
181 .firmware = "dvb-usb-dibusb-5.0.0.11.fw",
182
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300183 .num_adapters = 1,
184 .adapter = {
185 {
Michael Krufky77eed212011-09-06 09:31:57 -0300186 .num_frontends = 1,
187 .fe = {{
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300188 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
189 .pid_filter_count = 16,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700190
Patrick Boettcher01451e72006-10-13 11:34:46 -0300191 .streaming_ctrl = dibusb_streaming_ctrl,
192 .pid_filter = dibusb_pid_filter,
193 .pid_filter_ctrl = dibusb_pid_filter_ctrl,
194 .frontend_attach = dibusb_dib3000mb_frontend_attach,
195 .tuner_attach = dibusb_tuner_probe_and_attach,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700196
Patrick Boettcher01451e72006-10-13 11:34:46 -0300197 /* parameter for the MPEG2-data transfer */
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300198 .stream = {
199 .type = USB_BULK,
Patrick Boettcher01451e72006-10-13 11:34:46 -0300200 .count = 7,
201 .endpoint = 0x02,
202 .u = {
203 .bulk = {
204 .buffersize = 4096,
205 }
206 }
207 },
Michael Krufky77eed212011-09-06 09:31:57 -0300208 }},
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300209 .size_of_priv = sizeof(struct dibusb_state),
210 }
211 },
212
213 .power_ctrl = dibusb_power_ctrl,
214
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -0300215 .rc.legacy = {
216 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -0300217 .rc_map_table = rc_map_dibusb_table,
218 .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 -0300219 .rc_query = dibusb_rc_query,
220 },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700221
222 .i2c_algo = &dibusb_i2c_algo,
223
224 .generic_bulk_ctrl_endpoint = 0x01,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700225
Patrick Boettcher2f7f96b2005-07-07 17:58:16 -0700226 .num_device_descs = 9,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700227 .devices = {
228 { "AVerMedia AverTV DVBT USB1.1",
229 { &dibusb_dib3000mb_table[0], NULL },
230 { &dibusb_dib3000mb_table[1], NULL },
231 },
232 { "Compro Videomate DVB-U2000 - DVB-T USB1.1 (please confirm to linux-dvb)",
233 { &dibusb_dib3000mb_table[2], &dibusb_dib3000mb_table[4], NULL},
234 { &dibusb_dib3000mb_table[3], NULL },
235 },
236 { "DiBcom USB1.1 DVB-T reference design (MOD3000)",
237 { &dibusb_dib3000mb_table[5], NULL },
238 { &dibusb_dib3000mb_table[6], NULL },
239 },
240 { "KWorld V-Stream XPERT DTV - DVB-T USB1.1",
241 { &dibusb_dib3000mb_table[7], NULL },
242 { &dibusb_dib3000mb_table[8], NULL },
243 },
244 { "Grandtec USB1.1 DVB-T",
245 { &dibusb_dib3000mb_table[9], &dibusb_dib3000mb_table[11], NULL },
246 { &dibusb_dib3000mb_table[10], &dibusb_dib3000mb_table[12], NULL },
247 },
André Goddard Rosaaf901ca2009-11-14 13:09:05 -0200248 { "Unknown USB1.1 DVB-T device ???? please report the name to the author",
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700249 { &dibusb_dib3000mb_table[13], NULL },
250 { &dibusb_dib3000mb_table[14], NULL },
251 },
252 { "TwinhanDTV USB-Ter USB1.1 / Magic Box I / HAMA USB1.1 DVB-T device",
253 { &dibusb_dib3000mb_table[15], &dibusb_dib3000mb_table[17], NULL},
254 { &dibusb_dib3000mb_table[16], &dibusb_dib3000mb_table[18], NULL},
255 },
256 { "Artec T1 USB1.1 TVBOX with AN2135",
257 { &dibusb_dib3000mb_table[19], NULL },
258 { &dibusb_dib3000mb_table[20], NULL },
259 },
Patrick Boettcher2f7f96b2005-07-07 17:58:16 -0700260 { "VideoWalker DVB-T USB",
261 { &dibusb_dib3000mb_table[25], NULL },
262 { &dibusb_dib3000mb_table[26], NULL },
263 },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700264 }
265};
266
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300267static struct dvb_usb_device_properties dibusb1_1_an2235_properties = {
268 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700269 .usb_ctrl = CYPRESS_AN2235,
270
271 .firmware = "dvb-usb-dibusb-an2235-01.fw",
272
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300273 .num_adapters = 1,
274 .adapter = {
275 {
Michael Krufky77eed212011-09-06 09:31:57 -0300276 .num_frontends = 1,
277 .fe = {{
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300278 .caps = DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF | DVB_USB_ADAP_HAS_PID_FILTER,
279 .pid_filter_count = 16,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700280
Patrick Boettcher01451e72006-10-13 11:34:46 -0300281 .streaming_ctrl = dibusb_streaming_ctrl,
282 .pid_filter = dibusb_pid_filter,
283 .pid_filter_ctrl = dibusb_pid_filter_ctrl,
284 .frontend_attach = dibusb_dib3000mb_frontend_attach,
285 .tuner_attach = dibusb_tuner_probe_and_attach,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700286
Patrick Boettcher01451e72006-10-13 11:34:46 -0300287 /* parameter for the MPEG2-data transfer */
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300288 .stream = {
289 .type = USB_BULK,
Patrick Boettcher01451e72006-10-13 11:34:46 -0300290 .count = 7,
291 .endpoint = 0x02,
292 .u = {
293 .bulk = {
294 .buffersize = 4096,
295 }
296 }
297 },
Michael Krufky77eed212011-09-06 09:31:57 -0300298 }},
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300299 .size_of_priv = sizeof(struct dibusb_state),
300 },
301 },
302 .power_ctrl = dibusb_power_ctrl,
303
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -0300304 .rc.legacy = {
305 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -0300306 .rc_map_table = rc_map_dibusb_table,
307 .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 -0300308 .rc_query = dibusb_rc_query,
309 },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700310
311 .i2c_algo = &dibusb_i2c_algo,
312
313 .generic_bulk_ctrl_endpoint = 0x01,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700314
Marc Koschewski11570202006-01-09 18:21:36 -0200315#ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700316 .num_device_descs = 2,
317#else
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700318 .num_device_descs = 1,
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700319#endif
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700320 .devices = {
321 { "Artec T1 USB1.1 TVBOX with AN2235",
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700322 { &dibusb_dib3000mb_table[21], NULL },
Alistair Buxton83905b02006-09-10 12:09:22 -0300323 { &dibusb_dib3000mb_table[22], NULL },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700324 },
Marc Koschewski11570202006-01-09 18:21:36 -0200325#ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700326 { "Artec T1 USB1.1 TVBOX with AN2235 (faulty USB IDs)",
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800327 { &dibusb_dib3000mb_table[30], NULL },
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700328 { NULL },
329 },
Marc Koschewski11570202006-01-09 18:21:36 -0200330 { NULL },
Johannes Stezenbach68293dd2005-07-07 17:58:06 -0700331#endif
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700332 }
333};
334
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300335static struct dvb_usb_device_properties dibusb2_0b_properties = {
336 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
Patrick Boettcherc251ef62005-07-07 17:58:14 -0700337
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700338 .usb_ctrl = CYPRESS_FX2,
339
Patrick Boettcher8945c8c2005-07-07 17:58:07 -0700340 .firmware = "dvb-usb-adstech-usb2-02.fw",
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700341
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300342 .num_adapters = 1,
343 .adapter = {
344 {
Michael Krufky77eed212011-09-06 09:31:57 -0300345 .num_frontends = 1,
346 .fe = {{
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300347 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
348 .pid_filter_count = 16,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700349
Patrick Boettcher01451e72006-10-13 11:34:46 -0300350 .streaming_ctrl = dibusb2_0_streaming_ctrl,
351 .pid_filter = dibusb_pid_filter,
352 .pid_filter_ctrl = dibusb_pid_filter_ctrl,
353 .frontend_attach = dibusb_dib3000mb_frontend_attach,
354 .tuner_attach = dibusb_thomson_tuner_attach,
355
356 /* parameter for the MPEG2-data transfer */
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300357 .stream = {
358 .type = USB_BULK,
Patrick Boettcher01451e72006-10-13 11:34:46 -0300359 .count = 7,
360 .endpoint = 0x06,
361 .u = {
362 .bulk = {
363 .buffersize = 4096,
364 }
365 }
366 },
Michael Krufky77eed212011-09-06 09:31:57 -0300367 }},
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300368 .size_of_priv = sizeof(struct dibusb_state),
369 }
370 },
371 .power_ctrl = dibusb2_0_power_ctrl,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700372
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -0300373 .rc.legacy = {
374 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -0300375 .rc_map_table = rc_map_dibusb_table,
376 .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 -0300377 .rc_query = dibusb_rc_query,
378 },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700379
380 .i2c_algo = &dibusb_i2c_algo,
381
382 .generic_bulk_ctrl_endpoint = 0x01,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700383
Patrick Boettchere69339d2005-09-09 13:02:42 -0700384 .num_device_descs = 2,
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700385 .devices = {
Patrick Boettchere69339d2005-09-09 13:02:42 -0700386 { "KWorld/ADSTech Instant DVB-T USB2.0",
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700387 { &dibusb_dib3000mb_table[23], NULL },
Patrick Boettcher8945c8c2005-07-07 17:58:07 -0700388 { &dibusb_dib3000mb_table[24], NULL },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700389 },
Patrick Boettchere69339d2005-09-09 13:02:42 -0700390 { "KWorld Xpert DVB-T USB2.0",
391 { &dibusb_dib3000mb_table[27], NULL },
392 { NULL }
393 },
Marc Koschewski11570202006-01-09 18:21:36 -0200394 { NULL },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700395 }
396};
397
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300398static struct dvb_usb_device_properties artec_t1_usb2_properties = {
399 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800400
401 .usb_ctrl = CYPRESS_FX2,
402
403 .firmware = "dvb-usb-dibusb-6.0.0.8.fw",
404
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300405 .num_adapters = 1,
406 .adapter = {
407 {
Michael Krufky77eed212011-09-06 09:31:57 -0300408 .num_frontends = 1,
409 .fe = {{
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300410 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
411 .pid_filter_count = 16,
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800412
Patrick Boettcher01451e72006-10-13 11:34:46 -0300413 .streaming_ctrl = dibusb2_0_streaming_ctrl,
414 .pid_filter = dibusb_pid_filter,
415 .pid_filter_ctrl = dibusb_pid_filter_ctrl,
416 .frontend_attach = dibusb_dib3000mb_frontend_attach,
417 .tuner_attach = dibusb_tuner_probe_and_attach,
418 /* parameter for the MPEG2-data transfer */
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300419 .stream = {
420 .type = USB_BULK,
Patrick Boettcher01451e72006-10-13 11:34:46 -0300421 .count = 7,
422 .endpoint = 0x06,
423 .u = {
424 .bulk = {
425 .buffersize = 4096,
426 }
427 }
428 },
Michael Krufky77eed212011-09-06 09:31:57 -0300429 }},
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300430 .size_of_priv = sizeof(struct dibusb_state),
431 }
432 },
433 .power_ctrl = dibusb2_0_power_ctrl,
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800434
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -0300435 .rc.legacy = {
436 .rc_interval = DEFAULT_RC_INTERVAL,
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -0300437 .rc_map_table = rc_map_dibusb_table,
438 .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 -0300439 .rc_query = dibusb_rc_query,
440 },
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800441
442 .i2c_algo = &dibusb_i2c_algo,
443
444 .generic_bulk_ctrl_endpoint = 0x01,
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800445
446 .num_device_descs = 1,
447 .devices = {
448 { "Artec T1 USB2.0",
449 { &dibusb_dib3000mb_table[28], NULL },
450 { &dibusb_dib3000mb_table[29], NULL },
451 },
Marc Koschewski11570202006-01-09 18:21:36 -0200452 { NULL },
Patrick Boettcherf6f4b722005-11-08 21:35:52 -0800453 }
454};
455
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700456static struct usb_driver dibusb_driver = {
Patrick Boettcher63b5c1c2005-07-07 17:58:30 -0700457 .name = "dvb_usb_dibusb_mb",
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700458 .probe = dibusb_probe,
459 .disconnect = dvb_usb_device_exit,
460 .id_table = dibusb_dib3000mb_table,
461};
462
Greg Kroah-Hartmanecb3b2b2011-11-18 09:46:12 -0800463module_usb_driver(dibusb_driver);
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700464
Patrick Boettcher99e44da2016-01-24 12:56:58 -0200465MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@posteo.de>");
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700466MODULE_DESCRIPTION("Driver for DiBcom USB DVB-T devices (DiB3000M-B based)");
467MODULE_VERSION("1.0");
468MODULE_LICENSE("GPL");