Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 1 | /* 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 Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 17 | * Copyright (C) 2005 Patrick Boettcher (patrick.boettcher@desy.de) |
| 18 | * |
| 19 | * This program is free software; you can redistribute it and/or modify it |
| 20 | * under the terms of the GNU General Public License as published by the Free |
| 21 | * Software Foundation, version 2. |
| 22 | * |
| 23 | * see Documentation/dvb/README.dvb-usb for more information |
| 24 | */ |
| 25 | #include "cxusb.h" |
| 26 | |
| 27 | #include "cx22702.h" |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 28 | #include "lgdt330x.h" |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame^] | 29 | #include "mt352.h" |
| 30 | #include "mt352_priv.h" |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 31 | |
| 32 | /* debug */ |
| 33 | int dvb_usb_cxusb_debug; |
| 34 | module_param_named(debug,dvb_usb_cxusb_debug, int, 0644); |
| 35 | MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS); |
| 36 | |
| 37 | static int cxusb_ctrl_msg(struct dvb_usb_device *d, |
| 38 | u8 cmd, u8 *wbuf, int wlen, u8 *rbuf, int rlen) |
| 39 | { |
| 40 | int wo = (rbuf == NULL || rlen == 0); /* write-only */ |
| 41 | u8 sndbuf[1+wlen]; |
| 42 | memset(sndbuf,0,1+wlen); |
| 43 | |
| 44 | sndbuf[0] = cmd; |
| 45 | memcpy(&sndbuf[1],wbuf,wlen); |
| 46 | if (wo) |
| 47 | dvb_usb_generic_write(d,sndbuf,1+wlen); |
| 48 | else |
| 49 | dvb_usb_generic_rw(d,sndbuf,1+wlen,rbuf,rlen,0); |
| 50 | |
| 51 | return 0; |
| 52 | } |
| 53 | |
Patrick Boettcher | e2efeab | 2005-09-09 13:02:51 -0700 | [diff] [blame] | 54 | /* GPIO */ |
| 55 | static void cxusb_gpio_tuner(struct dvb_usb_device *d, int onoff) |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 56 | { |
| 57 | struct cxusb_state *st = d->priv; |
| 58 | u8 o[2],i; |
| 59 | |
Patrick Boettcher | e2efeab | 2005-09-09 13:02:51 -0700 | [diff] [blame] | 60 | if (st->gpio_write_state[GPIO_TUNER] == onoff) |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 61 | return; |
| 62 | |
Patrick Boettcher | e2efeab | 2005-09-09 13:02:51 -0700 | [diff] [blame] | 63 | o[0] = GPIO_TUNER; |
| 64 | o[1] = onoff; |
| 65 | cxusb_ctrl_msg(d,CMD_GPIO_WRITE,o,2,&i,1); |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 66 | |
| 67 | if (i != 0x01) |
Patrick Boettcher | e2efeab | 2005-09-09 13:02:51 -0700 | [diff] [blame] | 68 | deb_info("gpio_write failed.\n"); |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 69 | |
Patrick Boettcher | e2efeab | 2005-09-09 13:02:51 -0700 | [diff] [blame] | 70 | st->gpio_write_state[GPIO_TUNER] = onoff; |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 71 | } |
| 72 | |
Patrick Boettcher | e2efeab | 2005-09-09 13:02:51 -0700 | [diff] [blame] | 73 | /* I2C */ |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 74 | static int cxusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num) |
| 75 | { |
| 76 | struct dvb_usb_device *d = i2c_get_adapdata(adap); |
| 77 | int i; |
| 78 | |
| 79 | if (down_interruptible(&d->i2c_sem) < 0) |
| 80 | return -EAGAIN; |
| 81 | |
| 82 | if (num > 2) |
| 83 | warn("more than 2 i2c messages at a time is not handled yet. TODO."); |
| 84 | |
| 85 | for (i = 0; i < num; i++) { |
| 86 | |
| 87 | switch (msg[i].addr) { |
| 88 | case 0x63: |
Patrick Boettcher | e2efeab | 2005-09-09 13:02:51 -0700 | [diff] [blame] | 89 | cxusb_gpio_tuner(d,0); |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 90 | break; |
| 91 | default: |
Patrick Boettcher | e2efeab | 2005-09-09 13:02:51 -0700 | [diff] [blame] | 92 | cxusb_gpio_tuner(d,1); |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 93 | break; |
| 94 | } |
| 95 | |
| 96 | /* read request */ |
| 97 | if (i+1 < num && (msg[i+1].flags & I2C_M_RD)) { |
| 98 | u8 obuf[3+msg[i].len], ibuf[1+msg[i+1].len]; |
| 99 | obuf[0] = msg[i].len; |
| 100 | obuf[1] = msg[i+1].len; |
| 101 | obuf[2] = msg[i].addr; |
| 102 | memcpy(&obuf[3],msg[i].buf,msg[i].len); |
| 103 | |
| 104 | if (cxusb_ctrl_msg(d, CMD_I2C_READ, |
| 105 | obuf, 3+msg[i].len, |
| 106 | ibuf, 1+msg[i+1].len) < 0) |
| 107 | break; |
| 108 | |
| 109 | if (ibuf[0] != 0x08) |
| 110 | deb_info("i2c read could have been failed\n"); |
| 111 | |
| 112 | memcpy(msg[i+1].buf,&ibuf[1],msg[i+1].len); |
| 113 | |
| 114 | i++; |
| 115 | } else { /* write */ |
| 116 | u8 obuf[2+msg[i].len], ibuf; |
| 117 | obuf[0] = msg[i].addr; |
| 118 | obuf[1] = msg[i].len; |
| 119 | memcpy(&obuf[2],msg[i].buf,msg[i].len); |
| 120 | |
| 121 | if (cxusb_ctrl_msg(d,CMD_I2C_WRITE, obuf, 2+msg[i].len, &ibuf,1) < 0) |
| 122 | break; |
| 123 | if (ibuf != 0x08) |
| 124 | deb_info("i2c write could have been failed\n"); |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | up(&d->i2c_sem); |
| 129 | return i; |
| 130 | } |
| 131 | |
| 132 | static u32 cxusb_i2c_func(struct i2c_adapter *adapter) |
| 133 | { |
| 134 | return I2C_FUNC_I2C; |
| 135 | } |
| 136 | |
| 137 | static struct i2c_algorithm cxusb_i2c_algo = { |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 138 | .master_xfer = cxusb_i2c_xfer, |
| 139 | .functionality = cxusb_i2c_func, |
| 140 | }; |
| 141 | |
| 142 | static int cxusb_power_ctrl(struct dvb_usb_device *d, int onoff) |
| 143 | { |
Patrick Boettcher | e2efeab | 2005-09-09 13:02:51 -0700 | [diff] [blame] | 144 | u8 b = 0; |
| 145 | if (onoff) |
| 146 | return cxusb_ctrl_msg(d, CMD_POWER_ON, &b, 1, NULL, 0); |
| 147 | else |
| 148 | return cxusb_ctrl_msg(d, CMD_POWER_OFF, &b, 1, NULL, 0); |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 149 | } |
| 150 | |
| 151 | static int cxusb_streaming_ctrl(struct dvb_usb_device *d, int onoff) |
| 152 | { |
Patrick Boettcher | 8257e8a | 2005-07-07 17:58:15 -0700 | [diff] [blame] | 153 | u8 buf[2] = { 0x03, 0x00 }; |
| 154 | if (onoff) |
Patrick Boettcher | e2efeab | 2005-09-09 13:02:51 -0700 | [diff] [blame] | 155 | cxusb_ctrl_msg(d,CMD_STREAMING_ON, buf, 2, NULL, 0); |
Patrick Boettcher | 8257e8a | 2005-07-07 17:58:15 -0700 | [diff] [blame] | 156 | else |
Patrick Boettcher | e2efeab | 2005-09-09 13:02:51 -0700 | [diff] [blame] | 157 | cxusb_ctrl_msg(d,CMD_STREAMING_OFF, NULL, 0, NULL, 0); |
Patrick Boettcher | 8257e8a | 2005-07-07 17:58:15 -0700 | [diff] [blame] | 158 | |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 159 | return 0; |
| 160 | } |
| 161 | |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame^] | 162 | static int cxusb_dee1601_demod_init(struct dvb_frontend* fe) |
| 163 | { |
| 164 | static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x38 }; |
| 165 | static u8 reset [] = { RESET, 0x80 }; |
| 166 | static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 }; |
| 167 | static u8 agc_cfg [] = { AGC_TARGET, 0x28, 0x20 }; |
| 168 | static u8 gpp_ctl_cfg [] = { GPP_CTL, 0x33 }; |
| 169 | static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 }; |
| 170 | |
| 171 | mt352_write(fe, clock_config, sizeof(clock_config)); |
| 172 | udelay(200); |
| 173 | mt352_write(fe, reset, sizeof(reset)); |
| 174 | mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg)); |
| 175 | |
| 176 | mt352_write(fe, agc_cfg, sizeof(agc_cfg)); |
| 177 | mt352_write(fe, gpp_ctl_cfg, sizeof(gpp_ctl_cfg)); |
| 178 | mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg)); |
| 179 | |
| 180 | return 0; |
| 181 | } |
| 182 | |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 183 | struct cx22702_config cxusb_cx22702_config = { |
| 184 | .demod_address = 0x63, |
| 185 | |
Patrick Boettcher | 8257e8a | 2005-07-07 17:58:15 -0700 | [diff] [blame] | 186 | .output_mode = CX22702_PARALLEL_OUTPUT, |
| 187 | |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 188 | .pll_init = dvb_usb_pll_init_i2c, |
| 189 | .pll_set = dvb_usb_pll_set_i2c, |
| 190 | }; |
| 191 | |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 192 | struct lgdt330x_config cxusb_lgdt330x_config = { |
| 193 | .demod_address = 0x0e, |
| 194 | .demod_chip = LGDT3303, |
| 195 | .pll_set = dvb_usb_pll_set_i2c, |
| 196 | }; |
| 197 | |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame^] | 198 | struct mt352_config cxusb_dee1601_config = { |
| 199 | .demod_address = 0x0f, |
| 200 | .demod_init = cxusb_dee1601_demod_init, |
| 201 | .pll_set = dvb_usb_pll_set, |
| 202 | }; |
| 203 | |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 204 | /* Callbacks for DVB USB */ |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 205 | static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_device *d) |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 206 | { |
| 207 | u8 bpll[4] = { 0x0b, 0xdc, 0x9c, 0xa0 }; |
| 208 | d->pll_addr = 0x61; |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 209 | memcpy(d->pll_init, bpll, 4); |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 210 | d->pll_desc = &dvb_pll_fmd1216me; |
| 211 | return 0; |
| 212 | } |
| 213 | |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 214 | static int cxusb_lgh064f_tuner_attach(struct dvb_usb_device *d) |
| 215 | { |
| 216 | u8 bpll[4] = { 0x00, 0x00, 0x18, 0x50 }; |
| 217 | /* bpll[2] : unset bit 3, set bits 4&5 |
| 218 | bpll[3] : 0x50 - digital, 0x20 - analog */ |
| 219 | d->pll_addr = 0x61; |
| 220 | memcpy(d->pll_init, bpll, 4); |
| 221 | d->pll_desc = &dvb_pll_tdvs_tua6034; |
| 222 | return 0; |
| 223 | } |
| 224 | |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame^] | 225 | static int cxusb_dee1601_tuner_attach(struct dvb_usb_device *d) |
| 226 | { |
| 227 | d->pll_addr = 0x61; |
| 228 | d->pll_desc = &dvb_pll_thomson_dtt7579; |
| 229 | return 0; |
| 230 | } |
| 231 | |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 232 | static int cxusb_cx22702_frontend_attach(struct dvb_usb_device *d) |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 233 | { |
Patrick Boettcher | e2efeab | 2005-09-09 13:02:51 -0700 | [diff] [blame] | 234 | u8 b; |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 235 | if (usb_set_interface(d->udev,0,6) < 0) |
Patrick Boettcher | 8257e8a | 2005-07-07 17:58:15 -0700 | [diff] [blame] | 236 | err("set interface failed"); |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 237 | |
Patrick Boettcher | e2efeab | 2005-09-09 13:02:51 -0700 | [diff] [blame] | 238 | cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, &b, 1); |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 239 | |
| 240 | if ((d->fe = cx22702_attach(&cxusb_cx22702_config, &d->i2c_adap)) != NULL) |
| 241 | return 0; |
| 242 | |
| 243 | return -EIO; |
| 244 | } |
| 245 | |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 246 | static int cxusb_lgdt330x_frontend_attach(struct dvb_usb_device *d) |
| 247 | { |
Michael Krufky | 37bdfa0 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 248 | if (usb_set_interface(d->udev,0,7) < 0) |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 249 | err("set interface failed"); |
| 250 | |
| 251 | cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); |
| 252 | |
| 253 | if ((d->fe = lgdt330x_attach(&cxusb_lgdt330x_config, &d->i2c_adap)) != NULL) |
| 254 | return 0; |
| 255 | |
| 256 | return -EIO; |
| 257 | } |
| 258 | |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame^] | 259 | static int cxusb_dee1601_frontend_attach(struct dvb_usb_device *d) |
| 260 | { |
| 261 | if (usb_set_interface(d->udev,0,0) < 0) |
| 262 | err("set interface failed"); |
| 263 | |
| 264 | cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); |
| 265 | |
| 266 | if ((d->fe = mt352_attach(&cxusb_dee1601_config, &d->i2c_adap)) != NULL) |
| 267 | return 0; |
| 268 | |
| 269 | return -EIO; |
| 270 | } |
| 271 | |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 272 | /* DVB USB Driver stuff */ |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 273 | static struct dvb_usb_properties cxusb_medion_properties; |
Michael Krufky | e71bb54 | 2006-01-09 15:32:42 -0200 | [diff] [blame] | 274 | static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties; |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame^] | 275 | static struct dvb_usb_properties cxusb_bluebird_dee1601_properties; |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 276 | |
| 277 | static int cxusb_probe(struct usb_interface *intf, |
| 278 | const struct usb_device_id *id) |
| 279 | { |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 280 | if (dvb_usb_device_init(intf,&cxusb_medion_properties,THIS_MODULE,NULL) == 0 || |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame^] | 281 | dvb_usb_device_init(intf,&cxusb_bluebird_lgh064f_properties,THIS_MODULE,NULL) == 0 || |
| 282 | dvb_usb_device_init(intf,&cxusb_bluebird_dee1601_properties,THIS_MODULE,NULL) == 0 |
| 283 | ){ |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 284 | return 0; |
| 285 | } |
| 286 | |
| 287 | return -EINVAL; |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 288 | } |
| 289 | |
| 290 | static struct usb_device_id cxusb_table [] = { |
| 291 | { USB_DEVICE(USB_VID_MEDION, USB_PID_MEDION_MD95700) }, |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 292 | { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_COLD) }, |
| 293 | { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_WARM) }, |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame^] | 294 | { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DEE1601_COLD) }, |
| 295 | { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DEE1601_WARM) }, |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 296 | {} /* Terminating entry */ |
| 297 | }; |
| 298 | MODULE_DEVICE_TABLE (usb, cxusb_table); |
| 299 | |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 300 | static struct dvb_usb_properties cxusb_medion_properties = { |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 301 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
| 302 | |
| 303 | .usb_ctrl = CYPRESS_FX2, |
| 304 | |
| 305 | .size_of_priv = sizeof(struct cxusb_state), |
| 306 | |
| 307 | .streaming_ctrl = cxusb_streaming_ctrl, |
| 308 | .power_ctrl = cxusb_power_ctrl, |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 309 | .frontend_attach = cxusb_cx22702_frontend_attach, |
| 310 | .tuner_attach = cxusb_fmd1216me_tuner_attach, |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 311 | |
| 312 | .i2c_algo = &cxusb_i2c_algo, |
| 313 | |
| 314 | .generic_bulk_ctrl_endpoint = 0x01, |
| 315 | /* parameter for the MPEG2-data transfer */ |
| 316 | .urb = { |
Patrick Boettcher | e2efeab | 2005-09-09 13:02:51 -0700 | [diff] [blame] | 317 | .type = DVB_USB_BULK, |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 318 | .count = 5, |
| 319 | .endpoint = 0x02, |
| 320 | .u = { |
Patrick Boettcher | e2efeab | 2005-09-09 13:02:51 -0700 | [diff] [blame] | 321 | .bulk = { |
| 322 | .buffersize = 8192, |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 323 | } |
| 324 | } |
| 325 | }, |
| 326 | |
| 327 | .num_device_descs = 1, |
| 328 | .devices = { |
| 329 | { "Medion MD95700 (MDUSBTV-HYBRID)", |
| 330 | { NULL }, |
| 331 | { &cxusb_table[0], NULL }, |
| 332 | }, |
| 333 | } |
| 334 | }; |
| 335 | |
Michael Krufky | e71bb54 | 2006-01-09 15:32:42 -0200 | [diff] [blame] | 336 | static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties = { |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 337 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
| 338 | |
| 339 | .usb_ctrl = CYPRESS_FX2, |
Michael Krufky | 37bdfa0 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 340 | .firmware = "dvb-usb-bluebird-01.fw", |
| 341 | /* use usb alt setting 0 for EP4 transfer (dvb-t), |
| 342 | use usb alt setting 7 for EP2 transfer (atsc) */ |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 343 | |
| 344 | .size_of_priv = sizeof(struct cxusb_state), |
| 345 | |
| 346 | .streaming_ctrl = cxusb_streaming_ctrl, |
| 347 | .power_ctrl = cxusb_power_ctrl, |
| 348 | .frontend_attach = cxusb_lgdt330x_frontend_attach, |
| 349 | .tuner_attach = cxusb_lgh064f_tuner_attach, |
| 350 | |
| 351 | .i2c_algo = &cxusb_i2c_algo, |
| 352 | |
| 353 | .generic_bulk_ctrl_endpoint = 0x01, |
| 354 | /* parameter for the MPEG2-data transfer */ |
| 355 | .urb = { |
| 356 | .type = DVB_USB_BULK, |
| 357 | .count = 5, |
| 358 | .endpoint = 0x02, |
| 359 | .u = { |
| 360 | .bulk = { |
| 361 | .buffersize = 8192, |
| 362 | } |
| 363 | } |
| 364 | }, |
| 365 | |
| 366 | .num_device_descs = 1, |
| 367 | .devices = { |
| 368 | { "DViCO FusionHDTV5 USB Gold", |
| 369 | { &cxusb_table[1], NULL }, |
| 370 | { &cxusb_table[2], NULL }, |
| 371 | }, |
| 372 | } |
| 373 | }; |
| 374 | |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame^] | 375 | static struct dvb_usb_properties cxusb_bluebird_dee1601_properties = { |
| 376 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
| 377 | |
| 378 | .usb_ctrl = CYPRESS_FX2, |
| 379 | .firmware = "dvb-usb-bluebird-01.fw", |
| 380 | /* use usb alt setting 0 for EP4 transfer (dvb-t), |
| 381 | use usb alt setting 7 for EP2 transfer (atsc) */ |
| 382 | |
| 383 | .size_of_priv = sizeof(struct cxusb_state), |
| 384 | |
| 385 | .streaming_ctrl = cxusb_streaming_ctrl, |
| 386 | .power_ctrl = cxusb_power_ctrl, |
| 387 | .frontend_attach = cxusb_dee1601_frontend_attach, |
| 388 | .tuner_attach = cxusb_dee1601_tuner_attach, |
| 389 | |
| 390 | .i2c_algo = &cxusb_i2c_algo, |
| 391 | |
| 392 | .generic_bulk_ctrl_endpoint = 0x01, |
| 393 | /* parameter for the MPEG2-data transfer */ |
| 394 | .urb = { |
| 395 | .type = DVB_USB_BULK, |
| 396 | .count = 5, |
| 397 | .endpoint = 0x04, |
| 398 | .u = { |
| 399 | .bulk = { |
| 400 | .buffersize = 8192, |
| 401 | } |
| 402 | } |
| 403 | }, |
| 404 | |
| 405 | .num_device_descs = 1, |
| 406 | .devices = { |
| 407 | { "DViCO FusionHDTV DVB-T Dual USB", |
| 408 | { &cxusb_table[3], NULL }, |
| 409 | { &cxusb_table[4], NULL }, |
| 410 | }, |
| 411 | } |
| 412 | }; |
| 413 | |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 414 | static struct usb_driver cxusb_driver = { |
Patrick Boettcher | 63b5c1c | 2005-07-07 17:58:30 -0700 | [diff] [blame] | 415 | .name = "dvb_usb_cxusb", |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 416 | .probe = cxusb_probe, |
| 417 | .disconnect = dvb_usb_device_exit, |
| 418 | .id_table = cxusb_table, |
| 419 | }; |
| 420 | |
| 421 | /* module stuff */ |
| 422 | static int __init cxusb_module_init(void) |
| 423 | { |
| 424 | int result; |
| 425 | if ((result = usb_register(&cxusb_driver))) { |
| 426 | err("usb_register failed. Error number %d",result); |
| 427 | return result; |
| 428 | } |
| 429 | |
| 430 | return 0; |
| 431 | } |
| 432 | |
| 433 | static void __exit cxusb_module_exit(void) |
| 434 | { |
| 435 | /* deregister this driver from the USB subsystem */ |
| 436 | usb_deregister(&cxusb_driver); |
| 437 | } |
| 438 | |
| 439 | module_init (cxusb_module_init); |
| 440 | module_exit (cxusb_module_exit); |
| 441 | |
| 442 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); |
| 443 | MODULE_DESCRIPTION("Driver for Conexant USB2.0 hybrid reference design"); |
| 444 | MODULE_VERSION("1.0-alpha"); |
| 445 | MODULE_LICENSE("GPL"); |