dib0700_devices.c 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117
  1. /* Linux driver for devices based on the DiBcom DiB0700 USB bridge
  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 Free
  5. * Software Foundation, version 2.
  6. *
  7. * Copyright (C) 2005-7 DiBcom, SA
  8. */
  9. #include "dib0700.h"
  10. #include "dib3000mc.h"
  11. #include "dib7000m.h"
  12. #include "dib7000p.h"
  13. #include "mt2060.h"
  14. #include "mt2266.h"
  15. #include "dib0070.h"
  16. static int force_lna_activation;
  17. module_param(force_lna_activation, int, 0644);
  18. MODULE_PARM_DESC(force_lna_activation, "force the activation of Low-Noise-Amplifyer(s) (LNA), "
  19. "if applicable for the device (default: 0=automatic/off).");
  20. struct dib0700_adapter_state {
  21. int (*set_param_save) (struct dvb_frontend *, struct dvb_frontend_parameters *);
  22. };
  23. /* Hauppauge Nova-T 500 (aka Bristol)
  24. * has a LNA on GPIO0 which is enabled by setting 1 */
  25. static struct mt2060_config bristol_mt2060_config[2] = {
  26. {
  27. .i2c_address = 0x60,
  28. .clock_out = 3,
  29. }, {
  30. .i2c_address = 0x61,
  31. }
  32. };
  33. static struct dibx000_agc_config bristol_dib3000p_mt2060_agc_config = {
  34. .band_caps = BAND_VHF | BAND_UHF,
  35. .setup = (1 << 8) | (5 << 5) | (0 << 4) | (0 << 3) | (0 << 2) | (2 << 0),
  36. .agc1_max = 42598,
  37. .agc1_min = 17694,
  38. .agc2_max = 45875,
  39. .agc2_min = 0,
  40. .agc1_pt1 = 0,
  41. .agc1_pt2 = 59,
  42. .agc1_slope1 = 0,
  43. .agc1_slope2 = 69,
  44. .agc2_pt1 = 0,
  45. .agc2_pt2 = 59,
  46. .agc2_slope1 = 111,
  47. .agc2_slope2 = 28,
  48. };
  49. static struct dib3000mc_config bristol_dib3000mc_config[2] = {
  50. { .agc = &bristol_dib3000p_mt2060_agc_config,
  51. .max_time = 0x196,
  52. .ln_adc_level = 0x1cc7,
  53. .output_mpeg2_in_188_bytes = 1,
  54. },
  55. { .agc = &bristol_dib3000p_mt2060_agc_config,
  56. .max_time = 0x196,
  57. .ln_adc_level = 0x1cc7,
  58. .output_mpeg2_in_188_bytes = 1,
  59. }
  60. };
  61. static int bristol_frontend_attach(struct dvb_usb_adapter *adap)
  62. {
  63. struct dib0700_state *st = adap->dev->priv;
  64. if (adap->id == 0) {
  65. dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(10);
  66. dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10);
  67. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10);
  68. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(10);
  69. if (force_lna_activation)
  70. dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
  71. else
  72. dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 0);
  73. if (dib3000mc_i2c_enumeration(&adap->dev->i2c_adap, 2, DEFAULT_DIB3000P_I2C_ADDRESS, bristol_dib3000mc_config) != 0) {
  74. dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(10);
  75. return -ENODEV;
  76. }
  77. }
  78. st->mt2060_if1[adap->id] = 1220;
  79. return (adap->fe = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap,
  80. (10 + adap->id) << 1, &bristol_dib3000mc_config[adap->id])) == NULL ? -ENODEV : 0;
  81. }
  82. static int bristol_tuner_attach(struct dvb_usb_adapter *adap)
  83. {
  84. struct dib0700_state *st = adap->dev->priv;
  85. struct i2c_adapter *tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe, 1);
  86. return dvb_attach(mt2060_attach,adap->fe, tun_i2c, &bristol_mt2060_config[adap->id],
  87. st->mt2060_if1[adap->id]) == NULL ? -ENODEV : 0;
  88. }
  89. /* STK7700D: Pinnacle/Terratec/Hauppauge Dual DVB-T Diversity */
  90. /* MT226x */
  91. static struct dibx000_agc_config stk7700d_7000p_mt2266_agc_config[2] = {
  92. {
  93. BAND_UHF, // band_caps
  94. /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1, P_agc_inv_pwm1=1, P_agc_inv_pwm2=1,
  95. * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */
  96. (0 << 15) | (0 << 14) | (1 << 11) | (1 << 10) | (1 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), // setup
  97. 1130, // inv_gain
  98. 21, // time_stabiliz
  99. 0, // alpha_level
  100. 118, // thlock
  101. 0, // wbd_inv
  102. 3530, // wbd_ref
  103. 1, // wbd_sel
  104. 0, // wbd_alpha
  105. 65535, // agc1_max
  106. 33770, // agc1_min
  107. 65535, // agc2_max
  108. 23592, // agc2_min
  109. 0, // agc1_pt1
  110. 62, // agc1_pt2
  111. 255, // agc1_pt3
  112. 64, // agc1_slope1
  113. 64, // agc1_slope2
  114. 132, // agc2_pt1
  115. 192, // agc2_pt2
  116. 80, // agc2_slope1
  117. 80, // agc2_slope2
  118. 17, // alpha_mant
  119. 27, // alpha_exp
  120. 23, // beta_mant
  121. 51, // beta_exp
  122. 1, // perform_agc_softsplit
  123. }, {
  124. BAND_VHF | BAND_LBAND, // band_caps
  125. /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1, P_agc_inv_pwm1=1, P_agc_inv_pwm2=1,
  126. * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */
  127. (0 << 15) | (0 << 14) | (1 << 11) | (1 << 10) | (1 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup
  128. 2372, // inv_gain
  129. 21, // time_stabiliz
  130. 0, // alpha_level
  131. 118, // thlock
  132. 0, // wbd_inv
  133. 3530, // wbd_ref
  134. 1, // wbd_sel
  135. 0, // wbd_alpha
  136. 65535, // agc1_max
  137. 0, // agc1_min
  138. 65535, // agc2_max
  139. 23592, // agc2_min
  140. 0, // agc1_pt1
  141. 128, // agc1_pt2
  142. 128, // agc1_pt3
  143. 128, // agc1_slope1
  144. 0, // agc1_slope2
  145. 128, // agc2_pt1
  146. 253, // agc2_pt2
  147. 81, // agc2_slope1
  148. 0, // agc2_slope2
  149. 17, // alpha_mant
  150. 27, // alpha_exp
  151. 23, // beta_mant
  152. 51, // beta_exp
  153. 1, // perform_agc_softsplit
  154. }
  155. };
  156. static struct dibx000_bandwidth_config stk7700d_mt2266_pll_config = {
  157. 60000, 30000, // internal, sampling
  158. 1, 8, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass
  159. 0, 0, 1, 1, 2, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo
  160. (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k
  161. 0, // ifreq
  162. 20452225, // timf
  163. };
  164. static struct dib7000p_config stk7700d_dib7000p_mt2266_config[] = {
  165. { .output_mpeg2_in_188_bytes = 1,
  166. .hostbus_diversity = 1,
  167. .tuner_is_baseband = 1,
  168. .agc_config_count = 2,
  169. .agc = stk7700d_7000p_mt2266_agc_config,
  170. .bw = &stk7700d_mt2266_pll_config,
  171. .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
  172. .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
  173. .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
  174. },
  175. { .output_mpeg2_in_188_bytes = 1,
  176. .hostbus_diversity = 1,
  177. .tuner_is_baseband = 1,
  178. .agc_config_count = 2,
  179. .agc = stk7700d_7000p_mt2266_agc_config,
  180. .bw = &stk7700d_mt2266_pll_config,
  181. .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
  182. .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
  183. .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
  184. }
  185. };
  186. static struct mt2266_config stk7700d_mt2266_config[2] = {
  187. { .i2c_address = 0x60
  188. },
  189. { .i2c_address = 0x60
  190. }
  191. };
  192. static int stk7700P2_frontend_attach(struct dvb_usb_adapter *adap)
  193. {
  194. if (adap->id == 0) {
  195. dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
  196. msleep(10);
  197. dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
  198. dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
  199. dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
  200. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
  201. msleep(10);
  202. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
  203. msleep(10);
  204. dib7000p_i2c_enumeration(&adap->dev->i2c_adap,1,18,stk7700d_dib7000p_mt2266_config);
  205. }
  206. adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap,0x80+(adap->id << 1),
  207. &stk7700d_dib7000p_mt2266_config[adap->id]);
  208. return adap->fe == NULL ? -ENODEV : 0;
  209. }
  210. static int stk7700d_frontend_attach(struct dvb_usb_adapter *adap)
  211. {
  212. if (adap->id == 0) {
  213. dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
  214. msleep(10);
  215. dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
  216. dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
  217. dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
  218. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
  219. msleep(10);
  220. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
  221. msleep(10);
  222. dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
  223. dib7000p_i2c_enumeration(&adap->dev->i2c_adap,2,18,stk7700d_dib7000p_mt2266_config);
  224. }
  225. adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap,0x80+(adap->id << 1),
  226. &stk7700d_dib7000p_mt2266_config[adap->id]);
  227. return adap->fe == NULL ? -ENODEV : 0;
  228. }
  229. static int stk7700d_tuner_attach(struct dvb_usb_adapter *adap)
  230. {
  231. struct i2c_adapter *tun_i2c;
  232. tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1);
  233. return dvb_attach(mt2266_attach, adap->fe, tun_i2c,
  234. &stk7700d_mt2266_config[adap->id]) == NULL ? -ENODEV : 0;;
  235. }
  236. #define DEFAULT_RC_INTERVAL 150
  237. static u8 rc_request[] = { REQUEST_POLL_RC, 0 };
  238. static int dib0700_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
  239. {
  240. u8 key[4];
  241. int i;
  242. struct dvb_usb_rc_key *keymap = d->props.rc_key_map;
  243. struct dib0700_state *st = d->priv;
  244. *event = 0;
  245. *state = REMOTE_NO_KEY_PRESSED;
  246. i=dib0700_ctrl_rd(d,rc_request,2,key,4);
  247. if (i<=0) {
  248. err("RC Query Failed");
  249. return -1;
  250. }
  251. if (key[0]==0 && key[1]==0 && key[2]==0 && key[3]==0) return 0;
  252. if (key[3-1]!=st->rc_toggle) {
  253. for (i=0;i<d->props.rc_key_map_size; i++) {
  254. if (keymap[i].custom == key[3-2] && keymap[i].data == key[3-3]) {
  255. *event = keymap[i].event;
  256. *state = REMOTE_KEY_PRESSED;
  257. st->rc_toggle=key[3-1];
  258. return 0;
  259. }
  260. }
  261. err("Unknown remote controller key : %2X %2X",(int)key[3-2],(int)key[3-3]);
  262. }
  263. return 0;
  264. }
  265. static struct dvb_usb_rc_key dib0700_rc_keys[] = {
  266. /* Key codes for the tiny Pinnacle remote*/
  267. { 0x07, 0x00, KEY_MUTE },
  268. { 0x07, 0x01, KEY_MENU }, // Pinnacle logo
  269. { 0x07, 0x39, KEY_POWER },
  270. { 0x07, 0x03, KEY_VOLUMEUP },
  271. { 0x07, 0x09, KEY_VOLUMEDOWN },
  272. { 0x07, 0x06, KEY_CHANNELUP },
  273. { 0x07, 0x0c, KEY_CHANNELDOWN },
  274. { 0x07, 0x0f, KEY_1 },
  275. { 0x07, 0x15, KEY_2 },
  276. { 0x07, 0x10, KEY_3 },
  277. { 0x07, 0x18, KEY_4 },
  278. { 0x07, 0x1b, KEY_5 },
  279. { 0x07, 0x1e, KEY_6 },
  280. { 0x07, 0x11, KEY_7 },
  281. { 0x07, 0x21, KEY_8 },
  282. { 0x07, 0x12, KEY_9 },
  283. { 0x07, 0x27, KEY_0 },
  284. { 0x07, 0x24, KEY_SCREEN }, // 'Square' key
  285. { 0x07, 0x2a, KEY_TEXT }, // 'T' key
  286. { 0x07, 0x2d, KEY_REWIND },
  287. { 0x07, 0x30, KEY_PLAY },
  288. { 0x07, 0x33, KEY_FASTFORWARD },
  289. { 0x07, 0x36, KEY_RECORD },
  290. { 0x07, 0x3c, KEY_STOP },
  291. { 0x07, 0x3f, KEY_CANCEL }, // '?' key
  292. /* Key codes for the Terratec Cinergy DT XS Diversity, similar to cinergyT2.c */
  293. { 0xeb, 0x01, KEY_POWER },
  294. { 0xeb, 0x02, KEY_1 },
  295. { 0xeb, 0x03, KEY_2 },
  296. { 0xeb, 0x04, KEY_3 },
  297. { 0xeb, 0x05, KEY_4 },
  298. { 0xeb, 0x06, KEY_5 },
  299. { 0xeb, 0x07, KEY_6 },
  300. { 0xeb, 0x08, KEY_7 },
  301. { 0xeb, 0x09, KEY_8 },
  302. { 0xeb, 0x0a, KEY_9 },
  303. { 0xeb, 0x0b, KEY_VIDEO },
  304. { 0xeb, 0x0c, KEY_0 },
  305. { 0xeb, 0x0d, KEY_REFRESH },
  306. { 0xeb, 0x0f, KEY_EPG },
  307. { 0xeb, 0x10, KEY_UP },
  308. { 0xeb, 0x11, KEY_LEFT },
  309. { 0xeb, 0x12, KEY_OK },
  310. { 0xeb, 0x13, KEY_RIGHT },
  311. { 0xeb, 0x14, KEY_DOWN },
  312. { 0xeb, 0x16, KEY_INFO },
  313. { 0xeb, 0x17, KEY_RED },
  314. { 0xeb, 0x18, KEY_GREEN },
  315. { 0xeb, 0x19, KEY_YELLOW },
  316. { 0xeb, 0x1a, KEY_BLUE },
  317. { 0xeb, 0x1b, KEY_CHANNELUP },
  318. { 0xeb, 0x1c, KEY_VOLUMEUP },
  319. { 0xeb, 0x1d, KEY_MUTE },
  320. { 0xeb, 0x1e, KEY_VOLUMEDOWN },
  321. { 0xeb, 0x1f, KEY_CHANNELDOWN },
  322. { 0xeb, 0x40, KEY_PAUSE },
  323. { 0xeb, 0x41, KEY_HOME },
  324. { 0xeb, 0x42, KEY_MENU }, /* DVD Menu */
  325. { 0xeb, 0x43, KEY_SUBTITLE },
  326. { 0xeb, 0x44, KEY_TEXT }, /* Teletext */
  327. { 0xeb, 0x45, KEY_DELETE },
  328. { 0xeb, 0x46, KEY_TV },
  329. { 0xeb, 0x47, KEY_DVD },
  330. { 0xeb, 0x48, KEY_STOP },
  331. { 0xeb, 0x49, KEY_VIDEO },
  332. { 0xeb, 0x4a, KEY_AUDIO }, /* Music */
  333. { 0xeb, 0x4b, KEY_SCREEN }, /* Pic */
  334. { 0xeb, 0x4c, KEY_PLAY },
  335. { 0xeb, 0x4d, KEY_BACK },
  336. { 0xeb, 0x4e, KEY_REWIND },
  337. { 0xeb, 0x4f, KEY_FASTFORWARD },
  338. { 0xeb, 0x54, KEY_PREVIOUS },
  339. { 0xeb, 0x58, KEY_RECORD },
  340. { 0xeb, 0x5c, KEY_NEXT },
  341. /* Key codes for the Haupauge WinTV Nova-TD, copied from nova-t-usb2.c (Nova-T USB2) */
  342. { 0x1e, 0x00, KEY_0 },
  343. { 0x1e, 0x01, KEY_1 },
  344. { 0x1e, 0x02, KEY_2 },
  345. { 0x1e, 0x03, KEY_3 },
  346. { 0x1e, 0x04, KEY_4 },
  347. { 0x1e, 0x05, KEY_5 },
  348. { 0x1e, 0x06, KEY_6 },
  349. { 0x1e, 0x07, KEY_7 },
  350. { 0x1e, 0x08, KEY_8 },
  351. { 0x1e, 0x09, KEY_9 },
  352. { 0x1e, 0x0a, KEY_KPASTERISK },
  353. { 0x1e, 0x0b, KEY_RED },
  354. { 0x1e, 0x0c, KEY_RADIO },
  355. { 0x1e, 0x0d, KEY_MENU },
  356. { 0x1e, 0x0e, KEY_GRAVE }, /* # */
  357. { 0x1e, 0x0f, KEY_MUTE },
  358. { 0x1e, 0x10, KEY_VOLUMEUP },
  359. { 0x1e, 0x11, KEY_VOLUMEDOWN },
  360. { 0x1e, 0x12, KEY_CHANNEL },
  361. { 0x1e, 0x14, KEY_UP },
  362. { 0x1e, 0x15, KEY_DOWN },
  363. { 0x1e, 0x16, KEY_LEFT },
  364. { 0x1e, 0x17, KEY_RIGHT },
  365. { 0x1e, 0x18, KEY_VIDEO },
  366. { 0x1e, 0x19, KEY_AUDIO },
  367. { 0x1e, 0x1a, KEY_MEDIA },
  368. { 0x1e, 0x1b, KEY_EPG },
  369. { 0x1e, 0x1c, KEY_TV },
  370. { 0x1e, 0x1e, KEY_NEXT },
  371. { 0x1e, 0x1f, KEY_BACK },
  372. { 0x1e, 0x20, KEY_CHANNELUP },
  373. { 0x1e, 0x21, KEY_CHANNELDOWN },
  374. { 0x1e, 0x24, KEY_LAST }, /* Skip backwards */
  375. { 0x1e, 0x25, KEY_OK },
  376. { 0x1e, 0x29, KEY_BLUE},
  377. { 0x1e, 0x2e, KEY_GREEN },
  378. { 0x1e, 0x30, KEY_PAUSE },
  379. { 0x1e, 0x32, KEY_REWIND },
  380. { 0x1e, 0x34, KEY_FASTFORWARD },
  381. { 0x1e, 0x35, KEY_PLAY },
  382. { 0x1e, 0x36, KEY_STOP },
  383. { 0x1e, 0x37, KEY_RECORD },
  384. { 0x1e, 0x38, KEY_YELLOW },
  385. { 0x1e, 0x3b, KEY_GOTO },
  386. { 0x1e, 0x3d, KEY_POWER },
  387. /* Key codes for the Leadtek Winfast DTV Dongle */
  388. { 0x00, 0x42, KEY_POWER },
  389. { 0x07, 0x7c, KEY_TUNER },
  390. { 0x0f, 0x4e, KEY_PRINT }, /* PREVIEW */
  391. { 0x08, 0x40, KEY_SCREEN }, /* full screen toggle*/
  392. { 0x0f, 0x71, KEY_DOT }, /* frequency */
  393. { 0x07, 0x43, KEY_0 },
  394. { 0x0c, 0x41, KEY_1 },
  395. { 0x04, 0x43, KEY_2 },
  396. { 0x0b, 0x7f, KEY_3 },
  397. { 0x0e, 0x41, KEY_4 },
  398. { 0x06, 0x43, KEY_5 },
  399. { 0x09, 0x7f, KEY_6 },
  400. { 0x0d, 0x7e, KEY_7 },
  401. { 0x05, 0x7c, KEY_8 },
  402. { 0x0a, 0x40, KEY_9 },
  403. { 0x0e, 0x4e, KEY_CLEAR },
  404. { 0x04, 0x7c, KEY_CHANNEL }, /* show channel number */
  405. { 0x0f, 0x41, KEY_LAST }, /* recall */
  406. { 0x03, 0x42, KEY_MUTE },
  407. { 0x06, 0x4c, KEY_RESERVED }, /* PIP button*/
  408. { 0x01, 0x72, KEY_SHUFFLE }, /* SNAPSHOT */
  409. { 0x0c, 0x4e, KEY_PLAYPAUSE }, /* TIMESHIFT */
  410. { 0x0b, 0x70, KEY_RECORD },
  411. { 0x03, 0x7d, KEY_VOLUMEUP },
  412. { 0x01, 0x7d, KEY_VOLUMEDOWN },
  413. { 0x02, 0x42, KEY_CHANNELUP },
  414. { 0x00, 0x7d, KEY_CHANNELDOWN },
  415. };
  416. /* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */
  417. static struct dibx000_agc_config stk7700p_7000m_mt2060_agc_config = {
  418. BAND_UHF | BAND_VHF, // band_caps
  419. /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=5, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0,
  420. * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */
  421. (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup
  422. 712, // inv_gain
  423. 41, // time_stabiliz
  424. 0, // alpha_level
  425. 118, // thlock
  426. 0, // wbd_inv
  427. 4095, // wbd_ref
  428. 0, // wbd_sel
  429. 0, // wbd_alpha
  430. 42598, // agc1_max
  431. 17694, // agc1_min
  432. 45875, // agc2_max
  433. 2621, // agc2_min
  434. 0, // agc1_pt1
  435. 76, // agc1_pt2
  436. 139, // agc1_pt3
  437. 52, // agc1_slope1
  438. 59, // agc1_slope2
  439. 107, // agc2_pt1
  440. 172, // agc2_pt2
  441. 57, // agc2_slope1
  442. 70, // agc2_slope2
  443. 21, // alpha_mant
  444. 25, // alpha_exp
  445. 28, // beta_mant
  446. 48, // beta_exp
  447. 1, // perform_agc_softsplit
  448. { 0, // split_min
  449. 107, // split_max
  450. 51800, // global_split_min
  451. 24700 // global_split_max
  452. },
  453. };
  454. static struct dibx000_agc_config stk7700p_7000p_mt2060_agc_config = {
  455. BAND_UHF | BAND_VHF,
  456. /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=5, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0,
  457. * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=2, P_agc_write=0 */
  458. (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup
  459. 712, // inv_gain
  460. 41, // time_stabiliz
  461. 0, // alpha_level
  462. 118, // thlock
  463. 0, // wbd_inv
  464. 4095, // wbd_ref
  465. 0, // wbd_sel
  466. 0, // wbd_alpha
  467. 42598, // agc1_max
  468. 16384, // agc1_min
  469. 42598, // agc2_max
  470. 0, // agc2_min
  471. 0, // agc1_pt1
  472. 137, // agc1_pt2
  473. 255, // agc1_pt3
  474. 0, // agc1_slope1
  475. 255, // agc1_slope2
  476. 0, // agc2_pt1
  477. 0, // agc2_pt2
  478. 0, // agc2_slope1
  479. 41, // agc2_slope2
  480. 15, // alpha_mant
  481. 25, // alpha_exp
  482. 28, // beta_mant
  483. 48, // beta_exp
  484. 0, // perform_agc_softsplit
  485. };
  486. static struct dibx000_bandwidth_config stk7700p_pll_config = {
  487. 60000, 30000, // internal, sampling
  488. 1, 8, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass
  489. 0, 0, 1, 1, 0, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo
  490. (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k
  491. 60258167, // ifreq
  492. 20452225, // timf
  493. 30000000, // xtal
  494. };
  495. static struct dib7000m_config stk7700p_dib7000m_config = {
  496. .dvbt_mode = 1,
  497. .output_mpeg2_in_188_bytes = 1,
  498. .quartz_direct = 1,
  499. .agc_config_count = 1,
  500. .agc = &stk7700p_7000m_mt2060_agc_config,
  501. .bw = &stk7700p_pll_config,
  502. .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS,
  503. .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES,
  504. .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS,
  505. };
  506. static struct dib7000p_config stk7700p_dib7000p_config = {
  507. .output_mpeg2_in_188_bytes = 1,
  508. .agc_config_count = 1,
  509. .agc = &stk7700p_7000p_mt2060_agc_config,
  510. .bw = &stk7700p_pll_config,
  511. .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS,
  512. .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES,
  513. .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS,
  514. };
  515. static int stk7700p_frontend_attach(struct dvb_usb_adapter *adap)
  516. {
  517. struct dib0700_state *st = adap->dev->priv;
  518. /* unless there is no real power management in DVB - we leave the device on GPIO6 */
  519. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
  520. dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(50);
  521. dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10);
  522. dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
  523. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10);
  524. dib0700_ctrl_clock(adap->dev, 72, 1);
  525. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(100);
  526. dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
  527. st->mt2060_if1[0] = 1220;
  528. if (dib7000pc_detection(&adap->dev->i2c_adap)) {
  529. adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000p_config);
  530. st->is_dib7000pc = 1;
  531. } else
  532. adap->fe = dvb_attach(dib7000m_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000m_config);
  533. return adap->fe == NULL ? -ENODEV : 0;
  534. }
  535. static struct mt2060_config stk7700p_mt2060_config = {
  536. 0x60
  537. };
  538. static int stk7700p_tuner_attach(struct dvb_usb_adapter *adap)
  539. {
  540. struct dib0700_state *st = adap->dev->priv;
  541. struct i2c_adapter *tun_i2c;
  542. if (st->is_dib7000pc)
  543. tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1);
  544. else
  545. tun_i2c = dib7000m_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1);
  546. return dvb_attach(mt2060_attach, adap->fe, tun_i2c, &stk7700p_mt2060_config,
  547. st->mt2060_if1[0]) == NULL ? -ENODEV : 0;
  548. }
  549. /* DIB7070 generic */
  550. static struct dibx000_agc_config dib7070_agc_config = {
  551. BAND_UHF | BAND_VHF | BAND_LBAND | BAND_SBAND,
  552. /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=5, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0,
  553. * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0 */
  554. (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), // setup
  555. 600, // inv_gain
  556. 10, // time_stabiliz
  557. 0, // alpha_level
  558. 118, // thlock
  559. 0, // wbd_inv
  560. 3530, // wbd_ref
  561. 1, // wbd_sel
  562. 5, // wbd_alpha
  563. 65535, // agc1_max
  564. 0, // agc1_min
  565. 65535, // agc2_max
  566. 0, // agc2_min
  567. 0, // agc1_pt1
  568. 40, // agc1_pt2
  569. 183, // agc1_pt3
  570. 206, // agc1_slope1
  571. 255, // agc1_slope2
  572. 72, // agc2_pt1
  573. 152, // agc2_pt2
  574. 88, // agc2_slope1
  575. 90, // agc2_slope2
  576. 17, // alpha_mant
  577. 27, // alpha_exp
  578. 23, // beta_mant
  579. 51, // beta_exp
  580. 0, // perform_agc_softsplit
  581. };
  582. static int dib7070_tuner_reset(struct dvb_frontend *fe, int onoff)
  583. {
  584. return dib7000p_set_gpio(fe, 8, 0, !onoff);
  585. }
  586. static int dib7070_tuner_sleep(struct dvb_frontend *fe, int onoff)
  587. {
  588. return dib7000p_set_gpio(fe, 9, 0, onoff);
  589. }
  590. static struct dib0070_config dib7070p_dib0070_config[2] = {
  591. {
  592. .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS,
  593. .reset = dib7070_tuner_reset,
  594. .sleep = dib7070_tuner_sleep,
  595. .clock_khz = 12000,
  596. .clock_pad_drive = 4
  597. }, {
  598. .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS,
  599. .reset = dib7070_tuner_reset,
  600. .sleep = dib7070_tuner_sleep,
  601. .clock_khz = 12000,
  602. }
  603. };
  604. static int dib7070_set_param_override(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep)
  605. {
  606. struct dvb_usb_adapter *adap = fe->dvb->priv;
  607. struct dib0700_adapter_state *state = adap->priv;
  608. u16 offset;
  609. u8 band = BAND_OF_FREQUENCY(fep->frequency/1000);
  610. switch (band) {
  611. case BAND_VHF: offset = 950; break;
  612. case BAND_UHF:
  613. default: offset = 550; break;
  614. }
  615. deb_info("WBD for DiB7000P: %d\n", offset + dib0070_wbd_offset(fe));
  616. dib7000p_set_wbd_ref(fe, offset + dib0070_wbd_offset(fe));
  617. return state->set_param_save(fe, fep);
  618. }
  619. static int dib7070p_tuner_attach(struct dvb_usb_adapter *adap)
  620. {
  621. struct dib0700_adapter_state *st = adap->priv;
  622. struct i2c_adapter *tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1);
  623. if (adap->id == 0) {
  624. if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, &dib7070p_dib0070_config[0]) == NULL)
  625. return -ENODEV;
  626. } else {
  627. if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, &dib7070p_dib0070_config[1]) == NULL)
  628. return -ENODEV;
  629. }
  630. st->set_param_save = adap->fe->ops.tuner_ops.set_params;
  631. adap->fe->ops.tuner_ops.set_params = dib7070_set_param_override;
  632. return 0;
  633. }
  634. static struct dibx000_bandwidth_config dib7070_bw_config_12_mhz = {
  635. 60000, 15000, // internal, sampling
  636. 1, 20, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass
  637. 0, 0, 1, 1, 2, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo
  638. (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k
  639. (0 << 25) | 0, // ifreq = 0.000000 MHz
  640. 20452225, // timf
  641. 12000000, // xtal_hz
  642. };
  643. static struct dib7000p_config dib7070p_dib7000p_config = {
  644. .output_mpeg2_in_188_bytes = 1,
  645. .agc_config_count = 1,
  646. .agc = &dib7070_agc_config,
  647. .bw = &dib7070_bw_config_12_mhz,
  648. .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
  649. .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
  650. .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
  651. .hostbus_diversity = 1,
  652. };
  653. /* STK7070P */
  654. static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap)
  655. {
  656. dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
  657. msleep(10);
  658. dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
  659. dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
  660. dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
  661. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
  662. dib0700_ctrl_clock(adap->dev, 72, 1);
  663. msleep(10);
  664. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
  665. msleep(10);
  666. dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
  667. dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, &dib7070p_dib7000p_config);
  668. adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, &dib7070p_dib7000p_config);
  669. return adap->fe == NULL ? -ENODEV : 0;
  670. }
  671. /* STK7070PD */
  672. static struct dib7000p_config stk7070pd_dib7000p_config[2] = {
  673. {
  674. .output_mpeg2_in_188_bytes = 1,
  675. .agc_config_count = 1,
  676. .agc = &dib7070_agc_config,
  677. .bw = &dib7070_bw_config_12_mhz,
  678. .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
  679. .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
  680. .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
  681. .hostbus_diversity = 1,
  682. }, {
  683. .output_mpeg2_in_188_bytes = 1,
  684. .agc_config_count = 1,
  685. .agc = &dib7070_agc_config,
  686. .bw = &dib7070_bw_config_12_mhz,
  687. .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
  688. .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
  689. .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
  690. .hostbus_diversity = 1,
  691. }
  692. };
  693. static int stk7070pd_frontend_attach0(struct dvb_usb_adapter *adap)
  694. {
  695. dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
  696. msleep(10);
  697. dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
  698. dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
  699. dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
  700. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
  701. dib0700_ctrl_clock(adap->dev, 72, 1);
  702. msleep(10);
  703. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
  704. msleep(10);
  705. dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
  706. dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 2, 18, stk7070pd_dib7000p_config);
  707. adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, &stk7070pd_dib7000p_config[0]);
  708. return adap->fe == NULL ? -ENODEV : 0;
  709. }
  710. static int stk7070pd_frontend_attach1(struct dvb_usb_adapter *adap)
  711. {
  712. adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x82, &stk7070pd_dib7000p_config[1]);
  713. return adap->fe == NULL ? -ENODEV : 0;
  714. }
  715. /* DVB-USB and USB stuff follows */
  716. struct usb_device_id dib0700_usb_id_table[] = {
  717. /* 0 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P) },
  718. { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P_PC) },
  719. { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500) },
  720. { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500_2) },
  721. { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK) },
  722. /* 5 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR) },
  723. { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500) },
  724. { USB_DEVICE(USB_VID_UNIWILL, USB_PID_UNIWILL_STK7700P) },
  725. { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_STK7700P) },
  726. { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_2) },
  727. /* 10 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR_2) },
  728. { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV2000E) },
  729. { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY) },
  730. { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_TD_STICK) },
  731. { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700D) },
  732. /* 15 */{ USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070P) },
  733. { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV_DVB_T_FLASH) },
  734. { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070PD) },
  735. { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T) },
  736. { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500_PC) },
  737. /* 20 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_EXPRESS) },
  738. { USB_DEVICE(USB_VID_GIGABYTE, USB_PID_GIGABYTE_U7000) },
  739. { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14BR) },
  740. { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3000) },
  741. { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3100) },
  742. { 0 } /* Terminating entry */
  743. };
  744. MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table);
  745. #define DIB0700_DEFAULT_DEVICE_PROPERTIES \
  746. .caps = DVB_USB_IS_AN_I2C_ADAPTER, \
  747. .usb_ctrl = DEVICE_SPECIFIC, \
  748. .firmware = "dvb-usb-dib0700-1.10.fw", \
  749. .download_firmware = dib0700_download_firmware, \
  750. .no_reconnect = 1, \
  751. .size_of_priv = sizeof(struct dib0700_state), \
  752. .i2c_algo = &dib0700_i2c_algo, \
  753. .identify_state = dib0700_identify_state
  754. #define DIB0700_DEFAULT_STREAMING_CONFIG(ep) \
  755. .streaming_ctrl = dib0700_streaming_ctrl, \
  756. .stream = { \
  757. .type = USB_BULK, \
  758. .count = 4, \
  759. .endpoint = ep, \
  760. .u = { \
  761. .bulk = { \
  762. .buffersize = 39480, \
  763. } \
  764. } \
  765. }
  766. struct dvb_usb_device_properties dib0700_devices[] = {
  767. {
  768. DIB0700_DEFAULT_DEVICE_PROPERTIES,
  769. .num_adapters = 1,
  770. .adapter = {
  771. {
  772. .frontend_attach = stk7700p_frontend_attach,
  773. .tuner_attach = stk7700p_tuner_attach,
  774. DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
  775. },
  776. },
  777. .num_device_descs = 8,
  778. .devices = {
  779. { "DiBcom STK7700P reference design",
  780. { &dib0700_usb_id_table[0], &dib0700_usb_id_table[1] },
  781. { NULL },
  782. },
  783. { "Hauppauge Nova-T Stick",
  784. { &dib0700_usb_id_table[4], &dib0700_usb_id_table[9], NULL },
  785. { NULL },
  786. },
  787. { "AVerMedia AVerTV DVB-T Volar",
  788. { &dib0700_usb_id_table[5], &dib0700_usb_id_table[10] },
  789. { NULL },
  790. },
  791. { "Compro Videomate U500",
  792. { &dib0700_usb_id_table[6], &dib0700_usb_id_table[19] },
  793. { NULL },
  794. },
  795. { "Uniwill STK7700P based (Hama and others)",
  796. { &dib0700_usb_id_table[7], NULL },
  797. { NULL },
  798. },
  799. { "Leadtek Winfast DTV Dongle (STK7700P based)",
  800. { &dib0700_usb_id_table[8], NULL },
  801. { NULL },
  802. },
  803. { "AVerMedia AVerTV DVB-T Express",
  804. { &dib0700_usb_id_table[20] },
  805. { NULL },
  806. },
  807. { "Gigabyte U7000",
  808. { &dib0700_usb_id_table[21], NULL },
  809. { NULL },
  810. }
  811. },
  812. .rc_interval = DEFAULT_RC_INTERVAL,
  813. .rc_key_map = dib0700_rc_keys,
  814. .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys),
  815. .rc_query = dib0700_rc_query
  816. }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
  817. .num_adapters = 2,
  818. .adapter = {
  819. {
  820. .frontend_attach = bristol_frontend_attach,
  821. .tuner_attach = bristol_tuner_attach,
  822. DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
  823. }, {
  824. .frontend_attach = bristol_frontend_attach,
  825. .tuner_attach = bristol_tuner_attach,
  826. DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
  827. }
  828. },
  829. .num_device_descs = 1,
  830. .devices = {
  831. { "Hauppauge Nova-T 500 Dual DVB-T",
  832. { &dib0700_usb_id_table[2], &dib0700_usb_id_table[3], NULL },
  833. { NULL },
  834. },
  835. },
  836. .rc_interval = DEFAULT_RC_INTERVAL,
  837. .rc_key_map = dib0700_rc_keys,
  838. .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys),
  839. .rc_query = dib0700_rc_query
  840. }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
  841. .num_adapters = 2,
  842. .adapter = {
  843. {
  844. .frontend_attach = stk7700d_frontend_attach,
  845. .tuner_attach = stk7700d_tuner_attach,
  846. DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
  847. }, {
  848. .frontend_attach = stk7700d_frontend_attach,
  849. .tuner_attach = stk7700d_tuner_attach,
  850. DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
  851. }
  852. },
  853. .num_device_descs = 4,
  854. .devices = {
  855. { "Pinnacle PCTV 2000e",
  856. { &dib0700_usb_id_table[11], NULL },
  857. { NULL },
  858. },
  859. { "Terratec Cinergy DT XS Diversity",
  860. { &dib0700_usb_id_table[12], NULL },
  861. { NULL },
  862. },
  863. { "Hauppauge Nova-TD Stick/Elgato Eye-TV Diversity",
  864. { &dib0700_usb_id_table[13], NULL },
  865. { NULL },
  866. },
  867. { "DiBcom STK7700D reference design",
  868. { &dib0700_usb_id_table[14], NULL },
  869. { NULL },
  870. }
  871. },
  872. .rc_interval = DEFAULT_RC_INTERVAL,
  873. .rc_key_map = dib0700_rc_keys,
  874. .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys),
  875. .rc_query = dib0700_rc_query
  876. }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
  877. .num_adapters = 1,
  878. .adapter = {
  879. {
  880. .frontend_attach = stk7700P2_frontend_attach,
  881. .tuner_attach = stk7700d_tuner_attach,
  882. DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
  883. },
  884. },
  885. .num_device_descs = 1,
  886. .devices = {
  887. { "ASUS My Cinema U3000 Mini DVBT Tuner",
  888. { &dib0700_usb_id_table[23], NULL },
  889. { NULL },
  890. },
  891. }
  892. }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
  893. .num_adapters = 1,
  894. .adapter = {
  895. {
  896. .frontend_attach = stk7070p_frontend_attach,
  897. .tuner_attach = dib7070p_tuner_attach,
  898. DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
  899. .size_of_priv = sizeof(struct dib0700_adapter_state),
  900. },
  901. },
  902. .num_device_descs = 4,
  903. .devices = {
  904. { "DiBcom STK7070P reference design",
  905. { &dib0700_usb_id_table[15], NULL },
  906. { NULL },
  907. },
  908. { "Pinnacle PCTV DVB-T Flash Stick",
  909. { &dib0700_usb_id_table[16], NULL },
  910. { NULL },
  911. },
  912. { "Artec T14BR DVB-T",
  913. { &dib0700_usb_id_table[22], NULL },
  914. { NULL },
  915. },
  916. { "ASUS My Cinema U3100 Mini DVBT Tuner",
  917. { &dib0700_usb_id_table[24], NULL },
  918. { NULL },
  919. },
  920. }
  921. }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
  922. .num_adapters = 2,
  923. .adapter = {
  924. {
  925. .frontend_attach = stk7070pd_frontend_attach0,
  926. .tuner_attach = dib7070p_tuner_attach,
  927. DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
  928. .size_of_priv = sizeof(struct dib0700_adapter_state),
  929. }, {
  930. .frontend_attach = stk7070pd_frontend_attach1,
  931. .tuner_attach = dib7070p_tuner_attach,
  932. DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
  933. .size_of_priv = sizeof(struct dib0700_adapter_state),
  934. }
  935. },
  936. .num_device_descs = 2,
  937. .devices = {
  938. { "DiBcom STK7070PD reference design",
  939. { &dib0700_usb_id_table[17], NULL },
  940. { NULL },
  941. },
  942. { "Pinnacle PCTV Dual DVB-T Diversity Stick",
  943. { &dib0700_usb_id_table[18], NULL },
  944. { NULL },
  945. }
  946. }
  947. },
  948. };
  949. int dib0700_device_count = ARRAY_SIZE(dib0700_devices);