data->temp_high = i2c_smbus_read_byte_data(client, ADM9240_REG_TEMP_HIGH); data->temp_hyst = i2c_smbus_read_byte_data(client, ADM9240_REG_TEMP_HYST); 
data->temp_max[0] = i2c_smbus_read_byte_data(client, ADM9240_REG_TEMP_MAX(0)); data->temp_max[1] = i2c_smbus_read_byte_data(client, ADM9240_REG_TEMP_MAX(1)); 
static struct adm9240_data *adm9240_update_device(struct device *dev){	struct i2c_client *client = to_i2c_client(dev);	struct adm9240_data *data = i2c_get_clientdata(client);	int i;	down(&data->update_lock);	/* minimum measurement cycle: 1.75 seconds */	if (time_after(jiffies, data->last_updated_measure + (HZ * 7 / 4))			|| !data->valid) {		for (i = 0; i < 6; i++) /* read voltages */		{			data->in[i] = i2c_smbus_read_byte_data(client,					ADM9240_REG_IN(i));		}		data->alarms = i2c_smbus_read_byte_data(client,					ADM9240_REG_INT(0)) |					i2c_smbus_read_byte_data(client,					ADM9240_REG_INT(1)) << 8;		/* read temperature: assume temperature changes less than		 * 0.5'C per two measurement cycles thus ignore possible		 * but unlikely aliasing error on lsb reading. --Grant */		data->temp = ((i2c_smbus_read_byte_data(client,					ADM9240_REG_TEMP) << 8) |					i2c_smbus_read_byte_data(client,					ADM9240_REG_TEMP_CONF)) / 128;		for (i = 0; i < 2; i++) /* read fans */		{			data->fan[i] = i2c_smbus_read_byte_data(client,					ADM9240_REG_FAN(i));			/* adjust fan clock divider on overflow */			if (data->valid && data->fan[i] == 255 &&					data->fan_div[i] < 3) {				adm9240_write_fan_div(client, i,						++data->fan_div[i]);				/* adjust fan_min if active, but not to 0 */				if (data->fan_min[i] < 255 &&						data->fan_min[i] >= 2)					data->fan_min[i] /= 2;			}		}		data->last_updated_measure = jiffies;	}	/* minimum config reading cycle: 300 seconds */	if (time_after(jiffies, data->last_updated_config + (HZ * 300))			|| !data->valid) {		for (i = 0; i < 6; i++)		{			data->in_min[i] = i2c_smbus_read_byte_data(client,					ADM9240_REG_IN_MIN(i));			data->in_max[i] = i2c_smbus_read_byte_data(client,					ADM9240_REG_IN_MAX(i));		}		for (i = 0; i < 2; i++)		{			data->fan_min[i] = i2c_smbus_read_byte_data(client,					ADM9240_REG_FAN_MIN(i));		}		data->temp_high = i2c_smbus_read_byte_data(client,				ADM9240_REG_TEMP_HIGH);		data->temp_hyst = i2c_smbus_read_byte_data(client,				ADM9240_REG_TEMP_HYST);		/* read fan divs and 5-bit VID */		i = i2c_smbus_read_byte_data(client, ADM9240_REG_VID_FAN_DIV);		data->fan_div[0] = (i >> 4) & 3;		data->fan_div[1] = (i >> 6) & 3;		data->vid = i & 0x0f;		data->vid |= (i2c_smbus_read_byte_data(client,					ADM9240_REG_VID4) & 1) << 4;		/* read analog out */		data->aout = i2c_smbus_read_byte_data(client,				ADM9240_REG_ANALOG_OUT);		data->last_updated_config = jiffies;		data->valid = 1;	}	up(&data->update_lock);	return data;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/c7461a6652f40ce4f8e19d7368c7a807a618fb68/adm9240.c/clean/drivers/hwmon/adm9240.c