const char *name;
struct device *hwmon_dev;
- struct mutex lock;
u16 reg_temp[4][NUM_TEMP]; /* 0=temp, 1=temp_over, 2=temp_hyst,
* 3=temp_crit
{
int res, word_sized = is_word_sized(data, reg);
- mutex_lock(&data->lock);
-
nct6775_set_bank(data, reg);
outb_p(reg & 0xff, data->addr + ADDR_REG_OFFSET);
res = inb_p(data->addr + DATA_REG_OFFSET);
data->addr + ADDR_REG_OFFSET);
res = (res << 8) + inb_p(data->addr + DATA_REG_OFFSET);
}
-
- mutex_unlock(&data->lock);
return res;
}
{
int word_sized = is_word_sized(data, reg);
- mutex_lock(&data->lock);
-
nct6775_set_bank(data, reg);
outb_p(reg & 0xff, data->addr + ADDR_REG_OFFSET);
if (word_sized) {
data->addr + ADDR_REG_OFFSET);
}
outb_p(value & 0xff, data->addr + DATA_REG_OFFSET);
-
- mutex_unlock(&data->lock);
return 0;
}
data->kind = sio_data->kind;
data->addr = res->start;
- mutex_init(&data->lock);
mutex_init(&data->update_lock);
data->name = nct6775_device_names[data->kind];
data->bank = 0xff; /* Force initial bank selection */