lgdt3302.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  1. /*
  2. * Support for LGDT3302 (DViCO FustionHDTV 3 Gold) - VSB/QAM
  3. *
  4. * Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net>
  5. *
  6. * Based on code from Kirk Lapray <kirk_lapray@bigfoot.com>
  7. * Copyright (C) 2005
  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. * NOTES ABOUT THIS DRIVER
  26. *
  27. * This driver supports DViCO FusionHDTV 3 Gold under Linux.
  28. *
  29. * TODO:
  30. * BER and signal strength always return 0.
  31. *
  32. */
  33. #include <linux/kernel.h>
  34. #include <linux/module.h>
  35. #include <linux/moduleparam.h>
  36. #include <linux/init.h>
  37. #include <linux/delay.h>
  38. #include <asm/byteorder.h>
  39. #include "dvb_frontend.h"
  40. #include "dvb-pll.h"
  41. #include "lgdt3302_priv.h"
  42. #include "lgdt3302.h"
  43. static int debug = 0;
  44. module_param(debug, int, 0644);
  45. MODULE_PARM_DESC(debug,"Turn on/off lgdt3302 frontend debugging (default:off).");
  46. #define dprintk(args...) \
  47. do { \
  48. if (debug) printk(KERN_DEBUG "lgdt3302: " args); \
  49. } while (0)
  50. struct lgdt3302_state
  51. {
  52. struct i2c_adapter* i2c;
  53. struct dvb_frontend_ops ops;
  54. /* Configuration settings */
  55. const struct lgdt3302_config* config;
  56. struct dvb_frontend frontend;
  57. /* Demodulator private data */
  58. fe_modulation_t current_modulation;
  59. /* Tuner private data */
  60. u32 current_frequency;
  61. };
  62. static int i2c_writebytes (struct lgdt3302_state* state,
  63. u8 addr, /* demod_address or pll_address */
  64. u8 *buf, /* data bytes to send */
  65. int len /* number of bytes to send */ )
  66. {
  67. u8 tmp[] = { buf[0], buf[1] };
  68. struct i2c_msg msg =
  69. { .addr = addr, .flags = 0, .buf = tmp, .len = 2 };
  70. int err;
  71. int i;
  72. for (i=1; i<len; i++) {
  73. tmp[1] = buf[i];
  74. if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) {
  75. printk(KERN_WARNING "lgdt3302: %s error (addr %02x <- %02x, err == %i)\n", __FUNCTION__, addr, buf[0], err);
  76. if (err < 0)
  77. return err;
  78. else
  79. return -EREMOTEIO;
  80. }
  81. tmp[0]++;
  82. }
  83. return 0;
  84. }
  85. static int i2c_readbytes (struct lgdt3302_state* state,
  86. u8 addr, /* demod_address or pll_address */
  87. u8 *buf, /* holds data bytes read */
  88. int len /* number of bytes to read */ )
  89. {
  90. struct i2c_msg msg =
  91. { .addr = addr, .flags = I2C_M_RD, .buf = buf, .len = len };
  92. int err;
  93. if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) {
  94. printk(KERN_WARNING "lgdt3302: %s error (addr %02x, err == %i)\n", __FUNCTION__, addr, err);
  95. return -EREMOTEIO;
  96. }
  97. return 0;
  98. }
  99. /*
  100. * This routine writes the register (reg) to the demod bus
  101. * then reads the data returned for (len) bytes.
  102. */
  103. static u8 i2c_selectreadbytes (struct lgdt3302_state* state,
  104. enum I2C_REG reg, u8* buf, int len)
  105. {
  106. u8 wr [] = { reg };
  107. struct i2c_msg msg [] = {
  108. { .addr = state->config->demod_address,
  109. .flags = 0, .buf = wr, .len = 1 },
  110. { .addr = state->config->demod_address,
  111. .flags = I2C_M_RD, .buf = buf, .len = len },
  112. };
  113. int ret;
  114. ret = i2c_transfer(state->i2c, msg, 2);
  115. if (ret != 2) {
  116. printk(KERN_WARNING "lgdt3302: %s: addr 0x%02x select 0x%02x error (ret == %i)\n", __FUNCTION__, state->config->demod_address, reg, ret);
  117. } else {
  118. ret = 0;
  119. }
  120. return ret;
  121. }
  122. /* Software reset */
  123. int lgdt3302_SwReset(struct lgdt3302_state* state)
  124. {
  125. u8 ret;
  126. u8 reset[] = {
  127. IRQ_MASK,
  128. 0x00 /* bit 6 is active low software reset
  129. * bits 5-0 are 1 to mask interrupts */
  130. };
  131. ret = i2c_writebytes(state,
  132. state->config->demod_address,
  133. reset, sizeof(reset));
  134. if (ret == 0) {
  135. /* spec says reset takes 100 ns why wait */
  136. /* mdelay(100); */ /* keep low for 100mS */
  137. reset[1] = 0x7f; /* force reset high (inactive)
  138. * and unmask interrupts */
  139. ret = i2c_writebytes(state,
  140. state->config->demod_address,
  141. reset, sizeof(reset));
  142. }
  143. /* Spec does not indicate a need for this either */
  144. /*mdelay(5); */ /* wait 5 msec before doing more */
  145. return ret;
  146. }
  147. static int lgdt3302_init(struct dvb_frontend* fe)
  148. {
  149. /* Hardware reset is done using gpio[0] of cx23880x chip.
  150. * I'd like to do it here, but don't know how to find chip address.
  151. * cx88-cards.c arranges for the reset bit to be inactive (high).
  152. * Maybe there needs to be a callable function in cx88-core or
  153. * the caller of this function needs to do it. */
  154. dprintk("%s entered\n", __FUNCTION__);
  155. return lgdt3302_SwReset((struct lgdt3302_state*) fe->demodulator_priv);
  156. }
  157. static int lgdt3302_read_ber(struct dvb_frontend* fe, u32* ber)
  158. {
  159. *ber = 0; /* Dummy out for now */
  160. return 0;
  161. }
  162. static int lgdt3302_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
  163. {
  164. struct lgdt3302_state* state = (struct lgdt3302_state*) fe->demodulator_priv;
  165. u8 buf[2];
  166. i2c_selectreadbytes(state, PACKET_ERR_COUNTER1, buf, sizeof(buf));
  167. *ucblocks = (buf[0] << 8) | buf[1];
  168. return 0;
  169. }
  170. static int lgdt3302_set_parameters(struct dvb_frontend* fe,
  171. struct dvb_frontend_parameters *param)
  172. {
  173. struct lgdt3302_state* state =
  174. (struct lgdt3302_state*) fe->demodulator_priv;
  175. /* Use 50MHz parameter values from spec sheet since xtal is 50 */
  176. static u8 top_ctrl_cfg[] = { TOP_CONTROL, 0x03 };
  177. static u8 vsb_freq_cfg[] = { VSB_CARRIER_FREQ0, 0x00, 0x87, 0x8e, 0x01 };
  178. static u8 demux_ctrl_cfg[] = { DEMUX_CONTROL, 0xfb };
  179. static u8 agc_rf_cfg[] = { AGC_RF_BANDWIDTH0, 0x40, 0x93, 0x00 };
  180. static u8 agc_ctrl_cfg[] = { AGC_FUNC_CTRL2, 0xc6, 0x40 };
  181. static u8 agc_delay_cfg[] = { AGC_DELAY0, 0x07, 0x00, 0xfe };
  182. static u8 agc_loop_cfg[] = { AGC_LOOP_BANDWIDTH0, 0x08, 0x9a };
  183. /* Change only if we are actually changing the modulation */
  184. if (state->current_modulation != param->u.vsb.modulation) {
  185. switch(param->u.vsb.modulation) {
  186. case VSB_8:
  187. dprintk("%s: VSB_8 MODE\n", __FUNCTION__);
  188. /* Select VSB mode and serial MPEG interface */
  189. top_ctrl_cfg[1] = 0x07;
  190. /* Select ANT connector if supported by card */
  191. if (state->config->pll_rf_set)
  192. state->config->pll_rf_set(fe, 1);
  193. break;
  194. case QAM_64:
  195. dprintk("%s: QAM_64 MODE\n", __FUNCTION__);
  196. /* Select QAM_64 mode and serial MPEG interface */
  197. top_ctrl_cfg[1] = 0x04;
  198. /* Select CABLE connector if supported by card */
  199. if (state->config->pll_rf_set)
  200. state->config->pll_rf_set(fe, 0);
  201. break;
  202. case QAM_256:
  203. dprintk("%s: QAM_256 MODE\n", __FUNCTION__);
  204. /* Select QAM_256 mode and serial MPEG interface */
  205. top_ctrl_cfg[1] = 0x05;
  206. /* Select CABLE connector if supported by card */
  207. if (state->config->pll_rf_set)
  208. state->config->pll_rf_set(fe, 0);
  209. break;
  210. default:
  211. printk(KERN_WARNING "lgdt3302: %s: Modulation type(%d) UNSUPPORTED\n", __FUNCTION__, param->u.vsb.modulation);
  212. return -1;
  213. }
  214. /* Initializations common to all modes */
  215. /* Select the requested mode */
  216. i2c_writebytes(state, state->config->demod_address,
  217. top_ctrl_cfg, sizeof(top_ctrl_cfg));
  218. /* Change the value of IFBW[11:0]
  219. of AGC IF/RF loop filter bandwidth register */
  220. i2c_writebytes(state, state->config->demod_address,
  221. agc_rf_cfg, sizeof(agc_rf_cfg));
  222. /* Change the value of bit 6, 'nINAGCBY' and
  223. 'NSSEL[1:0] of ACG function control register 2 */
  224. /* Change the value of bit 6 'RFFIX'
  225. of AGC function control register 3 */
  226. i2c_writebytes(state, state->config->demod_address,
  227. agc_ctrl_cfg, sizeof(agc_ctrl_cfg));
  228. /* Change the TPCLK pin polarity
  229. data is valid on falling clock */
  230. i2c_writebytes(state, state->config->demod_address,
  231. demux_ctrl_cfg, sizeof(demux_ctrl_cfg));
  232. /* Change the value of NCOCTFV[25:0] of carrier
  233. recovery center frequency register */
  234. i2c_writebytes(state, state->config->demod_address,
  235. vsb_freq_cfg, sizeof(vsb_freq_cfg));
  236. /* Set the value of 'INLVTHD' register 0x2a/0x2c to 0x7fe */
  237. i2c_writebytes(state, state->config->demod_address,
  238. agc_delay_cfg, sizeof(agc_delay_cfg));
  239. /* Change the value of IAGCBW[15:8]
  240. of inner AGC loop filter bandwith */
  241. i2c_writebytes(state, state->config->demod_address,
  242. agc_loop_cfg, sizeof(agc_loop_cfg));
  243. state->config->set_ts_params(fe, 0);
  244. state->current_modulation = param->u.vsb.modulation;
  245. }
  246. /* Change only if we are actually changing the channel */
  247. if (state->current_frequency != param->frequency) {
  248. u8 buf[5];
  249. /* This must be done before the initialized msg is declared */
  250. state->config->pll_set(fe, param, buf);
  251. struct i2c_msg msg =
  252. { .addr = buf[0], .flags = 0, .buf = &buf[1], .len = 4 };
  253. int err;
  254. dprintk("%s: tuner at 0x%02x bytes: 0x%02x 0x%02x "
  255. "0x%02x 0x%02x\n", __FUNCTION__,
  256. buf[0],buf[1],buf[2],buf[3],buf[4]);
  257. if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) {
  258. printk(KERN_WARNING "lgdt3302: %s error (addr %02x <- %02x, err = %i)\n", __FUNCTION__, buf[0], buf[1], err);
  259. if (err < 0)
  260. return err;
  261. else
  262. return -EREMOTEIO;
  263. }
  264. #if 0
  265. /* Check the status of the tuner pll */
  266. i2c_readbytes(state, buf[0], &buf[1], 1);
  267. dprintk("%s: tuner status byte = 0x%02x\n", __FUNCTION__, buf[1]);
  268. #endif
  269. /* Update current frequency */
  270. state->current_frequency = param->frequency;
  271. }
  272. lgdt3302_SwReset(state);
  273. return 0;
  274. }
  275. static int lgdt3302_get_frontend(struct dvb_frontend* fe,
  276. struct dvb_frontend_parameters* param)
  277. {
  278. struct lgdt3302_state *state = fe->demodulator_priv;
  279. param->frequency = state->current_frequency;
  280. return 0;
  281. }
  282. static int lgdt3302_read_status(struct dvb_frontend* fe, fe_status_t* status)
  283. {
  284. struct lgdt3302_state* state = (struct lgdt3302_state*) fe->demodulator_priv;
  285. u8 buf[3];
  286. *status = 0; /* Reset status result */
  287. /*
  288. * You must set the Mask bits to 1 in the IRQ_MASK in order
  289. * to see that status bit in the IRQ_STATUS register.
  290. * This is done in SwReset();
  291. */
  292. /* AGC status register */
  293. i2c_selectreadbytes(state, AGC_STATUS, buf, 1);
  294. dprintk("%s: AGC_STATUS = 0x%02x\n", __FUNCTION__, buf[0]);
  295. if ((buf[0] & 0x0c) == 0x8){
  296. /* Test signal does not exist flag */
  297. /* as well as the AGC lock flag. */
  298. *status |= FE_HAS_SIGNAL;
  299. } else {
  300. /* Without a signal all other status bits are meaningless */
  301. return 0;
  302. }
  303. /* signal status */
  304. i2c_selectreadbytes(state, TOP_CONTROL, buf, sizeof(buf));
  305. dprintk("%s: TOP_CONTROL = 0x%02x, IRO_MASK = 0x%02x, IRQ_STATUS = 0x%02x\n", __FUNCTION__, buf[0], buf[1], buf[2]);
  306. #if 0
  307. /* Alternative method to check for a signal */
  308. /* using the SNR good/bad interrupts. */
  309. if ((buf[2] & 0x30) == 0x10)
  310. *status |= FE_HAS_SIGNAL;
  311. #endif
  312. /* sync status */
  313. if ((buf[2] & 0x03) == 0x01) {
  314. *status |= FE_HAS_SYNC;
  315. }
  316. /* FEC error status */
  317. if ((buf[2] & 0x0c) == 0x08) {
  318. *status |= FE_HAS_LOCK;
  319. *status |= FE_HAS_VITERBI;
  320. }
  321. /* Carrier Recovery Lock Status Register */
  322. i2c_selectreadbytes(state, CARRIER_LOCK, buf, 1);
  323. dprintk("%s: CARRIER_LOCK = 0x%02x\n", __FUNCTION__, buf[0]);
  324. switch (state->current_modulation) {
  325. case QAM_256:
  326. case QAM_64:
  327. /* Need to undestand why there are 3 lock levels here */
  328. if ((buf[0] & 0x07) == 0x07)
  329. *status |= FE_HAS_CARRIER;
  330. break;
  331. case VSB_8:
  332. if ((buf[0] & 0x80) == 0x80)
  333. *status |= FE_HAS_CARRIER;
  334. break;
  335. default:
  336. printk("KERN_WARNING lgdt3302: %s: Modulation set to unsupported value\n", __FUNCTION__);
  337. }
  338. return 0;
  339. }
  340. static int lgdt3302_read_signal_strength(struct dvb_frontend* fe, u16* strength)
  341. {
  342. /* not directly available. */
  343. return 0;
  344. }
  345. static int lgdt3302_read_snr(struct dvb_frontend* fe, u16* snr)
  346. {
  347. #ifdef SNR_IN_DB
  348. /*
  349. * Spec sheet shows formula for SNR_EQ = 10 log10(25 * 24**2 / noise)
  350. * and SNR_PH = 10 log10(25 * 32**2 / noise) for equalizer and phase tracker
  351. * respectively. The following tables are built on these formulas.
  352. * The usual definition is SNR = 20 log10(signal/noise)
  353. * If the specification is wrong the value retuned is 1/2 the actual SNR in db.
  354. *
  355. * This table is a an ordered list of noise values computed by the
  356. * formula from the spec sheet such that the index into the table
  357. * starting at 43 or 45 is the SNR value in db. There are duplicate noise
  358. * value entries at the beginning because the SNR varies more than
  359. * 1 db for a change of 1 digit in noise at very small values of noise.
  360. *
  361. * Examples from SNR_EQ table:
  362. * noise SNR
  363. * 0 43
  364. * 1 42
  365. * 2 39
  366. * 3 37
  367. * 4 36
  368. * 5 35
  369. * 6 34
  370. * 7 33
  371. * 8 33
  372. * 9 32
  373. * 10 32
  374. * 11 31
  375. * 12 31
  376. * 13 30
  377. */
  378. static const u32 SNR_EQ[] =
  379. { 1, 2, 2, 2, 3, 3, 4, 4, 5, 7,
  380. 9, 11, 13, 17, 21, 26, 33, 41, 52, 65,
  381. 81, 102, 129, 162, 204, 257, 323, 406, 511, 644,
  382. 810, 1020, 1284, 1616, 2035, 2561, 3224, 4059, 5110, 6433,
  383. 8098, 10195, 12835, 16158, 20341, 25608, 32238, 40585, 51094, 64323,
  384. 80978, 101945, 128341, 161571, 203406, 256073, 0x40000
  385. };
  386. static const u32 SNR_PH[] =
  387. { 1, 2, 2, 2, 3, 3, 4, 5, 6, 8,
  388. 10, 12, 15, 19, 23, 29, 37, 46, 58, 73,
  389. 91, 115, 144, 182, 229, 288, 362, 456, 574, 722,
  390. 909, 1144, 1440, 1813, 2282, 2873, 3617, 4553, 5732, 7216,
  391. 9084, 11436, 14396, 18124, 22817, 28724, 36161, 45524, 57312, 72151,
  392. 90833, 114351, 143960, 181235, 228161, 0x040000
  393. };
  394. static u8 buf[5];/* read data buffer */
  395. static u32 noise; /* noise value */
  396. static u32 snr_db; /* index into SNR_EQ[] */
  397. struct lgdt3302_state* state = (struct lgdt3302_state*) fe->demodulator_priv;
  398. /* read both equalizer and pase tracker noise data */
  399. i2c_selectreadbytes(state, EQPH_ERR0, buf, sizeof(buf));
  400. if (state->current_modulation == VSB_8) {
  401. /* Equalizer Mean-Square Error Register for VSB */
  402. noise = ((buf[0] & 7) << 16) | (buf[1] << 8) | buf[2];
  403. /*
  404. * Look up noise value in table.
  405. * A better search algorithm could be used...
  406. * watch out there are duplicate entries.
  407. */
  408. for (snr_db = 0; snr_db < sizeof(SNR_EQ); snr_db++) {
  409. if (noise < SNR_EQ[snr_db]) {
  410. *snr = 43 - snr_db;
  411. break;
  412. }
  413. }
  414. } else {
  415. /* Phase Tracker Mean-Square Error Register for QAM */
  416. noise = ((buf[0] & 7<<3) << 13) | (buf[3] << 8) | buf[4];
  417. /* Look up noise value in table. */
  418. for (snr_db = 0; snr_db < sizeof(SNR_PH); snr_db++) {
  419. if (noise < SNR_PH[snr_db]) {
  420. *snr = 45 - snr_db;
  421. break;
  422. }
  423. }
  424. }
  425. #else
  426. /* Return the raw noise value */
  427. static u8 buf[5];/* read data buffer */
  428. static u32 noise; /* noise value */
  429. struct lgdt3302_state* state = (struct lgdt3302_state*) fe->demodulator_priv;
  430. /* read both equalizer and pase tracker noise data */
  431. i2c_selectreadbytes(state, EQPH_ERR0, buf, sizeof(buf));
  432. if (state->current_modulation == VSB_8) {
  433. /* Equalizer Mean-Square Error Register for VSB */
  434. noise = ((buf[0] & 7) << 16) | (buf[1] << 8) | buf[2];
  435. } else {
  436. /* Phase Tracker Mean-Square Error Register for QAM */
  437. noise = ((buf[0] & 7<<3) << 13) | (buf[3] << 8) | buf[4];
  438. }
  439. /* Small values for noise mean signal is better so invert noise */
  440. /* Noise is 19 bit value so discard 3 LSB*/
  441. *snr = ~noise>>3;
  442. #endif
  443. dprintk("%s: noise = 0x%05x, snr = %idb\n",__FUNCTION__, noise, *snr);
  444. return 0;
  445. }
  446. static int lgdt3302_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fe_tune_settings)
  447. {
  448. /* I have no idea about this - it may not be needed */
  449. fe_tune_settings->min_delay_ms = 500;
  450. fe_tune_settings->step_size = 0;
  451. fe_tune_settings->max_drift = 0;
  452. return 0;
  453. }
  454. static void lgdt3302_release(struct dvb_frontend* fe)
  455. {
  456. struct lgdt3302_state* state = (struct lgdt3302_state*) fe->demodulator_priv;
  457. kfree(state);
  458. }
  459. static struct dvb_frontend_ops lgdt3302_ops;
  460. struct dvb_frontend* lgdt3302_attach(const struct lgdt3302_config* config,
  461. struct i2c_adapter* i2c)
  462. {
  463. struct lgdt3302_state* state = NULL;
  464. u8 buf[1];
  465. /* Allocate memory for the internal state */
  466. state = (struct lgdt3302_state*) kmalloc(sizeof(struct lgdt3302_state), GFP_KERNEL);
  467. if (state == NULL)
  468. goto error;
  469. memset(state,0,sizeof(*state));
  470. /* Setup the state */
  471. state->config = config;
  472. state->i2c = i2c;
  473. memcpy(&state->ops, &lgdt3302_ops, sizeof(struct dvb_frontend_ops));
  474. /* Verify communication with demod chip */
  475. if (i2c_selectreadbytes(state, 2, buf, 1))
  476. goto error;
  477. state->current_frequency = -1;
  478. state->current_modulation = -1;
  479. /* Create dvb_frontend */
  480. state->frontend.ops = &state->ops;
  481. state->frontend.demodulator_priv = state;
  482. return &state->frontend;
  483. error:
  484. if (state)
  485. kfree(state);
  486. dprintk("%s: ERROR\n",__FUNCTION__);
  487. return NULL;
  488. }
  489. static struct dvb_frontend_ops lgdt3302_ops = {
  490. .info = {
  491. .name= "LG Electronics LGDT3302 VSB/QAM Frontend",
  492. .type = FE_ATSC,
  493. .frequency_min= 54000000,
  494. .frequency_max= 858000000,
  495. .frequency_stepsize= 62500,
  496. /* Symbol rate is for all VSB modes need to check QAM */
  497. .symbol_rate_min = 10762000,
  498. .symbol_rate_max = 10762000,
  499. .caps = FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB
  500. },
  501. .init = lgdt3302_init,
  502. .set_frontend = lgdt3302_set_parameters,
  503. .get_frontend = lgdt3302_get_frontend,
  504. .get_tune_settings = lgdt3302_get_tune_settings,
  505. .read_status = lgdt3302_read_status,
  506. .read_ber = lgdt3302_read_ber,
  507. .read_signal_strength = lgdt3302_read_signal_strength,
  508. .read_snr = lgdt3302_read_snr,
  509. .read_ucblocks = lgdt3302_read_ucblocks,
  510. .release = lgdt3302_release,
  511. };
  512. MODULE_DESCRIPTION("LGDT3302 [DViCO FusionHDTV 3 Gold] (ATSC 8VSB & ITU-T J.83 AnnexB 64/256 QAM) Demodulator Driver");
  513. MODULE_AUTHOR("Wilson Michaels");
  514. MODULE_LICENSE("GPL");
  515. EXPORT_SYMBOL(lgdt3302_attach);
  516. /*
  517. * Local variables:
  518. * c-basic-offset: 8
  519. * compile-command: "make DVB=1"
  520. * End:
  521. */