if ((timeout >= MAX_TIMEOUT) || (~temp & NVIDIA_SMB_STS_DONE) || (temp & NVIDIA_SMB_STS_STATUS)) 
if ((~temp & NVIDIA_SMB_STS_DONE) || (temp & NVIDIA_SMB_STS_STATUS)) { dev_dbg(&adap->dev, "SMBus Timeout! (0x%02x)\n", temp); 
static s32 nforce2_access(struct i2c_adapter * adap, u16 addr,		unsigned short flags, char read_write,		u8 command, int size, union i2c_smbus_data * data){	struct nforce2_smbus *smbus = adap->algo_data;	unsigned char protocol, pec, temp;	unsigned char len = 0; /* to keep the compiler quiet */	int timeout = 0;	int i;	protocol = (read_write == I2C_SMBUS_READ) ? NVIDIA_SMB_PRTCL_READ :		NVIDIA_SMB_PRTCL_WRITE;	pec = (flags & I2C_CLIENT_PEC) ? NVIDIA_SMB_PRTCL_PEC : 0;	switch (size) {		case I2C_SMBUS_QUICK:			protocol |= NVIDIA_SMB_PRTCL_QUICK;			read_write = I2C_SMBUS_WRITE;			break;		case I2C_SMBUS_BYTE:			if (read_write == I2C_SMBUS_WRITE)				outb_p(command, NVIDIA_SMB_CMD);			protocol |= NVIDIA_SMB_PRTCL_BYTE;			break;		case I2C_SMBUS_BYTE_DATA:			outb_p(command, NVIDIA_SMB_CMD);			if (read_write == I2C_SMBUS_WRITE)				outb_p(data->byte, NVIDIA_SMB_DATA);			protocol |= NVIDIA_SMB_PRTCL_BYTE_DATA;			break;		case I2C_SMBUS_WORD_DATA:			outb_p(command, NVIDIA_SMB_CMD);			if (read_write == I2C_SMBUS_WRITE) {				 outb_p(data->word, NVIDIA_SMB_DATA);				 outb_p(data->word >> 8, NVIDIA_SMB_DATA+1);			}			protocol |= NVIDIA_SMB_PRTCL_WORD_DATA | pec;			break;		case I2C_SMBUS_BLOCK_DATA:			outb_p(command, NVIDIA_SMB_CMD);			if (read_write == I2C_SMBUS_WRITE) {				len = min_t(u8, data->block[0], 32);				outb_p(len, NVIDIA_SMB_BCNT);				for (i = 0; i < len; i++)					outb_p(data->block[i + 1], NVIDIA_SMB_DATA+i);			}			protocol |= NVIDIA_SMB_PRTCL_BLOCK_DATA | pec;			break;		case I2C_SMBUS_I2C_BLOCK_DATA:			len = min_t(u8, data->block[0], 32);			outb_p(command, NVIDIA_SMB_CMD);			outb_p(len, NVIDIA_SMB_BCNT);			if (read_write == I2C_SMBUS_WRITE)				for (i = 0; i < len; i++)					outb_p(data->block[i + 1], NVIDIA_SMB_DATA+i);			protocol |= NVIDIA_SMB_PRTCL_I2C_BLOCK_DATA;			break;		case I2C_SMBUS_PROC_CALL:			dev_err(&adap->dev, "I2C_SMBUS_PROC_CALL not supported!\n");			return -1;			/*			outb_p(command, NVIDIA_SMB_CMD);			outb_p(data->word, NVIDIA_SMB_DATA);			outb_p(data->word >> 8, NVIDIA_SMB_DATA + 1);			protocol = NVIDIA_SMB_PRTCL_PROC_CALL | pec;			read_write = I2C_SMBUS_READ;			break;			 */		case I2C_SMBUS_BLOCK_PROC_CALL:			dev_err(&adap->dev, "I2C_SMBUS_BLOCK_PROC_CALL not supported!\n");			return -1;			/*			protocol |= pec;			len = min_t(u8, data->block[0], 31);			outb_p(command, NVIDIA_SMB_CMD);			outb_p(len, NVIDIA_SMB_BCNT);			for (i = 0; i < len; i++)				outb_p(data->block[i + 1], NVIDIA_SMB_DATA + i);			protocol = NVIDIA_SMB_PRTCL_BLOCK_PROC_CALL | pec;			read_write = I2C_SMBUS_READ;			break;			*/		case I2C_SMBUS_WORD_DATA_PEC:		case I2C_SMBUS_BLOCK_DATA_PEC:		case I2C_SMBUS_PROC_CALL_PEC:		case I2C_SMBUS_BLOCK_PROC_CALL_PEC:			dev_err(&adap->dev, "Unexpected software PEC transaction %d\n.", size);			return -1;		default:			dev_err(&adap->dev, "Unsupported transaction %d\n", size);			return -1;	}	outb_p((addr & 0x7f) << 1, NVIDIA_SMB_ADDR);	outb_p(protocol, NVIDIA_SMB_PRTCL);	temp = inb_p(NVIDIA_SMB_STS);#if 0	do {		i2c_do_pause(1);		temp = inb_p(NVIDIA_SMB_STS);	} while (((temp & NVIDIA_SMB_STS_DONE) == 0) && (timeout++ < MAX_TIMEOUT));#endif	if (~temp & NVIDIA_SMB_STS_DONE) {		udelay(500);		temp = inb_p(NVIDIA_SMB_STS);	}	if (~temp & NVIDIA_SMB_STS_DONE) {		msleep(10);		temp = inb_p(NVIDIA_SMB_STS);	}	if ((timeout >= MAX_TIMEOUT) || (~temp & NVIDIA_SMB_STS_DONE)		|| (temp & NVIDIA_SMB_STS_STATUS))		return -1;	if (read_write == I2C_SMBUS_WRITE)		return 0;	switch (size) {		case I2C_SMBUS_BYTE:		case I2C_SMBUS_BYTE_DATA:			data->byte = inb_p(NVIDIA_SMB_DATA);			break;		case I2C_SMBUS_WORD_DATA:		/* case I2C_SMBUS_PROC_CALL: not supported */			data->word = inb_p(NVIDIA_SMB_DATA) | (inb_p(NVIDIA_SMB_DATA+1) << 8);			break;		case I2C_SMBUS_BLOCK_DATA:		/* case I2C_SMBUS_BLOCK_PROC_CALL: not supported */			len = inb_p(NVIDIA_SMB_BCNT);			len = min_t(u8, len, 32);		case I2C_SMBUS_I2C_BLOCK_DATA:			for (i = 0; i < len; i++)				data->block[i+1] = inb_p(NVIDIA_SMB_DATA + i);			data->block[0] = len;			break;	}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/5033017c2678df9dc75be0139f19701ff224a498/i2c-nforce2.c/clean/drivers/i2c/busses/i2c-nforce2.c