Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 1 | /* DVB USB compliant linux driver for Technotrend DVB USB boxes and clones |
| 2 | * (e.g. Pinnacle 400e DVB-S USB2.0). |
| 3 | * |
| 4 | * The Pinnacle 400e uses the same protocol as the Technotrend USB1.1 boxes. |
| 5 | * |
| 6 | * TDA8263 + TDA10086 |
| 7 | * |
| 8 | * I2C addresses: |
| 9 | * 0x08 - LNBP21PD - LNB power supply |
| 10 | * 0x0e - TDA10086 - Demodulator |
| 11 | * 0x50 - FX2 eeprom |
| 12 | * 0x60 - TDA8263 - Tuner |
| 13 | * 0x78 ??? |
| 14 | * |
| 15 | * Copyright (c) 2002 Holger Waechtler <holger@convergence.de> |
| 16 | * Copyright (c) 2003 Felix Domke <tmbinc@elitedvb.net> |
| 17 | * Copyright (C) 2005-6 Patrick Boettcher <pb@linuxtv.org> |
| 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 | #define DVB_USB_LOG_PREFIX "ttusb2" |
| 26 | #include "dvb-usb.h" |
| 27 | |
| 28 | #include "ttusb2.h" |
| 29 | |
| 30 | #include "tda826x.h" |
| 31 | #include "tda10086.h" |
Guy Martin | 76952c7 | 2010-05-07 04:09:25 -0300 | [diff] [blame] | 32 | #include "tda1002x.h" |
Jose Alberto Reguero | c9f88aa | 2011-08-08 07:35:35 -0300 | [diff] [blame] | 33 | #include "tda10048.h" |
Guy Martin | 76952c7 | 2010-05-07 04:09:25 -0300 | [diff] [blame] | 34 | #include "tda827x.h" |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 35 | #include "lnbp21.h" |
| 36 | |
| 37 | /* debug */ |
| 38 | static int dvb_usb_ttusb2_debug; |
| 39 | #define deb_info(args...) dprintk(dvb_usb_ttusb2_debug,0x01,args) |
| 40 | module_param_named(debug,dvb_usb_ttusb2_debug, int, 0644); |
| 41 | MODULE_PARM_DESC(debug, "set debugging level (1=info (or-able))." DVB_USB_DEBUG_STATUS); |
| 42 | |
Janne Grunau | 78e9200 | 2008-04-09 19:13:13 -0300 | [diff] [blame] | 43 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); |
| 44 | |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 45 | struct ttusb2_state { |
| 46 | u8 id; |
David Henningsson | 9d1da73 | 2010-12-26 10:23:58 -0300 | [diff] [blame] | 47 | u16 last_rc_key; |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 48 | }; |
| 49 | |
| 50 | static int ttusb2_msg(struct dvb_usb_device *d, u8 cmd, |
| 51 | u8 *wbuf, int wlen, u8 *rbuf, int rlen) |
| 52 | { |
| 53 | struct ttusb2_state *st = d->priv; |
| 54 | u8 s[wlen+4],r[64] = { 0 }; |
| 55 | int ret = 0; |
| 56 | |
| 57 | memset(s,0,wlen+4); |
| 58 | |
| 59 | s[0] = 0xaa; |
| 60 | s[1] = ++st->id; |
| 61 | s[2] = cmd; |
| 62 | s[3] = wlen; |
| 63 | memcpy(&s[4],wbuf,wlen); |
| 64 | |
| 65 | ret = dvb_usb_generic_rw(d, s, wlen+4, r, 64, 0); |
| 66 | |
| 67 | if (ret != 0 || |
| 68 | r[0] != 0x55 || |
| 69 | r[1] != s[1] || |
| 70 | r[2] != cmd || |
| 71 | (rlen > 0 && r[3] != rlen)) { |
| 72 | warn("there might have been an error during control message transfer. (rlen = %d, was %d)",rlen,r[3]); |
| 73 | return -EIO; |
| 74 | } |
| 75 | |
| 76 | if (rlen > 0) |
| 77 | memcpy(rbuf, &r[4], rlen); |
| 78 | |
| 79 | return 0; |
| 80 | } |
| 81 | |
| 82 | static int ttusb2_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num) |
| 83 | { |
| 84 | struct dvb_usb_device *d = i2c_get_adapdata(adap); |
| 85 | static u8 obuf[60], ibuf[60]; |
Jose Alberto Reguero | c9f88aa | 2011-08-08 07:35:35 -0300 | [diff] [blame] | 86 | int i, write_read, read; |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 87 | |
| 88 | if (mutex_lock_interruptible(&d->i2c_mutex) < 0) |
| 89 | return -EAGAIN; |
| 90 | |
| 91 | if (num > 2) |
| 92 | warn("more than 2 i2c messages at a time is not handled yet. TODO."); |
| 93 | |
| 94 | for (i = 0; i < num; i++) { |
Jose Alberto Reguero | c9f88aa | 2011-08-08 07:35:35 -0300 | [diff] [blame] | 95 | write_read = i+1 < num && (msg[i+1].flags & I2C_M_RD); |
| 96 | read = msg[i].flags & I2C_M_RD; |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 97 | |
Jose Alberto Reguero | c9f88aa | 2011-08-08 07:35:35 -0300 | [diff] [blame] | 98 | obuf[0] = (msg[i].addr << 1) | (write_read | read); |
| 99 | if (read) |
| 100 | obuf[1] = 0; |
| 101 | else |
| 102 | obuf[1] = msg[i].len; |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 103 | |
| 104 | /* read request */ |
Jose Alberto Reguero | c9f88aa | 2011-08-08 07:35:35 -0300 | [diff] [blame] | 105 | if (write_read) |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 106 | obuf[2] = msg[i+1].len; |
Jose Alberto Reguero | c9f88aa | 2011-08-08 07:35:35 -0300 | [diff] [blame] | 107 | else if (read) |
| 108 | obuf[2] = msg[i].len; |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 109 | else |
| 110 | obuf[2] = 0; |
| 111 | |
Jose Alberto Reguero | c9f88aa | 2011-08-08 07:35:35 -0300 | [diff] [blame] | 112 | memcpy(&obuf[3], msg[i].buf, msg[i].len); |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 113 | |
| 114 | if (ttusb2_msg(d, CMD_I2C_XFER, obuf, msg[i].len+3, ibuf, obuf[2] + 3) < 0) { |
| 115 | err("i2c transfer failed."); |
| 116 | break; |
| 117 | } |
| 118 | |
Jose Alberto Reguero | c9f88aa | 2011-08-08 07:35:35 -0300 | [diff] [blame] | 119 | if (write_read) { |
| 120 | memcpy(msg[i+1].buf, &ibuf[3], msg[i+1].len); |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 121 | i++; |
Jose Alberto Reguero | c9f88aa | 2011-08-08 07:35:35 -0300 | [diff] [blame] | 122 | } else if (read) |
| 123 | memcpy(msg[i].buf, &ibuf[3], msg[i].len); |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 124 | } |
| 125 | |
| 126 | mutex_unlock(&d->i2c_mutex); |
| 127 | return i; |
| 128 | } |
| 129 | |
| 130 | static u32 ttusb2_i2c_func(struct i2c_adapter *adapter) |
| 131 | { |
| 132 | return I2C_FUNC_I2C; |
| 133 | } |
| 134 | |
| 135 | static struct i2c_algorithm ttusb2_i2c_algo = { |
| 136 | .master_xfer = ttusb2_i2c_xfer, |
| 137 | .functionality = ttusb2_i2c_func, |
| 138 | }; |
| 139 | |
David Henningsson | 9d1da73 | 2010-12-26 10:23:58 -0300 | [diff] [blame] | 140 | /* command to poll IR receiver (copied from pctv452e.c) */ |
| 141 | #define CMD_GET_IR_CODE 0x1b |
| 142 | |
| 143 | /* IR */ |
| 144 | static int tt3650_rc_query(struct dvb_usb_device *d) |
| 145 | { |
| 146 | int ret; |
| 147 | u8 rx[9]; /* A CMD_GET_IR_CODE reply is 9 bytes long */ |
| 148 | struct ttusb2_state *st = d->priv; |
| 149 | ret = ttusb2_msg(d, CMD_GET_IR_CODE, NULL, 0, rx, sizeof(rx)); |
| 150 | if (ret != 0) |
| 151 | return ret; |
| 152 | |
| 153 | if (rx[8] & 0x01) { |
| 154 | /* got a "press" event */ |
| 155 | st->last_rc_key = (rx[3] << 8) | rx[2]; |
| 156 | deb_info("%s: cmd=0x%02x sys=0x%02x\n", __func__, rx[2], rx[3]); |
| 157 | rc_keydown(d->rc_dev, st->last_rc_key, 0); |
| 158 | } else if (st->last_rc_key) { |
| 159 | rc_keyup(d->rc_dev); |
| 160 | st->last_rc_key = 0; |
| 161 | } |
| 162 | |
| 163 | return 0; |
| 164 | } |
| 165 | |
| 166 | |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 167 | /* Callbacks for DVB USB */ |
| 168 | static int ttusb2_identify_state (struct usb_device *udev, struct |
| 169 | dvb_usb_device_properties *props, struct dvb_usb_device_description **desc, |
| 170 | int *cold) |
| 171 | { |
| 172 | *cold = udev->descriptor.iManufacturer == 0 && udev->descriptor.iProduct == 0; |
| 173 | return 0; |
| 174 | } |
| 175 | |
| 176 | static int ttusb2_power_ctrl(struct dvb_usb_device *d, int onoff) |
| 177 | { |
| 178 | u8 b = onoff; |
| 179 | ttusb2_msg(d, CMD_POWER, &b, 0, NULL, 0); |
| 180 | return ttusb2_msg(d, CMD_POWER, &b, 1, NULL, 0); |
| 181 | } |
| 182 | |
| 183 | |
| 184 | static struct tda10086_config tda10086_config = { |
| 185 | .demod_address = 0x0e, |
| 186 | .invert = 0, |
Hartmut Hackmann | ea75baf | 2008-02-09 23:54:24 -0300 | [diff] [blame] | 187 | .diseqc_tone = 1, |
Hartmut Hackmann | 9a1b04e | 2008-04-09 23:07:11 -0300 | [diff] [blame] | 188 | .xtal_freq = TDA10086_XTAL_16M, |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 189 | }; |
| 190 | |
Guy Martin | 76952c7 | 2010-05-07 04:09:25 -0300 | [diff] [blame] | 191 | static struct tda10023_config tda10023_config = { |
| 192 | .demod_address = 0x0c, |
| 193 | .invert = 0, |
| 194 | .xtal = 16000000, |
| 195 | .pll_m = 11, |
| 196 | .pll_p = 3, |
| 197 | .pll_n = 1, |
| 198 | .deltaf = 0xa511, |
| 199 | }; |
| 200 | |
Jose Alberto Reguero | c9f88aa | 2011-08-08 07:35:35 -0300 | [diff] [blame] | 201 | static struct tda10048_config tda10048_config = { |
| 202 | .demod_address = 0x10 >> 1, |
| 203 | .output_mode = TDA10048_PARALLEL_OUTPUT, |
| 204 | .inversion = TDA10048_INVERSION_ON, |
| 205 | .dtv6_if_freq_khz = TDA10048_IF_4000, |
| 206 | .dtv7_if_freq_khz = TDA10048_IF_4500, |
| 207 | .dtv8_if_freq_khz = TDA10048_IF_5000, |
| 208 | .clk_freq_khz = TDA10048_CLK_16000, |
| 209 | .no_firmware = 1, |
| 210 | .set_pll = true , |
| 211 | .pll_m = 5, |
| 212 | .pll_n = 3, |
| 213 | .pll_p = 0, |
| 214 | }; |
| 215 | |
| 216 | static struct tda827x_config tda827x_config = { |
| 217 | .config = 0, |
| 218 | }; |
| 219 | |
Guy Martin | 76952c7 | 2010-05-07 04:09:25 -0300 | [diff] [blame] | 220 | static int ttusb2_frontend_tda10086_attach(struct dvb_usb_adapter *adap) |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 221 | { |
| 222 | if (usb_set_interface(adap->dev->udev,0,3) < 0) |
| 223 | err("set interface to alts=3 failed"); |
| 224 | |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 225 | if ((adap->fe_adap[0].fe = dvb_attach(tda10086_attach, &tda10086_config, &adap->dev->i2c_adap)) == NULL) { |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 226 | deb_info("TDA10086 attach failed\n"); |
| 227 | return -ENODEV; |
| 228 | } |
| 229 | |
| 230 | return 0; |
| 231 | } |
| 232 | |
Jose Alberto Reguero | c9f88aa | 2011-08-08 07:35:35 -0300 | [diff] [blame] | 233 | static int ttusb2_ct3650_i2c_gate_ctrl(struct dvb_frontend *fe, int enable) |
| 234 | { |
| 235 | struct dvb_usb_adapter *adap = fe->dvb->priv; |
| 236 | |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 237 | return adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].fe, enable); |
Jose Alberto Reguero | c9f88aa | 2011-08-08 07:35:35 -0300 | [diff] [blame] | 238 | } |
| 239 | |
Guy Martin | 76952c7 | 2010-05-07 04:09:25 -0300 | [diff] [blame] | 240 | static int ttusb2_frontend_tda10023_attach(struct dvb_usb_adapter *adap) |
| 241 | { |
| 242 | if (usb_set_interface(adap->dev->udev, 0, 3) < 0) |
| 243 | err("set interface to alts=3 failed"); |
Jose Alberto Reguero | c9f88aa | 2011-08-08 07:35:35 -0300 | [diff] [blame] | 244 | |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 245 | if (adap->fe_adap[0].fe == NULL) { |
Jose Alberto Reguero | c9f88aa | 2011-08-08 07:35:35 -0300 | [diff] [blame] | 246 | /* FE 0 DVB-C */ |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 247 | adap->fe_adap[0].fe = dvb_attach(tda10023_attach, |
Jose Alberto Reguero | c9f88aa | 2011-08-08 07:35:35 -0300 | [diff] [blame] | 248 | &tda10023_config, &adap->dev->i2c_adap, 0x48); |
| 249 | |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 250 | if (adap->fe_adap[0].fe == NULL) { |
Jose Alberto Reguero | c9f88aa | 2011-08-08 07:35:35 -0300 | [diff] [blame] | 251 | deb_info("TDA10023 attach failed\n"); |
| 252 | return -ENODEV; |
| 253 | } |
| 254 | } else { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 255 | adap->fe_adap[1].fe = dvb_attach(tda10048_attach, |
Jose Alberto Reguero | c9f88aa | 2011-08-08 07:35:35 -0300 | [diff] [blame] | 256 | &tda10048_config, &adap->dev->i2c_adap); |
| 257 | |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 258 | if (adap->fe_adap[1].fe == NULL) { |
Jose Alberto Reguero | c9f88aa | 2011-08-08 07:35:35 -0300 | [diff] [blame] | 259 | deb_info("TDA10048 attach failed\n"); |
| 260 | return -ENODEV; |
| 261 | } |
| 262 | |
| 263 | /* tuner is behind TDA10023 I2C-gate */ |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 264 | adap->fe_adap[1].fe->ops.i2c_gate_ctrl = ttusb2_ct3650_i2c_gate_ctrl; |
Jose Alberto Reguero | c9f88aa | 2011-08-08 07:35:35 -0300 | [diff] [blame] | 265 | |
Guy Martin | 76952c7 | 2010-05-07 04:09:25 -0300 | [diff] [blame] | 266 | } |
Jose Alberto Reguero | c9f88aa | 2011-08-08 07:35:35 -0300 | [diff] [blame] | 267 | |
Guy Martin | 76952c7 | 2010-05-07 04:09:25 -0300 | [diff] [blame] | 268 | return 0; |
| 269 | } |
| 270 | |
| 271 | static int ttusb2_tuner_tda827x_attach(struct dvb_usb_adapter *adap) |
| 272 | { |
Jose Alberto Reguero | c9f88aa | 2011-08-08 07:35:35 -0300 | [diff] [blame] | 273 | struct dvb_frontend *fe; |
| 274 | |
| 275 | /* MFE: select correct FE to attach tuner since that's called twice */ |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 276 | if (adap->fe_adap[1].fe == NULL) |
| 277 | fe = adap->fe_adap[0].fe; |
Jose Alberto Reguero | c9f88aa | 2011-08-08 07:35:35 -0300 | [diff] [blame] | 278 | else |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 279 | fe = adap->fe_adap[1].fe; |
Jose Alberto Reguero | c9f88aa | 2011-08-08 07:35:35 -0300 | [diff] [blame] | 280 | |
| 281 | /* attach tuner */ |
| 282 | if (dvb_attach(tda827x_attach, fe, 0x61, &adap->dev->i2c_adap, &tda827x_config) == NULL) { |
Guy Martin | 76952c7 | 2010-05-07 04:09:25 -0300 | [diff] [blame] | 283 | printk(KERN_ERR "%s: No tda827x found!\n", __func__); |
| 284 | return -ENODEV; |
| 285 | } |
| 286 | return 0; |
| 287 | } |
| 288 | |
| 289 | static int ttusb2_tuner_tda826x_attach(struct dvb_usb_adapter *adap) |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 290 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 291 | if (dvb_attach(tda826x_attach, adap->fe_adap[0].fe, 0x60, &adap->dev->i2c_adap, 0) == NULL) { |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 292 | deb_info("TDA8263 attach failed\n"); |
| 293 | return -ENODEV; |
| 294 | } |
| 295 | |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 296 | if (dvb_attach(lnbp21_attach, adap->fe_adap[0].fe, &adap->dev->i2c_adap, 0, 0) == NULL) { |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 297 | deb_info("LNBP21 attach failed\n"); |
| 298 | return -ENODEV; |
| 299 | } |
| 300 | return 0; |
| 301 | } |
| 302 | |
| 303 | /* DVB USB Driver stuff */ |
| 304 | static struct dvb_usb_device_properties ttusb2_properties; |
Andre Weidemann | 8c899bc | 2008-03-29 21:30:49 -0300 | [diff] [blame] | 305 | static struct dvb_usb_device_properties ttusb2_properties_s2400; |
Guy Martin | 76952c7 | 2010-05-07 04:09:25 -0300 | [diff] [blame] | 306 | static struct dvb_usb_device_properties ttusb2_properties_ct3650; |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 307 | |
| 308 | static int ttusb2_probe(struct usb_interface *intf, |
| 309 | const struct usb_device_id *id) |
| 310 | { |
Janne Grunau | 78e9200 | 2008-04-09 19:13:13 -0300 | [diff] [blame] | 311 | if (0 == dvb_usb_device_init(intf, &ttusb2_properties, |
| 312 | THIS_MODULE, NULL, adapter_nr) || |
| 313 | 0 == dvb_usb_device_init(intf, &ttusb2_properties_s2400, |
Guy Martin | 76952c7 | 2010-05-07 04:09:25 -0300 | [diff] [blame] | 314 | THIS_MODULE, NULL, adapter_nr) || |
| 315 | 0 == dvb_usb_device_init(intf, &ttusb2_properties_ct3650, |
Janne Grunau | 78e9200 | 2008-04-09 19:13:13 -0300 | [diff] [blame] | 316 | THIS_MODULE, NULL, adapter_nr)) |
Andre Weidemann | 8c899bc | 2008-03-29 21:30:49 -0300 | [diff] [blame] | 317 | return 0; |
| 318 | return -ENODEV; |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 319 | } |
| 320 | |
| 321 | static struct usb_device_id ttusb2_table [] = { |
Andre Weidemann | 8c899bc | 2008-03-29 21:30:49 -0300 | [diff] [blame] | 322 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PCTV_400E) }, |
| 323 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PCTV_450E) }, |
| 324 | { USB_DEVICE(USB_VID_TECHNOTREND, |
| 325 | USB_PID_TECHNOTREND_CONNECT_S2400) }, |
Guy Martin | 76952c7 | 2010-05-07 04:09:25 -0300 | [diff] [blame] | 326 | { USB_DEVICE(USB_VID_TECHNOTREND, |
| 327 | USB_PID_TECHNOTREND_CONNECT_CT3650) }, |
Andre Weidemann | 8c899bc | 2008-03-29 21:30:49 -0300 | [diff] [blame] | 328 | {} /* Terminating entry */ |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 329 | }; |
| 330 | MODULE_DEVICE_TABLE (usb, ttusb2_table); |
| 331 | |
| 332 | static struct dvb_usb_device_properties ttusb2_properties = { |
| 333 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
| 334 | |
| 335 | .usb_ctrl = CYPRESS_FX2, |
| 336 | .firmware = "dvb-usb-pctv-400e-01.fw", |
| 337 | |
| 338 | .size_of_priv = sizeof(struct ttusb2_state), |
| 339 | |
| 340 | .num_adapters = 1, |
| 341 | .adapter = { |
| 342 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 343 | .num_frontends = 1, |
| 344 | .fe = {{ |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 345 | .streaming_ctrl = NULL, // ttusb2_streaming_ctrl, |
| 346 | |
Guy Martin | 76952c7 | 2010-05-07 04:09:25 -0300 | [diff] [blame] | 347 | .frontend_attach = ttusb2_frontend_tda10086_attach, |
| 348 | .tuner_attach = ttusb2_tuner_tda826x_attach, |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 349 | |
| 350 | /* parameter for the MPEG2-data transfer */ |
| 351 | .stream = { |
| 352 | .type = USB_ISOC, |
| 353 | .count = 5, |
| 354 | .endpoint = 0x02, |
| 355 | .u = { |
| 356 | .isoc = { |
| 357 | .framesperurb = 4, |
| 358 | .framesize = 940, |
| 359 | .interval = 1, |
| 360 | } |
| 361 | } |
| 362 | } |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 363 | }}, |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 364 | } |
| 365 | }, |
| 366 | |
| 367 | .power_ctrl = ttusb2_power_ctrl, |
| 368 | .identify_state = ttusb2_identify_state, |
| 369 | |
| 370 | .i2c_algo = &ttusb2_i2c_algo, |
| 371 | |
| 372 | .generic_bulk_ctrl_endpoint = 0x01, |
| 373 | |
Christophe Cattelain | ddc9ece | 2007-04-27 12:31:32 -0300 | [diff] [blame] | 374 | .num_device_descs = 2, |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 375 | .devices = { |
| 376 | { "Pinnacle 400e DVB-S USB2.0", |
| 377 | { &ttusb2_table[0], NULL }, |
| 378 | { NULL }, |
| 379 | }, |
Christophe Cattelain | ddc9ece | 2007-04-27 12:31:32 -0300 | [diff] [blame] | 380 | { "Pinnacle 450e DVB-S USB2.0", |
| 381 | { &ttusb2_table[1], NULL }, |
| 382 | { NULL }, |
| 383 | }, |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 384 | } |
| 385 | }; |
| 386 | |
Andre Weidemann | 8c899bc | 2008-03-29 21:30:49 -0300 | [diff] [blame] | 387 | static struct dvb_usb_device_properties ttusb2_properties_s2400 = { |
| 388 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
| 389 | |
| 390 | .usb_ctrl = CYPRESS_FX2, |
| 391 | .firmware = "dvb-usb-tt-s2400-01.fw", |
| 392 | |
| 393 | .size_of_priv = sizeof(struct ttusb2_state), |
| 394 | |
| 395 | .num_adapters = 1, |
| 396 | .adapter = { |
| 397 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 398 | .num_frontends = 1, |
| 399 | .fe = {{ |
Andre Weidemann | 8c899bc | 2008-03-29 21:30:49 -0300 | [diff] [blame] | 400 | .streaming_ctrl = NULL, |
| 401 | |
Guy Martin | 76952c7 | 2010-05-07 04:09:25 -0300 | [diff] [blame] | 402 | .frontend_attach = ttusb2_frontend_tda10086_attach, |
| 403 | .tuner_attach = ttusb2_tuner_tda826x_attach, |
Andre Weidemann | 8c899bc | 2008-03-29 21:30:49 -0300 | [diff] [blame] | 404 | |
| 405 | /* parameter for the MPEG2-data transfer */ |
| 406 | .stream = { |
| 407 | .type = USB_ISOC, |
| 408 | .count = 5, |
| 409 | .endpoint = 0x02, |
| 410 | .u = { |
| 411 | .isoc = { |
| 412 | .framesperurb = 4, |
| 413 | .framesize = 940, |
| 414 | .interval = 1, |
| 415 | } |
| 416 | } |
| 417 | } |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 418 | }}, |
Andre Weidemann | 8c899bc | 2008-03-29 21:30:49 -0300 | [diff] [blame] | 419 | } |
| 420 | }, |
| 421 | |
| 422 | .power_ctrl = ttusb2_power_ctrl, |
| 423 | .identify_state = ttusb2_identify_state, |
| 424 | |
| 425 | .i2c_algo = &ttusb2_i2c_algo, |
| 426 | |
| 427 | .generic_bulk_ctrl_endpoint = 0x01, |
| 428 | |
| 429 | .num_device_descs = 1, |
| 430 | .devices = { |
| 431 | { "Technotrend TT-connect S-2400", |
| 432 | { &ttusb2_table[2], NULL }, |
| 433 | { NULL }, |
| 434 | }, |
| 435 | } |
| 436 | }; |
| 437 | |
Guy Martin | 76952c7 | 2010-05-07 04:09:25 -0300 | [diff] [blame] | 438 | static struct dvb_usb_device_properties ttusb2_properties_ct3650 = { |
| 439 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
| 440 | |
| 441 | .usb_ctrl = CYPRESS_FX2, |
| 442 | |
| 443 | .size_of_priv = sizeof(struct ttusb2_state), |
| 444 | |
David Henningsson | 9d1da73 | 2010-12-26 10:23:58 -0300 | [diff] [blame] | 445 | .rc.core = { |
| 446 | .rc_interval = 150, /* Less than IR_KEYPRESS_TIMEOUT */ |
| 447 | .rc_codes = RC_MAP_TT_1500, |
| 448 | .rc_query = tt3650_rc_query, |
| 449 | .allowed_protos = RC_TYPE_UNKNOWN, |
| 450 | }, |
| 451 | |
Guy Martin | 76952c7 | 2010-05-07 04:09:25 -0300 | [diff] [blame] | 452 | .num_adapters = 1, |
| 453 | .adapter = { |
| 454 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 455 | .num_frontends = 2, |
| 456 | .fe = {{ |
Guy Martin | 76952c7 | 2010-05-07 04:09:25 -0300 | [diff] [blame] | 457 | .streaming_ctrl = NULL, |
| 458 | |
| 459 | .frontend_attach = ttusb2_frontend_tda10023_attach, |
| 460 | .tuner_attach = ttusb2_tuner_tda827x_attach, |
| 461 | |
| 462 | /* parameter for the MPEG2-data transfer */ |
| 463 | .stream = { |
| 464 | .type = USB_ISOC, |
| 465 | .count = 5, |
| 466 | .endpoint = 0x02, |
| 467 | .u = { |
| 468 | .isoc = { |
| 469 | .framesperurb = 4, |
| 470 | .framesize = 940, |
| 471 | .interval = 1, |
| 472 | } |
| 473 | } |
| 474 | } |
Michael Krufky | 1645c87 | 2011-09-16 09:36:56 -0300 | [diff] [blame^] | 475 | }, { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 476 | .streaming_ctrl = NULL, |
| 477 | |
| 478 | .frontend_attach = ttusb2_frontend_tda10023_attach, |
| 479 | .tuner_attach = ttusb2_tuner_tda827x_attach, |
| 480 | |
| 481 | /* parameter for the MPEG2-data transfer */ |
| 482 | .stream = { |
| 483 | .type = USB_ISOC, |
| 484 | .count = 5, |
| 485 | .endpoint = 0x02, |
| 486 | .u = { |
| 487 | .isoc = { |
| 488 | .framesperurb = 4, |
| 489 | .framesize = 940, |
| 490 | .interval = 1, |
| 491 | } |
| 492 | } |
| 493 | } |
| 494 | }}, |
Guy Martin | 76952c7 | 2010-05-07 04:09:25 -0300 | [diff] [blame] | 495 | }, |
| 496 | }, |
| 497 | |
| 498 | .power_ctrl = ttusb2_power_ctrl, |
| 499 | .identify_state = ttusb2_identify_state, |
| 500 | |
| 501 | .i2c_algo = &ttusb2_i2c_algo, |
| 502 | |
| 503 | .generic_bulk_ctrl_endpoint = 0x01, |
| 504 | |
| 505 | .num_device_descs = 1, |
| 506 | .devices = { |
| 507 | { "Technotrend TT-connect CT-3650", |
| 508 | .warm_ids = { &ttusb2_table[3], NULL }, |
| 509 | }, |
| 510 | } |
| 511 | }; |
| 512 | |
Patrick Boettcher | bc2e391 | 2006-12-02 21:16:04 -0200 | [diff] [blame] | 513 | static struct usb_driver ttusb2_driver = { |
| 514 | .name = "dvb_usb_ttusb2", |
| 515 | .probe = ttusb2_probe, |
| 516 | .disconnect = dvb_usb_device_exit, |
| 517 | .id_table = ttusb2_table, |
| 518 | }; |
| 519 | |
| 520 | /* module stuff */ |
| 521 | static int __init ttusb2_module_init(void) |
| 522 | { |
| 523 | int result; |
| 524 | if ((result = usb_register(&ttusb2_driver))) { |
| 525 | err("usb_register failed. Error number %d",result); |
| 526 | return result; |
| 527 | } |
| 528 | |
| 529 | return 0; |
| 530 | } |
| 531 | |
| 532 | static void __exit ttusb2_module_exit(void) |
| 533 | { |
| 534 | /* deregister this driver from the USB subsystem */ |
| 535 | usb_deregister(&ttusb2_driver); |
| 536 | } |
| 537 | |
| 538 | module_init (ttusb2_module_init); |
| 539 | module_exit (ttusb2_module_exit); |
| 540 | |
| 541 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); |
| 542 | MODULE_DESCRIPTION("Driver for Pinnacle PCTV 400e DVB-S USB2.0"); |
| 543 | MODULE_VERSION("1.0"); |
| 544 | MODULE_LICENSE("GPL"); |