ttusb2.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821
  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. #include "ttusb2.h"
  28. #include "tda826x.h"
  29. #include "tda10086.h"
  30. #include "tda1002x.h"
  31. #include "tda10048.h"
  32. #include "tda827x.h"
  33. #include "lnbp21.h"
  34. /* CA */
  35. #include "dvb_ca_en50221.h"
  36. /* debug */
  37. static int dvb_usb_ttusb2_debug;
  38. #define deb_info(args...) dprintk(dvb_usb_ttusb2_debug,0x01,args)
  39. module_param_named(debug,dvb_usb_ttusb2_debug, int, 0644);
  40. MODULE_PARM_DESC(debug, "set debugging level (1=info (or-able))." DVB_USB_DEBUG_STATUS);
  41. static int dvb_usb_ttusb2_debug_ci;
  42. module_param_named(debug_ci,dvb_usb_ttusb2_debug_ci, int, 0644);
  43. MODULE_PARM_DESC(debug_ci, "set debugging ci." DVB_USB_DEBUG_STATUS);
  44. DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
  45. #define ci_dbg(format, arg...) \
  46. do { \
  47. if (dvb_usb_ttusb2_debug_ci) \
  48. printk(KERN_DEBUG DVB_USB_LOG_PREFIX \
  49. ": %s " format "\n" , __func__, ## arg); \
  50. } while (0)
  51. enum {
  52. TT3650_CMD_CI_TEST = 0x40,
  53. TT3650_CMD_CI_RD_CTRL,
  54. TT3650_CMD_CI_WR_CTRL,
  55. TT3650_CMD_CI_RD_ATTR,
  56. TT3650_CMD_CI_WR_ATTR,
  57. TT3650_CMD_CI_RESET,
  58. TT3650_CMD_CI_SET_VIDEO_PORT
  59. };
  60. struct ttusb2_state {
  61. struct dvb_ca_en50221 ca;
  62. struct mutex ca_mutex;
  63. u8 id;
  64. u16 last_rc_key;
  65. };
  66. static int ttusb2_msg(struct dvb_usb_device *d, u8 cmd,
  67. u8 *wbuf, int wlen, u8 *rbuf, int rlen)
  68. {
  69. struct ttusb2_state *st = d->priv;
  70. u8 *s, *r = NULL;
  71. int ret = 0;
  72. s = kzalloc(wlen+4, GFP_KERNEL);
  73. if (!s)
  74. return -ENOMEM;
  75. r = kzalloc(64, GFP_KERNEL);
  76. if (!r) {
  77. kfree(s);
  78. return -ENOMEM;
  79. }
  80. s[0] = 0xaa;
  81. s[1] = ++st->id;
  82. s[2] = cmd;
  83. s[3] = wlen;
  84. memcpy(&s[4],wbuf,wlen);
  85. ret = dvb_usb_generic_rw(d, s, wlen+4, r, 64, 0);
  86. if (ret != 0 ||
  87. r[0] != 0x55 ||
  88. r[1] != s[1] ||
  89. r[2] != cmd ||
  90. (rlen > 0 && r[3] != rlen)) {
  91. warn("there might have been an error during control message transfer. (rlen = %d, was %d)",rlen,r[3]);
  92. kfree(s);
  93. kfree(r);
  94. return -EIO;
  95. }
  96. if (rlen > 0)
  97. memcpy(rbuf, &r[4], rlen);
  98. kfree(s);
  99. kfree(r);
  100. return 0;
  101. }
  102. /* ci */
  103. static int tt3650_ci_msg(struct dvb_usb_device *d, u8 cmd, u8 *data, unsigned int write_len, unsigned int read_len)
  104. {
  105. int ret;
  106. u8 rx[60];/* (64 -4) */
  107. ret = ttusb2_msg(d, cmd, data, write_len, rx, read_len);
  108. if (!ret)
  109. memcpy(data, rx, read_len);
  110. return ret;
  111. }
  112. static int tt3650_ci_msg_locked(struct dvb_ca_en50221 *ca, u8 cmd, u8 *data, unsigned int write_len, unsigned int read_len)
  113. {
  114. struct dvb_usb_device *d = ca->data;
  115. struct ttusb2_state *state = d->priv;
  116. int ret;
  117. mutex_lock(&state->ca_mutex);
  118. ret = tt3650_ci_msg(d, cmd, data, write_len, read_len);
  119. mutex_unlock(&state->ca_mutex);
  120. return ret;
  121. }
  122. static int tt3650_ci_read_attribute_mem(struct dvb_ca_en50221 *ca, int slot, int address)
  123. {
  124. u8 buf[3];
  125. int ret = 0;
  126. if (slot)
  127. return -EINVAL;
  128. buf[0] = (address >> 8) & 0x0F;
  129. buf[1] = address;
  130. ret = tt3650_ci_msg_locked(ca, TT3650_CMD_CI_RD_ATTR, buf, 2, 3);
  131. ci_dbg("%04x -> %d 0x%02x", address, ret, buf[2]);
  132. if (ret < 0)
  133. return ret;
  134. return buf[2];
  135. }
  136. static int tt3650_ci_write_attribute_mem(struct dvb_ca_en50221 *ca, int slot, int address, u8 value)
  137. {
  138. u8 buf[3];
  139. ci_dbg("%d 0x%04x 0x%02x", slot, address, value);
  140. if (slot)
  141. return -EINVAL;
  142. buf[0] = (address >> 8) & 0x0F;
  143. buf[1] = address;
  144. buf[2] = value;
  145. return tt3650_ci_msg_locked(ca, TT3650_CMD_CI_WR_ATTR, buf, 3, 3);
  146. }
  147. static int tt3650_ci_read_cam_control(struct dvb_ca_en50221 *ca, int slot, u8 address)
  148. {
  149. u8 buf[2];
  150. int ret;
  151. if (slot)
  152. return -EINVAL;
  153. buf[0] = address & 3;
  154. ret = tt3650_ci_msg_locked(ca, TT3650_CMD_CI_RD_CTRL, buf, 1, 2);
  155. ci_dbg("0x%02x -> %d 0x%02x", address, ret, buf[1]);
  156. if (ret < 0)
  157. return ret;
  158. return buf[1];
  159. }
  160. static int tt3650_ci_write_cam_control(struct dvb_ca_en50221 *ca, int slot, u8 address, u8 value)
  161. {
  162. u8 buf[2];
  163. ci_dbg("%d 0x%02x 0x%02x", slot, address, value);
  164. if (slot)
  165. return -EINVAL;
  166. buf[0] = address;
  167. buf[1] = value;
  168. return tt3650_ci_msg_locked(ca, TT3650_CMD_CI_WR_CTRL, buf, 2, 2);
  169. }
  170. static int tt3650_ci_set_video_port(struct dvb_ca_en50221 *ca, int slot, int enable)
  171. {
  172. u8 buf[1];
  173. int ret;
  174. ci_dbg("%d %d", slot, enable);
  175. if (slot)
  176. return -EINVAL;
  177. buf[0] = enable;
  178. ret = tt3650_ci_msg_locked(ca, TT3650_CMD_CI_SET_VIDEO_PORT, buf, 1, 1);
  179. if (ret < 0)
  180. return ret;
  181. if (enable != buf[0]) {
  182. err("CI not %sabled.", enable ? "en" : "dis");
  183. return -EIO;
  184. }
  185. return 0;
  186. }
  187. static int tt3650_ci_slot_shutdown(struct dvb_ca_en50221 *ca, int slot)
  188. {
  189. return tt3650_ci_set_video_port(ca, slot, 0);
  190. }
  191. static int tt3650_ci_slot_ts_enable(struct dvb_ca_en50221 *ca, int slot)
  192. {
  193. return tt3650_ci_set_video_port(ca, slot, 1);
  194. }
  195. static int tt3650_ci_slot_reset(struct dvb_ca_en50221 *ca, int slot)
  196. {
  197. struct dvb_usb_device *d = ca->data;
  198. struct ttusb2_state *state = d->priv;
  199. u8 buf[1];
  200. int ret;
  201. ci_dbg("%d", slot);
  202. if (slot)
  203. return -EINVAL;
  204. buf[0] = 0;
  205. mutex_lock(&state->ca_mutex);
  206. ret = tt3650_ci_msg(d, TT3650_CMD_CI_RESET, buf, 1, 1);
  207. if (ret)
  208. goto failed;
  209. msleep(500);
  210. buf[0] = 1;
  211. ret = tt3650_ci_msg(d, TT3650_CMD_CI_RESET, buf, 1, 1);
  212. if (ret)
  213. goto failed;
  214. msleep(500);
  215. buf[0] = 0; /* FTA */
  216. ret = tt3650_ci_msg(d, TT3650_CMD_CI_SET_VIDEO_PORT, buf, 1, 1);
  217. msleep(1100);
  218. failed:
  219. mutex_unlock(&state->ca_mutex);
  220. return ret;
  221. }
  222. static int tt3650_ci_poll_slot_status(struct dvb_ca_en50221 *ca, int slot, int open)
  223. {
  224. u8 buf[1];
  225. int ret;
  226. if (slot)
  227. return -EINVAL;
  228. ret = tt3650_ci_msg_locked(ca, TT3650_CMD_CI_TEST, buf, 0, 1);
  229. if (ret)
  230. return ret;
  231. if (1 == buf[0]) {
  232. return DVB_CA_EN50221_POLL_CAM_PRESENT |
  233. DVB_CA_EN50221_POLL_CAM_READY;
  234. }
  235. return 0;
  236. }
  237. static void tt3650_ci_uninit(struct dvb_usb_device *d)
  238. {
  239. struct ttusb2_state *state;
  240. ci_dbg("");
  241. if (NULL == d)
  242. return;
  243. state = d->priv;
  244. if (NULL == state)
  245. return;
  246. if (NULL == state->ca.data)
  247. return;
  248. dvb_ca_en50221_release(&state->ca);
  249. memset(&state->ca, 0, sizeof(state->ca));
  250. }
  251. static int tt3650_ci_init(struct dvb_usb_adapter *a)
  252. {
  253. struct dvb_usb_device *d = a->dev;
  254. struct ttusb2_state *state = d->priv;
  255. int ret;
  256. ci_dbg("");
  257. mutex_init(&state->ca_mutex);
  258. state->ca.owner = THIS_MODULE;
  259. state->ca.read_attribute_mem = tt3650_ci_read_attribute_mem;
  260. state->ca.write_attribute_mem = tt3650_ci_write_attribute_mem;
  261. state->ca.read_cam_control = tt3650_ci_read_cam_control;
  262. state->ca.write_cam_control = tt3650_ci_write_cam_control;
  263. state->ca.slot_reset = tt3650_ci_slot_reset;
  264. state->ca.slot_shutdown = tt3650_ci_slot_shutdown;
  265. state->ca.slot_ts_enable = tt3650_ci_slot_ts_enable;
  266. state->ca.poll_slot_status = tt3650_ci_poll_slot_status;
  267. state->ca.data = d;
  268. ret = dvb_ca_en50221_init(&a->dvb_adap,
  269. &state->ca,
  270. /* flags */ 0,
  271. /* n_slots */ 1);
  272. if (ret) {
  273. err("Cannot initialize CI: Error %d.", ret);
  274. memset(&state->ca, 0, sizeof(state->ca));
  275. return ret;
  276. }
  277. info("CI initialized.");
  278. return 0;
  279. }
  280. static int ttusb2_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num)
  281. {
  282. struct dvb_usb_device *d = i2c_get_adapdata(adap);
  283. static u8 obuf[60], ibuf[60];
  284. int i, write_read, read;
  285. if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
  286. return -EAGAIN;
  287. if (num > 2)
  288. warn("more than 2 i2c messages at a time is not handled yet. TODO.");
  289. for (i = 0; i < num; i++) {
  290. write_read = i+1 < num && (msg[i+1].flags & I2C_M_RD);
  291. read = msg[i].flags & I2C_M_RD;
  292. obuf[0] = (msg[i].addr << 1) | (write_read | read);
  293. if (read)
  294. obuf[1] = 0;
  295. else
  296. obuf[1] = msg[i].len;
  297. /* read request */
  298. if (write_read)
  299. obuf[2] = msg[i+1].len;
  300. else if (read)
  301. obuf[2] = msg[i].len;
  302. else
  303. obuf[2] = 0;
  304. memcpy(&obuf[3], msg[i].buf, msg[i].len);
  305. if (ttusb2_msg(d, CMD_I2C_XFER, obuf, obuf[1]+3, ibuf, obuf[2] + 3) < 0) {
  306. err("i2c transfer failed.");
  307. break;
  308. }
  309. if (write_read) {
  310. memcpy(msg[i+1].buf, &ibuf[3], msg[i+1].len);
  311. i++;
  312. } else if (read)
  313. memcpy(msg[i].buf, &ibuf[3], msg[i].len);
  314. }
  315. mutex_unlock(&d->i2c_mutex);
  316. return i;
  317. }
  318. static u32 ttusb2_i2c_func(struct i2c_adapter *adapter)
  319. {
  320. return I2C_FUNC_I2C;
  321. }
  322. static struct i2c_algorithm ttusb2_i2c_algo = {
  323. .master_xfer = ttusb2_i2c_xfer,
  324. .functionality = ttusb2_i2c_func,
  325. };
  326. /* command to poll IR receiver (copied from pctv452e.c) */
  327. #define CMD_GET_IR_CODE 0x1b
  328. /* IR */
  329. static int tt3650_rc_query(struct dvb_usb_device *d)
  330. {
  331. int ret;
  332. u8 rx[9]; /* A CMD_GET_IR_CODE reply is 9 bytes long */
  333. struct ttusb2_state *st = d->priv;
  334. ret = ttusb2_msg(d, CMD_GET_IR_CODE, NULL, 0, rx, sizeof(rx));
  335. if (ret != 0)
  336. return ret;
  337. if (rx[8] & 0x01) {
  338. /* got a "press" event */
  339. st->last_rc_key = (rx[3] << 8) | rx[2];
  340. deb_info("%s: cmd=0x%02x sys=0x%02x\n", __func__, rx[2], rx[3]);
  341. rc_keydown(d->rc_dev, st->last_rc_key, 0);
  342. } else if (st->last_rc_key) {
  343. rc_keyup(d->rc_dev);
  344. st->last_rc_key = 0;
  345. }
  346. return 0;
  347. }
  348. /* Callbacks for DVB USB */
  349. static int ttusb2_identify_state (struct usb_device *udev, struct
  350. dvb_usb_device_properties *props, struct dvb_usb_device_description **desc,
  351. int *cold)
  352. {
  353. *cold = udev->descriptor.iManufacturer == 0 && udev->descriptor.iProduct == 0;
  354. return 0;
  355. }
  356. static int ttusb2_power_ctrl(struct dvb_usb_device *d, int onoff)
  357. {
  358. u8 b = onoff;
  359. ttusb2_msg(d, CMD_POWER, &b, 0, NULL, 0);
  360. return ttusb2_msg(d, CMD_POWER, &b, 1, NULL, 0);
  361. }
  362. static struct tda10086_config tda10086_config = {
  363. .demod_address = 0x0e,
  364. .invert = 0,
  365. .diseqc_tone = 1,
  366. .xtal_freq = TDA10086_XTAL_16M,
  367. };
  368. static struct tda10023_config tda10023_config = {
  369. .demod_address = 0x0c,
  370. .invert = 0,
  371. .xtal = 16000000,
  372. .pll_m = 11,
  373. .pll_p = 3,
  374. .pll_n = 1,
  375. .deltaf = 0xa511,
  376. };
  377. static struct tda10048_config tda10048_config = {
  378. .demod_address = 0x10 >> 1,
  379. .output_mode = TDA10048_PARALLEL_OUTPUT,
  380. .inversion = TDA10048_INVERSION_ON,
  381. .dtv6_if_freq_khz = TDA10048_IF_4000,
  382. .dtv7_if_freq_khz = TDA10048_IF_4500,
  383. .dtv8_if_freq_khz = TDA10048_IF_5000,
  384. .clk_freq_khz = TDA10048_CLK_16000,
  385. .no_firmware = 1,
  386. .set_pll = true ,
  387. .pll_m = 5,
  388. .pll_n = 3,
  389. .pll_p = 0,
  390. };
  391. static struct tda827x_config tda827x_config = {
  392. .config = 0,
  393. };
  394. static int ttusb2_frontend_tda10086_attach(struct dvb_usb_adapter *adap)
  395. {
  396. if (usb_set_interface(adap->dev->udev,0,3) < 0)
  397. err("set interface to alts=3 failed");
  398. if ((adap->fe_adap[0].fe = dvb_attach(tda10086_attach, &tda10086_config, &adap->dev->i2c_adap)) == NULL) {
  399. deb_info("TDA10086 attach failed\n");
  400. return -ENODEV;
  401. }
  402. return 0;
  403. }
  404. static int ttusb2_ct3650_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
  405. {
  406. struct dvb_usb_adapter *adap = fe->dvb->priv;
  407. return adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].fe, enable);
  408. }
  409. static int ttusb2_frontend_tda10023_attach(struct dvb_usb_adapter *adap)
  410. {
  411. if (usb_set_interface(adap->dev->udev, 0, 3) < 0)
  412. err("set interface to alts=3 failed");
  413. if (adap->fe_adap[0].fe == NULL) {
  414. /* FE 0 DVB-C */
  415. adap->fe_adap[0].fe = dvb_attach(tda10023_attach,
  416. &tda10023_config, &adap->dev->i2c_adap, 0x48);
  417. if (adap->fe_adap[0].fe == NULL) {
  418. deb_info("TDA10023 attach failed\n");
  419. return -ENODEV;
  420. }
  421. tt3650_ci_init(adap);
  422. } else {
  423. adap->fe_adap[1].fe = dvb_attach(tda10048_attach,
  424. &tda10048_config, &adap->dev->i2c_adap);
  425. if (adap->fe_adap[1].fe == NULL) {
  426. deb_info("TDA10048 attach failed\n");
  427. return -ENODEV;
  428. }
  429. /* tuner is behind TDA10023 I2C-gate */
  430. adap->fe_adap[1].fe->ops.i2c_gate_ctrl = ttusb2_ct3650_i2c_gate_ctrl;
  431. }
  432. return 0;
  433. }
  434. static int ttusb2_tuner_tda827x_attach(struct dvb_usb_adapter *adap)
  435. {
  436. struct dvb_frontend *fe;
  437. /* MFE: select correct FE to attach tuner since that's called twice */
  438. if (adap->fe_adap[1].fe == NULL)
  439. fe = adap->fe_adap[0].fe;
  440. else
  441. fe = adap->fe_adap[1].fe;
  442. /* attach tuner */
  443. if (dvb_attach(tda827x_attach, fe, 0x61, &adap->dev->i2c_adap, &tda827x_config) == NULL) {
  444. printk(KERN_ERR "%s: No tda827x found!\n", __func__);
  445. return -ENODEV;
  446. }
  447. return 0;
  448. }
  449. static int ttusb2_tuner_tda826x_attach(struct dvb_usb_adapter *adap)
  450. {
  451. if (dvb_attach(tda826x_attach, adap->fe_adap[0].fe, 0x60, &adap->dev->i2c_adap, 0) == NULL) {
  452. deb_info("TDA8263 attach failed\n");
  453. return -ENODEV;
  454. }
  455. if (dvb_attach(lnbp21_attach, adap->fe_adap[0].fe, &adap->dev->i2c_adap, 0, 0) == NULL) {
  456. deb_info("LNBP21 attach failed\n");
  457. return -ENODEV;
  458. }
  459. return 0;
  460. }
  461. /* DVB USB Driver stuff */
  462. static struct dvb_usb_device_properties ttusb2_properties;
  463. static struct dvb_usb_device_properties ttusb2_properties_s2400;
  464. static struct dvb_usb_device_properties ttusb2_properties_ct3650;
  465. static void ttusb2_usb_disconnect(struct usb_interface *intf)
  466. {
  467. struct dvb_usb_device *d = usb_get_intfdata(intf);
  468. tt3650_ci_uninit(d);
  469. dvb_usb_device_exit(intf);
  470. }
  471. static int ttusb2_probe(struct usb_interface *intf,
  472. const struct usb_device_id *id)
  473. {
  474. if (0 == dvb_usb_device_init(intf, &ttusb2_properties,
  475. THIS_MODULE, NULL, adapter_nr) ||
  476. 0 == dvb_usb_device_init(intf, &ttusb2_properties_s2400,
  477. THIS_MODULE, NULL, adapter_nr) ||
  478. 0 == dvb_usb_device_init(intf, &ttusb2_properties_ct3650,
  479. THIS_MODULE, NULL, adapter_nr))
  480. return 0;
  481. return -ENODEV;
  482. }
  483. static struct usb_device_id ttusb2_table [] = {
  484. { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PCTV_400E) },
  485. { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PCTV_450E) },
  486. { USB_DEVICE(USB_VID_TECHNOTREND,
  487. USB_PID_TECHNOTREND_CONNECT_S2400) },
  488. { USB_DEVICE(USB_VID_TECHNOTREND,
  489. USB_PID_TECHNOTREND_CONNECT_CT3650) },
  490. {} /* Terminating entry */
  491. };
  492. MODULE_DEVICE_TABLE (usb, ttusb2_table);
  493. static struct dvb_usb_device_properties ttusb2_properties = {
  494. .caps = DVB_USB_IS_AN_I2C_ADAPTER,
  495. .usb_ctrl = CYPRESS_FX2,
  496. .firmware = "dvb-usb-pctv-400e-01.fw",
  497. .size_of_priv = sizeof(struct ttusb2_state),
  498. .num_adapters = 1,
  499. .adapter = {
  500. {
  501. .num_frontends = 1,
  502. .fe = {{
  503. .streaming_ctrl = NULL, // ttusb2_streaming_ctrl,
  504. .frontend_attach = ttusb2_frontend_tda10086_attach,
  505. .tuner_attach = ttusb2_tuner_tda826x_attach,
  506. /* parameter for the MPEG2-data transfer */
  507. .stream = {
  508. .type = USB_ISOC,
  509. .count = 5,
  510. .endpoint = 0x02,
  511. .u = {
  512. .isoc = {
  513. .framesperurb = 4,
  514. .framesize = 940,
  515. .interval = 1,
  516. }
  517. }
  518. }
  519. }},
  520. }
  521. },
  522. .power_ctrl = ttusb2_power_ctrl,
  523. .identify_state = ttusb2_identify_state,
  524. .i2c_algo = &ttusb2_i2c_algo,
  525. .generic_bulk_ctrl_endpoint = 0x01,
  526. .num_device_descs = 2,
  527. .devices = {
  528. { "Pinnacle 400e DVB-S USB2.0",
  529. { &ttusb2_table[0], NULL },
  530. { NULL },
  531. },
  532. { "Pinnacle 450e DVB-S USB2.0",
  533. { &ttusb2_table[1], NULL },
  534. { NULL },
  535. },
  536. }
  537. };
  538. static struct dvb_usb_device_properties ttusb2_properties_s2400 = {
  539. .caps = DVB_USB_IS_AN_I2C_ADAPTER,
  540. .usb_ctrl = CYPRESS_FX2,
  541. .firmware = "dvb-usb-tt-s2400-01.fw",
  542. .size_of_priv = sizeof(struct ttusb2_state),
  543. .num_adapters = 1,
  544. .adapter = {
  545. {
  546. .num_frontends = 1,
  547. .fe = {{
  548. .streaming_ctrl = NULL,
  549. .frontend_attach = ttusb2_frontend_tda10086_attach,
  550. .tuner_attach = ttusb2_tuner_tda826x_attach,
  551. /* parameter for the MPEG2-data transfer */
  552. .stream = {
  553. .type = USB_ISOC,
  554. .count = 5,
  555. .endpoint = 0x02,
  556. .u = {
  557. .isoc = {
  558. .framesperurb = 4,
  559. .framesize = 940,
  560. .interval = 1,
  561. }
  562. }
  563. }
  564. }},
  565. }
  566. },
  567. .power_ctrl = ttusb2_power_ctrl,
  568. .identify_state = ttusb2_identify_state,
  569. .i2c_algo = &ttusb2_i2c_algo,
  570. .generic_bulk_ctrl_endpoint = 0x01,
  571. .num_device_descs = 1,
  572. .devices = {
  573. { "Technotrend TT-connect S-2400",
  574. { &ttusb2_table[2], NULL },
  575. { NULL },
  576. },
  577. }
  578. };
  579. static struct dvb_usb_device_properties ttusb2_properties_ct3650 = {
  580. .caps = DVB_USB_IS_AN_I2C_ADAPTER,
  581. .usb_ctrl = CYPRESS_FX2,
  582. .size_of_priv = sizeof(struct ttusb2_state),
  583. .rc.core = {
  584. .rc_interval = 150, /* Less than IR_KEYPRESS_TIMEOUT */
  585. .rc_codes = RC_MAP_TT_1500,
  586. .rc_query = tt3650_rc_query,
  587. .allowed_protos = RC_TYPE_UNKNOWN,
  588. },
  589. .num_adapters = 1,
  590. .adapter = {
  591. {
  592. .num_frontends = 2,
  593. .fe = {{
  594. .streaming_ctrl = NULL,
  595. .frontend_attach = ttusb2_frontend_tda10023_attach,
  596. .tuner_attach = ttusb2_tuner_tda827x_attach,
  597. /* parameter for the MPEG2-data transfer */
  598. .stream = {
  599. .type = USB_ISOC,
  600. .count = 5,
  601. .endpoint = 0x02,
  602. .u = {
  603. .isoc = {
  604. .framesperurb = 4,
  605. .framesize = 940,
  606. .interval = 1,
  607. }
  608. }
  609. }
  610. }, {
  611. .streaming_ctrl = NULL,
  612. .frontend_attach = ttusb2_frontend_tda10023_attach,
  613. .tuner_attach = ttusb2_tuner_tda827x_attach,
  614. /* parameter for the MPEG2-data transfer */
  615. .stream = {
  616. .type = USB_ISOC,
  617. .count = 5,
  618. .endpoint = 0x02,
  619. .u = {
  620. .isoc = {
  621. .framesperurb = 4,
  622. .framesize = 940,
  623. .interval = 1,
  624. }
  625. }
  626. }
  627. }},
  628. },
  629. },
  630. .power_ctrl = ttusb2_power_ctrl,
  631. .identify_state = ttusb2_identify_state,
  632. .i2c_algo = &ttusb2_i2c_algo,
  633. .generic_bulk_ctrl_endpoint = 0x01,
  634. .num_device_descs = 1,
  635. .devices = {
  636. { "Technotrend TT-connect CT-3650",
  637. .warm_ids = { &ttusb2_table[3], NULL },
  638. },
  639. }
  640. };
  641. static struct usb_driver ttusb2_driver = {
  642. .name = "dvb_usb_ttusb2",
  643. .probe = ttusb2_probe,
  644. .disconnect = ttusb2_usb_disconnect,
  645. .id_table = ttusb2_table,
  646. };
  647. module_usb_driver(ttusb2_driver);
  648. MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
  649. MODULE_DESCRIPTION("Driver for Pinnacle PCTV 400e DVB-S USB2.0");
  650. MODULE_VERSION("1.0");
  651. MODULE_LICENSE("GPL");