blob: 3100ce91ccdb6ae3f279380f1eca6c1c1a908d16 [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 *
14 * TODO: check if the cx25840-driver (from ivtv) can be used for the analogue
15 * part
16 *
Patrick Boettcher22c6d932005-07-07 17:58:10 -070017 * Copyright (C) 2005 Patrick Boettcher (patrick.boettcher@desy.de)
Michael Krufkya07e6092006-01-09 18:21:31 -020018 * Copyright (C) 2005 Michael Krufky (mkrufky@m1k.net)
Chris Pascoe7c239702006-01-09 18:21:29 -020019 * Copyright (C) 2006 Chris Pascoe (c.pascoe@itee.uq.edu.au)
Patrick Boettcher22c6d932005-07-07 17:58:10 -070020 *
21 * This program is free software; you can redistribute it and/or modify it
22 * under the terms of the GNU General Public License as published by the Free
23 * Software Foundation, version 2.
24 *
25 * see Documentation/dvb/README.dvb-usb for more information
26 */
27#include "cxusb.h"
28
29#include "cx22702.h"
Michael Krufkyeffee032006-01-09 15:25:47 -020030#include "lgdt330x.h"
Chris Pascoe0029ee12006-01-09 18:21:28 -020031#include "mt352.h"
32#include "mt352_priv.h"
Patrick Boettcher22c6d932005-07-07 17:58:10 -070033
34/* debug */
35int dvb_usb_cxusb_debug;
36module_param_named(debug,dvb_usb_cxusb_debug, int, 0644);
37MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
38
39static int cxusb_ctrl_msg(struct dvb_usb_device *d,
40 u8 cmd, u8 *wbuf, int wlen, u8 *rbuf, int rlen)
41{
42 int wo = (rbuf == NULL || rlen == 0); /* write-only */
43 u8 sndbuf[1+wlen];
44 memset(sndbuf,0,1+wlen);
45
46 sndbuf[0] = cmd;
47 memcpy(&sndbuf[1],wbuf,wlen);
48 if (wo)
49 dvb_usb_generic_write(d,sndbuf,1+wlen);
50 else
51 dvb_usb_generic_rw(d,sndbuf,1+wlen,rbuf,rlen,0);
52
53 return 0;
54}
55
Patrick Boettchere2efeab2005-09-09 13:02:51 -070056/* GPIO */
57static void cxusb_gpio_tuner(struct dvb_usb_device *d, int onoff)
Patrick Boettcher22c6d932005-07-07 17:58:10 -070058{
59 struct cxusb_state *st = d->priv;
60 u8 o[2],i;
61
Patrick Boettchere2efeab2005-09-09 13:02:51 -070062 if (st->gpio_write_state[GPIO_TUNER] == onoff)
Patrick Boettcher22c6d932005-07-07 17:58:10 -070063 return;
64
Patrick Boettchere2efeab2005-09-09 13:02:51 -070065 o[0] = GPIO_TUNER;
66 o[1] = onoff;
67 cxusb_ctrl_msg(d,CMD_GPIO_WRITE,o,2,&i,1);
Patrick Boettcher22c6d932005-07-07 17:58:10 -070068
69 if (i != 0x01)
Patrick Boettchere2efeab2005-09-09 13:02:51 -070070 deb_info("gpio_write failed.\n");
Patrick Boettcher22c6d932005-07-07 17:58:10 -070071
Patrick Boettchere2efeab2005-09-09 13:02:51 -070072 st->gpio_write_state[GPIO_TUNER] = onoff;
Patrick Boettcher22c6d932005-07-07 17:58:10 -070073}
74
Patrick Boettchere2efeab2005-09-09 13:02:51 -070075/* I2C */
Patrick Boettcher22c6d932005-07-07 17:58:10 -070076static int cxusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num)
77{
78 struct dvb_usb_device *d = i2c_get_adapdata(adap);
79 int i;
80
81 if (down_interruptible(&d->i2c_sem) < 0)
82 return -EAGAIN;
83
84 if (num > 2)
85 warn("more than 2 i2c messages at a time is not handled yet. TODO.");
86
87 for (i = 0; i < num; i++) {
88
89 switch (msg[i].addr) {
90 case 0x63:
Patrick Boettchere2efeab2005-09-09 13:02:51 -070091 cxusb_gpio_tuner(d,0);
Patrick Boettcher22c6d932005-07-07 17:58:10 -070092 break;
93 default:
Patrick Boettchere2efeab2005-09-09 13:02:51 -070094 cxusb_gpio_tuner(d,1);
Patrick Boettcher22c6d932005-07-07 17:58:10 -070095 break;
96 }
97
98 /* read request */
99 if (i+1 < num && (msg[i+1].flags & I2C_M_RD)) {
100 u8 obuf[3+msg[i].len], ibuf[1+msg[i+1].len];
101 obuf[0] = msg[i].len;
102 obuf[1] = msg[i+1].len;
103 obuf[2] = msg[i].addr;
104 memcpy(&obuf[3],msg[i].buf,msg[i].len);
105
106 if (cxusb_ctrl_msg(d, CMD_I2C_READ,
107 obuf, 3+msg[i].len,
108 ibuf, 1+msg[i+1].len) < 0)
109 break;
110
111 if (ibuf[0] != 0x08)
112 deb_info("i2c read could have been failed\n");
113
114 memcpy(msg[i+1].buf,&ibuf[1],msg[i+1].len);
115
116 i++;
117 } else { /* write */
118 u8 obuf[2+msg[i].len], ibuf;
119 obuf[0] = msg[i].addr;
120 obuf[1] = msg[i].len;
121 memcpy(&obuf[2],msg[i].buf,msg[i].len);
122
123 if (cxusb_ctrl_msg(d,CMD_I2C_WRITE, obuf, 2+msg[i].len, &ibuf,1) < 0)
124 break;
125 if (ibuf != 0x08)
126 deb_info("i2c write could have been failed\n");
127 }
128 }
129
130 up(&d->i2c_sem);
131 return i;
132}
133
134static u32 cxusb_i2c_func(struct i2c_adapter *adapter)
135{
136 return I2C_FUNC_I2C;
137}
138
139static struct i2c_algorithm cxusb_i2c_algo = {
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700140 .master_xfer = cxusb_i2c_xfer,
141 .functionality = cxusb_i2c_func,
142};
143
144static int cxusb_power_ctrl(struct dvb_usb_device *d, int onoff)
145{
Patrick Boettchere2efeab2005-09-09 13:02:51 -0700146 u8 b = 0;
147 if (onoff)
148 return cxusb_ctrl_msg(d, CMD_POWER_ON, &b, 1, NULL, 0);
149 else
150 return cxusb_ctrl_msg(d, CMD_POWER_OFF, &b, 1, NULL, 0);
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700151}
152
153static int cxusb_streaming_ctrl(struct dvb_usb_device *d, int onoff)
154{
Patrick Boettcher8257e8a2005-07-07 17:58:15 -0700155 u8 buf[2] = { 0x03, 0x00 };
156 if (onoff)
Patrick Boettchere2efeab2005-09-09 13:02:51 -0700157 cxusb_ctrl_msg(d,CMD_STREAMING_ON, buf, 2, NULL, 0);
Patrick Boettcher8257e8a2005-07-07 17:58:15 -0700158 else
Patrick Boettchere2efeab2005-09-09 13:02:51 -0700159 cxusb_ctrl_msg(d,CMD_STREAMING_OFF, NULL, 0, NULL, 0);
Patrick Boettcher8257e8a2005-07-07 17:58:15 -0700160
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700161 return 0;
162}
163
Chris Pascoe7c239702006-01-09 18:21:29 -0200164static int cxusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
165{
166 struct dvb_usb_rc_key *keymap = d->props.rc_key_map;
Michael Krufkya07e6092006-01-09 18:21:31 -0200167 u8 ircode[4];
Chris Pascoe7c239702006-01-09 18:21:29 -0200168 int i;
169
Michael Krufkya07e6092006-01-09 18:21:31 -0200170 cxusb_ctrl_msg(d, CMD_GET_IR_CODE, NULL, 0, ircode, 4);
Chris Pascoe7c239702006-01-09 18:21:29 -0200171
172 *event = 0;
173 *state = REMOTE_NO_KEY_PRESSED;
174
175 for (i = 0; i < d->props.rc_key_map_size; i++) {
Michael Krufkya07e6092006-01-09 18:21:31 -0200176 if (keymap[i].custom == ircode[2] &&
177 keymap[i].data == ircode[3]) {
Chris Pascoe7c239702006-01-09 18:21:29 -0200178 *event = keymap[i].event;
179 *state = REMOTE_KEY_PRESSED;
180
181 return 0;
182 }
183 }
184
185 return 0;
186}
187
Michael Krufkya07e6092006-01-09 18:21:31 -0200188struct dvb_usb_rc_key dvico_mce_rc_keys[] = {
189 { 0xfe, 0x02, KEY_TV },
190 { 0xfe, 0x0e, KEY_MP3 },
191 { 0xfe, 0x1a, KEY_DVD },
192 { 0xfe, 0x1e, KEY_FAVORITES },
193 { 0xfe, 0x16, KEY_SETUP },
194 { 0xfe, 0x46, KEY_POWER2 },
195 { 0xfe, 0x0a, KEY_EPG },
196 { 0xfe, 0x49, KEY_BACK },
197 { 0xfe, 0x4d, KEY_MENU },
198 { 0xfe, 0x51, KEY_UP },
199 { 0xfe, 0x5b, KEY_LEFT },
200 { 0xfe, 0x5f, KEY_RIGHT },
201 { 0xfe, 0x53, KEY_DOWN },
202 { 0xfe, 0x5e, KEY_OK },
203 { 0xfe, 0x59, KEY_INFO },
204 { 0xfe, 0x55, KEY_TAB },
205 { 0xfe, 0x0f, KEY_PREVIOUSSONG },/* Replay */
206 { 0xfe, 0x12, KEY_NEXTSONG }, /* Skip */
207 { 0xfe, 0x42, KEY_ENTER }, /* Windows/Start */
208 { 0xfe, 0x15, KEY_VOLUMEUP },
209 { 0xfe, 0x05, KEY_VOLUMEDOWN },
210 { 0xfe, 0x11, KEY_CHANNELUP },
211 { 0xfe, 0x09, KEY_CHANNELDOWN },
212 { 0xfe, 0x52, KEY_CAMERA },
213 { 0xfe, 0x5a, KEY_TUNER }, /* Live */
214 { 0xfe, 0x19, KEY_OPEN },
215 { 0xfe, 0x0b, KEY_1 },
216 { 0xfe, 0x17, KEY_2 },
217 { 0xfe, 0x1b, KEY_3 },
218 { 0xfe, 0x07, KEY_4 },
219 { 0xfe, 0x50, KEY_5 },
220 { 0xfe, 0x54, KEY_6 },
221 { 0xfe, 0x48, KEY_7 },
222 { 0xfe, 0x4c, KEY_8 },
223 { 0xfe, 0x58, KEY_9 },
224 { 0xfe, 0x13, KEY_ANGLE }, /* Aspect */
225 { 0xfe, 0x03, KEY_0 },
226 { 0xfe, 0x1f, KEY_ZOOM },
227 { 0xfe, 0x43, KEY_REWIND },
228 { 0xfe, 0x47, KEY_PLAYPAUSE },
229 { 0xfe, 0x4f, KEY_FASTFORWARD },
230 { 0xfe, 0x57, KEY_MUTE },
231 { 0xfe, 0x0d, KEY_STOP },
232 { 0xfe, 0x01, KEY_RECORD },
233 { 0xfe, 0x4e, KEY_POWER },
234};
235
Chris Pascoe0029ee12006-01-09 18:21:28 -0200236static int cxusb_dee1601_demod_init(struct dvb_frontend* fe)
237{
238 static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x38 };
239 static u8 reset [] = { RESET, 0x80 };
240 static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 };
241 static u8 agc_cfg [] = { AGC_TARGET, 0x28, 0x20 };
242 static u8 gpp_ctl_cfg [] = { GPP_CTL, 0x33 };
243 static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 };
244
245 mt352_write(fe, clock_config, sizeof(clock_config));
246 udelay(200);
247 mt352_write(fe, reset, sizeof(reset));
248 mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
249
250 mt352_write(fe, agc_cfg, sizeof(agc_cfg));
251 mt352_write(fe, gpp_ctl_cfg, sizeof(gpp_ctl_cfg));
252 mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
253
254 return 0;
255}
256
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700257struct cx22702_config cxusb_cx22702_config = {
258 .demod_address = 0x63,
259
Patrick Boettcher8257e8a2005-07-07 17:58:15 -0700260 .output_mode = CX22702_PARALLEL_OUTPUT,
261
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700262 .pll_init = dvb_usb_pll_init_i2c,
263 .pll_set = dvb_usb_pll_set_i2c,
264};
265
Michael Krufkyeffee032006-01-09 15:25:47 -0200266struct lgdt330x_config cxusb_lgdt330x_config = {
267 .demod_address = 0x0e,
268 .demod_chip = LGDT3303,
269 .pll_set = dvb_usb_pll_set_i2c,
270};
271
Chris Pascoe0029ee12006-01-09 18:21:28 -0200272struct mt352_config cxusb_dee1601_config = {
273 .demod_address = 0x0f,
274 .demod_init = cxusb_dee1601_demod_init,
275 .pll_set = dvb_usb_pll_set,
276};
277
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700278/* Callbacks for DVB USB */
Michael Krufkyeffee032006-01-09 15:25:47 -0200279static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_device *d)
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700280{
281 u8 bpll[4] = { 0x0b, 0xdc, 0x9c, 0xa0 };
282 d->pll_addr = 0x61;
Michael Krufkyeffee032006-01-09 15:25:47 -0200283 memcpy(d->pll_init, bpll, 4);
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700284 d->pll_desc = &dvb_pll_fmd1216me;
285 return 0;
286}
287
Michael Krufkyeffee032006-01-09 15:25:47 -0200288static int cxusb_lgh064f_tuner_attach(struct dvb_usb_device *d)
289{
290 u8 bpll[4] = { 0x00, 0x00, 0x18, 0x50 };
291 /* bpll[2] : unset bit 3, set bits 4&5
292 bpll[3] : 0x50 - digital, 0x20 - analog */
293 d->pll_addr = 0x61;
294 memcpy(d->pll_init, bpll, 4);
295 d->pll_desc = &dvb_pll_tdvs_tua6034;
296 return 0;
297}
298
Chris Pascoe0029ee12006-01-09 18:21:28 -0200299static int cxusb_dee1601_tuner_attach(struct dvb_usb_device *d)
300{
301 d->pll_addr = 0x61;
302 d->pll_desc = &dvb_pll_thomson_dtt7579;
303 return 0;
304}
305
Michael Krufkyeffee032006-01-09 15:25:47 -0200306static int cxusb_cx22702_frontend_attach(struct dvb_usb_device *d)
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700307{
Patrick Boettchere2efeab2005-09-09 13:02:51 -0700308 u8 b;
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700309 if (usb_set_interface(d->udev,0,6) < 0)
Patrick Boettcher8257e8a2005-07-07 17:58:15 -0700310 err("set interface failed");
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700311
Patrick Boettchere2efeab2005-09-09 13:02:51 -0700312 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, &b, 1);
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700313
314 if ((d->fe = cx22702_attach(&cxusb_cx22702_config, &d->i2c_adap)) != NULL)
315 return 0;
316
317 return -EIO;
318}
319
Michael Krufkyeffee032006-01-09 15:25:47 -0200320static int cxusb_lgdt330x_frontend_attach(struct dvb_usb_device *d)
321{
Michael Krufky37bdfa02006-01-09 15:25:47 -0200322 if (usb_set_interface(d->udev,0,7) < 0)
Michael Krufkyeffee032006-01-09 15:25:47 -0200323 err("set interface failed");
324
325 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0);
326
327 if ((d->fe = lgdt330x_attach(&cxusb_lgdt330x_config, &d->i2c_adap)) != NULL)
328 return 0;
329
330 return -EIO;
331}
332
Chris Pascoe0029ee12006-01-09 18:21:28 -0200333static int cxusb_dee1601_frontend_attach(struct dvb_usb_device *d)
334{
335 if (usb_set_interface(d->udev,0,0) < 0)
336 err("set interface failed");
337
338 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0);
339
340 if ((d->fe = mt352_attach(&cxusb_dee1601_config, &d->i2c_adap)) != NULL)
341 return 0;
342
343 return -EIO;
344}
345
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700346/* DVB USB Driver stuff */
Michael Krufkyeffee032006-01-09 15:25:47 -0200347static struct dvb_usb_properties cxusb_medion_properties;
Michael Krufkye71bb542006-01-09 15:32:42 -0200348static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties;
Chris Pascoe0029ee12006-01-09 18:21:28 -0200349static struct dvb_usb_properties cxusb_bluebird_dee1601_properties;
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700350
351static int cxusb_probe(struct usb_interface *intf,
352 const struct usb_device_id *id)
353{
Michael Krufkyeffee032006-01-09 15:25:47 -0200354 if (dvb_usb_device_init(intf,&cxusb_medion_properties,THIS_MODULE,NULL) == 0 ||
Chris Pascoe0029ee12006-01-09 18:21:28 -0200355 dvb_usb_device_init(intf,&cxusb_bluebird_lgh064f_properties,THIS_MODULE,NULL) == 0 ||
Michael Krufkya07e6092006-01-09 18:21:31 -0200356 dvb_usb_device_init(intf,&cxusb_bluebird_dee1601_properties,THIS_MODULE,NULL) == 0) {
Michael Krufkyeffee032006-01-09 15:25:47 -0200357 return 0;
358 }
359
360 return -EINVAL;
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700361}
362
363static struct usb_device_id cxusb_table [] = {
364 { USB_DEVICE(USB_VID_MEDION, USB_PID_MEDION_MD95700) },
Michael Krufkyeffee032006-01-09 15:25:47 -0200365 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_COLD) },
366 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_WARM) },
Chris Pascoe0029ee12006-01-09 18:21:28 -0200367 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DEE1601_COLD) },
368 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DEE1601_WARM) },
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700369 {} /* Terminating entry */
370};
371MODULE_DEVICE_TABLE (usb, cxusb_table);
372
Michael Krufkyeffee032006-01-09 15:25:47 -0200373static struct dvb_usb_properties cxusb_medion_properties = {
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700374 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
375
376 .usb_ctrl = CYPRESS_FX2,
377
378 .size_of_priv = sizeof(struct cxusb_state),
379
380 .streaming_ctrl = cxusb_streaming_ctrl,
381 .power_ctrl = cxusb_power_ctrl,
Michael Krufkyeffee032006-01-09 15:25:47 -0200382 .frontend_attach = cxusb_cx22702_frontend_attach,
383 .tuner_attach = cxusb_fmd1216me_tuner_attach,
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700384
385 .i2c_algo = &cxusb_i2c_algo,
386
387 .generic_bulk_ctrl_endpoint = 0x01,
388 /* parameter for the MPEG2-data transfer */
389 .urb = {
Patrick Boettchere2efeab2005-09-09 13:02:51 -0700390 .type = DVB_USB_BULK,
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700391 .count = 5,
392 .endpoint = 0x02,
393 .u = {
Patrick Boettchere2efeab2005-09-09 13:02:51 -0700394 .bulk = {
395 .buffersize = 8192,
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700396 }
397 }
398 },
399
400 .num_device_descs = 1,
401 .devices = {
402 { "Medion MD95700 (MDUSBTV-HYBRID)",
403 { NULL },
404 { &cxusb_table[0], NULL },
405 },
406 }
407};
408
Michael Krufkye71bb542006-01-09 15:32:42 -0200409static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties = {
Michael Krufkyeffee032006-01-09 15:25:47 -0200410 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
411
412 .usb_ctrl = CYPRESS_FX2,
Michael Krufky37bdfa02006-01-09 15:25:47 -0200413 .firmware = "dvb-usb-bluebird-01.fw",
414 /* use usb alt setting 0 for EP4 transfer (dvb-t),
415 use usb alt setting 7 for EP2 transfer (atsc) */
Michael Krufkyeffee032006-01-09 15:25:47 -0200416
417 .size_of_priv = sizeof(struct cxusb_state),
418
419 .streaming_ctrl = cxusb_streaming_ctrl,
420 .power_ctrl = cxusb_power_ctrl,
421 .frontend_attach = cxusb_lgdt330x_frontend_attach,
422 .tuner_attach = cxusb_lgh064f_tuner_attach,
423
424 .i2c_algo = &cxusb_i2c_algo,
425
426 .generic_bulk_ctrl_endpoint = 0x01,
427 /* parameter for the MPEG2-data transfer */
428 .urb = {
429 .type = DVB_USB_BULK,
430 .count = 5,
431 .endpoint = 0x02,
432 .u = {
433 .bulk = {
434 .buffersize = 8192,
435 }
436 }
437 },
438
439 .num_device_descs = 1,
440 .devices = {
441 { "DViCO FusionHDTV5 USB Gold",
442 { &cxusb_table[1], NULL },
443 { &cxusb_table[2], NULL },
444 },
445 }
446};
447
Chris Pascoe0029ee12006-01-09 18:21:28 -0200448static struct dvb_usb_properties cxusb_bluebird_dee1601_properties = {
449 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
450
451 .usb_ctrl = CYPRESS_FX2,
452 .firmware = "dvb-usb-bluebird-01.fw",
453 /* use usb alt setting 0 for EP4 transfer (dvb-t),
454 use usb alt setting 7 for EP2 transfer (atsc) */
455
456 .size_of_priv = sizeof(struct cxusb_state),
457
458 .streaming_ctrl = cxusb_streaming_ctrl,
459 .power_ctrl = cxusb_power_ctrl,
460 .frontend_attach = cxusb_dee1601_frontend_attach,
461 .tuner_attach = cxusb_dee1601_tuner_attach,
462
463 .i2c_algo = &cxusb_i2c_algo,
464
Chris Pascoe7c239702006-01-09 18:21:29 -0200465 .rc_interval = 150,
466 .rc_key_map = dvico_mce_rc_keys,
467 .rc_key_map_size = ARRAY_SIZE(dvico_mce_rc_keys),
468 .rc_query = cxusb_rc_query,
469
Chris Pascoe0029ee12006-01-09 18:21:28 -0200470 .generic_bulk_ctrl_endpoint = 0x01,
471 /* parameter for the MPEG2-data transfer */
472 .urb = {
473 .type = DVB_USB_BULK,
474 .count = 5,
475 .endpoint = 0x04,
476 .u = {
477 .bulk = {
478 .buffersize = 8192,
479 }
480 }
481 },
482
483 .num_device_descs = 1,
484 .devices = {
485 { "DViCO FusionHDTV DVB-T Dual USB",
486 { &cxusb_table[3], NULL },
487 { &cxusb_table[4], NULL },
488 },
489 }
490};
491
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700492static struct usb_driver cxusb_driver = {
Patrick Boettcher63b5c1c2005-07-07 17:58:30 -0700493 .name = "dvb_usb_cxusb",
Patrick Boettcher22c6d932005-07-07 17:58:10 -0700494 .probe = cxusb_probe,
495 .disconnect = dvb_usb_device_exit,
496 .id_table = cxusb_table,
497};
498
499/* module stuff */
500static int __init cxusb_module_init(void)
501{
502 int result;
503 if ((result = usb_register(&cxusb_driver))) {
504 err("usb_register failed. Error number %d",result);
505 return result;
506 }
507
508 return 0;
509}
510
511static void __exit cxusb_module_exit(void)
512{
513 /* deregister this driver from the USB subsystem */
514 usb_deregister(&cxusb_driver);
515}
516
517module_init (cxusb_module_init);
518module_exit (cxusb_module_exit);
519
520MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
521MODULE_DESCRIPTION("Driver for Conexant USB2.0 hybrid reference design");
522MODULE_VERSION("1.0-alpha");
523MODULE_LICENSE("GPL");