dib0700_devices.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  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-6 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. static int force_lna_activation;
  16. module_param(force_lna_activation, int, 0644);
  17. MODULE_PARM_DESC(force_lna_activation, "force the activation of Low-Noise-Amplifyer(s) (LNA), "
  18. "if applicable for the device (default: 0=automatic/off).");
  19. /* Hauppauge Nova-T 500
  20. * has a LNA on GPIO0 which is enabled by setting 1 */
  21. static struct mt2060_config bristol_mt2060_config[2] = {
  22. {
  23. .i2c_address = 0x60,
  24. .clock_out = 3,
  25. }, {
  26. .i2c_address = 0x61,
  27. }
  28. };
  29. static struct dibx000_agc_config bristol_dib3000p_mt2060_agc_config = {
  30. .band_caps = BAND_VHF | BAND_UHF,
  31. .setup = (1 << 8) | (5 << 5) | (0 << 4) | (0 << 3) | (0 << 2) | (2 << 0),
  32. .agc1_max = 42598,
  33. .agc1_min = 17694,
  34. .agc2_max = 45875,
  35. .agc2_min = 0,
  36. .agc1_pt1 = 0,
  37. .agc1_pt2 = 59,
  38. .agc1_slope1 = 0,
  39. .agc1_slope2 = 69,
  40. .agc2_pt1 = 0,
  41. .agc2_pt2 = 59,
  42. .agc2_slope1 = 111,
  43. .agc2_slope2 = 28,
  44. };
  45. static struct dib3000mc_config bristol_dib3000mc_config[2] = {
  46. { .agc = &bristol_dib3000p_mt2060_agc_config,
  47. .max_time = 0x196,
  48. .ln_adc_level = 0x1cc7,
  49. .output_mpeg2_in_188_bytes = 1,
  50. },
  51. { .agc = &bristol_dib3000p_mt2060_agc_config,
  52. .max_time = 0x196,
  53. .ln_adc_level = 0x1cc7,
  54. .output_mpeg2_in_188_bytes = 1,
  55. }
  56. };
  57. static int bristol_frontend_attach(struct dvb_usb_adapter *adap)
  58. {
  59. struct dib0700_state *st = adap->dev->priv;
  60. if (adap->id == 0) {
  61. dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(10);
  62. dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10);
  63. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10);
  64. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(10);
  65. if (force_lna_activation)
  66. dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
  67. else
  68. dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 0);
  69. if (dib3000mc_i2c_enumeration(&adap->dev->i2c_adap, 2, DEFAULT_DIB3000P_I2C_ADDRESS, bristol_dib3000mc_config) != 0) {
  70. dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(10);
  71. return -ENODEV;
  72. }
  73. }
  74. st->mt2060_if1[adap->id] = 1220;
  75. return (adap->fe = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap,
  76. (10 + adap->id) << 1, &bristol_dib3000mc_config[adap->id])) == NULL ? -ENODEV : 0;
  77. }
  78. static int bristol_tuner_attach(struct dvb_usb_adapter *adap)
  79. {
  80. struct dib0700_state *st = adap->dev->priv;
  81. struct i2c_adapter *tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe, 1);
  82. return dvb_attach(mt2060_attach,adap->fe, tun_i2c, &bristol_mt2060_config[adap->id],
  83. st->mt2060_if1[adap->id]) == NULL ? -ENODEV : 0;
  84. }
  85. /* STK7700D: Pinnacle Dual DVB-T Diversity */
  86. static struct dibx000_agc_config stk7700d_7000p_mt2266_agc_config = {
  87. BAND_UHF/* | BAND_VHF*/,
  88. 0xE64, // setup
  89. 2372, // inv_gain
  90. 21, // time_stabiliz
  91. 0, // alpha_level
  92. 118, // thlock
  93. 0, // wbd_inv
  94. 0, // wbd_ref
  95. 0, // wbd_sel
  96. 0, // wbd_alpha
  97. 65535, // agc1_max
  98. 0, // agc1_min
  99. 65535, // agc2_max
  100. 23592, // agc2_min
  101. 0, // agc1_pt1
  102. 128, // agc1_pt2
  103. 128, // agc1_pt3
  104. 128, // agc1_slope1
  105. 0, // agc1_slope2
  106. 128, // agc2_pt1
  107. 253, // agc2_pt2
  108. 81, // agc2_slope1
  109. 0, // agc2_slope2
  110. 17, // alpha_mant
  111. 27, // alpha_exp
  112. 23, // beta_mant
  113. 51, // beta_exp
  114. 0, // perform_agc_softsplit : 1 en vrai!
  115. };
  116. static struct dibx000_bandwidth_config stk7700d_mt2266_pll_config = {
  117. 60000, 30000, // internal, sampling
  118. 1, 8, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass
  119. 0, 0, 1, 1, 2, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo
  120. (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k
  121. 0, // ifreq
  122. 20452225, // timf
  123. };
  124. static struct dib7000p_config stk7700d_dib7000p_mt2266_config[] = {
  125. { .output_mpeg2_in_188_bytes = 1,
  126. .hostbus_diversity = 1,
  127. .tuner_is_baseband = 1,
  128. .agc = &stk7700d_7000p_mt2266_agc_config,
  129. .bw = &stk7700d_mt2266_pll_config,
  130. .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS,
  131. .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES,
  132. .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS,
  133. },
  134. { .output_mpeg2_in_188_bytes = 1,
  135. .hostbus_diversity = 1,
  136. .tuner_is_baseband = 1,
  137. .agc = &stk7700d_7000p_mt2266_agc_config,
  138. .bw = &stk7700d_mt2266_pll_config,
  139. .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS,
  140. .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES,
  141. .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS,
  142. }
  143. };
  144. static struct mt2266_config stk7700d_mt2266_config[2] = {
  145. { .i2c_address = 0x60
  146. },
  147. { .i2c_address = 0x60
  148. }
  149. };
  150. static int stk7700d_frontend_attach(struct dvb_usb_adapter *adap)
  151. {
  152. if (adap->id == 0) {
  153. dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
  154. msleep(10);
  155. dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
  156. dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
  157. dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
  158. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
  159. msleep(10);
  160. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
  161. msleep(10);
  162. dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
  163. dib7000p_i2c_enumeration(&adap->dev->i2c_adap,2,18,stk7700d_dib7000p_mt2266_config);
  164. }
  165. adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap,0x80+(adap->id << 1),
  166. &stk7700d_dib7000p_mt2266_config[adap->id]);
  167. return adap->fe == NULL ? -ENODEV : 0;
  168. }
  169. static int stk7700d_tuner_attach(struct dvb_usb_adapter *adap)
  170. {
  171. struct i2c_adapter *tun_i2c;
  172. tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1);
  173. return dvb_attach(mt2266_attach, adap->fe, tun_i2c,
  174. &stk7700d_mt2266_config[adap->id]) == NULL ? -ENODEV : 0;;
  175. }
  176. #define DEFAULT_RC_INTERVAL 150
  177. static u8 rc_request[] = { REQUEST_POLL_RC, 0 };
  178. int stk7700d_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
  179. {
  180. u8 key[4];
  181. int i;
  182. struct dvb_usb_rc_key *keymap = d->props.rc_key_map;
  183. struct dib0700_state *st = d->priv;
  184. *event = 0;
  185. *state = REMOTE_NO_KEY_PRESSED;
  186. i=dib0700_ctrl_rd(d,rc_request,2,key,4);
  187. if (i<=0) {
  188. err("stk7700d:RC Query Failed\n");
  189. return 0;
  190. }
  191. if (key[0]==0 && key[1]==0 && key[2]==0 && key[3]==0) return 0;
  192. if (key[1]!=st->rc_toggle) {
  193. for (i=0;i<d->props.rc_key_map_size; i++) {
  194. if (keymap[i].custom == key[2] && keymap[i].data == key[3]) {
  195. *event = keymap[i].event;
  196. *state = REMOTE_KEY_PRESSED;
  197. st->rc_toggle=key[1];
  198. return 0;
  199. }
  200. }
  201. err("stk7700d:Unknown remote controller key : %2X %2X\n",(int)key[2],(int)key[3]);
  202. }
  203. return 0;
  204. }
  205. #define KEY_MAP_SIZE (25+48)
  206. struct dvb_usb_rc_key stk7700d_rc_keys[] = {
  207. /* Key codes for the tiny Pinnacle remote*/
  208. { 0x07, 0x00, KEY_MUTE },
  209. { 0x07, 0x01, KEY_MENU }, // Pinnacle logo
  210. { 0x07, 0x39, KEY_POWER },
  211. { 0x07, 0x03, KEY_VOLUMEUP },
  212. { 0x07, 0x09, KEY_VOLUMEDOWN },
  213. { 0x07, 0x06, KEY_CHANNELUP },
  214. { 0x07, 0x0c, KEY_CHANNELDOWN },
  215. { 0x07, 0x0f, KEY_1 },
  216. { 0x07, 0x15, KEY_2 },
  217. { 0x07, 0x10, KEY_3 },
  218. { 0x07, 0x18, KEY_4 },
  219. { 0x07, 0x1b, KEY_5 },
  220. { 0x07, 0x1e, KEY_6 },
  221. { 0x07, 0x11, KEY_7 },
  222. { 0x07, 0x21, KEY_8 },
  223. { 0x07, 0x12, KEY_9 },
  224. { 0x07, 0x27, KEY_0 },
  225. { 0x07, 0x24, KEY_SCREEN }, // 'Square' key
  226. { 0x07, 0x2a, KEY_TEXT }, // 'T' key
  227. { 0x07, 0x2d, KEY_REWIND },
  228. { 0x07, 0x30, KEY_PLAY },
  229. { 0x07, 0x33, KEY_FASTFORWARD },
  230. { 0x07, 0x36, KEY_RECORD },
  231. { 0x07, 0x3c, KEY_STOP },
  232. { 0x07, 0x3f, KEY_CANCEL }, // '?' key
  233. /* Key codes for the Terratec Cinergy DT XS Diversity, similar to cinergyT2.c */
  234. { 0xeb, 0x01, KEY_POWER },
  235. { 0xeb, 0x02, KEY_1 },
  236. { 0xeb, 0x03, KEY_2 },
  237. { 0xeb, 0x04, KEY_3 },
  238. { 0xeb, 0x05, KEY_4 },
  239. { 0xeb, 0x06, KEY_5 },
  240. { 0xeb, 0x07, KEY_6 },
  241. { 0xeb, 0x08, KEY_7 },
  242. { 0xeb, 0x09, KEY_8 },
  243. { 0xeb, 0x0a, KEY_9 },
  244. { 0xeb, 0x0b, KEY_VIDEO },
  245. { 0xeb, 0x0c, KEY_0 },
  246. { 0xeb, 0x0d, KEY_REFRESH },
  247. { 0xeb, 0x0f, KEY_EPG },
  248. { 0xeb, 0x10, KEY_UP },
  249. { 0xeb, 0x11, KEY_LEFT },
  250. { 0xeb, 0x12, KEY_OK },
  251. { 0xeb, 0x13, KEY_RIGHT },
  252. { 0xeb, 0x14, KEY_DOWN },
  253. { 0xeb, 0x16, KEY_INFO },
  254. { 0xeb, 0x17, KEY_RED },
  255. { 0xeb, 0x18, KEY_GREEN },
  256. { 0xeb, 0x19, KEY_YELLOW },
  257. { 0xeb, 0x1a, KEY_BLUE },
  258. { 0xeb, 0x1b, KEY_CHANNELUP },
  259. { 0xeb, 0x1c, KEY_VOLUMEUP },
  260. { 0xeb, 0x1d, KEY_MUTE },
  261. { 0xeb, 0x1e, KEY_VOLUMEDOWN },
  262. { 0xeb, 0x1f, KEY_CHANNELDOWN },
  263. { 0xeb, 0x40, KEY_PAUSE },
  264. { 0xeb, 0x41, KEY_HOME },
  265. { 0xeb, 0x42, KEY_MENU }, /* DVD Menu */
  266. { 0xeb, 0x43, KEY_SUBTITLE },
  267. { 0xeb, 0x44, KEY_TEXT }, /* Teletext */
  268. { 0xeb, 0x45, KEY_DELETE },
  269. { 0xeb, 0x46, KEY_TV },
  270. { 0xeb, 0x47, KEY_DVD },
  271. { 0xeb, 0x48, KEY_STOP },
  272. { 0xeb, 0x49, KEY_VIDEO },
  273. { 0xeb, 0x4a, KEY_AUDIO }, /* Music */
  274. { 0xeb, 0x4b, KEY_SCREEN }, /* Pic */
  275. { 0xeb, 0x4c, KEY_PLAY },
  276. { 0xeb, 0x4d, KEY_BACK },
  277. { 0xeb, 0x4e, KEY_REWIND },
  278. { 0xeb, 0x4f, KEY_FASTFORWARD },
  279. { 0xeb, 0x54, KEY_PREVIOUS },
  280. { 0xeb, 0x58, KEY_RECORD },
  281. { 0xeb, 0x5c, KEY_NEXT }
  282. };
  283. /* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */
  284. static struct dibx000_agc_config stk7700p_7000m_mt2060_agc_config = {
  285. BAND_UHF | BAND_VHF, // band_caps
  286. /* 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,
  287. * 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 */
  288. (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup
  289. 712, // inv_gain
  290. 41, // time_stabiliz
  291. 0, // alpha_level
  292. 118, // thlock
  293. 0, // wbd_inv
  294. 4095, // wbd_ref
  295. 0, // wbd_sel
  296. 0, // wbd_alpha
  297. 42598, // agc1_max
  298. 17694, // agc1_min
  299. 45875, // agc2_max
  300. 2621, // agc2_min
  301. 0, // agc1_pt1
  302. 76, // agc1_pt2
  303. 139, // agc1_pt3
  304. 52, // agc1_slope1
  305. 59, // agc1_slope2
  306. 107, // agc2_pt1
  307. 172, // agc2_pt2
  308. 57, // agc2_slope1
  309. 70, // agc2_slope2
  310. 21, // alpha_mant
  311. 25, // alpha_exp
  312. 28, // beta_mant
  313. 48, // beta_exp
  314. 1, // perform_agc_softsplit
  315. { 0, // split_min
  316. 107, // split_max
  317. 51800, // global_split_min
  318. 24700 // global_split_max
  319. },
  320. };
  321. static struct dibx000_agc_config stk7700p_7000p_mt2060_agc_config = {
  322. BAND_UHF | BAND_VHF,
  323. /* 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,
  324. * 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 */
  325. (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup
  326. 712, // inv_gain
  327. 41, // time_stabiliz
  328. 0, // alpha_level
  329. 118, // thlock
  330. 0, // wbd_inv
  331. 4095, // wbd_ref
  332. 0, // wbd_sel
  333. 0, // wbd_alpha
  334. 42598, // agc1_max
  335. 16384, // agc1_min
  336. 42598, // agc2_max
  337. 0, // agc2_min
  338. 0, // agc1_pt1
  339. 137, // agc1_pt2
  340. 255, // agc1_pt3
  341. 0, // agc1_slope1
  342. 255, // agc1_slope2
  343. 0, // agc2_pt1
  344. 0, // agc2_pt2
  345. 0, // agc2_slope1
  346. 41, // agc2_slope2
  347. 15, // alpha_mant
  348. 25, // alpha_exp
  349. 28, // beta_mant
  350. 48, // beta_exp
  351. 0, // perform_agc_softsplit
  352. };
  353. static struct dibx000_bandwidth_config stk7700p_pll_config = {
  354. 60000, 30000, // internal, sampling
  355. 1, 8, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass
  356. 0, 0, 1, 1, 0, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo
  357. (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k
  358. 60258167, // ifreq
  359. 20452225, // timf
  360. };
  361. static struct dib7000m_config stk7700p_dib7000m_config = {
  362. .dvbt_mode = 1,
  363. .output_mpeg2_in_188_bytes = 1,
  364. .quartz_direct = 1,
  365. .agc_config_count = 1,
  366. .agc = &stk7700p_7000m_mt2060_agc_config,
  367. .bw = &stk7700p_pll_config,
  368. .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS,
  369. .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES,
  370. .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS,
  371. };
  372. static struct dib7000p_config stk7700p_dib7000p_config = {
  373. .output_mpeg2_in_188_bytes = 1,
  374. .agc = &stk7700p_7000p_mt2060_agc_config,
  375. .bw = &stk7700p_pll_config,
  376. .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS,
  377. .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES,
  378. .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS,
  379. };
  380. static int stk7700p_frontend_attach(struct dvb_usb_adapter *adap)
  381. {
  382. struct dib0700_state *st = adap->dev->priv;
  383. /* unless there is no real power management in DVB - we leave the device on GPIO6 */
  384. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
  385. dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(50);
  386. dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10);
  387. dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
  388. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10);
  389. dib0700_ctrl_clock(adap->dev, 72, 1);
  390. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(100);
  391. dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
  392. st->mt2060_if1[0] = 1220;
  393. if (dib7000pc_detection(&adap->dev->i2c_adap)) {
  394. adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000p_config);
  395. st->is_dib7000pc = 1;
  396. } else
  397. adap->fe = dvb_attach(dib7000m_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000m_config);
  398. return adap->fe == NULL ? -ENODEV : 0;
  399. }
  400. static struct mt2060_config stk7700p_mt2060_config = {
  401. 0x60
  402. };
  403. static int stk7700p_tuner_attach(struct dvb_usb_adapter *adap)
  404. {
  405. struct dib0700_state *st = adap->dev->priv;
  406. struct i2c_adapter *tun_i2c;
  407. if (st->is_dib7000pc)
  408. tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1);
  409. else
  410. tun_i2c = dib7000m_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1);
  411. return dvb_attach(mt2060_attach, adap->fe, tun_i2c, &stk7700p_mt2060_config,
  412. st->mt2060_if1[0]) == NULL ? -ENODEV : 0;
  413. }
  414. struct usb_device_id dib0700_usb_id_table[] = {
  415. { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P) },
  416. { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P_PC) },
  417. { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500) },
  418. { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500_2) },
  419. { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK) },
  420. { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR) },
  421. { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500) },
  422. { USB_DEVICE(USB_VID_UNIWILL, USB_PID_UNIWILL_STK7700P) },
  423. { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_STK7700P) },
  424. { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_2) },
  425. { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR_2) },
  426. { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV2000E) },
  427. { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY) },
  428. { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_TD_STICK) },
  429. { } /* Terminating entry */
  430. };
  431. MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table);
  432. #define DIB0700_DEFAULT_DEVICE_PROPERTIES \
  433. .caps = DVB_USB_IS_AN_I2C_ADAPTER, \
  434. .usb_ctrl = DEVICE_SPECIFIC, \
  435. .firmware = "dvb-usb-dib0700-01.fw", \
  436. .download_firmware = dib0700_download_firmware, \
  437. .no_reconnect = 1, \
  438. .size_of_priv = sizeof(struct dib0700_state), \
  439. .i2c_algo = &dib0700_i2c_algo, \
  440. .identify_state = dib0700_identify_state
  441. #define DIB0700_DEFAULT_STREAMING_CONFIG(ep) \
  442. .streaming_ctrl = dib0700_streaming_ctrl, \
  443. .stream = { \
  444. .type = USB_BULK, \
  445. .count = 4, \
  446. .endpoint = ep, \
  447. .u = { \
  448. .bulk = { \
  449. .buffersize = 39480, \
  450. } \
  451. } \
  452. }
  453. struct dvb_usb_device_properties dib0700_devices[] = {
  454. {
  455. DIB0700_DEFAULT_DEVICE_PROPERTIES,
  456. .num_adapters = 1,
  457. .adapter = {
  458. {
  459. .frontend_attach = stk7700p_frontend_attach,
  460. .tuner_attach = stk7700p_tuner_attach,
  461. DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
  462. },
  463. },
  464. .num_device_descs = 6,
  465. .devices = {
  466. { "DiBcom STK7700P reference design",
  467. { &dib0700_usb_id_table[0], &dib0700_usb_id_table[1] },
  468. { NULL },
  469. },
  470. { "Hauppauge Nova-T Stick",
  471. { &dib0700_usb_id_table[4], &dib0700_usb_id_table[9], NULL },
  472. { NULL },
  473. },
  474. { "AVerMedia AVerTV DVB-T Volar",
  475. { &dib0700_usb_id_table[5], &dib0700_usb_id_table[10] },
  476. { NULL },
  477. },
  478. { "Compro Videomate U500",
  479. { &dib0700_usb_id_table[6], NULL },
  480. { NULL },
  481. },
  482. { "Uniwill STK7700P based (Hama and others)",
  483. { &dib0700_usb_id_table[7], NULL },
  484. { NULL },
  485. },
  486. { "Leadtek Winfast DTV Dongle (STK7700P based)",
  487. { &dib0700_usb_id_table[8], NULL },
  488. { NULL },
  489. }
  490. }
  491. }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
  492. .num_adapters = 2,
  493. .adapter = {
  494. {
  495. .frontend_attach = bristol_frontend_attach,
  496. .tuner_attach = bristol_tuner_attach,
  497. DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
  498. }, {
  499. .frontend_attach = bristol_frontend_attach,
  500. .tuner_attach = bristol_tuner_attach,
  501. DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
  502. }
  503. },
  504. .num_device_descs = 1,
  505. .devices = {
  506. { "Hauppauge Nova-T 500 Dual DVB-T",
  507. { &dib0700_usb_id_table[2], &dib0700_usb_id_table[3], NULL },
  508. { NULL },
  509. },
  510. }
  511. }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
  512. .num_adapters = 2,
  513. .adapter = {
  514. {
  515. .frontend_attach = stk7700d_frontend_attach,
  516. .tuner_attach = stk7700d_tuner_attach,
  517. DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
  518. }, {
  519. .frontend_attach = stk7700d_frontend_attach,
  520. .tuner_attach = stk7700d_tuner_attach,
  521. DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
  522. }
  523. },
  524. .num_device_descs = 3,
  525. .devices = {
  526. { "Pinnacle PCTV 2000e",
  527. { &dib0700_usb_id_table[11], NULL },
  528. { NULL },
  529. },
  530. { "Terratec Cinergy DT XS Diversity",
  531. { &dib0700_usb_id_table[12], NULL },
  532. { NULL },
  533. },
  534. { "Haupauge Nova-TD Stick",
  535. { &dib0700_usb_id_table[13], NULL },
  536. { NULL },
  537. },
  538. },
  539. .rc_interval = DEFAULT_RC_INTERVAL,
  540. .rc_key_map = stk7700d_rc_keys,
  541. .rc_key_map_size = KEY_MAP_SIZE,
  542. .rc_query = stk7700d_rc_query
  543. }
  544. };
  545. int dib0700_device_count = ARRAY_SIZE(dib0700_devices);