aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/adm9240.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/drivers/hwmon/adm9240.c b/drivers/hwmon/adm9240.c
index 8bb6d6e45ed5..11dc95f8a17e 100644
--- a/drivers/hwmon/adm9240.c
+++ b/drivers/hwmon/adm9240.c
@@ -219,8 +219,8 @@ static ssize_t show_in(struct device *dev, struct device_attribute *devattr,
219 attr->index)); 219 attr->index));
220} 220}
221 221
222static ssize_t show_in_min(struct device *dev, struct device_attribute *devattr, 222static ssize_t show_in_min(struct device *dev,
223 char *buf) 223 struct device_attribute *devattr, char *buf)
224{ 224{
225 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); 225 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
226 struct adm9240_data *data = adm9240_update_device(dev); 226 struct adm9240_data *data = adm9240_update_device(dev);
@@ -228,8 +228,8 @@ static ssize_t show_in_min(struct device *dev, struct device_attribute *devattr,
228 attr->index)); 228 attr->index));
229} 229}
230 230
231static ssize_t show_in_max(struct device *dev, struct device_attribute *devattr, 231static ssize_t show_in_max(struct device *dev,
232 char *buf) 232 struct device_attribute *devattr, char *buf)
233{ 233{
234 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); 234 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
235 struct adm9240_data *data = adm9240_update_device(dev); 235 struct adm9240_data *data = adm9240_update_device(dev);
@@ -237,7 +237,8 @@ static ssize_t show_in_max(struct device *dev, struct device_attribute *devattr,
237 attr->index)); 237 attr->index));
238} 238}
239 239
240static ssize_t set_in_min(struct device *dev, struct device_attribute *devattr, 240static ssize_t set_in_min(struct device *dev,
241 struct device_attribute *devattr,
241 const char *buf, size_t count) 242 const char *buf, size_t count)
242{ 243{
243 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); 244 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
@@ -253,7 +254,8 @@ static ssize_t set_in_min(struct device *dev, struct device_attribute *devattr,
253 return count; 254 return count;
254} 255}
255 256
256static ssize_t set_in_max(struct device *dev, struct device_attribute *devattr, 257static ssize_t set_in_max(struct device *dev,
258 struct device_attribute *devattr,
257 const char *buf, size_t count) 259 const char *buf, size_t count)
258{ 260{
259 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); 261 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
@@ -326,7 +328,7 @@ static void adm9240_write_fan_div(struct i2c_client *client, int nr,
326 "to %u\n", nr + 1, 1 << old, 1 << fan_div); 328 "to %u\n", nr + 1, 1 << old, 1 << fan_div);
327} 329}
328 330
329/* 331/*
330 * set fan speed low limit: 332 * set fan speed low limit:
331 * 333 *
332 * - value is zero: disable fan speed low limit alarm 334 * - value is zero: disable fan speed low limit alarm
@@ -404,7 +406,8 @@ fan(1);
404fan(2); 406fan(2);
405 407
406/* alarms */ 408/* alarms */
407static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf) 409static ssize_t show_alarms(struct device *dev,
410 struct device_attribute *attr, char *buf)
408{ 411{
409 struct adm9240_data *data = adm9240_update_device(dev); 412 struct adm9240_data *data = adm9240_update_device(dev);
410 return sprintf(buf, "%u\n", data->alarms); 413 return sprintf(buf, "%u\n", data->alarms);
@@ -412,7 +415,8 @@ static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, ch
412static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); 415static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
413 416
414/* vid */ 417/* vid */
415static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf) 418static ssize_t show_vid(struct device *dev,
419 struct device_attribute *attr, char *buf)
416{ 420{
417 struct adm9240_data *data = adm9240_update_device(dev); 421 struct adm9240_data *data = adm9240_update_device(dev);
418 return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm)); 422 return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm));
@@ -420,13 +424,16 @@ static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char
420static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); 424static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL);
421 425
422/* analog output */ 426/* analog output */
423static ssize_t show_aout(struct device *dev, struct device_attribute *attr, char *buf) 427static ssize_t show_aout(struct device *dev,
428 struct device_attribute *attr, char *buf)
424{ 429{
425 struct adm9240_data *data = adm9240_update_device(dev); 430 struct adm9240_data *data = adm9240_update_device(dev);
426 return sprintf(buf, "%d\n", AOUT_FROM_REG(data->aout)); 431 return sprintf(buf, "%d\n", AOUT_FROM_REG(data->aout));
427} 432}
428 433
429static ssize_t set_aout(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) 434static ssize_t set_aout(struct device *dev,
435 struct device_attribute *attr,
436 const char *buf, size_t count)
430{ 437{
431 struct i2c_client *client = to_i2c_client(dev); 438 struct i2c_client *client = to_i2c_client(dev);
432 struct adm9240_data *data = i2c_get_clientdata(client); 439 struct adm9240_data *data = i2c_get_clientdata(client);
@@ -441,7 +448,9 @@ static ssize_t set_aout(struct device *dev, struct device_attribute *attr, const
441static DEVICE_ATTR(aout_output, S_IRUGO | S_IWUSR, show_aout, set_aout); 448static DEVICE_ATTR(aout_output, S_IRUGO | S_IWUSR, show_aout, set_aout);
442 449
443/* chassis_clear */ 450/* chassis_clear */
444static ssize_t chassis_clear(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) 451static ssize_t chassis_clear(struct device *dev,
452 struct device_attribute *attr,
453 const char *buf, size_t count)
445{ 454{
446 struct i2c_client *client = to_i2c_client(dev); 455 struct i2c_client *client = to_i2c_client(dev);
447 unsigned long val = simple_strtol(buf, NULL, 10); 456 unsigned long val = simple_strtol(buf, NULL, 10);