unsigned short flags,  char read_write, u8 command, int size,  union i2c_smbus_data *data) 
unsigned short flags, char read_write, u8 command, int size, union i2c_smbus_data *data) 
static s32 vt596_access(struct i2c_adapter *adap, u16 addr,		unsigned short flags,  char read_write, u8 command,		int size,  union i2c_smbus_data *data){	int i, len;	switch (size) {	case I2C_SMBUS_PROC_CALL:		dev_info(&vt596_adapter.dev,			 "I2C_SMBUS_PROC_CALL not supported!\n");		return -1;	case I2C_SMBUS_QUICK:		outb_p(((addr & 0x7f) << 1) | (read_write & 0x01),		       SMBHSTADD);		size = VT596_QUICK;		break;	case I2C_SMBUS_BYTE:		outb_p(((addr & 0x7f) << 1) | (read_write & 0x01),		       SMBHSTADD);		if (read_write == I2C_SMBUS_WRITE)			outb_p(command, SMBHSTCMD);		size = VT596_BYTE;		break;	case I2C_SMBUS_BYTE_DATA:		outb_p(((addr & 0x7f) << 1) | (read_write & 0x01),		       SMBHSTADD);		outb_p(command, SMBHSTCMD);		if (read_write == I2C_SMBUS_WRITE)			outb_p(data->byte, SMBHSTDAT0);		size = VT596_BYTE_DATA;		break;	case I2C_SMBUS_WORD_DATA:		outb_p(((addr & 0x7f) << 1) | (read_write & 0x01),		       SMBHSTADD);		outb_p(command, SMBHSTCMD);		if (read_write == I2C_SMBUS_WRITE) {			outb_p(data->word & 0xff, SMBHSTDAT0);			outb_p((data->word & 0xff00) >> 8, SMBHSTDAT1);		}		size = VT596_WORD_DATA;		break;	case I2C_SMBUS_BLOCK_DATA:		outb_p(((addr & 0x7f) << 1) | (read_write & 0x01),		       SMBHSTADD);		outb_p(command, SMBHSTCMD);		if (read_write == I2C_SMBUS_WRITE) {			len = data->block[0];			if (len < 0)				len = 0;			if (len > I2C_SMBUS_BLOCK_MAX)				len = I2C_SMBUS_BLOCK_MAX;			outb_p(len, SMBHSTDAT0);			i = inb_p(SMBHSTCNT);	/* Reset SMBBLKDAT */			for (i = 1; i <= len; i++)				outb_p(data->block[i], SMBBLKDAT);		}		size = VT596_BLOCK_DATA;		break;	}	outb_p((size & 0x1C) + (ENABLE_INT9 & 1), SMBHSTCNT);	if (vt596_transaction()) /* Error in transaction */		return -1;	if ((read_write == I2C_SMBUS_WRITE) || (size == VT596_QUICK))		return 0;	switch (size) {	case VT596_BYTE:		/* Where is the result put? I assume here it is in		 * SMBHSTDAT0 but it might just as well be in the		 * SMBHSTCMD. No clue in the docs 		 */		data->byte = inb_p(SMBHSTDAT0);		break;	case VT596_BYTE_DATA:		data->byte = inb_p(SMBHSTDAT0);		break;	case VT596_WORD_DATA:		data->word = inb_p(SMBHSTDAT0) + (inb_p(SMBHSTDAT1) << 8);		break;	case VT596_BLOCK_DATA:		data->block[0] = inb_p(SMBHSTDAT0);		if (data->block[0] > I2C_SMBUS_BLOCK_MAX)			data->block[0] = I2C_SMBUS_BLOCK_MAX;		i = inb_p(SMBHSTCNT);	/* Reset SMBBLKDAT */		for (i = 1; i <= data->block[0]; i++)			data->block[i] = inb_p(SMBBLKDAT);		break;	}	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/5f49ef8e8cefe0a95948b4270db28507c1c287d4/i2c-viapro.c/buggy/drivers/i2c/busses/i2c-viapro.c