cx23885-dvb.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. /*
  2. * Driver for the Conexant CX23885 PCIe bridge
  3. *
  4. * Copyright (c) 2006 Steven Toth <stoth@linuxtv.org>
  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. *
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21. #include <linux/module.h>
  22. #include <linux/init.h>
  23. #include <linux/device.h>
  24. #include <linux/fs.h>
  25. #include <linux/kthread.h>
  26. #include <linux/file.h>
  27. #include <linux/suspend.h>
  28. #include "cx23885.h"
  29. #include <media/v4l2-common.h>
  30. #include "s5h1409.h"
  31. #include "s5h1411.h"
  32. #include "mt2131.h"
  33. #include "tda8290.h"
  34. #include "tda18271.h"
  35. #include "lgdt330x.h"
  36. #include "xc5000.h"
  37. #include "tda10048.h"
  38. #include "tuner-xc2028.h"
  39. #include "tuner-simple.h"
  40. #include "dib7000p.h"
  41. #include "dibx000_common.h"
  42. #include "zl10353.h"
  43. static unsigned int debug;
  44. #define dprintk(level, fmt, arg...)\
  45. do { if (debug >= level)\
  46. printk(KERN_DEBUG "%s/0: " fmt, dev->name, ## arg);\
  47. } while (0)
  48. /* ------------------------------------------------------------------ */
  49. static unsigned int alt_tuner;
  50. module_param(alt_tuner, int, 0644);
  51. MODULE_PARM_DESC(alt_tuner, "Enable alternate tuner configuration");
  52. DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
  53. /* ------------------------------------------------------------------ */
  54. static int dvb_buf_setup(struct videobuf_queue *q,
  55. unsigned int *count, unsigned int *size)
  56. {
  57. struct cx23885_tsport *port = q->priv_data;
  58. port->ts_packet_size = 188 * 4;
  59. port->ts_packet_count = 32;
  60. *size = port->ts_packet_size * port->ts_packet_count;
  61. *count = 32;
  62. return 0;
  63. }
  64. static int dvb_buf_prepare(struct videobuf_queue *q,
  65. struct videobuf_buffer *vb, enum v4l2_field field)
  66. {
  67. struct cx23885_tsport *port = q->priv_data;
  68. return cx23885_buf_prepare(q, port, (struct cx23885_buffer*)vb, field);
  69. }
  70. static void dvb_buf_queue(struct videobuf_queue *q, struct videobuf_buffer *vb)
  71. {
  72. struct cx23885_tsport *port = q->priv_data;
  73. cx23885_buf_queue(port, (struct cx23885_buffer*)vb);
  74. }
  75. static void dvb_buf_release(struct videobuf_queue *q,
  76. struct videobuf_buffer *vb)
  77. {
  78. cx23885_free_buffer(q, (struct cx23885_buffer*)vb);
  79. }
  80. static struct videobuf_queue_ops dvb_qops = {
  81. .buf_setup = dvb_buf_setup,
  82. .buf_prepare = dvb_buf_prepare,
  83. .buf_queue = dvb_buf_queue,
  84. .buf_release = dvb_buf_release,
  85. };
  86. static struct s5h1409_config hauppauge_generic_config = {
  87. .demod_address = 0x32 >> 1,
  88. .output_mode = S5H1409_SERIAL_OUTPUT,
  89. .gpio = S5H1409_GPIO_ON,
  90. .qam_if = 44000,
  91. .inversion = S5H1409_INVERSION_OFF,
  92. .status_mode = S5H1409_DEMODLOCKING,
  93. .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK,
  94. };
  95. static struct tda10048_config hauppauge_hvr1200_config = {
  96. .demod_address = 0x10 >> 1,
  97. .output_mode = TDA10048_SERIAL_OUTPUT,
  98. .fwbulkwritelen = TDA10048_BULKWRITE_200,
  99. .inversion = TDA10048_INVERSION_ON
  100. };
  101. static struct s5h1409_config hauppauge_ezqam_config = {
  102. .demod_address = 0x32 >> 1,
  103. .output_mode = S5H1409_SERIAL_OUTPUT,
  104. .gpio = S5H1409_GPIO_OFF,
  105. .qam_if = 4000,
  106. .inversion = S5H1409_INVERSION_ON,
  107. .status_mode = S5H1409_DEMODLOCKING,
  108. .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK,
  109. };
  110. static struct s5h1409_config hauppauge_hvr1800lp_config = {
  111. .demod_address = 0x32 >> 1,
  112. .output_mode = S5H1409_SERIAL_OUTPUT,
  113. .gpio = S5H1409_GPIO_OFF,
  114. .qam_if = 44000,
  115. .inversion = S5H1409_INVERSION_OFF,
  116. .status_mode = S5H1409_DEMODLOCKING,
  117. .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK,
  118. };
  119. static struct s5h1409_config hauppauge_hvr1500_config = {
  120. .demod_address = 0x32 >> 1,
  121. .output_mode = S5H1409_SERIAL_OUTPUT,
  122. .gpio = S5H1409_GPIO_OFF,
  123. .inversion = S5H1409_INVERSION_OFF,
  124. .status_mode = S5H1409_DEMODLOCKING,
  125. .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK,
  126. };
  127. static struct mt2131_config hauppauge_generic_tunerconfig = {
  128. 0x61
  129. };
  130. static struct lgdt330x_config fusionhdtv_5_express = {
  131. .demod_address = 0x0e,
  132. .demod_chip = LGDT3303,
  133. .serial_mpeg = 0x40,
  134. };
  135. static struct s5h1409_config hauppauge_hvr1500q_config = {
  136. .demod_address = 0x32 >> 1,
  137. .output_mode = S5H1409_SERIAL_OUTPUT,
  138. .gpio = S5H1409_GPIO_ON,
  139. .qam_if = 44000,
  140. .inversion = S5H1409_INVERSION_OFF,
  141. .status_mode = S5H1409_DEMODLOCKING,
  142. .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK,
  143. };
  144. static struct s5h1409_config dvico_s5h1409_config = {
  145. .demod_address = 0x32 >> 1,
  146. .output_mode = S5H1409_SERIAL_OUTPUT,
  147. .gpio = S5H1409_GPIO_ON,
  148. .qam_if = 44000,
  149. .inversion = S5H1409_INVERSION_OFF,
  150. .status_mode = S5H1409_DEMODLOCKING,
  151. .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK,
  152. };
  153. static struct s5h1411_config dvico_s5h1411_config = {
  154. .output_mode = S5H1411_SERIAL_OUTPUT,
  155. .gpio = S5H1411_GPIO_ON,
  156. .qam_if = S5H1411_IF_44000,
  157. .vsb_if = S5H1411_IF_44000,
  158. .inversion = S5H1411_INVERSION_OFF,
  159. .status_mode = S5H1411_DEMODLOCKING,
  160. .mpeg_timing = S5H1411_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK,
  161. };
  162. static struct xc5000_config hauppauge_hvr1500q_tunerconfig = {
  163. .i2c_address = 0x61,
  164. .if_khz = 5380,
  165. .tuner_callback = cx23885_xc5000_tuner_callback,
  166. };
  167. static struct xc5000_config dvico_xc5000_tunerconfig = {
  168. .i2c_address = 0x64,
  169. .if_khz = 5380,
  170. .tuner_callback = cx23885_xc5000_tuner_callback,
  171. };
  172. static struct tda829x_config tda829x_no_probe = {
  173. .probe_tuner = TDA829X_DONT_PROBE,
  174. };
  175. static struct tda18271_std_map hauppauge_tda18271_std_map = {
  176. .atsc_6 = { .if_freq = 5380, .agc_mode = 3, .std = 3,
  177. .if_lvl = 6, .rfagc_top = 0x37 },
  178. .qam_6 = { .if_freq = 4000, .agc_mode = 3, .std = 0,
  179. .if_lvl = 6, .rfagc_top = 0x37 },
  180. };
  181. static struct tda18271_config hauppauge_tda18271_config = {
  182. .std_map = &hauppauge_tda18271_std_map,
  183. .gate = TDA18271_GATE_ANALOG,
  184. };
  185. static struct tda18271_config hauppauge_hvr1200_tuner_config = {
  186. .gate = TDA18271_GATE_ANALOG,
  187. };
  188. static struct dibx000_agc_config xc3028_agc_config = {
  189. BAND_VHF | BAND_UHF, /* band_caps */
  190. /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=0,
  191. * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0,
  192. * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0,
  193. * P_agc_nb_est=2, P_agc_write=0
  194. */
  195. (0 << 15) | (0 << 14) | (0 << 11) | (0 << 10) | (0 << 9) | (0 << 8) |
  196. (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), /* setup */
  197. 712, /* inv_gain */
  198. 21, /* time_stabiliz */
  199. 0, /* alpha_level */
  200. 118, /* thlock */
  201. 0, /* wbd_inv */
  202. 2867, /* wbd_ref */
  203. 0, /* wbd_sel */
  204. 2, /* wbd_alpha */
  205. 0, /* agc1_max */
  206. 0, /* agc1_min */
  207. 39718, /* agc2_max */
  208. 9930, /* agc2_min */
  209. 0, /* agc1_pt1 */
  210. 0, /* agc1_pt2 */
  211. 0, /* agc1_pt3 */
  212. 0, /* agc1_slope1 */
  213. 0, /* agc1_slope2 */
  214. 0, /* agc2_pt1 */
  215. 128, /* agc2_pt2 */
  216. 29, /* agc2_slope1 */
  217. 29, /* agc2_slope2 */
  218. 17, /* alpha_mant */
  219. 27, /* alpha_exp */
  220. 23, /* beta_mant */
  221. 51, /* beta_exp */
  222. 1, /* perform_agc_softsplit */
  223. };
  224. /* PLL Configuration for COFDM BW_MHz = 8.000000
  225. * With external clock = 30.000000 */
  226. static struct dibx000_bandwidth_config xc3028_bw_config = {
  227. 60000, /* internal */
  228. 30000, /* sampling */
  229. 1, /* pll_cfg: prediv */
  230. 8, /* pll_cfg: ratio */
  231. 3, /* pll_cfg: range */
  232. 1, /* pll_cfg: reset */
  233. 0, /* pll_cfg: bypass */
  234. 0, /* misc: refdiv */
  235. 0, /* misc: bypclk_div */
  236. 1, /* misc: IO_CLK_en_core */
  237. 1, /* misc: ADClkSrc */
  238. 0, /* misc: modulo */
  239. (3 << 14) | (1 << 12) | (524 << 0), /* sad_cfg: refsel, sel, freq_15k */
  240. (1 << 25) | 5816102, /* ifreq = 5.200000 MHz */
  241. 20452225, /* timf */
  242. 30000000 /* xtal_hz */
  243. };
  244. static struct dib7000p_config hauppauge_hvr1400_dib7000_config = {
  245. .output_mpeg2_in_188_bytes = 1,
  246. .hostbus_diversity = 1,
  247. .tuner_is_baseband = 0,
  248. .update_lna = NULL,
  249. .agc_config_count = 1,
  250. .agc = &xc3028_agc_config,
  251. .bw = &xc3028_bw_config,
  252. .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
  253. .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
  254. .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
  255. .pwm_freq_div = 0,
  256. .agc_control = NULL,
  257. .spur_protect = 0,
  258. .output_mode = OUTMODE_MPEG2_SERIAL,
  259. };
  260. static struct zl10353_config dvico_fusionhdtv_xc3028 = {
  261. .demod_address = 0x0f,
  262. .if2 = 45600,
  263. .no_tuner = 1,
  264. };
  265. static int dvb_register(struct cx23885_tsport *port)
  266. {
  267. struct cx23885_dev *dev = port->dev;
  268. struct cx23885_i2c *i2c_bus = NULL;
  269. /* init struct videobuf_dvb */
  270. port->dvb.name = dev->name;
  271. /* init frontend */
  272. switch (dev->board) {
  273. case CX23885_BOARD_HAUPPAUGE_HVR1250:
  274. i2c_bus = &dev->i2c_bus[0];
  275. port->dvb.frontend = dvb_attach(s5h1409_attach,
  276. &hauppauge_generic_config,
  277. &i2c_bus->i2c_adap);
  278. if (port->dvb.frontend != NULL) {
  279. dvb_attach(mt2131_attach, port->dvb.frontend,
  280. &i2c_bus->i2c_adap,
  281. &hauppauge_generic_tunerconfig, 0);
  282. }
  283. break;
  284. case CX23885_BOARD_HAUPPAUGE_HVR1800:
  285. i2c_bus = &dev->i2c_bus[0];
  286. switch (alt_tuner) {
  287. case 1:
  288. port->dvb.frontend =
  289. dvb_attach(s5h1409_attach,
  290. &hauppauge_ezqam_config,
  291. &i2c_bus->i2c_adap);
  292. if (port->dvb.frontend != NULL) {
  293. dvb_attach(tda829x_attach, port->dvb.frontend,
  294. &dev->i2c_bus[1].i2c_adap, 0x42,
  295. &tda829x_no_probe);
  296. dvb_attach(tda18271_attach, port->dvb.frontend,
  297. 0x60, &dev->i2c_bus[1].i2c_adap,
  298. &hauppauge_tda18271_config);
  299. }
  300. break;
  301. case 0:
  302. default:
  303. port->dvb.frontend =
  304. dvb_attach(s5h1409_attach,
  305. &hauppauge_generic_config,
  306. &i2c_bus->i2c_adap);
  307. if (port->dvb.frontend != NULL)
  308. dvb_attach(mt2131_attach, port->dvb.frontend,
  309. &i2c_bus->i2c_adap,
  310. &hauppauge_generic_tunerconfig, 0);
  311. break;
  312. }
  313. break;
  314. case CX23885_BOARD_HAUPPAUGE_HVR1800lp:
  315. i2c_bus = &dev->i2c_bus[0];
  316. port->dvb.frontend = dvb_attach(s5h1409_attach,
  317. &hauppauge_hvr1800lp_config,
  318. &i2c_bus->i2c_adap);
  319. if (port->dvb.frontend != NULL) {
  320. dvb_attach(mt2131_attach, port->dvb.frontend,
  321. &i2c_bus->i2c_adap,
  322. &hauppauge_generic_tunerconfig, 0);
  323. }
  324. break;
  325. case CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP:
  326. i2c_bus = &dev->i2c_bus[0];
  327. port->dvb.frontend = dvb_attach(lgdt330x_attach,
  328. &fusionhdtv_5_express,
  329. &i2c_bus->i2c_adap);
  330. if (port->dvb.frontend != NULL) {
  331. dvb_attach(simple_tuner_attach, port->dvb.frontend,
  332. &i2c_bus->i2c_adap, 0x61,
  333. TUNER_LG_TDVS_H06XF);
  334. }
  335. break;
  336. case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
  337. i2c_bus = &dev->i2c_bus[1];
  338. port->dvb.frontend = dvb_attach(s5h1409_attach,
  339. &hauppauge_hvr1500q_config,
  340. &dev->i2c_bus[0].i2c_adap);
  341. if (port->dvb.frontend != NULL)
  342. dvb_attach(xc5000_attach, port->dvb.frontend,
  343. &i2c_bus->i2c_adap,
  344. &hauppauge_hvr1500q_tunerconfig, i2c_bus);
  345. break;
  346. case CX23885_BOARD_HAUPPAUGE_HVR1500:
  347. i2c_bus = &dev->i2c_bus[1];
  348. port->dvb.frontend = dvb_attach(s5h1409_attach,
  349. &hauppauge_hvr1500_config,
  350. &dev->i2c_bus[0].i2c_adap);
  351. if (port->dvb.frontend != NULL) {
  352. struct dvb_frontend *fe;
  353. struct xc2028_config cfg = {
  354. .i2c_adap = &i2c_bus->i2c_adap,
  355. .i2c_addr = 0x61,
  356. .callback = cx23885_xc3028_tuner_callback,
  357. };
  358. static struct xc2028_ctrl ctl = {
  359. .fname = "xc3028-v27.fw",
  360. .max_len = 64,
  361. .scode_table = XC3028_FE_OREN538,
  362. };
  363. fe = dvb_attach(xc2028_attach,
  364. port->dvb.frontend, &cfg);
  365. if (fe != NULL && fe->ops.tuner_ops.set_config != NULL)
  366. fe->ops.tuner_ops.set_config(fe, &ctl);
  367. }
  368. break;
  369. case CX23885_BOARD_HAUPPAUGE_HVR1200:
  370. case CX23885_BOARD_HAUPPAUGE_HVR1700:
  371. i2c_bus = &dev->i2c_bus[0];
  372. port->dvb.frontend = dvb_attach(tda10048_attach,
  373. &hauppauge_hvr1200_config,
  374. &i2c_bus->i2c_adap);
  375. if (port->dvb.frontend != NULL) {
  376. dvb_attach(tda829x_attach, port->dvb.frontend,
  377. &dev->i2c_bus[1].i2c_adap, 0x42,
  378. &tda829x_no_probe);
  379. dvb_attach(tda18271_attach, port->dvb.frontend,
  380. 0x60, &dev->i2c_bus[1].i2c_adap,
  381. &hauppauge_hvr1200_tuner_config);
  382. }
  383. break;
  384. case CX23885_BOARD_HAUPPAUGE_HVR1400:
  385. i2c_bus = &dev->i2c_bus[0];
  386. port->dvb.frontend = dvb_attach(dib7000p_attach,
  387. &i2c_bus->i2c_adap,
  388. 0x12, &hauppauge_hvr1400_dib7000_config);
  389. if (port->dvb.frontend != NULL) {
  390. struct dvb_frontend *fe;
  391. struct xc2028_config cfg = {
  392. .i2c_adap = &dev->i2c_bus[1].i2c_adap,
  393. .i2c_addr = 0x64,
  394. .callback = cx23885_xc3028_tuner_callback,
  395. };
  396. static struct xc2028_ctrl ctl = {
  397. .fname = "xc3028L-v36.fw",
  398. .max_len = 64,
  399. .demod = 5000,
  400. .d2633 = 1
  401. };
  402. fe = dvb_attach(xc2028_attach,
  403. port->dvb.frontend, &cfg);
  404. if (fe != NULL && fe->ops.tuner_ops.set_config != NULL)
  405. fe->ops.tuner_ops.set_config(fe, &ctl);
  406. }
  407. break;
  408. case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP:
  409. i2c_bus = &dev->i2c_bus[port->nr - 1];
  410. port->dvb.frontend = dvb_attach(s5h1409_attach,
  411. &dvico_s5h1409_config,
  412. &i2c_bus->i2c_adap);
  413. if (port->dvb.frontend == NULL)
  414. port->dvb.frontend = dvb_attach(s5h1411_attach,
  415. &dvico_s5h1411_config,
  416. &i2c_bus->i2c_adap);
  417. if (port->dvb.frontend != NULL)
  418. dvb_attach(xc5000_attach, port->dvb.frontend,
  419. &i2c_bus->i2c_adap,
  420. &dvico_xc5000_tunerconfig, i2c_bus);
  421. break;
  422. case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP: {
  423. i2c_bus = &dev->i2c_bus[port->nr - 1];
  424. port->dvb.frontend = dvb_attach(zl10353_attach,
  425. &dvico_fusionhdtv_xc3028,
  426. &i2c_bus->i2c_adap);
  427. if (port->dvb.frontend != NULL) {
  428. struct dvb_frontend *fe;
  429. struct xc2028_config cfg = {
  430. .i2c_adap = &i2c_bus->i2c_adap,
  431. .i2c_addr = 0x61,
  432. .video_dev = port,
  433. .callback = cx23885_xc3028_tuner_callback,
  434. };
  435. static struct xc2028_ctrl ctl = {
  436. .fname = "xc3028-v27.fw",
  437. .max_len = 64,
  438. .demod = XC3028_FE_ZARLINK456,
  439. };
  440. fe = dvb_attach(xc2028_attach, port->dvb.frontend,
  441. &cfg);
  442. if (fe != NULL && fe->ops.tuner_ops.set_config != NULL)
  443. fe->ops.tuner_ops.set_config(fe, &ctl);
  444. }
  445. break;
  446. }
  447. default:
  448. printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n",
  449. dev->name);
  450. break;
  451. }
  452. if (NULL == port->dvb.frontend) {
  453. printk("%s: frontend initialization failed\n", dev->name);
  454. return -1;
  455. }
  456. /* Put the analog decoder in standby to keep it quiet */
  457. cx23885_call_i2c_clients(i2c_bus, TUNER_SET_STANDBY, NULL);
  458. if (port->dvb.frontend->ops.analog_ops.standby)
  459. port->dvb.frontend->ops.analog_ops.standby(port->dvb.frontend);
  460. /* register everything */
  461. return videobuf_dvb_register(&port->dvb, THIS_MODULE, port,
  462. &dev->pci->dev, adapter_nr);
  463. }
  464. int cx23885_dvb_register(struct cx23885_tsport *port)
  465. {
  466. struct cx23885_dev *dev = port->dev;
  467. int err;
  468. dprintk(1, "%s\n", __func__);
  469. dprintk(1, " ->being probed by Card=%d Name=%s, PCI %02x:%02x\n",
  470. dev->board,
  471. dev->name,
  472. dev->pci_bus,
  473. dev->pci_slot);
  474. err = -ENODEV;
  475. /* dvb stuff */
  476. printk("%s: cx23885 based dvb card\n", dev->name);
  477. videobuf_queue_sg_init(&port->dvb.dvbq, &dvb_qops, &dev->pci->dev, &port->slock,
  478. V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_TOP,
  479. sizeof(struct cx23885_buffer), port);
  480. err = dvb_register(port);
  481. if (err != 0)
  482. printk("%s() dvb_register failed err = %d\n", __func__, err);
  483. return err;
  484. }
  485. int cx23885_dvb_unregister(struct cx23885_tsport *port)
  486. {
  487. /* dvb */
  488. if(port->dvb.frontend)
  489. videobuf_dvb_unregister(&port->dvb);
  490. return 0;
  491. }
  492. /*
  493. * Local variables:
  494. * c-basic-offset: 8
  495. * End:
  496. * kate: eol "unix"; indent-width 3; remove-trailing-space on; replace-trailing-space-save on; tab-width 8; replace-tabs off; space-indent off; mixed-indent off
  497. */