diff options
Diffstat (limited to 'drivers/i2c/chips/pc87360.c')
-rw-r--r-- | drivers/i2c/chips/pc87360.c | 69 |
1 files changed, 34 insertions, 35 deletions
diff --git a/drivers/i2c/chips/pc87360.c b/drivers/i2c/chips/pc87360.c index 6d94c36c9218..876c68f3af31 100644 --- a/drivers/i2c/chips/pc87360.c +++ b/drivers/i2c/chips/pc87360.c @@ -33,7 +33,6 @@ * the standard Super-I/O addresses is used (0x2E/0x2F or 0x4E/0x4F). */ -#include <linux/config.h> #include <linux/module.h> #include <linux/init.h> #include <linux/slab.h> @@ -282,31 +281,31 @@ static ssize_t set_fan_min(struct device *dev, const char *buf, } #define show_and_set_fan(offset) \ -static ssize_t show_fan##offset##_input(struct device *dev, char *buf) \ +static ssize_t show_fan##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct pc87360_data *data = pc87360_update_device(dev); \ return sprintf(buf, "%u\n", FAN_FROM_REG(data->fan[offset-1], \ FAN_DIV_FROM_REG(data->fan_status[offset-1]))); \ } \ -static ssize_t show_fan##offset##_min(struct device *dev, char *buf) \ +static ssize_t show_fan##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct pc87360_data *data = pc87360_update_device(dev); \ return sprintf(buf, "%u\n", FAN_FROM_REG(data->fan_min[offset-1], \ FAN_DIV_FROM_REG(data->fan_status[offset-1]))); \ } \ -static ssize_t show_fan##offset##_div(struct device *dev, char *buf) \ +static ssize_t show_fan##offset##_div(struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct pc87360_data *data = pc87360_update_device(dev); \ return sprintf(buf, "%u\n", \ FAN_DIV_FROM_REG(data->fan_status[offset-1])); \ } \ -static ssize_t show_fan##offset##_status(struct device *dev, char *buf) \ +static ssize_t show_fan##offset##_status(struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct pc87360_data *data = pc87360_update_device(dev); \ return sprintf(buf, "%u\n", \ FAN_STATUS_FROM_REG(data->fan_status[offset-1])); \ } \ -static ssize_t set_fan##offset##_min(struct device *dev, const char *buf, \ +static ssize_t set_fan##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \ size_t count) \ { \ return set_fan_min(dev, buf, count, offset-1); \ @@ -324,7 +323,7 @@ show_and_set_fan(2) show_and_set_fan(3) #define show_and_set_pwm(offset) \ -static ssize_t show_pwm##offset(struct device *dev, char *buf) \ +static ssize_t show_pwm##offset(struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct pc87360_data *data = pc87360_update_device(dev); \ return sprintf(buf, "%u\n", \ @@ -332,7 +331,7 @@ static ssize_t show_pwm##offset(struct device *dev, char *buf) \ FAN_CONFIG_INVERT(data->fan_conf, \ offset-1))); \ } \ -static ssize_t set_pwm##offset(struct device *dev, const char *buf, \ +static ssize_t set_pwm##offset(struct device *dev, struct device_attribute *attr, const char *buf, \ size_t count) \ { \ struct i2c_client *client = to_i2c_client(dev); \ @@ -354,30 +353,30 @@ show_and_set_pwm(2) show_and_set_pwm(3) #define show_and_set_in(offset) \ -static ssize_t show_in##offset##_input(struct device *dev, char *buf) \ +static ssize_t show_in##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct pc87360_data *data = pc87360_update_device(dev); \ return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \ data->in_vref)); \ } \ -static ssize_t show_in##offset##_min(struct device *dev, char *buf) \ +static ssize_t show_in##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct pc87360_data *data = pc87360_update_device(dev); \ return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \ data->in_vref)); \ } \ -static ssize_t show_in##offset##_max(struct device *dev, char *buf) \ +static ssize_t show_in##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct pc87360_data *data = pc87360_update_device(dev); \ return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \ data->in_vref)); \ } \ -static ssize_t show_in##offset##_status(struct device *dev, char *buf) \ +static ssize_t show_in##offset##_status(struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct pc87360_data *data = pc87360_update_device(dev); \ return sprintf(buf, "%u\n", data->in_status[offset]); \ } \ -static ssize_t set_in##offset##_min(struct device *dev, const char *buf, \ +static ssize_t set_in##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \ size_t count) \ { \ struct i2c_client *client = to_i2c_client(dev); \ @@ -391,7 +390,7 @@ static ssize_t set_in##offset##_min(struct device *dev, const char *buf, \ up(&data->update_lock); \ return count; \ } \ -static ssize_t set_in##offset##_max(struct device *dev, const char *buf, \ +static ssize_t set_in##offset##_max(struct device *dev, struct device_attribute *attr, const char *buf, \ size_t count) \ { \ struct i2c_client *client = to_i2c_client(dev); \ @@ -427,36 +426,36 @@ show_and_set_in(9) show_and_set_in(10) #define show_and_set_therm(offset) \ -static ssize_t show_temp##offset##_input(struct device *dev, char *buf) \ +static ssize_t show_temp##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct pc87360_data *data = pc87360_update_device(dev); \ return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset+7], \ data->in_vref)); \ } \ -static ssize_t show_temp##offset##_min(struct device *dev, char *buf) \ +static ssize_t show_temp##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct pc87360_data *data = pc87360_update_device(dev); \ return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset+7], \ data->in_vref)); \ } \ -static ssize_t show_temp##offset##_max(struct device *dev, char *buf) \ +static ssize_t show_temp##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct pc87360_data *data = pc87360_update_device(dev); \ return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset+7], \ data->in_vref)); \ } \ -static ssize_t show_temp##offset##_crit(struct device *dev, char *buf) \ +static ssize_t show_temp##offset##_crit(struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct pc87360_data *data = pc87360_update_device(dev); \ return sprintf(buf, "%u\n", IN_FROM_REG(data->in_crit[offset-4], \ data->in_vref)); \ } \ -static ssize_t show_temp##offset##_status(struct device *dev, char *buf) \ +static ssize_t show_temp##offset##_status(struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct pc87360_data *data = pc87360_update_device(dev); \ return sprintf(buf, "%u\n", data->in_status[offset+7]); \ } \ -static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \ +static ssize_t set_temp##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \ size_t count) \ { \ struct i2c_client *client = to_i2c_client(dev); \ @@ -470,7 +469,7 @@ static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \ up(&data->update_lock); \ return count; \ } \ -static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \ +static ssize_t set_temp##offset##_max(struct device *dev, struct device_attribute *attr, const char *buf, \ size_t count) \ { \ struct i2c_client *client = to_i2c_client(dev); \ @@ -484,7 +483,7 @@ static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \ up(&data->update_lock); \ return count; \ } \ -static ssize_t set_temp##offset##_crit(struct device *dev, const char *buf, \ +static ssize_t set_temp##offset##_crit(struct device *dev, struct device_attribute *attr, const char *buf, \ size_t count) \ { \ struct i2c_client *client = to_i2c_client(dev); \ @@ -512,19 +511,19 @@ show_and_set_therm(4) show_and_set_therm(5) show_and_set_therm(6) -static ssize_t show_vid(struct device *dev, char *buf) +static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf) { struct pc87360_data *data = pc87360_update_device(dev); return sprintf(buf, "%u\n", vid_from_reg(data->vid, data->vrm)); } static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); -static ssize_t show_vrm(struct device *dev, char *buf) +static ssize_t show_vrm(struct device *dev, struct device_attribute *attr, char *buf) { struct pc87360_data *data = pc87360_update_device(dev); return sprintf(buf, "%u\n", data->vrm); } -static ssize_t set_vrm(struct device *dev, const char *buf, size_t count) +static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct i2c_client *client = to_i2c_client(dev); struct pc87360_data *data = i2c_get_clientdata(client); @@ -533,7 +532,7 @@ static ssize_t set_vrm(struct device *dev, const char *buf, size_t count) } static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm); -static ssize_t show_in_alarms(struct device *dev, char *buf) +static ssize_t show_in_alarms(struct device *dev, struct device_attribute *attr, char *buf) { struct pc87360_data *data = pc87360_update_device(dev); return sprintf(buf, "%u\n", data->in_alarms); @@ -541,32 +540,32 @@ static ssize_t show_in_alarms(struct device *dev, char *buf) static DEVICE_ATTR(alarms_in, S_IRUGO, show_in_alarms, NULL); #define show_and_set_temp(offset) \ -static ssize_t show_temp##offset##_input(struct device *dev, char *buf) \ +static ssize_t show_temp##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct pc87360_data *data = pc87360_update_device(dev); \ return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \ } \ -static ssize_t show_temp##offset##_min(struct device *dev, char *buf) \ +static ssize_t show_temp##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct pc87360_data *data = pc87360_update_device(dev); \ return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_min[offset-1])); \ } \ -static ssize_t show_temp##offset##_max(struct device *dev, char *buf) \ +static ssize_t show_temp##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct pc87360_data *data = pc87360_update_device(dev); \ return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[offset-1])); \ }\ -static ssize_t show_temp##offset##_crit(struct device *dev, char *buf) \ +static ssize_t show_temp##offset##_crit(struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct pc87360_data *data = pc87360_update_device(dev); \ return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit[offset-1])); \ }\ -static ssize_t show_temp##offset##_status(struct device *dev, char *buf) \ +static ssize_t show_temp##offset##_status(struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct pc87360_data *data = pc87360_update_device(dev); \ return sprintf(buf, "%d\n", data->temp_status[offset-1]); \ }\ -static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \ +static ssize_t set_temp##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \ size_t count) \ { \ struct i2c_client *client = to_i2c_client(dev); \ @@ -580,7 +579,7 @@ static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \ up(&data->update_lock); \ return count; \ } \ -static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \ +static ssize_t set_temp##offset##_max(struct device *dev, struct device_attribute *attr, const char *buf, \ size_t count) \ { \ struct i2c_client *client = to_i2c_client(dev); \ @@ -594,7 +593,7 @@ static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \ up(&data->update_lock); \ return count; \ } \ -static ssize_t set_temp##offset##_crit(struct device *dev, const char *buf, \ +static ssize_t set_temp##offset##_crit(struct device *dev, struct device_attribute *attr, const char *buf, \ size_t count) \ { \ struct i2c_client *client = to_i2c_client(dev); \ @@ -622,7 +621,7 @@ show_and_set_temp(1) show_and_set_temp(2) show_and_set_temp(3) -static ssize_t show_temp_alarms(struct device *dev, char *buf) +static ssize_t show_temp_alarms(struct device *dev, struct device_attribute *attr, char *buf) { struct pc87360_data *data = pc87360_update_device(dev); return sprintf(buf, "%u\n", data->temp_alarms); |