zl10353.c 15 KB

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