m920x.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698
  1. /* DVB USB compliant linux driver for MSI Mega Sky 580 DVB-T USB2.0 receiver
  2. *
  3. * Copyright (C) 2006 Aapo Tahkola (aet@rasterburn.org)
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License as published by the Free
  7. * Software Foundation, version 2.
  8. *
  9. * see Documentation/dvb/README.dvb-usb for more information
  10. */
  11. #include "m920x.h"
  12. #include "mt352.h"
  13. #include "mt352_priv.h"
  14. /* debug */
  15. int dvb_usb_m920x_debug;
  16. module_param_named(debug,dvb_usb_m920x_debug, int, 0644);
  17. MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
  18. static struct dvb_usb_rc_key megasky_rc_keys [] = {
  19. { 0x0, 0x12, KEY_POWER },
  20. { 0x0, 0x1e, KEY_CYCLEWINDOWS }, /* min/max */
  21. { 0x0, 0x02, KEY_CHANNELUP },
  22. { 0x0, 0x05, KEY_CHANNELDOWN },
  23. { 0x0, 0x03, KEY_VOLUMEUP },
  24. { 0x0, 0x06, KEY_VOLUMEDOWN },
  25. { 0x0, 0x04, KEY_MUTE },
  26. { 0x0, 0x07, KEY_OK }, /* TS */
  27. { 0x0, 0x08, KEY_STOP },
  28. { 0x0, 0x09, KEY_MENU }, /* swap */
  29. { 0x0, 0x0a, KEY_REWIND },
  30. { 0x0, 0x1b, KEY_PAUSE },
  31. { 0x0, 0x1f, KEY_FASTFORWARD },
  32. { 0x0, 0x0c, KEY_RECORD },
  33. { 0x0, 0x0d, KEY_CAMERA }, /* screenshot */
  34. { 0x0, 0x0e, KEY_COFFEE }, /* "MTS" */
  35. };
  36. static inline int m9206_read(struct usb_device *udev, u8 request, u16 value, u16 index, void *data, int size)
  37. {
  38. int ret;
  39. ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
  40. request, USB_TYPE_VENDOR | USB_DIR_IN,
  41. value, index, data, size, 2000);
  42. if (ret < 0)
  43. return ret;
  44. if (ret != size)
  45. return -EIO;
  46. return 0;
  47. }
  48. static inline int m9206_write(struct usb_device *udev, u8 request, u16 value, u16 index)
  49. {
  50. int ret;
  51. ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
  52. request, USB_TYPE_VENDOR | USB_DIR_OUT,
  53. value, index, NULL, 0, 2000);
  54. msleep(3);
  55. return ret;
  56. }
  57. static int m9206_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
  58. {
  59. int i, ret = 0;
  60. u8 rc_state[2];
  61. if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
  62. return -EAGAIN;
  63. if ((ret = m9206_read(d->udev, 0x22, 0x0, 0xff51, rc_state, 1)) != 0)
  64. goto unlock;
  65. if ((ret = m9206_read(d->udev, 0x22, 0x0, 0xff52, rc_state + 1, 1)) != 0)
  66. goto unlock;
  67. for (i = 0; i < ARRAY_SIZE(megasky_rc_keys); i++)
  68. if (megasky_rc_keys[i].data == rc_state[1]) {
  69. *event = megasky_rc_keys[i].event;
  70. switch(rc_state[0]) {
  71. case 0x80:
  72. *state = REMOTE_NO_KEY_PRESSED;
  73. goto unlock;
  74. case 0x93:
  75. case 0x92:
  76. *state = REMOTE_KEY_PRESSED;
  77. goto unlock;
  78. case 0x91:
  79. *state = REMOTE_KEY_REPEAT;
  80. goto unlock;
  81. default:
  82. deb_rc("Unexpected rc response %x\n", rc_state[0]);
  83. *state = REMOTE_NO_KEY_PRESSED;
  84. goto unlock;
  85. }
  86. }
  87. if (rc_state[1] != 0)
  88. deb_rc("Unknown rc key %x\n", rc_state[1]);
  89. *state = REMOTE_NO_KEY_PRESSED;
  90. unlock:
  91. mutex_unlock(&d->i2c_mutex);
  92. return ret;
  93. }
  94. /* I2C */
  95. static int m9206_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num)
  96. {
  97. struct dvb_usb_device *d = i2c_get_adapdata(adap);
  98. int i;
  99. int ret = 0;
  100. if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
  101. return -EAGAIN;
  102. if (num > 2)
  103. return -EINVAL;
  104. for (i = 0; i < num; i++) {
  105. u8 w_len;
  106. if ((ret = m9206_write(d->udev, 0x23, msg[i].addr, 0x80)) != 0)
  107. goto unlock;
  108. if ((ret = m9206_write(d->udev, 0x23, msg[i].buf[0], 0x0)) != 0)
  109. goto unlock;
  110. if (i + 1 < num && msg[i + 1].flags & I2C_M_RD) {
  111. if (msg[i].addr == 0x1e)
  112. w_len = 0x1f;
  113. else
  114. w_len = 0xc5;
  115. if ((ret = m9206_write(d->udev, 0x23, w_len, 0x80)) != 0)
  116. goto unlock;
  117. if ((ret = m9206_read(d->udev, 0x23, 0x0, 0x60, msg[i + 1].buf, msg[i + 1].len)) != 0)
  118. goto unlock;
  119. i++;
  120. } else {
  121. if (msg[i].len != 2)
  122. return -EINVAL;
  123. if ((ret = m9206_write(d->udev, 0x23, msg[i].buf[1], 0x40)) != 0)
  124. goto unlock;
  125. }
  126. }
  127. ret = i;
  128. unlock:
  129. mutex_unlock(&d->i2c_mutex);
  130. return ret;
  131. }
  132. static u32 m9206_i2c_func(struct i2c_adapter *adapter)
  133. {
  134. return I2C_FUNC_I2C;
  135. }
  136. static struct i2c_algorithm m9206_i2c_algo = {
  137. .master_xfer = m9206_i2c_xfer,
  138. .functionality = m9206_i2c_func,
  139. };
  140. /* Callbacks for DVB USB */
  141. static int megasky_identify_state(struct usb_device *udev,
  142. struct dvb_usb_device_properties *props,
  143. struct dvb_usb_device_description **desc,
  144. int *cold)
  145. {
  146. struct usb_host_interface *alt;
  147. alt = usb_altnum_to_altsetting(usb_ifnum_to_if(udev, 0), 1);
  148. *cold = (alt == NULL) ? 1 : 0;
  149. return 0;
  150. }
  151. static int megasky_mt352_demod_init(struct dvb_frontend *fe)
  152. {
  153. int i;
  154. static u8 buf1[] = {
  155. CONFIG, 0x3d,
  156. CLOCK_CTL, 0x30,
  157. RESET, 0x80,
  158. ADC_CTL_1, 0x40,
  159. AGC_TARGET, 0x1c,
  160. AGC_CTL, 0x20,
  161. 0x69, 0x00,
  162. 0x6a, 0xff,
  163. 0x6b, 0xff,
  164. 0x6c, 0x40,
  165. 0x6d, 0xff,
  166. 0x6e, 0x00,
  167. 0x6f, 0x40,
  168. 0x70, 0x40,
  169. 0x93, 0x1a,
  170. 0xb5, 0x7a,
  171. ACQ_CTL, 0x50,
  172. INPUT_FREQ_1, 0x31,
  173. INPUT_FREQ_0, 0x05,
  174. };
  175. for (i = 0; i < ARRAY_SIZE(buf1); i += 2)
  176. mt352_write(fe, &buf1[i], 2);
  177. deb_rc("Demod init!\n");
  178. return 0;
  179. }
  180. struct mt352_state;
  181. #define W 0
  182. #define R 1
  183. /* Not actual hw limits. */
  184. #define QT1010_MIN_STEP 2000000
  185. #define QT1010_MIN_FREQ 48000000
  186. int qt1010_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params, u8 *buf, int buf_len)
  187. {
  188. int i;
  189. int div, mod;
  190. struct {
  191. u8 read, reg, value;
  192. } rd[46] = { { W, 0x01, 0x80 },
  193. { W, 0x02, 0x3f },
  194. { W, 0x05, 0xff }, /* c */
  195. { W, 0x06, 0x44 },
  196. { W, 0x07, 0xff }, /* c */
  197. { W, 0x08, 0x08 },
  198. { W, 0x09, 0xff }, /* c */
  199. { W, 0x0a, 0xff }, /* c */
  200. { W, 0x0b, 0xff }, /* c */
  201. { W, 0x0c, 0xe1 },
  202. { W, 0x1a, 0xff }, /* 10 c */
  203. { W, 0x1b, 0x00 },
  204. { W, 0x1c, 0x89 },
  205. { W, 0x11, 0xff }, /* c */
  206. { W, 0x12, 0x91 },
  207. { W, 0x22, 0xff }, /* c */
  208. { W, 0x1e, 0x00 },
  209. { W, 0x1e, 0xd0 },
  210. { R, 0x22, 0xff }, /* c read */
  211. { W, 0x1e, 0x00 },
  212. { R, 0x05, 0xff }, /* 20 c read */
  213. { R, 0x22, 0xff }, /* c read */
  214. { W, 0x23, 0xd0 },
  215. { W, 0x1e, 0x00 },
  216. { W, 0x1e, 0xe0 },
  217. { R, 0x23, 0xff }, /* c read */
  218. { W, 0x1e, 0x00 },
  219. { W, 0x24, 0xd0 },
  220. { W, 0x1e, 0x00 },
  221. { W, 0x1e, 0xf0 },
  222. { R, 0x24, 0xff }, /* 30 c read */
  223. { W, 0x1e, 0x00 },
  224. { W, 0x14, 0x7f },
  225. { W, 0x15, 0x7f },
  226. { W, 0x05, 0xff }, /* c */
  227. { W, 0x06, 0x00 },
  228. { W, 0x15, 0x1f },
  229. { W, 0x16, 0xff },
  230. { W, 0x18, 0xff },
  231. { W, 0x1f, 0xff }, /* c */
  232. { W, 0x20, 0xff }, /* 40 c */
  233. { W, 0x21, 0x53 },
  234. { W, 0x25, 0xbd },
  235. { W, 0x26, 0x15 },
  236. { W, 0x02, 0x00 },
  237. { W, 0x01, 0x00 },
  238. };
  239. struct i2c_msg msg;
  240. struct dvb_usb_device *d = fe->dvb->priv;
  241. unsigned long freq = params->frequency;
  242. if (freq % QT1010_MIN_STEP)
  243. deb_rc("frequency not supported.\n");
  244. (void) buf;
  245. (void) buf_len;
  246. div = (freq - QT1010_MIN_FREQ) / QT1010_MIN_STEP;
  247. mod = (div + 16 - 9) % 16;
  248. /* 0x5 */
  249. if (div >= 377)
  250. rd[2].value = 0x74;
  251. else if (div >= 265)
  252. rd[2].value = 0x54;
  253. else if (div >= 121)
  254. rd[2].value = 0x34;
  255. else
  256. rd[2].value = 0x14;
  257. /* 0x7 */
  258. rd[4].value = (((freq - QT1010_MIN_FREQ) / 1000000) * 9975 + 12960000) / 320000;
  259. /* 09 */
  260. if (mod < 4)
  261. rd[6].value = 0x1d;
  262. else
  263. rd[6].value = 0x1c;
  264. /* 0a */
  265. if (mod < 2)
  266. rd[7].value = 0x09;
  267. else if (mod < 4)
  268. rd[7].value = 0x08;
  269. else if (mod < 6)
  270. rd[7].value = 0x0f;
  271. else if (mod < 8)
  272. rd[7].value = 0x0e;
  273. else if (mod < 10)
  274. rd[7].value = 0x0d;
  275. else if (mod < 12)
  276. rd[7].value = 0x0c;
  277. else if (mod < 14)
  278. rd[7].value = 0x0b;
  279. else
  280. rd[7].value = 0x0a;
  281. /* 0b */
  282. if (div & 1)
  283. rd[8].value = 0x45;
  284. else
  285. rd[8].value = 0x44;
  286. /* 1a */
  287. if (div & 1)
  288. rd[10].value = 0x78;
  289. else
  290. rd[10].value = 0xf8;
  291. /* 11 */
  292. if (div >= 265)
  293. rd[13].value = 0xf9;
  294. else if (div >= 121)
  295. rd[13].value = 0xfd;
  296. else
  297. rd[13].value = 0xf9;
  298. /* 22 */
  299. if (div < 201)
  300. rd[15].value = 0xd0;
  301. else if (div < 217)
  302. rd[15].value = 0xd3;
  303. else if (div < 233)
  304. rd[15].value = 0xd6;
  305. else if (div < 249)
  306. rd[15].value = 0xd9;
  307. else if (div < 265)
  308. rd[15].value = 0xda;
  309. else
  310. rd[15].value = 0xd0;
  311. /* 05 */
  312. if (div >= 377)
  313. rd[34].value = 0x70;
  314. else if (div >= 265)
  315. rd[34].value = 0x50;
  316. else if (div >= 121)
  317. rd[34].value = 0x30;
  318. else
  319. rd[34].value = 0x10;
  320. /* 1f */
  321. if (mod < 4)
  322. rd[39].value = 0x64;
  323. else if (mod < 6)
  324. rd[39].value = 0x66;
  325. else if (mod < 8)
  326. rd[39].value = 0x67;
  327. else if (mod < 12)
  328. rd[39].value = 0x68;
  329. else if (mod < 14)
  330. rd[39].value = 0x69;
  331. else
  332. rd[39].value = 0x6a;
  333. /* 20 */
  334. if (mod < 4)
  335. rd[40].value = 0x10;
  336. else if (mod < 6)
  337. rd[40].value = 0x11;
  338. else if (mod < 10)
  339. rd[40].value = 0x12;
  340. else if (mod < 12)
  341. rd[40].value = 0x13;
  342. else if (mod < 14)
  343. rd[40].value = 0x14;
  344. else
  345. rd[40].value = 0x15;
  346. deb_rc("Now tuning... ");
  347. for (i = 0; i < sizeof(rd) / sizeof(*rd); i++) {
  348. if (rd[i].read)
  349. continue;
  350. msg.flags = 0;
  351. msg.len = 2;
  352. msg.addr = 0xc4;
  353. msg.buf = &rd[i].reg;
  354. if (i2c_transfer(&d->i2c_adap, &msg, 1) != 1) {
  355. deb_rc("tuner write failed\n");
  356. return -EIO;
  357. }
  358. }
  359. deb_rc("done\n");
  360. return 0;
  361. }
  362. #undef W
  363. #undef R
  364. static struct mt352_config megasky_mt352_config = {
  365. .demod_address = 0x1e,
  366. .demod_init = megasky_mt352_demod_init,
  367. };
  368. static int megasky_frontend_attach(struct dvb_usb_adapter *adap)
  369. {
  370. deb_rc("megasky_frontend_attach!\n");
  371. if ((adap->fe = dvb_attach(mt352_attach, &megasky_mt352_config, &adap->dev->i2c_adap)) != NULL) {
  372. adap->fe->ops.tuner_ops.calc_regs = qt1010_set_params;
  373. return 0;
  374. }
  375. return -EIO;
  376. }
  377. /* DVB USB Driver stuff */
  378. static struct dvb_usb_device_properties megasky_properties;
  379. static int m920x_probe(struct usb_interface *intf, const struct usb_device_id *id)
  380. {
  381. struct dvb_usb_device *d;
  382. struct usb_host_interface *alt;
  383. int ret;
  384. if ((ret = dvb_usb_device_init(intf, &megasky_properties, THIS_MODULE, &d)) == 0) {
  385. deb_rc("probed!\n");
  386. alt = usb_altnum_to_altsetting(intf, 1);
  387. if (alt == NULL) {
  388. deb_rc("not alt found!\n");
  389. return -ENODEV;
  390. }
  391. ret = usb_set_interface(d->udev, alt->desc.bInterfaceNumber, alt->desc.bAlternateSetting);
  392. if (ret < 0)
  393. return ret;
  394. deb_rc("Changed to alternate setting!\n");
  395. /* Remote controller init. */
  396. if ((ret = m9206_write(d->udev, 0x22, 0xa8, 0xff55)) != 0)
  397. return ret;
  398. if ((ret = m9206_write(d->udev, 0x22, 0x51, 0xff54)) != 0)
  399. return ret;
  400. }
  401. return ret;
  402. }
  403. static struct usb_device_id m920x_table [] = {
  404. { USB_DEVICE(USB_VID_MSI, USB_PID_MSI_MEGASKY580) },
  405. { } /* Terminating entry */
  406. };
  407. MODULE_DEVICE_TABLE (usb, m920x_table);
  408. static int set_filter(struct dvb_usb_adapter *adap, int type, int idx, int pid)
  409. {
  410. int ret = 0;
  411. if (pid >= 0x8000)
  412. return -EINVAL;
  413. pid |= 0x8000;
  414. if ((ret = m9206_write(adap->dev->udev, 0x25, pid, (type << 8) | (idx * 4) )) != 0)
  415. return ret;
  416. if ((ret = m9206_write(adap->dev->udev, 0x25, 0, (type << 8) | (idx * 4) )) != 0)
  417. return ret;
  418. return ret;
  419. }
  420. static int m9206_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff)
  421. {
  422. int ret = 0;
  423. if (mutex_lock_interruptible(&adap->dev->i2c_mutex) < 0)
  424. return -EAGAIN;
  425. deb_rc("filtering %s\n", onoff ? "on" : "off");
  426. if (onoff == 0) {
  427. if ((ret = set_filter(adap, 0x81, 1, 0x00)) != 0)
  428. goto unlock;
  429. if ((ret = set_filter(adap, 0x82, 0, 0x02f5)) != 0)
  430. goto unlock;
  431. }
  432. unlock:
  433. mutex_unlock(&adap->dev->i2c_mutex);
  434. return ret;
  435. }
  436. static int m9206_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, int onoff)
  437. {
  438. int ret = 0;
  439. if (pid == 8192)
  440. return m9206_pid_filter_ctrl(adap, !onoff);
  441. if (mutex_lock_interruptible(&adap->dev->i2c_mutex) < 0)
  442. return -EAGAIN;
  443. deb_rc("filter %d, pid %x, %s\n", index, pid, onoff ? "on" : "off");
  444. if (onoff == 0)
  445. pid = 0;
  446. if ((ret = set_filter(adap, 0x81, 1, 0x01)) != 0)
  447. goto unlock;
  448. if ((ret = set_filter(adap, 0x81, index + 2, pid)) != 0)
  449. goto unlock;
  450. if ((ret = set_filter(adap, 0x82, 0, 0x02f5)) != 0)
  451. goto unlock;
  452. unlock:
  453. mutex_unlock(&adap->dev->i2c_mutex);
  454. return ret;
  455. }
  456. static int m9206_firmware_download(struct usb_device *udev, const struct firmware *fw)
  457. {
  458. u16 value, index, size;
  459. u8 read[4], *buff;
  460. int i, pass, ret = 0;
  461. buff = kmalloc(65536, GFP_KERNEL);
  462. if ((ret = m9206_read(udev, 0x25, 0x0, 0x8000, read, 4)) != 0)
  463. goto done;
  464. deb_rc("%x %x %x %x\n", read[0], read[1], read[2], read[3]);
  465. if ((ret = m9206_read(udev, 0x30, 0x0, 0x0, read, 1)) != 0)
  466. goto done;
  467. deb_rc("%x\n", read[0]);
  468. for (pass = 0; pass < 2; pass++) {
  469. for (i = 0; i + (sizeof(u16) * 3) < fw->size;) {
  470. value = le16_to_cpu(*(u16 *)(fw->data + i));
  471. i += sizeof(u16);
  472. index = le16_to_cpu(*(u16 *)(fw->data + i));
  473. i += sizeof(u16);
  474. size = le16_to_cpu(*(u16 *)(fw->data + i));
  475. i += sizeof(u16);
  476. if (pass == 1) {
  477. /* Will stall if using fw->data ... */
  478. memcpy(buff, fw->data + i, size);
  479. ret = usb_control_msg(udev, usb_sndctrlpipe(udev,0),
  480. 0x30, USB_TYPE_VENDOR | USB_DIR_OUT,
  481. value, index, buff, size, 20);
  482. if (ret != size) {
  483. deb_rc("error while uploading fw!\n");
  484. ret = -EIO;
  485. goto done;
  486. }
  487. msleep(3);
  488. }
  489. i += size;
  490. }
  491. if (i != fw->size) {
  492. ret = -EINVAL;
  493. goto done;
  494. }
  495. }
  496. msleep(36);
  497. /* m9206 will disconnect itself from the bus after this. */
  498. (void) m9206_write(udev, 0x22, 0x01, 0xff69);
  499. deb_rc("firmware uploaded!\n");
  500. done:
  501. kfree(buff);
  502. return ret;
  503. }
  504. static struct dvb_usb_device_properties megasky_properties = {
  505. .usb_ctrl = DEVICE_SPECIFIC,
  506. .firmware = "dvb-usb-megasky-02.fw",
  507. .download_firmware = m9206_firmware_download,
  508. .rc_interval = 200,
  509. .rc_key_map = megasky_rc_keys,
  510. .rc_key_map_size = ARRAY_SIZE(megasky_rc_keys),
  511. .rc_query = m9206_rc_query,
  512. .size_of_priv = 0,
  513. .identify_state = megasky_identify_state,
  514. .num_adapters = 1,
  515. .adapter = {{
  516. .caps = DVB_USB_IS_AN_I2C_ADAPTER | DVB_USB_ADAP_HAS_PID_FILTER |
  517. DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF |
  518. DVB_USB_ADAP_NEED_PID_FILTERING,
  519. .pid_filter_count = 8,
  520. .pid_filter = m9206_pid_filter,
  521. .pid_filter_ctrl = m9206_pid_filter_ctrl,
  522. .frontend_attach = megasky_frontend_attach,
  523. .stream = {
  524. .type = USB_BULK,
  525. .count = 8,
  526. .endpoint = 0x81,
  527. .u = {
  528. .bulk = {
  529. .buffersize = 512,
  530. }
  531. }
  532. },
  533. }},
  534. .i2c_algo = &m9206_i2c_algo,
  535. .generic_bulk_ctrl_endpoint = 0x01,
  536. .num_device_descs = 1,
  537. .devices = {
  538. { "MSI Mega Sky 580 DVB-T USB2.0",
  539. { &m920x_table[0], NULL },
  540. { NULL },
  541. },
  542. { NULL },
  543. }
  544. };
  545. static struct usb_driver m920x_driver = {
  546. .name = "dvb_usb_m920x",
  547. .probe = m920x_probe,
  548. .disconnect = dvb_usb_device_exit,
  549. .id_table = m920x_table,
  550. };
  551. /* module stuff */
  552. static int __init m920x_module_init(void)
  553. {
  554. int ret;
  555. if ((ret = usb_register(&m920x_driver))) {
  556. err("usb_register failed. Error number %d", ret);
  557. return ret;
  558. }
  559. return 0;
  560. }
  561. static void __exit m920x_module_exit(void)
  562. {
  563. /* deregister this driver from the USB subsystem */
  564. usb_deregister(&m920x_driver);
  565. }
  566. module_init (m920x_module_init);
  567. module_exit (m920x_module_exit);
  568. MODULE_AUTHOR("Aapo Tahkola <aet@rasterburn.org>");
  569. MODULE_DESCRIPTION("Driver MSI Mega Sky 580 DVB-T USB2.0 / Uli m920x");
  570. MODULE_VERSION("0.1");
  571. MODULE_LICENSE("GPL");