zl10353.c 16 KB

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