protocol |= pec; 
static s32 amd8111_access(struct i2c_adapter * adap, u16 addr, unsigned short flags,		char read_write, u8 command, int size, union i2c_smbus_data * data){	struct amd_smbus *smbus = adap->algo_data;	unsigned char protocol, len, pec, temp[2];	int i;	protocol = (read_write == I2C_SMBUS_READ) ? AMD_SMB_PRTCL_READ : AMD_SMB_PRTCL_WRITE;	pec = (flags & I2C_CLIENT_PEC) ? AMD_SMB_PRTCL_PEC : 0;	switch (size) {		case I2C_SMBUS_QUICK:			protocol |= AMD_SMB_PRTCL_QUICK;			read_write = I2C_SMBUS_WRITE;			break;		case I2C_SMBUS_BYTE:			if (read_write == I2C_SMBUS_WRITE)				amd_ec_write(smbus, AMD_SMB_CMD, command);			protocol |= AMD_SMB_PRTCL_BYTE;			break;		case I2C_SMBUS_BYTE_DATA:			amd_ec_write(smbus, AMD_SMB_CMD, command);			if (read_write == I2C_SMBUS_WRITE)				amd_ec_write(smbus, AMD_SMB_DATA, data->byte);			protocol |= AMD_SMB_PRTCL_BYTE_DATA;			break;		case I2C_SMBUS_WORD_DATA:			amd_ec_write(smbus, AMD_SMB_CMD, command);			if (read_write == I2C_SMBUS_WRITE) {				amd_ec_write(smbus, AMD_SMB_DATA, data->word);				amd_ec_write(smbus, AMD_SMB_DATA + 1, data->word >> 8);			}			protocol |= AMD_SMB_PRTCL_WORD_DATA | pec;			break;		case I2C_SMBUS_BLOCK_DATA:			amd_ec_write(smbus, AMD_SMB_CMD, command);			if (read_write == I2C_SMBUS_WRITE) {				len = min_t(u8, data->block[0], 32);				amd_ec_write(smbus, AMD_SMB_BCNT, len);				for (i = 0; i < len; i++)					amd_ec_write(smbus, AMD_SMB_DATA + i, data->block[i + 1]);			}			protocol |= AMD_SMB_PRTCL_BLOCK_DATA | pec;			break;		case I2C_SMBUS_I2C_BLOCK_DATA:			len = min_t(u8, data->block[0], 32);			amd_ec_write(smbus, AMD_SMB_CMD, command);			amd_ec_write(smbus, AMD_SMB_BCNT, len);			if (read_write == I2C_SMBUS_WRITE)				for (i = 0; i < len; i++)					amd_ec_write(smbus, AMD_SMB_DATA + i, data->block[i + 1]);			protocol |= AMD_SMB_PRTCL_I2C_BLOCK_DATA;			break;		case I2C_SMBUS_PROC_CALL:			amd_ec_write(smbus, AMD_SMB_CMD, command);			amd_ec_write(smbus, AMD_SMB_DATA, data->word);			amd_ec_write(smbus, AMD_SMB_DATA + 1, data->word >> 8);			protocol = AMD_SMB_PRTCL_PROC_CALL | pec;			read_write = I2C_SMBUS_READ;			break;		case I2C_SMBUS_BLOCK_PROC_CALL:			protocol |= pec;			len = min_t(u8, data->block[0], 31);			amd_ec_write(smbus, AMD_SMB_CMD, command);			amd_ec_write(smbus, AMD_SMB_BCNT, len);			for (i = 0; i < len; i++)				amd_ec_write(smbus, AMD_SMB_DATA + i, data->block[i + 1]);			protocol = AMD_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_warn(&adap->dev, "Unexpected software PEC transaction %d\n.", size);			return -1;		default:			dev_warn(&adap->dev, "Unsupported transaction %d\n", size);			return -1;	}	amd_ec_write(smbus, AMD_SMB_ADDR, addr << 1);	amd_ec_write(smbus, AMD_SMB_PRTCL, protocol);	amd_ec_read(smbus, AMD_SMB_STS, temp + 0);	if (~temp[0] & AMD_SMB_STS_DONE) {		udelay(500);		amd_ec_read(smbus, AMD_SMB_STS, temp + 0);	}	if (~temp[0] & AMD_SMB_STS_DONE) {		msleep(1);		amd_ec_read(smbus, AMD_SMB_STS, temp + 0);	}	if ((~temp[0] & AMD_SMB_STS_DONE) || (temp[0] & AMD_SMB_STS_STATUS))		return -1;	if (read_write == I2C_SMBUS_WRITE)		return 0;	switch (size) {		case I2C_SMBUS_BYTE:		case I2C_SMBUS_BYTE_DATA:			amd_ec_read(smbus, AMD_SMB_DATA, &data->byte);			break;		case I2C_SMBUS_WORD_DATA:		case I2C_SMBUS_PROC_CALL:			amd_ec_read(smbus, AMD_SMB_DATA, temp + 0);			amd_ec_read(smbus, AMD_SMB_DATA + 1, temp + 1);			data->word = (temp[1] << 8) | temp[0];			break;		case I2C_SMBUS_BLOCK_DATA:		case I2C_SMBUS_BLOCK_PROC_CALL:			amd_ec_read(smbus, AMD_SMB_BCNT, &len);			len = min_t(u8, len, 32);		case I2C_SMBUS_I2C_BLOCK_DATA:			for (i = 0; i < len; i++)				amd_ec_read(smbus, AMD_SMB_DATA + i, data->block + i + 1);			data->block[0] = len;			break;	}	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/0f69a612f950f7508e556bf1b09390087d112115/i2c-amd8111.c/buggy/drivers/i2c/busses/i2c-amd8111.c