tda827x.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  1. /*
  2. *
  3. * (c) 2005 Hartmut Hackmann
  4. * (c) 2007 Michael Krufky
  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. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20. #include <linux/module.h>
  21. #include <linux/dvb/frontend.h>
  22. #include <asm/types.h>
  23. #include "tda827x.h"
  24. static int debug = 0;
  25. #define dprintk(args...) \
  26. do { \
  27. if (debug) printk(KERN_DEBUG "tda827x: " args); \
  28. } while (0)
  29. struct tda827x_priv {
  30. int i2c_addr;
  31. struct i2c_adapter *i2c_adap;
  32. struct tda827x_config *cfg;
  33. u32 frequency;
  34. u32 bandwidth;
  35. };
  36. struct tda827x_data {
  37. u32 lomax;
  38. u8 spd;
  39. u8 bs;
  40. u8 bp;
  41. u8 cp;
  42. u8 gc3;
  43. u8 div1p5;
  44. };
  45. static const struct tda827x_data tda827x_dvbt[] = {
  46. { .lomax = 62000000, .spd = 3, .bs = 2, .bp = 0, .cp = 0, .gc3 = 3, .div1p5 = 1},
  47. { .lomax = 66000000, .spd = 3, .bs = 3, .bp = 0, .cp = 0, .gc3 = 3, .div1p5 = 1},
  48. { .lomax = 76000000, .spd = 3, .bs = 1, .bp = 0, .cp = 0, .gc3 = 3, .div1p5 = 0},
  49. { .lomax = 84000000, .spd = 3, .bs = 2, .bp = 0, .cp = 0, .gc3 = 3, .div1p5 = 0},
  50. { .lomax = 93000000, .spd = 3, .bs = 2, .bp = 0, .cp = 0, .gc3 = 1, .div1p5 = 0},
  51. { .lomax = 98000000, .spd = 3, .bs = 3, .bp = 0, .cp = 0, .gc3 = 1, .div1p5 = 0},
  52. { .lomax = 109000000, .spd = 3, .bs = 3, .bp = 1, .cp = 0, .gc3 = 1, .div1p5 = 0},
  53. { .lomax = 123000000, .spd = 2, .bs = 2, .bp = 1, .cp = 0, .gc3 = 1, .div1p5 = 1},
  54. { .lomax = 133000000, .spd = 2, .bs = 3, .bp = 1, .cp = 0, .gc3 = 1, .div1p5 = 1},
  55. { .lomax = 151000000, .spd = 2, .bs = 1, .bp = 1, .cp = 0, .gc3 = 1, .div1p5 = 0},
  56. { .lomax = 154000000, .spd = 2, .bs = 2, .bp = 1, .cp = 0, .gc3 = 1, .div1p5 = 0},
  57. { .lomax = 181000000, .spd = 2, .bs = 2, .bp = 1, .cp = 0, .gc3 = 0, .div1p5 = 0},
  58. { .lomax = 185000000, .spd = 2, .bs = 2, .bp = 2, .cp = 0, .gc3 = 1, .div1p5 = 0},
  59. { .lomax = 217000000, .spd = 2, .bs = 3, .bp = 2, .cp = 0, .gc3 = 1, .div1p5 = 0},
  60. { .lomax = 244000000, .spd = 1, .bs = 2, .bp = 2, .cp = 0, .gc3 = 1, .div1p5 = 1},
  61. { .lomax = 265000000, .spd = 1, .bs = 3, .bp = 2, .cp = 0, .gc3 = 1, .div1p5 = 1},
  62. { .lomax = 302000000, .spd = 1, .bs = 1, .bp = 2, .cp = 0, .gc3 = 1, .div1p5 = 0},
  63. { .lomax = 324000000, .spd = 1, .bs = 2, .bp = 2, .cp = 0, .gc3 = 1, .div1p5 = 0},
  64. { .lomax = 370000000, .spd = 1, .bs = 2, .bp = 3, .cp = 0, .gc3 = 1, .div1p5 = 0},
  65. { .lomax = 454000000, .spd = 1, .bs = 3, .bp = 3, .cp = 0, .gc3 = 1, .div1p5 = 0},
  66. { .lomax = 493000000, .spd = 0, .bs = 2, .bp = 3, .cp = 0, .gc3 = 1, .div1p5 = 1},
  67. { .lomax = 530000000, .spd = 0, .bs = 3, .bp = 3, .cp = 0, .gc3 = 1, .div1p5 = 1},
  68. { .lomax = 554000000, .spd = 0, .bs = 1, .bp = 3, .cp = 0, .gc3 = 1, .div1p5 = 0},
  69. { .lomax = 604000000, .spd = 0, .bs = 1, .bp = 4, .cp = 0, .gc3 = 0, .div1p5 = 0},
  70. { .lomax = 696000000, .spd = 0, .bs = 2, .bp = 4, .cp = 0, .gc3 = 0, .div1p5 = 0},
  71. { .lomax = 740000000, .spd = 0, .bs = 2, .bp = 4, .cp = 1, .gc3 = 0, .div1p5 = 0},
  72. { .lomax = 820000000, .spd = 0, .bs = 3, .bp = 4, .cp = 0, .gc3 = 0, .div1p5 = 0},
  73. { .lomax = 865000000, .spd = 0, .bs = 3, .bp = 4, .cp = 1, .gc3 = 0, .div1p5 = 0},
  74. { .lomax = 0, .spd = 0, .bs = 0, .bp = 0, .cp = 0, .gc3 = 0, .div1p5 = 0}
  75. };
  76. static int tda827xo_set_params(struct dvb_frontend *fe,
  77. struct dvb_frontend_parameters *params)
  78. {
  79. struct tda827x_priv *priv = fe->tuner_priv;
  80. u8 buf[14];
  81. struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0,
  82. .buf = buf, .len = sizeof(buf) };
  83. int i, tuner_freq, if_freq;
  84. u32 N;
  85. switch (params->u.ofdm.bandwidth) {
  86. case BANDWIDTH_6_MHZ:
  87. if_freq = 4000000;
  88. break;
  89. case BANDWIDTH_7_MHZ:
  90. if_freq = 4500000;
  91. break;
  92. default: /* 8 MHz or Auto */
  93. if_freq = 5000000;
  94. break;
  95. }
  96. tuner_freq = params->frequency + if_freq;
  97. i = 0;
  98. while (tda827x_dvbt[i].lomax < tuner_freq) {
  99. if(tda827x_dvbt[i + 1].lomax == 0)
  100. break;
  101. i++;
  102. }
  103. N = ((tuner_freq + 125000) / 250000) << (tda827x_dvbt[i].spd + 2);
  104. buf[0] = 0;
  105. buf[1] = (N>>8) | 0x40;
  106. buf[2] = N & 0xff;
  107. buf[3] = 0;
  108. buf[4] = 0x52;
  109. buf[5] = (tda827x_dvbt[i].spd << 6) + (tda827x_dvbt[i].div1p5 << 5) +
  110. (tda827x_dvbt[i].bs << 3) + tda827x_dvbt[i].bp;
  111. buf[6] = (tda827x_dvbt[i].gc3 << 4) + 0x8f;
  112. buf[7] = 0xbf;
  113. buf[8] = 0x2a;
  114. buf[9] = 0x05;
  115. buf[10] = 0xff;
  116. buf[11] = 0x00;
  117. buf[12] = 0x00;
  118. buf[13] = 0x40;
  119. msg.len = 14;
  120. if (fe->ops.i2c_gate_ctrl)
  121. fe->ops.i2c_gate_ctrl(fe, 1);
  122. if (i2c_transfer(priv->i2c_adap, &msg, 1) != 1) {
  123. printk("%s: could not write to tuner at addr: 0x%02x\n",
  124. __FUNCTION__, priv->i2c_addr << 1);
  125. return -EIO;
  126. }
  127. msleep(500);
  128. /* correct CP value */
  129. buf[0] = 0x30;
  130. buf[1] = 0x50 + tda827x_dvbt[i].cp;
  131. msg.len = 2;
  132. if (fe->ops.i2c_gate_ctrl)
  133. fe->ops.i2c_gate_ctrl(fe, 1);
  134. i2c_transfer(priv->i2c_adap, &msg, 1);
  135. priv->frequency = tuner_freq - if_freq; // FIXME
  136. priv->bandwidth = (fe->ops.info.type == FE_OFDM) ? params->u.ofdm.bandwidth : 0;
  137. return 0;
  138. }
  139. static int tda827xo_sleep(struct dvb_frontend *fe)
  140. {
  141. struct tda827x_priv *priv = fe->tuner_priv;
  142. static u8 buf[] = { 0x30, 0xd0 };
  143. struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0,
  144. .buf = buf, .len = sizeof(buf) };
  145. if (fe->ops.i2c_gate_ctrl)
  146. fe->ops.i2c_gate_ctrl(fe, 1);
  147. i2c_transfer(priv->i2c_adap, &msg, 1);
  148. if (priv->cfg && priv->cfg->sleep)
  149. priv->cfg->sleep(fe);
  150. return 0;
  151. }
  152. /* ------------------------------------------------------------------ */
  153. struct tda827xa_data {
  154. u32 lomax;
  155. u8 svco;
  156. u8 spd;
  157. u8 scr;
  158. u8 sbs;
  159. u8 gc3;
  160. };
  161. static const struct tda827xa_data tda827xa_dvbt[] = {
  162. { .lomax = 56875000, .svco = 3, .spd = 4, .scr = 0, .sbs = 0, .gc3 = 1},
  163. { .lomax = 67250000, .svco = 0, .spd = 3, .scr = 0, .sbs = 0, .gc3 = 1},
  164. { .lomax = 81250000, .svco = 1, .spd = 3, .scr = 0, .sbs = 0, .gc3 = 1},
  165. { .lomax = 97500000, .svco = 2, .spd = 3, .scr = 0, .sbs = 0, .gc3 = 1},
  166. { .lomax = 113750000, .svco = 3, .spd = 3, .scr = 0, .sbs = 1, .gc3 = 1},
  167. { .lomax = 134500000, .svco = 0, .spd = 2, .scr = 0, .sbs = 1, .gc3 = 1},
  168. { .lomax = 154000000, .svco = 1, .spd = 2, .scr = 0, .sbs = 1, .gc3 = 1},
  169. { .lomax = 162500000, .svco = 1, .spd = 2, .scr = 0, .sbs = 1, .gc3 = 1},
  170. { .lomax = 183000000, .svco = 2, .spd = 2, .scr = 0, .sbs = 1, .gc3 = 1},
  171. { .lomax = 195000000, .svco = 2, .spd = 2, .scr = 0, .sbs = 2, .gc3 = 1},
  172. { .lomax = 227500000, .svco = 3, .spd = 2, .scr = 0, .sbs = 2, .gc3 = 1},
  173. { .lomax = 269000000, .svco = 0, .spd = 1, .scr = 0, .sbs = 2, .gc3 = 1},
  174. { .lomax = 290000000, .svco = 1, .spd = 1, .scr = 0, .sbs = 2, .gc3 = 1},
  175. { .lomax = 325000000, .svco = 1, .spd = 1, .scr = 0, .sbs = 3, .gc3 = 1},
  176. { .lomax = 390000000, .svco = 2, .spd = 1, .scr = 0, .sbs = 3, .gc3 = 1},
  177. { .lomax = 455000000, .svco = 3, .spd = 1, .scr = 0, .sbs = 3, .gc3 = 1},
  178. { .lomax = 520000000, .svco = 0, .spd = 0, .scr = 0, .sbs = 3, .gc3 = 1},
  179. { .lomax = 538000000, .svco = 0, .spd = 0, .scr = 1, .sbs = 3, .gc3 = 1},
  180. { .lomax = 550000000, .svco = 1, .spd = 0, .scr = 0, .sbs = 3, .gc3 = 1},
  181. { .lomax = 620000000, .svco = 1, .spd = 0, .scr = 0, .sbs = 4, .gc3 = 0},
  182. { .lomax = 650000000, .svco = 1, .spd = 0, .scr = 1, .sbs = 4, .gc3 = 0},
  183. { .lomax = 700000000, .svco = 2, .spd = 0, .scr = 0, .sbs = 4, .gc3 = 0},
  184. { .lomax = 780000000, .svco = 2, .spd = 0, .scr = 1, .sbs = 4, .gc3 = 0},
  185. { .lomax = 820000000, .svco = 3, .spd = 0, .scr = 0, .sbs = 4, .gc3 = 0},
  186. { .lomax = 870000000, .svco = 3, .spd = 0, .scr = 1, .sbs = 4, .gc3 = 0},
  187. { .lomax = 911000000, .svco = 3, .spd = 0, .scr = 2, .sbs = 4, .gc3 = 0},
  188. { .lomax = 0, .svco = 0, .spd = 0, .scr = 0, .sbs = 0, .gc3 = 0}
  189. };
  190. static int tda827xa_set_params(struct dvb_frontend *fe,
  191. struct dvb_frontend_parameters *params)
  192. {
  193. struct tda827x_priv *priv = fe->tuner_priv;
  194. u8 buf[11];
  195. struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0,
  196. .buf = buf, .len = sizeof(buf) };
  197. int i, tuner_freq, if_freq;
  198. u32 N;
  199. if (priv->cfg && priv->cfg->lna_gain)
  200. priv->cfg->lna_gain(fe, 1);
  201. msleep(20);
  202. switch (params->u.ofdm.bandwidth) {
  203. case BANDWIDTH_6_MHZ:
  204. if_freq = 4000000;
  205. break;
  206. case BANDWIDTH_7_MHZ:
  207. if_freq = 4500000;
  208. break;
  209. default: /* 8 MHz or Auto */
  210. if_freq = 5000000;
  211. break;
  212. }
  213. tuner_freq = params->frequency + if_freq;
  214. i = 0;
  215. while (tda827xa_dvbt[i].lomax < tuner_freq) {
  216. if(tda827xa_dvbt[i + 1].lomax == 0)
  217. break;
  218. i++;
  219. }
  220. N = ((tuner_freq + 31250) / 62500) << tda827xa_dvbt[i].spd;
  221. buf[0] = 0; // subaddress
  222. buf[1] = N >> 8;
  223. buf[2] = N & 0xff;
  224. buf[3] = 0;
  225. buf[4] = 0x16;
  226. buf[5] = (tda827xa_dvbt[i].spd << 5) + (tda827xa_dvbt[i].svco << 3) +
  227. tda827xa_dvbt[i].sbs;
  228. buf[6] = 0x4b + (tda827xa_dvbt[i].gc3 << 4);
  229. buf[7] = 0x1c;
  230. buf[8] = 0x06;
  231. buf[9] = 0x24;
  232. buf[10] = 0x00;
  233. msg.len = 11;
  234. if (fe->ops.i2c_gate_ctrl)
  235. fe->ops.i2c_gate_ctrl(fe, 1);
  236. if (i2c_transfer(priv->i2c_adap, &msg, 1) != 1) {
  237. printk("%s: could not write to tuner at addr: 0x%02x\n",
  238. __FUNCTION__, priv->i2c_addr << 1);
  239. return -EIO;
  240. }
  241. buf[0] = 0x90;
  242. buf[1] = 0xff;
  243. buf[2] = 0x60;
  244. buf[3] = 0x00;
  245. buf[4] = 0x59; // lpsel, for 6MHz + 2
  246. msg.len = 5;
  247. if (fe->ops.i2c_gate_ctrl)
  248. fe->ops.i2c_gate_ctrl(fe, 1);
  249. i2c_transfer(priv->i2c_adap, &msg, 1);
  250. buf[0] = 0xa0;
  251. buf[1] = 0x40;
  252. msg.len = 2;
  253. if (fe->ops.i2c_gate_ctrl)
  254. fe->ops.i2c_gate_ctrl(fe, 1);
  255. i2c_transfer(priv->i2c_adap, &msg, 1);
  256. msleep(11);
  257. msg.flags = I2C_M_RD;
  258. if (fe->ops.i2c_gate_ctrl)
  259. fe->ops.i2c_gate_ctrl(fe, 1);
  260. i2c_transfer(priv->i2c_adap, &msg, 1);
  261. msg.flags = 0;
  262. buf[1] >>= 4;
  263. dprintk("tda8275a AGC2 gain is: %d\n", buf[1]);
  264. if ((buf[1]) < 2) {
  265. if (priv->cfg && priv->cfg->lna_gain)
  266. priv->cfg->lna_gain(fe, 0);
  267. buf[0] = 0x60;
  268. buf[1] = 0x0c;
  269. if (fe->ops.i2c_gate_ctrl)
  270. fe->ops.i2c_gate_ctrl(fe, 1);
  271. i2c_transfer(priv->i2c_adap, &msg, 1);
  272. }
  273. buf[0] = 0xc0;
  274. buf[1] = 0x99; // lpsel, for 6MHz + 2
  275. if (fe->ops.i2c_gate_ctrl)
  276. fe->ops.i2c_gate_ctrl(fe, 1);
  277. i2c_transfer(priv->i2c_adap, &msg, 1);
  278. buf[0] = 0x60;
  279. buf[1] = 0x3c;
  280. if (fe->ops.i2c_gate_ctrl)
  281. fe->ops.i2c_gate_ctrl(fe, 1);
  282. i2c_transfer(priv->i2c_adap, &msg, 1);
  283. /* correct CP value */
  284. buf[0] = 0x30;
  285. buf[1] = 0x10 + tda827xa_dvbt[i].scr;
  286. if (fe->ops.i2c_gate_ctrl)
  287. fe->ops.i2c_gate_ctrl(fe, 1);
  288. i2c_transfer(priv->i2c_adap, &msg, 1);
  289. msleep(163);
  290. buf[0] = 0xc0;
  291. buf[1] = 0x39; // lpsel, for 6MHz + 2
  292. if (fe->ops.i2c_gate_ctrl)
  293. fe->ops.i2c_gate_ctrl(fe, 1);
  294. i2c_transfer(priv->i2c_adap, &msg, 1);
  295. msleep(3);
  296. /* freeze AGC1 */
  297. buf[0] = 0x50;
  298. buf[1] = 0x4f + (tda827xa_dvbt[i].gc3 << 4);
  299. if (fe->ops.i2c_gate_ctrl)
  300. fe->ops.i2c_gate_ctrl(fe, 1);
  301. i2c_transfer(priv->i2c_adap, &msg, 1);
  302. priv->frequency = tuner_freq - if_freq; // FIXME
  303. priv->bandwidth = (fe->ops.info.type == FE_OFDM) ? params->u.ofdm.bandwidth : 0;
  304. return 0;
  305. }
  306. static int tda827xa_sleep(struct dvb_frontend *fe)
  307. {
  308. struct tda827x_priv *priv = fe->tuner_priv;
  309. static u8 buf[] = { 0x30, 0x90 };
  310. struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0,
  311. .buf = buf, .len = sizeof(buf) };
  312. if (fe->ops.i2c_gate_ctrl)
  313. fe->ops.i2c_gate_ctrl(fe, 1);
  314. i2c_transfer(priv->i2c_adap, &msg, 1);
  315. if (fe->ops.i2c_gate_ctrl)
  316. fe->ops.i2c_gate_ctrl(fe, 0);
  317. if (priv->cfg && priv->cfg->sleep)
  318. priv->cfg->sleep(fe);
  319. return 0;
  320. }
  321. static int tda827x_release(struct dvb_frontend *fe)
  322. {
  323. kfree(fe->tuner_priv);
  324. fe->tuner_priv = NULL;
  325. return 0;
  326. }
  327. static int tda827x_get_frequency(struct dvb_frontend *fe, u32 *frequency)
  328. {
  329. struct tda827x_priv *priv = fe->tuner_priv;
  330. *frequency = priv->frequency;
  331. return 0;
  332. }
  333. static int tda827x_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
  334. {
  335. struct tda827x_priv *priv = fe->tuner_priv;
  336. *bandwidth = priv->bandwidth;
  337. return 0;
  338. }
  339. static int tda827x_init(struct dvb_frontend *fe)
  340. {
  341. struct tda827x_priv *priv = fe->tuner_priv;
  342. if (priv->cfg && priv->cfg->init)
  343. priv->cfg->init(fe);
  344. return 0;
  345. }
  346. static struct dvb_tuner_ops tda827xo_tuner_ops = {
  347. .info = {
  348. .name = "Philips TDA827X",
  349. .frequency_min = 55000000,
  350. .frequency_max = 860000000,
  351. .frequency_step = 250000
  352. },
  353. .release = tda827x_release,
  354. .init = tda827x_init,
  355. .sleep = tda827xo_sleep,
  356. .set_params = tda827xo_set_params,
  357. .get_frequency = tda827x_get_frequency,
  358. .get_bandwidth = tda827x_get_bandwidth,
  359. };
  360. static struct dvb_tuner_ops tda827xa_tuner_ops = {
  361. .info = {
  362. .name = "Philips TDA827XA",
  363. .frequency_min = 44000000,
  364. .frequency_max = 906000000,
  365. .frequency_step = 62500
  366. },
  367. .release = tda827x_release,
  368. .init = tda827x_init,
  369. .sleep = tda827xa_sleep,
  370. .set_params = tda827xa_set_params,
  371. .get_frequency = tda827x_get_frequency,
  372. .get_bandwidth = tda827x_get_bandwidth,
  373. };
  374. struct dvb_frontend *tda827x_attach(struct dvb_frontend *fe, int addr,
  375. struct i2c_adapter *i2c,
  376. struct tda827x_config *cfg)
  377. {
  378. struct tda827x_priv *priv = NULL;
  379. u8 data;
  380. u8 sb_msg[] = { 0x30, 0xd0 };
  381. struct i2c_msg msg = { .addr = addr, .flags = I2C_M_RD,
  382. .buf = &data, .len = 1 };
  383. dprintk("%s:\n", __FUNCTION__);
  384. if (fe->ops.i2c_gate_ctrl)
  385. fe->ops.i2c_gate_ctrl(fe, 1);
  386. if (i2c_transfer(i2c, &msg, 1) != 1) {
  387. printk("%s: could not read from tuner at addr: 0x%02x\n",
  388. __FUNCTION__, addr << 1);
  389. return NULL;
  390. }
  391. priv = kzalloc(sizeof(struct tda827x_priv), GFP_KERNEL);
  392. if (priv == NULL)
  393. return NULL;
  394. priv->i2c_addr = addr;
  395. priv->i2c_adap = i2c;
  396. priv->cfg = cfg;
  397. msg.flags = 0;
  398. msg.buf = sb_msg;
  399. msg.len = sizeof(sb_msg);
  400. if ((data & 0x3c) == 0) {
  401. dprintk("tda827x tuner found\n");
  402. memcpy(&fe->ops.tuner_ops, &tda827xo_tuner_ops, sizeof(struct dvb_tuner_ops));
  403. } else {
  404. dprintk("tda827xa tuner found\n");
  405. memcpy(&fe->ops.tuner_ops, &tda827xa_tuner_ops, sizeof(struct dvb_tuner_ops));
  406. sb_msg[1] = 0x90;
  407. }
  408. fe->tuner_priv = priv;
  409. if (fe->ops.i2c_gate_ctrl)
  410. fe->ops.i2c_gate_ctrl(fe, 1);
  411. i2c_transfer(i2c, &msg, 1);
  412. return fe;
  413. }
  414. EXPORT_SYMBOL(tda827x_attach);
  415. module_param(debug, int, 0644);
  416. MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off).");
  417. MODULE_DESCRIPTION("DVB TDA827x driver");
  418. MODULE_AUTHOR("Hartmut Hackmann <hartmut.hackmann@t-online.de>");
  419. MODULE_AUTHOR("Michael Krufky <mkrufky@linuxtv.org>");
  420. MODULE_LICENSE("GPL");
  421. /*
  422. * Overrides for Emacs so that we follow Linus's tabbing style.
  423. * ---------------------------------------------------------------------------
  424. * Local variables:
  425. * c-basic-offset: 8
  426. * End:
  427. */