nxt2002.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706
  1. /*
  2. Support for B2C2/BBTI Technisat Air2PC - ATSC
  3. Copyright (C) 2004 Taylor Jacob <rtjacob@earthlink.net>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. */
  16. /*
  17. * This driver needs external firmware. Please use the command
  18. * "<kerneldir>/Documentation/dvb/get_dvb_firmware nxt2002" to
  19. * download/extract it, and then copy it to /usr/lib/hotplug/firmware
  20. * or /lib/firmware (depending on configuration of firmware hotplug).
  21. */
  22. #define NXT2002_DEFAULT_FIRMWARE "dvb-fe-nxt2002.fw"
  23. #define CRC_CCIT_MASK 0x1021
  24. #include <linux/init.h>
  25. #include <linux/module.h>
  26. #include <linux/moduleparam.h>
  27. #include <linux/device.h>
  28. #include <linux/firmware.h>
  29. #include <linux/string.h>
  30. #include <linux/slab.h>
  31. #include "dvb_frontend.h"
  32. #include "nxt2002.h"
  33. struct nxt2002_state {
  34. struct i2c_adapter* i2c;
  35. struct dvb_frontend_ops ops;
  36. const struct nxt2002_config* config;
  37. struct dvb_frontend frontend;
  38. /* demodulator private data */
  39. u8 initialised:1;
  40. };
  41. static int debug;
  42. #define dprintk(args...) \
  43. do { \
  44. if (debug) printk(KERN_DEBUG "nxt2002: " args); \
  45. } while (0)
  46. static int i2c_writebytes (struct nxt2002_state* state, u8 reg, u8 *buf, u8 len)
  47. {
  48. /* probbably a much better way or doing this */
  49. u8 buf2 [256],x;
  50. int err;
  51. struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf2, .len = len + 1 };
  52. buf2[0] = reg;
  53. for (x = 0 ; x < len ; x++)
  54. buf2[x+1] = buf[x];
  55. if ((err = i2c_transfer (state->i2c, &msg, 1)) != 1) {
  56. printk ("%s: i2c write error (addr %02x, err == %i)\n",
  57. __FUNCTION__, state->config->demod_address, err);
  58. return -EREMOTEIO;
  59. }
  60. return 0;
  61. }
  62. static u8 i2c_readbytes (struct nxt2002_state* state, u8 reg, u8* buf, u8 len)
  63. {
  64. u8 reg2 [] = { reg };
  65. struct i2c_msg msg [] = { { .addr = state->config->demod_address, .flags = 0, .buf = reg2, .len = 1 },
  66. { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = buf, .len = len } };
  67. int err;
  68. if ((err = i2c_transfer (state->i2c, msg, 2)) != 2) {
  69. printk ("%s: i2c read error (addr %02x, err == %i)\n",
  70. __FUNCTION__, state->config->demod_address, err);
  71. return -EREMOTEIO;
  72. }
  73. return 0;
  74. }
  75. static u16 nxt2002_crc(u16 crc, u8 c)
  76. {
  77. u8 i;
  78. u16 input = (u16) c & 0xFF;
  79. input<<=8;
  80. for(i=0 ;i<8 ;i++) {
  81. if((crc ^ input) & 0x8000)
  82. crc=(crc<<1)^CRC_CCIT_MASK;
  83. else
  84. crc<<=1;
  85. input<<=1;
  86. }
  87. return crc;
  88. }
  89. static int nxt2002_writereg_multibyte (struct nxt2002_state* state, u8 reg, u8* data, u8 len)
  90. {
  91. u8 buf;
  92. dprintk("%s\n", __FUNCTION__);
  93. /* set multi register length */
  94. i2c_writebytes(state,0x34,&len,1);
  95. /* set mutli register register */
  96. i2c_writebytes(state,0x35,&reg,1);
  97. /* send the actual data */
  98. i2c_writebytes(state,0x36,data,len);
  99. /* toggle the multireg write bit*/
  100. buf = 0x02;
  101. i2c_writebytes(state,0x21,&buf,1);
  102. i2c_readbytes(state,0x21,&buf,1);
  103. if ((buf & 0x02) == 0)
  104. return 0;
  105. dprintk("Error writing multireg register %02X\n",reg);
  106. return 0;
  107. }
  108. static int nxt2002_readreg_multibyte (struct nxt2002_state* state, u8 reg, u8* data, u8 len)
  109. {
  110. u8 len2;
  111. dprintk("%s\n", __FUNCTION__);
  112. /* set multi register length */
  113. len2 = len & 0x80;
  114. i2c_writebytes(state,0x34,&len2,1);
  115. /* set mutli register register */
  116. i2c_writebytes(state,0x35,&reg,1);
  117. /* send the actual data */
  118. i2c_readbytes(state,reg,data,len);
  119. return 0;
  120. }
  121. static void nxt2002_microcontroller_stop (struct nxt2002_state* state)
  122. {
  123. u8 buf[2],counter = 0;
  124. dprintk("%s\n", __FUNCTION__);
  125. buf[0] = 0x80;
  126. i2c_writebytes(state,0x22,buf,1);
  127. while (counter < 20) {
  128. i2c_readbytes(state,0x31,buf,1);
  129. if (buf[0] & 0x40)
  130. return;
  131. msleep(10);
  132. counter++;
  133. }
  134. dprintk("Timeout waiting for micro to stop.. This is ok after firmware upload\n");
  135. return;
  136. }
  137. static void nxt2002_microcontroller_start (struct nxt2002_state* state)
  138. {
  139. u8 buf;
  140. dprintk("%s\n", __FUNCTION__);
  141. buf = 0x00;
  142. i2c_writebytes(state,0x22,&buf,1);
  143. }
  144. static int nxt2002_writetuner (struct nxt2002_state* state, u8* data)
  145. {
  146. u8 buf,count = 0;
  147. dprintk("Tuner Bytes: %02X %02X %02X %02X\n",data[0],data[1],data[2],data[3]);
  148. dprintk("%s\n", __FUNCTION__);
  149. /* stop the micro first */
  150. nxt2002_microcontroller_stop(state);
  151. /* set the i2c transfer speed to the tuner */
  152. buf = 0x03;
  153. i2c_writebytes(state,0x20,&buf,1);
  154. /* setup to transfer 4 bytes via i2c */
  155. buf = 0x04;
  156. i2c_writebytes(state,0x34,&buf,1);
  157. /* write actual tuner bytes */
  158. i2c_writebytes(state,0x36,data,4);
  159. /* set tuner i2c address */
  160. buf = 0xC2;
  161. i2c_writebytes(state,0x35,&buf,1);
  162. /* write UC Opmode to begin transfer */
  163. buf = 0x80;
  164. i2c_writebytes(state,0x21,&buf,1);
  165. while (count < 20) {
  166. i2c_readbytes(state,0x21,&buf,1);
  167. if ((buf & 0x80)== 0x00)
  168. return 0;
  169. msleep(100);
  170. count++;
  171. }
  172. printk("nxt2002: timeout error writing tuner\n");
  173. return 0;
  174. }
  175. static void nxt2002_agc_reset(struct nxt2002_state* state)
  176. {
  177. u8 buf;
  178. dprintk("%s\n", __FUNCTION__);
  179. buf = 0x08;
  180. i2c_writebytes(state,0x08,&buf,1);
  181. buf = 0x00;
  182. i2c_writebytes(state,0x08,&buf,1);
  183. return;
  184. }
  185. static int nxt2002_load_firmware (struct dvb_frontend* fe, const struct firmware *fw)
  186. {
  187. struct nxt2002_state* state = fe->demodulator_priv;
  188. u8 buf[256],written = 0,chunkpos = 0;
  189. u16 rambase,position,crc = 0;
  190. dprintk("%s\n", __FUNCTION__);
  191. dprintk("Firmware is %zu bytes\n",fw->size);
  192. /* Get the RAM base for this nxt2002 */
  193. i2c_readbytes(state,0x10,buf,1);
  194. if (buf[0] & 0x10)
  195. rambase = 0x1000;
  196. else
  197. rambase = 0x0000;
  198. dprintk("rambase on this nxt2002 is %04X\n",rambase);
  199. /* Hold the micro in reset while loading firmware */
  200. buf[0] = 0x80;
  201. i2c_writebytes(state,0x2B,buf,1);
  202. for (position = 0; position < fw->size ; position++) {
  203. if (written == 0) {
  204. crc = 0;
  205. chunkpos = 0x28;
  206. buf[0] = ((rambase + position) >> 8);
  207. buf[1] = (rambase + position) & 0xFF;
  208. buf[2] = 0x81;
  209. /* write starting address */
  210. i2c_writebytes(state,0x29,buf,3);
  211. }
  212. written++;
  213. chunkpos++;
  214. if ((written % 4) == 0)
  215. i2c_writebytes(state,chunkpos,&fw->data[position-3],4);
  216. crc = nxt2002_crc(crc,fw->data[position]);
  217. if ((written == 255) || (position+1 == fw->size)) {
  218. /* write remaining bytes of firmware */
  219. i2c_writebytes(state, chunkpos+4-(written %4),
  220. &fw->data[position-(written %4) + 1],
  221. written %4);
  222. buf[0] = crc << 8;
  223. buf[1] = crc & 0xFF;
  224. /* write crc */
  225. i2c_writebytes(state,0x2C,buf,2);
  226. /* do a read to stop things */
  227. i2c_readbytes(state,0x2A,buf,1);
  228. /* set transfer mode to complete */
  229. buf[0] = 0x80;
  230. i2c_writebytes(state,0x2B,buf,1);
  231. written = 0;
  232. }
  233. }
  234. printk ("done.\n");
  235. return 0;
  236. };
  237. static int nxt2002_setup_frontend_parameters (struct dvb_frontend* fe,
  238. struct dvb_frontend_parameters *p)
  239. {
  240. struct nxt2002_state* state = fe->demodulator_priv;
  241. u32 freq = 0;
  242. u16 tunerfreq = 0;
  243. u8 buf[4];
  244. freq = 44000 + ( p->frequency / 1000 );
  245. dprintk("freq = %d p->frequency = %d\n",freq,p->frequency);
  246. tunerfreq = freq * 24/4000;
  247. buf[0] = (tunerfreq >> 8) & 0x7F;
  248. buf[1] = (tunerfreq & 0xFF);
  249. if (p->frequency <= 214000000) {
  250. buf[2] = 0x84 + (0x06 << 3);
  251. buf[3] = (p->frequency <= 172000000) ? 0x01 : 0x02;
  252. } else if (p->frequency <= 721000000) {
  253. buf[2] = 0x84 + (0x07 << 3);
  254. buf[3] = (p->frequency <= 467000000) ? 0x02 : 0x08;
  255. } else if (p->frequency <= 841000000) {
  256. buf[2] = 0x84 + (0x0E << 3);
  257. buf[3] = 0x08;
  258. } else {
  259. buf[2] = 0x84 + (0x0F << 3);
  260. buf[3] = 0x02;
  261. }
  262. /* write frequency information */
  263. nxt2002_writetuner(state,buf);
  264. /* reset the agc now that tuning has been completed */
  265. nxt2002_agc_reset(state);
  266. /* set target power level */
  267. switch (p->u.vsb.modulation) {
  268. case QAM_64:
  269. case QAM_256:
  270. buf[0] = 0x74;
  271. break;
  272. case VSB_8:
  273. buf[0] = 0x70;
  274. break;
  275. default:
  276. return -EINVAL;
  277. break;
  278. }
  279. i2c_writebytes(state,0x42,buf,1);
  280. /* configure sdm */
  281. buf[0] = 0x87;
  282. i2c_writebytes(state,0x57,buf,1);
  283. /* write sdm1 input */
  284. buf[0] = 0x10;
  285. buf[1] = 0x00;
  286. nxt2002_writereg_multibyte(state,0x58,buf,2);
  287. /* write sdmx input */
  288. switch (p->u.vsb.modulation) {
  289. case QAM_64:
  290. buf[0] = 0x68;
  291. break;
  292. case QAM_256:
  293. buf[0] = 0x64;
  294. break;
  295. case VSB_8:
  296. buf[0] = 0x60;
  297. break;
  298. default:
  299. return -EINVAL;
  300. break;
  301. }
  302. buf[1] = 0x00;
  303. nxt2002_writereg_multibyte(state,0x5C,buf,2);
  304. /* write adc power lpf fc */
  305. buf[0] = 0x05;
  306. i2c_writebytes(state,0x43,buf,1);
  307. /* write adc power lpf fc */
  308. buf[0] = 0x05;
  309. i2c_writebytes(state,0x43,buf,1);
  310. /* write accumulator2 input */
  311. buf[0] = 0x80;
  312. buf[1] = 0x00;
  313. nxt2002_writereg_multibyte(state,0x4B,buf,2);
  314. /* write kg1 */
  315. buf[0] = 0x00;
  316. i2c_writebytes(state,0x4D,buf,1);
  317. /* write sdm12 lpf fc */
  318. buf[0] = 0x44;
  319. i2c_writebytes(state,0x55,buf,1);
  320. /* write agc control reg */
  321. buf[0] = 0x04;
  322. i2c_writebytes(state,0x41,buf,1);
  323. /* write agc ucgp0 */
  324. switch (p->u.vsb.modulation) {
  325. case QAM_64:
  326. buf[0] = 0x02;
  327. break;
  328. case QAM_256:
  329. buf[0] = 0x03;
  330. break;
  331. case VSB_8:
  332. buf[0] = 0x00;
  333. break;
  334. default:
  335. return -EINVAL;
  336. break;
  337. }
  338. i2c_writebytes(state,0x30,buf,1);
  339. /* write agc control reg */
  340. buf[0] = 0x00;
  341. i2c_writebytes(state,0x41,buf,1);
  342. /* write accumulator2 input */
  343. buf[0] = 0x80;
  344. buf[1] = 0x00;
  345. nxt2002_writereg_multibyte(state,0x49,buf,2);
  346. nxt2002_writereg_multibyte(state,0x4B,buf,2);
  347. /* write agc control reg */
  348. buf[0] = 0x04;
  349. i2c_writebytes(state,0x41,buf,1);
  350. nxt2002_microcontroller_start(state);
  351. /* adjacent channel detection should be done here, but I don't
  352. have any stations with this need so I cannot test it */
  353. return 0;
  354. }
  355. static int nxt2002_read_status(struct dvb_frontend* fe, fe_status_t* status)
  356. {
  357. struct nxt2002_state* state = fe->demodulator_priv;
  358. u8 lock;
  359. i2c_readbytes(state,0x31,&lock,1);
  360. *status = 0;
  361. if (lock & 0x20) {
  362. *status |= FE_HAS_SIGNAL;
  363. *status |= FE_HAS_CARRIER;
  364. *status |= FE_HAS_VITERBI;
  365. *status |= FE_HAS_SYNC;
  366. *status |= FE_HAS_LOCK;
  367. }
  368. return 0;
  369. }
  370. static int nxt2002_read_ber(struct dvb_frontend* fe, u32* ber)
  371. {
  372. struct nxt2002_state* state = fe->demodulator_priv;
  373. u8 b[3];
  374. nxt2002_readreg_multibyte(state,0xE6,b,3);
  375. *ber = ((b[0] << 8) + b[1]) * 8;
  376. return 0;
  377. }
  378. static int nxt2002_read_signal_strength(struct dvb_frontend* fe, u16* strength)
  379. {
  380. struct nxt2002_state* state = fe->demodulator_priv;
  381. u8 b[2];
  382. u16 temp = 0;
  383. /* setup to read cluster variance */
  384. b[0] = 0x00;
  385. i2c_writebytes(state,0xA1,b,1);
  386. /* get multreg val */
  387. nxt2002_readreg_multibyte(state,0xA6,b,2);
  388. temp = (b[0] << 8) | b[1];
  389. *strength = ((0x7FFF - temp) & 0x0FFF) * 16;
  390. return 0;
  391. }
  392. static int nxt2002_read_snr(struct dvb_frontend* fe, u16* snr)
  393. {
  394. struct nxt2002_state* state = fe->demodulator_priv;
  395. u8 b[2];
  396. u16 temp = 0, temp2;
  397. u32 snrdb = 0;
  398. /* setup to read cluster variance */
  399. b[0] = 0x00;
  400. i2c_writebytes(state,0xA1,b,1);
  401. /* get multreg val from 0xA6 */
  402. nxt2002_readreg_multibyte(state,0xA6,b,2);
  403. temp = (b[0] << 8) | b[1];
  404. temp2 = 0x7FFF - temp;
  405. /* snr will be in db */
  406. if (temp2 > 0x7F00)
  407. snrdb = 1000*24 + ( 1000*(30-24) * ( temp2 - 0x7F00 ) / ( 0x7FFF - 0x7F00 ) );
  408. else if (temp2 > 0x7EC0)
  409. snrdb = 1000*18 + ( 1000*(24-18) * ( temp2 - 0x7EC0 ) / ( 0x7F00 - 0x7EC0 ) );
  410. else if (temp2 > 0x7C00)
  411. snrdb = 1000*12 + ( 1000*(18-12) * ( temp2 - 0x7C00 ) / ( 0x7EC0 - 0x7C00 ) );
  412. else
  413. snrdb = 1000*0 + ( 1000*(12-0) * ( temp2 - 0 ) / ( 0x7C00 - 0 ) );
  414. /* the value reported back from the frontend will be FFFF=32db 0000=0db */
  415. *snr = snrdb * (0xFFFF/32000);
  416. return 0;
  417. }
  418. static int nxt2002_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
  419. {
  420. struct nxt2002_state* state = fe->demodulator_priv;
  421. u8 b[3];
  422. nxt2002_readreg_multibyte(state,0xE6,b,3);
  423. *ucblocks = b[2];
  424. return 0;
  425. }
  426. static int nxt2002_sleep(struct dvb_frontend* fe)
  427. {
  428. return 0;
  429. }
  430. static int nxt2002_init(struct dvb_frontend* fe)
  431. {
  432. struct nxt2002_state* state = fe->demodulator_priv;
  433. const struct firmware *fw;
  434. int ret;
  435. u8 buf[2];
  436. if (!state->initialised) {
  437. /* request the firmware, this will block until someone uploads it */
  438. printk("nxt2002: Waiting for firmware upload (%s)...\n", NXT2002_DEFAULT_FIRMWARE);
  439. ret = state->config->request_firmware(fe, &fw, NXT2002_DEFAULT_FIRMWARE);
  440. printk("nxt2002: Waiting for firmware upload(2)...\n");
  441. if (ret) {
  442. printk("nxt2002: no firmware upload (timeout or file not found?)\n");
  443. return ret;
  444. }
  445. ret = nxt2002_load_firmware(fe, fw);
  446. if (ret) {
  447. printk("nxt2002: writing firmware to device failed\n");
  448. release_firmware(fw);
  449. return ret;
  450. }
  451. printk("nxt2002: firmware upload complete\n");
  452. /* Put the micro into reset */
  453. nxt2002_microcontroller_stop(state);
  454. /* ensure transfer is complete */
  455. buf[0]=0;
  456. i2c_writebytes(state,0x2B,buf,1);
  457. /* Put the micro into reset for real this time */
  458. nxt2002_microcontroller_stop(state);
  459. /* soft reset everything (agc,frontend,eq,fec)*/
  460. buf[0] = 0x0F;
  461. i2c_writebytes(state,0x08,buf,1);
  462. buf[0] = 0x00;
  463. i2c_writebytes(state,0x08,buf,1);
  464. /* write agc sdm configure */
  465. buf[0] = 0xF1;
  466. i2c_writebytes(state,0x57,buf,1);
  467. /* write mod output format */
  468. buf[0] = 0x20;
  469. i2c_writebytes(state,0x09,buf,1);
  470. /* write fec mpeg mode */
  471. buf[0] = 0x7E;
  472. buf[1] = 0x00;
  473. i2c_writebytes(state,0xE9,buf,2);
  474. /* write mux selection */
  475. buf[0] = 0x00;
  476. i2c_writebytes(state,0xCC,buf,1);
  477. state->initialised = 1;
  478. }
  479. return 0;
  480. }
  481. static int nxt2002_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings)
  482. {
  483. fesettings->min_delay_ms = 500;
  484. fesettings->step_size = 0;
  485. fesettings->max_drift = 0;
  486. return 0;
  487. }
  488. static void nxt2002_release(struct dvb_frontend* fe)
  489. {
  490. struct nxt2002_state* state = fe->demodulator_priv;
  491. kfree(state);
  492. }
  493. static struct dvb_frontend_ops nxt2002_ops;
  494. struct dvb_frontend* nxt2002_attach(const struct nxt2002_config* config,
  495. struct i2c_adapter* i2c)
  496. {
  497. struct nxt2002_state* state = NULL;
  498. u8 buf [] = {0,0,0,0,0};
  499. /* allocate memory for the internal state */
  500. state = kmalloc(sizeof(struct nxt2002_state), GFP_KERNEL);
  501. if (state == NULL) goto error;
  502. /* setup the state */
  503. state->config = config;
  504. state->i2c = i2c;
  505. memcpy(&state->ops, &nxt2002_ops, sizeof(struct dvb_frontend_ops));
  506. state->initialised = 0;
  507. /* Check the first 5 registers to ensure this a revision we can handle */
  508. i2c_readbytes(state, 0x00, buf, 5);
  509. if (buf[0] != 0x04) goto error; /* device id */
  510. if (buf[1] != 0x02) goto error; /* fab id */
  511. if (buf[2] != 0x11) goto error; /* month */
  512. if (buf[3] != 0x20) goto error; /* year msb */
  513. if (buf[4] != 0x00) goto error; /* year lsb */
  514. /* create dvb_frontend */
  515. state->frontend.ops = &state->ops;
  516. state->frontend.demodulator_priv = state;
  517. return &state->frontend;
  518. error:
  519. kfree(state);
  520. return NULL;
  521. }
  522. static struct dvb_frontend_ops nxt2002_ops = {
  523. .info = {
  524. .name = "Nextwave nxt2002 VSB/QAM frontend",
  525. .type = FE_ATSC,
  526. .frequency_min = 54000000,
  527. .frequency_max = 860000000,
  528. /* stepsize is just a guess */
  529. .frequency_stepsize = 166666,
  530. .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
  531. FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
  532. FE_CAN_8VSB | FE_CAN_QAM_64 | FE_CAN_QAM_256
  533. },
  534. .release = nxt2002_release,
  535. .init = nxt2002_init,
  536. .sleep = nxt2002_sleep,
  537. .set_frontend = nxt2002_setup_frontend_parameters,
  538. .get_tune_settings = nxt2002_get_tune_settings,
  539. .read_status = nxt2002_read_status,
  540. .read_ber = nxt2002_read_ber,
  541. .read_signal_strength = nxt2002_read_signal_strength,
  542. .read_snr = nxt2002_read_snr,
  543. .read_ucblocks = nxt2002_read_ucblocks,
  544. };
  545. module_param(debug, int, 0644);
  546. MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off).");
  547. MODULE_DESCRIPTION("NXT2002 ATSC (8VSB & ITU J83 AnnexB FEC QAM64/256) demodulator driver");
  548. MODULE_AUTHOR("Taylor Jacob");
  549. MODULE_LICENSE("GPL");
  550. EXPORT_SYMBOL(nxt2002_attach);