예제 #1
0
static struct dvb_frontend * frontend_init(struct core_config *cfg, int i)
{
	struct tuner_devctl *ctl = NULL;
	struct dvb_frontend *frontend = NULL;

	printk (KERN_INFO "%s >\n", __FUNCTION__);
	
#if defined(UFS912) || defined(HS7810A) || defined(HS7110) || defined(WHITEBOX) || defined(SPARK)
		frontend = stv090x_attach(&tt1600_stv090x_config, cfg->i2c_adap, STV090x_DEMODULATOR_0, STV090x_TUNER1);
#else
	if (i== 0)
		frontend = stv090x_attach(&tt1600_stv090x_config, cfg->i2c_adap, STV090x_DEMODULATOR_0, STV090x_TUNER1);
	else
/* Dagobert commented: is this correct? second tuner uses demod0 ??? */
		frontend = stv090x_attach(&tt1600_stv090x_config, cfg->i2c_adap, STV090x_DEMODULATOR_0, STV090x_TUNER2);
#endif	
	if (frontend) {
		printk("%s: attached\n", __FUNCTION__);
		
		switch (tunerType) {
#if !defined(FORTIS_HDBOX)
		case SHARP7306:
			ctl = dvb_attach(ix7306_attach, frontend, &bs2s7hz7306a_config, cfg->i2c_adap);
			break;
#endif
		case STV6110X:
		default:
			ctl = dvb_attach(stv6110x_attach, frontend, &stv6110x_config, cfg->i2c_adap);
		}

		if(ctl)	{
			printk("%s: %s attached\n", __FUNCTION__, tuner);
			tt1600_stv090x_config.tuner_init	  	  = ctl->tuner_init;
			tt1600_stv090x_config.tuner_set_mode	  = ctl->tuner_set_mode;
			tt1600_stv090x_config.tuner_set_frequency = ctl->tuner_set_frequency;
			tt1600_stv090x_config.tuner_get_frequency = ctl->tuner_get_frequency;
			tt1600_stv090x_config.tuner_set_bandwidth = ctl->tuner_set_bandwidth;
			tt1600_stv090x_config.tuner_get_bandwidth = ctl->tuner_get_bandwidth;
			tt1600_stv090x_config.tuner_set_bbgain	  = ctl->tuner_set_bbgain;
			tt1600_stv090x_config.tuner_get_bbgain	  = ctl->tuner_get_bbgain;
			tt1600_stv090x_config.tuner_set_refclk	  = ctl->tuner_set_refclk;
			tt1600_stv090x_config.tuner_get_status	  = ctl->tuner_get_status;
		} else {
			printk (KERN_INFO "%s: error attaching %s\n", __FUNCTION__, tuner);
			goto error_out;
		}
	} else {
		printk (KERN_INFO "%s: error attaching\n", __FUNCTION__);
		goto error_out;
	}

	return frontend;

error_out:
	printk("core: Frontend registration failed!\n");
	if (frontend) 
		dvb_frontend_detach(frontend);
	return NULL;
}
예제 #2
0
static struct dvb_frontend * frontend_init(struct core_config *cfg, int i)
{
	
	struct dvb_frontend *frontend = NULL;

	printk (KERN_INFO "%s >\n", __FUNCTION__);


	if (i== 0)
		frontend = stv090x_attach(&tt1600_stv090x_config, cfg->i2c_adap, STV090x_DEMODULATOR_0, STV090x_TUNER1);
	else

		frontend = stv090x_attach(&tt1600_stv090x_config, cfg->i2c_adap, STV090x_DEMODULATOR_1, STV090x_TUNER2);
	
	if (frontend) {
		printk("%s: stv0900 attached\n", __FUNCTION__);
	if (i == 0){
				if (dvb_attach(stb6100_attach, frontend, &stb6100_config, cfg->i2c_adap,STB1) == 0) {
					printk (KERN_INFO "error attaching stb6100\n");
					goto error_out;
					}
				}else{
			
				if (dvb_attach(stb6100_attach,frontend, &stb6100_config_1, cfg->i2c_adap,STB2) == 0) {
					printk(KERN_INFO " error attaching stb6100\n");
					goto error_out;
				}
				 }
				
				
					printk("fe_core : stb6100 attached OK \n");
			} else {
				printk (KERN_INFO "%s: error attaching stv0900\n", __FUNCTION__);
				goto error_out;
			}

	return frontend;
error_out:
	printk("core: Frontend registration failed!\n");
	if (frontend) 
		dvb_frontend_detach(frontend);
	return NULL;
}
예제 #3
0
파일: core.c 프로젝트: Audioniek/driver
static struct dvb_frontend *frontend_init(struct core_config *cfg, int i)
{
	struct tuner_devctl *ctl = NULL;
	struct dvb_frontend *frontend = NULL;

	printk(KERN_INFO "%s >\n", __FUNCTION__);

	frontend = stv090x_attach(&vitamin_hd5000_stv090x_config, cfg->i2c_adap, STV090x_DEMODULATOR_0, STV090x_TUNER1);
	if (frontend)
	{
		printk("%s: DEMOD attached\n", __FUNCTION__);

		ctl = dvb_attach(stv6110x_attach, frontend, &stv6110x_config, cfg->i2c_adap);
		if (ctl)
		{
			printk("%s: TUNER attached\n", __FUNCTION__);
			vitamin_hd5000_stv090x_config.tuner_init	  	  = ctl->tuner_init;
			vitamin_hd5000_stv090x_config.tuner_set_mode	  = ctl->tuner_set_mode;
			vitamin_hd5000_stv090x_config.tuner_set_frequency = ctl->tuner_set_frequency;
			vitamin_hd5000_stv090x_config.tuner_get_frequency = ctl->tuner_get_frequency;
			vitamin_hd5000_stv090x_config.tuner_set_bandwidth = ctl->tuner_set_bandwidth;
			vitamin_hd5000_stv090x_config.tuner_get_bandwidth = ctl->tuner_get_bandwidth;
			vitamin_hd5000_stv090x_config.tuner_set_bbgain	  = ctl->tuner_set_bbgain;
			vitamin_hd5000_stv090x_config.tuner_get_bbgain	  = ctl->tuner_get_bbgain;
			vitamin_hd5000_stv090x_config.tuner_set_refclk	  = ctl->tuner_set_refclk;
			vitamin_hd5000_stv090x_config.tuner_get_status	  = ctl->tuner_get_status;
		}
		else
		{
			printk(KERN_INFO "%s: error attaching TUNER\n", __FUNCTION__);
			goto error_out;
		}
	}
	else
	{
		printk(KERN_INFO "%s: error attaching\n", __FUNCTION__);
		goto error_out;
	}

	return frontend;

error_out:
	printk("core: Frontend registration failed!\n");
	if (frontend)
		dvb_frontend_detach(frontend);
	return NULL;
}