if (tuner && state->config.pll_addr && state->config.pll_set) { /* initial call from dvb */ dib3000mc_tuner_pass_ctrl(fe,1,state->config.pll_addr(fe)); state->config.pll_set(fe,fep,NULL); dib3000mc_tuner_pass_ctrl(fe,0,state->config.pll_addr(fe)); 
if (tuner && state->config.pll_set) { /* initial call from dvb */ state->config.pll_set(fe,fep); 
static int dib3000mc_set_frontend(struct dvb_frontend* fe,				  struct dvb_frontend_parameters *fep, int tuner){	struct dib3000_state* state = fe->demodulator_priv;	struct dvb_ofdm_parameters *ofdm = &fep->u.ofdm;	int search_state,auto_val;	u16 val;	if (tuner && state->config.pll_addr && state->config.pll_set) { /* initial call from dvb */		dib3000mc_tuner_pass_ctrl(fe,1,state->config.pll_addr(fe));		state->config.pll_set(fe,fep,NULL);		dib3000mc_tuner_pass_ctrl(fe,0,state->config.pll_addr(fe));		state->last_tuned_freq = fep->frequency;	//	if (!scanboost) {			dib3000mc_set_timing(state,0,ofdm->transmission_mode,ofdm->bandwidth);			dib3000mc_init_auto_scan(state, ofdm->bandwidth, 0);			state->last_tuned_bw = ofdm->bandwidth;			wr_foreach(dib3000mc_reg_agc_bandwidth,dib3000mc_agc_bandwidth);			wr(DIB3000MC_REG_RESTART,DIB3000MC_RESTART_AGC);			wr(DIB3000MC_REG_RESTART,DIB3000MC_RESTART_OFF);			/* Default cfg isi offset adp */			wr_foreach(dib3000mc_reg_offset,dib3000mc_offset[0]);			wr(DIB3000MC_REG_ISI,DIB3000MC_ISI_DEFAULT | DIB3000MC_ISI_INHIBIT);			dib3000mc_set_adp_cfg(state,ofdm->constellation);			wr(DIB3000MC_REG_UNK_133,DIB3000MC_UNK_133);			wr_foreach(dib3000mc_reg_bandwidth_general,dib3000mc_bandwidth_general);			/* power smoothing */			if (ofdm->bandwidth != BANDWIDTH_8_MHZ) {				wr_foreach(dib3000mc_reg_bw,dib3000mc_bw[0]);			} else {				wr_foreach(dib3000mc_reg_bw,dib3000mc_bw[3]);			}			auto_val = 0;			dib3000mc_set_general_cfg(state,fep,&auto_val);			dib3000mc_set_impulse_noise(state,0,ofdm->constellation,ofdm->bandwidth);			val = rd(DIB3000MC_REG_DEMOD_PARM);			wr(DIB3000MC_REG_DEMOD_PARM,val|DIB3000MC_DEMOD_RST_DEMOD_ON);			wr(DIB3000MC_REG_DEMOD_PARM,val);	//	}		msleep(70);		/* something has to be auto searched */		if (auto_val) {			int as_count=0;			deb_setf("autosearch enabled.\n");			val = rd(DIB3000MC_REG_DEMOD_PARM);			wr(DIB3000MC_REG_DEMOD_PARM,val | DIB3000MC_DEMOD_RST_AUTO_SRCH_ON);			wr(DIB3000MC_REG_DEMOD_PARM,val);			while ((search_state = dib3000_search_status(						rd(DIB3000MC_REG_AS_IRQ),1)) < 0 && as_count++ < 100)				msleep(10);			deb_info("search_state after autosearch %d after %d checks\n",search_state,as_count);			if (search_state == 1) {				struct dvb_frontend_parameters feps;				if (dib3000mc_get_frontend(fe, &feps) == 0) {					deb_setf("reading tuning data from frontend succeeded.\n");					return dib3000mc_set_frontend(fe, &feps, 0);				}			}		} else {			dib3000mc_set_impulse_noise(state,0,ofdm->transmission_mode,ofdm->bandwidth);			wr(DIB3000MC_REG_ISI,DIB3000MC_ISI_DEFAULT|DIB3000MC_ISI_ACTIVATE);			dib3000mc_set_adp_cfg(state,ofdm->constellation);			/* set_offset_cfg */			wr_foreach(dib3000mc_reg_offset,					dib3000mc_offset[(ofdm->transmission_mode == TRANSMISSION_MODE_8K)+1]);		}	} else { /* second call, after autosearch (fka: set_WithKnownParams) *///		dib3000mc_set_timing(state,1,ofdm->transmission_mode,ofdm->bandwidth);		auto_val = 0;		dib3000mc_set_general_cfg(state,fep,&auto_val);		if (auto_val)			deb_info("auto_val is true, even though an auto search was already performed.\n");		dib3000mc_set_impulse_noise(state,0,ofdm->constellation,ofdm->bandwidth);		val = rd(DIB3000MC_REG_DEMOD_PARM);		wr(DIB3000MC_REG_DEMOD_PARM,val | DIB3000MC_DEMOD_RST_AUTO_SRCH_ON);		wr(DIB3000MC_REG_DEMOD_PARM,val);		msleep(30);		wr(DIB3000MC_REG_ISI,DIB3000MC_ISI_DEFAULT|DIB3000MC_ISI_ACTIVATE);			dib3000mc_set_adp_cfg(state,ofdm->constellation);		wr_foreach(dib3000mc_reg_offset,				dib3000mc_offset[(ofdm->transmission_mode == TRANSMISSION_MODE_8K)+1]);	}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/776338e121b9db3156bfb4e21622a0219bbab9d4/dib3000mc.c/clean/drivers/media/dvb/frontends/dib3000mc.c