diff options
-rw-r--r-- | drivers/hwmon/adm9240.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/hwmon/adm9240.c b/drivers/hwmon/adm9240.c index 7887192c4236..7671d2bf7800 100644 --- a/drivers/hwmon/adm9240.c +++ b/drivers/hwmon/adm9240.c | |||
@@ -414,6 +414,23 @@ static ssize_t show_alarms(struct device *dev, | |||
414 | } | 414 | } |
415 | static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); | 415 | static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); |
416 | 416 | ||
417 | static ssize_t show_alarm(struct device *dev, | ||
418 | struct device_attribute *attr, char *buf) | ||
419 | { | ||
420 | int bitnr = to_sensor_dev_attr(attr)->index; | ||
421 | struct adm9240_data *data = adm9240_update_device(dev); | ||
422 | return sprintf(buf, "%u\n", (data->alarms >> bitnr) & 1); | ||
423 | } | ||
424 | static SENSOR_DEVICE_ATTR(in0_alarm, S_IRUGO, show_alarm, NULL, 0); | ||
425 | static SENSOR_DEVICE_ATTR(in1_alarm, S_IRUGO, show_alarm, NULL, 1); | ||
426 | static SENSOR_DEVICE_ATTR(in2_alarm, S_IRUGO, show_alarm, NULL, 2); | ||
427 | static SENSOR_DEVICE_ATTR(in3_alarm, S_IRUGO, show_alarm, NULL, 3); | ||
428 | static SENSOR_DEVICE_ATTR(in4_alarm, S_IRUGO, show_alarm, NULL, 8); | ||
429 | static SENSOR_DEVICE_ATTR(in5_alarm, S_IRUGO, show_alarm, NULL, 9); | ||
430 | static SENSOR_DEVICE_ATTR(temp1_alarm, S_IRUGO, show_alarm, NULL, 4); | ||
431 | static SENSOR_DEVICE_ATTR(fan1_alarm, S_IRUGO, show_alarm, NULL, 6); | ||
432 | static SENSOR_DEVICE_ATTR(fan2_alarm, S_IRUGO, show_alarm, NULL, 7); | ||
433 | |||
417 | /* vid */ | 434 | /* vid */ |
418 | static ssize_t show_vid(struct device *dev, | 435 | static ssize_t show_vid(struct device *dev, |
419 | struct device_attribute *attr, char *buf) | 436 | struct device_attribute *attr, char *buf) |
@@ -468,30 +485,39 @@ static struct attribute *adm9240_attributes[] = { | |||
468 | &sensor_dev_attr_in0_input.dev_attr.attr, | 485 | &sensor_dev_attr_in0_input.dev_attr.attr, |
469 | &sensor_dev_attr_in0_min.dev_attr.attr, | 486 | &sensor_dev_attr_in0_min.dev_attr.attr, |
470 | &sensor_dev_attr_in0_max.dev_attr.attr, | 487 | &sensor_dev_attr_in0_max.dev_attr.attr, |
488 | &sensor_dev_attr_in0_alarm.dev_attr.attr, | ||
471 | &sensor_dev_attr_in1_input.dev_attr.attr, | 489 | &sensor_dev_attr_in1_input.dev_attr.attr, |
472 | &sensor_dev_attr_in1_min.dev_attr.attr, | 490 | &sensor_dev_attr_in1_min.dev_attr.attr, |
473 | &sensor_dev_attr_in1_max.dev_attr.attr, | 491 | &sensor_dev_attr_in1_max.dev_attr.attr, |
492 | &sensor_dev_attr_in1_alarm.dev_attr.attr, | ||
474 | &sensor_dev_attr_in2_input.dev_attr.attr, | 493 | &sensor_dev_attr_in2_input.dev_attr.attr, |
475 | &sensor_dev_attr_in2_min.dev_attr.attr, | 494 | &sensor_dev_attr_in2_min.dev_attr.attr, |
476 | &sensor_dev_attr_in2_max.dev_attr.attr, | 495 | &sensor_dev_attr_in2_max.dev_attr.attr, |
496 | &sensor_dev_attr_in2_alarm.dev_attr.attr, | ||
477 | &sensor_dev_attr_in3_input.dev_attr.attr, | 497 | &sensor_dev_attr_in3_input.dev_attr.attr, |
478 | &sensor_dev_attr_in3_min.dev_attr.attr, | 498 | &sensor_dev_attr_in3_min.dev_attr.attr, |
479 | &sensor_dev_attr_in3_max.dev_attr.attr, | 499 | &sensor_dev_attr_in3_max.dev_attr.attr, |
500 | &sensor_dev_attr_in3_alarm.dev_attr.attr, | ||
480 | &sensor_dev_attr_in4_input.dev_attr.attr, | 501 | &sensor_dev_attr_in4_input.dev_attr.attr, |
481 | &sensor_dev_attr_in4_min.dev_attr.attr, | 502 | &sensor_dev_attr_in4_min.dev_attr.attr, |
482 | &sensor_dev_attr_in4_max.dev_attr.attr, | 503 | &sensor_dev_attr_in4_max.dev_attr.attr, |
504 | &sensor_dev_attr_in4_alarm.dev_attr.attr, | ||
483 | &sensor_dev_attr_in5_input.dev_attr.attr, | 505 | &sensor_dev_attr_in5_input.dev_attr.attr, |
484 | &sensor_dev_attr_in5_min.dev_attr.attr, | 506 | &sensor_dev_attr_in5_min.dev_attr.attr, |
485 | &sensor_dev_attr_in5_max.dev_attr.attr, | 507 | &sensor_dev_attr_in5_max.dev_attr.attr, |
508 | &sensor_dev_attr_in5_alarm.dev_attr.attr, | ||
486 | &dev_attr_temp1_input.attr, | 509 | &dev_attr_temp1_input.attr, |
487 | &sensor_dev_attr_temp1_max.dev_attr.attr, | 510 | &sensor_dev_attr_temp1_max.dev_attr.attr, |
488 | &sensor_dev_attr_temp1_max_hyst.dev_attr.attr, | 511 | &sensor_dev_attr_temp1_max_hyst.dev_attr.attr, |
512 | &sensor_dev_attr_temp1_alarm.dev_attr.attr, | ||
489 | &sensor_dev_attr_fan1_input.dev_attr.attr, | 513 | &sensor_dev_attr_fan1_input.dev_attr.attr, |
490 | &sensor_dev_attr_fan1_div.dev_attr.attr, | 514 | &sensor_dev_attr_fan1_div.dev_attr.attr, |
491 | &sensor_dev_attr_fan1_min.dev_attr.attr, | 515 | &sensor_dev_attr_fan1_min.dev_attr.attr, |
516 | &sensor_dev_attr_fan1_alarm.dev_attr.attr, | ||
492 | &sensor_dev_attr_fan2_input.dev_attr.attr, | 517 | &sensor_dev_attr_fan2_input.dev_attr.attr, |
493 | &sensor_dev_attr_fan2_div.dev_attr.attr, | 518 | &sensor_dev_attr_fan2_div.dev_attr.attr, |
494 | &sensor_dev_attr_fan2_min.dev_attr.attr, | 519 | &sensor_dev_attr_fan2_min.dev_attr.attr, |
520 | &sensor_dev_attr_fan2_alarm.dev_attr.attr, | ||
495 | &dev_attr_alarms.attr, | 521 | &dev_attr_alarms.attr, |
496 | &dev_attr_aout_output.attr, | 522 | &dev_attr_aout_output.attr, |
497 | &dev_attr_chassis_clear.attr, | 523 | &dev_attr_chassis_clear.attr, |