blob: f65591fb7cec36d720d9717b8503c513cbcd3082 [file] [log] [blame]
Patrick Boettcher22c6d932005-07-07 17:58:10 -07001/* DVB USB compliant linux driver for Conexant USB reference design.
2 *
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.
8 *
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
12 * appear at all).
13 *
Michael Krufky81481e92006-01-09 18:21:38 -020014 * TODO: Use the cx25840-driver for the analogue part
Patrick Boettcher22c6d932005-07-07 17:58:10 -070015 *
Patrick Boettcher22c6d932005-07-07 17:58:10 -070016 * Copyright (C) 2005 Patrick Boettcher (patrick.boettcher@desy.de)
Michael Krufky5b9ed282006-10-15 14:51:08 -030017 * Copyright (C) 2006 Michael Krufky (mkrufky@linuxtv.org)
Chris Pascoeaeb012b2007-11-19 21:57:10 -030018 * Copyright (C) 2006, 2007 Chris Pascoe (c.pascoe@itee.uq.edu.au)
Patrick Boettcher22c6d932005-07-07 17:58:10 -070019 *
Michael Krufkyf35db232006-12-05 14:53:39 -030020 * 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.
Patrick Boettcher22c6d932005-07-07 17:58:10 -070023 *
24 * see Documentation/dvb/README.dvb-usb for more information
25 */
Michael Krufky827855d2008-04-22 14:46:16 -030026#include <media/tuner.h>
David Woodhousee62f89f2008-05-24 00:12:42 +010027#include <linux/vmalloc.h>
Michael Krufky827855d2008-04-22 14:46:16 -030028
Patrick Boettcher22c6d932005-07-07 17:58:10 -070029#include "cxusb.h"
30
31#include "cx22702.h"
Michael Krufkyeffee032006-01-09 15:25:47 -020032#include "lgdt330x.h"
Chris Pascoe0029ee12006-01-09 18:21:28 -020033#include "mt352.h"
34#include "mt352_priv.h"
Michael Krufkyc9ce3942006-06-11 04:24:31 -030035#include "zl10353.h"
Chris Pascoeaeb012b2007-11-19 21:57:10 -030036#include "tuner-xc2028.h"
Michael Krufky827855d2008-04-22 14:46:16 -030037#include "tuner-simple.h"
Daniel Gimpelevichf5376ad2008-06-28 05:01:30 -030038#include "mxl5005s.h"
Anton Blanchard8d798982008-08-09 12:23:15 -030039#include "dib7000p.h"
40#include "dib0070.h"
David T.L. Wong6bf1a992009-08-05 13:07:10 -030041#include "lgs8gxx.h"
Patrick Boettcher22c6d932005-07-07 17:58:10 -070042
43/* debug */
Adrian Bunk53133af2007-11-05 14:07:06 -030044static int dvb_usb_cxusb_debug;
Michael Krufkyf35db232006-12-05 14:53:39 -030045module_param_named(debug, dvb_usb_cxusb_debug, int, 0644);
Patrick Boettcher22c6d932005-07-07 17:58:10 -070046MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
Janne Grunau78e92002008-04-09 19:13:13 -030047
48DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
49
Daniel Gimpelevichf5376ad2008-06-28 05:01:30 -030050#define deb_info(args...) dprintk(dvb_usb_cxusb_debug, 0x03, args)
51#define deb_i2c(args...) dprintk(dvb_usb_cxusb_debug, 0x02, args)
Patrick Boettcher22c6d932005-07-07 17:58:10 -070052
53static int cxusb_ctrl_msg(struct dvb_usb_device *d,
Michael Krufkyf35db232006-12-05 14:53:39 -030054 u8 cmd, u8 *wbuf, int wlen, u8 *rbuf, int rlen)
Patrick Boettcher22c6d932005-07-07 17:58:10 -070055{
56 int wo = (rbuf == NULL || rlen == 0); /* write-only */
57 u8 sndbuf[1+wlen];
Michael Krufkyf35db232006-12-05 14:53:39 -030058 memset(sndbuf, 0, 1+wlen);
Patrick Boettcher22c6d932005-07-07 17:58:10 -070059
60 sndbuf[0] = cmd;
Michael Krufkyf35db232006-12-05 14:53:39 -030061 memcpy(&sndbuf[1], wbuf, wlen);
Patrick Boettcher22c6d932005-07-07 17:58:10 -070062 if (wo)
Chris Pascoeb17f1092007-11-19 02:42:44 -030063 return dvb_usb_generic_write(d, sndbuf, 1+wlen);
Patrick Boettcher22c6d932005-07-07 17:58:10 -070064 else
Chris Pascoeb17f1092007-11-19 02:42:44 -030065 return dvb_usb_generic_rw(d, sndbuf, 1+wlen, rbuf, rlen, 0);
Patrick Boettcher22c6d932005-07-07 17:58:10 -070066}
67
Patrick Boettchere2efeab2005-09-09 13:02:51 -070068/* GPIO */
69static void cxusb_gpio_tuner(struct dvb_usb_device *d, int onoff)
Patrick Boettcher22c6d932005-07-07 17:58:10 -070070{
71 struct cxusb_state *st = d->priv;
Michael Krufkyf35db232006-12-05 14:53:39 -030072 u8 o[2], i;
Patrick Boettcher22c6d932005-07-07 17:58:10 -070073
Patrick Boettchere2efeab2005-09-09 13:02:51 -070074 if (st->gpio_write_state[GPIO_TUNER] == onoff)
Patrick Boettcher22c6d932005-07-07 17:58:10 -070075 return;
76
Patrick Boettchere2efeab2005-09-09 13:02:51 -070077 o[0] = GPIO_TUNER;
78 o[1] = onoff;
Michael Krufkyf35db232006-12-05 14:53:39 -030079 cxusb_ctrl_msg(d, CMD_GPIO_WRITE, o, 2, &i, 1);
Patrick Boettcher22c6d932005-07-07 17:58:10 -070080
81 if (i != 0x01)
Patrick Boettchere2efeab2005-09-09 13:02:51 -070082 deb_info("gpio_write failed.\n");
Patrick Boettcher22c6d932005-07-07 17:58:10 -070083
Patrick Boettchere2efeab2005-09-09 13:02:51 -070084 st->gpio_write_state[GPIO_TUNER] = onoff;
Patrick Boettcher22c6d932005-07-07 17:58:10 -070085}
86
Chris Pascoeaeb012b2007-11-19 21:57:10 -030087static int cxusb_bluebird_gpio_rw(struct dvb_usb_device *d, u8 changemask,
88 u8 newval)
89{
90 u8 o[2], gpio_state;
91 int rc;
92
93 o[0] = 0xff & ~changemask; /* mask of bits to keep */
94 o[1] = newval & changemask; /* new values for bits */
95
96 rc = cxusb_ctrl_msg(d, CMD_BLUEBIRD_GPIO_RW, o, 2, &gpio_state, 1);
97 if (rc < 0 || (gpio_state & changemask) != (newval & changemask))
98 deb_info("bluebird_gpio_write failed.\n");
99
100 return rc < 0 ? rc : gpio_state;
101}
102
103static void cxusb_bluebird_gpio_pulse(struct dvb_usb_device *d, u8 pin, int low)
104{
105 cxusb_bluebird_gpio_rw(d, pin, low ? 0 : pin);
106 msleep(5);
107 cxusb_bluebird_gpio_rw(d, pin, low ? pin : 0);
108}
109
Chris Pascoe5ccaf902007-11-20 01:53:31 -0300110static void cxusb_nano2_led(struct dvb_usb_device *d, int onoff)
111{
112 cxusb_bluebird_gpio_rw(d, 0x40, onoff ? 0 : 0x40);
113}
114
Timothy Leedfbdce02008-08-09 13:36:51 -0300115static int cxusb_d680_dmb_gpio_tuner(struct dvb_usb_device *d,
116 u8 addr, int onoff)
117{
118 u8 o[2] = {addr, onoff};
119 u8 i;
120 int rc;
121
122 rc = cxusb_ctrl_msg(d, CMD_GPIO_WRITE, o, 2, &i, 1);
123
124 if (rc < 0)
125 return rc;
126 if (i == 0x01)
127 return 0;
128 else {
129 deb_info("gpio_write failed.\n");
130 return -EIO;
131 }
132}
133
Patrick Boettchere2efeab2005-09-09 13:02:51 -0700134/* I2C */
Michael Krufkyf35db232006-12-05 14:53:39 -0300135static int cxusb_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
136 int num)
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700137{
138 struct dvb_usb_device *d = i2c_get_adapdata(adap);
139 int i;
140
Ingo Molnar3593cab2006-02-07 06:49:14 -0200141 if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700142 return -EAGAIN;
143
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700144 for (i = 0; i < num; i++) {
145
Michael Krufky5e805ef2006-03-23 00:01:34 -0300146 if (d->udev->descriptor.idVendor == USB_VID_MEDION)
147 switch (msg[i].addr) {
Michael Krufkyf35db232006-12-05 14:53:39 -0300148 case 0x63:
149 cxusb_gpio_tuner(d, 0);
150 break;
151 default:
152 cxusb_gpio_tuner(d, 1);
153 break;
Michael Krufky5e805ef2006-03-23 00:01:34 -0300154 }
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700155
Chris Pascoe272479d72007-11-19 03:01:22 -0300156 if (msg[i].flags & I2C_M_RD) {
157 /* read only */
158 u8 obuf[3], ibuf[1+msg[i].len];
159 obuf[0] = 0;
160 obuf[1] = msg[i].len;
161 obuf[2] = msg[i].addr;
162 if (cxusb_ctrl_msg(d, CMD_I2C_READ,
163 obuf, 3,
164 ibuf, 1+msg[i].len) < 0) {
165 warn("i2c read failed");
166 break;
167 }
168 memcpy(msg[i].buf, &ibuf[1], msg[i].len);
Chris Pascoea644e4a2007-11-19 03:05:09 -0300169 } else if (i+1 < num && (msg[i+1].flags & I2C_M_RD) &&
170 msg[i].addr == msg[i+1].addr) {
171 /* write to then read from same address */
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700172 u8 obuf[3+msg[i].len], ibuf[1+msg[i+1].len];
173 obuf[0] = msg[i].len;
174 obuf[1] = msg[i+1].len;
175 obuf[2] = msg[i].addr;
Michael Krufkyf35db232006-12-05 14:53:39 -0300176 memcpy(&obuf[3], msg[i].buf, msg[i].len);
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700177
178 if (cxusb_ctrl_msg(d, CMD_I2C_READ,
Michael Krufkyf35db232006-12-05 14:53:39 -0300179 obuf, 3+msg[i].len,
180 ibuf, 1+msg[i+1].len) < 0)
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700181 break;
182
183 if (ibuf[0] != 0x08)
Michael Krufkyae62e3d2006-03-23 01:11:18 -0300184 deb_i2c("i2c read may have failed\n");
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700185
Michael Krufkyf35db232006-12-05 14:53:39 -0300186 memcpy(msg[i+1].buf, &ibuf[1], msg[i+1].len);
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700187
188 i++;
Chris Pascoe272479d72007-11-19 03:01:22 -0300189 } else {
190 /* write only */
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700191 u8 obuf[2+msg[i].len], ibuf;
192 obuf[0] = msg[i].addr;
193 obuf[1] = msg[i].len;
Michael Krufkyf35db232006-12-05 14:53:39 -0300194 memcpy(&obuf[2], msg[i].buf, msg[i].len);
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700195
Michael Krufkyf35db232006-12-05 14:53:39 -0300196 if (cxusb_ctrl_msg(d, CMD_I2C_WRITE, obuf,
197 2+msg[i].len, &ibuf,1) < 0)
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700198 break;
199 if (ibuf != 0x08)
Michael Krufkyae62e3d2006-03-23 01:11:18 -0300200 deb_i2c("i2c write may have failed\n");
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700201 }
202 }
203
Ingo Molnar3593cab2006-02-07 06:49:14 -0200204 mutex_unlock(&d->i2c_mutex);
Chris Pascoe13e001d2007-11-19 02:48:27 -0300205 return i == num ? num : -EREMOTEIO;
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700206}
207
208static u32 cxusb_i2c_func(struct i2c_adapter *adapter)
209{
210 return I2C_FUNC_I2C;
211}
212
213static struct i2c_algorithm cxusb_i2c_algo = {
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700214 .master_xfer = cxusb_i2c_xfer,
215 .functionality = cxusb_i2c_func,
216};
217
218static int cxusb_power_ctrl(struct dvb_usb_device *d, int onoff)
219{
Patrick Boettchere2efeab2005-09-09 13:02:51 -0700220 u8 b = 0;
221 if (onoff)
222 return cxusb_ctrl_msg(d, CMD_POWER_ON, &b, 1, NULL, 0);
223 else
224 return cxusb_ctrl_msg(d, CMD_POWER_OFF, &b, 1, NULL, 0);
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700225}
226
Daniel Gimpelevichf5376ad2008-06-28 05:01:30 -0300227static int cxusb_aver_power_ctrl(struct dvb_usb_device *d, int onoff)
228{
229 int ret;
230 if (!onoff)
231 return cxusb_ctrl_msg(d, CMD_POWER_OFF, NULL, 0, NULL, 0);
232 if (d->state == DVB_USB_STATE_INIT &&
233 usb_set_interface(d->udev, 0, 0) < 0)
234 err("set interface failed");
Hans Verkuilc6eb8ea2008-09-03 17:11:54 -0300235 do {} while (!(ret = cxusb_ctrl_msg(d, CMD_POWER_ON, NULL, 0, NULL, 0)) &&
Daniel Gimpelevichf5376ad2008-06-28 05:01:30 -0300236 !(ret = cxusb_ctrl_msg(d, 0x15, NULL, 0, NULL, 0)) &&
237 !(ret = cxusb_ctrl_msg(d, 0x17, NULL, 0, NULL, 0)) && 0);
238 if (!ret) {
239 /* FIXME: We don't know why, but we need to configure the
240 * lgdt3303 with the register settings below on resume */
241 int i;
242 u8 buf, bufs[] = {
243 0x0e, 0x2, 0x00, 0x7f,
244 0x0e, 0x2, 0x02, 0xfe,
245 0x0e, 0x2, 0x02, 0x01,
246 0x0e, 0x2, 0x00, 0x03,
247 0x0e, 0x2, 0x0d, 0x40,
248 0x0e, 0x2, 0x0e, 0x87,
249 0x0e, 0x2, 0x0f, 0x8e,
250 0x0e, 0x2, 0x10, 0x01,
251 0x0e, 0x2, 0x14, 0xd7,
252 0x0e, 0x2, 0x47, 0x88,
253 };
254 msleep(20);
255 for (i = 0; i < sizeof(bufs)/sizeof(u8); i += 4/sizeof(u8)) {
256 ret = cxusb_ctrl_msg(d, CMD_I2C_WRITE,
257 bufs+i, 4, &buf, 1);
258 if (ret)
259 break;
260 if (buf != 0x8)
261 return -EREMOTEIO;
262 }
263 }
264 return ret;
265}
266
Michael Krufky5691c842006-04-19 20:40:01 -0300267static int cxusb_bluebird_power_ctrl(struct dvb_usb_device *d, int onoff)
268{
269 u8 b = 0;
270 if (onoff)
271 return cxusb_ctrl_msg(d, CMD_POWER_ON, &b, 1, NULL, 0);
272 else
273 return 0;
274}
275
Chris Pascoe5ccaf902007-11-20 01:53:31 -0300276static int cxusb_nano2_power_ctrl(struct dvb_usb_device *d, int onoff)
277{
278 int rc = 0;
279
280 rc = cxusb_power_ctrl(d, onoff);
281 if (!onoff)
282 cxusb_nano2_led(d, 0);
283
284 return rc;
285}
286
Timothy Leedfbdce02008-08-09 13:36:51 -0300287static int cxusb_d680_dmb_power_ctrl(struct dvb_usb_device *d, int onoff)
288{
289 int ret;
290 u8 b;
291 ret = cxusb_power_ctrl(d, onoff);
292 if (!onoff)
293 return ret;
294
295 msleep(128);
296 cxusb_ctrl_msg(d, CMD_DIGITAL, NULL, 0, &b, 1);
297 msleep(100);
298 return ret;
299}
300
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300301static int cxusb_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700302{
Patrick Boettcher8257e8a2005-07-07 17:58:15 -0700303 u8 buf[2] = { 0x03, 0x00 };
304 if (onoff)
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300305 cxusb_ctrl_msg(adap->dev, CMD_STREAMING_ON, buf, 2, NULL, 0);
Patrick Boettcher8257e8a2005-07-07 17:58:15 -0700306 else
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300307 cxusb_ctrl_msg(adap->dev, CMD_STREAMING_OFF, NULL, 0, NULL, 0);
Patrick Boettcher8257e8a2005-07-07 17:58:15 -0700308
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700309 return 0;
310}
311
Daniel Gimpelevichf5376ad2008-06-28 05:01:30 -0300312static int cxusb_aver_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
313{
314 if (onoff)
315 cxusb_ctrl_msg(adap->dev, CMD_AVER_STREAM_ON, NULL, 0, NULL, 0);
316 else
317 cxusb_ctrl_msg(adap->dev, CMD_AVER_STREAM_OFF,
318 NULL, 0, NULL, 0);
319 return 0;
320}
321
Timothy Leedfbdce02008-08-09 13:36:51 -0300322static void cxusb_d680_dmb_drain_message(struct dvb_usb_device *d)
323{
324 int ep = d->props.generic_bulk_ctrl_endpoint;
325 const int timeout = 100;
326 const int junk_len = 32;
327 u8 *junk;
328 int rd_count;
329
330 /* Discard remaining data in video pipe */
331 junk = kmalloc(junk_len, GFP_KERNEL);
332 if (!junk)
333 return;
334 while (1) {
335 if (usb_bulk_msg(d->udev,
336 usb_rcvbulkpipe(d->udev, ep),
337 junk, junk_len, &rd_count, timeout) < 0)
338 break;
339 if (!rd_count)
340 break;
341 }
342 kfree(junk);
343}
344
345static void cxusb_d680_dmb_drain_video(struct dvb_usb_device *d)
346{
347 struct usb_data_stream_properties *p = &d->props.adapter[0].stream;
348 const int timeout = 100;
349 const int junk_len = p->u.bulk.buffersize;
350 u8 *junk;
351 int rd_count;
352
353 /* Discard remaining data in video pipe */
354 junk = kmalloc(junk_len, GFP_KERNEL);
355 if (!junk)
356 return;
357 while (1) {
358 if (usb_bulk_msg(d->udev,
359 usb_rcvbulkpipe(d->udev, p->endpoint),
360 junk, junk_len, &rd_count, timeout) < 0)
361 break;
362 if (!rd_count)
363 break;
364 }
365 kfree(junk);
366}
367
368static int cxusb_d680_dmb_streaming_ctrl(
369 struct dvb_usb_adapter *adap, int onoff)
370{
371 if (onoff) {
372 u8 buf[2] = { 0x03, 0x00 };
373 cxusb_d680_dmb_drain_video(adap->dev);
374 return cxusb_ctrl_msg(adap->dev, CMD_STREAMING_ON,
375 buf, sizeof(buf), NULL, 0);
376 } else {
377 int ret = cxusb_ctrl_msg(adap->dev,
378 CMD_STREAMING_OFF, NULL, 0, NULL, 0);
379 return ret;
380 }
381}
382
Chris Pascoe7c239702006-01-09 18:21:29 -0200383static int cxusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
384{
385 struct dvb_usb_rc_key *keymap = d->props.rc_key_map;
Michael Krufkya07e6092006-01-09 18:21:31 -0200386 u8 ircode[4];
Chris Pascoe7c239702006-01-09 18:21:29 -0200387 int i;
388
Michael Krufkya07e6092006-01-09 18:21:31 -0200389 cxusb_ctrl_msg(d, CMD_GET_IR_CODE, NULL, 0, ircode, 4);
Chris Pascoe7c239702006-01-09 18:21:29 -0200390
391 *event = 0;
392 *state = REMOTE_NO_KEY_PRESSED;
393
394 for (i = 0; i < d->props.rc_key_map_size; i++) {
Mauro Carvalho Chehab2e365882009-08-29 15:19:31 -0300395 if (rc5_custom(&keymap[i]) == ircode[2] &&
396 rc5_data(&keymap[i]) == ircode[3]) {
Chris Pascoe7c239702006-01-09 18:21:29 -0200397 *event = keymap[i].event;
398 *state = REMOTE_KEY_PRESSED;
399
400 return 0;
401 }
402 }
403
404 return 0;
405}
406
Chris Pascoeaeb012b2007-11-19 21:57:10 -0300407static int cxusb_bluebird2_rc_query(struct dvb_usb_device *d, u32 *event,
408 int *state)
409{
410 struct dvb_usb_rc_key *keymap = d->props.rc_key_map;
411 u8 ircode[4];
412 int i;
413 struct i2c_msg msg = { .addr = 0x6b, .flags = I2C_M_RD,
414 .buf = ircode, .len = 4 };
415
416 *event = 0;
417 *state = REMOTE_NO_KEY_PRESSED;
418
419 if (cxusb_i2c_xfer(&d->i2c_adap, &msg, 1) != 1)
420 return 0;
421
422 for (i = 0; i < d->props.rc_key_map_size; i++) {
Mauro Carvalho Chehab2e365882009-08-29 15:19:31 -0300423 if (rc5_custom(&keymap[i]) == ircode[1] &&
424 rc5_data(&keymap[i]) == ircode[2]) {
Chris Pascoeaeb012b2007-11-19 21:57:10 -0300425 *event = keymap[i].event;
426 *state = REMOTE_KEY_PRESSED;
427
428 return 0;
429 }
430 }
431
432 return 0;
433}
434
Timothy Leedfbdce02008-08-09 13:36:51 -0300435static int cxusb_d680_dmb_rc_query(struct dvb_usb_device *d, u32 *event,
436 int *state)
437{
438 struct dvb_usb_rc_key *keymap = d->props.rc_key_map;
439 u8 ircode[2];
440 int i;
441
442 *event = 0;
443 *state = REMOTE_NO_KEY_PRESSED;
444
445 if (cxusb_ctrl_msg(d, 0x10, NULL, 0, ircode, 2) < 0)
446 return 0;
447
448 for (i = 0; i < d->props.rc_key_map_size; i++) {
Mauro Carvalho Chehab2e365882009-08-29 15:19:31 -0300449 if (rc5_custom(&keymap[i]) == ircode[0] &&
450 rc5_data(&keymap[i]) == ircode[1]) {
Timothy Leedfbdce02008-08-09 13:36:51 -0300451 *event = keymap[i].event;
452 *state = REMOTE_KEY_PRESSED;
453
454 return 0;
455 }
456 }
457
458 return 0;
459}
460
Adrian Bunk703cb2c2006-01-23 17:11:09 -0200461static struct dvb_usb_rc_key dvico_mce_rc_keys[] = {
Mauro Carvalho Chehab2e365882009-08-29 15:19:31 -0300462 { 0xfe02, KEY_TV },
463 { 0xfe0e, KEY_MP3 },
464 { 0xfe1a, KEY_DVD },
465 { 0xfe1e, KEY_FAVORITES },
466 { 0xfe16, KEY_SETUP },
467 { 0xfe46, KEY_POWER2 },
468 { 0xfe0a, KEY_EPG },
469 { 0xfe49, KEY_BACK },
470 { 0xfe4d, KEY_MENU },
471 { 0xfe51, KEY_UP },
472 { 0xfe5b, KEY_LEFT },
473 { 0xfe5f, KEY_RIGHT },
474 { 0xfe53, KEY_DOWN },
475 { 0xfe5e, KEY_OK },
476 { 0xfe59, KEY_INFO },
477 { 0xfe55, KEY_TAB },
478 { 0xfe0f, KEY_PREVIOUSSONG },/* Replay */
479 { 0xfe12, KEY_NEXTSONG }, /* Skip */
480 { 0xfe42, KEY_ENTER }, /* Windows/Start */
481 { 0xfe15, KEY_VOLUMEUP },
482 { 0xfe05, KEY_VOLUMEDOWN },
483 { 0xfe11, KEY_CHANNELUP },
484 { 0xfe09, KEY_CHANNELDOWN },
485 { 0xfe52, KEY_CAMERA },
486 { 0xfe5a, KEY_TUNER }, /* Live */
487 { 0xfe19, KEY_OPEN },
488 { 0xfe0b, KEY_1 },
489 { 0xfe17, KEY_2 },
490 { 0xfe1b, KEY_3 },
491 { 0xfe07, KEY_4 },
492 { 0xfe50, KEY_5 },
493 { 0xfe54, KEY_6 },
494 { 0xfe48, KEY_7 },
495 { 0xfe4c, KEY_8 },
496 { 0xfe58, KEY_9 },
497 { 0xfe13, KEY_ANGLE }, /* Aspect */
498 { 0xfe03, KEY_0 },
499 { 0xfe1f, KEY_ZOOM },
500 { 0xfe43, KEY_REWIND },
501 { 0xfe47, KEY_PLAYPAUSE },
502 { 0xfe4f, KEY_FASTFORWARD },
503 { 0xfe57, KEY_MUTE },
504 { 0xfe0d, KEY_STOP },
505 { 0xfe01, KEY_RECORD },
506 { 0xfe4e, KEY_POWER },
Michael Krufkya07e6092006-01-09 18:21:31 -0200507};
508
Michael Krufkyc1501782006-03-26 05:43:36 -0300509static struct dvb_usb_rc_key dvico_portable_rc_keys[] = {
Mauro Carvalho Chehab2e365882009-08-29 15:19:31 -0300510 { 0xfc02, KEY_SETUP }, /* Profile */
511 { 0xfc43, KEY_POWER2 },
512 { 0xfc06, KEY_EPG },
513 { 0xfc5a, KEY_BACK },
514 { 0xfc05, KEY_MENU },
515 { 0xfc47, KEY_INFO },
516 { 0xfc01, KEY_TAB },
517 { 0xfc42, KEY_PREVIOUSSONG },/* Replay */
518 { 0xfc49, KEY_VOLUMEUP },
519 { 0xfc09, KEY_VOLUMEDOWN },
520 { 0xfc54, KEY_CHANNELUP },
521 { 0xfc0b, KEY_CHANNELDOWN },
522 { 0xfc16, KEY_CAMERA },
523 { 0xfc40, KEY_TUNER }, /* ATV/DTV */
524 { 0xfc45, KEY_OPEN },
525 { 0xfc19, KEY_1 },
526 { 0xfc18, KEY_2 },
527 { 0xfc1b, KEY_3 },
528 { 0xfc1a, KEY_4 },
529 { 0xfc58, KEY_5 },
530 { 0xfc59, KEY_6 },
531 { 0xfc15, KEY_7 },
532 { 0xfc14, KEY_8 },
533 { 0xfc17, KEY_9 },
534 { 0xfc44, KEY_ANGLE }, /* Aspect */
535 { 0xfc55, KEY_0 },
536 { 0xfc07, KEY_ZOOM },
537 { 0xfc0a, KEY_REWIND },
538 { 0xfc08, KEY_PLAYPAUSE },
539 { 0xfc4b, KEY_FASTFORWARD },
540 { 0xfc5b, KEY_MUTE },
541 { 0xfc04, KEY_STOP },
542 { 0xfc56, KEY_RECORD },
543 { 0xfc57, KEY_POWER },
544 { 0xfc41, KEY_UNKNOWN }, /* INPUT */
545 { 0xfc00, KEY_UNKNOWN }, /* HD */
Michael Krufkyc1501782006-03-26 05:43:36 -0300546};
547
Timothy Leedfbdce02008-08-09 13:36:51 -0300548static struct dvb_usb_rc_key d680_dmb_rc_keys[] = {
Mauro Carvalho Chehab2e365882009-08-29 15:19:31 -0300549 { 0x0038, KEY_UNKNOWN }, /* TV/AV */
550 { 0x080c, KEY_ZOOM },
551 { 0x0800, KEY_0 },
552 { 0x0001, KEY_1 },
553 { 0x0802, KEY_2 },
554 { 0x0003, KEY_3 },
555 { 0x0804, KEY_4 },
556 { 0x0005, KEY_5 },
557 { 0x0806, KEY_6 },
558 { 0x0007, KEY_7 },
559 { 0x0808, KEY_8 },
560 { 0x0009, KEY_9 },
561 { 0x000a, KEY_MUTE },
562 { 0x0829, KEY_BACK },
563 { 0x0012, KEY_CHANNELUP },
564 { 0x0813, KEY_CHANNELDOWN },
565 { 0x002b, KEY_VOLUMEUP },
566 { 0x082c, KEY_VOLUMEDOWN },
567 { 0x0020, KEY_UP },
568 { 0x0821, KEY_DOWN },
569 { 0x0011, KEY_LEFT },
570 { 0x0810, KEY_RIGHT },
571 { 0x000d, KEY_OK },
572 { 0x081f, KEY_RECORD },
573 { 0x0017, KEY_PLAYPAUSE },
574 { 0x0816, KEY_PLAYPAUSE },
575 { 0x000b, KEY_STOP },
576 { 0x0827, KEY_FASTFORWARD },
577 { 0x0026, KEY_REWIND },
578 { 0x081e, KEY_UNKNOWN }, /* Time Shift */
579 { 0x000e, KEY_UNKNOWN }, /* Snapshot */
580 { 0x082d, KEY_UNKNOWN }, /* Mouse Cursor */
581 { 0x000f, KEY_UNKNOWN }, /* Minimize/Maximize */
582 { 0x0814, KEY_UNKNOWN }, /* Shuffle */
583 { 0x0025, KEY_POWER },
Timothy Leedfbdce02008-08-09 13:36:51 -0300584};
585
Chris Pascoe0029ee12006-01-09 18:21:28 -0200586static int cxusb_dee1601_demod_init(struct dvb_frontend* fe)
587{
Chris Pascoed9ed8812006-02-07 06:49:11 -0200588 static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x28 };
Chris Pascoe0029ee12006-01-09 18:21:28 -0200589 static u8 reset [] = { RESET, 0x80 };
590 static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 };
591 static u8 agc_cfg [] = { AGC_TARGET, 0x28, 0x20 };
592 static u8 gpp_ctl_cfg [] = { GPP_CTL, 0x33 };
593 static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 };
594
595 mt352_write(fe, clock_config, sizeof(clock_config));
596 udelay(200);
597 mt352_write(fe, reset, sizeof(reset));
598 mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
599
600 mt352_write(fe, agc_cfg, sizeof(agc_cfg));
601 mt352_write(fe, gpp_ctl_cfg, sizeof(gpp_ctl_cfg));
602 mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
603
604 return 0;
605}
606
Michael Krufky6f447252006-01-11 19:40:33 -0200607static int cxusb_mt352_demod_init(struct dvb_frontend* fe)
608{ /* used in both lgz201 and th7579 */
Michael Krufkyfb51fd22006-02-07 06:49:12 -0200609 static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x29 };
Michael Krufky6f447252006-01-11 19:40:33 -0200610 static u8 reset [] = { RESET, 0x80 };
611 static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 };
612 static u8 agc_cfg [] = { AGC_TARGET, 0x24, 0x20 };
613 static u8 gpp_ctl_cfg [] = { GPP_CTL, 0x33 };
614 static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 };
615
616 mt352_write(fe, clock_config, sizeof(clock_config));
617 udelay(200);
618 mt352_write(fe, reset, sizeof(reset));
619 mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
620
621 mt352_write(fe, agc_cfg, sizeof(agc_cfg));
622 mt352_write(fe, gpp_ctl_cfg, sizeof(gpp_ctl_cfg));
623 mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
624 return 0;
625}
626
Adrian Bunk703cb2c2006-01-23 17:11:09 -0200627static struct cx22702_config cxusb_cx22702_config = {
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700628 .demod_address = 0x63,
Patrick Boettcher8257e8a2005-07-07 17:58:15 -0700629 .output_mode = CX22702_PARALLEL_OUTPUT,
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700630};
631
Michael Krufkyfddd6322006-02-27 00:08:17 -0300632static struct lgdt330x_config cxusb_lgdt3303_config = {
Michael Krufkyeffee032006-01-09 15:25:47 -0200633 .demod_address = 0x0e,
634 .demod_chip = LGDT3303,
Michael Krufkyeffee032006-01-09 15:25:47 -0200635};
636
Daniel Gimpelevichf5376ad2008-06-28 05:01:30 -0300637static struct lgdt330x_config cxusb_aver_lgdt3303_config = {
638 .demod_address = 0x0e,
639 .demod_chip = LGDT3303,
640 .clock_polarity_flip = 2,
641};
642
Adrian Bunk703cb2c2006-01-23 17:11:09 -0200643static struct mt352_config cxusb_dee1601_config = {
Chris Pascoe0029ee12006-01-09 18:21:28 -0200644 .demod_address = 0x0f,
645 .demod_init = cxusb_dee1601_demod_init,
Chris Pascoe0029ee12006-01-09 18:21:28 -0200646};
647
Michael Krufkyc9ce3942006-06-11 04:24:31 -0300648static struct zl10353_config cxusb_zl10353_dee1601_config = {
649 .demod_address = 0x0f,
Chris Pascoe8fb95782006-08-10 03:17:16 -0300650 .parallel_ts = 1,
Michael Krufkyc9ce3942006-06-11 04:24:31 -0300651};
652
Adrian Bunk6fe00b02006-04-19 20:49:28 -0300653static struct mt352_config cxusb_mt352_config = {
Michael Krufky6f447252006-01-11 19:40:33 -0200654 /* used in both lgz201 and th7579 */
655 .demod_address = 0x0f,
656 .demod_init = cxusb_mt352_demod_init,
Michael Krufky6f447252006-01-11 19:40:33 -0200657};
658
Chris Pascoeaeb012b2007-11-19 21:57:10 -0300659static struct zl10353_config cxusb_zl10353_xc3028_config = {
660 .demod_address = 0x0f,
Chris Pascoea1dcd9d2007-11-20 08:17:54 -0300661 .if2 = 45600,
Chris Pascoeaeb012b2007-11-19 21:57:10 -0300662 .no_tuner = 1,
663 .parallel_ts = 1,
664};
665
Chris Pascoe702a6762007-11-20 03:34:11 -0300666static struct mt352_config cxusb_mt352_xc3028_config = {
667 .demod_address = 0x0f,
668 .if2 = 4560,
669 .no_tuner = 1,
670 .demod_init = cxusb_mt352_demod_init,
671};
672
Daniel Gimpelevichf5376ad2008-06-28 05:01:30 -0300673/* FIXME: needs tweaking */
674static struct mxl5005s_config aver_a868r_tuner = {
675 .i2c_address = 0x63,
676 .if_freq = 6000000UL,
677 .xtal_freq = CRYSTAL_FREQ_16000000HZ,
678 .agc_mode = MXL_SINGLE_AGC,
679 .tracking_filter = MXL_TF_C,
680 .rssi_enable = MXL_RSSI_ENABLE,
681 .cap_select = MXL_CAP_SEL_ENABLE,
682 .div_out = MXL_DIV_OUT_4,
683 .clock_out = MXL_CLOCK_OUT_DISABLE,
684 .output_load = MXL5005S_IF_OUTPUT_LOAD_200_OHM,
685 .top = MXL5005S_TOP_25P2,
686 .mod_mode = MXL_DIGITAL_MODE,
687 .if_mode = MXL_ZERO_IF,
688 .AgcMasterByte = 0x00,
689};
690
Timothy Leedfbdce02008-08-09 13:36:51 -0300691/* FIXME: needs tweaking */
692static struct mxl5005s_config d680_dmb_tuner = {
693 .i2c_address = 0x63,
694 .if_freq = 36125000UL,
695 .xtal_freq = CRYSTAL_FREQ_16000000HZ,
696 .agc_mode = MXL_SINGLE_AGC,
697 .tracking_filter = MXL_TF_C,
698 .rssi_enable = MXL_RSSI_ENABLE,
699 .cap_select = MXL_CAP_SEL_ENABLE,
700 .div_out = MXL_DIV_OUT_4,
701 .clock_out = MXL_CLOCK_OUT_DISABLE,
702 .output_load = MXL5005S_IF_OUTPUT_LOAD_200_OHM,
703 .top = MXL5005S_TOP_25P2,
704 .mod_mode = MXL_DIGITAL_MODE,
705 .if_mode = MXL_ZERO_IF,
706 .AgcMasterByte = 0x00,
707};
708
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700709/* Callbacks for DVB USB */
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300710static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap)
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700711{
Michael Krufkycb89cd32008-04-22 14:46:16 -0300712 dvb_attach(simple_tuner_attach, adap->fe,
713 &adap->dev->i2c_adap, 0x61,
714 TUNER_PHILIPS_FMD1216ME_MK3);
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700715 return 0;
716}
717
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300718static int cxusb_dee1601_tuner_attach(struct dvb_usb_adapter *adap)
Chris Pascoe0029ee12006-01-09 18:21:28 -0200719{
Michael Krufky79a54cb2006-12-05 14:20:06 -0300720 dvb_attach(dvb_pll_attach, adap->fe, 0x61,
Michael Krufky47a99912007-06-12 16:10:51 -0300721 NULL, DVB_PLL_THOMSON_DTT7579);
Chris Pascoe0029ee12006-01-09 18:21:28 -0200722 return 0;
723}
724
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300725static int cxusb_lgz201_tuner_attach(struct dvb_usb_adapter *adap)
Michael Krufky6f447252006-01-11 19:40:33 -0200726{
Michael Krufky47a99912007-06-12 16:10:51 -0300727 dvb_attach(dvb_pll_attach, adap->fe, 0x61, NULL, DVB_PLL_LG_Z201);
Michael Krufky6f447252006-01-11 19:40:33 -0200728 return 0;
729}
730
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300731static int cxusb_dtt7579_tuner_attach(struct dvb_usb_adapter *adap)
Michael Krufky6f447252006-01-11 19:40:33 -0200732{
Michael Krufky79a54cb2006-12-05 14:20:06 -0300733 dvb_attach(dvb_pll_attach, adap->fe, 0x60,
Michael Krufky47a99912007-06-12 16:10:51 -0300734 NULL, DVB_PLL_THOMSON_DTT7579);
Patrick Boettcher332bed52006-05-14 04:49:00 -0300735 return 0;
736}
737
Michael Krufkyf71a56c2006-10-13 21:55:57 -0300738static int cxusb_lgh064f_tuner_attach(struct dvb_usb_adapter *adap)
Patrick Boettcher332bed52006-05-14 04:49:00 -0300739{
Michael Krufky827855d2008-04-22 14:46:16 -0300740 dvb_attach(simple_tuner_attach, adap->fe,
741 &adap->dev->i2c_adap, 0x61, TUNER_LG_TDVS_H06XF);
Michael Krufky6f447252006-01-11 19:40:33 -0200742 return 0;
743}
744
Michael Krufkyd7cba042008-09-12 13:31:45 -0300745static int dvico_bluebird_xc2028_callback(void *ptr, int component,
746 int command, int arg)
Chris Pascoeaeb012b2007-11-19 21:57:10 -0300747{
Robert Loweryd483b732008-07-30 19:43:11 -0300748 struct dvb_usb_adapter *adap = ptr;
749 struct dvb_usb_device *d = adap->dev;
Chris Pascoeaeb012b2007-11-19 21:57:10 -0300750
751 switch (command) {
752 case XC2028_TUNER_RESET:
Harvey Harrison708bebd2008-04-08 23:20:00 -0300753 deb_info("%s: XC2028_TUNER_RESET %d\n", __func__, arg);
Chris Pascoeaeb012b2007-11-19 21:57:10 -0300754 cxusb_bluebird_gpio_pulse(d, 0x01, 1);
755 break;
756 case XC2028_RESET_CLK:
Harvey Harrison708bebd2008-04-08 23:20:00 -0300757 deb_info("%s: XC2028_RESET_CLK %d\n", __func__, arg);
Chris Pascoeaeb012b2007-11-19 21:57:10 -0300758 break;
759 default:
Harvey Harrison708bebd2008-04-08 23:20:00 -0300760 deb_info("%s: unknown command %d, arg %d\n", __func__,
Chris Pascoeaeb012b2007-11-19 21:57:10 -0300761 command, arg);
762 return -EINVAL;
763 }
764
765 return 0;
766}
767
768static int cxusb_dvico_xc3028_tuner_attach(struct dvb_usb_adapter *adap)
769{
770 struct dvb_frontend *fe;
771 struct xc2028_config cfg = {
772 .i2c_adap = &adap->dev->i2c_adap,
773 .i2c_addr = 0x61,
Chris Pascoeaeb012b2007-11-19 21:57:10 -0300774 };
775 static struct xc2028_ctrl ctl = {
Michael Krufkyef80bfe2008-09-16 02:15:30 -0300776 .fname = XC2028_DEFAULT_FIRMWARE,
Chris Pascoeaeb012b2007-11-19 21:57:10 -0300777 .max_len = 64,
Robert Loweryd483b732008-07-30 19:43:11 -0300778 .demod = XC3028_FE_ZARLINK456,
Chris Pascoeaeb012b2007-11-19 21:57:10 -0300779 };
780
Michael Krufkyd7cba042008-09-12 13:31:45 -0300781 /* FIXME: generalize & move to common area */
782 adap->fe->callback = dvico_bluebird_xc2028_callback;
783
Chris Pascoeaeb012b2007-11-19 21:57:10 -0300784 fe = dvb_attach(xc2028_attach, adap->fe, &cfg);
785 if (fe == NULL || fe->ops.tuner_ops.set_config == NULL)
786 return -EIO;
787
788 fe->ops.tuner_ops.set_config(fe, &ctl);
789
790 return 0;
791}
792
Daniel Gimpelevichf5376ad2008-06-28 05:01:30 -0300793static int cxusb_mxl5003s_tuner_attach(struct dvb_usb_adapter *adap)
794{
795 dvb_attach(mxl5005s_attach, adap->fe,
796 &adap->dev->i2c_adap, &aver_a868r_tuner);
797 return 0;
798}
799
Timothy Leedfbdce02008-08-09 13:36:51 -0300800static int cxusb_d680_dmb_tuner_attach(struct dvb_usb_adapter *adap)
801{
802 struct dvb_frontend *fe;
803 fe = dvb_attach(mxl5005s_attach, adap->fe,
804 &adap->dev->i2c_adap, &d680_dmb_tuner);
805 return (fe == NULL) ? -EIO : 0;
806}
807
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300808static int cxusb_cx22702_frontend_attach(struct dvb_usb_adapter *adap)
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700809{
Patrick Boettchere2efeab2005-09-09 13:02:51 -0700810 u8 b;
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300811 if (usb_set_interface(adap->dev->udev, 0, 6) < 0)
Patrick Boettcher8257e8a2005-07-07 17:58:15 -0700812 err("set interface failed");
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700813
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300814 cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, &b, 1);
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700815
Michael Krufkyf35db232006-12-05 14:53:39 -0300816 if ((adap->fe = dvb_attach(cx22702_attach, &cxusb_cx22702_config,
817 &adap->dev->i2c_adap)) != NULL)
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700818 return 0;
819
820 return -EIO;
821}
822
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300823static int cxusb_lgdt3303_frontend_attach(struct dvb_usb_adapter *adap)
Michael Krufkyeffee032006-01-09 15:25:47 -0200824{
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300825 if (usb_set_interface(adap->dev->udev, 0, 7) < 0)
Michael Krufkyeffee032006-01-09 15:25:47 -0200826 err("set interface failed");
827
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300828 cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0);
Michael Krufkyeffee032006-01-09 15:25:47 -0200829
Michael Krufkyf35db232006-12-05 14:53:39 -0300830 if ((adap->fe = dvb_attach(lgdt330x_attach, &cxusb_lgdt3303_config,
831 &adap->dev->i2c_adap)) != NULL)
Michael Krufkyeffee032006-01-09 15:25:47 -0200832 return 0;
833
834 return -EIO;
835}
836
Daniel Gimpelevichf5376ad2008-06-28 05:01:30 -0300837static int cxusb_aver_lgdt3303_frontend_attach(struct dvb_usb_adapter *adap)
838{
839 adap->fe = dvb_attach(lgdt330x_attach, &cxusb_aver_lgdt3303_config,
840 &adap->dev->i2c_adap);
841 if (adap->fe != NULL)
842 return 0;
843
844 return -EIO;
845}
846
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300847static int cxusb_mt352_frontend_attach(struct dvb_usb_adapter *adap)
Chris Pascoe0029ee12006-01-09 18:21:28 -0200848{
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300849 /* used in both lgz201 and th7579 */
850 if (usb_set_interface(adap->dev->udev, 0, 0) < 0)
Chris Pascoe0029ee12006-01-09 18:21:28 -0200851 err("set interface failed");
852
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300853 cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0);
Chris Pascoe0029ee12006-01-09 18:21:28 -0200854
Michael Krufkyf35db232006-12-05 14:53:39 -0300855 if ((adap->fe = dvb_attach(mt352_attach, &cxusb_mt352_config,
856 &adap->dev->i2c_adap)) != NULL)
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300857 return 0;
858
859 return -EIO;
860}
861
862static int cxusb_dee1601_frontend_attach(struct dvb_usb_adapter *adap)
863{
864 if (usb_set_interface(adap->dev->udev, 0, 0) < 0)
865 err("set interface failed");
866
867 cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0);
868
Michael Krufkyf35db232006-12-05 14:53:39 -0300869 if (((adap->fe = dvb_attach(mt352_attach, &cxusb_dee1601_config,
870 &adap->dev->i2c_adap)) != NULL) ||
871 ((adap->fe = dvb_attach(zl10353_attach,
872 &cxusb_zl10353_dee1601_config,
873 &adap->dev->i2c_adap)) != NULL))
Chris Pascoe0029ee12006-01-09 18:21:28 -0200874 return 0;
875
876 return -EIO;
877}
878
Chris Pascoeaeb012b2007-11-19 21:57:10 -0300879static int cxusb_dualdig4_frontend_attach(struct dvb_usb_adapter *adap)
880{
881 u8 ircode[4];
882 int i;
883 struct i2c_msg msg = { .addr = 0x6b, .flags = I2C_M_RD,
884 .buf = ircode, .len = 4 };
885
886 if (usb_set_interface(adap->dev->udev, 0, 1) < 0)
887 err("set interface failed");
888
889 cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0);
890
891 /* reset the tuner and demodulator */
892 cxusb_bluebird_gpio_rw(adap->dev, 0x04, 0);
893 cxusb_bluebird_gpio_pulse(adap->dev, 0x01, 1);
894 cxusb_bluebird_gpio_pulse(adap->dev, 0x02, 1);
895
896 if ((adap->fe = dvb_attach(zl10353_attach,
897 &cxusb_zl10353_xc3028_config,
898 &adap->dev->i2c_adap)) == NULL)
899 return -EIO;
900
901 /* try to determine if there is no IR decoder on the I2C bus */
902 for (i = 0; adap->dev->props.rc_key_map != NULL && i < 5; i++) {
903 msleep(20);
904 if (cxusb_i2c_xfer(&adap->dev->i2c_adap, &msg, 1) != 1)
905 goto no_IR;
906 if (ircode[0] == 0 && ircode[1] == 0)
907 continue;
908 if (ircode[2] + ircode[3] != 0xff) {
909no_IR:
910 adap->dev->props.rc_key_map = NULL;
911 info("No IR receiver detected on this device.");
912 break;
913 }
914 }
915
916 return 0;
917}
918
Anton Blanchard8d798982008-08-09 12:23:15 -0300919static struct dibx000_agc_config dib7070_agc_config = {
920 .band_caps = BAND_UHF | BAND_VHF | BAND_LBAND | BAND_SBAND,
921
922 /*
923 * P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=5,
924 * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0,
925 * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0
926 */
927 .setup = (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) |
928 (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),
929 .inv_gain = 600,
930 .time_stabiliz = 10,
931 .alpha_level = 0,
932 .thlock = 118,
933 .wbd_inv = 0,
934 .wbd_ref = 3530,
935 .wbd_sel = 1,
936 .wbd_alpha = 5,
937 .agc1_max = 65535,
938 .agc1_min = 0,
939 .agc2_max = 65535,
940 .agc2_min = 0,
941 .agc1_pt1 = 0,
942 .agc1_pt2 = 40,
943 .agc1_pt3 = 183,
944 .agc1_slope1 = 206,
945 .agc1_slope2 = 255,
946 .agc2_pt1 = 72,
947 .agc2_pt2 = 152,
948 .agc2_slope1 = 88,
949 .agc2_slope2 = 90,
950 .alpha_mant = 17,
951 .alpha_exp = 27,
952 .beta_mant = 23,
953 .beta_exp = 51,
954 .perform_agc_softsplit = 0,
955};
956
957static struct dibx000_bandwidth_config dib7070_bw_config_12_mhz = {
958 .internal = 60000,
959 .sampling = 15000,
960 .pll_prediv = 1,
961 .pll_ratio = 20,
962 .pll_range = 3,
963 .pll_reset = 1,
964 .pll_bypass = 0,
965 .enable_refdiv = 0,
966 .bypclk_div = 0,
967 .IO_CLK_en_core = 1,
968 .ADClkSrc = 1,
969 .modulo = 2,
970 /* refsel, sel, freq_15k */
971 .sad_cfg = (3 << 14) | (1 << 12) | (524 << 0),
972 .ifreq = (0 << 25) | 0,
973 .timf = 20452225,
974 .xtal_hz = 12000000,
975};
976
977static struct dib7000p_config cxusb_dualdig4_rev2_config = {
978 .output_mode = OUTMODE_MPEG2_PAR_GATED_CLK,
979 .output_mpeg2_in_188_bytes = 1,
980
981 .agc_config_count = 1,
982 .agc = &dib7070_agc_config,
983 .bw = &dib7070_bw_config_12_mhz,
984 .tuner_is_baseband = 1,
985 .spur_protect = 1,
986
987 .gpio_dir = 0xfcef,
988 .gpio_val = 0x0110,
989
990 .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
991
992 .hostbus_diversity = 1,
993};
994
995static int cxusb_dualdig4_rev2_frontend_attach(struct dvb_usb_adapter *adap)
996{
997 if (usb_set_interface(adap->dev->udev, 0, 1) < 0)
998 err("set interface failed");
999
1000 cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0);
1001
1002 cxusb_bluebird_gpio_pulse(adap->dev, 0x02, 1);
1003
1004 dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18,
1005 &cxusb_dualdig4_rev2_config);
1006
Michael Krufkya2dc86b2008-08-09 13:06:26 -03001007 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80,
1008 &cxusb_dualdig4_rev2_config);
1009 if (adap->fe == NULL)
Anton Blanchard8d798982008-08-09 12:23:15 -03001010 return -EIO;
1011
1012 return 0;
1013}
1014
1015static int dib7070_tuner_reset(struct dvb_frontend *fe, int onoff)
1016{
1017 return dib7000p_set_gpio(fe, 8, 0, !onoff);
1018}
1019
1020static int dib7070_tuner_sleep(struct dvb_frontend *fe, int onoff)
1021{
1022 return 0;
1023}
1024
1025static struct dib0070_config dib7070p_dib0070_config = {
1026 .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS,
1027 .reset = dib7070_tuner_reset,
1028 .sleep = dib7070_tuner_sleep,
1029 .clock_khz = 12000,
1030};
1031
1032struct dib0700_adapter_state {
1033 int (*set_param_save) (struct dvb_frontend *,
1034 struct dvb_frontend_parameters *);
1035};
1036
1037static int dib7070_set_param_override(struct dvb_frontend *fe,
1038 struct dvb_frontend_parameters *fep)
1039{
1040 struct dvb_usb_adapter *adap = fe->dvb->priv;
1041 struct dib0700_adapter_state *state = adap->priv;
1042
1043 u16 offset;
1044 u8 band = BAND_OF_FREQUENCY(fep->frequency/1000);
1045 switch (band) {
Michael Krufkya2dc86b2008-08-09 13:06:26 -03001046 case BAND_VHF: offset = 950; break;
1047 default:
1048 case BAND_UHF: offset = 550; break;
Anton Blanchard8d798982008-08-09 12:23:15 -03001049 }
1050
1051 dib7000p_set_wbd_ref(fe, offset + dib0070_wbd_offset(fe));
1052
1053 return state->set_param_save(fe, fep);
1054}
1055
1056static int cxusb_dualdig4_rev2_tuner_attach(struct dvb_usb_adapter *adap)
1057{
1058 struct dib0700_adapter_state *st = adap->priv;
Michael Krufkya2dc86b2008-08-09 13:06:26 -03001059 struct i2c_adapter *tun_i2c =
1060 dib7000p_get_i2c_master(adap->fe,
1061 DIBX000_I2C_INTERFACE_TUNER, 1);
Anton Blanchard8d798982008-08-09 12:23:15 -03001062
1063 if (dvb_attach(dib0070_attach, adap->fe, tun_i2c,
1064 &dib7070p_dib0070_config) == NULL)
1065 return -ENODEV;
1066
1067 st->set_param_save = adap->fe->ops.tuner_ops.set_params;
1068 adap->fe->ops.tuner_ops.set_params = dib7070_set_param_override;
1069 return 0;
1070}
1071
Chris Pascoe5ccaf902007-11-20 01:53:31 -03001072static int cxusb_nano2_frontend_attach(struct dvb_usb_adapter *adap)
1073{
1074 if (usb_set_interface(adap->dev->udev, 0, 1) < 0)
1075 err("set interface failed");
1076
1077 cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0);
1078
1079 /* reset the tuner and demodulator */
1080 cxusb_bluebird_gpio_rw(adap->dev, 0x04, 0);
1081 cxusb_bluebird_gpio_pulse(adap->dev, 0x01, 1);
1082 cxusb_bluebird_gpio_pulse(adap->dev, 0x02, 1);
1083
1084 if ((adap->fe = dvb_attach(zl10353_attach,
1085 &cxusb_zl10353_xc3028_config,
1086 &adap->dev->i2c_adap)) != NULL)
1087 return 0;
1088
Chris Pascoe702a6762007-11-20 03:34:11 -03001089 if ((adap->fe = dvb_attach(mt352_attach,
1090 &cxusb_mt352_xc3028_config,
1091 &adap->dev->i2c_adap)) != NULL)
1092 return 0;
1093
Chris Pascoe5ccaf902007-11-20 01:53:31 -03001094 return -EIO;
1095}
1096
David T.L. Wong6bf1a992009-08-05 13:07:10 -03001097static struct lgs8gxx_config d680_lgs8gl5_cfg = {
1098 .prod = LGS8GXX_PROD_LGS8GL5,
Timothy Leedfbdce02008-08-09 13:36:51 -03001099 .demod_address = 0x19,
David T.L. Wong6bf1a992009-08-05 13:07:10 -03001100 .serial_ts = 0,
1101 .ts_clk_pol = 0,
1102 .ts_clk_gated = 1,
1103 .if_clk_freq = 30400, /* 30.4 MHz */
1104 .if_freq = 5725, /* 5.725 MHz */
1105 .if_neg_center = 0,
1106 .ext_adc = 0,
1107 .adc_signed = 0,
1108 .if_neg_edge = 0,
Timothy Leedfbdce02008-08-09 13:36:51 -03001109};
1110
1111static int cxusb_d680_dmb_frontend_attach(struct dvb_usb_adapter *adap)
1112{
1113 struct dvb_usb_device *d = adap->dev;
1114 int n;
1115
1116 /* Select required USB configuration */
1117 if (usb_set_interface(d->udev, 0, 0) < 0)
1118 err("set interface failed");
1119
1120 /* Unblock all USB pipes */
1121 usb_clear_halt(d->udev,
1122 usb_sndbulkpipe(d->udev, d->props.generic_bulk_ctrl_endpoint));
1123 usb_clear_halt(d->udev,
1124 usb_rcvbulkpipe(d->udev, d->props.generic_bulk_ctrl_endpoint));
1125 usb_clear_halt(d->udev,
1126 usb_rcvbulkpipe(d->udev, d->props.adapter[0].stream.endpoint));
1127
1128 /* Drain USB pipes to avoid hang after reboot */
1129 for (n = 0; n < 5; n++) {
1130 cxusb_d680_dmb_drain_message(d);
1131 cxusb_d680_dmb_drain_video(d);
1132 msleep(200);
1133 }
1134
1135 /* Reset the tuner */
1136 if (cxusb_d680_dmb_gpio_tuner(d, 0x07, 0) < 0) {
1137 err("clear tuner gpio failed");
1138 return -EIO;
1139 }
1140 msleep(100);
1141 if (cxusb_d680_dmb_gpio_tuner(d, 0x07, 1) < 0) {
1142 err("set tuner gpio failed");
1143 return -EIO;
1144 }
1145 msleep(100);
1146
1147 /* Attach frontend */
David T.L. Wong6bf1a992009-08-05 13:07:10 -03001148 adap->fe = dvb_attach(lgs8gxx_attach, &d680_lgs8gl5_cfg, &d->i2c_adap);
Timothy Leedfbdce02008-08-09 13:36:51 -03001149 if (adap->fe == NULL)
1150 return -EIO;
1151
1152 return 0;
1153}
1154
Patrick Boettcherf5373782006-01-09 18:21:38 -02001155/*
Chris Pascoe702a6762007-11-20 03:34:11 -03001156 * DViCO has shipped two devices with the same USB ID, but only one of them
1157 * needs a firmware download. Check the device class details to see if they
1158 * have non-default values to decide whether the device is actually cold or
1159 * not, and forget a match if it turns out we selected the wrong device.
1160 */
1161static int bluebird_fx2_identify_state(struct usb_device *udev,
1162 struct dvb_usb_device_properties *props,
1163 struct dvb_usb_device_description **desc,
1164 int *cold)
1165{
1166 int wascold = *cold;
1167
1168 *cold = udev->descriptor.bDeviceClass == 0xff &&
1169 udev->descriptor.bDeviceSubClass == 0xff &&
1170 udev->descriptor.bDeviceProtocol == 0xff;
1171
1172 if (*cold && !wascold)
1173 *desc = NULL;
1174
1175 return 0;
1176}
1177
1178/*
Patrick Boettcherf5373782006-01-09 18:21:38 -02001179 * DViCO bluebird firmware needs the "warm" product ID to be patched into the
1180 * firmware file before download.
1181 */
1182
Chris Pascoe702a6762007-11-20 03:34:11 -03001183static const int dvico_firmware_id_offsets[] = { 6638, 3204 };
Michael Krufkyf35db232006-12-05 14:53:39 -03001184static int bluebird_patch_dvico_firmware_download(struct usb_device *udev,
1185 const struct firmware *fw)
Patrick Boettcherf5373782006-01-09 18:21:38 -02001186{
Chris Pascoe702a6762007-11-20 03:34:11 -03001187 int pos;
Patrick Boettcherf5373782006-01-09 18:21:38 -02001188
Chris Pascoe702a6762007-11-20 03:34:11 -03001189 for (pos = 0; pos < ARRAY_SIZE(dvico_firmware_id_offsets); pos++) {
1190 int idoff = dvico_firmware_id_offsets[pos];
Patrick Boettcherf5373782006-01-09 18:21:38 -02001191
Chris Pascoe702a6762007-11-20 03:34:11 -03001192 if (fw->size < idoff + 4)
1193 continue;
Patrick Boettcherf5373782006-01-09 18:21:38 -02001194
Chris Pascoe702a6762007-11-20 03:34:11 -03001195 if (fw->data[idoff] == (USB_VID_DVICO & 0xff) &&
1196 fw->data[idoff + 1] == USB_VID_DVICO >> 8) {
David Woodhousee62f89f2008-05-24 00:12:42 +01001197 struct firmware new_fw;
1198 u8 *new_fw_data = vmalloc(fw->size);
1199 int ret;
1200
1201 if (!new_fw_data)
1202 return -ENOMEM;
1203
1204 memcpy(new_fw_data, fw->data, fw->size);
1205 new_fw.size = fw->size;
1206 new_fw.data = new_fw_data;
1207
1208 new_fw_data[idoff + 2] =
Chris Pascoe702a6762007-11-20 03:34:11 -03001209 le16_to_cpu(udev->descriptor.idProduct) + 1;
David Woodhousee62f89f2008-05-24 00:12:42 +01001210 new_fw_data[idoff + 3] =
Chris Pascoe702a6762007-11-20 03:34:11 -03001211 le16_to_cpu(udev->descriptor.idProduct) >> 8;
1212
David Woodhousee62f89f2008-05-24 00:12:42 +01001213 ret = usb_cypress_load_firmware(udev, &new_fw,
1214 CYPRESS_FX2);
1215 vfree(new_fw_data);
1216 return ret;
Chris Pascoe702a6762007-11-20 03:34:11 -03001217 }
Patrick Boettcherf5373782006-01-09 18:21:38 -02001218 }
1219
1220 return -EINVAL;
1221}
1222
Patrick Boettcher22c6d932005-07-07 17:58:10 -07001223/* DVB USB Driver stuff */
Patrick Boettcher4d43e132006-09-30 06:53:48 -03001224static struct dvb_usb_device_properties cxusb_medion_properties;
1225static struct dvb_usb_device_properties cxusb_bluebird_lgh064f_properties;
1226static struct dvb_usb_device_properties cxusb_bluebird_dee1601_properties;
1227static struct dvb_usb_device_properties cxusb_bluebird_lgz201_properties;
1228static struct dvb_usb_device_properties cxusb_bluebird_dtt7579_properties;
Chris Pascoeaeb012b2007-11-19 21:57:10 -03001229static struct dvb_usb_device_properties cxusb_bluebird_dualdig4_properties;
Anton Blanchard8d798982008-08-09 12:23:15 -03001230static struct dvb_usb_device_properties cxusb_bluebird_dualdig4_rev2_properties;
Chris Pascoe5ccaf902007-11-20 01:53:31 -03001231static struct dvb_usb_device_properties cxusb_bluebird_nano2_properties;
Chris Pascoe702a6762007-11-20 03:34:11 -03001232static struct dvb_usb_device_properties cxusb_bluebird_nano2_needsfirmware_properties;
Daniel Gimpelevichf5376ad2008-06-28 05:01:30 -03001233static struct dvb_usb_device_properties cxusb_aver_a868r_properties;
Timothy Leedfbdce02008-08-09 13:36:51 -03001234static struct dvb_usb_device_properties cxusb_d680_dmb_properties;
Patrick Boettcher22c6d932005-07-07 17:58:10 -07001235
1236static int cxusb_probe(struct usb_interface *intf,
Michael Krufkyf35db232006-12-05 14:53:39 -03001237 const struct usb_device_id *id)
Patrick Boettcher22c6d932005-07-07 17:58:10 -07001238{
Janne Grunau78e92002008-04-09 19:13:13 -03001239 if (0 == dvb_usb_device_init(intf, &cxusb_medion_properties,
1240 THIS_MODULE, NULL, adapter_nr) ||
1241 0 == dvb_usb_device_init(intf, &cxusb_bluebird_lgh064f_properties,
1242 THIS_MODULE, NULL, adapter_nr) ||
1243 0 == dvb_usb_device_init(intf, &cxusb_bluebird_dee1601_properties,
1244 THIS_MODULE, NULL, adapter_nr) ||
1245 0 == dvb_usb_device_init(intf, &cxusb_bluebird_lgz201_properties,
1246 THIS_MODULE, NULL, adapter_nr) ||
1247 0 == dvb_usb_device_init(intf, &cxusb_bluebird_dtt7579_properties,
1248 THIS_MODULE, NULL, adapter_nr) ||
1249 0 == dvb_usb_device_init(intf, &cxusb_bluebird_dualdig4_properties,
1250 THIS_MODULE, NULL, adapter_nr) ||
1251 0 == dvb_usb_device_init(intf, &cxusb_bluebird_nano2_properties,
1252 THIS_MODULE, NULL, adapter_nr) ||
1253 0 == dvb_usb_device_init(intf,
1254 &cxusb_bluebird_nano2_needsfirmware_properties,
Daniel Gimpelevichf5376ad2008-06-28 05:01:30 -03001255 THIS_MODULE, NULL, adapter_nr) ||
1256 0 == dvb_usb_device_init(intf, &cxusb_aver_a868r_properties,
1257 THIS_MODULE, NULL, adapter_nr) ||
Anton Blanchard8d798982008-08-09 12:23:15 -03001258 0 == dvb_usb_device_init(intf,
1259 &cxusb_bluebird_dualdig4_rev2_properties,
1260 THIS_MODULE, NULL, adapter_nr) ||
Timothy Leedfbdce02008-08-09 13:36:51 -03001261 0 == dvb_usb_device_init(intf, &cxusb_d680_dmb_properties,
1262 THIS_MODULE, NULL, adapter_nr) ||
Daniel Gimpelevichf5376ad2008-06-28 05:01:30 -03001263 0)
Michael Krufkyeffee032006-01-09 15:25:47 -02001264 return 0;
Michael Krufkyeffee032006-01-09 15:25:47 -02001265
1266 return -EINVAL;
Patrick Boettcher22c6d932005-07-07 17:58:10 -07001267}
1268
1269static struct usb_device_id cxusb_table [] = {
Michael Krufkyf35db232006-12-05 14:53:39 -03001270 { USB_DEVICE(USB_VID_MEDION, USB_PID_MEDION_MD95700) },
1271 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_COLD) },
1272 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_WARM) },
1273 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_1_COLD) },
1274 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_1_WARM) },
1275 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LGZ201_COLD) },
1276 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LGZ201_WARM) },
1277 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_TH7579_COLD) },
1278 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_TH7579_WARM) },
1279 { USB_DEVICE(USB_VID_DVICO, USB_PID_DIGITALNOW_BLUEBIRD_DUAL_1_COLD) },
1280 { USB_DEVICE(USB_VID_DVICO, USB_PID_DIGITALNOW_BLUEBIRD_DUAL_1_WARM) },
1281 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_2_COLD) },
1282 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_2_WARM) },
Chris Pascoeaeb012b2007-11-19 21:57:10 -03001283 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_4) },
Chris Pascoe5ccaf902007-11-20 01:53:31 -03001284 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DVB_T_NANO_2) },
Chris Pascoe702a6762007-11-20 03:34:11 -03001285 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DVB_T_NANO_2_NFW_WARM) },
Daniel Gimpelevichf5376ad2008-06-28 05:01:30 -03001286 { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR_A868R) },
Anton Blanchard8d798982008-08-09 12:23:15 -03001287 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_4_REV_2) },
Timothy Leedfbdce02008-08-09 13:36:51 -03001288 { USB_DEVICE(USB_VID_CONEXANT, USB_PID_CONEXANT_D680_DMB) },
Michael Krufkyf35db232006-12-05 14:53:39 -03001289 {} /* Terminating entry */
Patrick Boettcher22c6d932005-07-07 17:58:10 -07001290};
1291MODULE_DEVICE_TABLE (usb, cxusb_table);
1292
Patrick Boettcher4d43e132006-09-30 06:53:48 -03001293static struct dvb_usb_device_properties cxusb_medion_properties = {
Patrick Boettcher22c6d932005-07-07 17:58:10 -07001294 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1295
1296 .usb_ctrl = CYPRESS_FX2,
1297
1298 .size_of_priv = sizeof(struct cxusb_state),
1299
Patrick Boettcher4d43e132006-09-30 06:53:48 -03001300 .num_adapters = 1,
1301 .adapter = {
1302 {
Patrick Boettcher01451e72006-10-13 11:34:46 -03001303 .streaming_ctrl = cxusb_streaming_ctrl,
1304 .frontend_attach = cxusb_cx22702_frontend_attach,
1305 .tuner_attach = cxusb_fmd1216me_tuner_attach,
1306 /* parameter for the MPEG2-data transfer */
1307 .stream = {
1308 .type = USB_BULK,
1309 .count = 5,
1310 .endpoint = 0x02,
1311 .u = {
1312 .bulk = {
1313 .buffersize = 8192,
1314 }
1315 }
1316 },
Patrick Boettcher22c6d932005-07-07 17:58:10 -07001317
Patrick Boettcher4d43e132006-09-30 06:53:48 -03001318 },
1319 },
1320 .power_ctrl = cxusb_power_ctrl,
1321
1322 .i2c_algo = &cxusb_i2c_algo,
1323
1324 .generic_bulk_ctrl_endpoint = 0x01,
1325
Patrick Boettcher22c6d932005-07-07 17:58:10 -07001326 .num_device_descs = 1,
1327 .devices = {
1328 { "Medion MD95700 (MDUSBTV-HYBRID)",
1329 { NULL },
1330 { &cxusb_table[0], NULL },
1331 },
1332 }
1333};
1334
Patrick Boettcher4d43e132006-09-30 06:53:48 -03001335static struct dvb_usb_device_properties cxusb_bluebird_lgh064f_properties = {
Michael Krufkyeffee032006-01-09 15:25:47 -02001336 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1337
Patrick Boettcherf5373782006-01-09 18:21:38 -02001338 .usb_ctrl = DEVICE_SPECIFIC,
1339 .firmware = "dvb-usb-bluebird-01.fw",
1340 .download_firmware = bluebird_patch_dvico_firmware_download,
Michael Krufky37bdfa02006-01-09 15:25:47 -02001341 /* use usb alt setting 0 for EP4 transfer (dvb-t),
1342 use usb alt setting 7 for EP2 transfer (atsc) */
Michael Krufkyeffee032006-01-09 15:25:47 -02001343
1344 .size_of_priv = sizeof(struct cxusb_state),
1345
Patrick Boettcher4d43e132006-09-30 06:53:48 -03001346 .num_adapters = 1,
1347 .adapter = {
1348 {
Patrick Boettcher01451e72006-10-13 11:34:46 -03001349 .streaming_ctrl = cxusb_streaming_ctrl,
1350 .frontend_attach = cxusb_lgdt3303_frontend_attach,
Michael Krufkyf71a56c2006-10-13 21:55:57 -03001351 .tuner_attach = cxusb_lgh064f_tuner_attach,
Michael Krufkyeffee032006-01-09 15:25:47 -02001352
Patrick Boettcher01451e72006-10-13 11:34:46 -03001353 /* parameter for the MPEG2-data transfer */
1354 .stream = {
1355 .type = USB_BULK,
1356 .count = 5,
1357 .endpoint = 0x02,
1358 .u = {
1359 .bulk = {
1360 .buffersize = 8192,
1361 }
1362 }
1363 },
Patrick Boettcher4d43e132006-09-30 06:53:48 -03001364 },
1365 },
1366
1367 .power_ctrl = cxusb_bluebird_power_ctrl,
1368
Michael Krufkyeffee032006-01-09 15:25:47 -02001369 .i2c_algo = &cxusb_i2c_algo,
1370
Michael Krufkyc1501782006-03-26 05:43:36 -03001371 .rc_interval = 100,
1372 .rc_key_map = dvico_portable_rc_keys,
1373 .rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys),
1374 .rc_query = cxusb_rc_query,
1375
Michael Krufkyeffee032006-01-09 15:25:47 -02001376 .generic_bulk_ctrl_endpoint = 0x01,
Michael Krufkyeffee032006-01-09 15:25:47 -02001377
1378 .num_device_descs = 1,
1379 .devices = {
1380 { "DViCO FusionHDTV5 USB Gold",
1381 { &cxusb_table[1], NULL },
1382 { &cxusb_table[2], NULL },
1383 },
1384 }
1385};
1386
Patrick Boettcher4d43e132006-09-30 06:53:48 -03001387static struct dvb_usb_device_properties cxusb_bluebird_dee1601_properties = {
Chris Pascoe0029ee12006-01-09 18:21:28 -02001388 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1389
Patrick Boettcherf5373782006-01-09 18:21:38 -02001390 .usb_ctrl = DEVICE_SPECIFIC,
1391 .firmware = "dvb-usb-bluebird-01.fw",
1392 .download_firmware = bluebird_patch_dvico_firmware_download,
Chris Pascoe0029ee12006-01-09 18:21:28 -02001393 /* use usb alt setting 0 for EP4 transfer (dvb-t),
1394 use usb alt setting 7 for EP2 transfer (atsc) */
1395
1396 .size_of_priv = sizeof(struct cxusb_state),
1397
Patrick Boettcher4d43e132006-09-30 06:53:48 -03001398 .num_adapters = 1,
1399 .adapter = {
1400 {
Patrick Boettcher01451e72006-10-13 11:34:46 -03001401 .streaming_ctrl = cxusb_streaming_ctrl,
1402 .frontend_attach = cxusb_dee1601_frontend_attach,
1403 .tuner_attach = cxusb_dee1601_tuner_attach,
1404 /* parameter for the MPEG2-data transfer */
Patrick Boettcher4d43e132006-09-30 06:53:48 -03001405 .stream = {
1406 .type = USB_BULK,
Patrick Boettcher01451e72006-10-13 11:34:46 -03001407 .count = 5,
1408 .endpoint = 0x04,
1409 .u = {
1410 .bulk = {
1411 .buffersize = 8192,
1412 }
1413 }
1414 },
Patrick Boettcher4d43e132006-09-30 06:53:48 -03001415 },
1416 },
1417
1418 .power_ctrl = cxusb_bluebird_power_ctrl,
Chris Pascoe0029ee12006-01-09 18:21:28 -02001419
1420 .i2c_algo = &cxusb_i2c_algo,
1421
Chris Pascoe7c239702006-01-09 18:21:29 -02001422 .rc_interval = 150,
1423 .rc_key_map = dvico_mce_rc_keys,
1424 .rc_key_map_size = ARRAY_SIZE(dvico_mce_rc_keys),
1425 .rc_query = cxusb_rc_query,
1426
Chris Pascoe0029ee12006-01-09 18:21:28 -02001427 .generic_bulk_ctrl_endpoint = 0x01,
Chris Pascoe0029ee12006-01-09 18:21:28 -02001428
Michael Krufky587c03d2006-09-28 02:16:01 -03001429 .num_device_descs = 3,
Chris Pascoe0029ee12006-01-09 18:21:28 -02001430 .devices = {
1431 { "DViCO FusionHDTV DVB-T Dual USB",
1432 { &cxusb_table[3], NULL },
1433 { &cxusb_table[4], NULL },
1434 },
Michael Krufkyac9ffb92006-01-11 23:21:00 -02001435 { "DigitalNow DVB-T Dual USB",
1436 { &cxusb_table[9], NULL },
1437 { &cxusb_table[10], NULL },
1438 },
Michael Krufky587c03d2006-09-28 02:16:01 -03001439 { "DViCO FusionHDTV DVB-T Dual Digital 2",
1440 { &cxusb_table[11], NULL },
1441 { &cxusb_table[12], NULL },
1442 },
Chris Pascoe0029ee12006-01-09 18:21:28 -02001443 }
1444};
1445
Patrick Boettcher4d43e132006-09-30 06:53:48 -03001446static struct dvb_usb_device_properties cxusb_bluebird_lgz201_properties = {
Michael Krufky6f447252006-01-11 19:40:33 -02001447 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1448
1449 .usb_ctrl = DEVICE_SPECIFIC,
1450 .firmware = "dvb-usb-bluebird-01.fw",
1451 .download_firmware = bluebird_patch_dvico_firmware_download,
1452 /* use usb alt setting 0 for EP4 transfer (dvb-t),
1453 use usb alt setting 7 for EP2 transfer (atsc) */
1454
1455 .size_of_priv = sizeof(struct cxusb_state),
1456
Patrick Boettcher4d43e132006-09-30 06:53:48 -03001457 .num_adapters = 2,
1458 .adapter = {
1459 {
Patrick Boettcher01451e72006-10-13 11:34:46 -03001460 .streaming_ctrl = cxusb_streaming_ctrl,
1461 .frontend_attach = cxusb_mt352_frontend_attach,
1462 .tuner_attach = cxusb_lgz201_tuner_attach,
Michael Krufky6f447252006-01-11 19:40:33 -02001463
Patrick Boettcher01451e72006-10-13 11:34:46 -03001464 /* parameter for the MPEG2-data transfer */
Patrick Boettcher4d43e132006-09-30 06:53:48 -03001465 .stream = {
1466 .type = USB_BULK,
Patrick Boettcher01451e72006-10-13 11:34:46 -03001467 .count = 5,
1468 .endpoint = 0x04,
1469 .u = {
1470 .bulk = {
1471 .buffersize = 8192,
1472 }
1473 }
1474 },
Patrick Boettcher4d43e132006-09-30 06:53:48 -03001475 },
1476 },
1477 .power_ctrl = cxusb_bluebird_power_ctrl,
1478
Michael Krufky6f447252006-01-11 19:40:33 -02001479 .i2c_algo = &cxusb_i2c_algo,
1480
Michael Krufkyc1501782006-03-26 05:43:36 -03001481 .rc_interval = 100,
1482 .rc_key_map = dvico_portable_rc_keys,
1483 .rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys),
1484 .rc_query = cxusb_rc_query,
1485
Michael Krufky6f447252006-01-11 19:40:33 -02001486 .generic_bulk_ctrl_endpoint = 0x01,
Michael Krufky6f447252006-01-11 19:40:33 -02001487 .num_device_descs = 1,
1488 .devices = {
1489 { "DViCO FusionHDTV DVB-T USB (LGZ201)",
1490 { &cxusb_table[5], NULL },
1491 { &cxusb_table[6], NULL },
1492 },
1493 }
1494};
1495
Patrick Boettcher4d43e132006-09-30 06:53:48 -03001496static struct dvb_usb_device_properties cxusb_bluebird_dtt7579_properties = {
Michael Krufky6f447252006-01-11 19:40:33 -02001497 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1498
1499 .usb_ctrl = DEVICE_SPECIFIC,
1500 .firmware = "dvb-usb-bluebird-01.fw",
1501 .download_firmware = bluebird_patch_dvico_firmware_download,
1502 /* use usb alt setting 0 for EP4 transfer (dvb-t),
1503 use usb alt setting 7 for EP2 transfer (atsc) */
1504
1505 .size_of_priv = sizeof(struct cxusb_state),
1506
Patrick Boettcher4d43e132006-09-30 06:53:48 -03001507 .num_adapters = 1,
1508 .adapter = {
1509 {
Patrick Boettcher01451e72006-10-13 11:34:46 -03001510 .streaming_ctrl = cxusb_streaming_ctrl,
1511 .frontend_attach = cxusb_mt352_frontend_attach,
1512 .tuner_attach = cxusb_dtt7579_tuner_attach,
Michael Krufky6f447252006-01-11 19:40:33 -02001513
Patrick Boettcher01451e72006-10-13 11:34:46 -03001514 /* parameter for the MPEG2-data transfer */
Patrick Boettcher4d43e132006-09-30 06:53:48 -03001515 .stream = {
1516 .type = USB_BULK,
Patrick Boettcher01451e72006-10-13 11:34:46 -03001517 .count = 5,
1518 .endpoint = 0x04,
1519 .u = {
1520 .bulk = {
1521 .buffersize = 8192,
1522 }
1523 }
1524 },
Patrick Boettcher4d43e132006-09-30 06:53:48 -03001525 },
1526 },
1527 .power_ctrl = cxusb_bluebird_power_ctrl,
1528
Michael Krufky6f447252006-01-11 19:40:33 -02001529 .i2c_algo = &cxusb_i2c_algo,
1530
Michael Krufkyc1501782006-03-26 05:43:36 -03001531 .rc_interval = 100,
1532 .rc_key_map = dvico_portable_rc_keys,
1533 .rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys),
1534 .rc_query = cxusb_rc_query,
1535
Michael Krufky6f447252006-01-11 19:40:33 -02001536 .generic_bulk_ctrl_endpoint = 0x01,
Michael Krufky6f447252006-01-11 19:40:33 -02001537
1538 .num_device_descs = 1,
1539 .devices = {
1540 { "DViCO FusionHDTV DVB-T USB (TH7579)",
1541 { &cxusb_table[7], NULL },
1542 { &cxusb_table[8], NULL },
1543 },
1544 }
1545};
1546
Chris Pascoeaeb012b2007-11-19 21:57:10 -03001547static struct dvb_usb_device_properties cxusb_bluebird_dualdig4_properties = {
1548 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1549
1550 .usb_ctrl = CYPRESS_FX2,
1551
1552 .size_of_priv = sizeof(struct cxusb_state),
1553
1554 .num_adapters = 1,
1555 .adapter = {
1556 {
1557 .streaming_ctrl = cxusb_streaming_ctrl,
1558 .frontend_attach = cxusb_dualdig4_frontend_attach,
1559 .tuner_attach = cxusb_dvico_xc3028_tuner_attach,
1560 /* parameter for the MPEG2-data transfer */
1561 .stream = {
1562 .type = USB_BULK,
1563 .count = 5,
1564 .endpoint = 0x02,
1565 .u = {
1566 .bulk = {
1567 .buffersize = 8192,
1568 }
1569 }
1570 },
1571 },
1572 },
1573
1574 .power_ctrl = cxusb_power_ctrl,
1575
1576 .i2c_algo = &cxusb_i2c_algo,
1577
1578 .generic_bulk_ctrl_endpoint = 0x01,
1579
1580 .rc_interval = 100,
1581 .rc_key_map = dvico_mce_rc_keys,
1582 .rc_key_map_size = ARRAY_SIZE(dvico_mce_rc_keys),
1583 .rc_query = cxusb_bluebird2_rc_query,
1584
1585 .num_device_descs = 1,
1586 .devices = {
1587 { "DViCO FusionHDTV DVB-T Dual Digital 4",
1588 { NULL },
1589 { &cxusb_table[13], NULL },
1590 },
1591 }
1592};
1593
Chris Pascoe5ccaf902007-11-20 01:53:31 -03001594static struct dvb_usb_device_properties cxusb_bluebird_nano2_properties = {
1595 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1596
1597 .usb_ctrl = CYPRESS_FX2,
Chris Pascoe702a6762007-11-20 03:34:11 -03001598 .identify_state = bluebird_fx2_identify_state,
Chris Pascoe5ccaf902007-11-20 01:53:31 -03001599
1600 .size_of_priv = sizeof(struct cxusb_state),
1601
1602 .num_adapters = 1,
1603 .adapter = {
1604 {
1605 .streaming_ctrl = cxusb_streaming_ctrl,
1606 .frontend_attach = cxusb_nano2_frontend_attach,
1607 .tuner_attach = cxusb_dvico_xc3028_tuner_attach,
1608 /* parameter for the MPEG2-data transfer */
1609 .stream = {
1610 .type = USB_BULK,
1611 .count = 5,
1612 .endpoint = 0x02,
1613 .u = {
1614 .bulk = {
1615 .buffersize = 8192,
1616 }
1617 }
1618 },
1619 },
1620 },
1621
1622 .power_ctrl = cxusb_nano2_power_ctrl,
1623
1624 .i2c_algo = &cxusb_i2c_algo,
1625
1626 .generic_bulk_ctrl_endpoint = 0x01,
1627
1628 .rc_interval = 100,
1629 .rc_key_map = dvico_portable_rc_keys,
1630 .rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys),
1631 .rc_query = cxusb_bluebird2_rc_query,
1632
1633 .num_device_descs = 1,
1634 .devices = {
1635 { "DViCO FusionHDTV DVB-T NANO2",
1636 { NULL },
1637 { &cxusb_table[14], NULL },
1638 },
1639 }
1640};
1641
Chris Pascoe702a6762007-11-20 03:34:11 -03001642static struct dvb_usb_device_properties cxusb_bluebird_nano2_needsfirmware_properties = {
1643 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1644
1645 .usb_ctrl = DEVICE_SPECIFIC,
1646 .firmware = "dvb-usb-bluebird-02.fw",
1647 .download_firmware = bluebird_patch_dvico_firmware_download,
1648 .identify_state = bluebird_fx2_identify_state,
1649
1650 .size_of_priv = sizeof(struct cxusb_state),
1651
1652 .num_adapters = 1,
1653 .adapter = {
1654 {
1655 .streaming_ctrl = cxusb_streaming_ctrl,
1656 .frontend_attach = cxusb_nano2_frontend_attach,
1657 .tuner_attach = cxusb_dvico_xc3028_tuner_attach,
1658 /* parameter for the MPEG2-data transfer */
1659 .stream = {
1660 .type = USB_BULK,
1661 .count = 5,
1662 .endpoint = 0x02,
1663 .u = {
1664 .bulk = {
1665 .buffersize = 8192,
1666 }
1667 }
1668 },
1669 },
1670 },
1671
1672 .power_ctrl = cxusb_nano2_power_ctrl,
1673
1674 .i2c_algo = &cxusb_i2c_algo,
1675
1676 .generic_bulk_ctrl_endpoint = 0x01,
1677
1678 .rc_interval = 100,
1679 .rc_key_map = dvico_portable_rc_keys,
1680 .rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys),
1681 .rc_query = cxusb_rc_query,
1682
1683 .num_device_descs = 1,
1684 .devices = {
1685 { "DViCO FusionHDTV DVB-T NANO2 w/o firmware",
1686 { &cxusb_table[14], NULL },
1687 { &cxusb_table[15], NULL },
1688 },
1689 }
1690};
1691
Daniel Gimpelevichf5376ad2008-06-28 05:01:30 -03001692static struct dvb_usb_device_properties cxusb_aver_a868r_properties = {
1693 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1694
1695 .usb_ctrl = CYPRESS_FX2,
1696
1697 .size_of_priv = sizeof(struct cxusb_state),
1698
1699 .num_adapters = 1,
1700 .adapter = {
1701 {
1702 .streaming_ctrl = cxusb_aver_streaming_ctrl,
1703 .frontend_attach = cxusb_aver_lgdt3303_frontend_attach,
1704 .tuner_attach = cxusb_mxl5003s_tuner_attach,
1705 /* parameter for the MPEG2-data transfer */
1706 .stream = {
1707 .type = USB_BULK,
1708 .count = 5,
1709 .endpoint = 0x04,
1710 .u = {
1711 .bulk = {
1712 .buffersize = 8192,
1713 }
1714 }
1715 },
1716
1717 },
1718 },
1719 .power_ctrl = cxusb_aver_power_ctrl,
1720
1721 .i2c_algo = &cxusb_i2c_algo,
1722
1723 .generic_bulk_ctrl_endpoint = 0x01,
1724
1725 .num_device_descs = 1,
1726 .devices = {
1727 { "AVerMedia AVerTVHD Volar (A868R)",
1728 { NULL },
1729 { &cxusb_table[16], NULL },
1730 },
1731 }
1732};
1733
Michael Krufkya2dc86b2008-08-09 13:06:26 -03001734static
1735struct dvb_usb_device_properties cxusb_bluebird_dualdig4_rev2_properties = {
Anton Blanchard8d798982008-08-09 12:23:15 -03001736 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1737
1738 .usb_ctrl = CYPRESS_FX2,
1739
1740 .size_of_priv = sizeof(struct cxusb_state),
1741
1742 .num_adapters = 1,
1743 .adapter = {
1744 {
Michael Krufkya2dc86b2008-08-09 13:06:26 -03001745 .streaming_ctrl = cxusb_streaming_ctrl,
1746 .frontend_attach = cxusb_dualdig4_rev2_frontend_attach,
1747 .tuner_attach = cxusb_dualdig4_rev2_tuner_attach,
1748 .size_of_priv = sizeof(struct dib0700_adapter_state),
Anton Blanchard8d798982008-08-09 12:23:15 -03001749 /* parameter for the MPEG2-data transfer */
1750 .stream = {
1751 .type = USB_BULK,
1752 .count = 7,
1753 .endpoint = 0x02,
1754 .u = {
1755 .bulk = {
1756 .buffersize = 4096,
1757 }
1758 }
1759 },
1760 },
1761 },
1762
1763 .power_ctrl = cxusb_bluebird_power_ctrl,
1764
1765 .i2c_algo = &cxusb_i2c_algo,
1766
1767 .generic_bulk_ctrl_endpoint = 0x01,
1768
1769 .rc_interval = 100,
1770 .rc_key_map = dvico_mce_rc_keys,
1771 .rc_key_map_size = ARRAY_SIZE(dvico_mce_rc_keys),
1772 .rc_query = cxusb_rc_query,
1773
1774 .num_device_descs = 1,
1775 .devices = {
1776 { "DViCO FusionHDTV DVB-T Dual Digital 4 (rev 2)",
1777 { NULL },
1778 { &cxusb_table[17], NULL },
1779 },
1780 }
1781};
1782
Timothy Leedfbdce02008-08-09 13:36:51 -03001783static struct dvb_usb_device_properties cxusb_d680_dmb_properties = {
1784 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1785
1786 .usb_ctrl = CYPRESS_FX2,
1787
1788 .size_of_priv = sizeof(struct cxusb_state),
1789
1790 .num_adapters = 1,
1791 .adapter = {
1792 {
1793 .streaming_ctrl = cxusb_d680_dmb_streaming_ctrl,
1794 .frontend_attach = cxusb_d680_dmb_frontend_attach,
1795 .tuner_attach = cxusb_d680_dmb_tuner_attach,
1796
1797 /* parameter for the MPEG2-data transfer */
1798 .stream = {
1799 .type = USB_BULK,
1800 .count = 5,
1801 .endpoint = 0x02,
1802 .u = {
1803 .bulk = {
1804 .buffersize = 8192,
1805 }
1806 }
1807 },
1808 },
1809 },
1810
1811 .power_ctrl = cxusb_d680_dmb_power_ctrl,
1812
1813 .i2c_algo = &cxusb_i2c_algo,
1814
1815 .generic_bulk_ctrl_endpoint = 0x01,
1816
1817 .rc_interval = 100,
1818 .rc_key_map = d680_dmb_rc_keys,
1819 .rc_key_map_size = ARRAY_SIZE(d680_dmb_rc_keys),
1820 .rc_query = cxusb_d680_dmb_rc_query,
1821
1822 .num_device_descs = 1,
1823 .devices = {
1824 {
1825 "Conexant DMB-TH Stick",
1826 { NULL },
1827 { &cxusb_table[18], NULL },
1828 },
1829 }
1830};
1831
Patrick Boettcher22c6d932005-07-07 17:58:10 -07001832static struct usb_driver cxusb_driver = {
Patrick Boettcher63b5c1c2005-07-07 17:58:30 -07001833 .name = "dvb_usb_cxusb",
Patrick Boettcher22c6d932005-07-07 17:58:10 -07001834 .probe = cxusb_probe,
Michael Krufkyf35db232006-12-05 14:53:39 -03001835 .disconnect = dvb_usb_device_exit,
Patrick Boettcher22c6d932005-07-07 17:58:10 -07001836 .id_table = cxusb_table,
1837};
1838
1839/* module stuff */
1840static int __init cxusb_module_init(void)
1841{
1842 int result;
1843 if ((result = usb_register(&cxusb_driver))) {
1844 err("usb_register failed. Error number %d",result);
1845 return result;
1846 }
1847
1848 return 0;
1849}
1850
1851static void __exit cxusb_module_exit(void)
1852{
1853 /* deregister this driver from the USB subsystem */
1854 usb_deregister(&cxusb_driver);
1855}
1856
1857module_init (cxusb_module_init);
1858module_exit (cxusb_module_exit);
1859
1860MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
Michael Krufky5b9ed282006-10-15 14:51:08 -03001861MODULE_AUTHOR("Michael Krufky <mkrufky@linuxtv.org>");
Michael Krufkyf4efb4d2006-01-13 14:10:25 -02001862MODULE_AUTHOR("Chris Pascoe <c.pascoe@itee.uq.edu.au>");
Patrick Boettcher22c6d932005-07-07 17:58:10 -07001863MODULE_DESCRIPTION("Driver for Conexant USB2.0 hybrid reference design");
1864MODULE_VERSION("1.0-alpha");
1865MODULE_LICENSE("GPL");