or51211.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  1. /*
  2. * Support for OR51211 (pcHDTV HD-2000) - VSB
  3. *
  4. * Copyright (C) 2005 Kirk Lapray <kirk_lapray@bigfoot.com>
  5. *
  6. * Based on code from Jack Kelliher (kelliher@xmission.com)
  7. * Copyright (C) 2002 & pcHDTV, inc.
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  22. *
  23. */
  24. /*
  25. * This driver needs external firmware. Please use the command
  26. * "<kerneldir>/Documentation/dvb/get_dvb_firmware or51211" to
  27. * download/extract it, and then copy it to /usr/lib/hotplug/firmware
  28. * or /lib/firmware (depending on configuration of firmware hotplug).
  29. */
  30. #define OR51211_DEFAULT_FIRMWARE "dvb-fe-or51211.fw"
  31. #include <linux/kernel.h>
  32. #include <linux/module.h>
  33. #include <linux/moduleparam.h>
  34. #include <linux/device.h>
  35. #include <linux/firmware.h>
  36. #include <linux/string.h>
  37. #include <linux/slab.h>
  38. #include <asm/byteorder.h>
  39. #include "dvb_frontend.h"
  40. #include "or51211.h"
  41. static int debug;
  42. #define dprintk(args...) \
  43. do { \
  44. if (debug) printk(KERN_DEBUG "or51211: " args); \
  45. } while (0)
  46. static u8 run_buf[] = {0x7f,0x01};
  47. static u8 cmd_buf[] = {0x04,0x01,0x50,0x80,0x06}; // ATSC
  48. struct or51211_state {
  49. struct i2c_adapter* i2c;
  50. struct dvb_frontend_ops ops;
  51. /* Configuration settings */
  52. const struct or51211_config* config;
  53. struct dvb_frontend frontend;
  54. struct bt878* bt;
  55. /* Demodulator private data */
  56. u8 initialized:1;
  57. /* Tuner private data */
  58. u32 current_frequency;
  59. };
  60. static int i2c_writebytes (struct or51211_state* state, u8 reg, u8 *buf,
  61. int len)
  62. {
  63. int err;
  64. struct i2c_msg msg;
  65. msg.addr = reg;
  66. msg.flags = 0;
  67. msg.len = len;
  68. msg.buf = buf;
  69. if ((err = i2c_transfer (state->i2c, &msg, 1)) != 1) {
  70. printk(KERN_WARNING "or51211: i2c_writebytes error "
  71. "(addr %02x, err == %i)\n", reg, err);
  72. return -EREMOTEIO;
  73. }
  74. return 0;
  75. }
  76. static u8 i2c_readbytes (struct or51211_state* state, u8 reg, u8* buf, int len)
  77. {
  78. int err;
  79. struct i2c_msg msg;
  80. msg.addr = reg;
  81. msg.flags = I2C_M_RD;
  82. msg.len = len;
  83. msg.buf = buf;
  84. if ((err = i2c_transfer (state->i2c, &msg, 1)) != 1) {
  85. printk(KERN_WARNING "or51211: i2c_readbytes error "
  86. "(addr %02x, err == %i)\n", reg, err);
  87. return -EREMOTEIO;
  88. }
  89. return 0;
  90. }
  91. static int or51211_load_firmware (struct dvb_frontend* fe,
  92. const struct firmware *fw)
  93. {
  94. struct or51211_state* state = fe->demodulator_priv;
  95. u8 tudata[585];
  96. int i;
  97. dprintk("Firmware is %zd bytes\n",fw->size);
  98. /* Get eprom data */
  99. tudata[0] = 17;
  100. if (i2c_writebytes(state,0x50,tudata,1)) {
  101. printk(KERN_WARNING "or51211:load_firmware error eprom addr\n");
  102. return -1;
  103. }
  104. if (i2c_readbytes(state,0x50,&tudata[145],192)) {
  105. printk(KERN_WARNING "or51211: load_firmware error eprom\n");
  106. return -1;
  107. }
  108. /* Create firmware buffer */
  109. for (i = 0; i < 145; i++)
  110. tudata[i] = fw->data[i];
  111. for (i = 0; i < 248; i++)
  112. tudata[i+337] = fw->data[145+i];
  113. state->config->reset(fe);
  114. if (i2c_writebytes(state,state->config->demod_address,tudata,585)) {
  115. printk(KERN_WARNING "or51211: load_firmware error 1\n");
  116. return -1;
  117. }
  118. msleep(1);
  119. if (i2c_writebytes(state,state->config->demod_address,
  120. &fw->data[393],8125)) {
  121. printk(KERN_WARNING "or51211: load_firmware error 2\n");
  122. return -1;
  123. }
  124. msleep(1);
  125. if (i2c_writebytes(state,state->config->demod_address,run_buf,2)) {
  126. printk(KERN_WARNING "or51211: load_firmware error 3\n");
  127. return -1;
  128. }
  129. /* Wait at least 5 msec */
  130. msleep(10);
  131. if (i2c_writebytes(state,state->config->demod_address,run_buf,2)) {
  132. printk(KERN_WARNING "or51211: load_firmware error 4\n");
  133. return -1;
  134. }
  135. msleep(10);
  136. printk("or51211: Done.\n");
  137. return 0;
  138. };
  139. static int or51211_setmode(struct dvb_frontend* fe, int mode)
  140. {
  141. struct or51211_state* state = fe->demodulator_priv;
  142. u8 rec_buf[14];
  143. state->config->setmode(fe, mode);
  144. if (i2c_writebytes(state,state->config->demod_address,run_buf,2)) {
  145. printk(KERN_WARNING "or51211: setmode error 1\n");
  146. return -1;
  147. }
  148. /* Wait at least 5 msec */
  149. msleep(10);
  150. if (i2c_writebytes(state,state->config->demod_address,run_buf,2)) {
  151. printk(KERN_WARNING "or51211: setmode error 2\n");
  152. return -1;
  153. }
  154. msleep(10);
  155. /* Set operation mode in Receiver 1 register;
  156. * type 1:
  157. * data 0x50h Automatic sets receiver channel conditions
  158. * Automatic NTSC rejection filter
  159. * Enable MPEG serial data output
  160. * MPEG2tr
  161. * High tuner phase noise
  162. * normal +/-150kHz Carrier acquisition range
  163. */
  164. if (i2c_writebytes(state,state->config->demod_address,cmd_buf,3)) {
  165. printk(KERN_WARNING "or51211: setmode error 3\n");
  166. return -1;
  167. }
  168. rec_buf[0] = 0x04;
  169. rec_buf[1] = 0x00;
  170. rec_buf[2] = 0x03;
  171. rec_buf[3] = 0x00;
  172. msleep(20);
  173. if (i2c_writebytes(state,state->config->demod_address,rec_buf,3)) {
  174. printk(KERN_WARNING "or51211: setmode error 5\n");
  175. }
  176. msleep(3);
  177. if (i2c_readbytes(state,state->config->demod_address,&rec_buf[10],2)) {
  178. printk(KERN_WARNING "or51211: setmode error 6");
  179. return -1;
  180. }
  181. dprintk("setmode rec status %02x %02x\n",rec_buf[10],rec_buf[11]);
  182. return 0;
  183. }
  184. static int or51211_set_parameters(struct dvb_frontend* fe,
  185. struct dvb_frontend_parameters *param)
  186. {
  187. struct or51211_state* state = fe->demodulator_priv;
  188. u32 freq = 0;
  189. u16 tunerfreq = 0;
  190. u8 buf[4];
  191. /* Change only if we are actually changing the channel */
  192. if (state->current_frequency != param->frequency) {
  193. freq = 44000 + (param->frequency/1000);
  194. tunerfreq = freq * 16/1000;
  195. dprintk("set_parameters frequency = %d (tunerfreq = %d)\n",
  196. param->frequency,tunerfreq);
  197. buf[0] = (tunerfreq >> 8) & 0x7F;
  198. buf[1] = (tunerfreq & 0xFF);
  199. buf[2] = 0x8E;
  200. if (param->frequency < 157250000) {
  201. buf[3] = 0xA0;
  202. dprintk("set_parameters VHF low range\n");
  203. } else if (param->frequency < 454000000) {
  204. buf[3] = 0x90;
  205. dprintk("set_parameters VHF high range\n");
  206. } else {
  207. buf[3] = 0x30;
  208. dprintk("set_parameters UHF range\n");
  209. }
  210. dprintk("set_parameters tuner bytes: 0x%02x 0x%02x "
  211. "0x%02x 0x%02x\n",buf[0],buf[1],buf[2],buf[3]);
  212. if (i2c_writebytes(state,0xC2>>1,buf,4))
  213. printk(KERN_WARNING "or51211:set_parameters error "
  214. "writing to tuner\n");
  215. /* Set to ATSC mode */
  216. or51211_setmode(fe,0);
  217. /* Update current frequency */
  218. state->current_frequency = param->frequency;
  219. }
  220. return 0;
  221. }
  222. static int or51211_read_status(struct dvb_frontend* fe, fe_status_t* status)
  223. {
  224. struct or51211_state* state = fe->demodulator_priv;
  225. unsigned char rec_buf[2];
  226. unsigned char snd_buf[] = {0x04,0x00,0x03,0x00};
  227. *status = 0;
  228. /* Receiver Status */
  229. if (i2c_writebytes(state,state->config->demod_address,snd_buf,3)) {
  230. printk(KERN_WARNING "or51132: read_status write error\n");
  231. return -1;
  232. }
  233. msleep(3);
  234. if (i2c_readbytes(state,state->config->demod_address,rec_buf,2)) {
  235. printk(KERN_WARNING "or51132: read_status read error\n");
  236. return -1;
  237. }
  238. dprintk("read_status %x %x\n",rec_buf[0],rec_buf[1]);
  239. if (rec_buf[0] & 0x01) { /* Receiver Lock */
  240. *status |= FE_HAS_SIGNAL;
  241. *status |= FE_HAS_CARRIER;
  242. *status |= FE_HAS_VITERBI;
  243. *status |= FE_HAS_SYNC;
  244. *status |= FE_HAS_LOCK;
  245. }
  246. return 0;
  247. }
  248. /* log10-1 table at .5 increments from 1 to 100.5 */
  249. static unsigned int i100x20log10[] = {
  250. 0, 352, 602, 795, 954, 1088, 1204, 1306, 1397, 1480,
  251. 1556, 1625, 1690, 1750, 1806, 1858, 1908, 1955, 2000, 2042,
  252. 2082, 2121, 2158, 2193, 2227, 2260, 2292, 2322, 2352, 2380,
  253. 2408, 2434, 2460, 2486, 2510, 2534, 2557, 2580, 2602, 2623,
  254. 2644, 2664, 2684, 2704, 2723, 2742, 2760, 2778, 2795, 2813,
  255. 2829, 2846, 2862, 2878, 2894, 2909, 2924, 2939, 2954, 2968,
  256. 2982, 2996, 3010, 3023, 3037, 3050, 3062, 3075, 3088, 3100,
  257. 3112, 3124, 3136, 3148, 3159, 3170, 3182, 3193, 3204, 3214,
  258. 3225, 3236, 3246, 3256, 3266, 3276, 3286, 3296, 3306, 3316,
  259. 3325, 3334, 3344, 3353, 3362, 3371, 3380, 3389, 3397, 3406,
  260. 3415, 3423, 3432, 3440, 3448, 3456, 3464, 3472, 3480, 3488,
  261. 3496, 3504, 3511, 3519, 3526, 3534, 3541, 3549, 3556, 3563,
  262. 3570, 3577, 3584, 3591, 3598, 3605, 3612, 3619, 3625, 3632,
  263. 3639, 3645, 3652, 3658, 3665, 3671, 3677, 3683, 3690, 3696,
  264. 3702, 3708, 3714, 3720, 3726, 3732, 3738, 3744, 3750, 3755,
  265. 3761, 3767, 3772, 3778, 3784, 3789, 3795, 3800, 3806, 3811,
  266. 3816, 3822, 3827, 3832, 3838, 3843, 3848, 3853, 3858, 3863,
  267. 3868, 3874, 3879, 3884, 3888, 3893, 3898, 3903, 3908, 3913,
  268. 3918, 3922, 3927, 3932, 3936, 3941, 3946, 3950, 3955, 3960,
  269. 3964, 3969, 3973, 3978, 3982, 3986, 3991, 3995, 4000, 4004,
  270. };
  271. static unsigned int denom[] = {1,1,100,1000,10000,100000,1000000,10000000,100000000};
  272. static unsigned int i20Log10(unsigned short val)
  273. {
  274. unsigned int rntval = 100;
  275. unsigned int tmp = val;
  276. unsigned int exp = 1;
  277. while(tmp > 100) {tmp /= 100; exp++;}
  278. val = (2 * val)/denom[exp];
  279. if (exp > 1) rntval = 2000*exp;
  280. rntval += i100x20log10[val];
  281. return rntval;
  282. }
  283. static int or51211_read_signal_strength(struct dvb_frontend* fe, u16* strength)
  284. {
  285. struct or51211_state* state = fe->demodulator_priv;
  286. u8 rec_buf[2];
  287. u8 snd_buf[4];
  288. u8 snr_equ;
  289. u32 signal_strength;
  290. /* SNR after Equalizer */
  291. snd_buf[0] = 0x04;
  292. snd_buf[1] = 0x00;
  293. snd_buf[2] = 0x04;
  294. snd_buf[3] = 0x00;
  295. if (i2c_writebytes(state,state->config->demod_address,snd_buf,3)) {
  296. printk(KERN_WARNING "or51211: read_status write error\n");
  297. return -1;
  298. }
  299. msleep(3);
  300. if (i2c_readbytes(state,state->config->demod_address,rec_buf,2)) {
  301. printk(KERN_WARNING "or51211: read_status read error\n");
  302. return -1;
  303. }
  304. snr_equ = rec_buf[0] & 0xff;
  305. /* The value reported back from the frontend will be FFFF=100% 0000=0% */
  306. signal_strength = (((5334 - i20Log10(snr_equ))/3+5)*65535)/1000;
  307. if (signal_strength > 0xffff)
  308. *strength = 0xffff;
  309. else
  310. *strength = signal_strength;
  311. dprintk("read_signal_strength %i\n",*strength);
  312. return 0;
  313. }
  314. static int or51211_read_snr(struct dvb_frontend* fe, u16* snr)
  315. {
  316. struct or51211_state* state = fe->demodulator_priv;
  317. u8 rec_buf[2];
  318. u8 snd_buf[4];
  319. /* SNR after Equalizer */
  320. snd_buf[0] = 0x04;
  321. snd_buf[1] = 0x00;
  322. snd_buf[2] = 0x04;
  323. snd_buf[3] = 0x00;
  324. if (i2c_writebytes(state,state->config->demod_address,snd_buf,3)) {
  325. printk(KERN_WARNING "or51211: read_status write error\n");
  326. return -1;
  327. }
  328. msleep(3);
  329. if (i2c_readbytes(state,state->config->demod_address,rec_buf,2)) {
  330. printk(KERN_WARNING "or51211: read_status read error\n");
  331. return -1;
  332. }
  333. *snr = rec_buf[0] & 0xff;
  334. dprintk("read_snr %i\n",*snr);
  335. return 0;
  336. }
  337. static int or51211_read_ber(struct dvb_frontend* fe, u32* ber)
  338. {
  339. *ber = -ENOSYS;
  340. return 0;
  341. }
  342. static int or51211_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
  343. {
  344. *ucblocks = -ENOSYS;
  345. return 0;
  346. }
  347. static int or51211_sleep(struct dvb_frontend* fe)
  348. {
  349. return 0;
  350. }
  351. static int or51211_init(struct dvb_frontend* fe)
  352. {
  353. struct or51211_state* state = fe->demodulator_priv;
  354. const struct or51211_config* config = state->config;
  355. const struct firmware* fw;
  356. unsigned char get_ver_buf[] = {0x04,0x00,0x30,0x00,0x00};
  357. unsigned char rec_buf[14];
  358. int ret,i;
  359. if (!state->initialized) {
  360. /* Request the firmware, this will block until it uploads */
  361. printk(KERN_INFO "or51211: Waiting for firmware upload "
  362. "(%s)...\n", OR51211_DEFAULT_FIRMWARE);
  363. ret = config->request_firmware(fe, &fw,
  364. OR51211_DEFAULT_FIRMWARE);
  365. printk(KERN_INFO "or51211:Got Hotplug firmware\n");
  366. if (ret) {
  367. printk(KERN_WARNING "or51211: No firmware uploaded "
  368. "(timeout or file not found?)\n");
  369. return ret;
  370. }
  371. ret = or51211_load_firmware(fe, fw);
  372. if (ret) {
  373. printk(KERN_WARNING "or51211: Writing firmware to "
  374. "device failed!\n");
  375. release_firmware(fw);
  376. return ret;
  377. }
  378. printk(KERN_INFO "or51211: Firmware upload complete.\n");
  379. /* Set operation mode in Receiver 1 register;
  380. * type 1:
  381. * data 0x50h Automatic sets receiver channel conditions
  382. * Automatic NTSC rejection filter
  383. * Enable MPEG serial data output
  384. * MPEG2tr
  385. * High tuner phase noise
  386. * normal +/-150kHz Carrier acquisition range
  387. */
  388. if (i2c_writebytes(state,state->config->demod_address,
  389. cmd_buf,3)) {
  390. printk(KERN_WARNING "or51211: Load DVR Error 5\n");
  391. return -1;
  392. }
  393. /* Read back ucode version to besure we loaded correctly */
  394. /* and are really up and running */
  395. rec_buf[0] = 0x04;
  396. rec_buf[1] = 0x00;
  397. rec_buf[2] = 0x03;
  398. rec_buf[3] = 0x00;
  399. msleep(30);
  400. if (i2c_writebytes(state,state->config->demod_address,
  401. rec_buf,3)) {
  402. printk(KERN_WARNING "or51211: Load DVR Error A\n");
  403. return -1;
  404. }
  405. msleep(3);
  406. if (i2c_readbytes(state,state->config->demod_address,
  407. &rec_buf[10],2)) {
  408. printk(KERN_WARNING "or51211: Load DVR Error B\n");
  409. return -1;
  410. }
  411. rec_buf[0] = 0x04;
  412. rec_buf[1] = 0x00;
  413. rec_buf[2] = 0x01;
  414. rec_buf[3] = 0x00;
  415. msleep(20);
  416. if (i2c_writebytes(state,state->config->demod_address,
  417. rec_buf,3)) {
  418. printk(KERN_WARNING "or51211: Load DVR Error C\n");
  419. return -1;
  420. }
  421. msleep(3);
  422. if (i2c_readbytes(state,state->config->demod_address,
  423. &rec_buf[12],2)) {
  424. printk(KERN_WARNING "or51211: Load DVR Error D\n");
  425. return -1;
  426. }
  427. for (i = 0; i < 8; i++)
  428. rec_buf[i]=0xed;
  429. for (i = 0; i < 5; i++) {
  430. msleep(30);
  431. get_ver_buf[4] = i+1;
  432. if (i2c_writebytes(state,state->config->demod_address,
  433. get_ver_buf,5)) {
  434. printk(KERN_WARNING "or51211:Load DVR Error 6"
  435. " - %d\n",i);
  436. return -1;
  437. }
  438. msleep(3);
  439. if (i2c_readbytes(state,state->config->demod_address,
  440. &rec_buf[i*2],2)) {
  441. printk(KERN_WARNING "or51211:Load DVR Error 7"
  442. " - %d\n",i);
  443. return -1;
  444. }
  445. /* If we didn't receive the right index, try again */
  446. if ((int)rec_buf[i*2+1]!=i+1){
  447. i--;
  448. }
  449. }
  450. dprintk("read_fwbits %x %x %x %x %x %x %x %x %x %x\n",
  451. rec_buf[0], rec_buf[1], rec_buf[2], rec_buf[3],
  452. rec_buf[4], rec_buf[5], rec_buf[6], rec_buf[7],
  453. rec_buf[8], rec_buf[9]);
  454. printk(KERN_INFO "or51211: ver TU%02x%02x%02x VSB mode %02x"
  455. " Status %02x\n",
  456. rec_buf[2], rec_buf[4],rec_buf[6],
  457. rec_buf[12],rec_buf[10]);
  458. rec_buf[0] = 0x04;
  459. rec_buf[1] = 0x00;
  460. rec_buf[2] = 0x03;
  461. rec_buf[3] = 0x00;
  462. msleep(20);
  463. if (i2c_writebytes(state,state->config->demod_address,
  464. rec_buf,3)) {
  465. printk(KERN_WARNING "or51211: Load DVR Error 8\n");
  466. return -1;
  467. }
  468. msleep(20);
  469. if (i2c_readbytes(state,state->config->demod_address,
  470. &rec_buf[8],2)) {
  471. printk(KERN_WARNING "or51211: Load DVR Error 9\n");
  472. return -1;
  473. }
  474. state->initialized = 1;
  475. }
  476. return 0;
  477. }
  478. static int or51211_get_tune_settings(struct dvb_frontend* fe,
  479. struct dvb_frontend_tune_settings* fesettings)
  480. {
  481. fesettings->min_delay_ms = 500;
  482. fesettings->step_size = 0;
  483. fesettings->max_drift = 0;
  484. return 0;
  485. }
  486. static void or51211_release(struct dvb_frontend* fe)
  487. {
  488. struct or51211_state* state = fe->demodulator_priv;
  489. state->config->sleep(fe);
  490. kfree(state);
  491. }
  492. static struct dvb_frontend_ops or51211_ops;
  493. struct dvb_frontend* or51211_attach(const struct or51211_config* config,
  494. struct i2c_adapter* i2c)
  495. {
  496. struct or51211_state* state = NULL;
  497. /* Allocate memory for the internal state */
  498. state = kmalloc(sizeof(struct or51211_state), GFP_KERNEL);
  499. if (state == NULL)
  500. goto error;
  501. /* Setup the state */
  502. state->config = config;
  503. state->i2c = i2c;
  504. memcpy(&state->ops, &or51211_ops, sizeof(struct dvb_frontend_ops));
  505. state->initialized = 0;
  506. state->current_frequency = 0;
  507. /* Create dvb_frontend */
  508. state->frontend.ops = &state->ops;
  509. state->frontend.demodulator_priv = state;
  510. return &state->frontend;
  511. error:
  512. kfree(state);
  513. return NULL;
  514. }
  515. static struct dvb_frontend_ops or51211_ops = {
  516. .info = {
  517. .name = "Oren OR51211 VSB Frontend",
  518. .type = FE_ATSC,
  519. .frequency_min = 44000000,
  520. .frequency_max = 958000000,
  521. .frequency_stepsize = 166666,
  522. .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
  523. FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
  524. FE_CAN_8VSB
  525. },
  526. .release = or51211_release,
  527. .init = or51211_init,
  528. .sleep = or51211_sleep,
  529. .set_frontend = or51211_set_parameters,
  530. .get_tune_settings = or51211_get_tune_settings,
  531. .read_status = or51211_read_status,
  532. .read_ber = or51211_read_ber,
  533. .read_signal_strength = or51211_read_signal_strength,
  534. .read_snr = or51211_read_snr,
  535. .read_ucblocks = or51211_read_ucblocks,
  536. };
  537. module_param(debug, int, 0644);
  538. MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off).");
  539. MODULE_DESCRIPTION("Oren OR51211 VSB [pcHDTV HD-2000] Demodulator Driver");
  540. MODULE_AUTHOR("Kirk Lapray");
  541. MODULE_LICENSE("GPL");
  542. EXPORT_SYMBOL(or51211_attach);