gl861.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661
  1. /* DVB USB compliant linux driver for GL861 USB2.0 devices.
  2. *
  3. * This program is free software; you can redistribute it and/or modify it
  4. * under the terms of the GNU General Public License as published by the
  5. * Free Software Foundation, version 2.
  6. *
  7. * see Documentation/media/dvb-drivers/dvb-usb.rst for more information
  8. */
  9. #include <linux/string.h>
  10. #include "gl861.h"
  11. #include "zl10353.h"
  12. #include "qt1010.h"
  13. #include "tc90522.h"
  14. #include "dvb-pll.h"
  15. DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
  16. static int gl861_i2c_msg(struct dvb_usb_device *d, u8 addr,
  17. u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen)
  18. {
  19. u16 index;
  20. u16 value = addr << (8 + 1);
  21. int wo = (rbuf == NULL || rlen == 0); /* write-only */
  22. u8 req, type;
  23. u8 *buf;
  24. int ret;
  25. if (wo) {
  26. req = GL861_REQ_I2C_WRITE;
  27. type = GL861_WRITE;
  28. buf = kmemdup(wbuf, wlen, GFP_KERNEL);
  29. } else { /* rw */
  30. req = GL861_REQ_I2C_READ;
  31. type = GL861_READ;
  32. buf = kmalloc(rlen, GFP_KERNEL);
  33. }
  34. if (!buf)
  35. return -ENOMEM;
  36. switch (wlen) {
  37. case 1:
  38. index = wbuf[0];
  39. break;
  40. case 2:
  41. index = wbuf[0];
  42. value = value + wbuf[1];
  43. break;
  44. default:
  45. dev_err(&d->udev->dev, "%s: wlen=%d, aborting\n",
  46. KBUILD_MODNAME, wlen);
  47. kfree(buf);
  48. return -EINVAL;
  49. }
  50. usleep_range(1000, 2000); /* avoid I2C errors */
  51. ret = usb_control_msg(d->udev, usb_rcvctrlpipe(d->udev, 0), req, type,
  52. value, index, buf, rlen, 2000);
  53. if (!wo && ret > 0)
  54. memcpy(rbuf, buf, rlen);
  55. kfree(buf);
  56. return ret;
  57. }
  58. /* I2C */
  59. static int gl861_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
  60. int num)
  61. {
  62. struct dvb_usb_device *d = i2c_get_adapdata(adap);
  63. int i;
  64. if (num > 2)
  65. return -EINVAL;
  66. if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
  67. return -EAGAIN;
  68. for (i = 0; i < num; i++) {
  69. /* write/read request */
  70. if (i+1 < num && (msg[i+1].flags & I2C_M_RD)) {
  71. if (gl861_i2c_msg(d, msg[i].addr, msg[i].buf,
  72. msg[i].len, msg[i+1].buf, msg[i+1].len) < 0)
  73. break;
  74. i++;
  75. } else
  76. if (gl861_i2c_msg(d, msg[i].addr, msg[i].buf,
  77. msg[i].len, NULL, 0) < 0)
  78. break;
  79. }
  80. mutex_unlock(&d->i2c_mutex);
  81. return i;
  82. }
  83. static u32 gl861_i2c_func(struct i2c_adapter *adapter)
  84. {
  85. return I2C_FUNC_I2C;
  86. }
  87. static struct i2c_algorithm gl861_i2c_algo = {
  88. .master_xfer = gl861_i2c_xfer,
  89. .functionality = gl861_i2c_func,
  90. };
  91. /* Callbacks for DVB USB */
  92. static struct zl10353_config gl861_zl10353_config = {
  93. .demod_address = 0x0f,
  94. .no_tuner = 1,
  95. .parallel_ts = 1,
  96. };
  97. static int gl861_frontend_attach(struct dvb_usb_adapter *adap)
  98. {
  99. adap->fe[0] = dvb_attach(zl10353_attach, &gl861_zl10353_config,
  100. &adap_to_d(adap)->i2c_adap);
  101. if (adap->fe[0] == NULL)
  102. return -EIO;
  103. return 0;
  104. }
  105. static struct qt1010_config gl861_qt1010_config = {
  106. .i2c_address = 0x62
  107. };
  108. static int gl861_tuner_attach(struct dvb_usb_adapter *adap)
  109. {
  110. return dvb_attach(qt1010_attach,
  111. adap->fe[0], &adap_to_d(adap)->i2c_adap,
  112. &gl861_qt1010_config) == NULL ? -ENODEV : 0;
  113. }
  114. static int gl861_init(struct dvb_usb_device *d)
  115. {
  116. /*
  117. * There is 2 interfaces. Interface 0 is for TV and interface 1 is
  118. * for HID remote controller. Interface 0 has 2 alternate settings.
  119. * For some reason we need to set interface explicitly, defaulted
  120. * as alternate setting 1?
  121. */
  122. return usb_set_interface(d->udev, 0, 0);
  123. }
  124. /* DVB USB Driver stuff */
  125. static struct dvb_usb_device_properties gl861_props = {
  126. .driver_name = KBUILD_MODNAME,
  127. .owner = THIS_MODULE,
  128. .adapter_nr = adapter_nr,
  129. .i2c_algo = &gl861_i2c_algo,
  130. .frontend_attach = gl861_frontend_attach,
  131. .tuner_attach = gl861_tuner_attach,
  132. .init = gl861_init,
  133. .num_adapters = 1,
  134. .adapter = {
  135. {
  136. .stream = DVB_USB_STREAM_BULK(0x81, 7, 512),
  137. }
  138. }
  139. };
  140. /*
  141. * For Friio
  142. */
  143. struct friio_priv {
  144. struct i2c_adapter *demod_sub_i2c;
  145. struct i2c_client *i2c_client_demod;
  146. struct i2c_client *i2c_client_tuner;
  147. struct i2c_adapter tuner_adap;
  148. };
  149. struct friio_config {
  150. struct i2c_board_info demod_info;
  151. struct tc90522_config demod_cfg;
  152. struct i2c_board_info tuner_info;
  153. struct dvb_pll_config tuner_cfg;
  154. };
  155. static const struct friio_config friio_config = {
  156. .demod_info = { I2C_BOARD_INFO(TC90522_I2C_DEV_TER, 0x18), },
  157. .tuner_info = { I2C_BOARD_INFO("tua6034_friio", 0x60), },
  158. };
  159. /* For another type of I2C:
  160. * message sent by a USB control-read/write transaction with data stage.
  161. * Used in init/config of Friio.
  162. */
  163. static int
  164. gl861_i2c_write_ex(struct dvb_usb_device *d, u8 addr, u8 *wbuf, u16 wlen)
  165. {
  166. u8 *buf;
  167. int ret;
  168. buf = kmalloc(wlen, GFP_KERNEL);
  169. if (!buf)
  170. return -ENOMEM;
  171. memcpy(buf, wbuf, wlen);
  172. ret = usb_control_msg(d->udev, usb_sndctrlpipe(d->udev, 0),
  173. GL861_REQ_I2C_RAW, GL861_WRITE,
  174. addr << (8 + 1), 0x0100, buf, wlen, 2000);
  175. kfree(buf);
  176. return ret;
  177. }
  178. static int
  179. gl861_i2c_read_ex(struct dvb_usb_device *d, u8 addr, u8 *rbuf, u16 rlen)
  180. {
  181. u8 *buf;
  182. int ret;
  183. buf = kmalloc(rlen, GFP_KERNEL);
  184. if (!buf)
  185. return -ENOMEM;
  186. ret = usb_control_msg(d->udev, usb_rcvctrlpipe(d->udev, 0),
  187. GL861_REQ_I2C_READ, GL861_READ,
  188. addr << (8 + 1), 0x0100, buf, rlen, 2000);
  189. if (ret > 0 && rlen > 0)
  190. memcpy(buf, rbuf, rlen);
  191. kfree(buf);
  192. return ret;
  193. }
  194. /* For I2C transactions to the tuner of Friio (dvb_pll).
  195. *
  196. * Friio uses irregular USB encapsulation for tuner i2c transactions:
  197. * write transacions are encapsulated with a different USB 'request' value.
  198. *
  199. * Although all transactions are sent via the demod(tc90522)
  200. * and the demod provides an i2c adapter for them, it cannot be used in Friio
  201. * since it assumes using the same parent adapter with the demod,
  202. * which does not use the request value and uses same one for both read/write.
  203. * So we define a dedicated i2c adapter here.
  204. */
  205. static int
  206. friio_i2c_tuner_read(struct dvb_usb_device *d, struct i2c_msg *msg)
  207. {
  208. struct friio_priv *priv;
  209. u8 addr;
  210. priv = d_to_priv(d);
  211. addr = priv->i2c_client_demod->addr;
  212. return gl861_i2c_read_ex(d, addr, msg->buf, msg->len);
  213. }
  214. static int
  215. friio_i2c_tuner_write(struct dvb_usb_device *d, struct i2c_msg *msg)
  216. {
  217. u8 *buf;
  218. int ret;
  219. struct friio_priv *priv;
  220. priv = d_to_priv(d);
  221. if (msg->len < 1)
  222. return -EINVAL;
  223. buf = kmalloc(msg->len + 1, GFP_KERNEL);
  224. if (!buf)
  225. return -ENOMEM;
  226. buf[0] = msg->addr << 1;
  227. memcpy(buf + 1, msg->buf, msg->len);
  228. ret = usb_control_msg(d->udev, usb_sndctrlpipe(d->udev, 0),
  229. GL861_REQ_I2C_RAW, GL861_WRITE,
  230. priv->i2c_client_demod->addr << (8 + 1),
  231. 0xFE, buf, msg->len + 1, 2000);
  232. kfree(buf);
  233. return ret;
  234. }
  235. static int friio_tuner_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
  236. int num)
  237. {
  238. struct dvb_usb_device *d = i2c_get_adapdata(adap);
  239. int i;
  240. if (num > 2)
  241. return -EINVAL;
  242. if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
  243. return -EAGAIN;
  244. for (i = 0; i < num; i++) {
  245. int ret;
  246. if (msg[i].flags & I2C_M_RD)
  247. ret = friio_i2c_tuner_read(d, &msg[i]);
  248. else
  249. ret = friio_i2c_tuner_write(d, &msg[i]);
  250. if (ret < 0)
  251. break;
  252. usleep_range(1000, 2000); /* avoid I2C errors */
  253. }
  254. mutex_unlock(&d->i2c_mutex);
  255. return i;
  256. }
  257. static struct i2c_algorithm friio_tuner_i2c_algo = {
  258. .master_xfer = friio_tuner_i2c_xfer,
  259. .functionality = gl861_i2c_func,
  260. };
  261. /* GPIO control in Friio */
  262. #define FRIIO_CTL_LNB (1 << 0)
  263. #define FRIIO_CTL_STROBE (1 << 1)
  264. #define FRIIO_CTL_CLK (1 << 2)
  265. #define FRIIO_CTL_LED (1 << 3)
  266. #define FRIIO_LED_RUNNING 0x6400ff64
  267. #define FRIIO_LED_STOPPED 0x96ff00ff
  268. /* control PIC16F676 attached to Friio */
  269. static int friio_ext_ctl(struct dvb_usb_device *d,
  270. u32 sat_color, int power_on)
  271. {
  272. int i, ret;
  273. struct i2c_msg msg;
  274. u8 *buf;
  275. u32 mask;
  276. u8 power = (power_on) ? FRIIO_CTL_LNB : 0;
  277. buf = kmalloc(2, GFP_KERNEL);
  278. if (!buf)
  279. return -ENOMEM;
  280. msg.addr = 0x00;
  281. msg.flags = 0;
  282. msg.len = 2;
  283. msg.buf = buf;
  284. buf[0] = 0x00;
  285. /* send 2bit header (&B10) */
  286. buf[1] = power | FRIIO_CTL_LED | FRIIO_CTL_STROBE;
  287. ret = i2c_transfer(&d->i2c_adap, &msg, 1);
  288. buf[1] |= FRIIO_CTL_CLK;
  289. ret += i2c_transfer(&d->i2c_adap, &msg, 1);
  290. buf[1] = power | FRIIO_CTL_STROBE;
  291. ret += i2c_transfer(&d->i2c_adap, &msg, 1);
  292. buf[1] |= FRIIO_CTL_CLK;
  293. ret += i2c_transfer(&d->i2c_adap, &msg, 1);
  294. /* send 32bit(satur, R, G, B) data in serial */
  295. mask = 1 << 31;
  296. for (i = 0; i < 32; i++) {
  297. buf[1] = power | FRIIO_CTL_STROBE;
  298. if (sat_color & mask)
  299. buf[1] |= FRIIO_CTL_LED;
  300. ret += i2c_transfer(&d->i2c_adap, &msg, 1);
  301. buf[1] |= FRIIO_CTL_CLK;
  302. ret += i2c_transfer(&d->i2c_adap, &msg, 1);
  303. mask >>= 1;
  304. }
  305. /* set the strobe off */
  306. buf[1] = power;
  307. ret += i2c_transfer(&d->i2c_adap, &msg, 1);
  308. buf[1] |= FRIIO_CTL_CLK;
  309. ret += i2c_transfer(&d->i2c_adap, &msg, 1);
  310. kfree(buf);
  311. return (ret == 70) ? 0 : -EREMOTEIO;
  312. }
  313. /* init/config of gl861 for Friio */
  314. /* NOTE:
  315. * This function cannot be moved to friio_init()/dvb_usbv2_init(),
  316. * because the init defined here must be done before any activities like I2C,
  317. * but friio_init() is called by dvb-usbv2 after {_frontend, _tuner}_attach(),
  318. * where I2C communication is used.
  319. * Thus this function is set to be called from _power_ctl().
  320. *
  321. * Since it will be called on the early init stage
  322. * where the i2c adapter is not initialized yet,
  323. * we cannot use i2c_transfer() here.
  324. */
  325. static int friio_reset(struct dvb_usb_device *d)
  326. {
  327. int i, ret;
  328. u8 wbuf[2], rbuf[2];
  329. static const u8 friio_init_cmds[][2] = {
  330. {0x33, 0x08}, {0x37, 0x40}, {0x3a, 0x1f}, {0x3b, 0xff},
  331. {0x3c, 0x1f}, {0x3d, 0xff}, {0x38, 0x00}, {0x35, 0x00},
  332. {0x39, 0x00}, {0x36, 0x00},
  333. };
  334. ret = usb_set_interface(d->udev, 0, 0);
  335. if (ret < 0)
  336. return ret;
  337. wbuf[0] = 0x11;
  338. wbuf[1] = 0x02;
  339. ret = gl861_i2c_msg(d, 0x00, wbuf, 2, NULL, 0);
  340. if (ret < 0)
  341. return ret;
  342. usleep_range(2000, 3000);
  343. wbuf[0] = 0x11;
  344. wbuf[1] = 0x00;
  345. ret = gl861_i2c_msg(d, 0x00, wbuf, 2, NULL, 0);
  346. if (ret < 0)
  347. return ret;
  348. /*
  349. * Check if the dev is really a Friio White, since it might be
  350. * another device, Friio Black, with the same VID/PID.
  351. */
  352. usleep_range(1000, 2000);
  353. wbuf[0] = 0x03;
  354. wbuf[1] = 0x80;
  355. ret = gl861_i2c_write_ex(d, 0x09, wbuf, 2);
  356. if (ret < 0)
  357. return ret;
  358. usleep_range(2000, 3000);
  359. ret = gl861_i2c_read_ex(d, 0x09, rbuf, 2);
  360. if (ret < 0)
  361. return ret;
  362. if (rbuf[0] != 0xff || rbuf[1] != 0xff)
  363. return -ENODEV;
  364. usleep_range(1000, 2000);
  365. ret = gl861_i2c_write_ex(d, 0x48, wbuf, 2);
  366. if (ret < 0)
  367. return ret;
  368. usleep_range(2000, 3000);
  369. ret = gl861_i2c_read_ex(d, 0x48, rbuf, 2);
  370. if (ret < 0)
  371. return ret;
  372. if (rbuf[0] != 0xff || rbuf[1] != 0xff)
  373. return -ENODEV;
  374. wbuf[0] = 0x30;
  375. wbuf[1] = 0x04;
  376. ret = gl861_i2c_msg(d, 0x00, wbuf, 2, NULL, 0);
  377. if (ret < 0)
  378. return ret;
  379. wbuf[0] = 0x00;
  380. wbuf[1] = 0x01;
  381. ret = gl861_i2c_msg(d, 0x00, wbuf, 2, NULL, 0);
  382. if (ret < 0)
  383. return ret;
  384. wbuf[0] = 0x06;
  385. wbuf[1] = 0x0f;
  386. ret = gl861_i2c_msg(d, 0x00, wbuf, 2, NULL, 0);
  387. if (ret < 0)
  388. return ret;
  389. for (i = 0; i < ARRAY_SIZE(friio_init_cmds); i++) {
  390. ret = gl861_i2c_msg(d, 0x00, (u8 *)friio_init_cmds[i], 2,
  391. NULL, 0);
  392. if (ret < 0)
  393. return ret;
  394. }
  395. return 0;
  396. }
  397. /*
  398. * DVB callbacks for Friio
  399. */
  400. static int friio_power_ctrl(struct dvb_usb_device *d, int onoff)
  401. {
  402. return onoff ? friio_reset(d) : 0;
  403. }
  404. static int friio_frontend_attach(struct dvb_usb_adapter *adap)
  405. {
  406. const struct i2c_board_info *info;
  407. struct dvb_usb_device *d;
  408. struct tc90522_config cfg;
  409. struct i2c_client *cl;
  410. struct friio_priv *priv;
  411. info = &friio_config.demod_info;
  412. d = adap_to_d(adap);
  413. cl = dvb_module_probe("tc90522", info->type,
  414. &d->i2c_adap, info->addr, &cfg);
  415. if (!cl)
  416. return -ENODEV;
  417. adap->fe[0] = cfg.fe;
  418. /* ignore cfg.tuner_i2c and create new one */
  419. priv = adap_to_priv(adap);
  420. priv->i2c_client_demod = cl;
  421. priv->tuner_adap.algo = &friio_tuner_i2c_algo;
  422. priv->tuner_adap.dev.parent = &d->udev->dev;
  423. strlcpy(priv->tuner_adap.name, d->name, sizeof(priv->tuner_adap.name));
  424. strlcat(priv->tuner_adap.name, "-tuner", sizeof(priv->tuner_adap.name));
  425. priv->demod_sub_i2c = &priv->tuner_adap;
  426. i2c_set_adapdata(&priv->tuner_adap, d);
  427. return i2c_add_adapter(&priv->tuner_adap);
  428. }
  429. static int friio_frontend_detach(struct dvb_usb_adapter *adap)
  430. {
  431. struct friio_priv *priv;
  432. priv = adap_to_priv(adap);
  433. i2c_del_adapter(&priv->tuner_adap);
  434. dvb_module_release(priv->i2c_client_demod);
  435. return 0;
  436. }
  437. static int friio_tuner_attach(struct dvb_usb_adapter *adap)
  438. {
  439. const struct i2c_board_info *info;
  440. struct dvb_pll_config cfg;
  441. struct i2c_client *cl;
  442. struct friio_priv *priv;
  443. priv = adap_to_priv(adap);
  444. info = &friio_config.tuner_info;
  445. cfg = friio_config.tuner_cfg;
  446. cfg.fe = adap->fe[0];
  447. cl = dvb_module_probe("dvb_pll", info->type,
  448. priv->demod_sub_i2c, info->addr, &cfg);
  449. if (!cl)
  450. return -ENODEV;
  451. priv->i2c_client_tuner = cl;
  452. return 0;
  453. }
  454. static int friio_tuner_detach(struct dvb_usb_adapter *adap)
  455. {
  456. struct friio_priv *priv;
  457. priv = adap_to_priv(adap);
  458. dvb_module_release(priv->i2c_client_tuner);
  459. return 0;
  460. }
  461. static int friio_init(struct dvb_usb_device *d)
  462. {
  463. int i;
  464. int ret;
  465. struct friio_priv *priv;
  466. static const u8 demod_init[][2] = {
  467. {0x01, 0x40}, {0x04, 0x38}, {0x05, 0x40}, {0x07, 0x40},
  468. {0x0f, 0x4f}, {0x11, 0x21}, {0x12, 0x0b}, {0x13, 0x2f},
  469. {0x14, 0x31}, {0x16, 0x02}, {0x21, 0xc4}, {0x22, 0x20},
  470. {0x2c, 0x79}, {0x2d, 0x34}, {0x2f, 0x00}, {0x30, 0x28},
  471. {0x31, 0x31}, {0x32, 0xdf}, {0x38, 0x01}, {0x39, 0x78},
  472. {0x3b, 0x33}, {0x3c, 0x33}, {0x48, 0x90}, {0x51, 0x68},
  473. {0x5e, 0x38}, {0x71, 0x00}, {0x72, 0x08}, {0x77, 0x00},
  474. {0xc0, 0x21}, {0xc1, 0x10}, {0xe4, 0x1a}, {0xea, 0x1f},
  475. {0x77, 0x00}, {0x71, 0x00}, {0x71, 0x00}, {0x76, 0x0c},
  476. };
  477. /* power on LNA? */
  478. ret = friio_ext_ctl(d, FRIIO_LED_STOPPED, true);
  479. if (ret < 0)
  480. return ret;
  481. msleep(20);
  482. /* init/config demod */
  483. priv = d_to_priv(d);
  484. for (i = 0; i < ARRAY_SIZE(demod_init); i++) {
  485. int ret;
  486. ret = i2c_master_send(priv->i2c_client_demod, demod_init[i], 2);
  487. if (ret < 0)
  488. return ret;
  489. }
  490. msleep(100);
  491. return 0;
  492. }
  493. static void friio_exit(struct dvb_usb_device *d)
  494. {
  495. friio_ext_ctl(d, FRIIO_LED_STOPPED, false);
  496. }
  497. static int friio_streaming_ctrl(struct dvb_frontend *fe, int onoff)
  498. {
  499. u32 led_color;
  500. led_color = onoff ? FRIIO_LED_RUNNING : FRIIO_LED_STOPPED;
  501. return friio_ext_ctl(fe_to_d(fe), led_color, true);
  502. }
  503. static struct dvb_usb_device_properties friio_props = {
  504. .driver_name = KBUILD_MODNAME,
  505. .owner = THIS_MODULE,
  506. .adapter_nr = adapter_nr,
  507. .size_of_priv = sizeof(struct friio_priv),
  508. .i2c_algo = &gl861_i2c_algo,
  509. .power_ctrl = friio_power_ctrl,
  510. .frontend_attach = friio_frontend_attach,
  511. .frontend_detach = friio_frontend_detach,
  512. .tuner_attach = friio_tuner_attach,
  513. .tuner_detach = friio_tuner_detach,
  514. .init = friio_init,
  515. .exit = friio_exit,
  516. .streaming_ctrl = friio_streaming_ctrl,
  517. .num_adapters = 1,
  518. .adapter = {
  519. {
  520. .stream = DVB_USB_STREAM_BULK(0x01, 8, 16384),
  521. }
  522. }
  523. };
  524. static const struct usb_device_id gl861_id_table[] = {
  525. { DVB_USB_DEVICE(USB_VID_MSI, USB_PID_MSI_MEGASKY580_55801,
  526. &gl861_props, "MSI Mega Sky 55801 DVB-T USB2.0", NULL) },
  527. { DVB_USB_DEVICE(USB_VID_ALINK, USB_VID_ALINK_DTU,
  528. &gl861_props, "A-LINK DTU DVB-T USB2.0", NULL) },
  529. { DVB_USB_DEVICE(USB_VID_774, USB_PID_FRIIO_WHITE,
  530. &friio_props, "774 Friio White ISDB-T USB2.0", NULL) },
  531. { }
  532. };
  533. MODULE_DEVICE_TABLE(usb, gl861_id_table);
  534. static struct usb_driver gl861_usb_driver = {
  535. .name = KBUILD_MODNAME,
  536. .id_table = gl861_id_table,
  537. .probe = dvb_usbv2_probe,
  538. .disconnect = dvb_usbv2_disconnect,
  539. .suspend = dvb_usbv2_suspend,
  540. .resume = dvb_usbv2_resume,
  541. .reset_resume = dvb_usbv2_reset_resume,
  542. .no_dynamic_id = 1,
  543. .soft_unbind = 1,
  544. };
  545. module_usb_driver(gl861_usb_driver);
  546. MODULE_AUTHOR("Carl Lundqvist <comabug@gmail.com>");
  547. MODULE_DESCRIPTION("Driver MSI Mega Sky 580 DVB-T USB2.0 / GL861");
  548. MODULE_VERSION("0.1");
  549. MODULE_LICENSE("GPL");