dib0700_devices.c 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032
  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 stk7700d_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. dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
  205. dib7000p_i2c_enumeration(&adap->dev->i2c_adap,2,18,stk7700d_dib7000p_mt2266_config);
  206. }
  207. adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap,0x80+(adap->id << 1),
  208. &stk7700d_dib7000p_mt2266_config[adap->id]);
  209. return adap->fe == NULL ? -ENODEV : 0;
  210. }
  211. static int stk7700d_tuner_attach(struct dvb_usb_adapter *adap)
  212. {
  213. struct i2c_adapter *tun_i2c;
  214. tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1);
  215. return dvb_attach(mt2266_attach, adap->fe, tun_i2c,
  216. &stk7700d_mt2266_config[adap->id]) == NULL ? -ENODEV : 0;;
  217. }
  218. #define DEFAULT_RC_INTERVAL 150
  219. static u8 rc_request[] = { REQUEST_POLL_RC, 0 };
  220. static int dib0700_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
  221. {
  222. u8 key[4];
  223. int i;
  224. struct dvb_usb_rc_key *keymap = d->props.rc_key_map;
  225. struct dib0700_state *st = d->priv;
  226. *event = 0;
  227. *state = REMOTE_NO_KEY_PRESSED;
  228. i=dib0700_ctrl_rd(d,rc_request,2,key,4);
  229. if (i<=0) {
  230. err("RC Query Failed");
  231. return -1;
  232. }
  233. if (key[0]==0 && key[1]==0 && key[2]==0 && key[3]==0) return 0;
  234. if (key[3-1]!=st->rc_toggle) {
  235. for (i=0;i<d->props.rc_key_map_size; i++) {
  236. if (keymap[i].custom == key[3-2] && keymap[i].data == key[3-3]) {
  237. *event = keymap[i].event;
  238. *state = REMOTE_KEY_PRESSED;
  239. st->rc_toggle=key[3-1];
  240. return 0;
  241. }
  242. }
  243. err("Unknown remote controller key : %2X %2X",(int)key[3-2],(int)key[3-3]);
  244. }
  245. return 0;
  246. }
  247. static struct dvb_usb_rc_key dib0700_rc_keys[] = {
  248. /* Key codes for the tiny Pinnacle remote*/
  249. { 0x07, 0x00, KEY_MUTE },
  250. { 0x07, 0x01, KEY_MENU }, // Pinnacle logo
  251. { 0x07, 0x39, KEY_POWER },
  252. { 0x07, 0x03, KEY_VOLUMEUP },
  253. { 0x07, 0x09, KEY_VOLUMEDOWN },
  254. { 0x07, 0x06, KEY_CHANNELUP },
  255. { 0x07, 0x0c, KEY_CHANNELDOWN },
  256. { 0x07, 0x0f, KEY_1 },
  257. { 0x07, 0x15, KEY_2 },
  258. { 0x07, 0x10, KEY_3 },
  259. { 0x07, 0x18, KEY_4 },
  260. { 0x07, 0x1b, KEY_5 },
  261. { 0x07, 0x1e, KEY_6 },
  262. { 0x07, 0x11, KEY_7 },
  263. { 0x07, 0x21, KEY_8 },
  264. { 0x07, 0x12, KEY_9 },
  265. { 0x07, 0x27, KEY_0 },
  266. { 0x07, 0x24, KEY_SCREEN }, // 'Square' key
  267. { 0x07, 0x2a, KEY_TEXT }, // 'T' key
  268. { 0x07, 0x2d, KEY_REWIND },
  269. { 0x07, 0x30, KEY_PLAY },
  270. { 0x07, 0x33, KEY_FASTFORWARD },
  271. { 0x07, 0x36, KEY_RECORD },
  272. { 0x07, 0x3c, KEY_STOP },
  273. { 0x07, 0x3f, KEY_CANCEL }, // '?' key
  274. /* Key codes for the Terratec Cinergy DT XS Diversity, similar to cinergyT2.c */
  275. { 0xeb, 0x01, KEY_POWER },
  276. { 0xeb, 0x02, KEY_1 },
  277. { 0xeb, 0x03, KEY_2 },
  278. { 0xeb, 0x04, KEY_3 },
  279. { 0xeb, 0x05, KEY_4 },
  280. { 0xeb, 0x06, KEY_5 },
  281. { 0xeb, 0x07, KEY_6 },
  282. { 0xeb, 0x08, KEY_7 },
  283. { 0xeb, 0x09, KEY_8 },
  284. { 0xeb, 0x0a, KEY_9 },
  285. { 0xeb, 0x0b, KEY_VIDEO },
  286. { 0xeb, 0x0c, KEY_0 },
  287. { 0xeb, 0x0d, KEY_REFRESH },
  288. { 0xeb, 0x0f, KEY_EPG },
  289. { 0xeb, 0x10, KEY_UP },
  290. { 0xeb, 0x11, KEY_LEFT },
  291. { 0xeb, 0x12, KEY_OK },
  292. { 0xeb, 0x13, KEY_RIGHT },
  293. { 0xeb, 0x14, KEY_DOWN },
  294. { 0xeb, 0x16, KEY_INFO },
  295. { 0xeb, 0x17, KEY_RED },
  296. { 0xeb, 0x18, KEY_GREEN },
  297. { 0xeb, 0x19, KEY_YELLOW },
  298. { 0xeb, 0x1a, KEY_BLUE },
  299. { 0xeb, 0x1b, KEY_CHANNELUP },
  300. { 0xeb, 0x1c, KEY_VOLUMEUP },
  301. { 0xeb, 0x1d, KEY_MUTE },
  302. { 0xeb, 0x1e, KEY_VOLUMEDOWN },
  303. { 0xeb, 0x1f, KEY_CHANNELDOWN },
  304. { 0xeb, 0x40, KEY_PAUSE },
  305. { 0xeb, 0x41, KEY_HOME },
  306. { 0xeb, 0x42, KEY_MENU }, /* DVD Menu */
  307. { 0xeb, 0x43, KEY_SUBTITLE },
  308. { 0xeb, 0x44, KEY_TEXT }, /* Teletext */
  309. { 0xeb, 0x45, KEY_DELETE },
  310. { 0xeb, 0x46, KEY_TV },
  311. { 0xeb, 0x47, KEY_DVD },
  312. { 0xeb, 0x48, KEY_STOP },
  313. { 0xeb, 0x49, KEY_VIDEO },
  314. { 0xeb, 0x4a, KEY_AUDIO }, /* Music */
  315. { 0xeb, 0x4b, KEY_SCREEN }, /* Pic */
  316. { 0xeb, 0x4c, KEY_PLAY },
  317. { 0xeb, 0x4d, KEY_BACK },
  318. { 0xeb, 0x4e, KEY_REWIND },
  319. { 0xeb, 0x4f, KEY_FASTFORWARD },
  320. { 0xeb, 0x54, KEY_PREVIOUS },
  321. { 0xeb, 0x58, KEY_RECORD },
  322. { 0xeb, 0x5c, KEY_NEXT },
  323. /* Key codes for the Haupauge WinTV Nova-TD, copied from nova-t-usb2.c (Nova-T USB2) */
  324. { 0x1e, 0x00, KEY_0 },
  325. { 0x1e, 0x01, KEY_1 },
  326. { 0x1e, 0x02, KEY_2 },
  327. { 0x1e, 0x03, KEY_3 },
  328. { 0x1e, 0x04, KEY_4 },
  329. { 0x1e, 0x05, KEY_5 },
  330. { 0x1e, 0x06, KEY_6 },
  331. { 0x1e, 0x07, KEY_7 },
  332. { 0x1e, 0x08, KEY_8 },
  333. { 0x1e, 0x09, KEY_9 },
  334. { 0x1e, 0x0a, KEY_KPASTERISK },
  335. { 0x1e, 0x0b, KEY_RED },
  336. { 0x1e, 0x0c, KEY_RADIO },
  337. { 0x1e, 0x0d, KEY_MENU },
  338. { 0x1e, 0x0e, KEY_GRAVE }, /* # */
  339. { 0x1e, 0x0f, KEY_MUTE },
  340. { 0x1e, 0x10, KEY_VOLUMEUP },
  341. { 0x1e, 0x11, KEY_VOLUMEDOWN },
  342. { 0x1e, 0x12, KEY_CHANNEL },
  343. { 0x1e, 0x14, KEY_UP },
  344. { 0x1e, 0x15, KEY_DOWN },
  345. { 0x1e, 0x16, KEY_LEFT },
  346. { 0x1e, 0x17, KEY_RIGHT },
  347. { 0x1e, 0x18, KEY_VIDEO },
  348. { 0x1e, 0x19, KEY_AUDIO },
  349. { 0x1e, 0x1a, KEY_MEDIA },
  350. { 0x1e, 0x1b, KEY_EPG },
  351. { 0x1e, 0x1c, KEY_TV },
  352. { 0x1e, 0x1e, KEY_NEXT },
  353. { 0x1e, 0x1f, KEY_BACK },
  354. { 0x1e, 0x20, KEY_CHANNELUP },
  355. { 0x1e, 0x21, KEY_CHANNELDOWN },
  356. { 0x1e, 0x24, KEY_LAST }, /* Skip backwards */
  357. { 0x1e, 0x25, KEY_OK },
  358. { 0x1e, 0x29, KEY_BLUE},
  359. { 0x1e, 0x2e, KEY_GREEN },
  360. { 0x1e, 0x30, KEY_PAUSE },
  361. { 0x1e, 0x32, KEY_REWIND },
  362. { 0x1e, 0x34, KEY_FASTFORWARD },
  363. { 0x1e, 0x35, KEY_PLAY },
  364. { 0x1e, 0x36, KEY_STOP },
  365. { 0x1e, 0x37, KEY_RECORD },
  366. { 0x1e, 0x38, KEY_YELLOW },
  367. { 0x1e, 0x3b, KEY_GOTO },
  368. { 0x1e, 0x3d, KEY_POWER },
  369. };
  370. /* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */
  371. static struct dibx000_agc_config stk7700p_7000m_mt2060_agc_config = {
  372. BAND_UHF | BAND_VHF, // band_caps
  373. /* 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,
  374. * 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 */
  375. (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup
  376. 712, // inv_gain
  377. 41, // time_stabiliz
  378. 0, // alpha_level
  379. 118, // thlock
  380. 0, // wbd_inv
  381. 4095, // wbd_ref
  382. 0, // wbd_sel
  383. 0, // wbd_alpha
  384. 42598, // agc1_max
  385. 17694, // agc1_min
  386. 45875, // agc2_max
  387. 2621, // agc2_min
  388. 0, // agc1_pt1
  389. 76, // agc1_pt2
  390. 139, // agc1_pt3
  391. 52, // agc1_slope1
  392. 59, // agc1_slope2
  393. 107, // agc2_pt1
  394. 172, // agc2_pt2
  395. 57, // agc2_slope1
  396. 70, // agc2_slope2
  397. 21, // alpha_mant
  398. 25, // alpha_exp
  399. 28, // beta_mant
  400. 48, // beta_exp
  401. 1, // perform_agc_softsplit
  402. { 0, // split_min
  403. 107, // split_max
  404. 51800, // global_split_min
  405. 24700 // global_split_max
  406. },
  407. };
  408. static struct dibx000_agc_config stk7700p_7000p_mt2060_agc_config = {
  409. BAND_UHF | BAND_VHF,
  410. /* 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,
  411. * 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 */
  412. (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), // setup
  413. 712, // inv_gain
  414. 41, // time_stabiliz
  415. 0, // alpha_level
  416. 118, // thlock
  417. 0, // wbd_inv
  418. 4095, // wbd_ref
  419. 0, // wbd_sel
  420. 0, // wbd_alpha
  421. 42598, // agc1_max
  422. 16384, // agc1_min
  423. 42598, // agc2_max
  424. 0, // agc2_min
  425. 0, // agc1_pt1
  426. 137, // agc1_pt2
  427. 255, // agc1_pt3
  428. 0, // agc1_slope1
  429. 255, // agc1_slope2
  430. 0, // agc2_pt1
  431. 0, // agc2_pt2
  432. 0, // agc2_slope1
  433. 41, // agc2_slope2
  434. 15, // alpha_mant
  435. 25, // alpha_exp
  436. 28, // beta_mant
  437. 48, // beta_exp
  438. 0, // perform_agc_softsplit
  439. };
  440. static struct dibx000_bandwidth_config stk7700p_pll_config = {
  441. 60000, 30000, // internal, sampling
  442. 1, 8, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass
  443. 0, 0, 1, 1, 0, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo
  444. (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k
  445. 60258167, // ifreq
  446. 20452225, // timf
  447. 30000000, // xtal
  448. };
  449. static struct dib7000m_config stk7700p_dib7000m_config = {
  450. .dvbt_mode = 1,
  451. .output_mpeg2_in_188_bytes = 1,
  452. .quartz_direct = 1,
  453. .agc_config_count = 1,
  454. .agc = &stk7700p_7000m_mt2060_agc_config,
  455. .bw = &stk7700p_pll_config,
  456. .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS,
  457. .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES,
  458. .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS,
  459. };
  460. static struct dib7000p_config stk7700p_dib7000p_config = {
  461. .output_mpeg2_in_188_bytes = 1,
  462. .agc_config_count = 1,
  463. .agc = &stk7700p_7000p_mt2060_agc_config,
  464. .bw = &stk7700p_pll_config,
  465. .gpio_dir = DIB7000M_GPIO_DEFAULT_DIRECTIONS,
  466. .gpio_val = DIB7000M_GPIO_DEFAULT_VALUES,
  467. .gpio_pwm_pos = DIB7000M_GPIO_DEFAULT_PWM_POS,
  468. };
  469. static int stk7700p_frontend_attach(struct dvb_usb_adapter *adap)
  470. {
  471. struct dib0700_state *st = adap->dev->priv;
  472. /* unless there is no real power management in DVB - we leave the device on GPIO6 */
  473. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
  474. dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(50);
  475. dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10);
  476. dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
  477. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10);
  478. dib0700_ctrl_clock(adap->dev, 72, 1);
  479. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(100);
  480. dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
  481. st->mt2060_if1[0] = 1220;
  482. if (dib7000pc_detection(&adap->dev->i2c_adap)) {
  483. adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000p_config);
  484. st->is_dib7000pc = 1;
  485. } else
  486. adap->fe = dvb_attach(dib7000m_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000m_config);
  487. return adap->fe == NULL ? -ENODEV : 0;
  488. }
  489. static struct mt2060_config stk7700p_mt2060_config = {
  490. 0x60
  491. };
  492. static int stk7700p_tuner_attach(struct dvb_usb_adapter *adap)
  493. {
  494. struct dib0700_state *st = adap->dev->priv;
  495. struct i2c_adapter *tun_i2c;
  496. if (st->is_dib7000pc)
  497. tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1);
  498. else
  499. tun_i2c = dib7000m_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1);
  500. return dvb_attach(mt2060_attach, adap->fe, tun_i2c, &stk7700p_mt2060_config,
  501. st->mt2060_if1[0]) == NULL ? -ENODEV : 0;
  502. }
  503. /* DIB7070 generic */
  504. static struct dibx000_agc_config dib7070_agc_config = {
  505. BAND_UHF | BAND_VHF | BAND_LBAND | BAND_SBAND,
  506. /* 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,
  507. * 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 */
  508. (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), // setup
  509. 600, // inv_gain
  510. 10, // time_stabiliz
  511. 0, // alpha_level
  512. 118, // thlock
  513. 0, // wbd_inv
  514. 3530, // wbd_ref
  515. 1, // wbd_sel
  516. 5, // wbd_alpha
  517. 65535, // agc1_max
  518. 0, // agc1_min
  519. 65535, // agc2_max
  520. 0, // agc2_min
  521. 0, // agc1_pt1
  522. 40, // agc1_pt2
  523. 183, // agc1_pt3
  524. 206, // agc1_slope1
  525. 255, // agc1_slope2
  526. 72, // agc2_pt1
  527. 152, // agc2_pt2
  528. 88, // agc2_slope1
  529. 90, // agc2_slope2
  530. 17, // alpha_mant
  531. 27, // alpha_exp
  532. 23, // beta_mant
  533. 51, // beta_exp
  534. 0, // perform_agc_softsplit
  535. };
  536. static int dib7070_tuner_reset(struct dvb_frontend *fe, int onoff)
  537. {
  538. return dib7000p_set_gpio(fe, 8, 0, !onoff);
  539. }
  540. static int dib7070_tuner_sleep(struct dvb_frontend *fe, int onoff)
  541. {
  542. return dib7000p_set_gpio(fe, 9, 0, onoff);
  543. }
  544. static struct dib0070_config dib7070p_dib0070_config[2] = {
  545. {
  546. .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS,
  547. .reset = dib7070_tuner_reset,
  548. .sleep = dib7070_tuner_sleep,
  549. .clock_khz = 12000,
  550. .clock_pad_drive = 4
  551. }, {
  552. .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS,
  553. .reset = dib7070_tuner_reset,
  554. .sleep = dib7070_tuner_sleep,
  555. .clock_khz = 12000,
  556. }
  557. };
  558. static int dib7070_set_param_override(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep)
  559. {
  560. struct dvb_usb_adapter *adap = fe->dvb->priv;
  561. struct dib0700_adapter_state *state = adap->priv;
  562. u16 offset;
  563. u8 band = BAND_OF_FREQUENCY(fep->frequency/1000);
  564. switch (band) {
  565. case BAND_VHF: offset = 950; break;
  566. case BAND_UHF:
  567. default: offset = 550; break;
  568. }
  569. deb_info("WBD for DiB7000P: %d\n", offset + dib0070_wbd_offset(fe));
  570. dib7000p_set_wbd_ref(fe, offset + dib0070_wbd_offset(fe));
  571. return state->set_param_save(fe, fep);
  572. }
  573. static int dib7070p_tuner_attach(struct dvb_usb_adapter *adap)
  574. {
  575. struct dib0700_adapter_state *st = adap->priv;
  576. struct i2c_adapter *tun_i2c = dib7000p_get_i2c_master(adap->fe, DIBX000_I2C_INTERFACE_TUNER, 1);
  577. if (adap->id == 0) {
  578. if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, &dib7070p_dib0070_config[0]) == NULL)
  579. return -ENODEV;
  580. } else {
  581. if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, &dib7070p_dib0070_config[1]) == NULL)
  582. return -ENODEV;
  583. }
  584. st->set_param_save = adap->fe->ops.tuner_ops.set_params;
  585. adap->fe->ops.tuner_ops.set_params = dib7070_set_param_override;
  586. return 0;
  587. }
  588. static struct dibx000_bandwidth_config dib7070_bw_config_12_mhz = {
  589. 60000, 15000, // internal, sampling
  590. 1, 20, 3, 1, 0, // pll_cfg: prediv, ratio, range, reset, bypass
  591. 0, 0, 1, 1, 2, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo
  592. (3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k
  593. (0 << 25) | 0, // ifreq = 0.000000 MHz
  594. 20452225, // timf
  595. 12000000, // xtal_hz
  596. };
  597. static struct dib7000p_config dib7070p_dib7000p_config = {
  598. .output_mpeg2_in_188_bytes = 1,
  599. .agc_config_count = 1,
  600. .agc = &dib7070_agc_config,
  601. .bw = &dib7070_bw_config_12_mhz,
  602. .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
  603. .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
  604. .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
  605. .hostbus_diversity = 1,
  606. };
  607. /* STK7070P */
  608. static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap)
  609. {
  610. dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
  611. msleep(10);
  612. dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
  613. dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
  614. dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
  615. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
  616. dib0700_ctrl_clock(adap->dev, 72, 1);
  617. msleep(10);
  618. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
  619. msleep(10);
  620. dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
  621. dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, &dib7070p_dib7000p_config);
  622. adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, &dib7070p_dib7000p_config);
  623. return adap->fe == NULL ? -ENODEV : 0;
  624. }
  625. /* STK7070PD */
  626. static struct dib7000p_config stk7070pd_dib7000p_config[2] = {
  627. {
  628. .output_mpeg2_in_188_bytes = 1,
  629. .agc_config_count = 1,
  630. .agc = &dib7070_agc_config,
  631. .bw = &dib7070_bw_config_12_mhz,
  632. .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
  633. .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
  634. .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
  635. .hostbus_diversity = 1,
  636. }, {
  637. .output_mpeg2_in_188_bytes = 1,
  638. .agc_config_count = 1,
  639. .agc = &dib7070_agc_config,
  640. .bw = &dib7070_bw_config_12_mhz,
  641. .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
  642. .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
  643. .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
  644. .hostbus_diversity = 1,
  645. }
  646. };
  647. static int stk7070pd_frontend_attach0(struct dvb_usb_adapter *adap)
  648. {
  649. dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
  650. msleep(10);
  651. dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
  652. dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
  653. dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
  654. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
  655. dib0700_ctrl_clock(adap->dev, 72, 1);
  656. msleep(10);
  657. dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
  658. msleep(10);
  659. dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
  660. dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 2, 18, stk7070pd_dib7000p_config);
  661. adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, &stk7070pd_dib7000p_config[0]);
  662. return adap->fe == NULL ? -ENODEV : 0;
  663. }
  664. static int stk7070pd_frontend_attach1(struct dvb_usb_adapter *adap)
  665. {
  666. adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x82, &stk7070pd_dib7000p_config[1]);
  667. return adap->fe == NULL ? -ENODEV : 0;
  668. }
  669. /* DVB-USB and USB stuff follows */
  670. struct usb_device_id dib0700_usb_id_table[] = {
  671. /* 0 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P) },
  672. { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P_PC) },
  673. { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500) },
  674. { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500_2) },
  675. { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK) },
  676. /* 5 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR) },
  677. { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500) },
  678. { USB_DEVICE(USB_VID_UNIWILL, USB_PID_UNIWILL_STK7700P) },
  679. { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_STK7700P) },
  680. { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_STICK_2) },
  681. /* 10 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR_2) },
  682. { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV2000E) },
  683. { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY) },
  684. { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_TD_STICK) },
  685. { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700D) },
  686. /* 15 */{ USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070P) },
  687. { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV_DVB_T_FLASH) },
  688. { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7070PD) },
  689. { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T) },
  690. { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_VIDEOMATE_U500_PC) },
  691. /* 20 */{ USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_EXPRESS) },
  692. { 0 } /* Terminating entry */
  693. };
  694. MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table);
  695. #define DIB0700_DEFAULT_DEVICE_PROPERTIES \
  696. .caps = DVB_USB_IS_AN_I2C_ADAPTER, \
  697. .usb_ctrl = DEVICE_SPECIFIC, \
  698. .firmware = "dvb-usb-dib0700-03-pre1.fw", \
  699. .download_firmware = dib0700_download_firmware, \
  700. .no_reconnect = 1, \
  701. .size_of_priv = sizeof(struct dib0700_state), \
  702. .i2c_algo = &dib0700_i2c_algo, \
  703. .identify_state = dib0700_identify_state
  704. #define DIB0700_DEFAULT_STREAMING_CONFIG(ep) \
  705. .streaming_ctrl = dib0700_streaming_ctrl, \
  706. .stream = { \
  707. .type = USB_BULK, \
  708. .count = 4, \
  709. .endpoint = ep, \
  710. .u = { \
  711. .bulk = { \
  712. .buffersize = 39480, \
  713. } \
  714. } \
  715. }
  716. struct dvb_usb_device_properties dib0700_devices[] = {
  717. {
  718. DIB0700_DEFAULT_DEVICE_PROPERTIES,
  719. .num_adapters = 1,
  720. .adapter = {
  721. {
  722. .frontend_attach = stk7700p_frontend_attach,
  723. .tuner_attach = stk7700p_tuner_attach,
  724. DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
  725. },
  726. },
  727. .num_device_descs = 7,
  728. .devices = {
  729. { "DiBcom STK7700P reference design",
  730. { &dib0700_usb_id_table[0], &dib0700_usb_id_table[1] },
  731. { NULL },
  732. },
  733. { "Hauppauge Nova-T Stick",
  734. { &dib0700_usb_id_table[4], &dib0700_usb_id_table[9], NULL },
  735. { NULL },
  736. },
  737. { "AVerMedia AVerTV DVB-T Volar",
  738. { &dib0700_usb_id_table[5], &dib0700_usb_id_table[10] },
  739. { NULL },
  740. },
  741. { "Compro Videomate U500",
  742. { &dib0700_usb_id_table[6], &dib0700_usb_id_table[19] },
  743. { NULL },
  744. },
  745. { "Uniwill STK7700P based (Hama and others)",
  746. { &dib0700_usb_id_table[7], NULL },
  747. { NULL },
  748. },
  749. { "Leadtek Winfast DTV Dongle (STK7700P based)",
  750. { &dib0700_usb_id_table[8], NULL },
  751. { NULL },
  752. },
  753. { "AVerMedia AVerTV DVB-T Express",
  754. { &dib0700_usb_id_table[20] },
  755. { NULL },
  756. }
  757. },
  758. .rc_interval = DEFAULT_RC_INTERVAL,
  759. .rc_key_map = dib0700_rc_keys,
  760. .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys),
  761. .rc_query = dib0700_rc_query
  762. }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
  763. .num_adapters = 2,
  764. .adapter = {
  765. {
  766. .frontend_attach = bristol_frontend_attach,
  767. .tuner_attach = bristol_tuner_attach,
  768. DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
  769. }, {
  770. .frontend_attach = bristol_frontend_attach,
  771. .tuner_attach = bristol_tuner_attach,
  772. DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
  773. }
  774. },
  775. .num_device_descs = 1,
  776. .devices = {
  777. { "Hauppauge Nova-T 500 Dual DVB-T",
  778. { &dib0700_usb_id_table[2], &dib0700_usb_id_table[3], NULL },
  779. { NULL },
  780. },
  781. },
  782. .rc_interval = DEFAULT_RC_INTERVAL,
  783. .rc_key_map = dib0700_rc_keys,
  784. .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys),
  785. .rc_query = dib0700_rc_query
  786. }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
  787. .num_adapters = 2,
  788. .adapter = {
  789. {
  790. .frontend_attach = stk7700d_frontend_attach,
  791. .tuner_attach = stk7700d_tuner_attach,
  792. DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
  793. }, {
  794. .frontend_attach = stk7700d_frontend_attach,
  795. .tuner_attach = stk7700d_tuner_attach,
  796. DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
  797. }
  798. },
  799. .num_device_descs = 4,
  800. .devices = {
  801. { "Pinnacle PCTV 2000e",
  802. { &dib0700_usb_id_table[11], NULL },
  803. { NULL },
  804. },
  805. { "Terratec Cinergy DT XS Diversity",
  806. { &dib0700_usb_id_table[12], NULL },
  807. { NULL },
  808. },
  809. { "Hauppauge Nova-TD Stick/Elgato Eye-TV Diversity",
  810. { &dib0700_usb_id_table[13], NULL },
  811. { NULL },
  812. },
  813. { "DiBcom STK7700D reference design",
  814. { &dib0700_usb_id_table[14], NULL },
  815. { NULL },
  816. },
  817. },
  818. .rc_interval = DEFAULT_RC_INTERVAL,
  819. .rc_key_map = dib0700_rc_keys,
  820. .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys),
  821. .rc_query = dib0700_rc_query
  822. }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
  823. .num_adapters = 1,
  824. .adapter = {
  825. {
  826. .frontend_attach = stk7070p_frontend_attach,
  827. .tuner_attach = dib7070p_tuner_attach,
  828. DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
  829. .size_of_priv = sizeof(struct dib0700_adapter_state),
  830. },
  831. },
  832. .num_device_descs = 2,
  833. .devices = {
  834. { "DiBcom STK7070P reference design",
  835. { &dib0700_usb_id_table[15], NULL },
  836. { NULL },
  837. },
  838. { "Pinnacle PCTV DVB-T Flash Stick",
  839. { &dib0700_usb_id_table[16], NULL },
  840. { NULL },
  841. },
  842. }
  843. }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
  844. .num_adapters = 2,
  845. .adapter = {
  846. {
  847. .frontend_attach = stk7070pd_frontend_attach0,
  848. .tuner_attach = dib7070p_tuner_attach,
  849. DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
  850. .size_of_priv = sizeof(struct dib0700_adapter_state),
  851. }, {
  852. .frontend_attach = stk7070pd_frontend_attach1,
  853. .tuner_attach = dib7070p_tuner_attach,
  854. DIB0700_DEFAULT_STREAMING_CONFIG(0x03),
  855. .size_of_priv = sizeof(struct dib0700_adapter_state),
  856. }
  857. },
  858. .num_device_descs = 2,
  859. .devices = {
  860. { "DiBcom STK7070PD reference design",
  861. { &dib0700_usb_id_table[17], NULL },
  862. { NULL },
  863. },
  864. { "Pinnacle PCTV Dual DVB-T Diversity Stick",
  865. { &dib0700_usb_id_table[18], NULL },
  866. { NULL },
  867. },
  868. }
  869. },
  870. };
  871. int dib0700_device_count = ARRAY_SIZE(dib0700_devices);