X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fi2c%2Fchips%2Fadm1031.c;h=69f4d1e29a616230b8c9f6959bd461febe28415a;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=23c323e801a6349c9b8c6ceaba34067eb2b4ae6a;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/drivers/i2c/chips/adm1031.c b/drivers/i2c/chips/adm1031.c index 23c323e80..69f4d1e29 100644 --- a/drivers/i2c/chips/adm1031.c +++ b/drivers/i2c/chips/adm1031.c @@ -57,10 +57,8 @@ #define ADM1031_CONF2_TEMP_ENABLE(chan) (0x10 << (chan)) /* Addresses to scan */ -static unsigned short normal_i2c[] = { I2C_CLIENT_END }; -static unsigned short normal_i2c_range[] = { 0x2c, 0x2e, I2C_CLIENT_END }; +static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END }; -static unsigned int normal_isa_range[] = { I2C_CLIENT_ISA_END }; /* Insmod parameters */ SENSORS_INSMOD_2(adm1030, adm1031); @@ -298,12 +296,12 @@ set_fan_auto_channel(struct device *dev, const char *buf, size_t count, int nr) #define fan_auto_channel_offset(offset) \ static ssize_t show_fan_auto_channel_##offset (struct device *dev, char *buf) \ { \ - return show_fan_auto_channel(dev, buf, 0x##offset - 1); \ + return show_fan_auto_channel(dev, buf, offset - 1); \ } \ static ssize_t set_fan_auto_channel_##offset (struct device *dev, \ const char *buf, size_t count) \ { \ - return set_fan_auto_channel(dev, buf, count, 0x##offset - 1); \ + return set_fan_auto_channel(dev, buf, count, offset - 1); \ } \ static DEVICE_ATTR(auto_fan##offset##_channel, S_IRUGO | S_IWUSR, \ show_fan_auto_channel_##offset, \ @@ -365,25 +363,25 @@ set_auto_temp_max(struct device *dev, const char *buf, size_t count, int nr) #define auto_temp_reg(offset) \ static ssize_t show_auto_temp_##offset##_off (struct device *dev, char *buf) \ { \ - return show_auto_temp_off(dev, buf, 0x##offset - 1); \ + return show_auto_temp_off(dev, buf, offset - 1); \ } \ static ssize_t show_auto_temp_##offset##_min (struct device *dev, char *buf) \ { \ - return show_auto_temp_min(dev, buf, 0x##offset - 1); \ + return show_auto_temp_min(dev, buf, offset - 1); \ } \ static ssize_t show_auto_temp_##offset##_max (struct device *dev, char *buf) \ { \ - return show_auto_temp_max(dev, buf, 0x##offset - 1); \ + return show_auto_temp_max(dev, buf, offset - 1); \ } \ static ssize_t set_auto_temp_##offset##_min (struct device *dev, \ const char *buf, size_t count) \ { \ - return set_auto_temp_min(dev, buf, count, 0x##offset - 1); \ + return set_auto_temp_min(dev, buf, count, offset - 1); \ } \ static ssize_t set_auto_temp_##offset##_max (struct device *dev, \ const char *buf, size_t count) \ { \ - return set_auto_temp_max(dev, buf, count, 0x##offset - 1); \ + return set_auto_temp_max(dev, buf, count, offset - 1); \ } \ static DEVICE_ATTR(auto_temp##offset##_off, S_IRUGO, \ show_auto_temp_##offset##_off, NULL); \ @@ -429,14 +427,14 @@ set_pwm(struct device *dev, const char *buf, size_t count, int nr) #define pwm_reg(offset) \ static ssize_t show_pwm_##offset (struct device *dev, char *buf) \ { \ - return show_pwm(dev, buf, 0x##offset - 1); \ + return show_pwm(dev, buf, offset - 1); \ } \ static ssize_t set_pwm_##offset (struct device *dev, \ const char *buf, size_t count) \ { \ - return set_pwm(dev, buf, count, 0x##offset - 1); \ + return set_pwm(dev, buf, count, offset - 1); \ } \ -static DEVICE_ATTR(fan##offset##_pwm, S_IRUGO | S_IWUSR, \ +static DEVICE_ATTR(pwm##offset, S_IRUGO | S_IWUSR, \ show_pwm_##offset, set_pwm_##offset) pwm_reg(1); @@ -565,25 +563,25 @@ set_fan_div(struct device *dev, const char *buf, size_t count, int nr) #define fan_offset(offset) \ static ssize_t show_fan_##offset (struct device *dev, char *buf) \ { \ - return show_fan(dev, buf, 0x##offset - 1); \ + return show_fan(dev, buf, offset - 1); \ } \ static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \ { \ - return show_fan_min(dev, buf, 0x##offset - 1); \ + return show_fan_min(dev, buf, offset - 1); \ } \ static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \ { \ - return show_fan_div(dev, buf, 0x##offset - 1); \ + return show_fan_div(dev, buf, offset - 1); \ } \ static ssize_t set_fan_##offset##_min (struct device *dev, \ const char *buf, size_t count) \ { \ - return set_fan_min(dev, buf, count, 0x##offset - 1); \ + return set_fan_min(dev, buf, count, offset - 1); \ } \ static ssize_t set_fan_##offset##_div (struct device *dev, \ const char *buf, size_t count) \ { \ - return set_fan_div(dev, buf, count, 0x##offset - 1); \ + return set_fan_div(dev, buf, count, offset - 1); \ } \ static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, \ NULL); \ @@ -675,34 +673,34 @@ set_temp_crit(struct device *dev, const char *buf, size_t count, int nr) #define temp_reg(offset) \ static ssize_t show_temp_##offset (struct device *dev, char *buf) \ { \ - return show_temp(dev, buf, 0x##offset - 1); \ + return show_temp(dev, buf, offset - 1); \ } \ static ssize_t show_temp_##offset##_min (struct device *dev, char *buf) \ { \ - return show_temp_min(dev, buf, 0x##offset - 1); \ + return show_temp_min(dev, buf, offset - 1); \ } \ static ssize_t show_temp_##offset##_max (struct device *dev, char *buf) \ { \ - return show_temp_max(dev, buf, 0x##offset - 1); \ + return show_temp_max(dev, buf, offset - 1); \ } \ static ssize_t show_temp_##offset##_crit (struct device *dev, char *buf) \ { \ - return show_temp_crit(dev, buf, 0x##offset - 1); \ + return show_temp_crit(dev, buf, offset - 1); \ } \ static ssize_t set_temp_##offset##_min (struct device *dev, \ const char *buf, size_t count) \ { \ - return set_temp_min(dev, buf, count, 0x##offset - 1); \ + return set_temp_min(dev, buf, count, offset - 1); \ } \ static ssize_t set_temp_##offset##_max (struct device *dev, \ const char *buf, size_t count) \ { \ - return set_temp_max(dev, buf, count, 0x##offset - 1); \ + return set_temp_max(dev, buf, count, offset - 1); \ } \ static ssize_t set_temp_##offset##_crit (struct device *dev, \ const char *buf, size_t count) \ { \ - return set_temp_crit(dev, buf, count, 0x##offset - 1); \ + return set_temp_crit(dev, buf, count, offset - 1); \ } \ static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp_##offset, \ NULL); \ @@ -799,7 +797,7 @@ static int adm1031_detect(struct i2c_adapter *adapter, int address, int kind) device_create_file(&new_client->dev, &dev_attr_fan1_input); device_create_file(&new_client->dev, &dev_attr_fan1_div); device_create_file(&new_client->dev, &dev_attr_fan1_min); - device_create_file(&new_client->dev, &dev_attr_fan1_pwm); + device_create_file(&new_client->dev, &dev_attr_pwm1); device_create_file(&new_client->dev, &dev_attr_auto_fan1_channel); device_create_file(&new_client->dev, &dev_attr_temp1_input); device_create_file(&new_client->dev, &dev_attr_temp1_min); @@ -826,7 +824,7 @@ static int adm1031_detect(struct i2c_adapter *adapter, int address, int kind) device_create_file(&new_client->dev, &dev_attr_fan2_input); device_create_file(&new_client->dev, &dev_attr_fan2_div); device_create_file(&new_client->dev, &dev_attr_fan2_min); - device_create_file(&new_client->dev, &dev_attr_fan2_pwm); + device_create_file(&new_client->dev, &dev_attr_pwm2); device_create_file(&new_client->dev, &dev_attr_auto_fan2_channel); device_create_file(&new_client->dev, &dev_attr_temp3_input);