struct sp887x_state* state = (struct sp887x_state*) fe->demodulator_priv; 
struct sp887x_state* state = fe->demodulator_priv; 
static int sp887x_setup_frontend_parameters (struct dvb_frontend* fe,					     struct dvb_frontend_parameters *p){	struct sp887x_state* state = (struct sp887x_state*) fe->demodulator_priv;	int actual_freq, err;	u16 val, reg0xc05;	if (p->u.ofdm.bandwidth != BANDWIDTH_8_MHZ &&	    p->u.ofdm.bandwidth != BANDWIDTH_7_MHZ &&	    p->u.ofdm.bandwidth != BANDWIDTH_6_MHZ)		return -EINVAL;	if ((err = configure_reg0xc05(p, &reg0xc05)))		return err;	sp887x_microcontroller_stop(state);	/* setup the PLL */	sp887x_writereg(state, 0x206, 0x001);	actual_freq = state->config->pll_set(fe, p);	sp887x_writereg(state, 0x206, 0x000);	/* read status reg in order to clear <pending irqs */	sp887x_readreg(state, 0x200);	sp887x_correct_offsets(state, p, actual_freq);	/* filter for 6/7/8 Mhz channel */	if (p->u.ofdm.bandwidth == BANDWIDTH_6_MHZ)		val = 2;	else if (p->u.ofdm.bandwidth == BANDWIDTH_7_MHZ)		val = 1;	else		val = 0;	sp887x_writereg(state, 0x311, val);	/* scan order: 2k first = 0, 8k first = 1 */	if (p->u.ofdm.transmission_mode == TRANSMISSION_MODE_2K)		sp887x_writereg(state, 0x338, 0x000);	else		sp887x_writereg(state, 0x338, 0x001);	sp887x_writereg(state, 0xc05, reg0xc05);	if (p->u.ofdm.bandwidth == BANDWIDTH_6_MHZ)		val = 2 << 3;	else if (p->u.ofdm.bandwidth == BANDWIDTH_7_MHZ)		val = 3 << 3;	else		val = 0 << 3;	/* enable OFDM and SAW bits as lock indicators in sync register 0xf17,	 * optimize algorithm for given bandwidth...	 */	sp887x_writereg(state, 0xf14, 0x160 | val);	sp887x_writereg(state, 0xf15, 0x000);	sp887x_microcontroller_start(state);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/b8742700f13163ffa00cddce2a3c940b9ab2ab5a/sp887x.c/clean/drivers/media/dvb/frontends/sp887x.c