zl10353.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  1. /*
  2. * Driver for Zarlink DVB-T ZL10353 demodulator
  3. *
  4. * Copyright (C) 2006, 2007 Christopher Pascoe <c.pascoe@itee.uq.edu.au>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. *
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21. #include <linux/kernel.h>
  22. #include <linux/module.h>
  23. #include <linux/init.h>
  24. #include <linux/delay.h>
  25. #include <linux/string.h>
  26. #include <linux/slab.h>
  27. #include <asm/div64.h>
  28. #include "dvb_frontend.h"
  29. #include "zl10353_priv.h"
  30. #include "zl10353.h"
  31. struct zl10353_state {
  32. struct i2c_adapter *i2c;
  33. struct dvb_frontend frontend;
  34. struct zl10353_config config;
  35. u32 bandwidth;
  36. u32 ucblocks;
  37. u32 frequency;
  38. };
  39. static int debug;
  40. #define dprintk(args...) \
  41. do { \
  42. if (debug) printk(KERN_DEBUG "zl10353: " args); \
  43. } while (0)
  44. static int debug_regs;
  45. static int zl10353_single_write(struct dvb_frontend *fe, u8 reg, u8 val)
  46. {
  47. struct zl10353_state *state = fe->demodulator_priv;
  48. u8 buf[2] = { reg, val };
  49. struct i2c_msg msg = { .addr = state->config.demod_address, .flags = 0,
  50. .buf = buf, .len = 2 };
  51. int err = i2c_transfer(state->i2c, &msg, 1);
  52. if (err != 1) {
  53. printk("zl10353: write to reg %x failed (err = %d)!\n", reg, err);
  54. return err;
  55. }
  56. return 0;
  57. }
  58. static int zl10353_write(struct dvb_frontend *fe, const u8 ibuf[], int ilen)
  59. {
  60. int err, i;
  61. for (i = 0; i < ilen - 1; i++)
  62. if ((err = zl10353_single_write(fe, ibuf[0] + i, ibuf[i + 1])))
  63. return err;
  64. return 0;
  65. }
  66. static int zl10353_read_register(struct zl10353_state *state, u8 reg)
  67. {
  68. int ret;
  69. u8 b0[1] = { reg };
  70. u8 b1[1] = { 0 };
  71. struct i2c_msg msg[2] = { { .addr = state->config.demod_address,
  72. .flags = 0,
  73. .buf = b0, .len = 1 },
  74. { .addr = state->config.demod_address,
  75. .flags = I2C_M_RD,
  76. .buf = b1, .len = 1 } };
  77. ret = i2c_transfer(state->i2c, msg, 2);
  78. if (ret != 2) {
  79. printk("%s: readreg error (reg=%d, ret==%i)\n",
  80. __func__, reg, ret);
  81. return ret;
  82. }
  83. return b1[0];
  84. }
  85. static void zl10353_dump_regs(struct dvb_frontend *fe)
  86. {
  87. struct zl10353_state *state = fe->demodulator_priv;
  88. int ret;
  89. u8 reg;
  90. /* Dump all registers. */
  91. for (reg = 0; ; reg++) {
  92. if (reg % 16 == 0) {
  93. if (reg)
  94. printk(KERN_CONT "\n");
  95. printk(KERN_DEBUG "%02x:", reg);
  96. }
  97. ret = zl10353_read_register(state, reg);
  98. if (ret >= 0)
  99. printk(KERN_CONT " %02x", (u8)ret);
  100. else
  101. printk(KERN_CONT " --");
  102. if (reg == 0xff)
  103. break;
  104. }
  105. printk(KERN_CONT "\n");
  106. }
  107. static void zl10353_calc_nominal_rate(struct dvb_frontend *fe,
  108. u32 bandwidth,
  109. u16 *nominal_rate)
  110. {
  111. struct zl10353_state *state = fe->demodulator_priv;
  112. u32 adc_clock = 450560; /* 45.056 MHz */
  113. u64 value;
  114. u8 bw = bandwidth / 1000000;
  115. if (state->config.adc_clock)
  116. adc_clock = state->config.adc_clock;
  117. value = (u64)10 * (1 << 23) / 7 * 125;
  118. value = (bw * value) + adc_clock / 2;
  119. do_div(value, adc_clock);
  120. *nominal_rate = value;
  121. dprintk("%s: bw %d, adc_clock %d => 0x%x\n",
  122. __func__, bw, adc_clock, *nominal_rate);
  123. }
  124. static void zl10353_calc_input_freq(struct dvb_frontend *fe,
  125. u16 *input_freq)
  126. {
  127. struct zl10353_state *state = fe->demodulator_priv;
  128. u32 adc_clock = 450560; /* 45.056 MHz */
  129. int if2 = 361667; /* 36.1667 MHz */
  130. int ife;
  131. u64 value;
  132. if (state->config.adc_clock)
  133. adc_clock = state->config.adc_clock;
  134. if (state->config.if2)
  135. if2 = state->config.if2;
  136. if (adc_clock >= if2 * 2)
  137. ife = if2;
  138. else {
  139. ife = adc_clock - (if2 % adc_clock);
  140. if (ife > adc_clock / 2)
  141. ife = adc_clock - ife;
  142. }
  143. value = (u64)65536 * ife + adc_clock / 2;
  144. do_div(value, adc_clock);
  145. *input_freq = -value;
  146. dprintk("%s: if2 %d, ife %d, adc_clock %d => %d / 0x%x\n",
  147. __func__, if2, ife, adc_clock, -(int)value, *input_freq);
  148. }
  149. static int zl10353_sleep(struct dvb_frontend *fe)
  150. {
  151. static u8 zl10353_softdown[] = { 0x50, 0x0C, 0x44 };
  152. zl10353_write(fe, zl10353_softdown, sizeof(zl10353_softdown));
  153. return 0;
  154. }
  155. static int zl10353_set_parameters(struct dvb_frontend *fe)
  156. {
  157. struct dtv_frontend_properties *c = &fe->dtv_property_cache;
  158. struct zl10353_state *state = fe->demodulator_priv;
  159. u16 nominal_rate, input_freq;
  160. u8 pllbuf[6] = { 0x67 }, acq_ctl = 0;
  161. u16 tps = 0;
  162. state->frequency = c->frequency;
  163. zl10353_single_write(fe, RESET, 0x80);
  164. udelay(200);
  165. zl10353_single_write(fe, 0xEA, 0x01);
  166. udelay(200);
  167. zl10353_single_write(fe, 0xEA, 0x00);
  168. zl10353_single_write(fe, AGC_TARGET, 0x28);
  169. if (c->transmission_mode != TRANSMISSION_MODE_AUTO)
  170. acq_ctl |= (1 << 0);
  171. if (c->guard_interval != GUARD_INTERVAL_AUTO)
  172. acq_ctl |= (1 << 1);
  173. zl10353_single_write(fe, ACQ_CTL, acq_ctl);
  174. switch (c->bandwidth_hz) {
  175. case 6000000:
  176. /* These are extrapolated from the 7 and 8MHz values */
  177. zl10353_single_write(fe, MCLK_RATIO, 0x97);
  178. zl10353_single_write(fe, 0x64, 0x34);
  179. zl10353_single_write(fe, 0xcc, 0xdd);
  180. break;
  181. case 7000000:
  182. zl10353_single_write(fe, MCLK_RATIO, 0x86);
  183. zl10353_single_write(fe, 0x64, 0x35);
  184. zl10353_single_write(fe, 0xcc, 0x73);
  185. break;
  186. default:
  187. c->bandwidth_hz = 8000000;
  188. /* fall though */
  189. case 8000000:
  190. zl10353_single_write(fe, MCLK_RATIO, 0x75);
  191. zl10353_single_write(fe, 0x64, 0x36);
  192. zl10353_single_write(fe, 0xcc, 0x73);
  193. }
  194. zl10353_calc_nominal_rate(fe, c->bandwidth_hz, &nominal_rate);
  195. zl10353_single_write(fe, TRL_NOMINAL_RATE_1, msb(nominal_rate));
  196. zl10353_single_write(fe, TRL_NOMINAL_RATE_0, lsb(nominal_rate));
  197. state->bandwidth = c->bandwidth_hz;
  198. zl10353_calc_input_freq(fe, &input_freq);
  199. zl10353_single_write(fe, INPUT_FREQ_1, msb(input_freq));
  200. zl10353_single_write(fe, INPUT_FREQ_0, lsb(input_freq));
  201. /* Hint at TPS settings */
  202. switch (c->code_rate_HP) {
  203. case FEC_2_3:
  204. tps |= (1 << 7);
  205. break;
  206. case FEC_3_4:
  207. tps |= (2 << 7);
  208. break;
  209. case FEC_5_6:
  210. tps |= (3 << 7);
  211. break;
  212. case FEC_7_8:
  213. tps |= (4 << 7);
  214. break;
  215. case FEC_1_2:
  216. case FEC_AUTO:
  217. break;
  218. default:
  219. return -EINVAL;
  220. }
  221. switch (c->code_rate_LP) {
  222. case FEC_2_3:
  223. tps |= (1 << 4);
  224. break;
  225. case FEC_3_4:
  226. tps |= (2 << 4);
  227. break;
  228. case FEC_5_6:
  229. tps |= (3 << 4);
  230. break;
  231. case FEC_7_8:
  232. tps |= (4 << 4);
  233. break;
  234. case FEC_1_2:
  235. case FEC_AUTO:
  236. break;
  237. case FEC_NONE:
  238. if (c->hierarchy == HIERARCHY_AUTO ||
  239. c->hierarchy == HIERARCHY_NONE)
  240. break;
  241. default:
  242. return -EINVAL;
  243. }
  244. switch (c->modulation) {
  245. case QPSK:
  246. break;
  247. case QAM_AUTO:
  248. case QAM_16:
  249. tps |= (1 << 13);
  250. break;
  251. case QAM_64:
  252. tps |= (2 << 13);
  253. break;
  254. default:
  255. return -EINVAL;
  256. }
  257. switch (c->transmission_mode) {
  258. case TRANSMISSION_MODE_2K:
  259. case TRANSMISSION_MODE_AUTO:
  260. break;
  261. case TRANSMISSION_MODE_8K:
  262. tps |= (1 << 0);
  263. break;
  264. default:
  265. return -EINVAL;
  266. }
  267. switch (c->guard_interval) {
  268. case GUARD_INTERVAL_1_32:
  269. case GUARD_INTERVAL_AUTO:
  270. break;
  271. case GUARD_INTERVAL_1_16:
  272. tps |= (1 << 2);
  273. break;
  274. case GUARD_INTERVAL_1_8:
  275. tps |= (2 << 2);
  276. break;
  277. case GUARD_INTERVAL_1_4:
  278. tps |= (3 << 2);
  279. break;
  280. default:
  281. return -EINVAL;
  282. }
  283. switch (c->hierarchy) {
  284. case HIERARCHY_AUTO:
  285. case HIERARCHY_NONE:
  286. break;
  287. case HIERARCHY_1:
  288. tps |= (1 << 10);
  289. break;
  290. case HIERARCHY_2:
  291. tps |= (2 << 10);
  292. break;
  293. case HIERARCHY_4:
  294. tps |= (3 << 10);
  295. break;
  296. default:
  297. return -EINVAL;
  298. }
  299. zl10353_single_write(fe, TPS_GIVEN_1, msb(tps));
  300. zl10353_single_write(fe, TPS_GIVEN_0, lsb(tps));
  301. if (fe->ops.i2c_gate_ctrl)
  302. fe->ops.i2c_gate_ctrl(fe, 0);
  303. /*
  304. * If there is no tuner attached to the secondary I2C bus, we call
  305. * set_params to program a potential tuner attached somewhere else.
  306. * Otherwise, we update the PLL registers via calc_regs.
  307. */
  308. if (state->config.no_tuner) {
  309. if (fe->ops.tuner_ops.set_params) {
  310. fe->ops.tuner_ops.set_params(fe);
  311. if (fe->ops.i2c_gate_ctrl)
  312. fe->ops.i2c_gate_ctrl(fe, 0);
  313. }
  314. } else if (fe->ops.tuner_ops.calc_regs) {
  315. fe->ops.tuner_ops.calc_regs(fe, pllbuf + 1, 5);
  316. pllbuf[1] <<= 1;
  317. zl10353_write(fe, pllbuf, sizeof(pllbuf));
  318. }
  319. zl10353_single_write(fe, 0x5F, 0x13);
  320. /* If no attached tuner or invalid PLL registers, just start the FSM. */
  321. if (state->config.no_tuner || fe->ops.tuner_ops.calc_regs == NULL)
  322. zl10353_single_write(fe, FSM_GO, 0x01);
  323. else
  324. zl10353_single_write(fe, TUNER_GO, 0x01);
  325. return 0;
  326. }
  327. static int zl10353_get_parameters(struct dvb_frontend *fe)
  328. {
  329. struct dtv_frontend_properties *c = &fe->dtv_property_cache;
  330. struct zl10353_state *state = fe->demodulator_priv;
  331. int s6, s9;
  332. u16 tps;
  333. static const u8 tps_fec_to_api[8] = {
  334. FEC_1_2,
  335. FEC_2_3,
  336. FEC_3_4,
  337. FEC_5_6,
  338. FEC_7_8,
  339. FEC_AUTO,
  340. FEC_AUTO,
  341. FEC_AUTO
  342. };
  343. s6 = zl10353_read_register(state, STATUS_6);
  344. s9 = zl10353_read_register(state, STATUS_9);
  345. if (s6 < 0 || s9 < 0)
  346. return -EREMOTEIO;
  347. if ((s6 & (1 << 5)) == 0 || (s9 & (1 << 4)) == 0)
  348. return -EINVAL; /* no FE or TPS lock */
  349. tps = zl10353_read_register(state, TPS_RECEIVED_1) << 8 |
  350. zl10353_read_register(state, TPS_RECEIVED_0);
  351. c->code_rate_HP = tps_fec_to_api[(tps >> 7) & 7];
  352. c->code_rate_LP = tps_fec_to_api[(tps >> 4) & 7];
  353. switch ((tps >> 13) & 3) {
  354. case 0:
  355. c->modulation = QPSK;
  356. break;
  357. case 1:
  358. c->modulation = QAM_16;
  359. break;
  360. case 2:
  361. c->modulation = QAM_64;
  362. break;
  363. default:
  364. c->modulation = QAM_AUTO;
  365. break;
  366. }
  367. c->transmission_mode = (tps & 0x01) ? TRANSMISSION_MODE_8K :
  368. TRANSMISSION_MODE_2K;
  369. switch ((tps >> 2) & 3) {
  370. case 0:
  371. c->guard_interval = GUARD_INTERVAL_1_32;
  372. break;
  373. case 1:
  374. c->guard_interval = GUARD_INTERVAL_1_16;
  375. break;
  376. case 2:
  377. c->guard_interval = GUARD_INTERVAL_1_8;
  378. break;
  379. case 3:
  380. c->guard_interval = GUARD_INTERVAL_1_4;
  381. break;
  382. default:
  383. c->guard_interval = GUARD_INTERVAL_AUTO;
  384. break;
  385. }
  386. switch ((tps >> 10) & 7) {
  387. case 0:
  388. c->hierarchy = HIERARCHY_NONE;
  389. break;
  390. case 1:
  391. c->hierarchy = HIERARCHY_1;
  392. break;
  393. case 2:
  394. c->hierarchy = HIERARCHY_2;
  395. break;
  396. case 3:
  397. c->hierarchy = HIERARCHY_4;
  398. break;
  399. default:
  400. c->hierarchy = HIERARCHY_AUTO;
  401. break;
  402. }
  403. c->frequency = state->frequency;
  404. c->bandwidth_hz = state->bandwidth;
  405. c->inversion = INVERSION_AUTO;
  406. return 0;
  407. }
  408. static int zl10353_read_status(struct dvb_frontend *fe, enum fe_status *status)
  409. {
  410. struct zl10353_state *state = fe->demodulator_priv;
  411. int s6, s7, s8;
  412. if ((s6 = zl10353_read_register(state, STATUS_6)) < 0)
  413. return -EREMOTEIO;
  414. if ((s7 = zl10353_read_register(state, STATUS_7)) < 0)
  415. return -EREMOTEIO;
  416. if ((s8 = zl10353_read_register(state, STATUS_8)) < 0)
  417. return -EREMOTEIO;
  418. *status = 0;
  419. if (s6 & (1 << 2))
  420. *status |= FE_HAS_CARRIER;
  421. if (s6 & (1 << 1))
  422. *status |= FE_HAS_VITERBI;
  423. if (s6 & (1 << 5))
  424. *status |= FE_HAS_LOCK;
  425. if (s7 & (1 << 4))
  426. *status |= FE_HAS_SYNC;
  427. if (s8 & (1 << 6))
  428. *status |= FE_HAS_SIGNAL;
  429. if ((*status & (FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC)) !=
  430. (FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC))
  431. *status &= ~FE_HAS_LOCK;
  432. return 0;
  433. }
  434. static int zl10353_read_ber(struct dvb_frontend *fe, u32 *ber)
  435. {
  436. struct zl10353_state *state = fe->demodulator_priv;
  437. *ber = zl10353_read_register(state, RS_ERR_CNT_2) << 16 |
  438. zl10353_read_register(state, RS_ERR_CNT_1) << 8 |
  439. zl10353_read_register(state, RS_ERR_CNT_0);
  440. return 0;
  441. }
  442. static int zl10353_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
  443. {
  444. struct zl10353_state *state = fe->demodulator_priv;
  445. u16 signal = zl10353_read_register(state, AGC_GAIN_1) << 10 |
  446. zl10353_read_register(state, AGC_GAIN_0) << 2 | 3;
  447. *strength = ~signal;
  448. return 0;
  449. }
  450. static int zl10353_read_snr(struct dvb_frontend *fe, u16 *snr)
  451. {
  452. struct zl10353_state *state = fe->demodulator_priv;
  453. u8 _snr;
  454. if (debug_regs)
  455. zl10353_dump_regs(fe);
  456. _snr = zl10353_read_register(state, SNR);
  457. *snr = 10 * _snr / 8;
  458. return 0;
  459. }
  460. static int zl10353_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
  461. {
  462. struct zl10353_state *state = fe->demodulator_priv;
  463. u32 ubl = 0;
  464. ubl = zl10353_read_register(state, RS_UBC_1) << 8 |
  465. zl10353_read_register(state, RS_UBC_0);
  466. state->ucblocks += ubl;
  467. *ucblocks = state->ucblocks;
  468. return 0;
  469. }
  470. static int zl10353_get_tune_settings(struct dvb_frontend *fe,
  471. struct dvb_frontend_tune_settings
  472. *fe_tune_settings)
  473. {
  474. fe_tune_settings->min_delay_ms = 1000;
  475. fe_tune_settings->step_size = 0;
  476. fe_tune_settings->max_drift = 0;
  477. return 0;
  478. }
  479. static int zl10353_init(struct dvb_frontend *fe)
  480. {
  481. struct zl10353_state *state = fe->demodulator_priv;
  482. u8 zl10353_reset_attach[6] = { 0x50, 0x03, 0x64, 0x46, 0x15, 0x0F };
  483. if (debug_regs)
  484. zl10353_dump_regs(fe);
  485. if (state->config.parallel_ts)
  486. zl10353_reset_attach[2] &= ~0x20;
  487. if (state->config.clock_ctl_1)
  488. zl10353_reset_attach[3] = state->config.clock_ctl_1;
  489. if (state->config.pll_0)
  490. zl10353_reset_attach[4] = state->config.pll_0;
  491. /* Do a "hard" reset if not already done */
  492. if (zl10353_read_register(state, 0x50) != zl10353_reset_attach[1] ||
  493. zl10353_read_register(state, 0x51) != zl10353_reset_attach[2]) {
  494. zl10353_write(fe, zl10353_reset_attach,
  495. sizeof(zl10353_reset_attach));
  496. if (debug_regs)
  497. zl10353_dump_regs(fe);
  498. }
  499. return 0;
  500. }
  501. static int zl10353_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
  502. {
  503. struct zl10353_state *state = fe->demodulator_priv;
  504. u8 val = 0x0a;
  505. if (state->config.disable_i2c_gate_ctrl) {
  506. /* No tuner attached to the internal I2C bus */
  507. /* If set enable I2C bridge, the main I2C bus stopped hardly */
  508. return 0;
  509. }
  510. if (enable)
  511. val |= 0x10;
  512. return zl10353_single_write(fe, 0x62, val);
  513. }
  514. static void zl10353_release(struct dvb_frontend *fe)
  515. {
  516. struct zl10353_state *state = fe->demodulator_priv;
  517. kfree(state);
  518. }
  519. static struct dvb_frontend_ops zl10353_ops;
  520. struct dvb_frontend *zl10353_attach(const struct zl10353_config *config,
  521. struct i2c_adapter *i2c)
  522. {
  523. struct zl10353_state *state = NULL;
  524. int id;
  525. /* allocate memory for the internal state */
  526. state = kzalloc(sizeof(struct zl10353_state), GFP_KERNEL);
  527. if (state == NULL)
  528. goto error;
  529. /* setup the state */
  530. state->i2c = i2c;
  531. memcpy(&state->config, config, sizeof(struct zl10353_config));
  532. /* check if the demod is there */
  533. id = zl10353_read_register(state, CHIP_ID);
  534. if ((id != ID_ZL10353) && (id != ID_CE6230) && (id != ID_CE6231))
  535. goto error;
  536. /* create dvb_frontend */
  537. memcpy(&state->frontend.ops, &zl10353_ops, sizeof(struct dvb_frontend_ops));
  538. state->frontend.demodulator_priv = state;
  539. return &state->frontend;
  540. error:
  541. kfree(state);
  542. return NULL;
  543. }
  544. static struct dvb_frontend_ops zl10353_ops = {
  545. .delsys = { SYS_DVBT },
  546. .info = {
  547. .name = "Zarlink ZL10353 DVB-T",
  548. .frequency_min = 174000000,
  549. .frequency_max = 862000000,
  550. .frequency_stepsize = 166667,
  551. .frequency_tolerance = 0,
  552. .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 |
  553. FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 |
  554. FE_CAN_FEC_AUTO |
  555. FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO |
  556. FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO |
  557. FE_CAN_HIERARCHY_AUTO | FE_CAN_RECOVER |
  558. FE_CAN_MUTE_TS
  559. },
  560. .release = zl10353_release,
  561. .init = zl10353_init,
  562. .sleep = zl10353_sleep,
  563. .i2c_gate_ctrl = zl10353_i2c_gate_ctrl,
  564. .write = zl10353_write,
  565. .set_frontend = zl10353_set_parameters,
  566. .get_frontend = zl10353_get_parameters,
  567. .get_tune_settings = zl10353_get_tune_settings,
  568. .read_status = zl10353_read_status,
  569. .read_ber = zl10353_read_ber,
  570. .read_signal_strength = zl10353_read_signal_strength,
  571. .read_snr = zl10353_read_snr,
  572. .read_ucblocks = zl10353_read_ucblocks,
  573. };
  574. module_param(debug, int, 0644);
  575. MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off).");
  576. module_param(debug_regs, int, 0644);
  577. MODULE_PARM_DESC(debug_regs, "Turn on/off frontend register dumps (default:off).");
  578. MODULE_DESCRIPTION("Zarlink ZL10353 DVB-T demodulator driver");
  579. MODULE_AUTHOR("Chris Pascoe");
  580. MODULE_LICENSE("GPL");
  581. EXPORT_SYMBOL(zl10353_attach);