⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cx88-dvb.c

📁 trident tm5600的linux驱动
💻 C
📖 第 1 页 / 共 3 页
字号:
	.output_mode   = S5H1409_PARALLEL_OUTPUT,	.gpio	       = S5H1409_GPIO_ON,	.qam_if	       = 44000,	.inversion     = S5H1409_INVERSION_OFF,	.status_mode   = S5H1409_DEMODLOCKING,	.mpeg_timing   = S5H1409_MPEGTIMING_NONCONTINOUS_NONINVERTING_CLOCK,};static struct s5h1409_config dvico_hdtv5_pci_nano_config = {	.demod_address = 0x32 >> 1,	.output_mode   = S5H1409_SERIAL_OUTPUT,	.gpio          = S5H1409_GPIO_OFF,	.inversion     = S5H1409_INVERSION_OFF,	.status_mode   = S5H1409_DEMODLOCKING,	.mpeg_timing   = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK,};static struct s5h1409_config kworld_atsc_120_config = {	.demod_address = 0x32 >> 1,	.output_mode   = S5H1409_SERIAL_OUTPUT,	.gpio	       = S5H1409_GPIO_OFF,	.inversion     = S5H1409_INVERSION_OFF,	.status_mode   = S5H1409_DEMODLOCKING,	.mpeg_timing   = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK,};static struct xc5000_config pinnacle_pctv_hd_800i_tuner_config = {	.i2c_address	= 0x64,	.if_khz		= 5380,};static struct zl10353_config cx88_pinnacle_hybrid_pctv = {	.demod_address = (0x1e >> 1),	.no_tuner      = 1,	.if2           = 45600,};static struct zl10353_config cx88_geniatech_x8000_mt = {       .demod_address = (0x1e >> 1),       .no_tuner = 1,#if 0       .input_frequency = 0xe609,       .parallel_ts = 1,       .r56_agc_targets =  0x2b,       .r5c_clk_mpegts_output = 0x75,#endif};static struct s5h1411_config dvico_fusionhdtv7_config = {	.output_mode   = S5H1411_SERIAL_OUTPUT,	.gpio          = S5H1411_GPIO_ON,	.mpeg_timing   = S5H1411_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK,	.qam_if        = S5H1411_IF_44000,	.vsb_if        = S5H1411_IF_44000,	.inversion     = S5H1411_INVERSION_OFF,	.status_mode   = S5H1411_DEMODLOCKING};static struct xc5000_config dvico_fusionhdtv7_tuner_config = {	.i2c_address    = 0xc2 >> 1,	.if_khz         = 5380,};static int attach_xc3028(u8 addr, struct cx8802_dev *dev){	struct dvb_frontend *fe;	struct videobuf_dvb_frontend *fe0 = NULL;	struct xc2028_ctrl ctl;	struct xc2028_config cfg = {		.i2c_adap  = &dev->core->i2c_adap,		.i2c_addr  = addr,		.ctrl      = &ctl,	};	/* Get the first frontend */	fe0 = videobuf_dvb_get_frontend(&dev->frontends, 1);	if (!fe0)		return -EINVAL;	if (!fe0->dvb.frontend) {		printk(KERN_ERR "%s/2: dvb frontend not attached. "				"Can't attach xc3028\n",		       dev->core->name);		return -EINVAL;	}	/*	 * Some xc3028 devices may be hidden by an I2C gate. This is known	 * to happen with some s5h1409-based devices.	 * Now that I2C gate is open, sets up xc3028 configuration	 */	cx88_setup_xc3028(dev->core, &ctl);	fe = dvb_attach(xc2028_attach, fe0->dvb.frontend, &cfg);	if (!fe) {		printk(KERN_ERR "%s/2: xc3028 attach failed\n",		       dev->core->name);		dvb_frontend_detach(fe0->dvb.frontend);		dvb_unregister_frontend(fe0->dvb.frontend);		fe0->dvb.frontend = NULL;		return -EINVAL;	}	printk(KERN_INFO "%s/2: xc3028 attached\n",	       dev->core->name);	return 0;}static int cx24116_set_ts_param(struct dvb_frontend *fe,	int is_punctured){	struct cx8802_dev *dev = fe->dvb->priv;	dev->ts_gen_cntrl = 0x2;	return 0;}static int cx24116_reset_device(struct dvb_frontend *fe){	struct cx8802_dev *dev = fe->dvb->priv;	struct cx88_core *core = dev->core;	/* Reset the part */	/* Put the cx24116 into reset */	cx_write(MO_SRST_IO, 0);	msleep(10);	/* Take the cx24116 out of reset */	cx_write(MO_SRST_IO, 1);	msleep(10);	return 0;}static struct cx24116_config hauppauge_hvr4000_config = {	.demod_address          = 0x05,	.set_ts_params          = cx24116_set_ts_param,	.reset_device           = cx24116_reset_device,};static struct cx24116_config tevii_s460_config = {	.demod_address = 0x55,	.set_ts_params = cx24116_set_ts_param,	.reset_device  = cx24116_reset_device,};static struct stv0299_config tevii_tuner_sharp_config = {	.demod_address = 0x68,	.inittab = sharp_z0194a_inittab,	.mclk = 88000000UL,	.invert = 1,	.skip_reinit = 0,	.lock_output = 1,	.volt13_op0_op1 = STV0299_VOLT13_OP1,	.min_delay_ms = 100,	.set_symbol_rate = sharp_z0194a_set_symbol_rate,	.set_ts_params = cx24116_set_ts_param,};static struct stv0288_config tevii_tuner_earda_config = {	.demod_address = 0x68,	.min_delay_ms = 100,	.set_ts_params = cx24116_set_ts_param,};static int dvb_register(struct cx8802_dev *dev){	struct cx88_core *core = dev->core;	struct videobuf_dvb_frontend *fe0, *fe1 = NULL;	int mfe_shared = 0; /* bus not shared by default */	if (0 != core->i2c_rc) {		printk(KERN_ERR "%s/2: no i2c-bus available, cannot attach dvb drivers\n", core->name);		goto frontend_detach;	}	/* Get the first frontend */	fe0 = videobuf_dvb_get_frontend(&dev->frontends, 1);	if (!fe0)		return -EINVAL;	/* multi-frontend gate control is undefined or defaults to fe0 */	dev->frontends.gate = 0;	/* init frontend(s) */	switch (core->boardnr) {	case CX88_BOARD_HAUPPAUGE_DVB_T1:		fe0->dvb.frontend = dvb_attach(cx22702_attach,					       &connexant_refboard_config,					       &core->i2c_adap);		if (fe0->dvb.frontend != NULL) {			if (!dvb_attach(dvb_pll_attach, fe0->dvb.frontend,					0x61, &core->i2c_adap,					DVB_PLL_THOMSON_DTT759X))				goto frontend_detach;		}		break;	case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1:	case CX88_BOARD_CONEXANT_DVB_T1:	case CX88_BOARD_KWORLD_DVB_T_CX22702:	case CX88_BOARD_WINFAST_DTV1000:		fe0->dvb.frontend = dvb_attach(cx22702_attach,					       &connexant_refboard_config,					       &core->i2c_adap);		if (fe0->dvb.frontend != NULL) {			if (!dvb_attach(dvb_pll_attach, fe0->dvb.frontend,					0x60, &core->i2c_adap,					DVB_PLL_THOMSON_DTT7579))				goto frontend_detach;		}		break;	case CX88_BOARD_WINFAST_DTV2000H:	case CX88_BOARD_HAUPPAUGE_HVR1100:	case CX88_BOARD_HAUPPAUGE_HVR1100LP:	case CX88_BOARD_HAUPPAUGE_HVR1300:		fe0->dvb.frontend = dvb_attach(cx22702_attach,					       &hauppauge_hvr_config,					       &core->i2c_adap);		if (fe0->dvb.frontend != NULL) {			if (!dvb_attach(simple_tuner_attach, fe0->dvb.frontend,				   &core->i2c_adap, 0x61,				   TUNER_PHILIPS_FMD1216ME_MK3))				goto frontend_detach;		}		break;	case CX88_BOARD_HAUPPAUGE_HVR3000:		/* DVB-S init */		fe0->dvb.frontend = dvb_attach(cx24123_attach,			       &hauppauge_novas_config,			       &dev->core->i2c_adap);		if (fe0->dvb.frontend) {			if (!dvb_attach(isl6421_attach, fe0->dvb.frontend,			&dev->core->i2c_adap, 0x08, ISL6421_DCL, 0x00)) {				dprintk( 1, "%s(): HVR3000 - DVB-S LNB Init: failed\n", __func__);			}		} else {			dprintk( 1, "%s(): HVR3000 - DVB-S Init: failed\n", __func__);		}		/* DVB-T init */		fe1 = videobuf_dvb_get_frontend(&dev->frontends, 2);		if (fe1) {			dev->frontends.gate = 2;			mfe_shared = 1;			fe1->dvb.frontend = dvb_attach(cx22702_attach,				&hauppauge_hvr_config,				&dev->core->i2c_adap);			if (fe1->dvb.frontend) {				fe1->dvb.frontend->id = 1;				if(!dvb_attach(simple_tuner_attach, fe1->dvb.frontend,						&dev->core->i2c_adap, 0x61,						TUNER_PHILIPS_FMD1216ME_MK3)) {					dprintk( 1, "%s(): HVR3000 - DVB-T misc Init: failed\n", __func__);				}			} else {				dprintk( 1, "%s(): HVR3000 - DVB-T Init: failed\n", __func__);			}		} else {			dprintk( 1, "%s(): HVR3000 - DVB-T Init: can't find frontend 2.\n", __func__);		}		break;	case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS:		fe0->dvb.frontend = dvb_attach(mt352_attach,					       &dvico_fusionhdtv,					       &core->i2c_adap);		if (fe0->dvb.frontend != NULL) {			if (!dvb_attach(dvb_pll_attach, fe0->dvb.frontend,					0x60, NULL, DVB_PLL_THOMSON_DTT7579))				goto frontend_detach;			break;		}		/* ZL10353 replaces MT352 on later cards */		fe0->dvb.frontend = dvb_attach(zl10353_attach,					       &dvico_fusionhdtv_plus_v1_1,					       &core->i2c_adap);		if (fe0->dvb.frontend != NULL) {			if (!dvb_attach(dvb_pll_attach, fe0->dvb.frontend,					0x60, NULL, DVB_PLL_THOMSON_DTT7579))				goto frontend_detach;		}		break;	case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL:		/* The tin box says DEE1601, but it seems to be DTT7579		 * compatible, with a slightly different MT352 AGC gain. */		fe0->dvb.frontend = dvb_attach(mt352_attach,					       &dvico_fusionhdtv_dual,					       &core->i2c_adap);		if (fe0->dvb.frontend != NULL) {			if (!dvb_attach(dvb_pll_attach, fe0->dvb.frontend,					0x61, NULL, DVB_PLL_THOMSON_DTT7579))				goto frontend_detach;			break;		}		/* ZL10353 replaces MT352 on later cards */		fe0->dvb.frontend = dvb_attach(zl10353_attach,					       &dvico_fusionhdtv_plus_v1_1,					       &core->i2c_adap);		if (fe0->dvb.frontend != NULL) {			if (!dvb_attach(dvb_pll_attach, fe0->dvb.frontend,					0x61, NULL, DVB_PLL_THOMSON_DTT7579))				goto frontend_detach;		}		break;	case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:		fe0->dvb.frontend = dvb_attach(mt352_attach,					       &dvico_fusionhdtv,					       &core->i2c_adap);		if (fe0->dvb.frontend != NULL) {			if (!dvb_attach(dvb_pll_attach, fe0->dvb.frontend,					0x61, NULL, DVB_PLL_LG_Z201))				goto frontend_detach;		}		break;	case CX88_BOARD_KWORLD_DVB_T:	case CX88_BOARD_DNTV_LIVE_DVB_T:	case CX88_BOARD_ADSTECH_DVB_T_PCI:		fe0->dvb.frontend = dvb_attach(mt352_attach,					       &dntv_live_dvbt_config,					       &core->i2c_adap);		if (fe0->dvb.frontend != NULL) {			if (!dvb_attach(dvb_pll_attach, fe0->dvb.frontend,					0x61, NULL, DVB_PLL_UNKNOWN_1))				goto frontend_detach;		}		break;	case CX88_BOARD_DNTV_LIVE_DVB_T_PRO:#if defined(CONFIG_VIDEO_CX88_VP3054) || (defined(CONFIG_VIDEO_CX88_VP3054_MODULE) && defined(MODULE))		/* MT352 is on a secondary I2C bus made from some GPIO lines */		fe0->dvb.frontend = dvb_attach(mt352_attach, &dntv_live_dvbt_pro_config,					       &dev->vp3054->adap);		if (fe0->dvb.frontend != NULL) {			if (!dvb_attach(simple_tuner_attach, fe0->dvb.frontend,					&core->i2c_adap, 0x61,					TUNER_PHILIPS_FMD1216ME_MK3))				goto frontend_detach;		}#else		printk(KERN_ERR "%s/2: built without vp3054 support\n",				core->name);#endif		break;	case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID:		fe0->dvb.frontend = dvb_attach(zl10353_attach,					       &dvico_fusionhdtv_hybrid,					       &core->i2c_adap);		if (fe0->dvb.frontend != NULL) {			if (!dvb_attach(simple_tuner_attach, fe0->dvb.frontend,				   &core->i2c_adap, 0x61,				   TUNER_THOMSON_FE6600))				goto frontend_detach;		}		break;	case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO:		fe0->dvb.frontend = dvb_attach(zl10353_attach,					       &dvico_fusionhdtv_xc3028,					       &core->i2c_adap);		if (fe0->dvb.frontend == NULL)			fe0->dvb.frontend = dvb_attach(mt352_attach,						&dvico_fusionhdtv_mt352_xc3028,						&core->i2c_adap);		/*		 * On this board, the demod provides the I2C bus pullup.		 * We must not permit gate_ctrl to be performed, or		 * the xc3028 cannot communicate on the bus.		 */		if (fe0->dvb.frontend)			fe0->dvb.frontend->ops.i2c_gate_ctrl = NULL;		if (attach_xc3028(0x61, dev) < 0)			goto frontend_detach;		break;	case CX88_BOARD_PCHDTV_HD3000:		fe0->dvb.frontend = dvb_attach(or51132_attach, &pchdtv_hd3000,					       &core->i2c_adap);		if (fe0->dvb.frontend != NULL) {			if (!dvb_attach(simple_tuner_attach, fe0->dvb.frontend,					&core->i2c_adap, 0x61,					TUNER_THOMSON_DTT761X))				goto frontend_detach;		}		break;	case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q:		dev->ts_gen_cntrl = 0x08;		/* Do a hardware reset of chip before using it. */		cx_clear(MO_GP0_IO, 1);		mdelay(100);		cx_set(MO_GP0_IO, 1);		mdelay(200);		/* Select RF connector callback */		fusionhdtv_3_gold.pll_rf_set = lgdt330x_pll_rf_set;		fe0->dvb.frontend = dvb_attach(lgdt330x_attach,					       &fusionhdtv_3_gold,					       &core->i2c_adap);		if (fe0->dvb.frontend != NULL) {			if (!dvb_attach(simple_tuner_attach, fe0->dvb.frontend,					&core->i2c_adap, 0x61,					TUNER_MICROTUNE_4042FI5))				goto frontend_detach;		}		break;	case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T:		dev->ts_gen_cntrl = 0x08;		/* Do a hardware reset of chip before using it. */		cx_clear(MO_GP0_IO, 1);		mdelay(100);		cx_set(MO_GP0_IO, 9);		mdelay(200);		fe0->dvb.frontend = dvb_attach(lgdt330x_attach,					       &fusionhdtv_3_gold,					       &core->i2c_adap);		if (fe0->dvb.frontend != NULL) {			if (!dvb_attach(simple_tuner_attach, fe0->dvb.frontend,					&core->i2c_adap, 0x61,					TUNER_THOMSON_DTT761X))				goto frontend_detach;		}		break;	case CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD:		dev->ts_gen_cntrl = 0x08;		/* Do a hardware reset of chip before using it. */		cx_clear(MO_GP0_IO, 1);		mdelay(100);		cx_set(MO_GP0_IO, 1);		mdelay(200);		fe0->dvb.frontend = dvb_attach(lgdt330x_attach,					       &fusionhdtv_5_gold,					       &core->i2c_adap);		if (fe0->dvb.frontend != NULL) {			if (!dvb_attach(simple_tuner_attach, fe0->dvb.frontend,					&core->i2c_adap, 0x61,					TUNER_LG_TDVS_H06XF))				goto frontend_detach;			if (!dvb_attach(tda9887_attach, fe0->dvb.frontend,				   &core->i2c_adap, 0x43))

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -