3 * device driver for Conexant 2388x based TV cards
4 * MPEG Transport Stream (DVB) routines
6 * (c) 2004, 2005 Chris Pascoe <c.pascoe@itee.uq.edu.au>
7 * (c) 2004 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #include <linux/module.h>
25 #include <linux/init.h>
26 #include <linux/device.h>
28 #include <linux/kthread.h>
29 #include <linux/file.h>
30 #include <linux/suspend.h>
34 #include <media/v4l2-common.h>
37 #include "mt352_priv.h"
38 #include "cx88-vp3054-i2c.h"
48 #include "tuner-simple.h"
58 #include "stb6100_proc.h"
60 MODULE_DESCRIPTION("driver for cx2388x based DVB cards");
61 MODULE_AUTHOR("Chris Pascoe <c.pascoe@itee.uq.edu.au>");
62 MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]");
63 MODULE_LICENSE("GPL");
65 static unsigned int debug;
66 module_param(debug, int, 0644);
67 MODULE_PARM_DESC(debug,"enable debug messages [dvb]");
69 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
71 #define dprintk(level,fmt, arg...) if (debug >= level) \
72 printk(KERN_DEBUG "%s/2-dvb: " fmt, core->name, ## arg)
74 /* ------------------------------------------------------------------ */
76 static int dvb_buf_setup(struct videobuf_queue *q,
77 unsigned int *count, unsigned int *size)
79 struct cx8802_dev *dev = q->priv_data;
81 dev->ts_packet_size = 188 * 4;
82 dev->ts_packet_count = 32;
84 *size = dev->ts_packet_size * dev->ts_packet_count;
89 static int dvb_buf_prepare(struct videobuf_queue *q,
90 struct videobuf_buffer *vb, enum v4l2_field field)
92 struct cx8802_dev *dev = q->priv_data;
93 return cx8802_buf_prepare(q, dev, (struct cx88_buffer*)vb,field);
96 static void dvb_buf_queue(struct videobuf_queue *q, struct videobuf_buffer *vb)
98 struct cx8802_dev *dev = q->priv_data;
99 cx8802_buf_queue(dev, (struct cx88_buffer*)vb);
102 static void dvb_buf_release(struct videobuf_queue *q,
103 struct videobuf_buffer *vb)
105 cx88_free_buffer(q, (struct cx88_buffer*)vb);
108 static struct videobuf_queue_ops dvb_qops = {
109 .buf_setup = dvb_buf_setup,
110 .buf_prepare = dvb_buf_prepare,
111 .buf_queue = dvb_buf_queue,
112 .buf_release = dvb_buf_release,
115 /* ------------------------------------------------------------------ */
117 static int cx88_dvb_bus_ctrl(struct dvb_frontend* fe, int acquire)
119 struct cx8802_dev *dev= fe->dvb->priv;
120 struct cx8802_driver *drv = NULL;
124 fe_id = videobuf_dvb_find_frontend(&dev->frontends, fe);
126 printk(KERN_ERR "%s() No frontend found\n", __func__);
130 drv = cx8802_get_driver(dev, CX88_MPEG_DVB);
133 dev->frontends.active_fe_id = fe_id;
134 ret = drv->request_acquire(drv);
136 ret = drv->request_release(drv);
137 dev->frontends.active_fe_id = 0;
144 static void cx88_dvb_gate_ctrl(struct cx88_core *core, int open)
146 struct videobuf_dvb_frontends *f;
147 struct videobuf_dvb_frontend *fe;
152 f = &core->dvbdev->frontends;
157 if (f->gate <= 1) /* undefined or fe0 */
158 fe = videobuf_dvb_get_frontend(f, 1);
160 fe = videobuf_dvb_get_frontend(f, f->gate);
162 if (fe && fe->dvb.frontend && fe->dvb.frontend->ops.i2c_gate_ctrl)
163 fe->dvb.frontend->ops.i2c_gate_ctrl(fe->dvb.frontend, open);
166 /* ------------------------------------------------------------------ */
168 static int dvico_fusionhdtv_demod_init(struct dvb_frontend* fe)
170 static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x39 };
171 static u8 reset [] = { RESET, 0x80 };
172 static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 };
173 static u8 agc_cfg [] = { AGC_TARGET, 0x24, 0x20 };
174 static u8 gpp_ctl_cfg [] = { GPP_CTL, 0x33 };
175 static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 };
177 mt352_write(fe, clock_config, sizeof(clock_config));
179 mt352_write(fe, reset, sizeof(reset));
180 mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
182 mt352_write(fe, agc_cfg, sizeof(agc_cfg));
183 mt352_write(fe, gpp_ctl_cfg, sizeof(gpp_ctl_cfg));
184 mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
188 static int dvico_dual_demod_init(struct dvb_frontend *fe)
190 static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x38 };
191 static u8 reset [] = { RESET, 0x80 };
192 static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 };
193 static u8 agc_cfg [] = { AGC_TARGET, 0x28, 0x20 };
194 static u8 gpp_ctl_cfg [] = { GPP_CTL, 0x33 };
195 static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 };
197 mt352_write(fe, clock_config, sizeof(clock_config));
199 mt352_write(fe, reset, sizeof(reset));
200 mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
202 mt352_write(fe, agc_cfg, sizeof(agc_cfg));
203 mt352_write(fe, gpp_ctl_cfg, sizeof(gpp_ctl_cfg));
204 mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
209 static int dntv_live_dvbt_demod_init(struct dvb_frontend* fe)
211 static u8 clock_config [] = { 0x89, 0x38, 0x39 };
212 static u8 reset [] = { 0x50, 0x80 };
213 static u8 adc_ctl_1_cfg [] = { 0x8E, 0x40 };
214 static u8 agc_cfg [] = { 0x67, 0x10, 0x23, 0x00, 0xFF, 0xFF,
215 0x00, 0xFF, 0x00, 0x40, 0x40 };
216 static u8 dntv_extra[] = { 0xB5, 0x7A };
217 static u8 capt_range_cfg[] = { 0x75, 0x32 };
219 mt352_write(fe, clock_config, sizeof(clock_config));
221 mt352_write(fe, reset, sizeof(reset));
222 mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
224 mt352_write(fe, agc_cfg, sizeof(agc_cfg));
226 mt352_write(fe, dntv_extra, sizeof(dntv_extra));
227 mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
232 static struct mt352_config dvico_fusionhdtv = {
233 .demod_address = 0x0f,
234 .demod_init = dvico_fusionhdtv_demod_init,
237 static struct mt352_config dntv_live_dvbt_config = {
238 .demod_address = 0x0f,
239 .demod_init = dntv_live_dvbt_demod_init,
242 static struct mt352_config dvico_fusionhdtv_dual = {
243 .demod_address = 0x0f,
244 .demod_init = dvico_dual_demod_init,
247 static struct zl10353_config cx88_terratec_cinergy_ht_pci_mkii_config = {
248 .demod_address = (0x1e >> 1),
253 #if defined(CONFIG_VIDEO_CX88_VP3054) || (defined(CONFIG_VIDEO_CX88_VP3054_MODULE) && defined(MODULE))
254 static int dntv_live_dvbt_pro_demod_init(struct dvb_frontend* fe)
256 static u8 clock_config [] = { 0x89, 0x38, 0x38 };
257 static u8 reset [] = { 0x50, 0x80 };
258 static u8 adc_ctl_1_cfg [] = { 0x8E, 0x40 };
259 static u8 agc_cfg [] = { 0x67, 0x10, 0x20, 0x00, 0xFF, 0xFF,
260 0x00, 0xFF, 0x00, 0x40, 0x40 };
261 static u8 dntv_extra[] = { 0xB5, 0x7A };
262 static u8 capt_range_cfg[] = { 0x75, 0x32 };
264 mt352_write(fe, clock_config, sizeof(clock_config));
266 mt352_write(fe, reset, sizeof(reset));
267 mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
269 mt352_write(fe, agc_cfg, sizeof(agc_cfg));
271 mt352_write(fe, dntv_extra, sizeof(dntv_extra));
272 mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
277 static struct mt352_config dntv_live_dvbt_pro_config = {
278 .demod_address = 0x0f,
280 .demod_init = dntv_live_dvbt_pro_demod_init,
284 static struct zl10353_config dvico_fusionhdtv_hybrid = {
285 .demod_address = 0x0f,
289 static struct zl10353_config dvico_fusionhdtv_xc3028 = {
290 .demod_address = 0x0f,
295 static struct mt352_config dvico_fusionhdtv_mt352_xc3028 = {
296 .demod_address = 0x0f,
299 .demod_init = dvico_fusionhdtv_demod_init,
302 static struct zl10353_config dvico_fusionhdtv_plus_v1_1 = {
303 .demod_address = 0x0f,
306 static struct cx22702_config connexant_refboard_config = {
307 .demod_address = 0x43,
308 .output_mode = CX22702_SERIAL_OUTPUT,
311 static struct cx22702_config hauppauge_hvr_config = {
312 .demod_address = 0x63,
313 .output_mode = CX22702_SERIAL_OUTPUT,
316 static int or51132_set_ts_param(struct dvb_frontend* fe, int is_punctured)
318 struct cx8802_dev *dev= fe->dvb->priv;
319 dev->ts_gen_cntrl = is_punctured ? 0x04 : 0x00;
323 static struct or51132_config pchdtv_hd3000 = {
324 .demod_address = 0x15,
325 .set_ts_params = or51132_set_ts_param,
328 static int lgdt330x_pll_rf_set(struct dvb_frontend* fe, int index)
330 struct cx8802_dev *dev= fe->dvb->priv;
331 struct cx88_core *core = dev->core;
333 dprintk(1, "%s: index = %d\n", __func__, index);
335 cx_clear(MO_GP0_IO, 8);
337 cx_set(MO_GP0_IO, 8);
341 static int lgdt330x_set_ts_param(struct dvb_frontend* fe, int is_punctured)
343 struct cx8802_dev *dev= fe->dvb->priv;
345 dev->ts_gen_cntrl |= 0x04;
347 dev->ts_gen_cntrl &= ~0x04;
351 static struct lgdt330x_config fusionhdtv_3_gold = {
352 .demod_address = 0x0e,
353 .demod_chip = LGDT3302,
354 .serial_mpeg = 0x04, /* TPSERIAL for 3302 in TOP_CONTROL */
355 .set_ts_params = lgdt330x_set_ts_param,
358 static struct lgdt330x_config fusionhdtv_5_gold = {
359 .demod_address = 0x0e,
360 .demod_chip = LGDT3303,
361 .serial_mpeg = 0x40, /* TPSERIAL for 3303 in TOP_CONTROL */
362 .set_ts_params = lgdt330x_set_ts_param,
365 static struct lgdt330x_config pchdtv_hd5500 = {
366 .demod_address = 0x59,
367 .demod_chip = LGDT3303,
368 .serial_mpeg = 0x40, /* TPSERIAL for 3303 in TOP_CONTROL */
369 .set_ts_params = lgdt330x_set_ts_param,
372 static int nxt200x_set_ts_param(struct dvb_frontend* fe, int is_punctured)
374 struct cx8802_dev *dev= fe->dvb->priv;
375 dev->ts_gen_cntrl = is_punctured ? 0x04 : 0x00;
379 static struct nxt200x_config ati_hdtvwonder = {
380 .demod_address = 0x0a,
381 .set_ts_params = nxt200x_set_ts_param,
384 static int cx24123_set_ts_param(struct dvb_frontend* fe,
387 struct cx8802_dev *dev= fe->dvb->priv;
388 dev->ts_gen_cntrl = 0x02;
392 static int kworld_dvbs_100_set_voltage(struct dvb_frontend* fe,
393 fe_sec_voltage_t voltage)
395 struct cx8802_dev *dev= fe->dvb->priv;
396 struct cx88_core *core = dev->core;
398 if (voltage == SEC_VOLTAGE_OFF)
399 cx_write(MO_GP0_IO, 0x000006fb);
401 cx_write(MO_GP0_IO, 0x000006f9);
403 if (core->prev_set_voltage)
404 return core->prev_set_voltage(fe, voltage);
408 static int geniatech_dvbs_set_voltage(struct dvb_frontend *fe,
409 fe_sec_voltage_t voltage)
411 struct cx8802_dev *dev= fe->dvb->priv;
412 struct cx88_core *core = dev->core;
414 if (voltage == SEC_VOLTAGE_OFF) {
415 dprintk(1,"LNB Voltage OFF\n");
416 cx_write(MO_GP0_IO, 0x0000efff);
419 if (core->prev_set_voltage)
420 return core->prev_set_voltage(fe, voltage);
424 static int tevii_dvbs_set_voltage(struct dvb_frontend *fe,
425 fe_sec_voltage_t voltage)
427 struct cx8802_dev *dev= fe->dvb->priv;
428 struct cx88_core *core = dev->core;
430 cx_set(MO_GP0_IO, 0x6040);
433 cx_clear(MO_GP0_IO, 0x20);
436 cx_set(MO_GP0_IO, 0x20);
438 case SEC_VOLTAGE_OFF:
439 cx_clear(MO_GP0_IO, 0x20);
443 if (core->prev_set_voltage)
444 return core->prev_set_voltage(fe, voltage);
448 static struct cx24123_config geniatech_dvbs_config = {
449 .demod_address = 0x55,
450 .set_ts_params = cx24123_set_ts_param,
453 static struct cx24123_config hauppauge_novas_config = {
454 .demod_address = 0x55,
455 .set_ts_params = cx24123_set_ts_param,
458 static struct cx24123_config kworld_dvbs_100_config = {
459 .demod_address = 0x15,
460 .set_ts_params = cx24123_set_ts_param,
464 static struct s5h1409_config pinnacle_pctv_hd_800i_config = {
465 .demod_address = 0x32 >> 1,
466 .output_mode = S5H1409_PARALLEL_OUTPUT,
467 .gpio = S5H1409_GPIO_ON,
469 .inversion = S5H1409_INVERSION_OFF,
470 .status_mode = S5H1409_DEMODLOCKING,
471 .mpeg_timing = S5H1409_MPEGTIMING_NONCONTINOUS_NONINVERTING_CLOCK,
474 static struct s5h1409_config dvico_hdtv5_pci_nano_config = {
475 .demod_address = 0x32 >> 1,
476 .output_mode = S5H1409_SERIAL_OUTPUT,
477 .gpio = S5H1409_GPIO_OFF,
478 .inversion = S5H1409_INVERSION_OFF,
479 .status_mode = S5H1409_DEMODLOCKING,
480 .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK,
483 static struct s5h1409_config kworld_atsc_120_config = {
484 .demod_address = 0x32 >> 1,
485 .output_mode = S5H1409_SERIAL_OUTPUT,
486 .gpio = S5H1409_GPIO_OFF,
487 .inversion = S5H1409_INVERSION_OFF,
488 .status_mode = S5H1409_DEMODLOCKING,
489 .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK,
492 static struct xc5000_config pinnacle_pctv_hd_800i_tuner_config = {
497 static struct zl10353_config cx88_pinnacle_hybrid_pctv = {
498 .demod_address = (0x1e >> 1),
503 static struct zl10353_config cx88_geniatech_x8000_mt = {
504 .demod_address = (0x1e >> 1),
506 .disable_i2c_gate_ctrl = 1,
509 static struct s5h1411_config dvico_fusionhdtv7_config = {
510 .output_mode = S5H1411_SERIAL_OUTPUT,
511 .gpio = S5H1411_GPIO_ON,
512 .mpeg_timing = S5H1411_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK,
513 .qam_if = S5H1411_IF_44000,
514 .vsb_if = S5H1411_IF_44000,
515 .inversion = S5H1411_INVERSION_OFF,
516 .status_mode = S5H1411_DEMODLOCKING
519 static struct xc5000_config dvico_fusionhdtv7_tuner_config = {
520 .i2c_address = 0xc2 >> 1,
524 static int attach_xc3028(u8 addr, struct cx8802_dev *dev)
526 struct dvb_frontend *fe;
527 struct videobuf_dvb_frontend *fe0 = NULL;
528 struct xc2028_ctrl ctl;
529 struct xc2028_config cfg = {
530 .i2c_adap = &dev->core->i2c_adap,
535 /* Get the first frontend */
536 fe0 = videobuf_dvb_get_frontend(&dev->frontends, 1);
540 if (!fe0->dvb.frontend) {
541 printk(KERN_ERR "%s/2: dvb frontend not attached. "
542 "Can't attach xc3028\n",
548 * Some xc3028 devices may be hidden by an I2C gate. This is known
549 * to happen with some s5h1409-based devices.
550 * Now that I2C gate is open, sets up xc3028 configuration
552 cx88_setup_xc3028(dev->core, &ctl);
554 fe = dvb_attach(xc2028_attach, fe0->dvb.frontend, &cfg);
556 printk(KERN_ERR "%s/2: xc3028 attach failed\n",
558 dvb_frontend_detach(fe0->dvb.frontend);
559 dvb_unregister_frontend(fe0->dvb.frontend);
560 fe0->dvb.frontend = NULL;
564 printk(KERN_INFO "%s/2: xc3028 attached\n",
570 static int cx24116_set_ts_param(struct dvb_frontend *fe,
573 struct cx8802_dev *dev = fe->dvb->priv;
574 dev->ts_gen_cntrl = 0x2;
579 static int stv0900_set_ts_param(struct dvb_frontend *fe,
582 struct cx8802_dev *dev = fe->dvb->priv;
583 dev->ts_gen_cntrl = 0;
588 static int cx24116_reset_device(struct dvb_frontend *fe)
590 struct cx8802_dev *dev = fe->dvb->priv;
591 struct cx88_core *core = dev->core;
594 /* Put the cx24116 into reset */
595 cx_write(MO_SRST_IO, 0);
597 /* Take the cx24116 out of reset */
598 cx_write(MO_SRST_IO, 1);
604 static struct cx24116_config hauppauge_hvr4000_config = {
605 .demod_address = 0x05,
606 .set_ts_params = cx24116_set_ts_param,
607 .reset_device = cx24116_reset_device,
610 static struct cx24116_config tevii_s460_config = {
611 .demod_address = 0x55,
612 .set_ts_params = cx24116_set_ts_param,
613 .reset_device = cx24116_reset_device,
616 static struct stv0900_config prof_7301_stv0900_config = {
617 .demod_address = 0x6a,
620 .clkmode = 3,/* 0-CLKI, 2-XTALI, else AUTO */
621 .diseqc_mode = 2,/* 2/3 PWM */
622 .tun1_maddress = 0,/* 0x60 */
623 .tun1_adc = 0,/* 2 Vpp */
625 .set_ts_params = stv0900_set_ts_param,
628 static struct stb6100_config prof_7301_stb6100_config = {
629 .tuner_address = 0x60,
630 .refclock = 27000000,
633 static struct stv0299_config tevii_tuner_sharp_config = {
634 .demod_address = 0x68,
635 .inittab = sharp_z0194a_inittab,
640 .volt13_op0_op1 = STV0299_VOLT13_OP1,
642 .set_symbol_rate = sharp_z0194a_set_symbol_rate,
643 .set_ts_params = cx24116_set_ts_param,
646 static struct stv0288_config tevii_tuner_earda_config = {
647 .demod_address = 0x68,
649 .set_ts_params = cx24116_set_ts_param,
652 static int cx8802_alloc_frontends(struct cx8802_dev *dev)
654 struct cx88_core *core = dev->core;
655 struct videobuf_dvb_frontend *fe = NULL;
658 mutex_init(&dev->frontends.lock);
659 INIT_LIST_HEAD(&dev->frontends.felist);
661 if (!core->board.num_frontends)
664 printk(KERN_INFO "%s() allocating %d frontend(s)\n", __func__,
665 core->board.num_frontends);
666 for (i = 1; i <= core->board.num_frontends; i++) {
667 fe = videobuf_dvb_alloc_frontend(&dev->frontends, i);
669 printk(KERN_ERR "%s() failed to alloc\n", __func__);
670 videobuf_dvb_dealloc_frontends(&dev->frontends);
677 static int dvb_register(struct cx8802_dev *dev)
679 struct cx88_core *core = dev->core;
680 struct videobuf_dvb_frontend *fe0, *fe1 = NULL;
681 int mfe_shared = 0; /* bus not shared by default */
683 if (0 != core->i2c_rc) {
684 printk(KERN_ERR "%s/2: no i2c-bus available, cannot attach dvb drivers\n", core->name);
685 goto frontend_detach;
688 /* Get the first frontend */
689 fe0 = videobuf_dvb_get_frontend(&dev->frontends, 1);
691 goto frontend_detach;
693 /* multi-frontend gate control is undefined or defaults to fe0 */
694 dev->frontends.gate = 0;
696 /* Sets the gate control callback to be used by i2c command calls */
697 core->gate_ctrl = cx88_dvb_gate_ctrl;
699 /* init frontend(s) */
700 switch (core->boardnr) {
701 case CX88_BOARD_HAUPPAUGE_DVB_T1:
702 fe0->dvb.frontend = dvb_attach(cx22702_attach,
703 &connexant_refboard_config,
705 if (fe0->dvb.frontend != NULL) {
706 if (!dvb_attach(dvb_pll_attach, fe0->dvb.frontend,
707 0x61, &core->i2c_adap,
708 DVB_PLL_THOMSON_DTT759X))
709 goto frontend_detach;
712 case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1:
713 case CX88_BOARD_CONEXANT_DVB_T1:
714 case CX88_BOARD_KWORLD_DVB_T_CX22702:
715 case CX88_BOARD_WINFAST_DTV1000:
716 fe0->dvb.frontend = dvb_attach(cx22702_attach,
717 &connexant_refboard_config,
719 if (fe0->dvb.frontend != NULL) {
720 if (!dvb_attach(dvb_pll_attach, fe0->dvb.frontend,
721 0x60, &core->i2c_adap,
722 DVB_PLL_THOMSON_DTT7579))
723 goto frontend_detach;
726 case CX88_BOARD_WINFAST_DTV2000H:
727 case CX88_BOARD_WINFAST_DTV2000H_J:
728 case CX88_BOARD_HAUPPAUGE_HVR1100:
729 case CX88_BOARD_HAUPPAUGE_HVR1100LP:
730 case CX88_BOARD_HAUPPAUGE_HVR1300:
731 fe0->dvb.frontend = dvb_attach(cx22702_attach,
732 &hauppauge_hvr_config,
734 if (fe0->dvb.frontend != NULL) {
735 if (!dvb_attach(simple_tuner_attach, fe0->dvb.frontend,
736 &core->i2c_adap, 0x61,
737 TUNER_PHILIPS_FMD1216ME_MK3))
738 goto frontend_detach;
741 case CX88_BOARD_HAUPPAUGE_HVR3000:
744 dev->frontends.gate = 2;
746 fe0->dvb.frontend = dvb_attach(cx24123_attach,
747 &hauppauge_novas_config,
748 &dev->core->i2c_adap);
749 if (fe0->dvb.frontend) {
750 if (!dvb_attach(isl6421_attach,
752 &dev->core->i2c_adap,
753 0x08, ISL6421_DCL, 0x00))
754 goto frontend_detach;
757 fe1 = videobuf_dvb_get_frontend(&dev->frontends, 2);
759 goto frontend_detach;
761 fe1->dvb.frontend = dvb_attach(cx22702_attach,
762 &hauppauge_hvr_config,
763 &dev->core->i2c_adap);
764 if (fe1->dvb.frontend) {
765 fe1->dvb.frontend->id = 1;
766 if (!dvb_attach(simple_tuner_attach,
768 &dev->core->i2c_adap,
769 0x61, TUNER_PHILIPS_FMD1216ME_MK3))
770 goto frontend_detach;
773 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS:
774 fe0->dvb.frontend = dvb_attach(mt352_attach,
777 if (fe0->dvb.frontend != NULL) {
778 if (!dvb_attach(dvb_pll_attach, fe0->dvb.frontend,
779 0x60, NULL, DVB_PLL_THOMSON_DTT7579))
780 goto frontend_detach;
783 /* ZL10353 replaces MT352 on later cards */
784 fe0->dvb.frontend = dvb_attach(zl10353_attach,
785 &dvico_fusionhdtv_plus_v1_1,
787 if (fe0->dvb.frontend != NULL) {
788 if (!dvb_attach(dvb_pll_attach, fe0->dvb.frontend,
789 0x60, NULL, DVB_PLL_THOMSON_DTT7579))
790 goto frontend_detach;
793 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL:
794 /* The tin box says DEE1601, but it seems to be DTT7579
795 * compatible, with a slightly different MT352 AGC gain. */
796 fe0->dvb.frontend = dvb_attach(mt352_attach,
797 &dvico_fusionhdtv_dual,
799 if (fe0->dvb.frontend != NULL) {
800 if (!dvb_attach(dvb_pll_attach, fe0->dvb.frontend,
801 0x61, NULL, DVB_PLL_THOMSON_DTT7579))
802 goto frontend_detach;
805 /* ZL10353 replaces MT352 on later cards */
806 fe0->dvb.frontend = dvb_attach(zl10353_attach,
807 &dvico_fusionhdtv_plus_v1_1,
809 if (fe0->dvb.frontend != NULL) {
810 if (!dvb_attach(dvb_pll_attach, fe0->dvb.frontend,
811 0x61, NULL, DVB_PLL_THOMSON_DTT7579))
812 goto frontend_detach;
815 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
816 fe0->dvb.frontend = dvb_attach(mt352_attach,
819 if (fe0->dvb.frontend != NULL) {
820 if (!dvb_attach(dvb_pll_attach, fe0->dvb.frontend,
821 0x61, NULL, DVB_PLL_LG_Z201))
822 goto frontend_detach;
825 case CX88_BOARD_KWORLD_DVB_T:
826 case CX88_BOARD_DNTV_LIVE_DVB_T:
827 case CX88_BOARD_ADSTECH_DVB_T_PCI:
828 fe0->dvb.frontend = dvb_attach(mt352_attach,
829 &dntv_live_dvbt_config,
831 if (fe0->dvb.frontend != NULL) {
832 if (!dvb_attach(dvb_pll_attach, fe0->dvb.frontend,
833 0x61, NULL, DVB_PLL_UNKNOWN_1))
834 goto frontend_detach;
837 case CX88_BOARD_DNTV_LIVE_DVB_T_PRO:
838 #if defined(CONFIG_VIDEO_CX88_VP3054) || (defined(CONFIG_VIDEO_CX88_VP3054_MODULE) && defined(MODULE))
839 /* MT352 is on a secondary I2C bus made from some GPIO lines */
840 fe0->dvb.frontend = dvb_attach(mt352_attach, &dntv_live_dvbt_pro_config,
842 if (fe0->dvb.frontend != NULL) {
843 if (!dvb_attach(simple_tuner_attach, fe0->dvb.frontend,
844 &core->i2c_adap, 0x61,
845 TUNER_PHILIPS_FMD1216ME_MK3))
846 goto frontend_detach;
849 printk(KERN_ERR "%s/2: built without vp3054 support\n",
853 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID:
854 fe0->dvb.frontend = dvb_attach(zl10353_attach,
855 &dvico_fusionhdtv_hybrid,
857 if (fe0->dvb.frontend != NULL) {
858 if (!dvb_attach(simple_tuner_attach, fe0->dvb.frontend,
859 &core->i2c_adap, 0x61,
860 TUNER_THOMSON_FE6600))
861 goto frontend_detach;
864 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO:
865 fe0->dvb.frontend = dvb_attach(zl10353_attach,
866 &dvico_fusionhdtv_xc3028,
868 if (fe0->dvb.frontend == NULL)
869 fe0->dvb.frontend = dvb_attach(mt352_attach,
870 &dvico_fusionhdtv_mt352_xc3028,
873 * On this board, the demod provides the I2C bus pullup.
874 * We must not permit gate_ctrl to be performed, or
875 * the xc3028 cannot communicate on the bus.
877 if (fe0->dvb.frontend)
878 fe0->dvb.frontend->ops.i2c_gate_ctrl = NULL;
879 if (attach_xc3028(0x61, dev) < 0)
880 goto frontend_detach;
882 case CX88_BOARD_PCHDTV_HD3000:
883 fe0->dvb.frontend = dvb_attach(or51132_attach, &pchdtv_hd3000,
885 if (fe0->dvb.frontend != NULL) {
886 if (!dvb_attach(simple_tuner_attach, fe0->dvb.frontend,
887 &core->i2c_adap, 0x61,
888 TUNER_THOMSON_DTT761X))
889 goto frontend_detach;
892 case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q:
893 dev->ts_gen_cntrl = 0x08;
895 /* Do a hardware reset of chip before using it. */
896 cx_clear(MO_GP0_IO, 1);
898 cx_set(MO_GP0_IO, 1);
901 /* Select RF connector callback */
902 fusionhdtv_3_gold.pll_rf_set = lgdt330x_pll_rf_set;
903 fe0->dvb.frontend = dvb_attach(lgdt330x_attach,
906 if (fe0->dvb.frontend != NULL) {
907 if (!dvb_attach(simple_tuner_attach, fe0->dvb.frontend,
908 &core->i2c_adap, 0x61,
909 TUNER_MICROTUNE_4042FI5))
910 goto frontend_detach;
913 case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T:
914 dev->ts_gen_cntrl = 0x08;
916 /* Do a hardware reset of chip before using it. */
917 cx_clear(MO_GP0_IO, 1);
919 cx_set(MO_GP0_IO, 9);
921 fe0->dvb.frontend = dvb_attach(lgdt330x_attach,
924 if (fe0->dvb.frontend != NULL) {
925 if (!dvb_attach(simple_tuner_attach, fe0->dvb.frontend,
926 &core->i2c_adap, 0x61,
927 TUNER_THOMSON_DTT761X))
928 goto frontend_detach;
931 case CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD:
932 dev->ts_gen_cntrl = 0x08;
934 /* Do a hardware reset of chip before using it. */
935 cx_clear(MO_GP0_IO, 1);
937 cx_set(MO_GP0_IO, 1);
939 fe0->dvb.frontend = dvb_attach(lgdt330x_attach,
942 if (fe0->dvb.frontend != NULL) {
943 if (!dvb_attach(simple_tuner_attach, fe0->dvb.frontend,
944 &core->i2c_adap, 0x61,
945 TUNER_LG_TDVS_H06XF))
946 goto frontend_detach;
947 if (!dvb_attach(tda9887_attach, fe0->dvb.frontend,
948 &core->i2c_adap, 0x43))
949 goto frontend_detach;
952 case CX88_BOARD_PCHDTV_HD5500:
953 dev->ts_gen_cntrl = 0x08;
955 /* Do a hardware reset of chip before using it. */
956 cx_clear(MO_GP0_IO, 1);
958 cx_set(MO_GP0_IO, 1);
960 fe0->dvb.frontend = dvb_attach(lgdt330x_attach,
963 if (fe0->dvb.frontend != NULL) {
964 if (!dvb_attach(simple_tuner_attach, fe0->dvb.frontend,
965 &core->i2c_adap, 0x61,
966 TUNER_LG_TDVS_H06XF))
967 goto frontend_detach;
968 if (!dvb_attach(tda9887_attach, fe0->dvb.frontend,
969 &core->i2c_adap, 0x43))
970 goto frontend_detach;
973 case CX88_BOARD_ATI_HDTVWONDER:
974 fe0->dvb.frontend = dvb_attach(nxt200x_attach,
977 if (fe0->dvb.frontend != NULL) {
978 if (!dvb_attach(simple_tuner_attach, fe0->dvb.frontend,
979 &core->i2c_adap, 0x61,
980 TUNER_PHILIPS_TUV1236D))
981 goto frontend_detach;
984 case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1:
985 case CX88_BOARD_HAUPPAUGE_NOVASE2_S1:
986 fe0->dvb.frontend = dvb_attach(cx24123_attach,
987 &hauppauge_novas_config,
989 if (fe0->dvb.frontend) {
990 if (!dvb_attach(isl6421_attach, fe0->dvb.frontend,
991 &core->i2c_adap, 0x08, ISL6421_DCL, 0x00))
992 goto frontend_detach;
995 case CX88_BOARD_KWORLD_DVBS_100:
996 fe0->dvb.frontend = dvb_attach(cx24123_attach,
997 &kworld_dvbs_100_config,
999 if (fe0->dvb.frontend) {
1000 core->prev_set_voltage = fe0->dvb.frontend->ops.set_voltage;
1001 fe0->dvb.frontend->ops.set_voltage = kworld_dvbs_100_set_voltage;
1004 case CX88_BOARD_GENIATECH_DVBS:
1005 fe0->dvb.frontend = dvb_attach(cx24123_attach,
1006 &geniatech_dvbs_config,
1008 if (fe0->dvb.frontend) {
1009 core->prev_set_voltage = fe0->dvb.frontend->ops.set_voltage;
1010 fe0->dvb.frontend->ops.set_voltage = geniatech_dvbs_set_voltage;
1013 case CX88_BOARD_PINNACLE_PCTV_HD_800i:
1014 fe0->dvb.frontend = dvb_attach(s5h1409_attach,
1015 &pinnacle_pctv_hd_800i_config,
1017 if (fe0->dvb.frontend != NULL) {
1018 if (!dvb_attach(xc5000_attach, fe0->dvb.frontend,
1020 &pinnacle_pctv_hd_800i_tuner_config))
1021 goto frontend_detach;
1024 case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO:
1025 fe0->dvb.frontend = dvb_attach(s5h1409_attach,
1026 &dvico_hdtv5_pci_nano_config,
1028 if (fe0->dvb.frontend != NULL) {
1029 struct dvb_frontend *fe;
1030 struct xc2028_config cfg = {
1031 .i2c_adap = &core->i2c_adap,
1034 static struct xc2028_ctrl ctl = {
1035 .fname = XC2028_DEFAULT_FIRMWARE,
1037 .scode_table = XC3028_FE_OREN538,
1040 fe = dvb_attach(xc2028_attach,
1041 fe0->dvb.frontend, &cfg);
1042 if (fe != NULL && fe->ops.tuner_ops.set_config != NULL)
1043 fe->ops.tuner_ops.set_config(fe, &ctl);
1046 case CX88_BOARD_PINNACLE_HYBRID_PCTV:
1047 case CX88_BOARD_WINFAST_DTV1800H:
1048 fe0->dvb.frontend = dvb_attach(zl10353_attach,
1049 &cx88_pinnacle_hybrid_pctv,
1051 if (fe0->dvb.frontend) {
1052 fe0->dvb.frontend->ops.i2c_gate_ctrl = NULL;
1053 if (attach_xc3028(0x61, dev) < 0)
1054 goto frontend_detach;
1057 case CX88_BOARD_GENIATECH_X8000_MT:
1058 dev->ts_gen_cntrl = 0x00;
1060 fe0->dvb.frontend = dvb_attach(zl10353_attach,
1061 &cx88_geniatech_x8000_mt,
1063 if (attach_xc3028(0x61, dev) < 0)
1064 goto frontend_detach;
1066 case CX88_BOARD_KWORLD_ATSC_120:
1067 fe0->dvb.frontend = dvb_attach(s5h1409_attach,
1068 &kworld_atsc_120_config,
1070 if (attach_xc3028(0x61, dev) < 0)
1071 goto frontend_detach;
1073 case CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD:
1074 fe0->dvb.frontend = dvb_attach(s5h1411_attach,
1075 &dvico_fusionhdtv7_config,
1077 if (fe0->dvb.frontend != NULL) {
1078 if (!dvb_attach(xc5000_attach, fe0->dvb.frontend,
1080 &dvico_fusionhdtv7_tuner_config))
1081 goto frontend_detach;
1084 case CX88_BOARD_HAUPPAUGE_HVR4000:
1085 /* MFE frontend 1 */
1087 dev->frontends.gate = 2;
1089 fe0->dvb.frontend = dvb_attach(cx24116_attach,
1090 &hauppauge_hvr4000_config,
1091 &dev->core->i2c_adap);
1092 if (fe0->dvb.frontend) {
1093 if (!dvb_attach(isl6421_attach,
1095 &dev->core->i2c_adap,
1096 0x08, ISL6421_DCL, 0x00))
1097 goto frontend_detach;
1099 /* MFE frontend 2 */
1100 fe1 = videobuf_dvb_get_frontend(&dev->frontends, 2);
1102 goto frontend_detach;
1104 fe1->dvb.frontend = dvb_attach(cx22702_attach,
1105 &hauppauge_hvr_config,
1106 &dev->core->i2c_adap);
1107 if (fe1->dvb.frontend) {
1108 fe1->dvb.frontend->id = 1;
1109 if (!dvb_attach(simple_tuner_attach,
1111 &dev->core->i2c_adap,
1112 0x61, TUNER_PHILIPS_FMD1216ME_MK3))
1113 goto frontend_detach;
1116 case CX88_BOARD_HAUPPAUGE_HVR4000LITE:
1117 fe0->dvb.frontend = dvb_attach(cx24116_attach,
1118 &hauppauge_hvr4000_config,
1119 &dev->core->i2c_adap);
1120 if (fe0->dvb.frontend) {
1121 if (!dvb_attach(isl6421_attach,
1123 &dev->core->i2c_adap,
1124 0x08, ISL6421_DCL, 0x00))
1125 goto frontend_detach;
1128 case CX88_BOARD_PROF_6200:
1129 case CX88_BOARD_TBS_8910:
1130 case CX88_BOARD_TEVII_S420:
1131 fe0->dvb.frontend = dvb_attach(stv0299_attach,
1132 &tevii_tuner_sharp_config,
1134 if (fe0->dvb.frontend != NULL) {
1135 if (!dvb_attach(dvb_pll_attach, fe0->dvb.frontend, 0x60,
1136 &core->i2c_adap, DVB_PLL_OPERA1))
1137 goto frontend_detach;
1138 core->prev_set_voltage = fe0->dvb.frontend->ops.set_voltage;
1139 fe0->dvb.frontend->ops.set_voltage = tevii_dvbs_set_voltage;
1142 fe0->dvb.frontend = dvb_attach(stv0288_attach,
1143 &tevii_tuner_earda_config,
1145 if (fe0->dvb.frontend != NULL) {
1146 if (!dvb_attach(stb6000_attach, fe0->dvb.frontend, 0x61,
1148 goto frontend_detach;
1149 core->prev_set_voltage = fe0->dvb.frontend->ops.set_voltage;
1150 fe0->dvb.frontend->ops.set_voltage = tevii_dvbs_set_voltage;
1154 case CX88_BOARD_TEVII_S460:
1155 fe0->dvb.frontend = dvb_attach(cx24116_attach,
1158 if (fe0->dvb.frontend != NULL)
1159 fe0->dvb.frontend->ops.set_voltage = tevii_dvbs_set_voltage;
1161 case CX88_BOARD_OMICOM_SS4_PCI:
1162 case CX88_BOARD_TBS_8920:
1163 case CX88_BOARD_PROF_7300:
1164 case CX88_BOARD_SATTRADE_ST4200:
1165 fe0->dvb.frontend = dvb_attach(cx24116_attach,
1166 &hauppauge_hvr4000_config,
1168 if (fe0->dvb.frontend != NULL)
1169 fe0->dvb.frontend->ops.set_voltage = tevii_dvbs_set_voltage;
1171 case CX88_BOARD_TERRATEC_CINERGY_HT_PCI_MKII:
1172 fe0->dvb.frontend = dvb_attach(zl10353_attach,
1173 &cx88_terratec_cinergy_ht_pci_mkii_config,
1175 if (fe0->dvb.frontend) {
1176 fe0->dvb.frontend->ops.i2c_gate_ctrl = NULL;
1177 if (attach_xc3028(0x61, dev) < 0)
1178 goto frontend_detach;
1181 case CX88_BOARD_PROF_7301:{
1182 struct dvb_tuner_ops *tuner_ops = NULL;
1184 fe0->dvb.frontend = dvb_attach(stv0900_attach,
1185 &prof_7301_stv0900_config,
1186 &core->i2c_adap, 0);
1187 if (fe0->dvb.frontend != NULL) {
1188 if (!dvb_attach(stb6100_attach, fe0->dvb.frontend,
1189 &prof_7301_stb6100_config,
1191 goto frontend_detach;
1193 tuner_ops = &fe0->dvb.frontend->ops.tuner_ops;
1194 tuner_ops->set_frequency = stb6100_set_freq;
1195 tuner_ops->get_frequency = stb6100_get_freq;
1196 tuner_ops->set_bandwidth = stb6100_set_bandw;
1197 tuner_ops->get_bandwidth = stb6100_get_bandw;
1199 core->prev_set_voltage =
1200 fe0->dvb.frontend->ops.set_voltage;
1201 fe0->dvb.frontend->ops.set_voltage =
1202 tevii_dvbs_set_voltage;
1207 printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card isn't supported yet\n",
1212 if ( (NULL == fe0->dvb.frontend) || (fe1 && NULL == fe1->dvb.frontend) ) {
1214 "%s/2: frontend initialization failed\n",
1216 goto frontend_detach;
1218 /* define general-purpose callback pointer */
1219 fe0->dvb.frontend->callback = cx88_tuner_callback;
1221 /* Ensure all frontends negotiate bus access */
1222 fe0->dvb.frontend->ops.ts_bus_ctrl = cx88_dvb_bus_ctrl;
1224 fe1->dvb.frontend->ops.ts_bus_ctrl = cx88_dvb_bus_ctrl;
1226 /* Put the analog decoder in standby to keep it quiet */
1227 call_all(core, core, s_power, 0);
1229 /* register everything */
1230 return videobuf_dvb_register_bus(&dev->frontends, THIS_MODULE, dev,
1231 &dev->pci->dev, adapter_nr, mfe_shared, NULL);
1234 core->gate_ctrl = NULL;
1235 videobuf_dvb_dealloc_frontends(&dev->frontends);
1239 /* ----------------------------------------------------------- */
1241 /* CX8802 MPEG -> mini driver - We have been given the hardware */
1242 static int cx8802_dvb_advise_acquire(struct cx8802_driver *drv)
1244 struct cx88_core *core = drv->core;
1246 dprintk( 1, "%s\n", __func__);
1248 switch (core->boardnr) {
1249 case CX88_BOARD_HAUPPAUGE_HVR1300:
1250 /* We arrive here with either the cx23416 or the cx22702
1251 * on the bus. Take the bus from the cx23416 and enable the
1254 /* Toggle reset on cx22702 leaving i2c active */
1255 cx_set(MO_GP0_IO, 0x00000080);
1257 cx_clear(MO_GP0_IO, 0x00000080);
1259 cx_set(MO_GP0_IO, 0x00000080);
1261 /* enable the cx22702 pins */
1262 cx_clear(MO_GP0_IO, 0x00000004);
1266 case CX88_BOARD_HAUPPAUGE_HVR3000:
1267 case CX88_BOARD_HAUPPAUGE_HVR4000:
1268 /* Toggle reset on cx22702 leaving i2c active */
1269 cx_set(MO_GP0_IO, 0x00000080);
1271 cx_clear(MO_GP0_IO, 0x00000080);
1273 cx_set(MO_GP0_IO, 0x00000080);
1275 switch (core->dvbdev->frontends.active_fe_id) {
1276 case 1: /* DVB-S/S2 Enabled */
1277 /* tri-state the cx22702 pins */
1278 cx_set(MO_GP0_IO, 0x00000004);
1279 /* Take the cx24116/cx24123 out of reset */
1280 cx_write(MO_SRST_IO, 1);
1281 core->dvbdev->ts_gen_cntrl = 0x02; /* Parallel IO */
1283 case 2: /* DVB-T Enabled */
1284 /* Put the cx24116/cx24123 into reset */
1285 cx_write(MO_SRST_IO, 0);
1286 /* enable the cx22702 pins */
1287 cx_clear(MO_GP0_IO, 0x00000004);
1288 core->dvbdev->ts_gen_cntrl = 0x0c; /* Serial IO */
1300 /* CX8802 MPEG -> mini driver - We no longer have the hardware */
1301 static int cx8802_dvb_advise_release(struct cx8802_driver *drv)
1303 struct cx88_core *core = drv->core;
1305 dprintk( 1, "%s\n", __func__);
1307 switch (core->boardnr) {
1308 case CX88_BOARD_HAUPPAUGE_HVR1300:
1309 /* Do Nothing, leave the cx22702 on the bus. */
1311 case CX88_BOARD_HAUPPAUGE_HVR3000:
1312 case CX88_BOARD_HAUPPAUGE_HVR4000:
1320 static int cx8802_dvb_probe(struct cx8802_driver *drv)
1322 struct cx88_core *core = drv->core;
1323 struct cx8802_dev *dev = drv->core->dvbdev;
1325 struct videobuf_dvb_frontend *fe;
1328 dprintk( 1, "%s\n", __func__);
1329 dprintk( 1, " ->being probed by Card=%d Name=%s, PCI %02x:%02x\n",
1336 if (!(core->board.mpeg & CX88_MPEG_DVB))
1339 /* If vp3054 isn't enabled, a stub will just return 0 */
1340 err = vp3054_i2c_probe(dev);
1345 printk(KERN_INFO "%s/2: cx2388x based DVB/ATSC card\n", core->name);
1346 dev->ts_gen_cntrl = 0x0c;
1348 err = cx8802_alloc_frontends(dev);
1353 for (i = 1; i <= core->board.num_frontends; i++) {
1354 fe = videobuf_dvb_get_frontend(&core->dvbdev->frontends, i);
1356 printk(KERN_ERR "%s() failed to get frontend(%d)\n",
1360 videobuf_queue_sg_init(&fe->dvb.dvbq, &dvb_qops,
1361 &dev->pci->dev, &dev->slock,
1362 V4L2_BUF_TYPE_VIDEO_CAPTURE,
1364 sizeof(struct cx88_buffer),
1366 /* init struct videobuf_dvb */
1367 fe->dvb.name = dev->core->name;
1370 err = dvb_register(dev);
1372 /* frontends/adapter de-allocated in dvb_register */
1373 printk(KERN_ERR "%s/2: dvb_register failed (err = %d)\n",
1377 videobuf_dvb_dealloc_frontends(&core->dvbdev->frontends);
1382 static int cx8802_dvb_remove(struct cx8802_driver *drv)
1384 struct cx88_core *core = drv->core;
1385 struct cx8802_dev *dev = drv->core->dvbdev;
1387 dprintk( 1, "%s\n", __func__);
1389 videobuf_dvb_unregister_bus(&dev->frontends);
1391 vp3054_i2c_remove(dev);
1393 core->gate_ctrl = NULL;
1398 static struct cx8802_driver cx8802_dvb_driver = {
1399 .type_id = CX88_MPEG_DVB,
1400 .hw_access = CX8802_DRVCTL_SHARED,
1401 .probe = cx8802_dvb_probe,
1402 .remove = cx8802_dvb_remove,
1403 .advise_acquire = cx8802_dvb_advise_acquire,
1404 .advise_release = cx8802_dvb_advise_release,
1407 static int __init dvb_init(void)
1409 printk(KERN_INFO "cx88/2: cx2388x dvb driver version %d.%d.%d loaded\n",
1410 (CX88_VERSION_CODE >> 16) & 0xff,
1411 (CX88_VERSION_CODE >> 8) & 0xff,
1412 CX88_VERSION_CODE & 0xff);
1414 printk(KERN_INFO "cx2388x: snapshot date %04d-%02d-%02d\n",
1415 SNAPSHOT/10000, (SNAPSHOT/100)%100, SNAPSHOT%100);
1417 return cx8802_register_driver(&cx8802_dvb_driver);
1420 static void __exit dvb_fini(void)
1422 cx8802_unregister_driver(&cx8802_dvb_driver);
1425 module_init(dvb_init);
1426 module_exit(dvb_fini);
1431 * compile-command: "make DVB=1"