1 /* DVB USB compliant linux driver for Conexant USB reference design.
3 * The Conexant reference design I saw on their website was only for analogue
4 * capturing (using the cx25842). The box I took to write this driver (reverse
5 * engineered) is the one labeled Medion MD95700. In addition to the cx25842
6 * for analogue capturing it also has a cx22702 DVB-T demodulator on the main
7 * board. Besides it has a atiremote (X10) and a USB2.0 hub onboard.
9 * Maybe it is a little bit premature to call this driver cxusb, but I assume
10 * the USB protocol is identical or at least inherited from the reference
11 * design, so it can be reused for the "analogue-only" device (if it will
14 * TODO: Use the cx25840-driver for the analogue part
16 * Copyright (C) 2005 Patrick Boettcher (patrick.boettcher@desy.de)
17 * Copyright (C) 2006 Michael Krufky (mkrufky@linuxtv.org)
18 * Copyright (C) 2006, 2007 Chris Pascoe (c.pascoe@itee.uq.edu.au)
20 * This program is free software; you can redistribute it and/or modify it
21 * under the terms of the GNU General Public License as published by the Free
22 * Software Foundation, version 2.
24 * see Documentation/dvb/README.dvb-usb for more information
31 #include "mt352_priv.h"
33 #include "tuner-xc2028.h"
34 #include "tuner-xc2028-types.h"
37 static int dvb_usb_cxusb_debug;
38 module_param_named(debug, dvb_usb_cxusb_debug, int, 0644);
39 MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
40 #define deb_info(args...) dprintk(dvb_usb_cxusb_debug,0x01,args)
41 #define deb_i2c(args...) if (d->udev->descriptor.idVendor == USB_VID_MEDION) \
42 dprintk(dvb_usb_cxusb_debug,0x01,args)
44 static int cxusb_ctrl_msg(struct dvb_usb_device *d,
45 u8 cmd, u8 *wbuf, int wlen, u8 *rbuf, int rlen)
47 int wo = (rbuf == NULL || rlen == 0); /* write-only */
49 memset(sndbuf, 0, 1+wlen);
52 memcpy(&sndbuf[1], wbuf, wlen);
54 return dvb_usb_generic_write(d, sndbuf, 1+wlen);
56 return dvb_usb_generic_rw(d, sndbuf, 1+wlen, rbuf, rlen, 0);
60 static void cxusb_gpio_tuner(struct dvb_usb_device *d, int onoff)
62 struct cxusb_state *st = d->priv;
65 if (st->gpio_write_state[GPIO_TUNER] == onoff)
70 cxusb_ctrl_msg(d, CMD_GPIO_WRITE, o, 2, &i, 1);
73 deb_info("gpio_write failed.\n");
75 st->gpio_write_state[GPIO_TUNER] = onoff;
78 static int cxusb_bluebird_gpio_rw(struct dvb_usb_device *d, u8 changemask,
84 o[0] = 0xff & ~changemask; /* mask of bits to keep */
85 o[1] = newval & changemask; /* new values for bits */
87 rc = cxusb_ctrl_msg(d, CMD_BLUEBIRD_GPIO_RW, o, 2, &gpio_state, 1);
88 if (rc < 0 || (gpio_state & changemask) != (newval & changemask))
89 deb_info("bluebird_gpio_write failed.\n");
91 return rc < 0 ? rc : gpio_state;
94 static void cxusb_bluebird_gpio_pulse(struct dvb_usb_device *d, u8 pin, int low)
96 cxusb_bluebird_gpio_rw(d, pin, low ? 0 : pin);
98 cxusb_bluebird_gpio_rw(d, pin, low ? pin : 0);
102 static int cxusb_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
105 struct dvb_usb_device *d = i2c_get_adapdata(adap);
108 if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
111 for (i = 0; i < num; i++) {
113 if (d->udev->descriptor.idVendor == USB_VID_MEDION)
114 switch (msg[i].addr) {
116 cxusb_gpio_tuner(d, 0);
119 cxusb_gpio_tuner(d, 1);
123 if (msg[i].flags & I2C_M_RD) {
125 u8 obuf[3], ibuf[1+msg[i].len];
127 obuf[1] = msg[i].len;
128 obuf[2] = msg[i].addr;
129 if (cxusb_ctrl_msg(d, CMD_I2C_READ,
131 ibuf, 1+msg[i].len) < 0) {
132 warn("i2c read failed");
135 memcpy(msg[i].buf, &ibuf[1], msg[i].len);
136 } else if (i+1 < num && (msg[i+1].flags & I2C_M_RD) &&
137 msg[i].addr == msg[i+1].addr) {
138 /* write to then read from same address */
139 u8 obuf[3+msg[i].len], ibuf[1+msg[i+1].len];
140 obuf[0] = msg[i].len;
141 obuf[1] = msg[i+1].len;
142 obuf[2] = msg[i].addr;
143 memcpy(&obuf[3], msg[i].buf, msg[i].len);
145 if (cxusb_ctrl_msg(d, CMD_I2C_READ,
147 ibuf, 1+msg[i+1].len) < 0)
151 deb_i2c("i2c read may have failed\n");
153 memcpy(msg[i+1].buf, &ibuf[1], msg[i+1].len);
158 u8 obuf[2+msg[i].len], ibuf;
159 obuf[0] = msg[i].addr;
160 obuf[1] = msg[i].len;
161 memcpy(&obuf[2], msg[i].buf, msg[i].len);
163 if (cxusb_ctrl_msg(d, CMD_I2C_WRITE, obuf,
164 2+msg[i].len, &ibuf,1) < 0)
167 deb_i2c("i2c write may have failed\n");
171 mutex_unlock(&d->i2c_mutex);
172 return i == num ? num : -EREMOTEIO;
175 static u32 cxusb_i2c_func(struct i2c_adapter *adapter)
180 static struct i2c_algorithm cxusb_i2c_algo = {
181 .master_xfer = cxusb_i2c_xfer,
182 .functionality = cxusb_i2c_func,
185 static int cxusb_power_ctrl(struct dvb_usb_device *d, int onoff)
189 return cxusb_ctrl_msg(d, CMD_POWER_ON, &b, 1, NULL, 0);
191 return cxusb_ctrl_msg(d, CMD_POWER_OFF, &b, 1, NULL, 0);
194 static int cxusb_bluebird_power_ctrl(struct dvb_usb_device *d, int onoff)
198 return cxusb_ctrl_msg(d, CMD_POWER_ON, &b, 1, NULL, 0);
203 static int cxusb_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
205 u8 buf[2] = { 0x03, 0x00 };
207 cxusb_ctrl_msg(adap->dev, CMD_STREAMING_ON, buf, 2, NULL, 0);
209 cxusb_ctrl_msg(adap->dev, CMD_STREAMING_OFF, NULL, 0, NULL, 0);
214 static int cxusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
216 struct dvb_usb_rc_key *keymap = d->props.rc_key_map;
220 cxusb_ctrl_msg(d, CMD_GET_IR_CODE, NULL, 0, ircode, 4);
223 *state = REMOTE_NO_KEY_PRESSED;
225 for (i = 0; i < d->props.rc_key_map_size; i++) {
226 if (keymap[i].custom == ircode[2] &&
227 keymap[i].data == ircode[3]) {
228 *event = keymap[i].event;
229 *state = REMOTE_KEY_PRESSED;
238 static int cxusb_bluebird2_rc_query(struct dvb_usb_device *d, u32 *event,
241 struct dvb_usb_rc_key *keymap = d->props.rc_key_map;
244 struct i2c_msg msg = { .addr = 0x6b, .flags = I2C_M_RD,
245 .buf = ircode, .len = 4 };
248 *state = REMOTE_NO_KEY_PRESSED;
250 if (cxusb_i2c_xfer(&d->i2c_adap, &msg, 1) != 1)
253 for (i = 0; i < d->props.rc_key_map_size; i++) {
254 if (keymap[i].custom == ircode[1] &&
255 keymap[i].data == ircode[2]) {
256 *event = keymap[i].event;
257 *state = REMOTE_KEY_PRESSED;
266 static struct dvb_usb_rc_key dvico_mce_rc_keys[] = {
267 { 0xfe, 0x02, KEY_TV },
268 { 0xfe, 0x0e, KEY_MP3 },
269 { 0xfe, 0x1a, KEY_DVD },
270 { 0xfe, 0x1e, KEY_FAVORITES },
271 { 0xfe, 0x16, KEY_SETUP },
272 { 0xfe, 0x46, KEY_POWER2 },
273 { 0xfe, 0x0a, KEY_EPG },
274 { 0xfe, 0x49, KEY_BACK },
275 { 0xfe, 0x4d, KEY_MENU },
276 { 0xfe, 0x51, KEY_UP },
277 { 0xfe, 0x5b, KEY_LEFT },
278 { 0xfe, 0x5f, KEY_RIGHT },
279 { 0xfe, 0x53, KEY_DOWN },
280 { 0xfe, 0x5e, KEY_OK },
281 { 0xfe, 0x59, KEY_INFO },
282 { 0xfe, 0x55, KEY_TAB },
283 { 0xfe, 0x0f, KEY_PREVIOUSSONG },/* Replay */
284 { 0xfe, 0x12, KEY_NEXTSONG }, /* Skip */
285 { 0xfe, 0x42, KEY_ENTER }, /* Windows/Start */
286 { 0xfe, 0x15, KEY_VOLUMEUP },
287 { 0xfe, 0x05, KEY_VOLUMEDOWN },
288 { 0xfe, 0x11, KEY_CHANNELUP },
289 { 0xfe, 0x09, KEY_CHANNELDOWN },
290 { 0xfe, 0x52, KEY_CAMERA },
291 { 0xfe, 0x5a, KEY_TUNER }, /* Live */
292 { 0xfe, 0x19, KEY_OPEN },
293 { 0xfe, 0x0b, KEY_1 },
294 { 0xfe, 0x17, KEY_2 },
295 { 0xfe, 0x1b, KEY_3 },
296 { 0xfe, 0x07, KEY_4 },
297 { 0xfe, 0x50, KEY_5 },
298 { 0xfe, 0x54, KEY_6 },
299 { 0xfe, 0x48, KEY_7 },
300 { 0xfe, 0x4c, KEY_8 },
301 { 0xfe, 0x58, KEY_9 },
302 { 0xfe, 0x13, KEY_ANGLE }, /* Aspect */
303 { 0xfe, 0x03, KEY_0 },
304 { 0xfe, 0x1f, KEY_ZOOM },
305 { 0xfe, 0x43, KEY_REWIND },
306 { 0xfe, 0x47, KEY_PLAYPAUSE },
307 { 0xfe, 0x4f, KEY_FASTFORWARD },
308 { 0xfe, 0x57, KEY_MUTE },
309 { 0xfe, 0x0d, KEY_STOP },
310 { 0xfe, 0x01, KEY_RECORD },
311 { 0xfe, 0x4e, KEY_POWER },
314 static struct dvb_usb_rc_key dvico_portable_rc_keys[] = {
315 { 0xfc, 0x02, KEY_SETUP }, /* Profile */
316 { 0xfc, 0x43, KEY_POWER2 },
317 { 0xfc, 0x06, KEY_EPG },
318 { 0xfc, 0x5a, KEY_BACK },
319 { 0xfc, 0x05, KEY_MENU },
320 { 0xfc, 0x47, KEY_INFO },
321 { 0xfc, 0x01, KEY_TAB },
322 { 0xfc, 0x42, KEY_PREVIOUSSONG },/* Replay */
323 { 0xfc, 0x49, KEY_VOLUMEUP },
324 { 0xfc, 0x09, KEY_VOLUMEDOWN },
325 { 0xfc, 0x54, KEY_CHANNELUP },
326 { 0xfc, 0x0b, KEY_CHANNELDOWN },
327 { 0xfc, 0x16, KEY_CAMERA },
328 { 0xfc, 0x40, KEY_TUNER }, /* ATV/DTV */
329 { 0xfc, 0x45, KEY_OPEN },
330 { 0xfc, 0x19, KEY_1 },
331 { 0xfc, 0x18, KEY_2 },
332 { 0xfc, 0x1b, KEY_3 },
333 { 0xfc, 0x1a, KEY_4 },
334 { 0xfc, 0x58, KEY_5 },
335 { 0xfc, 0x59, KEY_6 },
336 { 0xfc, 0x15, KEY_7 },
337 { 0xfc, 0x14, KEY_8 },
338 { 0xfc, 0x17, KEY_9 },
339 { 0xfc, 0x44, KEY_ANGLE }, /* Aspect */
340 { 0xfc, 0x55, KEY_0 },
341 { 0xfc, 0x07, KEY_ZOOM },
342 { 0xfc, 0x0a, KEY_REWIND },
343 { 0xfc, 0x08, KEY_PLAYPAUSE },
344 { 0xfc, 0x4b, KEY_FASTFORWARD },
345 { 0xfc, 0x5b, KEY_MUTE },
346 { 0xfc, 0x04, KEY_STOP },
347 { 0xfc, 0x56, KEY_RECORD },
348 { 0xfc, 0x57, KEY_POWER },
349 { 0xfc, 0x41, KEY_UNKNOWN }, /* INPUT */
350 { 0xfc, 0x00, KEY_UNKNOWN }, /* HD */
353 static int cxusb_dee1601_demod_init(struct dvb_frontend* fe)
355 static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x28 };
356 static u8 reset [] = { RESET, 0x80 };
357 static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 };
358 static u8 agc_cfg [] = { AGC_TARGET, 0x28, 0x20 };
359 static u8 gpp_ctl_cfg [] = { GPP_CTL, 0x33 };
360 static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 };
362 mt352_write(fe, clock_config, sizeof(clock_config));
364 mt352_write(fe, reset, sizeof(reset));
365 mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
367 mt352_write(fe, agc_cfg, sizeof(agc_cfg));
368 mt352_write(fe, gpp_ctl_cfg, sizeof(gpp_ctl_cfg));
369 mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
374 static int cxusb_mt352_demod_init(struct dvb_frontend* fe)
375 { /* used in both lgz201 and th7579 */
376 static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x29 };
377 static u8 reset [] = { RESET, 0x80 };
378 static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 };
379 static u8 agc_cfg [] = { AGC_TARGET, 0x24, 0x20 };
380 static u8 gpp_ctl_cfg [] = { GPP_CTL, 0x33 };
381 static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 };
383 mt352_write(fe, clock_config, sizeof(clock_config));
385 mt352_write(fe, reset, sizeof(reset));
386 mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
388 mt352_write(fe, agc_cfg, sizeof(agc_cfg));
389 mt352_write(fe, gpp_ctl_cfg, sizeof(gpp_ctl_cfg));
390 mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
394 static struct cx22702_config cxusb_cx22702_config = {
395 .demod_address = 0x63,
396 .output_mode = CX22702_PARALLEL_OUTPUT,
399 static struct lgdt330x_config cxusb_lgdt3303_config = {
400 .demod_address = 0x0e,
401 .demod_chip = LGDT3303,
404 static struct mt352_config cxusb_dee1601_config = {
405 .demod_address = 0x0f,
406 .demod_init = cxusb_dee1601_demod_init,
409 static struct zl10353_config cxusb_zl10353_dee1601_config = {
410 .demod_address = 0x0f,
414 static struct mt352_config cxusb_mt352_config = {
415 /* used in both lgz201 and th7579 */
416 .demod_address = 0x0f,
417 .demod_init = cxusb_mt352_demod_init,
420 static struct zl10353_config cxusb_zl10353_xc3028_config = {
421 .demod_address = 0x0f,
427 /* Callbacks for DVB USB */
428 static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap)
430 dvb_attach(dvb_pll_attach, adap->fe, 0x61, &adap->dev->i2c_adap,
435 static int cxusb_dee1601_tuner_attach(struct dvb_usb_adapter *adap)
437 dvb_attach(dvb_pll_attach, adap->fe, 0x61,
438 NULL, DVB_PLL_THOMSON_DTT7579);
442 static int cxusb_lgz201_tuner_attach(struct dvb_usb_adapter *adap)
444 dvb_attach(dvb_pll_attach, adap->fe, 0x61, NULL, DVB_PLL_LG_Z201);
448 static int cxusb_dtt7579_tuner_attach(struct dvb_usb_adapter *adap)
450 dvb_attach(dvb_pll_attach, adap->fe, 0x60,
451 NULL, DVB_PLL_THOMSON_DTT7579);
455 static int cxusb_lgh064f_tuner_attach(struct dvb_usb_adapter *adap)
457 dvb_attach(dvb_pll_attach, adap->fe, 0x61, &adap->dev->i2c_adap,
458 DVB_PLL_LG_TDVS_H06XF);
462 static int dvico_bluebird_xc2028_callback(void *ptr, int command, int arg)
464 struct dvb_usb_device *d = ptr;
467 case XC2028_TUNER_RESET:
468 deb_info("%s: XC2028_TUNER_RESET %d\n", __FUNCTION__, arg);
469 cxusb_bluebird_gpio_pulse(d, 0x01, 1);
471 case XC2028_RESET_CLK:
472 deb_info("%s: XC2028_RESET_CLK %d\n", __FUNCTION__, arg);
475 deb_info("%s: unknown command %d, arg %d\n", __FUNCTION__,
483 static int cxusb_dvico_xc3028_tuner_attach(struct dvb_usb_adapter *adap)
485 struct dvb_frontend *fe;
486 struct xc2028_config cfg = {
487 .i2c_adap = &adap->dev->i2c_adap,
489 .video_dev = adap->dev,
490 .callback = dvico_bluebird_xc2028_callback,
492 static struct xc2028_ctrl ctl = {
493 .type = XC2028_FIRM_NORMAL,
494 .fname = "xc3028-dvico-au-01.fw",
496 .scode_table = ZARLINK456,
499 fe = dvb_attach(xc2028_attach, adap->fe, &cfg);
500 if (fe == NULL || fe->ops.tuner_ops.set_config == NULL)
503 fe->ops.tuner_ops.set_config(fe, &ctl);
508 static int cxusb_cx22702_frontend_attach(struct dvb_usb_adapter *adap)
511 if (usb_set_interface(adap->dev->udev, 0, 6) < 0)
512 err("set interface failed");
514 cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, &b, 1);
516 if ((adap->fe = dvb_attach(cx22702_attach, &cxusb_cx22702_config,
517 &adap->dev->i2c_adap)) != NULL)
523 static int cxusb_lgdt3303_frontend_attach(struct dvb_usb_adapter *adap)
525 if (usb_set_interface(adap->dev->udev, 0, 7) < 0)
526 err("set interface failed");
528 cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0);
530 if ((adap->fe = dvb_attach(lgdt330x_attach, &cxusb_lgdt3303_config,
531 &adap->dev->i2c_adap)) != NULL)
537 static int cxusb_mt352_frontend_attach(struct dvb_usb_adapter *adap)
539 /* used in both lgz201 and th7579 */
540 if (usb_set_interface(adap->dev->udev, 0, 0) < 0)
541 err("set interface failed");
543 cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0);
545 if ((adap->fe = dvb_attach(mt352_attach, &cxusb_mt352_config,
546 &adap->dev->i2c_adap)) != NULL)
552 static int cxusb_dee1601_frontend_attach(struct dvb_usb_adapter *adap)
554 if (usb_set_interface(adap->dev->udev, 0, 0) < 0)
555 err("set interface failed");
557 cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0);
559 if (((adap->fe = dvb_attach(mt352_attach, &cxusb_dee1601_config,
560 &adap->dev->i2c_adap)) != NULL) ||
561 ((adap->fe = dvb_attach(zl10353_attach,
562 &cxusb_zl10353_dee1601_config,
563 &adap->dev->i2c_adap)) != NULL))
569 static int cxusb_dualdig4_frontend_attach(struct dvb_usb_adapter *adap)
573 struct i2c_msg msg = { .addr = 0x6b, .flags = I2C_M_RD,
574 .buf = ircode, .len = 4 };
576 if (usb_set_interface(adap->dev->udev, 0, 1) < 0)
577 err("set interface failed");
579 cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0);
581 /* reset the tuner and demodulator */
582 cxusb_bluebird_gpio_rw(adap->dev, 0x04, 0);
583 cxusb_bluebird_gpio_pulse(adap->dev, 0x01, 1);
584 cxusb_bluebird_gpio_pulse(adap->dev, 0x02, 1);
586 if ((adap->fe = dvb_attach(zl10353_attach,
587 &cxusb_zl10353_xc3028_config,
588 &adap->dev->i2c_adap)) == NULL)
591 /* try to determine if there is no IR decoder on the I2C bus */
592 for (i = 0; adap->dev->props.rc_key_map != NULL && i < 5; i++) {
594 if (cxusb_i2c_xfer(&adap->dev->i2c_adap, &msg, 1) != 1)
596 if (ircode[0] == 0 && ircode[1] == 0)
598 if (ircode[2] + ircode[3] != 0xff) {
600 adap->dev->props.rc_key_map = NULL;
601 info("No IR receiver detected on this device.");
610 * DViCO bluebird firmware needs the "warm" product ID to be patched into the
611 * firmware file before download.
614 #define BLUEBIRD_01_ID_OFFSET 6638
615 static int bluebird_patch_dvico_firmware_download(struct usb_device *udev,
616 const struct firmware *fw)
618 if (fw->size < BLUEBIRD_01_ID_OFFSET + 4)
621 if (fw->data[BLUEBIRD_01_ID_OFFSET] == (USB_VID_DVICO & 0xff) &&
622 fw->data[BLUEBIRD_01_ID_OFFSET + 1] == USB_VID_DVICO >> 8) {
624 fw->data[BLUEBIRD_01_ID_OFFSET + 2] =
625 le16_to_cpu(udev->descriptor.idProduct) + 1;
626 fw->data[BLUEBIRD_01_ID_OFFSET + 3] =
627 le16_to_cpu(udev->descriptor.idProduct) >> 8;
629 return usb_cypress_load_firmware(udev, fw, CYPRESS_FX2);
635 /* DVB USB Driver stuff */
636 static struct dvb_usb_device_properties cxusb_medion_properties;
637 static struct dvb_usb_device_properties cxusb_bluebird_lgh064f_properties;
638 static struct dvb_usb_device_properties cxusb_bluebird_dee1601_properties;
639 static struct dvb_usb_device_properties cxusb_bluebird_lgz201_properties;
640 static struct dvb_usb_device_properties cxusb_bluebird_dtt7579_properties;
641 static struct dvb_usb_device_properties cxusb_bluebird_dualdig4_properties;
643 static int cxusb_probe(struct usb_interface *intf,
644 const struct usb_device_id *id)
646 if (dvb_usb_device_init(intf,&cxusb_medion_properties,THIS_MODULE,NULL) == 0 ||
647 dvb_usb_device_init(intf,&cxusb_bluebird_lgh064f_properties,THIS_MODULE,NULL) == 0 ||
648 dvb_usb_device_init(intf,&cxusb_bluebird_dee1601_properties,THIS_MODULE,NULL) == 0 ||
649 dvb_usb_device_init(intf,&cxusb_bluebird_lgz201_properties,THIS_MODULE,NULL) == 0 ||
650 dvb_usb_device_init(intf,&cxusb_bluebird_dtt7579_properties,THIS_MODULE,NULL) == 0 ||
651 dvb_usb_device_init(intf,&cxusb_bluebird_dualdig4_properties,THIS_MODULE,NULL) == 0) {
658 static struct usb_device_id cxusb_table [] = {
659 { USB_DEVICE(USB_VID_MEDION, USB_PID_MEDION_MD95700) },
660 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_COLD) },
661 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_WARM) },
662 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_1_COLD) },
663 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_1_WARM) },
664 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LGZ201_COLD) },
665 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LGZ201_WARM) },
666 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_TH7579_COLD) },
667 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_TH7579_WARM) },
668 { USB_DEVICE(USB_VID_DVICO, USB_PID_DIGITALNOW_BLUEBIRD_DUAL_1_COLD) },
669 { USB_DEVICE(USB_VID_DVICO, USB_PID_DIGITALNOW_BLUEBIRD_DUAL_1_WARM) },
670 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_2_COLD) },
671 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_2_WARM) },
672 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_4) },
673 {} /* Terminating entry */
675 MODULE_DEVICE_TABLE (usb, cxusb_table);
677 static struct dvb_usb_device_properties cxusb_medion_properties = {
678 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
680 .usb_ctrl = CYPRESS_FX2,
682 .size_of_priv = sizeof(struct cxusb_state),
687 .streaming_ctrl = cxusb_streaming_ctrl,
688 .frontend_attach = cxusb_cx22702_frontend_attach,
689 .tuner_attach = cxusb_fmd1216me_tuner_attach,
690 /* parameter for the MPEG2-data transfer */
704 .power_ctrl = cxusb_power_ctrl,
706 .i2c_algo = &cxusb_i2c_algo,
708 .generic_bulk_ctrl_endpoint = 0x01,
710 .num_device_descs = 1,
712 { "Medion MD95700 (MDUSBTV-HYBRID)",
714 { &cxusb_table[0], NULL },
719 static struct dvb_usb_device_properties cxusb_bluebird_lgh064f_properties = {
720 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
722 .usb_ctrl = DEVICE_SPECIFIC,
723 .firmware = "dvb-usb-bluebird-01.fw",
724 .download_firmware = bluebird_patch_dvico_firmware_download,
725 /* use usb alt setting 0 for EP4 transfer (dvb-t),
726 use usb alt setting 7 for EP2 transfer (atsc) */
728 .size_of_priv = sizeof(struct cxusb_state),
733 .streaming_ctrl = cxusb_streaming_ctrl,
734 .frontend_attach = cxusb_lgdt3303_frontend_attach,
735 .tuner_attach = cxusb_lgh064f_tuner_attach,
737 /* parameter for the MPEG2-data transfer */
751 .power_ctrl = cxusb_bluebird_power_ctrl,
753 .i2c_algo = &cxusb_i2c_algo,
756 .rc_key_map = dvico_portable_rc_keys,
757 .rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys),
758 .rc_query = cxusb_rc_query,
760 .generic_bulk_ctrl_endpoint = 0x01,
762 .num_device_descs = 1,
764 { "DViCO FusionHDTV5 USB Gold",
765 { &cxusb_table[1], NULL },
766 { &cxusb_table[2], NULL },
771 static struct dvb_usb_device_properties cxusb_bluebird_dee1601_properties = {
772 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
774 .usb_ctrl = DEVICE_SPECIFIC,
775 .firmware = "dvb-usb-bluebird-01.fw",
776 .download_firmware = bluebird_patch_dvico_firmware_download,
777 /* use usb alt setting 0 for EP4 transfer (dvb-t),
778 use usb alt setting 7 for EP2 transfer (atsc) */
780 .size_of_priv = sizeof(struct cxusb_state),
785 .streaming_ctrl = cxusb_streaming_ctrl,
786 .frontend_attach = cxusb_dee1601_frontend_attach,
787 .tuner_attach = cxusb_dee1601_tuner_attach,
788 /* parameter for the MPEG2-data transfer */
802 .power_ctrl = cxusb_bluebird_power_ctrl,
804 .i2c_algo = &cxusb_i2c_algo,
807 .rc_key_map = dvico_mce_rc_keys,
808 .rc_key_map_size = ARRAY_SIZE(dvico_mce_rc_keys),
809 .rc_query = cxusb_rc_query,
811 .generic_bulk_ctrl_endpoint = 0x01,
813 .num_device_descs = 3,
815 { "DViCO FusionHDTV DVB-T Dual USB",
816 { &cxusb_table[3], NULL },
817 { &cxusb_table[4], NULL },
819 { "DigitalNow DVB-T Dual USB",
820 { &cxusb_table[9], NULL },
821 { &cxusb_table[10], NULL },
823 { "DViCO FusionHDTV DVB-T Dual Digital 2",
824 { &cxusb_table[11], NULL },
825 { &cxusb_table[12], NULL },
830 static struct dvb_usb_device_properties cxusb_bluebird_lgz201_properties = {
831 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
833 .usb_ctrl = DEVICE_SPECIFIC,
834 .firmware = "dvb-usb-bluebird-01.fw",
835 .download_firmware = bluebird_patch_dvico_firmware_download,
836 /* use usb alt setting 0 for EP4 transfer (dvb-t),
837 use usb alt setting 7 for EP2 transfer (atsc) */
839 .size_of_priv = sizeof(struct cxusb_state),
844 .streaming_ctrl = cxusb_streaming_ctrl,
845 .frontend_attach = cxusb_mt352_frontend_attach,
846 .tuner_attach = cxusb_lgz201_tuner_attach,
848 /* parameter for the MPEG2-data transfer */
861 .power_ctrl = cxusb_bluebird_power_ctrl,
863 .i2c_algo = &cxusb_i2c_algo,
866 .rc_key_map = dvico_portable_rc_keys,
867 .rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys),
868 .rc_query = cxusb_rc_query,
870 .generic_bulk_ctrl_endpoint = 0x01,
871 .num_device_descs = 1,
873 { "DViCO FusionHDTV DVB-T USB (LGZ201)",
874 { &cxusb_table[5], NULL },
875 { &cxusb_table[6], NULL },
880 static struct dvb_usb_device_properties cxusb_bluebird_dtt7579_properties = {
881 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
883 .usb_ctrl = DEVICE_SPECIFIC,
884 .firmware = "dvb-usb-bluebird-01.fw",
885 .download_firmware = bluebird_patch_dvico_firmware_download,
886 /* use usb alt setting 0 for EP4 transfer (dvb-t),
887 use usb alt setting 7 for EP2 transfer (atsc) */
889 .size_of_priv = sizeof(struct cxusb_state),
894 .streaming_ctrl = cxusb_streaming_ctrl,
895 .frontend_attach = cxusb_mt352_frontend_attach,
896 .tuner_attach = cxusb_dtt7579_tuner_attach,
898 /* parameter for the MPEG2-data transfer */
911 .power_ctrl = cxusb_bluebird_power_ctrl,
913 .i2c_algo = &cxusb_i2c_algo,
916 .rc_key_map = dvico_portable_rc_keys,
917 .rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys),
918 .rc_query = cxusb_rc_query,
920 .generic_bulk_ctrl_endpoint = 0x01,
922 .num_device_descs = 1,
924 { "DViCO FusionHDTV DVB-T USB (TH7579)",
925 { &cxusb_table[7], NULL },
926 { &cxusb_table[8], NULL },
931 static struct dvb_usb_device_properties cxusb_bluebird_dualdig4_properties = {
932 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
934 .usb_ctrl = CYPRESS_FX2,
936 .size_of_priv = sizeof(struct cxusb_state),
941 .streaming_ctrl = cxusb_streaming_ctrl,
942 .frontend_attach = cxusb_dualdig4_frontend_attach,
943 .tuner_attach = cxusb_dvico_xc3028_tuner_attach,
944 /* parameter for the MPEG2-data transfer */
958 .power_ctrl = cxusb_power_ctrl,
960 .i2c_algo = &cxusb_i2c_algo,
962 .generic_bulk_ctrl_endpoint = 0x01,
965 .rc_key_map = dvico_mce_rc_keys,
966 .rc_key_map_size = ARRAY_SIZE(dvico_mce_rc_keys),
967 .rc_query = cxusb_bluebird2_rc_query,
969 .num_device_descs = 1,
971 { "DViCO FusionHDTV DVB-T Dual Digital 4",
973 { &cxusb_table[13], NULL },
978 static struct usb_driver cxusb_driver = {
979 .name = "dvb_usb_cxusb",
980 .probe = cxusb_probe,
981 .disconnect = dvb_usb_device_exit,
982 .id_table = cxusb_table,
986 static int __init cxusb_module_init(void)
989 if ((result = usb_register(&cxusb_driver))) {
990 err("usb_register failed. Error number %d",result);
997 static void __exit cxusb_module_exit(void)
999 /* deregister this driver from the USB subsystem */
1000 usb_deregister(&cxusb_driver);
1003 module_init (cxusb_module_init);
1004 module_exit (cxusb_module_exit);
1006 MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
1007 MODULE_AUTHOR("Michael Krufky <mkrufky@linuxtv.org>");
1008 MODULE_AUTHOR("Chris Pascoe <c.pascoe@itee.uq.edu.au>");
1009 MODULE_DESCRIPTION("Driver for Conexant USB2.0 hybrid reference design");
1010 MODULE_VERSION("1.0-alpha");
1011 MODULE_LICENSE("GPL");