saa7134-dvb.c 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093
  1. /*
  2. *
  3. * (c) 2004 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
  4. *
  5. * Extended 3 / 2005 by Hartmut Hackmann to support various
  6. * cards with the tda10046 DVB-T channel decoder
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21. */
  22. #include <linux/init.h>
  23. #include <linux/list.h>
  24. #include <linux/module.h>
  25. #include <linux/kernel.h>
  26. #include <linux/slab.h>
  27. #include <linux/delay.h>
  28. #include <linux/kthread.h>
  29. #include <linux/suspend.h>
  30. #include "saa7134-reg.h"
  31. #include "saa7134.h"
  32. #include <media/v4l2-common.h>
  33. #include "dvb-pll.h"
  34. #include "mt352.h"
  35. #include "mt352_priv.h" /* FIXME */
  36. #include "tda1004x.h"
  37. #include "nxt200x.h"
  38. #include "tda10086.h"
  39. #include "tda826x.h"
  40. #include "tda827x.h"
  41. #include "isl6421.h"
  42. MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]");
  43. MODULE_LICENSE("GPL");
  44. static unsigned int antenna_pwr = 0;
  45. module_param(antenna_pwr, int, 0444);
  46. MODULE_PARM_DESC(antenna_pwr,"enable antenna power (Pinnacle 300i)");
  47. static int use_frontend = 0;
  48. module_param(use_frontend, int, 0644);
  49. MODULE_PARM_DESC(use_frontend,"for cards with multiple frontends (0: terrestrial, 1: satellite)");
  50. static int debug = 0;
  51. module_param(debug, int, 0644);
  52. MODULE_PARM_DESC(debug, "Turn on/off module debugging (default:off).");
  53. #define dprintk(fmt, arg...) do { if (debug) \
  54. printk(KERN_DEBUG "%s/dvb: " fmt, dev->name , ## arg); } while(0)
  55. /* Print a warning */
  56. #define wprintk(fmt, arg...) \
  57. printk(KERN_WARNING "%s/dvb: " fmt, dev->name, ## arg)
  58. /* ------------------------------------------------------------------
  59. * mt352 based DVB-T cards
  60. */
  61. static int pinnacle_antenna_pwr(struct saa7134_dev *dev, int on)
  62. {
  63. u32 ok;
  64. if (!on) {
  65. saa_setl(SAA7134_GPIO_GPMODE0 >> 2, (1 << 26));
  66. saa_clearl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 26));
  67. return 0;
  68. }
  69. saa_setl(SAA7134_GPIO_GPMODE0 >> 2, (1 << 26));
  70. saa_setl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 26));
  71. udelay(10);
  72. saa_setl(SAA7134_GPIO_GPMODE0 >> 2, (1 << 28));
  73. saa_clearl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 28));
  74. udelay(10);
  75. saa_setl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 28));
  76. udelay(10);
  77. ok = saa_readl(SAA7134_GPIO_GPSTATUS0) & (1 << 27);
  78. dprintk("%s %s\n", __FUNCTION__, ok ? "on" : "off");
  79. if (!ok)
  80. saa_clearl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 26));
  81. return ok;
  82. }
  83. static int mt352_pinnacle_init(struct dvb_frontend* fe)
  84. {
  85. static u8 clock_config [] = { CLOCK_CTL, 0x3d, 0x28 };
  86. static u8 reset [] = { RESET, 0x80 };
  87. static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 };
  88. static u8 agc_cfg [] = { AGC_TARGET, 0x28, 0xa0 };
  89. static u8 capt_range_cfg[] = { CAPT_RANGE, 0x31 };
  90. static u8 fsm_ctl_cfg[] = { 0x7b, 0x04 };
  91. static u8 gpp_ctl_cfg [] = { GPP_CTL, 0x0f };
  92. static u8 scan_ctl_cfg [] = { SCAN_CTL, 0x0d };
  93. static u8 irq_cfg [] = { INTERRUPT_EN_0, 0x00, 0x00, 0x00, 0x00 };
  94. struct saa7134_dev *dev= fe->dvb->priv;
  95. dprintk("%s called\n", __FUNCTION__);
  96. mt352_write(fe, clock_config, sizeof(clock_config));
  97. udelay(200);
  98. mt352_write(fe, reset, sizeof(reset));
  99. mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
  100. mt352_write(fe, agc_cfg, sizeof(agc_cfg));
  101. mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
  102. mt352_write(fe, gpp_ctl_cfg, sizeof(gpp_ctl_cfg));
  103. mt352_write(fe, fsm_ctl_cfg, sizeof(fsm_ctl_cfg));
  104. mt352_write(fe, scan_ctl_cfg, sizeof(scan_ctl_cfg));
  105. mt352_write(fe, irq_cfg, sizeof(irq_cfg));
  106. return 0;
  107. }
  108. static int mt352_aver777_init(struct dvb_frontend* fe)
  109. {
  110. static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x2d };
  111. static u8 reset [] = { RESET, 0x80 };
  112. static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 };
  113. static u8 agc_cfg [] = { AGC_TARGET, 0x28, 0xa0 };
  114. static u8 capt_range_cfg[] = { CAPT_RANGE, 0x33 };
  115. mt352_write(fe, clock_config, sizeof(clock_config));
  116. udelay(200);
  117. mt352_write(fe, reset, sizeof(reset));
  118. mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
  119. mt352_write(fe, agc_cfg, sizeof(agc_cfg));
  120. mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
  121. return 0;
  122. }
  123. static int mt352_pinnacle_tuner_set_params(struct dvb_frontend* fe,
  124. struct dvb_frontend_parameters* params)
  125. {
  126. u8 off[] = { 0x00, 0xf1};
  127. u8 on[] = { 0x00, 0x71};
  128. struct i2c_msg msg = {.addr=0x43, .flags=0, .buf=off, .len = sizeof(off)};
  129. struct saa7134_dev *dev = fe->dvb->priv;
  130. struct v4l2_frequency f;
  131. /* set frequency (mt2050) */
  132. f.tuner = 0;
  133. f.type = V4L2_TUNER_DIGITAL_TV;
  134. f.frequency = params->frequency / 1000 * 16 / 1000;
  135. if (fe->ops.i2c_gate_ctrl)
  136. fe->ops.i2c_gate_ctrl(fe, 1);
  137. i2c_transfer(&dev->i2c_adap, &msg, 1);
  138. saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,&f);
  139. msg.buf = on;
  140. if (fe->ops.i2c_gate_ctrl)
  141. fe->ops.i2c_gate_ctrl(fe, 1);
  142. i2c_transfer(&dev->i2c_adap, &msg, 1);
  143. pinnacle_antenna_pwr(dev, antenna_pwr);
  144. /* mt352 setup */
  145. return mt352_pinnacle_init(fe);
  146. }
  147. static struct mt352_config pinnacle_300i = {
  148. .demod_address = 0x3c >> 1,
  149. .adc_clock = 20333,
  150. .if2 = 36150,
  151. .no_tuner = 1,
  152. .demod_init = mt352_pinnacle_init,
  153. };
  154. static struct mt352_config avermedia_777 = {
  155. .demod_address = 0xf,
  156. .demod_init = mt352_aver777_init,
  157. };
  158. /* ==================================================================
  159. * tda1004x based DVB-T cards, helper functions
  160. */
  161. static int philips_tda1004x_request_firmware(struct dvb_frontend *fe,
  162. const struct firmware **fw, char *name)
  163. {
  164. struct saa7134_dev *dev = fe->dvb->priv;
  165. return request_firmware(fw, name, &dev->pci->dev);
  166. }
  167. /* ------------------------------------------------------------------
  168. * these tuners are tu1216, td1316(a)
  169. */
  170. static int philips_tda6651_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
  171. {
  172. struct saa7134_dev *dev = fe->dvb->priv;
  173. struct tda1004x_state *state = fe->demodulator_priv;
  174. u8 addr = state->config->tuner_address;
  175. u8 tuner_buf[4];
  176. struct i2c_msg tuner_msg = {.addr = addr,.flags = 0,.buf = tuner_buf,.len =
  177. sizeof(tuner_buf) };
  178. int tuner_frequency = 0;
  179. u8 band, cp, filter;
  180. /* determine charge pump */
  181. tuner_frequency = params->frequency + 36166000;
  182. if (tuner_frequency < 87000000)
  183. return -EINVAL;
  184. else if (tuner_frequency < 130000000)
  185. cp = 3;
  186. else if (tuner_frequency < 160000000)
  187. cp = 5;
  188. else if (tuner_frequency < 200000000)
  189. cp = 6;
  190. else if (tuner_frequency < 290000000)
  191. cp = 3;
  192. else if (tuner_frequency < 420000000)
  193. cp = 5;
  194. else if (tuner_frequency < 480000000)
  195. cp = 6;
  196. else if (tuner_frequency < 620000000)
  197. cp = 3;
  198. else if (tuner_frequency < 830000000)
  199. cp = 5;
  200. else if (tuner_frequency < 895000000)
  201. cp = 7;
  202. else
  203. return -EINVAL;
  204. /* determine band */
  205. if (params->frequency < 49000000)
  206. return -EINVAL;
  207. else if (params->frequency < 161000000)
  208. band = 1;
  209. else if (params->frequency < 444000000)
  210. band = 2;
  211. else if (params->frequency < 861000000)
  212. band = 4;
  213. else
  214. return -EINVAL;
  215. /* setup PLL filter */
  216. switch (params->u.ofdm.bandwidth) {
  217. case BANDWIDTH_6_MHZ:
  218. filter = 0;
  219. break;
  220. case BANDWIDTH_7_MHZ:
  221. filter = 0;
  222. break;
  223. case BANDWIDTH_8_MHZ:
  224. filter = 1;
  225. break;
  226. default:
  227. return -EINVAL;
  228. }
  229. /* calculate divisor
  230. * ((36166000+((1000000/6)/2)) + Finput)/(1000000/6)
  231. */
  232. tuner_frequency = (((params->frequency / 1000) * 6) + 217496) / 1000;
  233. /* setup tuner buffer */
  234. tuner_buf[0] = (tuner_frequency >> 8) & 0x7f;
  235. tuner_buf[1] = tuner_frequency & 0xff;
  236. tuner_buf[2] = 0xca;
  237. tuner_buf[3] = (cp << 5) | (filter << 3) | band;
  238. if (fe->ops.i2c_gate_ctrl)
  239. fe->ops.i2c_gate_ctrl(fe, 1);
  240. if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) {
  241. wprintk("could not write to tuner at addr: 0x%02x\n",
  242. addr << 1);
  243. return -EIO;
  244. }
  245. msleep(1);
  246. return 0;
  247. }
  248. static int philips_tu1216_init(struct dvb_frontend *fe)
  249. {
  250. struct saa7134_dev *dev = fe->dvb->priv;
  251. struct tda1004x_state *state = fe->demodulator_priv;
  252. u8 addr = state->config->tuner_address;
  253. static u8 tu1216_init[] = { 0x0b, 0xf5, 0x85, 0xab };
  254. struct i2c_msg tuner_msg = {.addr = addr,.flags = 0,.buf = tu1216_init,.len = sizeof(tu1216_init) };
  255. /* setup PLL configuration */
  256. if (fe->ops.i2c_gate_ctrl)
  257. fe->ops.i2c_gate_ctrl(fe, 1);
  258. if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1)
  259. return -EIO;
  260. msleep(1);
  261. return 0;
  262. }
  263. /* ------------------------------------------------------------------ */
  264. static struct tda1004x_config philips_tu1216_60_config = {
  265. .demod_address = 0x8,
  266. .invert = 1,
  267. .invert_oclk = 0,
  268. .xtal_freq = TDA10046_XTAL_4M,
  269. .agc_config = TDA10046_AGC_DEFAULT,
  270. .if_freq = TDA10046_FREQ_3617,
  271. .tuner_address = 0x60,
  272. .request_firmware = philips_tda1004x_request_firmware
  273. };
  274. static struct tda1004x_config philips_tu1216_61_config = {
  275. .demod_address = 0x8,
  276. .invert = 1,
  277. .invert_oclk = 0,
  278. .xtal_freq = TDA10046_XTAL_4M,
  279. .agc_config = TDA10046_AGC_DEFAULT,
  280. .if_freq = TDA10046_FREQ_3617,
  281. .tuner_address = 0x61,
  282. .request_firmware = philips_tda1004x_request_firmware
  283. };
  284. /* ------------------------------------------------------------------ */
  285. static int philips_td1316_tuner_init(struct dvb_frontend *fe)
  286. {
  287. struct saa7134_dev *dev = fe->dvb->priv;
  288. struct tda1004x_state *state = fe->demodulator_priv;
  289. u8 addr = state->config->tuner_address;
  290. static u8 msg[] = { 0x0b, 0xf5, 0x86, 0xab };
  291. struct i2c_msg init_msg = {.addr = addr,.flags = 0,.buf = msg,.len = sizeof(msg) };
  292. /* setup PLL configuration */
  293. if (fe->ops.i2c_gate_ctrl)
  294. fe->ops.i2c_gate_ctrl(fe, 1);
  295. if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1)
  296. return -EIO;
  297. return 0;
  298. }
  299. static int philips_td1316_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
  300. {
  301. return philips_tda6651_pll_set(fe, params);
  302. }
  303. static int philips_td1316_tuner_sleep(struct dvb_frontend *fe)
  304. {
  305. struct saa7134_dev *dev = fe->dvb->priv;
  306. struct tda1004x_state *state = fe->demodulator_priv;
  307. u8 addr = state->config->tuner_address;
  308. static u8 msg[] = { 0x0b, 0xdc, 0x86, 0xa4 };
  309. struct i2c_msg analog_msg = {.addr = addr,.flags = 0,.buf = msg,.len = sizeof(msg) };
  310. /* switch the tuner to analog mode */
  311. if (fe->ops.i2c_gate_ctrl)
  312. fe->ops.i2c_gate_ctrl(fe, 1);
  313. if (i2c_transfer(&dev->i2c_adap, &analog_msg, 1) != 1)
  314. return -EIO;
  315. return 0;
  316. }
  317. /* ------------------------------------------------------------------ */
  318. static int philips_europa_tuner_init(struct dvb_frontend *fe)
  319. {
  320. struct saa7134_dev *dev = fe->dvb->priv;
  321. static u8 msg[] = { 0x00, 0x40};
  322. struct i2c_msg init_msg = {.addr = 0x43,.flags = 0,.buf = msg,.len = sizeof(msg) };
  323. if (philips_td1316_tuner_init(fe))
  324. return -EIO;
  325. msleep(1);
  326. if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1)
  327. return -EIO;
  328. return 0;
  329. }
  330. static int philips_europa_tuner_sleep(struct dvb_frontend *fe)
  331. {
  332. struct saa7134_dev *dev = fe->dvb->priv;
  333. static u8 msg[] = { 0x00, 0x14 };
  334. struct i2c_msg analog_msg = {.addr = 0x43,.flags = 0,.buf = msg,.len = sizeof(msg) };
  335. if (philips_td1316_tuner_sleep(fe))
  336. return -EIO;
  337. /* switch the board to analog mode */
  338. if (fe->ops.i2c_gate_ctrl)
  339. fe->ops.i2c_gate_ctrl(fe, 1);
  340. i2c_transfer(&dev->i2c_adap, &analog_msg, 1);
  341. return 0;
  342. }
  343. static int philips_europa_demod_sleep(struct dvb_frontend *fe)
  344. {
  345. struct saa7134_dev *dev = fe->dvb->priv;
  346. if (dev->original_demod_sleep)
  347. dev->original_demod_sleep(fe);
  348. fe->ops.i2c_gate_ctrl(fe, 1);
  349. return 0;
  350. }
  351. static struct tda1004x_config philips_europa_config = {
  352. .demod_address = 0x8,
  353. .invert = 0,
  354. .invert_oclk = 0,
  355. .xtal_freq = TDA10046_XTAL_4M,
  356. .agc_config = TDA10046_AGC_IFO_AUTO_POS,
  357. .if_freq = TDA10046_FREQ_052,
  358. .tuner_address = 0x61,
  359. .request_firmware = philips_tda1004x_request_firmware
  360. };
  361. /* ------------------------------------------------------------------ */
  362. static struct tda1004x_config medion_cardbus = {
  363. .demod_address = 0x08,
  364. .invert = 1,
  365. .invert_oclk = 0,
  366. .xtal_freq = TDA10046_XTAL_16M,
  367. .agc_config = TDA10046_AGC_IFO_AUTO_NEG,
  368. .if_freq = TDA10046_FREQ_3613,
  369. .tuner_address = 0x61,
  370. .request_firmware = philips_tda1004x_request_firmware
  371. };
  372. /* ------------------------------------------------------------------
  373. * tda 1004x based cards with philips silicon tuner
  374. */
  375. static void philips_tda827x_lna_gain(struct dvb_frontend *fe, int high)
  376. {
  377. struct saa7134_dev *dev = fe->dvb->priv;
  378. struct tda1004x_state *state = fe->demodulator_priv;
  379. u8 addr = state->config->i2c_gate;
  380. u8 config = state->config->tuner_config;
  381. u8 GP00_CF[] = {0x20, 0x01};
  382. u8 GP00_LEV[] = {0x22, 0x00};
  383. struct i2c_msg msg = {.addr = addr,.flags = 0,.buf = GP00_CF, .len = 2};
  384. if (config) {
  385. if (high) {
  386. dprintk("setting LNA to high gain\n");
  387. } else {
  388. dprintk("setting LNA to low gain\n");
  389. }
  390. }
  391. switch (config) {
  392. case 0: /* no LNA */
  393. break;
  394. case 1: /* switch is GPIO 0 of tda8290 */
  395. case 2:
  396. /* turn Vsync off */
  397. saa7134_set_gpio(dev, 22, 0);
  398. GP00_LEV[1] = high ? 0 : 1;
  399. if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) {
  400. wprintk("could not access tda8290 at addr: 0x%02x\n",
  401. addr << 1);
  402. return;
  403. }
  404. msg.buf = GP00_LEV;
  405. if (config == 2)
  406. GP00_LEV[1] = high ? 1 : 0;
  407. i2c_transfer(&dev->i2c_adap, &msg, 1);
  408. break;
  409. case 3: /* switch with GPIO of saa713x */
  410. saa7134_set_gpio(dev, 22, high);
  411. break;
  412. }
  413. }
  414. static int tda8290_i2c_gate_ctrl( struct dvb_frontend* fe, int enable)
  415. {
  416. struct tda1004x_state *state = fe->demodulator_priv;
  417. u8 addr = state->config->i2c_gate;
  418. static u8 tda8290_close[] = { 0x21, 0xc0};
  419. static u8 tda8290_open[] = { 0x21, 0x80};
  420. struct i2c_msg tda8290_msg = {.addr = addr,.flags = 0, .len = 2};
  421. if (enable) {
  422. tda8290_msg.buf = tda8290_close;
  423. } else {
  424. tda8290_msg.buf = tda8290_open;
  425. }
  426. if (i2c_transfer(state->i2c, &tda8290_msg, 1) != 1) {
  427. struct saa7134_dev *dev = fe->dvb->priv;
  428. wprintk("could not access tda8290 I2C gate\n");
  429. return -EIO;
  430. }
  431. msleep(20);
  432. return 0;
  433. }
  434. /* ------------------------------------------------------------------ */
  435. static int philips_tda827x_tuner_init(struct dvb_frontend *fe)
  436. {
  437. struct saa7134_dev *dev = fe->dvb->priv;
  438. struct tda1004x_state *state = fe->demodulator_priv;
  439. switch (state->config->antenna_switch) {
  440. case 0: break;
  441. case 1: dprintk("setting GPIO21 to 0 (TV antenna?)\n");
  442. saa7134_set_gpio(dev, 21, 0);
  443. break;
  444. case 2: dprintk("setting GPIO21 to 1 (Radio antenna?)\n");
  445. saa7134_set_gpio(dev, 21, 1);
  446. break;
  447. }
  448. return 0;
  449. }
  450. static int philips_tda827x_tuner_sleep(struct dvb_frontend *fe)
  451. {
  452. struct saa7134_dev *dev = fe->dvb->priv;
  453. struct tda1004x_state *state = fe->demodulator_priv;
  454. switch (state->config->antenna_switch) {
  455. case 0: break;
  456. case 1: dprintk("setting GPIO21 to 1 (Radio antenna?)\n");
  457. saa7134_set_gpio(dev, 21, 1);
  458. break;
  459. case 2: dprintk("setting GPIO21 to 0 (TV antenna?)\n");
  460. saa7134_set_gpio(dev, 21, 0);
  461. break;
  462. }
  463. return 0;
  464. }
  465. static struct tda827x_config tda827x_cfg = {
  466. .lna_gain = philips_tda827x_lna_gain,
  467. .init = philips_tda827x_tuner_init,
  468. .sleep = philips_tda827x_tuner_sleep
  469. };
  470. static void configure_tda827x_fe(struct saa7134_dev *dev, struct tda1004x_config *tda_conf)
  471. {
  472. dev->dvb.frontend = dvb_attach(tda10046_attach, tda_conf, &dev->i2c_adap);
  473. if (dev->dvb.frontend) {
  474. if (tda_conf->i2c_gate)
  475. dev->dvb.frontend->ops.i2c_gate_ctrl = tda8290_i2c_gate_ctrl;
  476. if (dvb_attach(tda827x_attach, dev->dvb.frontend, tda_conf->tuner_address,
  477. &dev->i2c_adap,&tda827x_cfg) == NULL) {
  478. wprintk("no tda827x tuner found at addr: %02x\n",
  479. tda_conf->tuner_address);
  480. }
  481. }
  482. }
  483. /* ------------------------------------------------------------------ */
  484. static struct tda1004x_config tda827x_lifeview_config = {
  485. .demod_address = 0x08,
  486. .invert = 1,
  487. .invert_oclk = 0,
  488. .xtal_freq = TDA10046_XTAL_16M,
  489. .agc_config = TDA10046_AGC_TDA827X,
  490. .gpio_config = TDA10046_GP11_I,
  491. .if_freq = TDA10046_FREQ_045,
  492. .tuner_address = 0x60,
  493. .request_firmware = philips_tda1004x_request_firmware
  494. };
  495. static struct tda1004x_config philips_tiger_config = {
  496. .demod_address = 0x08,
  497. .invert = 1,
  498. .invert_oclk = 0,
  499. .xtal_freq = TDA10046_XTAL_16M,
  500. .agc_config = TDA10046_AGC_TDA827X,
  501. .gpio_config = TDA10046_GP11_I,
  502. .if_freq = TDA10046_FREQ_045,
  503. .i2c_gate = 0x4b,
  504. .tuner_address = 0x61,
  505. .tuner_config = 0,
  506. .antenna_switch= 1,
  507. .request_firmware = philips_tda1004x_request_firmware
  508. };
  509. static struct tda1004x_config cinergy_ht_config = {
  510. .demod_address = 0x08,
  511. .invert = 1,
  512. .invert_oclk = 0,
  513. .xtal_freq = TDA10046_XTAL_16M,
  514. .agc_config = TDA10046_AGC_TDA827X,
  515. .gpio_config = TDA10046_GP01_I,
  516. .if_freq = TDA10046_FREQ_045,
  517. .i2c_gate = 0x4b,
  518. .tuner_address = 0x61,
  519. .tuner_config = 0,
  520. .request_firmware = philips_tda1004x_request_firmware
  521. };
  522. static struct tda1004x_config cinergy_ht_pci_config = {
  523. .demod_address = 0x08,
  524. .invert = 1,
  525. .invert_oclk = 0,
  526. .xtal_freq = TDA10046_XTAL_16M,
  527. .agc_config = TDA10046_AGC_TDA827X,
  528. .gpio_config = TDA10046_GP01_I,
  529. .if_freq = TDA10046_FREQ_045,
  530. .i2c_gate = 0x4b,
  531. .tuner_address = 0x60,
  532. .tuner_config = 0,
  533. .request_firmware = philips_tda1004x_request_firmware
  534. };
  535. static struct tda1004x_config philips_tiger_s_config = {
  536. .demod_address = 0x08,
  537. .invert = 1,
  538. .invert_oclk = 0,
  539. .xtal_freq = TDA10046_XTAL_16M,
  540. .agc_config = TDA10046_AGC_TDA827X,
  541. .gpio_config = TDA10046_GP01_I,
  542. .if_freq = TDA10046_FREQ_045,
  543. .i2c_gate = 0x4b,
  544. .tuner_address = 0x61,
  545. .tuner_config = 2,
  546. .antenna_switch= 1,
  547. .request_firmware = philips_tda1004x_request_firmware
  548. };
  549. static struct tda1004x_config pinnacle_pctv_310i_config = {
  550. .demod_address = 0x08,
  551. .invert = 1,
  552. .invert_oclk = 0,
  553. .xtal_freq = TDA10046_XTAL_16M,
  554. .agc_config = TDA10046_AGC_TDA827X,
  555. .gpio_config = TDA10046_GP11_I,
  556. .if_freq = TDA10046_FREQ_045,
  557. .i2c_gate = 0x4b,
  558. .tuner_address = 0x61,
  559. .tuner_config = 1,
  560. .request_firmware = philips_tda1004x_request_firmware
  561. };
  562. static struct tda1004x_config hauppauge_hvr_1110_config = {
  563. .demod_address = 0x08,
  564. .invert = 1,
  565. .invert_oclk = 0,
  566. .xtal_freq = TDA10046_XTAL_16M,
  567. .agc_config = TDA10046_AGC_TDA827X,
  568. .gpio_config = TDA10046_GP11_I,
  569. .if_freq = TDA10046_FREQ_045,
  570. .i2c_gate = 0x4b,
  571. .tuner_address = 0x61,
  572. .request_firmware = philips_tda1004x_request_firmware
  573. };
  574. static struct tda1004x_config asus_p7131_dual_config = {
  575. .demod_address = 0x08,
  576. .invert = 1,
  577. .invert_oclk = 0,
  578. .xtal_freq = TDA10046_XTAL_16M,
  579. .agc_config = TDA10046_AGC_TDA827X,
  580. .gpio_config = TDA10046_GP11_I,
  581. .if_freq = TDA10046_FREQ_045,
  582. .i2c_gate = 0x4b,
  583. .tuner_address = 0x61,
  584. .tuner_config = 0,
  585. .antenna_switch= 2,
  586. .request_firmware = philips_tda1004x_request_firmware
  587. };
  588. static struct tda1004x_config lifeview_trio_config = {
  589. .demod_address = 0x09,
  590. .invert = 1,
  591. .invert_oclk = 0,
  592. .xtal_freq = TDA10046_XTAL_16M,
  593. .agc_config = TDA10046_AGC_TDA827X,
  594. .gpio_config = TDA10046_GP00_I,
  595. .if_freq = TDA10046_FREQ_045,
  596. .tuner_address = 0x60,
  597. .request_firmware = philips_tda1004x_request_firmware
  598. };
  599. static struct tda1004x_config tevion_dvbt220rf_config = {
  600. .demod_address = 0x08,
  601. .invert = 1,
  602. .invert_oclk = 0,
  603. .xtal_freq = TDA10046_XTAL_16M,
  604. .agc_config = TDA10046_AGC_TDA827X,
  605. .gpio_config = TDA10046_GP11_I,
  606. .if_freq = TDA10046_FREQ_045,
  607. .tuner_address = 0x60,
  608. .request_firmware = philips_tda1004x_request_firmware
  609. };
  610. static struct tda1004x_config md8800_dvbt_config = {
  611. .demod_address = 0x08,
  612. .invert = 1,
  613. .invert_oclk = 0,
  614. .xtal_freq = TDA10046_XTAL_16M,
  615. .agc_config = TDA10046_AGC_TDA827X,
  616. .gpio_config = TDA10046_GP01_I,
  617. .if_freq = TDA10046_FREQ_045,
  618. .i2c_gate = 0x4b,
  619. .tuner_address = 0x60,
  620. .tuner_config = 0,
  621. .request_firmware = philips_tda1004x_request_firmware
  622. };
  623. static struct tda1004x_config asus_p7131_4871_config = {
  624. .demod_address = 0x08,
  625. .invert = 1,
  626. .invert_oclk = 0,
  627. .xtal_freq = TDA10046_XTAL_16M,
  628. .agc_config = TDA10046_AGC_TDA827X,
  629. .gpio_config = TDA10046_GP01_I,
  630. .if_freq = TDA10046_FREQ_045,
  631. .i2c_gate = 0x4b,
  632. .tuner_address = 0x61,
  633. .tuner_config = 2,
  634. .antenna_switch= 2,
  635. .request_firmware = philips_tda1004x_request_firmware
  636. };
  637. static struct tda1004x_config asus_p7131_hybrid_lna_config = {
  638. .demod_address = 0x08,
  639. .invert = 1,
  640. .invert_oclk = 0,
  641. .xtal_freq = TDA10046_XTAL_16M,
  642. .agc_config = TDA10046_AGC_TDA827X,
  643. .gpio_config = TDA10046_GP11_I,
  644. .if_freq = TDA10046_FREQ_045,
  645. .i2c_gate = 0x4b,
  646. .tuner_address = 0x61,
  647. .tuner_config = 2,
  648. .antenna_switch= 2,
  649. .request_firmware = philips_tda1004x_request_firmware
  650. };
  651. static struct tda1004x_config kworld_dvb_t_210_config = {
  652. .demod_address = 0x08,
  653. .invert = 1,
  654. .invert_oclk = 0,
  655. .xtal_freq = TDA10046_XTAL_16M,
  656. .agc_config = TDA10046_AGC_TDA827X,
  657. .gpio_config = TDA10046_GP11_I,
  658. .if_freq = TDA10046_FREQ_045,
  659. .i2c_gate = 0x4b,
  660. .tuner_address = 0x61,
  661. .tuner_config = 2,
  662. .antenna_switch= 1,
  663. .request_firmware = philips_tda1004x_request_firmware
  664. };
  665. /* ------------------------------------------------------------------
  666. * special case: this card uses saa713x GPIO22 for the mode switch
  667. */
  668. static int ads_duo_tuner_init(struct dvb_frontend *fe)
  669. {
  670. struct saa7134_dev *dev = fe->dvb->priv;
  671. philips_tda827x_tuner_init(fe);
  672. /* route TDA8275a AGC input to the channel decoder */
  673. saa7134_set_gpio(dev, 22, 1);
  674. return 0;
  675. }
  676. static int ads_duo_tuner_sleep(struct dvb_frontend *fe)
  677. {
  678. struct saa7134_dev *dev = fe->dvb->priv;
  679. /* route TDA8275a AGC input to the analog IF chip*/
  680. saa7134_set_gpio(dev, 22, 0);
  681. philips_tda827x_tuner_sleep(fe);
  682. return 0;
  683. }
  684. static struct tda827x_config ads_duo_cfg = {
  685. .lna_gain = philips_tda827x_lna_gain,
  686. .init = ads_duo_tuner_init,
  687. .sleep = ads_duo_tuner_sleep
  688. };
  689. static struct tda1004x_config ads_tech_duo_config = {
  690. .demod_address = 0x08,
  691. .invert = 1,
  692. .invert_oclk = 0,
  693. .xtal_freq = TDA10046_XTAL_16M,
  694. .agc_config = TDA10046_AGC_TDA827X,
  695. .gpio_config = TDA10046_GP00_I,
  696. .if_freq = TDA10046_FREQ_045,
  697. .tuner_address = 0x61,
  698. .request_firmware = philips_tda1004x_request_firmware
  699. };
  700. /* ==================================================================
  701. * tda10086 based DVB-S cards, helper functions
  702. */
  703. static struct tda10086_config flydvbs = {
  704. .demod_address = 0x0e,
  705. .invert = 0,
  706. };
  707. /* ==================================================================
  708. * nxt200x based ATSC cards, helper functions
  709. */
  710. static struct nxt200x_config avertvhda180 = {
  711. .demod_address = 0x0a,
  712. };
  713. static struct nxt200x_config kworldatsc110 = {
  714. .demod_address = 0x0a,
  715. };
  716. /* ==================================================================
  717. * Core code
  718. */
  719. static int dvb_init(struct saa7134_dev *dev)
  720. {
  721. int ret;
  722. /* init struct videobuf_dvb */
  723. dev->ts.nr_bufs = 32;
  724. dev->ts.nr_packets = 32*4;
  725. dev->dvb.name = dev->name;
  726. videobuf_queue_init(&dev->dvb.dvbq, &saa7134_ts_qops,
  727. dev->pci, &dev->slock,
  728. V4L2_BUF_TYPE_VIDEO_CAPTURE,
  729. V4L2_FIELD_ALTERNATE,
  730. sizeof(struct saa7134_buf),
  731. dev);
  732. switch (dev->board) {
  733. case SAA7134_BOARD_PINNACLE_300I_DVBT_PAL:
  734. dprintk("pinnacle 300i dvb setup\n");
  735. dev->dvb.frontend = dvb_attach(mt352_attach, &pinnacle_300i,
  736. &dev->i2c_adap);
  737. if (dev->dvb.frontend) {
  738. dev->dvb.frontend->ops.tuner_ops.set_params = mt352_pinnacle_tuner_set_params;
  739. }
  740. break;
  741. case SAA7134_BOARD_AVERMEDIA_777:
  742. case SAA7134_BOARD_AVERMEDIA_A16AR:
  743. dprintk("avertv 777 dvb setup\n");
  744. dev->dvb.frontend = dvb_attach(mt352_attach, &avermedia_777,
  745. &dev->i2c_adap);
  746. if (dev->dvb.frontend) {
  747. dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
  748. NULL, DVB_PLL_PHILIPS_TD1316);
  749. }
  750. break;
  751. case SAA7134_BOARD_MD7134:
  752. dev->dvb.frontend = dvb_attach(tda10046_attach,
  753. &medion_cardbus,
  754. &dev->i2c_adap);
  755. if (dev->dvb.frontend) {
  756. dvb_attach(dvb_pll_attach, dev->dvb.frontend, medion_cardbus.tuner_address,
  757. &dev->i2c_adap, DVB_PLL_FMD1216ME);
  758. }
  759. break;
  760. case SAA7134_BOARD_PHILIPS_TOUGH:
  761. dev->dvb.frontend = dvb_attach(tda10046_attach,
  762. &philips_tu1216_60_config,
  763. &dev->i2c_adap);
  764. if (dev->dvb.frontend) {
  765. dev->dvb.frontend->ops.tuner_ops.init = philips_tu1216_init;
  766. dev->dvb.frontend->ops.tuner_ops.set_params = philips_tda6651_pll_set;
  767. }
  768. break;
  769. case SAA7134_BOARD_FLYDVBTDUO:
  770. case SAA7134_BOARD_FLYDVBT_DUO_CARDBUS:
  771. configure_tda827x_fe(dev, &tda827x_lifeview_config);
  772. break;
  773. case SAA7134_BOARD_PHILIPS_EUROPA:
  774. case SAA7134_BOARD_VIDEOMATE_DVBT_300:
  775. dev->dvb.frontend = dvb_attach(tda10046_attach,
  776. &philips_europa_config,
  777. &dev->i2c_adap);
  778. if (dev->dvb.frontend) {
  779. dev->original_demod_sleep = dev->dvb.frontend->ops.sleep;
  780. dev->dvb.frontend->ops.sleep = philips_europa_demod_sleep;
  781. dev->dvb.frontend->ops.tuner_ops.init = philips_europa_tuner_init;
  782. dev->dvb.frontend->ops.tuner_ops.sleep = philips_europa_tuner_sleep;
  783. dev->dvb.frontend->ops.tuner_ops.set_params = philips_td1316_tuner_set_params;
  784. }
  785. break;
  786. case SAA7134_BOARD_VIDEOMATE_DVBT_200:
  787. dev->dvb.frontend = dvb_attach(tda10046_attach,
  788. &philips_tu1216_61_config,
  789. &dev->i2c_adap);
  790. if (dev->dvb.frontend) {
  791. dev->dvb.frontend->ops.tuner_ops.init = philips_tu1216_init;
  792. dev->dvb.frontend->ops.tuner_ops.set_params = philips_tda6651_pll_set;
  793. }
  794. break;
  795. case SAA7134_BOARD_KWORLD_DVBT_210:
  796. configure_tda827x_fe(dev, &kworld_dvb_t_210_config);
  797. break;
  798. case SAA7134_BOARD_PHILIPS_TIGER:
  799. configure_tda827x_fe(dev, &philips_tiger_config);
  800. break;
  801. case SAA7134_BOARD_PINNACLE_PCTV_310i:
  802. configure_tda827x_fe(dev, &pinnacle_pctv_310i_config);
  803. break;
  804. case SAA7134_BOARD_HAUPPAUGE_HVR1110:
  805. configure_tda827x_fe(dev, &hauppauge_hvr_1110_config);
  806. break;
  807. case SAA7134_BOARD_ASUSTeK_P7131_DUAL:
  808. configure_tda827x_fe(dev, &asus_p7131_dual_config);
  809. break;
  810. case SAA7134_BOARD_FLYDVBT_LR301:
  811. configure_tda827x_fe(dev, &tda827x_lifeview_config);
  812. break;
  813. case SAA7134_BOARD_FLYDVB_TRIO:
  814. if(! use_frontend) { //terrestrial
  815. configure_tda827x_fe(dev, &lifeview_trio_config);
  816. } else { //satellite
  817. dev->dvb.frontend = dvb_attach(tda10086_attach, &flydvbs, &dev->i2c_adap);
  818. if (dev->dvb.frontend) {
  819. if (dvb_attach(tda826x_attach, dev->dvb.frontend, 0x63,
  820. &dev->i2c_adap, 0) == NULL) {
  821. wprintk("%s: Lifeview Trio, No tda826x found!\n", __FUNCTION__);
  822. }
  823. if (dvb_attach(isl6421_attach, dev->dvb.frontend, &dev->i2c_adap,
  824. 0x08, 0, 0) == NULL) {
  825. wprintk("%s: Lifeview Trio, No ISL6421 found!\n", __FUNCTION__);
  826. }
  827. }
  828. }
  829. break;
  830. case SAA7134_BOARD_ADS_DUO_CARDBUS_PTV331:
  831. case SAA7134_BOARD_FLYDVBT_HYBRID_CARDBUS:
  832. dev->dvb.frontend = dvb_attach(tda10046_attach,
  833. &ads_tech_duo_config,
  834. &dev->i2c_adap);
  835. if (dev->dvb.frontend) {
  836. if (dvb_attach(tda827x_attach,dev->dvb.frontend,
  837. ads_tech_duo_config.tuner_address,
  838. &dev->i2c_adap,&ads_duo_cfg) == NULL) {
  839. wprintk("no tda827x tuner found at addr: %02x\n",
  840. ads_tech_duo_config.tuner_address);
  841. }
  842. }
  843. break;
  844. case SAA7134_BOARD_TEVION_DVBT_220RF:
  845. configure_tda827x_fe(dev, &tevion_dvbt220rf_config);
  846. break;
  847. case SAA7134_BOARD_MEDION_MD8800_QUADRO:
  848. configure_tda827x_fe(dev, &md8800_dvbt_config);
  849. break;
  850. case SAA7134_BOARD_AVERMEDIA_AVERTVHD_A180:
  851. dev->dvb.frontend = dvb_attach(nxt200x_attach, &avertvhda180,
  852. &dev->i2c_adap);
  853. if (dev->dvb.frontend) {
  854. dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
  855. NULL, DVB_PLL_TDHU2);
  856. }
  857. break;
  858. case SAA7134_BOARD_KWORLD_ATSC110:
  859. dev->dvb.frontend = dvb_attach(nxt200x_attach, &kworldatsc110,
  860. &dev->i2c_adap);
  861. if (dev->dvb.frontend) {
  862. dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
  863. NULL, DVB_PLL_TUV1236D);
  864. }
  865. break;
  866. case SAA7134_BOARD_FLYDVBS_LR300:
  867. dev->dvb.frontend = dvb_attach(tda10086_attach, &flydvbs,
  868. &dev->i2c_adap);
  869. if (dev->dvb.frontend) {
  870. if (dvb_attach(tda826x_attach, dev->dvb.frontend, 0x60,
  871. &dev->i2c_adap, 0) == NULL) {
  872. wprintk("%s: No tda826x found!\n", __FUNCTION__);
  873. }
  874. if (dvb_attach(isl6421_attach, dev->dvb.frontend,
  875. &dev->i2c_adap, 0x08, 0, 0) == NULL) {
  876. wprintk("%s: No ISL6421 found!\n", __FUNCTION__);
  877. }
  878. }
  879. break;
  880. case SAA7134_BOARD_ASUS_EUROPA2_HYBRID:
  881. dev->dvb.frontend = tda10046_attach(&medion_cardbus,
  882. &dev->i2c_adap);
  883. if (dev->dvb.frontend) {
  884. dev->original_demod_sleep = dev->dvb.frontend->ops.sleep;
  885. dev->dvb.frontend->ops.sleep = philips_europa_demod_sleep;
  886. dvb_attach(dvb_pll_attach, dev->dvb.frontend, medion_cardbus.tuner_address,
  887. &dev->i2c_adap, DVB_PLL_FMD1216ME);
  888. }
  889. break;
  890. case SAA7134_BOARD_VIDEOMATE_DVBT_200A:
  891. dev->dvb.frontend = dvb_attach(tda10046_attach,
  892. &philips_europa_config,
  893. &dev->i2c_adap);
  894. if (dev->dvb.frontend) {
  895. dev->dvb.frontend->ops.tuner_ops.init = philips_td1316_tuner_init;
  896. dev->dvb.frontend->ops.tuner_ops.set_params = philips_td1316_tuner_set_params;
  897. }
  898. break;
  899. case SAA7134_BOARD_CINERGY_HT_PCMCIA:
  900. configure_tda827x_fe(dev, &cinergy_ht_config);
  901. break;
  902. case SAA7134_BOARD_CINERGY_HT_PCI:
  903. configure_tda827x_fe(dev, &cinergy_ht_pci_config);
  904. break;
  905. case SAA7134_BOARD_PHILIPS_TIGER_S:
  906. configure_tda827x_fe(dev, &philips_tiger_s_config);
  907. break;
  908. case SAA7134_BOARD_ASUS_P7131_4871:
  909. configure_tda827x_fe(dev, &asus_p7131_4871_config);
  910. break;
  911. case SAA7134_BOARD_ASUSTeK_P7131_HYBRID_LNA:
  912. configure_tda827x_fe(dev, &asus_p7131_hybrid_lna_config);
  913. break;
  914. default:
  915. wprintk("Huh? unknown DVB card?\n");
  916. break;
  917. }
  918. if (NULL == dev->dvb.frontend) {
  919. printk(KERN_ERR "%s/dvb: frontend initialization failed\n", dev->name);
  920. return -1;
  921. }
  922. /* register everything else */
  923. ret = videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev, &dev->pci->dev);
  924. /* this sequence is necessary to make the tda1004x load its firmware
  925. * and to enter analog mode of hybrid boards
  926. */
  927. if (!ret) {
  928. if (dev->dvb.frontend->ops.init)
  929. dev->dvb.frontend->ops.init(dev->dvb.frontend);
  930. if (dev->dvb.frontend->ops.sleep)
  931. dev->dvb.frontend->ops.sleep(dev->dvb.frontend);
  932. if (dev->dvb.frontend->ops.tuner_ops.sleep)
  933. dev->dvb.frontend->ops.tuner_ops.sleep(dev->dvb.frontend);
  934. }
  935. return ret;
  936. }
  937. static int dvb_fini(struct saa7134_dev *dev)
  938. {
  939. static int on = TDA9887_PRESENT | TDA9887_PORT2_INACTIVE;
  940. switch (dev->board) {
  941. case SAA7134_BOARD_PINNACLE_300I_DVBT_PAL:
  942. /* otherwise we don't detect the tuner on next insmod */
  943. saa7134_i2c_call_clients(dev,TDA9887_SET_CONFIG,&on);
  944. break;
  945. };
  946. videobuf_dvb_unregister(&dev->dvb);
  947. return 0;
  948. }
  949. static struct saa7134_mpeg_ops dvb_ops = {
  950. .type = SAA7134_MPEG_DVB,
  951. .init = dvb_init,
  952. .fini = dvb_fini,
  953. };
  954. static int __init dvb_register(void)
  955. {
  956. return saa7134_ts_register(&dvb_ops);
  957. }
  958. static void __exit dvb_unregister(void)
  959. {
  960. saa7134_ts_unregister(&dvb_ops);
  961. }
  962. module_init(dvb_register);
  963. module_exit(dvb_unregister);
  964. /* ------------------------------------------------------------------ */
  965. /*
  966. * Local variables:
  967. * c-basic-offset: 8
  968. * End:
  969. */