struct or51132_state* state = (struct or51132_state*) fe->demodulator_priv; 
struct or51132_state* state = fe->demodulator_priv; 
static int or51132_load_firmware (struct dvb_frontend* fe, const struct firmware *fw){	struct or51132_state* state = (struct or51132_state*) fe->demodulator_priv;	static u8 run_buf[] = {0x7F,0x01};	static u8 get_ver_buf[] = {0x04,0x00,0x30,0x00,0x00};	u8 rec_buf[14];	u8 cmd_buf[14];	u32 firmwareAsize, firmwareBsize;	int i,ret;	dprintk("Firmware is %Zd bytes\n",fw->size);	/* Get size of firmware A and B */	firmwareAsize = le32_to_cpu(*((u32*)fw->data));	dprintk("FirmwareA is %i bytes\n",firmwareAsize);	firmwareBsize = le32_to_cpu(*((u32*)(fw->data+4)));	dprintk("FirmwareB is %i bytes\n",firmwareBsize);	/* Upload firmware */	if ((ret = i2c_writebytes(state,state->config->demod_address,				 &fw->data[8],firmwareAsize))) {		printk(KERN_WARNING "or51132: load_firmware error 1\n");		return ret;	}	msleep(1); /* 1ms */	if ((ret = i2c_writebytes(state,state->config->demod_address,				 &fw->data[8+firmwareAsize],firmwareBsize))) {		printk(KERN_WARNING "or51132: load_firmware error 2\n");		return ret;	}	msleep(1); /* 1ms */	if ((ret = i2c_writebytes(state,state->config->demod_address,				 run_buf,2))) {		printk(KERN_WARNING "or51132: load_firmware error 3\n");		return ret;	}	/* Wait at least 5 msec */	msleep(20); /* 10ms */	if ((ret = i2c_writebytes(state,state->config->demod_address,				 run_buf,2))) {		printk(KERN_WARNING "or51132: load_firmware error 4\n");		return ret;	}	/* 50ms for operation to begin */	msleep(50);	/* Read back ucode version to besure we loaded correctly and are really up and running */	/* Get uCode version */	cmd_buf[0] = 0x10;	cmd_buf[1] = 0x10;	cmd_buf[2] = 0x00;	cmd_buf[3] = 0x00;	msleep(20); /* 20ms */	if ((ret = i2c_writebytes(state,state->config->demod_address,				 cmd_buf,3))) {		printk(KERN_WARNING "or51132: load_firmware error a\n");		return ret;	}	cmd_buf[0] = 0x04;	cmd_buf[1] = 0x17;	cmd_buf[2] = 0x00;	cmd_buf[3] = 0x00;	msleep(20); /* 20ms */	if ((ret = i2c_writebytes(state,state->config->demod_address,				 cmd_buf,2))) {		printk(KERN_WARNING "or51132: load_firmware error b\n");		return ret;	}	cmd_buf[0] = 0x00;	cmd_buf[1] = 0x00;	cmd_buf[2] = 0x00;	cmd_buf[3] = 0x00;	msleep(20); /* 20ms */	if ((ret = i2c_writebytes(state,state->config->demod_address,				 cmd_buf,2))) {		printk(KERN_WARNING "or51132: load_firmware error c\n");		return ret;	}	for(i=0;i<4;i++) {		msleep(20); /* 20ms */		get_ver_buf[4] = i+1;		if ((ret = i2c_readbytes(state,state->config->demod_address,					&rec_buf[i*2],2))) {			printk(KERN_WARNING			       "or51132: load_firmware error d - %d\n",i);			return ret;		}	}	printk(KERN_WARNING	       "or51132: Version: %02X%02X%02X%02X-%02X%02X%02X%02X (%02X%01X-%01X-%02X%01X-%01X)\n",	       rec_buf[1],rec_buf[0],rec_buf[3],rec_buf[2],	       rec_buf[5],rec_buf[4],rec_buf[7],rec_buf[6],	       rec_buf[3],rec_buf[2]>>4,rec_buf[2]&0x0f,	       rec_buf[5],rec_buf[4]>>4,rec_buf[4]&0x0f);	cmd_buf[0] = 0x10;	cmd_buf[1] = 0x00;	cmd_buf[2] = 0x00;	cmd_buf[3] = 0x00;	msleep(20); /* 20ms */	if ((ret = i2c_writebytes(state,state->config->demod_address,				 cmd_buf,3))) {		printk(KERN_WARNING "or51132: load_firmware error e\n");		return ret;	}	return 0;};
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/b8742700f13163ffa00cddce2a3c940b9ab2ab5a/or51132.c/clean/drivers/media/dvb/frontends/or51132.c