m920x.c 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271
  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
  7. * Free 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. #include "qt1010.h"
  15. #include "tda1004x.h"
  16. #include "tda827x.h"
  17. #include "mt2060.h"
  18. #include <media/tuner.h>
  19. #include "tuner-simple.h"
  20. #include <asm/unaligned.h>
  21. /* debug */
  22. static int dvb_usb_m920x_debug;
  23. module_param_named(debug,dvb_usb_m920x_debug, int, 0644);
  24. MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
  25. DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
  26. static int m920x_set_filter(struct dvb_usb_device *d, int type, int idx, int pid);
  27. static inline int m920x_read(struct usb_device *udev, u8 request, u16 value,
  28. u16 index, void *data, int size)
  29. {
  30. int ret;
  31. ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
  32. request, USB_TYPE_VENDOR | USB_DIR_IN,
  33. value, index, data, size, 2000);
  34. if (ret < 0) {
  35. printk(KERN_INFO "m920x_read = error: %d\n", ret);
  36. return ret;
  37. }
  38. if (ret != size) {
  39. deb("m920x_read = no data\n");
  40. return -EIO;
  41. }
  42. return 0;
  43. }
  44. static inline int m920x_write(struct usb_device *udev, u8 request,
  45. u16 value, u16 index)
  46. {
  47. int ret;
  48. ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
  49. request, USB_TYPE_VENDOR | USB_DIR_OUT,
  50. value, index, NULL, 0, 2000);
  51. return ret;
  52. }
  53. static inline int m920x_write_seq(struct usb_device *udev, u8 request,
  54. struct m920x_inits *seq)
  55. {
  56. int ret;
  57. do {
  58. ret = m920x_write(udev, request, seq->data, seq->address);
  59. if (ret != 0)
  60. return ret;
  61. seq++;
  62. } while (seq->address);
  63. return 0;
  64. }
  65. static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq)
  66. {
  67. int ret, i, epi, flags = 0;
  68. int adap_enabled[M9206_MAX_ADAPTERS] = { 0 };
  69. /* Remote controller init. */
  70. if (d->props.rc.legacy.rc_query || d->props.rc.core.rc_query) {
  71. deb("Initialising remote control\n");
  72. ret = m920x_write_seq(d->udev, M9206_CORE, rc_seq);
  73. if (ret != 0) {
  74. deb("Initialising remote control failed\n");
  75. return ret;
  76. }
  77. deb("Initialising remote control success\n");
  78. }
  79. for (i = 0; i < d->props.num_adapters; i++)
  80. flags |= d->adapter[i].props.fe[0].caps;
  81. /* Some devices(Dposh) might crash if we attempt touch at all. */
  82. if (flags & DVB_USB_ADAP_HAS_PID_FILTER) {
  83. for (i = 0; i < d->props.num_adapters; i++) {
  84. epi = d->adapter[i].props.fe[0].stream.endpoint - 0x81;
  85. if (epi < 0 || epi >= M9206_MAX_ADAPTERS) {
  86. printk(KERN_INFO "m920x: Unexpected adapter endpoint!\n");
  87. return -EINVAL;
  88. }
  89. adap_enabled[epi] = 1;
  90. }
  91. for (i = 0; i < M9206_MAX_ADAPTERS; i++) {
  92. if (adap_enabled[i])
  93. continue;
  94. if ((ret = m920x_set_filter(d, 0x81 + i, 0, 0x0)) != 0)
  95. return ret;
  96. if ((ret = m920x_set_filter(d, 0x81 + i, 0, 0x02f5)) != 0)
  97. return ret;
  98. }
  99. }
  100. return 0;
  101. }
  102. static int m920x_init_ep(struct usb_interface *intf)
  103. {
  104. struct usb_device *udev = interface_to_usbdev(intf);
  105. struct usb_host_interface *alt;
  106. if ((alt = usb_altnum_to_altsetting(intf, 1)) == NULL) {
  107. deb("No alt found!\n");
  108. return -ENODEV;
  109. }
  110. return usb_set_interface(udev, alt->desc.bInterfaceNumber,
  111. alt->desc.bAlternateSetting);
  112. }
  113. static inline void m920x_parse_rc_state(struct dvb_usb_device *d, u8 rc_state,
  114. int *state)
  115. {
  116. struct m920x_state *m = d->priv;
  117. switch (rc_state) {
  118. case 0x80:
  119. *state = REMOTE_NO_KEY_PRESSED;
  120. break;
  121. case 0x88: /* framing error or "invalid code" */
  122. case 0x99:
  123. case 0xc0:
  124. case 0xd8:
  125. *state = REMOTE_NO_KEY_PRESSED;
  126. m->rep_count = 0;
  127. break;
  128. case 0x93:
  129. case 0x92:
  130. case 0x83: /* pinnacle PCTV310e */
  131. case 0x82:
  132. m->rep_count = 0;
  133. *state = REMOTE_KEY_PRESSED;
  134. break;
  135. case 0x91:
  136. case 0x81: /* pinnacle PCTV310e */
  137. /* prevent immediate auto-repeat */
  138. if (++m->rep_count > 2)
  139. *state = REMOTE_KEY_REPEAT;
  140. else
  141. *state = REMOTE_NO_KEY_PRESSED;
  142. break;
  143. default:
  144. deb("Unexpected rc state %02x\n", rc_state);
  145. *state = REMOTE_NO_KEY_PRESSED;
  146. break;
  147. }
  148. }
  149. static int m920x_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
  150. {
  151. int i, ret = 0;
  152. u8 *rc_state;
  153. rc_state = kmalloc(2, GFP_KERNEL);
  154. if (!rc_state)
  155. return -ENOMEM;
  156. ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_STATE,
  157. rc_state, 1);
  158. if (ret != 0)
  159. goto out;
  160. ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_KEY,
  161. rc_state + 1, 1);
  162. if (ret != 0)
  163. goto out;
  164. m920x_parse_rc_state(d, rc_state[0], state);
  165. for (i = 0; i < d->props.rc.legacy.rc_map_size; i++)
  166. if (rc5_data(&d->props.rc.legacy.rc_map_table[i]) == rc_state[1]) {
  167. *event = d->props.rc.legacy.rc_map_table[i].keycode;
  168. goto out;
  169. }
  170. if (rc_state[1] != 0)
  171. deb("Unknown rc key %02x\n", rc_state[1]);
  172. *state = REMOTE_NO_KEY_PRESSED;
  173. out:
  174. kfree(rc_state);
  175. return ret;
  176. }
  177. static int m920x_rc_core_query(struct dvb_usb_device *d)
  178. {
  179. int ret = 0;
  180. u8 *rc_state;
  181. int state;
  182. rc_state = kmalloc(2, GFP_KERNEL);
  183. if (!rc_state)
  184. return -ENOMEM;
  185. if ((ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_STATE, &rc_state[0], 1)) != 0)
  186. goto out;
  187. if ((ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_KEY, &rc_state[1], 1)) != 0)
  188. goto out;
  189. deb("state=0x%02x keycode=0x%02x\n", rc_state[0], rc_state[1]);
  190. m920x_parse_rc_state(d, rc_state[0], &state);
  191. if (state == REMOTE_NO_KEY_PRESSED)
  192. rc_keyup(d->rc_dev);
  193. else if (state == REMOTE_KEY_REPEAT)
  194. rc_repeat(d->rc_dev);
  195. else
  196. rc_keydown(d->rc_dev, RC_TYPE_UNKNOWN, rc_state[1], 0);
  197. out:
  198. kfree(rc_state);
  199. return ret;
  200. }
  201. /* I2C */
  202. static int m920x_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num)
  203. {
  204. struct dvb_usb_device *d = i2c_get_adapdata(adap);
  205. int i, j;
  206. int ret = 0;
  207. if (!num)
  208. return -EINVAL;
  209. if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
  210. return -EAGAIN;
  211. for (i = 0; i < num; i++) {
  212. if (msg[i].flags & (I2C_M_NO_RD_ACK | I2C_M_IGNORE_NAK | I2C_M_TEN) || msg[i].len == 0) {
  213. /* For a 0 byte message, I think sending the address
  214. * to index 0x80|0x40 would be the correct thing to
  215. * do. However, zero byte messages are only used for
  216. * probing, and since we don't know how to get the
  217. * slave's ack, we can't probe. */
  218. ret = -ENOTSUPP;
  219. goto unlock;
  220. }
  221. /* Send START & address/RW bit */
  222. if (!(msg[i].flags & I2C_M_NOSTART)) {
  223. if ((ret = m920x_write(d->udev, M9206_I2C,
  224. (msg[i].addr << 1) |
  225. (msg[i].flags & I2C_M_RD ? 0x01 : 0), 0x80)) != 0)
  226. goto unlock;
  227. /* Should check for ack here, if we knew how. */
  228. }
  229. if (msg[i].flags & I2C_M_RD) {
  230. for (j = 0; j < msg[i].len; j++) {
  231. /* Last byte of transaction?
  232. * Send STOP, otherwise send ACK. */
  233. int stop = (i+1 == num && j+1 == msg[i].len) ? 0x40 : 0x01;
  234. if ((ret = m920x_read(d->udev, M9206_I2C, 0x0,
  235. 0x20 | stop,
  236. &msg[i].buf[j], 1)) != 0)
  237. goto unlock;
  238. }
  239. } else {
  240. for (j = 0; j < msg[i].len; j++) {
  241. /* Last byte of transaction? Then send STOP. */
  242. int stop = (i+1 == num && j+1 == msg[i].len) ? 0x40 : 0x00;
  243. if ((ret = m920x_write(d->udev, M9206_I2C, msg[i].buf[j], stop)) != 0)
  244. goto unlock;
  245. /* Should check for ack here too. */
  246. }
  247. }
  248. }
  249. ret = num;
  250. unlock:
  251. mutex_unlock(&d->i2c_mutex);
  252. return ret;
  253. }
  254. static u32 m920x_i2c_func(struct i2c_adapter *adapter)
  255. {
  256. return I2C_FUNC_I2C;
  257. }
  258. static struct i2c_algorithm m920x_i2c_algo = {
  259. .master_xfer = m920x_i2c_xfer,
  260. .functionality = m920x_i2c_func,
  261. };
  262. /* pid filter */
  263. static int m920x_set_filter(struct dvb_usb_device *d, int type, int idx, int pid)
  264. {
  265. int ret = 0;
  266. if (pid >= 0x8000)
  267. return -EINVAL;
  268. pid |= 0x8000;
  269. if ((ret = m920x_write(d->udev, M9206_FILTER, pid, (type << 8) | (idx * 4) )) != 0)
  270. return ret;
  271. if ((ret = m920x_write(d->udev, M9206_FILTER, 0, (type << 8) | (idx * 4) )) != 0)
  272. return ret;
  273. return ret;
  274. }
  275. static int m920x_update_filters(struct dvb_usb_adapter *adap)
  276. {
  277. struct m920x_state *m = adap->dev->priv;
  278. int enabled = m->filtering_enabled[adap->id];
  279. int i, ret = 0, filter = 0;
  280. int ep = adap->props.fe[0].stream.endpoint;
  281. for (i = 0; i < M9206_MAX_FILTERS; i++)
  282. if (m->filters[adap->id][i] == 8192)
  283. enabled = 0;
  284. /* Disable all filters */
  285. if ((ret = m920x_set_filter(adap->dev, ep, 1, enabled)) != 0)
  286. return ret;
  287. for (i = 0; i < M9206_MAX_FILTERS; i++)
  288. if ((ret = m920x_set_filter(adap->dev, ep, i + 2, 0)) != 0)
  289. return ret;
  290. /* Set */
  291. if (enabled) {
  292. for (i = 0; i < M9206_MAX_FILTERS; i++) {
  293. if (m->filters[adap->id][i] == 0)
  294. continue;
  295. if ((ret = m920x_set_filter(adap->dev, ep, filter + 2, m->filters[adap->id][i])) != 0)
  296. return ret;
  297. filter++;
  298. }
  299. }
  300. return ret;
  301. }
  302. static int m920x_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff)
  303. {
  304. struct m920x_state *m = adap->dev->priv;
  305. m->filtering_enabled[adap->id] = onoff ? 1 : 0;
  306. return m920x_update_filters(adap);
  307. }
  308. static int m920x_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, int onoff)
  309. {
  310. struct m920x_state *m = adap->dev->priv;
  311. m->filters[adap->id][index] = onoff ? pid : 0;
  312. return m920x_update_filters(adap);
  313. }
  314. static int m920x_firmware_download(struct usb_device *udev, const struct firmware *fw)
  315. {
  316. u16 value, index, size;
  317. u8 *read, *buff;
  318. int i, pass, ret = 0;
  319. buff = kmalloc(65536, GFP_KERNEL);
  320. if (buff == NULL)
  321. return -ENOMEM;
  322. read = kmalloc(4, GFP_KERNEL);
  323. if (!read) {
  324. kfree(buff);
  325. return -ENOMEM;
  326. }
  327. if ((ret = m920x_read(udev, M9206_FILTER, 0x0, 0x8000, read, 4)) != 0)
  328. goto done;
  329. deb("%*ph\n", 4, read);
  330. if ((ret = m920x_read(udev, M9206_FW, 0x0, 0x0, read, 1)) != 0)
  331. goto done;
  332. deb("%x\n", read[0]);
  333. for (pass = 0; pass < 2; pass++) {
  334. for (i = 0; i + (sizeof(u16) * 3) < fw->size;) {
  335. value = get_unaligned_le16(fw->data + i);
  336. i += sizeof(u16);
  337. index = get_unaligned_le16(fw->data + i);
  338. i += sizeof(u16);
  339. size = get_unaligned_le16(fw->data + i);
  340. i += sizeof(u16);
  341. if (pass == 1) {
  342. /* Will stall if using fw->data ... */
  343. memcpy(buff, fw->data + i, size);
  344. ret = usb_control_msg(udev, usb_sndctrlpipe(udev,0),
  345. M9206_FW,
  346. USB_TYPE_VENDOR | USB_DIR_OUT,
  347. value, index, buff, size, 20);
  348. if (ret != size) {
  349. deb("error while uploading fw!\n");
  350. ret = -EIO;
  351. goto done;
  352. }
  353. msleep(3);
  354. }
  355. i += size;
  356. }
  357. if (i != fw->size) {
  358. deb("bad firmware file!\n");
  359. ret = -EINVAL;
  360. goto done;
  361. }
  362. }
  363. msleep(36);
  364. /* m920x will disconnect itself from the bus after this. */
  365. (void) m920x_write(udev, M9206_CORE, 0x01, M9206_FW_GO);
  366. deb("firmware uploaded!\n");
  367. done:
  368. kfree(read);
  369. kfree(buff);
  370. return ret;
  371. }
  372. /* Callbacks for DVB USB */
  373. static int m920x_identify_state(struct usb_device *udev,
  374. struct dvb_usb_device_properties *props,
  375. struct dvb_usb_device_description **desc,
  376. int *cold)
  377. {
  378. struct usb_host_interface *alt;
  379. alt = usb_altnum_to_altsetting(usb_ifnum_to_if(udev, 0), 1);
  380. *cold = (alt == NULL) ? 1 : 0;
  381. return 0;
  382. }
  383. /* demod configurations */
  384. static int m920x_mt352_demod_init(struct dvb_frontend *fe)
  385. {
  386. int ret;
  387. u8 config[] = { CONFIG, 0x3d };
  388. u8 clock[] = { CLOCK_CTL, 0x30 };
  389. u8 reset[] = { RESET, 0x80 };
  390. u8 adc_ctl[] = { ADC_CTL_1, 0x40 };
  391. u8 agc[] = { AGC_TARGET, 0x1c, 0x20 };
  392. u8 sec_agc[] = { 0x69, 0x00, 0xff, 0xff, 0x40, 0xff, 0x00, 0x40, 0x40 };
  393. u8 unk1[] = { 0x93, 0x1a };
  394. u8 unk2[] = { 0xb5, 0x7a };
  395. deb("Demod init!\n");
  396. if ((ret = mt352_write(fe, config, ARRAY_SIZE(config))) != 0)
  397. return ret;
  398. if ((ret = mt352_write(fe, clock, ARRAY_SIZE(clock))) != 0)
  399. return ret;
  400. if ((ret = mt352_write(fe, reset, ARRAY_SIZE(reset))) != 0)
  401. return ret;
  402. if ((ret = mt352_write(fe, adc_ctl, ARRAY_SIZE(adc_ctl))) != 0)
  403. return ret;
  404. if ((ret = mt352_write(fe, agc, ARRAY_SIZE(agc))) != 0)
  405. return ret;
  406. if ((ret = mt352_write(fe, sec_agc, ARRAY_SIZE(sec_agc))) != 0)
  407. return ret;
  408. if ((ret = mt352_write(fe, unk1, ARRAY_SIZE(unk1))) != 0)
  409. return ret;
  410. if ((ret = mt352_write(fe, unk2, ARRAY_SIZE(unk2))) != 0)
  411. return ret;
  412. return 0;
  413. }
  414. static struct mt352_config m920x_mt352_config = {
  415. .demod_address = 0x0f,
  416. .no_tuner = 1,
  417. .demod_init = m920x_mt352_demod_init,
  418. };
  419. static struct tda1004x_config m920x_tda10046_08_config = {
  420. .demod_address = 0x08,
  421. .invert = 0,
  422. .invert_oclk = 0,
  423. .ts_mode = TDA10046_TS_SERIAL,
  424. .xtal_freq = TDA10046_XTAL_16M,
  425. .if_freq = TDA10046_FREQ_045,
  426. .agc_config = TDA10046_AGC_TDA827X,
  427. .gpio_config = TDA10046_GPTRI,
  428. .request_firmware = NULL,
  429. };
  430. static struct tda1004x_config m920x_tda10046_0b_config = {
  431. .demod_address = 0x0b,
  432. .invert = 0,
  433. .invert_oclk = 0,
  434. .ts_mode = TDA10046_TS_SERIAL,
  435. .xtal_freq = TDA10046_XTAL_16M,
  436. .if_freq = TDA10046_FREQ_045,
  437. .agc_config = TDA10046_AGC_TDA827X,
  438. .gpio_config = TDA10046_GPTRI,
  439. .request_firmware = NULL, /* uses firmware EEPROM */
  440. };
  441. /* tuner configurations */
  442. static struct qt1010_config m920x_qt1010_config = {
  443. .i2c_address = 0x62
  444. };
  445. static struct mt2060_config m920x_mt2060_config = {
  446. .i2c_address = 0x60, /* 0xc0 */
  447. .clock_out = 0,
  448. };
  449. /* Callbacks for DVB USB */
  450. static int m920x_mt352_frontend_attach(struct dvb_usb_adapter *adap)
  451. {
  452. deb("%s\n",__func__);
  453. adap->fe_adap[0].fe = dvb_attach(mt352_attach,
  454. &m920x_mt352_config,
  455. &adap->dev->i2c_adap);
  456. if ((adap->fe_adap[0].fe) == NULL)
  457. return -EIO;
  458. return 0;
  459. }
  460. static int m920x_mt352_frontend_attach_vp7049(struct dvb_usb_adapter *adap)
  461. {
  462. struct m920x_inits vp7049_fe_init_seq[] = {
  463. /* XXX without these commands the frontend cannot be detected,
  464. * they must be sent BEFORE the frontend is attached */
  465. { 0xff28, 0x00 },
  466. { 0xff23, 0x00 },
  467. { 0xff28, 0x00 },
  468. { 0xff23, 0x00 },
  469. { 0xff21, 0x20 },
  470. { 0xff21, 0x60 },
  471. { 0xff28, 0x00 },
  472. { 0xff22, 0x00 },
  473. { 0xff20, 0x30 },
  474. { 0xff20, 0x20 },
  475. { 0xff20, 0x30 },
  476. { } /* terminating entry */
  477. };
  478. int ret;
  479. deb("%s\n", __func__);
  480. ret = m920x_write_seq(adap->dev->udev, M9206_CORE, vp7049_fe_init_seq);
  481. if (ret != 0) {
  482. deb("Initialization of vp7049 frontend failed.");
  483. return ret;
  484. }
  485. return m920x_mt352_frontend_attach(adap);
  486. }
  487. static int m920x_tda10046_08_frontend_attach(struct dvb_usb_adapter *adap)
  488. {
  489. deb("%s\n",__func__);
  490. adap->fe_adap[0].fe = dvb_attach(tda10046_attach,
  491. &m920x_tda10046_08_config,
  492. &adap->dev->i2c_adap);
  493. if ((adap->fe_adap[0].fe) == NULL)
  494. return -EIO;
  495. return 0;
  496. }
  497. static int m920x_tda10046_0b_frontend_attach(struct dvb_usb_adapter *adap)
  498. {
  499. deb("%s\n",__func__);
  500. adap->fe_adap[0].fe = dvb_attach(tda10046_attach,
  501. &m920x_tda10046_0b_config,
  502. &adap->dev->i2c_adap);
  503. if ((adap->fe_adap[0].fe) == NULL)
  504. return -EIO;
  505. return 0;
  506. }
  507. static int m920x_qt1010_tuner_attach(struct dvb_usb_adapter *adap)
  508. {
  509. deb("%s\n",__func__);
  510. if (dvb_attach(qt1010_attach, adap->fe_adap[0].fe, &adap->dev->i2c_adap, &m920x_qt1010_config) == NULL)
  511. return -ENODEV;
  512. return 0;
  513. }
  514. static int m920x_tda8275_60_tuner_attach(struct dvb_usb_adapter *adap)
  515. {
  516. deb("%s\n",__func__);
  517. if (dvb_attach(tda827x_attach, adap->fe_adap[0].fe, 0x60, &adap->dev->i2c_adap, NULL) == NULL)
  518. return -ENODEV;
  519. return 0;
  520. }
  521. static int m920x_tda8275_61_tuner_attach(struct dvb_usb_adapter *adap)
  522. {
  523. deb("%s\n",__func__);
  524. if (dvb_attach(tda827x_attach, adap->fe_adap[0].fe, 0x61, &adap->dev->i2c_adap, NULL) == NULL)
  525. return -ENODEV;
  526. return 0;
  527. }
  528. static int m920x_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap)
  529. {
  530. dvb_attach(simple_tuner_attach, adap->fe_adap[0].fe,
  531. &adap->dev->i2c_adap, 0x61,
  532. TUNER_PHILIPS_FMD1216ME_MK3);
  533. return 0;
  534. }
  535. static int m920x_mt2060_tuner_attach(struct dvb_usb_adapter *adap)
  536. {
  537. deb("%s\n", __func__);
  538. if (dvb_attach(mt2060_attach, adap->fe_adap[0].fe, &adap->dev->i2c_adap,
  539. &m920x_mt2060_config, 1220) == NULL)
  540. return -ENODEV;
  541. return 0;
  542. }
  543. /* device-specific initialization */
  544. static struct m920x_inits megasky_rc_init [] = {
  545. { M9206_RC_INIT2, 0xa8 },
  546. { M9206_RC_INIT1, 0x51 },
  547. { } /* terminating entry */
  548. };
  549. static struct m920x_inits tvwalkertwin_rc_init [] = {
  550. { M9206_RC_INIT2, 0x00 },
  551. { M9206_RC_INIT1, 0xef },
  552. { 0xff28, 0x00 },
  553. { 0xff23, 0x00 },
  554. { 0xff21, 0x30 },
  555. { } /* terminating entry */
  556. };
  557. static struct m920x_inits pinnacle310e_init[] = {
  558. /* without these the tuner doesn't work */
  559. { 0xff20, 0x9b },
  560. { 0xff22, 0x70 },
  561. /* rc settings */
  562. { 0xff50, 0x80 },
  563. { M9206_RC_INIT1, 0x00 },
  564. { M9206_RC_INIT2, 0xff },
  565. { } /* terminating entry */
  566. };
  567. static struct m920x_inits vp7049_rc_init[] = {
  568. { 0xff28, 0x00 },
  569. { 0xff23, 0x00 },
  570. { 0xff21, 0x70 },
  571. { M9206_RC_INIT2, 0x00 },
  572. { M9206_RC_INIT1, 0xff },
  573. { } /* terminating entry */
  574. };
  575. /* ir keymaps */
  576. static struct rc_map_table rc_map_megasky_table[] = {
  577. { 0x0012, KEY_POWER },
  578. { 0x001e, KEY_CYCLEWINDOWS }, /* min/max */
  579. { 0x0002, KEY_CHANNELUP },
  580. { 0x0005, KEY_CHANNELDOWN },
  581. { 0x0003, KEY_VOLUMEUP },
  582. { 0x0006, KEY_VOLUMEDOWN },
  583. { 0x0004, KEY_MUTE },
  584. { 0x0007, KEY_OK }, /* TS */
  585. { 0x0008, KEY_STOP },
  586. { 0x0009, KEY_MENU }, /* swap */
  587. { 0x000a, KEY_REWIND },
  588. { 0x001b, KEY_PAUSE },
  589. { 0x001f, KEY_FASTFORWARD },
  590. { 0x000c, KEY_RECORD },
  591. { 0x000d, KEY_CAMERA }, /* screenshot */
  592. { 0x000e, KEY_COFFEE }, /* "MTS" */
  593. };
  594. static struct rc_map_table rc_map_tvwalkertwin_table[] = {
  595. { 0x0001, KEY_ZOOM }, /* Full Screen */
  596. { 0x0002, KEY_CAMERA }, /* snapshot */
  597. { 0x0003, KEY_MUTE },
  598. { 0x0004, KEY_REWIND },
  599. { 0x0005, KEY_PLAYPAUSE }, /* Play/Pause */
  600. { 0x0006, KEY_FASTFORWARD },
  601. { 0x0007, KEY_RECORD },
  602. { 0x0008, KEY_STOP },
  603. { 0x0009, KEY_TIME }, /* Timeshift */
  604. { 0x000c, KEY_COFFEE }, /* Recall */
  605. { 0x000e, KEY_CHANNELUP },
  606. { 0x0012, KEY_POWER },
  607. { 0x0015, KEY_MENU }, /* source */
  608. { 0x0018, KEY_CYCLEWINDOWS }, /* TWIN PIP */
  609. { 0x001a, KEY_CHANNELDOWN },
  610. { 0x001b, KEY_VOLUMEDOWN },
  611. { 0x001e, KEY_VOLUMEUP },
  612. };
  613. static struct rc_map_table rc_map_pinnacle310e_table[] = {
  614. { 0x16, KEY_POWER },
  615. { 0x17, KEY_FAVORITES },
  616. { 0x0f, KEY_TEXT },
  617. { 0x48, KEY_PROGRAM }, /* preview */
  618. { 0x1c, KEY_EPG },
  619. { 0x04, KEY_LIST }, /* record list */
  620. { 0x03, KEY_1 },
  621. { 0x01, KEY_2 },
  622. { 0x06, KEY_3 },
  623. { 0x09, KEY_4 },
  624. { 0x1d, KEY_5 },
  625. { 0x1f, KEY_6 },
  626. { 0x0d, KEY_7 },
  627. { 0x19, KEY_8 },
  628. { 0x1b, KEY_9 },
  629. { 0x15, KEY_0 },
  630. { 0x0c, KEY_CANCEL },
  631. { 0x4a, KEY_CLEAR },
  632. { 0x13, KEY_BACK },
  633. { 0x00, KEY_TAB },
  634. { 0x4b, KEY_UP },
  635. { 0x4e, KEY_LEFT },
  636. { 0x52, KEY_RIGHT },
  637. { 0x51, KEY_DOWN },
  638. { 0x4f, KEY_ENTER }, /* could also be KEY_OK */
  639. { 0x1e, KEY_VOLUMEUP },
  640. { 0x0a, KEY_VOLUMEDOWN },
  641. { 0x05, KEY_CHANNELUP },
  642. { 0x02, KEY_CHANNELDOWN },
  643. { 0x11, KEY_RECORD },
  644. { 0x14, KEY_PLAY },
  645. { 0x4c, KEY_PAUSE },
  646. { 0x1a, KEY_STOP },
  647. { 0x40, KEY_REWIND },
  648. { 0x12, KEY_FASTFORWARD },
  649. { 0x41, KEY_PREVIOUSSONG }, /* Replay */
  650. { 0x42, KEY_NEXTSONG }, /* Skip */
  651. { 0x54, KEY_CAMERA }, /* Capture */
  652. /* { 0x50, KEY_SAP }, */ /* Sap */
  653. { 0x47, KEY_CYCLEWINDOWS }, /* Pip */
  654. { 0x4d, KEY_SCREEN }, /* FullScreen */
  655. { 0x08, KEY_SUBTITLE },
  656. { 0x0e, KEY_MUTE },
  657. /* { 0x49, KEY_LR }, */ /* L/R */
  658. { 0x07, KEY_SLEEP }, /* Hibernate */
  659. { 0x08, KEY_VIDEO }, /* A/V */
  660. { 0x0e, KEY_MENU }, /* Recall */
  661. { 0x45, KEY_ZOOMIN },
  662. { 0x46, KEY_ZOOMOUT },
  663. { 0x18, KEY_RED }, /* Red */
  664. { 0x53, KEY_GREEN }, /* Green */
  665. { 0x5e, KEY_YELLOW }, /* Yellow */
  666. { 0x5f, KEY_BLUE }, /* Blue */
  667. };
  668. /* DVB USB Driver stuff */
  669. static struct dvb_usb_device_properties megasky_properties;
  670. static struct dvb_usb_device_properties digivox_mini_ii_properties;
  671. static struct dvb_usb_device_properties tvwalkertwin_properties;
  672. static struct dvb_usb_device_properties dposh_properties;
  673. static struct dvb_usb_device_properties pinnacle_pctv310e_properties;
  674. static struct dvb_usb_device_properties vp7049_properties;
  675. static int m920x_probe(struct usb_interface *intf,
  676. const struct usb_device_id *id)
  677. {
  678. struct dvb_usb_device *d = NULL;
  679. int ret;
  680. struct m920x_inits *rc_init_seq = NULL;
  681. int bInterfaceNumber = intf->cur_altsetting->desc.bInterfaceNumber;
  682. deb("Probing for m920x device at interface %d\n", bInterfaceNumber);
  683. if (bInterfaceNumber == 0) {
  684. /* Single-tuner device, or first interface on
  685. * multi-tuner device
  686. */
  687. ret = dvb_usb_device_init(intf, &megasky_properties,
  688. THIS_MODULE, &d, adapter_nr);
  689. if (ret == 0) {
  690. rc_init_seq = megasky_rc_init;
  691. goto found;
  692. }
  693. ret = dvb_usb_device_init(intf, &digivox_mini_ii_properties,
  694. THIS_MODULE, &d, adapter_nr);
  695. if (ret == 0) {
  696. /* No remote control, so no rc_init_seq */
  697. goto found;
  698. }
  699. /* This configures both tuners on the TV Walker Twin */
  700. ret = dvb_usb_device_init(intf, &tvwalkertwin_properties,
  701. THIS_MODULE, &d, adapter_nr);
  702. if (ret == 0) {
  703. rc_init_seq = tvwalkertwin_rc_init;
  704. goto found;
  705. }
  706. ret = dvb_usb_device_init(intf, &dposh_properties,
  707. THIS_MODULE, &d, adapter_nr);
  708. if (ret == 0) {
  709. /* Remote controller not supported yet. */
  710. goto found;
  711. }
  712. ret = dvb_usb_device_init(intf, &pinnacle_pctv310e_properties,
  713. THIS_MODULE, &d, adapter_nr);
  714. if (ret == 0) {
  715. rc_init_seq = pinnacle310e_init;
  716. goto found;
  717. }
  718. ret = dvb_usb_device_init(intf, &vp7049_properties,
  719. THIS_MODULE, &d, adapter_nr);
  720. if (ret == 0) {
  721. rc_init_seq = vp7049_rc_init;
  722. goto found;
  723. }
  724. return ret;
  725. } else {
  726. /* Another interface on a multi-tuner device */
  727. /* The LifeView TV Walker Twin gets here, but struct
  728. * tvwalkertwin_properties already configured both
  729. * tuners, so there is nothing for us to do here
  730. */
  731. }
  732. found:
  733. if ((ret = m920x_init_ep(intf)) < 0)
  734. return ret;
  735. if (d && (ret = m920x_init(d, rc_init_seq)) != 0)
  736. return ret;
  737. return ret;
  738. }
  739. static struct usb_device_id m920x_table [] = {
  740. { USB_DEVICE(USB_VID_MSI, USB_PID_MSI_MEGASKY580) },
  741. { USB_DEVICE(USB_VID_ANUBIS_ELECTRONIC,
  742. USB_PID_MSI_DIGI_VOX_MINI_II) },
  743. { USB_DEVICE(USB_VID_ANUBIS_ELECTRONIC,
  744. USB_PID_LIFEVIEW_TV_WALKER_TWIN_COLD) },
  745. { USB_DEVICE(USB_VID_ANUBIS_ELECTRONIC,
  746. USB_PID_LIFEVIEW_TV_WALKER_TWIN_WARM) },
  747. { USB_DEVICE(USB_VID_DPOSH, USB_PID_DPOSH_M9206_COLD) },
  748. { USB_DEVICE(USB_VID_DPOSH, USB_PID_DPOSH_M9206_WARM) },
  749. { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_PINNACLE_PCTV310E) },
  750. { USB_DEVICE(USB_VID_AZUREWAVE, USB_PID_TWINHAN_VP7049) },
  751. { } /* Terminating entry */
  752. };
  753. MODULE_DEVICE_TABLE (usb, m920x_table);
  754. static struct dvb_usb_device_properties megasky_properties = {
  755. .caps = DVB_USB_IS_AN_I2C_ADAPTER,
  756. .usb_ctrl = DEVICE_SPECIFIC,
  757. .firmware = "dvb-usb-megasky-02.fw",
  758. .download_firmware = m920x_firmware_download,
  759. .rc.legacy = {
  760. .rc_interval = 100,
  761. .rc_map_table = rc_map_megasky_table,
  762. .rc_map_size = ARRAY_SIZE(rc_map_megasky_table),
  763. .rc_query = m920x_rc_query,
  764. },
  765. .size_of_priv = sizeof(struct m920x_state),
  766. .identify_state = m920x_identify_state,
  767. .num_adapters = 1,
  768. .adapter = {{
  769. .num_frontends = 1,
  770. .fe = {{
  771. .caps = DVB_USB_ADAP_HAS_PID_FILTER |
  772. DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
  773. .pid_filter_count = 8,
  774. .pid_filter = m920x_pid_filter,
  775. .pid_filter_ctrl = m920x_pid_filter_ctrl,
  776. .frontend_attach = m920x_mt352_frontend_attach,
  777. .tuner_attach = m920x_qt1010_tuner_attach,
  778. .stream = {
  779. .type = USB_BULK,
  780. .count = 8,
  781. .endpoint = 0x81,
  782. .u = {
  783. .bulk = {
  784. .buffersize = 512,
  785. }
  786. }
  787. },
  788. }},
  789. }},
  790. .i2c_algo = &m920x_i2c_algo,
  791. .num_device_descs = 1,
  792. .devices = {
  793. { "MSI Mega Sky 580 DVB-T USB2.0",
  794. { &m920x_table[0], NULL },
  795. { NULL },
  796. }
  797. }
  798. };
  799. static struct dvb_usb_device_properties digivox_mini_ii_properties = {
  800. .caps = DVB_USB_IS_AN_I2C_ADAPTER,
  801. .usb_ctrl = DEVICE_SPECIFIC,
  802. .firmware = "dvb-usb-digivox-02.fw",
  803. .download_firmware = m920x_firmware_download,
  804. .size_of_priv = sizeof(struct m920x_state),
  805. .identify_state = m920x_identify_state,
  806. .num_adapters = 1,
  807. .adapter = {{
  808. .num_frontends = 1,
  809. .fe = {{
  810. .caps = DVB_USB_ADAP_HAS_PID_FILTER |
  811. DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
  812. .pid_filter_count = 8,
  813. .pid_filter = m920x_pid_filter,
  814. .pid_filter_ctrl = m920x_pid_filter_ctrl,
  815. .frontend_attach = m920x_tda10046_08_frontend_attach,
  816. .tuner_attach = m920x_tda8275_60_tuner_attach,
  817. .stream = {
  818. .type = USB_BULK,
  819. .count = 8,
  820. .endpoint = 0x81,
  821. .u = {
  822. .bulk = {
  823. .buffersize = 0x4000,
  824. }
  825. }
  826. },
  827. }},
  828. }},
  829. .i2c_algo = &m920x_i2c_algo,
  830. .num_device_descs = 1,
  831. .devices = {
  832. { "MSI DIGI VOX mini II DVB-T USB2.0",
  833. { &m920x_table[1], NULL },
  834. { NULL },
  835. },
  836. }
  837. };
  838. /* LifeView TV Walker Twin support by Nick Andrew <nick@nick-andrew.net>
  839. *
  840. * LifeView TV Walker Twin has 1 x M9206, 2 x TDA10046, 2 x TDA8275A
  841. * TDA10046 #0 is located at i2c address 0x08
  842. * TDA10046 #1 is located at i2c address 0x0b
  843. * TDA8275A #0 is located at i2c address 0x60
  844. * TDA8275A #1 is located at i2c address 0x61
  845. */
  846. static struct dvb_usb_device_properties tvwalkertwin_properties = {
  847. .caps = DVB_USB_IS_AN_I2C_ADAPTER,
  848. .usb_ctrl = DEVICE_SPECIFIC,
  849. .firmware = "dvb-usb-tvwalkert.fw",
  850. .download_firmware = m920x_firmware_download,
  851. .rc.legacy = {
  852. .rc_interval = 100,
  853. .rc_map_table = rc_map_tvwalkertwin_table,
  854. .rc_map_size = ARRAY_SIZE(rc_map_tvwalkertwin_table),
  855. .rc_query = m920x_rc_query,
  856. },
  857. .size_of_priv = sizeof(struct m920x_state),
  858. .identify_state = m920x_identify_state,
  859. .num_adapters = 2,
  860. .adapter = {{
  861. .num_frontends = 1,
  862. .fe = {{
  863. .caps = DVB_USB_ADAP_HAS_PID_FILTER |
  864. DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
  865. .pid_filter_count = 8,
  866. .pid_filter = m920x_pid_filter,
  867. .pid_filter_ctrl = m920x_pid_filter_ctrl,
  868. .frontend_attach = m920x_tda10046_08_frontend_attach,
  869. .tuner_attach = m920x_tda8275_60_tuner_attach,
  870. .stream = {
  871. .type = USB_BULK,
  872. .count = 8,
  873. .endpoint = 0x81,
  874. .u = {
  875. .bulk = {
  876. .buffersize = 512,
  877. }
  878. }
  879. }},
  880. }},{
  881. .num_frontends = 1,
  882. .fe = {{
  883. .caps = DVB_USB_ADAP_HAS_PID_FILTER |
  884. DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
  885. .pid_filter_count = 8,
  886. .pid_filter = m920x_pid_filter,
  887. .pid_filter_ctrl = m920x_pid_filter_ctrl,
  888. .frontend_attach = m920x_tda10046_0b_frontend_attach,
  889. .tuner_attach = m920x_tda8275_61_tuner_attach,
  890. .stream = {
  891. .type = USB_BULK,
  892. .count = 8,
  893. .endpoint = 0x82,
  894. .u = {
  895. .bulk = {
  896. .buffersize = 512,
  897. }
  898. }
  899. }},
  900. },
  901. }},
  902. .i2c_algo = &m920x_i2c_algo,
  903. .num_device_descs = 1,
  904. .devices = {
  905. { .name = "LifeView TV Walker Twin DVB-T USB2.0",
  906. .cold_ids = { &m920x_table[2], NULL },
  907. .warm_ids = { &m920x_table[3], NULL },
  908. },
  909. }
  910. };
  911. static struct dvb_usb_device_properties dposh_properties = {
  912. .caps = DVB_USB_IS_AN_I2C_ADAPTER,
  913. .usb_ctrl = DEVICE_SPECIFIC,
  914. .firmware = "dvb-usb-dposh-01.fw",
  915. .download_firmware = m920x_firmware_download,
  916. .size_of_priv = sizeof(struct m920x_state),
  917. .identify_state = m920x_identify_state,
  918. .num_adapters = 1,
  919. .adapter = {{
  920. .num_frontends = 1,
  921. .fe = {{
  922. /* Hardware pid filters don't work with this device/firmware */
  923. .frontend_attach = m920x_mt352_frontend_attach,
  924. .tuner_attach = m920x_qt1010_tuner_attach,
  925. .stream = {
  926. .type = USB_BULK,
  927. .count = 8,
  928. .endpoint = 0x81,
  929. .u = {
  930. .bulk = {
  931. .buffersize = 512,
  932. }
  933. }
  934. },
  935. }},
  936. }},
  937. .i2c_algo = &m920x_i2c_algo,
  938. .num_device_descs = 1,
  939. .devices = {
  940. { .name = "Dposh DVB-T USB2.0",
  941. .cold_ids = { &m920x_table[4], NULL },
  942. .warm_ids = { &m920x_table[5], NULL },
  943. },
  944. }
  945. };
  946. static struct dvb_usb_device_properties pinnacle_pctv310e_properties = {
  947. .caps = DVB_USB_IS_AN_I2C_ADAPTER,
  948. .usb_ctrl = DEVICE_SPECIFIC,
  949. .download_firmware = NULL,
  950. .rc.legacy = {
  951. .rc_interval = 100,
  952. .rc_map_table = rc_map_pinnacle310e_table,
  953. .rc_map_size = ARRAY_SIZE(rc_map_pinnacle310e_table),
  954. .rc_query = m920x_rc_query,
  955. },
  956. .size_of_priv = sizeof(struct m920x_state),
  957. .identify_state = m920x_identify_state,
  958. .num_adapters = 1,
  959. .adapter = {{
  960. .num_frontends = 1,
  961. .fe = {{
  962. .caps = DVB_USB_ADAP_HAS_PID_FILTER |
  963. DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
  964. .pid_filter_count = 8,
  965. .pid_filter = m920x_pid_filter,
  966. .pid_filter_ctrl = m920x_pid_filter_ctrl,
  967. .frontend_attach = m920x_mt352_frontend_attach,
  968. .tuner_attach = m920x_fmd1216me_tuner_attach,
  969. .stream = {
  970. .type = USB_ISOC,
  971. .count = 5,
  972. .endpoint = 0x84,
  973. .u = {
  974. .isoc = {
  975. .framesperurb = 128,
  976. .framesize = 564,
  977. .interval = 1,
  978. }
  979. }
  980. },
  981. }},
  982. } },
  983. .i2c_algo = &m920x_i2c_algo,
  984. .num_device_descs = 1,
  985. .devices = {
  986. { "Pinnacle PCTV 310e",
  987. { &m920x_table[6], NULL },
  988. { NULL },
  989. }
  990. }
  991. };
  992. static struct dvb_usb_device_properties vp7049_properties = {
  993. .caps = DVB_USB_IS_AN_I2C_ADAPTER,
  994. .usb_ctrl = DEVICE_SPECIFIC,
  995. .firmware = "dvb-usb-vp7049-0.95.fw",
  996. .download_firmware = m920x_firmware_download,
  997. .rc.core = {
  998. .rc_interval = 150,
  999. .rc_codes = RC_MAP_TWINHAN_VP1027_DVBS,
  1000. .rc_query = m920x_rc_core_query,
  1001. .allowed_protos = RC_BIT_UNKNOWN,
  1002. },
  1003. .size_of_priv = sizeof(struct m920x_state),
  1004. .identify_state = m920x_identify_state,
  1005. .num_adapters = 1,
  1006. .adapter = {{
  1007. .num_frontends = 1,
  1008. .fe = {{
  1009. .caps = DVB_USB_ADAP_HAS_PID_FILTER |
  1010. DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
  1011. .pid_filter_count = 8,
  1012. .pid_filter = m920x_pid_filter,
  1013. .pid_filter_ctrl = m920x_pid_filter_ctrl,
  1014. .frontend_attach = m920x_mt352_frontend_attach_vp7049,
  1015. .tuner_attach = m920x_mt2060_tuner_attach,
  1016. .stream = {
  1017. .type = USB_BULK,
  1018. .count = 8,
  1019. .endpoint = 0x81,
  1020. .u = {
  1021. .bulk = {
  1022. .buffersize = 512,
  1023. }
  1024. }
  1025. },
  1026. } },
  1027. } },
  1028. .i2c_algo = &m920x_i2c_algo,
  1029. .num_device_descs = 1,
  1030. .devices = {
  1031. { "DTV-DVB UDTT7049",
  1032. { &m920x_table[7], NULL },
  1033. { NULL },
  1034. }
  1035. }
  1036. };
  1037. static struct usb_driver m920x_driver = {
  1038. .name = "dvb_usb_m920x",
  1039. .probe = m920x_probe,
  1040. .disconnect = dvb_usb_device_exit,
  1041. .id_table = m920x_table,
  1042. };
  1043. module_usb_driver(m920x_driver);
  1044. MODULE_AUTHOR("Aapo Tahkola <aet@rasterburn.org>");
  1045. MODULE_DESCRIPTION("DVB Driver for ULI M920x");
  1046. MODULE_VERSION("0.1");
  1047. MODULE_LICENSE("GPL");