/* Change only if we are actually changing the channel */ if (state->current_frequency != param->frequency) { /* Tune to the new frequency */ 
/* Tune to the specified frequency */ if (state->config->pll_set) 
static int lgdt330x_set_parameters(struct dvb_frontend* fe,				   struct dvb_frontend_parameters *param){	/*	 * Array of byte pairs <address, value>	 * to initialize 8VSB for lgdt3303 chip 50 MHz IF	 */	static u8 lgdt3303_8vsb_44_data[] = {		0x04, 0x00,		0x0d, 0x40,        0x0e, 0x87,        0x0f, 0x8e,        0x10, 0x01,        0x47, 0x8b };	/*	 * Array of byte pairs <address, value>	 * to initialize QAM for lgdt3303 chip	 */	static u8 lgdt3303_qam_data[] = {		0x04, 0x00,		0x0d, 0x00,		0x0e, 0x00,		0x0f, 0x00,		0x10, 0x00,		0x51, 0x63,		0x47, 0x66,		0x48, 0x66,		0x4d, 0x1a,		0x49, 0x08,		0x4a, 0x9b };	struct lgdt330x_state* state = fe->demodulator_priv;	static u8 top_ctrl_cfg[]   = { TOP_CONTROL, 0x03 };	int err;	/* Change only if we are actually changing the modulation */	if (state->current_modulation != param->u.vsb.modulation) {		switch(param->u.vsb.modulation) {		case VSB_8:			dprintk("%s: VSB_8 MODE\n", __FUNCTION__);			/* Select VSB mode */			top_ctrl_cfg[1] = 0x03;			/* Select ANT connector if supported by card */			if (state->config->pll_rf_set)				state->config->pll_rf_set(fe, 1);			if (state->config->demod_chip == LGDT3303) {				err = i2c_write_demod_bytes(state, lgdt3303_8vsb_44_data,											sizeof(lgdt3303_8vsb_44_data));			}			break;		case QAM_64:			dprintk("%s: QAM_64 MODE\n", __FUNCTION__);			/* Select QAM_64 mode */			top_ctrl_cfg[1] = 0x00;			/* Select CABLE connector if supported by card */			if (state->config->pll_rf_set)				state->config->pll_rf_set(fe, 0);			if (state->config->demod_chip == LGDT3303) {				err = i2c_write_demod_bytes(state, lgdt3303_qam_data,											sizeof(lgdt3303_qam_data));			}			break;		case QAM_256:			dprintk("%s: QAM_256 MODE\n", __FUNCTION__);			/* Select QAM_256 mode */			top_ctrl_cfg[1] = 0x01;			/* Select CABLE connector if supported by card */			if (state->config->pll_rf_set)				state->config->pll_rf_set(fe, 0);			if (state->config->demod_chip == LGDT3303) {				err = i2c_write_demod_bytes(state, lgdt3303_qam_data,											sizeof(lgdt3303_qam_data));			}			break;		default:			printk(KERN_WARNING "lgdt330x: %s: Modulation type(%d) UNSUPPORTED\n", __FUNCTION__, param->u.vsb.modulation);			return -1;		}		/*		 * select serial or parallel MPEG harware interface		 * Serial:   0x04 for LGDT3302 or 0x40 for LGDT3303		 * Parallel: 0x00		 */		top_ctrl_cfg[1] |= state->config->serial_mpeg;		/* Select the requested mode */		i2c_write_demod_bytes(state, top_ctrl_cfg,							  sizeof(top_ctrl_cfg));		state->config->set_ts_params(fe, 0);		state->current_modulation = param->u.vsb.modulation;	}	/* Change only if we are actually changing the channel */	if (state->current_frequency != param->frequency) {		/* Tune to the new frequency */		state->config->pll_set(fe, param);		/* Keep track of the new frequency */		state->current_frequency = param->frequency;	}	lgdt330x_SwReset(state);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/dc9ca2af4917ce4e545fa3eb1d845c555128cabc/lgdt330x.c/buggy/drivers/media/dvb/frontends/lgdt330x.c