au8522.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708
  1. /*
  2. Auvitek AU8522 QAM/8VSB demodulator driver
  3. Copyright (C) 2008 Steven Toth <stoth@hauppauge.com>
  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. #include <linux/kernel.h>
  17. #include <linux/init.h>
  18. #include <linux/module.h>
  19. #include <linux/string.h>
  20. #include <linux/slab.h>
  21. #include <linux/delay.h>
  22. #include "dvb_frontend.h"
  23. #include "au8522.h"
  24. struct au8522_state {
  25. struct i2c_adapter *i2c;
  26. /* configuration settings */
  27. const struct au8522_config *config;
  28. struct dvb_frontend frontend;
  29. u32 current_frequency;
  30. fe_modulation_t current_modulation;
  31. };
  32. static int debug;
  33. #define dprintk(arg...) do { \
  34. if (debug) \
  35. printk(arg); \
  36. } while (0)
  37. /* 16 bit registers, 8 bit values */
  38. static int au8522_writereg(struct au8522_state *state, u16 reg, u8 data)
  39. {
  40. int ret;
  41. u8 buf [] = { reg >> 8, reg & 0xff, data };
  42. struct i2c_msg msg = { .addr = state->config->demod_address,
  43. .flags = 0, .buf = buf, .len = 3 };
  44. ret = i2c_transfer(state->i2c, &msg, 1);
  45. if (ret != 1)
  46. printk("%s: writereg error (reg == 0x%02x, val == 0x%04x, "
  47. "ret == %i)\n", __func__, reg, data, ret);
  48. return (ret != 1) ? -1 : 0;
  49. }
  50. static u8 au8522_readreg(struct au8522_state *state, u16 reg)
  51. {
  52. int ret;
  53. u8 b0 [] = { reg >> 8, reg & 0xff };
  54. u8 b1 [] = { 0 };
  55. struct i2c_msg msg [] = {
  56. { .addr = state->config->demod_address, .flags = 0,
  57. .buf = b0, .len = 2 },
  58. { .addr = state->config->demod_address, .flags = I2C_M_RD,
  59. .buf = b1, .len = 1 } };
  60. ret = i2c_transfer(state->i2c, msg, 2);
  61. if (ret != 2)
  62. printk(KERN_ERR "%s: readreg error (ret == %i)\n",
  63. __func__, ret);
  64. return b1[0];
  65. }
  66. static int au8522_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
  67. {
  68. struct au8522_state *state = fe->demodulator_priv;
  69. dprintk("%s(%d)\n", __func__, enable);
  70. if (enable)
  71. return au8522_writereg(state, 0x106, 1);
  72. else
  73. return au8522_writereg(state, 0x106, 0);
  74. }
  75. struct mse2snr_tab {
  76. u16 val;
  77. u16 data;
  78. };
  79. /* VSB SNR lookup table */
  80. static struct mse2snr_tab vsb_mse2snr_tab[] = {
  81. { 0, 270 },
  82. { 2, 250 },
  83. { 3, 240 },
  84. { 5, 230 },
  85. { 7, 220 },
  86. { 9, 210 },
  87. { 12, 200 },
  88. { 13, 195 },
  89. { 15, 190 },
  90. { 17, 185 },
  91. { 19, 180 },
  92. { 21, 175 },
  93. { 24, 170 },
  94. { 27, 165 },
  95. { 31, 160 },
  96. { 32, 158 },
  97. { 33, 156 },
  98. { 36, 152 },
  99. { 37, 150 },
  100. { 39, 148 },
  101. { 40, 146 },
  102. { 41, 144 },
  103. { 43, 142 },
  104. { 44, 140 },
  105. { 48, 135 },
  106. { 50, 130 },
  107. { 43, 142 },
  108. { 53, 125 },
  109. { 56, 120 },
  110. { 256, 115 },
  111. };
  112. /* QAM64 SNR lookup table */
  113. static struct mse2snr_tab qam64_mse2snr_tab[] = {
  114. { 15, 0 },
  115. { 16, 290 },
  116. { 17, 288 },
  117. { 18, 286 },
  118. { 19, 284 },
  119. { 20, 282 },
  120. { 21, 281 },
  121. { 22, 279 },
  122. { 23, 277 },
  123. { 24, 275 },
  124. { 25, 273 },
  125. { 26, 271 },
  126. { 27, 269 },
  127. { 28, 268 },
  128. { 29, 266 },
  129. { 30, 264 },
  130. { 31, 262 },
  131. { 32, 260 },
  132. { 33, 259 },
  133. { 34, 258 },
  134. { 35, 256 },
  135. { 36, 255 },
  136. { 37, 254 },
  137. { 38, 252 },
  138. { 39, 251 },
  139. { 40, 250 },
  140. { 41, 249 },
  141. { 42, 248 },
  142. { 43, 246 },
  143. { 44, 245 },
  144. { 45, 244 },
  145. { 46, 242 },
  146. { 47, 241 },
  147. { 48, 240 },
  148. { 50, 239 },
  149. { 51, 238 },
  150. { 53, 237 },
  151. { 54, 236 },
  152. { 56, 235 },
  153. { 57, 234 },
  154. { 59, 233 },
  155. { 60, 232 },
  156. { 62, 231 },
  157. { 63, 230 },
  158. { 65, 229 },
  159. { 67, 228 },
  160. { 68, 227 },
  161. { 70, 226 },
  162. { 71, 225 },
  163. { 73, 224 },
  164. { 74, 223 },
  165. { 76, 222 },
  166. { 78, 221 },
  167. { 80, 220 },
  168. { 82, 219 },
  169. { 85, 218 },
  170. { 88, 217 },
  171. { 90, 216 },
  172. { 92, 215 },
  173. { 93, 214 },
  174. { 94, 212 },
  175. { 95, 211 },
  176. { 97, 210 },
  177. { 99, 209 },
  178. { 101, 208 },
  179. { 102, 207 },
  180. { 104, 206 },
  181. { 107, 205 },
  182. { 111, 204 },
  183. { 114, 203 },
  184. { 118, 202 },
  185. { 122, 201 },
  186. { 125, 200 },
  187. { 128, 199 },
  188. { 130, 198 },
  189. { 132, 197 },
  190. { 256, 190 },
  191. };
  192. /* QAM256 SNR lookup table */
  193. static struct mse2snr_tab qam256_mse2snr_tab[] = {
  194. { 16, 0 },
  195. { 17, 400 },
  196. { 18, 398 },
  197. { 19, 396 },
  198. { 20, 394 },
  199. { 21, 392 },
  200. { 22, 390 },
  201. { 23, 388 },
  202. { 24, 386 },
  203. { 25, 384 },
  204. { 26, 382 },
  205. { 27, 380 },
  206. { 28, 379 },
  207. { 29, 378 },
  208. { 30, 377 },
  209. { 31, 376 },
  210. { 32, 375 },
  211. { 33, 374 },
  212. { 34, 373 },
  213. { 35, 372 },
  214. { 36, 371 },
  215. { 37, 370 },
  216. { 38, 362 },
  217. { 39, 354 },
  218. { 40, 346 },
  219. { 41, 338 },
  220. { 42, 330 },
  221. { 43, 328 },
  222. { 44, 326 },
  223. { 45, 324 },
  224. { 46, 322 },
  225. { 47, 320 },
  226. { 48, 319 },
  227. { 49, 318 },
  228. { 50, 317 },
  229. { 51, 316 },
  230. { 52, 315 },
  231. { 53, 314 },
  232. { 54, 313 },
  233. { 55, 312 },
  234. { 56, 311 },
  235. { 57, 310 },
  236. { 58, 308 },
  237. { 59, 306 },
  238. { 60, 304 },
  239. { 61, 302 },
  240. { 62, 300 },
  241. { 63, 298 },
  242. { 65, 295 },
  243. { 68, 294 },
  244. { 70, 293 },
  245. { 73, 292 },
  246. { 76, 291 },
  247. { 78, 290 },
  248. { 79, 289 },
  249. { 81, 288 },
  250. { 82, 287 },
  251. { 83, 286 },
  252. { 84, 285 },
  253. { 85, 284 },
  254. { 86, 283 },
  255. { 88, 282 },
  256. { 89, 281 },
  257. { 256, 280 },
  258. };
  259. static int au8522_mse2snr_lookup(struct mse2snr_tab *tab, int sz, int mse,
  260. u16 *snr)
  261. {
  262. int i, ret = -EINVAL;
  263. dprintk("%s()\n", __func__);
  264. for (i = 0; i < sz; i++) {
  265. if (mse < tab[i].val) {
  266. *snr = tab[i].data;
  267. ret = 0;
  268. break;
  269. }
  270. }
  271. dprintk("%s() snr=%d\n", __func__, *snr);
  272. return ret;
  273. }
  274. /* VSB Modulation table */
  275. static struct {
  276. u16 reg;
  277. u16 data;
  278. } VSB_mod_tab[] = {
  279. { 0x8090, 0x84 },
  280. { 0x4092, 0x11 },
  281. { 0x2005, 0x00 },
  282. { 0x8091, 0x80 },
  283. { 0x80a3, 0x0c },
  284. { 0x80a4, 0xe8 },
  285. { 0x8081, 0xc4 },
  286. { 0x80a5, 0x40 },
  287. { 0x80a7, 0x40 },
  288. { 0x80a6, 0x67 },
  289. { 0x8262, 0x20 },
  290. { 0x821c, 0x30 },
  291. { 0x80d8, 0x1a },
  292. { 0x8227, 0xa0 },
  293. { 0x8121, 0xff },
  294. { 0x80a8, 0xf0 },
  295. { 0x80a9, 0x05 },
  296. { 0x80aa, 0x77 },
  297. { 0x80ab, 0xf0 },
  298. { 0x80ac, 0x05 },
  299. { 0x80ad, 0x77 },
  300. { 0x80ae, 0x41 },
  301. { 0x80af, 0x66 },
  302. { 0x821b, 0xcc },
  303. { 0x821d, 0x80 },
  304. { 0x80b5, 0xfb },
  305. { 0x80b6, 0x8e },
  306. { 0x80b7, 0x39 },
  307. { 0x80a4, 0xe8 },
  308. { 0x8231, 0x13 },
  309. };
  310. /* QAM Modulation table */
  311. static struct {
  312. u16 reg;
  313. u16 data;
  314. } QAM_mod_tab[] = {
  315. { 0x80a3, 0x09 },
  316. { 0x80a4, 0x00 },
  317. { 0x8081, 0xc4 },
  318. { 0x80a5, 0x40 },
  319. { 0x80b5, 0xfb },
  320. { 0x80b6, 0x8e },
  321. { 0x80b7, 0x39 },
  322. { 0x80aa, 0x77 },
  323. { 0x80ad, 0x77 },
  324. { 0x80a6, 0x67 },
  325. { 0x8262, 0x20 },
  326. { 0x821c, 0x30 },
  327. { 0x80b8, 0x3e },
  328. { 0x80b9, 0xf0 },
  329. { 0x80ba, 0x01 },
  330. { 0x80bb, 0x18 },
  331. { 0x80bc, 0x50 },
  332. { 0x80bd, 0x00 },
  333. { 0x80be, 0xea },
  334. { 0x80bf, 0xef },
  335. { 0x80c0, 0xfc },
  336. { 0x80c1, 0xbd },
  337. { 0x80c2, 0x1f },
  338. { 0x80c3, 0xfc },
  339. { 0x80c4, 0xdd },
  340. { 0x80c5, 0xaf },
  341. { 0x80c6, 0x00 },
  342. { 0x80c7, 0x38 },
  343. { 0x80c8, 0x30 },
  344. { 0x80c9, 0x05 },
  345. { 0x80ca, 0x4a },
  346. { 0x80cb, 0xd0 },
  347. { 0x80cc, 0x01 },
  348. { 0x80cd, 0xd9 },
  349. { 0x80ce, 0x6f },
  350. { 0x80cf, 0xf9 },
  351. { 0x80d0, 0x70 },
  352. { 0x80d1, 0xdf },
  353. { 0x80d2, 0xf7 },
  354. { 0x80d3, 0xc2 },
  355. { 0x80d4, 0xdf },
  356. { 0x80d5, 0x02 },
  357. { 0x80d6, 0x9a },
  358. { 0x80d7, 0xd0 },
  359. { 0x8250, 0x0d },
  360. { 0x8251, 0xcd },
  361. { 0x8252, 0xe0 },
  362. { 0x8253, 0x05 },
  363. { 0x8254, 0xa7 },
  364. { 0x8255, 0xff },
  365. { 0x8256, 0xed },
  366. { 0x8257, 0x5b },
  367. { 0x8258, 0xae },
  368. { 0x8259, 0xe6 },
  369. { 0x825a, 0x3d },
  370. { 0x825b, 0x0f },
  371. { 0x825c, 0x0d },
  372. { 0x825d, 0xea },
  373. { 0x825e, 0xf2 },
  374. { 0x825f, 0x51 },
  375. { 0x8260, 0xf5 },
  376. { 0x8261, 0x06 },
  377. { 0x821a, 0x00 },
  378. { 0x8546, 0x40 },
  379. { 0x8210, 0x26 },
  380. { 0x8211, 0xf6 },
  381. { 0x8212, 0x84 },
  382. { 0x8213, 0x02 },
  383. { 0x8502, 0x01 },
  384. { 0x8121, 0x04 },
  385. { 0x8122, 0x04 },
  386. { 0x852e, 0x10 },
  387. { 0x80a4, 0xca },
  388. { 0x80a7, 0x40 },
  389. { 0x8526, 0x01 },
  390. };
  391. static int au8522_enable_modulation(struct dvb_frontend *fe,
  392. fe_modulation_t m)
  393. {
  394. struct au8522_state *state = fe->demodulator_priv;
  395. int i;
  396. dprintk("%s(0x%08x)\n", __func__, m);
  397. switch (m) {
  398. case VSB_8:
  399. dprintk("%s() VSB_8\n", __func__);
  400. for (i = 0; i < ARRAY_SIZE(VSB_mod_tab); i++)
  401. au8522_writereg(state,
  402. VSB_mod_tab[i].reg,
  403. VSB_mod_tab[i].data);
  404. break;
  405. case QAM_64:
  406. case QAM_256:
  407. dprintk("%s() QAM 64/256\n", __func__);
  408. for (i = 0; i < ARRAY_SIZE(QAM_mod_tab); i++)
  409. au8522_writereg(state,
  410. QAM_mod_tab[i].reg,
  411. QAM_mod_tab[i].data);
  412. break;
  413. default:
  414. dprintk("%s() Invalid modulation\n", __func__);
  415. return -EINVAL;
  416. }
  417. state->current_modulation = m;
  418. return 0;
  419. }
  420. /* Talk to the demod, set the FEC, GUARD, QAM settings etc */
  421. static int au8522_set_frontend(struct dvb_frontend *fe,
  422. struct dvb_frontend_parameters *p)
  423. {
  424. struct au8522_state *state = fe->demodulator_priv;
  425. int ret = -EINVAL;
  426. dprintk("%s(frequency=%d)\n", __func__, p->frequency);
  427. if ((state->current_frequency == p->frequency) &&
  428. (state->current_modulation == p->u.vsb.modulation))
  429. return 0;
  430. au8522_enable_modulation(fe, p->u.vsb.modulation);
  431. /* Allow the demod to settle */
  432. msleep(100);
  433. if (fe->ops.tuner_ops.set_params) {
  434. if (fe->ops.i2c_gate_ctrl)
  435. fe->ops.i2c_gate_ctrl(fe, 1);
  436. ret = fe->ops.tuner_ops.set_params(fe, p);
  437. if (fe->ops.i2c_gate_ctrl)
  438. fe->ops.i2c_gate_ctrl(fe, 0);
  439. }
  440. if (ret < 0)
  441. return ret;
  442. state->current_frequency = p->frequency;
  443. return 0;
  444. }
  445. /* Reset the demod hardware and reset all of the configuration registers
  446. to a default state. */
  447. static int au8522_init(struct dvb_frontend *fe)
  448. {
  449. struct au8522_state *state = fe->demodulator_priv;
  450. dprintk("%s()\n", __func__);
  451. au8522_writereg(state, 0xa4, 1 << 5);
  452. au8522_i2c_gate_ctrl(fe, 1);
  453. return 0;
  454. }
  455. static int au8522_sleep(struct dvb_frontend *fe)
  456. {
  457. struct au8522_state *state = fe->demodulator_priv;
  458. dprintk("%s()\n", __func__);
  459. state->current_frequency = 0;
  460. return 0;
  461. }
  462. static int au8522_read_status(struct dvb_frontend *fe, fe_status_t *status)
  463. {
  464. struct au8522_state *state = fe->demodulator_priv;
  465. u8 reg;
  466. u32 tuner_status = 0;
  467. *status = 0;
  468. if (state->current_modulation == VSB_8) {
  469. dprintk("%s() Checking VSB_8\n", __func__);
  470. reg = au8522_readreg(state, 0x4088);
  471. if ((reg & 0x03) == 0x03)
  472. *status |= FE_HAS_LOCK | FE_HAS_SYNC | FE_HAS_VITERBI;
  473. } else {
  474. dprintk("%s() Checking QAM\n", __func__);
  475. reg = au8522_readreg(state, 0x4541);
  476. if (reg & 0x80)
  477. *status |= FE_HAS_VITERBI;
  478. if (reg & 0x20)
  479. *status |= FE_HAS_LOCK | FE_HAS_SYNC;
  480. }
  481. switch (state->config->status_mode) {
  482. case AU8522_DEMODLOCKING:
  483. dprintk("%s() DEMODLOCKING\n", __func__);
  484. if (*status & FE_HAS_VITERBI)
  485. *status |= FE_HAS_CARRIER | FE_HAS_SIGNAL;
  486. break;
  487. case AU8522_TUNERLOCKING:
  488. /* Get the tuner status */
  489. dprintk("%s() TUNERLOCKING\n", __func__);
  490. if (fe->ops.tuner_ops.get_status) {
  491. if (fe->ops.i2c_gate_ctrl)
  492. fe->ops.i2c_gate_ctrl(fe, 1);
  493. fe->ops.tuner_ops.get_status(fe, &tuner_status);
  494. if (fe->ops.i2c_gate_ctrl)
  495. fe->ops.i2c_gate_ctrl(fe, 0);
  496. }
  497. if (tuner_status)
  498. *status |= FE_HAS_CARRIER | FE_HAS_SIGNAL;
  499. break;
  500. }
  501. dprintk("%s() status 0x%08x\n", __func__, *status);
  502. return 0;
  503. }
  504. static int au8522_read_snr(struct dvb_frontend *fe, u16 *snr)
  505. {
  506. struct au8522_state *state = fe->demodulator_priv;
  507. int ret = -EINVAL;
  508. dprintk("%s()\n", __func__);
  509. if (state->current_modulation == QAM_256)
  510. ret = au8522_mse2snr_lookup(qam256_mse2snr_tab,
  511. ARRAY_SIZE(qam256_mse2snr_tab),
  512. au8522_readreg(state, 0x4522),
  513. snr);
  514. else if (state->current_modulation == QAM_64)
  515. ret = au8522_mse2snr_lookup(qam64_mse2snr_tab,
  516. ARRAY_SIZE(qam64_mse2snr_tab),
  517. au8522_readreg(state, 0x4522),
  518. snr);
  519. else /* VSB_8 */
  520. ret = au8522_mse2snr_lookup(vsb_mse2snr_tab,
  521. ARRAY_SIZE(vsb_mse2snr_tab),
  522. au8522_readreg(state, 0x4311),
  523. snr);
  524. return ret;
  525. }
  526. static int au8522_read_signal_strength(struct dvb_frontend *fe,
  527. u16 *signal_strength)
  528. {
  529. return au8522_read_snr(fe, signal_strength);
  530. }
  531. static int au8522_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
  532. {
  533. struct au8522_state *state = fe->demodulator_priv;
  534. if (state->current_modulation == VSB_8)
  535. *ucblocks = au8522_readreg(state, 0x4087);
  536. else
  537. *ucblocks = au8522_readreg(state, 0x4543);
  538. return 0;
  539. }
  540. static int au8522_read_ber(struct dvb_frontend *fe, u32 *ber)
  541. {
  542. return au8522_read_ucblocks(fe, ber);
  543. }
  544. static int au8522_get_frontend(struct dvb_frontend *fe,
  545. struct dvb_frontend_parameters *p)
  546. {
  547. struct au8522_state *state = fe->demodulator_priv;
  548. p->frequency = state->current_frequency;
  549. p->u.vsb.modulation = state->current_modulation;
  550. return 0;
  551. }
  552. static int au8522_get_tune_settings(struct dvb_frontend *fe,
  553. struct dvb_frontend_tune_settings *tune)
  554. {
  555. tune->min_delay_ms = 1000;
  556. return 0;
  557. }
  558. static void au8522_release(struct dvb_frontend *fe)
  559. {
  560. struct au8522_state *state = fe->demodulator_priv;
  561. kfree(state);
  562. }
  563. static struct dvb_frontend_ops au8522_ops;
  564. struct dvb_frontend *au8522_attach(const struct au8522_config *config,
  565. struct i2c_adapter *i2c)
  566. {
  567. struct au8522_state *state = NULL;
  568. /* allocate memory for the internal state */
  569. state = kmalloc(sizeof(struct au8522_state), GFP_KERNEL);
  570. if (state == NULL)
  571. goto error;
  572. /* setup the state */
  573. state->config = config;
  574. state->i2c = i2c;
  575. /* create dvb_frontend */
  576. memcpy(&state->frontend.ops, &au8522_ops,
  577. sizeof(struct dvb_frontend_ops));
  578. state->frontend.demodulator_priv = state;
  579. if (au8522_init(&state->frontend) != 0) {
  580. printk(KERN_ERR "%s: Failed to initialize correctly\n",
  581. __func__);
  582. goto error;
  583. }
  584. /* Note: Leaving the I2C gate open here. */
  585. au8522_i2c_gate_ctrl(&state->frontend, 1);
  586. return &state->frontend;
  587. error:
  588. kfree(state);
  589. return NULL;
  590. }
  591. EXPORT_SYMBOL(au8522_attach);
  592. static struct dvb_frontend_ops au8522_ops = {
  593. .info = {
  594. .name = "Auvitek AU8522 QAM/8VSB Frontend",
  595. .type = FE_ATSC,
  596. .frequency_min = 54000000,
  597. .frequency_max = 858000000,
  598. .frequency_stepsize = 62500,
  599. .caps = FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB
  600. },
  601. .init = au8522_init,
  602. .sleep = au8522_sleep,
  603. .i2c_gate_ctrl = au8522_i2c_gate_ctrl,
  604. .set_frontend = au8522_set_frontend,
  605. .get_frontend = au8522_get_frontend,
  606. .get_tune_settings = au8522_get_tune_settings,
  607. .read_status = au8522_read_status,
  608. .read_ber = au8522_read_ber,
  609. .read_signal_strength = au8522_read_signal_strength,
  610. .read_snr = au8522_read_snr,
  611. .read_ucblocks = au8522_read_ucblocks,
  612. .release = au8522_release,
  613. };
  614. module_param(debug, int, 0644);
  615. MODULE_PARM_DESC(debug, "Enable verbose debug messages");
  616. MODULE_DESCRIPTION("Auvitek AU8522 QAM-B/ATSC Demodulator driver");
  617. MODULE_AUTHOR("Steven Toth");
  618. MODULE_LICENSE("GPL");