stb6100.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. /*
  2. STB6100 Silicon Tuner
  3. Copyright (C) Manu Abraham (abraham.manu@gmail.com)
  4. Copyright (C) ST Microelectronics
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. */
  17. #include <linux/init.h>
  18. #include <linux/kernel.h>
  19. #include <linux/module.h>
  20. #include <linux/string.h>
  21. #include "dvb_frontend.h"
  22. #include "stb6100.h"
  23. static unsigned int verbose;
  24. module_param(verbose, int, 0644);
  25. #define FE_ERROR 0
  26. #define FE_NOTICE 1
  27. #define FE_INFO 2
  28. #define FE_DEBUG 3
  29. #define dprintk(x, y, z, format, arg...) do { \
  30. if (z) { \
  31. if ((x > FE_ERROR) && (x > y)) \
  32. printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \
  33. else if ((x > FE_NOTICE) && (x > y)) \
  34. printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \
  35. else if ((x > FE_INFO) && (x > y)) \
  36. printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \
  37. else if ((x > FE_DEBUG) && (x > y)) \
  38. printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \
  39. } else { \
  40. if (x > y) \
  41. printk(format, ##arg); \
  42. } \
  43. } while(0)
  44. struct stb6100_lkup {
  45. u32 val_low;
  46. u32 val_high;
  47. u8 reg;
  48. };
  49. static int stb6100_release(struct dvb_frontend *fe);
  50. static const struct stb6100_lkup lkup[] = {
  51. { 0, 950000, 0x0a },
  52. { 950000, 1000000, 0x0a },
  53. { 1000000, 1075000, 0x0c },
  54. { 1075000, 1200000, 0x00 },
  55. { 1200000, 1300000, 0x01 },
  56. { 1300000, 1370000, 0x02 },
  57. { 1370000, 1470000, 0x04 },
  58. { 1470000, 1530000, 0x05 },
  59. { 1530000, 1650000, 0x06 },
  60. { 1650000, 1800000, 0x08 },
  61. { 1800000, 1950000, 0x0a },
  62. { 1950000, 2150000, 0x0c },
  63. { 2150000, 9999999, 0x0c },
  64. { 0, 0, 0x00 }
  65. };
  66. /* Register names for easy debugging. */
  67. static const char *stb6100_regnames[] = {
  68. [STB6100_LD] = "LD",
  69. [STB6100_VCO] = "VCO",
  70. [STB6100_NI] = "NI",
  71. [STB6100_NF_LSB] = "NF",
  72. [STB6100_K] = "K",
  73. [STB6100_G] = "G",
  74. [STB6100_F] = "F",
  75. [STB6100_DLB] = "DLB",
  76. [STB6100_TEST1] = "TEST1",
  77. [STB6100_FCCK] = "FCCK",
  78. [STB6100_LPEN] = "LPEN",
  79. [STB6100_TEST3] = "TEST3",
  80. };
  81. /* Template for normalisation, i.e. setting unused or undocumented
  82. * bits as required according to the documentation.
  83. */
  84. struct stb6100_regmask {
  85. u8 mask;
  86. u8 set;
  87. };
  88. static const struct stb6100_regmask stb6100_template[] = {
  89. [STB6100_LD] = { 0xff, 0x00 },
  90. [STB6100_VCO] = { 0xff, 0x00 },
  91. [STB6100_NI] = { 0xff, 0x00 },
  92. [STB6100_NF_LSB] = { 0xff, 0x00 },
  93. [STB6100_K] = { 0xc7, 0x38 },
  94. [STB6100_G] = { 0xef, 0x10 },
  95. [STB6100_F] = { 0x1f, 0xc0 },
  96. [STB6100_DLB] = { 0x38, 0xc4 },
  97. [STB6100_TEST1] = { 0x00, 0x8f },
  98. [STB6100_FCCK] = { 0x40, 0x0d },
  99. [STB6100_LPEN] = { 0xf0, 0x0b },
  100. [STB6100_TEST3] = { 0x00, 0xde },
  101. };
  102. static void stb6100_normalise_regs(u8 regs[])
  103. {
  104. int i;
  105. for (i = 0; i < STB6100_NUMREGS; i++)
  106. regs[i] = (regs[i] & stb6100_template[i].mask) | stb6100_template[i].set;
  107. }
  108. static int stb6100_read_regs(struct stb6100_state *state, u8 regs[])
  109. {
  110. int rc;
  111. struct i2c_msg msg = {
  112. .addr = state->config->tuner_address,
  113. .flags = I2C_M_RD,
  114. .buf = regs,
  115. .len = STB6100_NUMREGS
  116. };
  117. if (state->frontend->ops.i2c_gate_ctrl)
  118. if ((rc = state->frontend->ops.i2c_gate_ctrl(state->frontend, 1)) < 0)
  119. return rc;
  120. rc = i2c_transfer(state->i2c, &msg, 1);
  121. if (state->frontend->ops.i2c_gate_ctrl) {
  122. int rc2;
  123. if ((rc2 = state->frontend->ops.i2c_gate_ctrl(state->frontend, 0)) < 0)
  124. return rc2;
  125. }
  126. if (unlikely(rc != 1)) {
  127. dprintk(verbose, FE_ERROR, 1, "Read (0x%x) err, rc=[%d]",
  128. state->config->tuner_address, rc);
  129. return -EREMOTEIO;
  130. }
  131. if (unlikely(verbose > FE_DEBUG)) {
  132. int i;
  133. dprintk(verbose, FE_DEBUG, 1, " Read from 0x%02x", state->config->tuner_address);
  134. for (i = 0; i < STB6100_NUMREGS; i++)
  135. dprintk(verbose, FE_DEBUG, 1, " %s: 0x%02x", stb6100_regnames[i], regs[i]);
  136. }
  137. return 0;
  138. }
  139. static int stb6100_read_reg(struct stb6100_state *state, u8 reg)
  140. {
  141. u8 regs[STB6100_NUMREGS];
  142. int rc;
  143. if (unlikely(reg >= STB6100_NUMREGS)) {
  144. dprintk(verbose, FE_ERROR, 1, "Invalid register offset 0x%x", reg);
  145. return -EINVAL;
  146. }
  147. if ((rc = stb6100_read_regs(state, regs)) < 0)
  148. return rc;
  149. return (unsigned int)regs[reg];
  150. }
  151. static int stb6100_write_reg_range(struct stb6100_state *state, u8 buf[], int start, int len)
  152. {
  153. int rc;
  154. u8 cmdbuf[len + 1];
  155. struct i2c_msg msg = {
  156. .addr = state->config->tuner_address,
  157. .flags = 0,
  158. .buf = cmdbuf,
  159. .len = len + 1
  160. };
  161. if (unlikely(start < 1 || start + len > STB6100_NUMREGS)) {
  162. dprintk(verbose, FE_ERROR, 1, "Invalid register range %d:%d",
  163. start, len);
  164. return -EINVAL;
  165. }
  166. memcpy(&cmdbuf[1], buf, len);
  167. cmdbuf[0] = start;
  168. if (unlikely(verbose > FE_DEBUG)) {
  169. int i;
  170. dprintk(verbose, FE_DEBUG, 1, " Write @ 0x%02x: [%d:%d]", state->config->tuner_address, start, len);
  171. for (i = 0; i < len; i++)
  172. dprintk(verbose, FE_DEBUG, 1, " %s: 0x%02x", stb6100_regnames[start + i], buf[i]);
  173. }
  174. if (state->frontend->ops.i2c_gate_ctrl)
  175. if ((rc = state->frontend->ops.i2c_gate_ctrl(state->frontend, 1)) < 0)
  176. return rc;
  177. rc = i2c_transfer(state->i2c, &msg, 1);
  178. if (state->frontend->ops.i2c_gate_ctrl) {
  179. int rc2;
  180. if ((rc2 = state->frontend->ops.i2c_gate_ctrl(state->frontend, 0)) < 0)
  181. return rc2;
  182. }
  183. if (unlikely(rc != 1)) {
  184. dprintk(verbose, FE_ERROR, 1, "(0x%x) write err [%d:%d], rc=[%d]",
  185. (unsigned int)state->config->tuner_address, start, len, rc);
  186. return -EREMOTEIO;
  187. }
  188. return 0;
  189. }
  190. static int stb6100_write_reg(struct stb6100_state *state, u8 reg, u8 data)
  191. {
  192. if (unlikely(reg >= STB6100_NUMREGS)) {
  193. dprintk(verbose, FE_ERROR, 1, "Invalid register offset 0x%x", reg);
  194. return -EREMOTEIO;
  195. }
  196. data = (data & stb6100_template[reg].mask) | stb6100_template[reg].set;
  197. return stb6100_write_reg_range(state, &data, reg, 1);
  198. }
  199. static int stb6100_write_regs(struct stb6100_state *state, u8 regs[])
  200. {
  201. stb6100_normalise_regs(regs);
  202. return stb6100_write_reg_range(state, &regs[1], 1, STB6100_NUMREGS - 1);
  203. }
  204. static int stb6100_get_status(struct dvb_frontend *fe, u32 *status)
  205. {
  206. int rc;
  207. struct stb6100_state *state = fe->tuner_priv;
  208. if ((rc = stb6100_read_reg(state, STB6100_LD)) < 0)
  209. return rc;
  210. return (rc & STB6100_LD_LOCK) ? TUNER_STATUS_LOCKED : 0;
  211. }
  212. static int stb6100_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
  213. {
  214. int rc;
  215. u8 f;
  216. struct stb6100_state *state = fe->tuner_priv;
  217. if ((rc = stb6100_read_reg(state, STB6100_F)) < 0)
  218. return rc;
  219. f = rc & STB6100_F_F;
  220. state->status.bandwidth = (f + 5) * 2000; /* x2 for ZIF */
  221. *bandwidth = state->bandwidth = state->status.bandwidth * 1000;
  222. dprintk(verbose, FE_DEBUG, 1, "bandwidth = %u Hz", state->bandwidth);
  223. return 0;
  224. }
  225. static int stb6100_set_bandwidth(struct dvb_frontend *fe, u32 bandwidth)
  226. {
  227. u32 tmp;
  228. int rc;
  229. struct stb6100_state *state = fe->tuner_priv;
  230. dprintk(verbose, FE_DEBUG, 1, "set bandwidth to %u kHz", bandwidth);
  231. bandwidth *= 1000 / 2; /* kHz -> Hz, bw / 2 */
  232. if (bandwidth > 36000000) /* F[4:0] BW/2 max =31+5=36 mhz for F=31 */
  233. tmp = 31;
  234. if (bandwidth < 5000000) /* bw/2 min = 5Mhz for F=0 */
  235. tmp = 0;
  236. else /* if 5 < bw/2 < 36 */
  237. tmp = bandwidth / 1000000 - 5;
  238. /* Turn on LPF bandwidth setting clock control,
  239. * set bandwidth, wait 10ms, turn off.
  240. */
  241. if ((rc = stb6100_write_reg(state, STB6100_FCCK, 0x0d | STB6100_FCCK_FCCK)) < 0)
  242. return rc;
  243. if ((rc = stb6100_write_reg(state, STB6100_F, 0xc0 | tmp)) < 0)
  244. return rc;
  245. msleep(1);
  246. if ((rc = stb6100_write_reg(state, STB6100_FCCK, 0x0d)) < 0)
  247. return rc;
  248. return 0;
  249. }
  250. static int stb6100_get_frequency(struct dvb_frontend *fe, u32 *frequency)
  251. {
  252. int rc;
  253. u32 nint, nfrac, fvco;
  254. int psd2, odiv;
  255. struct stb6100_state *state = fe->tuner_priv;
  256. u8 regs[STB6100_NUMREGS];
  257. if ((rc = stb6100_read_regs(state, regs)) < 0)
  258. return rc;
  259. odiv = (regs[STB6100_VCO] & STB6100_VCO_ODIV) >> STB6100_VCO_ODIV_SHIFT;
  260. psd2 = (regs[STB6100_K] & STB6100_K_PSD2) >> STB6100_K_PSD2_SHIFT;
  261. nint = regs[STB6100_NI];
  262. nfrac = ((regs[STB6100_K] & STB6100_K_NF_MSB) << 8) | regs[STB6100_NF_LSB];
  263. fvco = (nfrac * state->reference >> (9 - psd2)) + (nint * state->reference << psd2);
  264. *frequency = state->frequency = fvco >> (odiv + 1);
  265. dprintk(verbose, FE_DEBUG, 1,
  266. "frequency = %u kHz, odiv = %u, psd2 = %u, fxtal = %u kHz, fvco = %u kHz, N(I) = %u, N(F) = %u",
  267. state->frequency, odiv, psd2, state->reference, fvco, nint, nfrac);
  268. return 0;
  269. }
  270. static int stb6100_set_frequency(struct dvb_frontend *fe, u32 frequency)
  271. {
  272. int rc;
  273. const struct stb6100_lkup *ptr;
  274. struct stb6100_state *state = fe->tuner_priv;
  275. struct dvbfe_params params;
  276. u32 srate = 0, fvco, nint, nfrac;
  277. u8 regs[STB6100_NUMREGS];
  278. u8 g, psd2, odiv;
  279. if ((rc = stb6100_read_regs(state, regs)) < 0)
  280. return rc;
  281. if (fe->ops.get_params) {
  282. dprintk(verbose, FE_DEBUG, 1, "Get Frontend parameters");
  283. fe->ops.get_params(fe, &params);
  284. }
  285. switch (params.delivery) {
  286. case DVBFE_DELSYS_DVBS:
  287. srate = params.delsys.dvbs.symbol_rate;
  288. dprintk(verbose, FE_DEBUG, 1, "Delivery system = DVB-S, Symbol Rate=[%d]", srate);
  289. break;
  290. case DVBFE_DELSYS_DSS:
  291. dprintk(verbose, FE_DEBUG, 1, "Delivery system = DSS, Symbol Rate=[%d]", srate);
  292. srate = params.delsys.dss.symbol_rate;
  293. break;
  294. case DVBFE_DELSYS_DVBS2:
  295. dprintk(verbose, FE_DEBUG, 1, "Delivery system = DVB-S2, Symbol Rate=[%d]", srate);
  296. srate = params.delsys.dvbs2.symbol_rate;
  297. break;
  298. default:
  299. dprintk(verbose, FE_NOTICE, 1, "symbol rate unknown!");
  300. srate = 22000000; /* just a typical default value */
  301. break;
  302. }
  303. /* Baseband gain. */
  304. if (srate >= 15000000)
  305. g = 8;
  306. else if (state->srate >= 5000000)
  307. g = 12;
  308. else
  309. g = 14;
  310. regs[STB6100_G] = (regs[STB6100_G] & ~STB6100_G_G) | g;
  311. /* VCO divide ratio (LO divide ratio, VCO prescaler enable). */
  312. if (frequency <= 1075000)
  313. odiv = 1;
  314. else
  315. odiv = 0;
  316. regs[STB6100_VCO] = (regs[STB6100_VCO] & ~STB6100_VCO_ODIV) | (odiv << STB6100_VCO_ODIV_SHIFT);
  317. if ((frequency > 1075000) && (frequency <= 1325000))
  318. psd2 = 0;
  319. else
  320. psd2 = 1;
  321. regs[STB6100_K] = (regs[STB6100_K] & ~STB6100_K_PSD2) | (psd2 << STB6100_K_PSD2_SHIFT);
  322. /* OSM */
  323. for (ptr = lkup;
  324. (ptr->val_high != 0) && !CHKRANGE(frequency, ptr->val_low, ptr->val_high);
  325. ptr++);
  326. if (ptr->val_high == 0) {
  327. printk(KERN_ERR "%s: frequency out of range: %u kHz\n", __func__, frequency);
  328. return -EINVAL;
  329. }
  330. regs[STB6100_VCO] = (regs[STB6100_VCO] & ~STB6100_VCO_OSM) | ptr->reg;
  331. /* F(VCO) = F(LO) * (ODIV == 0 ? 2 : 4) */
  332. fvco = frequency << (1 + odiv);
  333. /* N(I) = floor(f(VCO) / (f(XTAL) * (PSD2 ? 2 : 1))) */
  334. nint = fvco / (state->reference << psd2);
  335. /* N(F) = round(f(VCO) / f(XTAL) * (PSD2 ? 2 : 1) - N(I)) * 2 ^ 9 */
  336. nfrac = (((fvco - (nint * state->reference << psd2)) << (9 - psd2)) + state->reference / 2) / state->reference;
  337. dprintk(verbose, FE_DEBUG, 1,
  338. "frequency = %u, srate = %u, g = %u, odiv = %u, psd2 = %u, fxtal = %u, osm = %u, fvco = %u, N(I) = %u, N(F) = %u",
  339. frequency, srate, (unsigned int)g, (unsigned int)odiv,
  340. (unsigned int)psd2, state->reference,
  341. ptr->reg, fvco, nint, nfrac);
  342. regs[STB6100_NI] = nint;
  343. regs[STB6100_NF_LSB] = nfrac;
  344. regs[STB6100_K] = (regs[STB6100_K] & ~STB6100_K_NF_MSB) | ((nfrac >> 8) & STB6100_K_NF_MSB);
  345. regs[STB6100_VCO] |= STB6100_VCO_OSCH; /* VCO search enabled */
  346. regs[STB6100_VCO] |= STB6100_VCO_OCK; /* VCO search clock off */
  347. regs[STB6100_FCCK] |= STB6100_FCCK_FCCK; /* LPF BW setting clock enabled */
  348. regs[STB6100_LPEN] &= ~STB6100_LPEN_LPEN; /* PLL loop disabled */
  349. /* Power up. */
  350. regs[STB6100_LPEN] |= STB6100_LPEN_SYNP | STB6100_LPEN_OSCP | STB6100_LPEN_BEN;
  351. if ((rc = stb6100_write_regs(state, regs)) < 0)
  352. return rc;
  353. regs[STB6100_LPEN] |= STB6100_LPEN_LPEN; /* PLL loop enabled */
  354. if ((rc = stb6100_write_reg(state, STB6100_LPEN, regs[STB6100_LPEN])) < 0)
  355. return rc;
  356. regs[STB6100_VCO] &= ~STB6100_VCO_OCK; /* VCO fast search */
  357. if ((rc = stb6100_write_reg(state, STB6100_VCO, regs[STB6100_VCO])) < 0)
  358. return rc;
  359. msleep(5); /* wait for LO to lock */
  360. regs[STB6100_VCO] &= ~STB6100_VCO_OSCH; /* vco search disabled */
  361. regs[STB6100_VCO] |= STB6100_VCO_OCK; /* search clock off */
  362. if ((rc = stb6100_write_reg(state, STB6100_VCO, regs[STB6100_VCO])) < 0)
  363. return rc;
  364. regs[STB6100_FCCK] &= ~STB6100_FCCK_FCCK; /* LPF BW clock disabled */
  365. if ((rc = stb6100_write_reg(state, STB6100_FCCK, regs[STB6100_FCCK])) < 0)
  366. return rc;
  367. return 0;
  368. }
  369. static int stb6100_sleep(struct dvb_frontend *fe)
  370. {
  371. /* TODO: power down */
  372. return 0;
  373. }
  374. static int stb6100_init(struct dvb_frontend *fe)
  375. {
  376. struct stb6100_state *state = fe->tuner_priv;
  377. struct tuner_state *status = &state->status;
  378. status->tunerstep = 125000;
  379. status->ifreq = 0;
  380. status->refclock = 27000000; /* Hz */
  381. status->iqsense = 1;
  382. status->bandwidth = 36000; /* kHz */
  383. state->bandwidth = status->bandwidth * 1000; /* MHz */
  384. state->reference = status->refclock / 1000; /* kHz */
  385. /* Set default bandwidth. */
  386. return stb6100_set_bandwidth(fe, status->bandwidth);
  387. }
  388. static int stb6100_get_state(struct dvb_frontend *fe,
  389. enum tuner_param param,
  390. struct tuner_state *state)
  391. {
  392. switch (param) {
  393. case DVBFE_TUNER_FREQUENCY:
  394. stb6100_get_frequency(fe, &state->frequency);
  395. break;
  396. case DVBFE_TUNER_TUNERSTEP:
  397. break;
  398. case DVBFE_TUNER_IFFREQ:
  399. break;
  400. case DVBFE_TUNER_BANDWIDTH:
  401. stb6100_get_bandwidth(fe, &state->bandwidth);
  402. break;
  403. case DVBFE_TUNER_REFCLOCK:
  404. break;
  405. default:
  406. break;
  407. }
  408. return 0;
  409. }
  410. static int stb6100_set_state(struct dvb_frontend *fe,
  411. enum tuner_param param,
  412. struct tuner_state *state)
  413. {
  414. struct stb6100_state *tstate = fe->tuner_priv;
  415. switch (param) {
  416. case DVBFE_TUNER_FREQUENCY:
  417. stb6100_set_frequency(fe, state->frequency);
  418. state->frequency = tstate->frequency;
  419. break;
  420. case DVBFE_TUNER_TUNERSTEP:
  421. break;
  422. case DVBFE_TUNER_IFFREQ:
  423. break;
  424. case DVBFE_TUNER_BANDWIDTH:
  425. stb6100_set_bandwidth(fe, state->bandwidth);
  426. state->bandwidth = tstate->bandwidth;
  427. break;
  428. case DVBFE_TUNER_REFCLOCK:
  429. break;
  430. default:
  431. break;
  432. }
  433. return 0;
  434. }
  435. static struct dvb_tuner_ops stb6100_ops = {
  436. .info = {
  437. .name = "STB6100 Silicon Tuner",
  438. .frequency_min = 950000,
  439. .frequency_max = 2150000,
  440. .frequency_step = 0,
  441. },
  442. .init = stb6100_init,
  443. .sleep = stb6100_sleep,
  444. .get_status = stb6100_get_status,
  445. .get_state = stb6100_get_state,
  446. .set_state = stb6100_set_state,
  447. .release = stb6100_release
  448. };
  449. struct dvb_frontend *stb6100_attach(struct dvb_frontend *fe,
  450. struct stb6100_config *config,
  451. struct i2c_adapter *i2c)
  452. {
  453. struct stb6100_state *state = NULL;
  454. state = kzalloc(sizeof (struct stb6100_state), GFP_KERNEL);
  455. if (state == NULL)
  456. goto error;
  457. state->config = config;
  458. state->i2c = i2c;
  459. state->frontend = fe;
  460. state->reference = config->refclock / 1000; /* kHz */
  461. fe->tuner_priv = state;
  462. fe->ops.tuner_ops = stb6100_ops;
  463. printk("%s: Attaching STB6100 \n", __func__);
  464. return fe;
  465. error:
  466. kfree(state);
  467. return NULL;
  468. }
  469. static int stb6100_release(struct dvb_frontend *fe)
  470. {
  471. struct stb6100_state *state = fe->tuner_priv;
  472. fe->tuner_priv = NULL;
  473. kfree(state);
  474. return 0;
  475. }
  476. EXPORT_SYMBOL(stb6100_attach);
  477. MODULE_PARM_DESC(verbose, "Set Verbosity level");
  478. MODULE_AUTHOR("Manu Abraham");
  479. MODULE_DESCRIPTION("STB6100 Silicon tuner");
  480. MODULE_LICENSE("GPL");