diff options
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/asb100.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/hwmon/asb100.c b/drivers/hwmon/asb100.c index 407c86c20ecb..950cea8d1d65 100644 --- a/drivers/hwmon/asb100.c +++ b/drivers/hwmon/asb100.c | |||
@@ -480,6 +480,25 @@ static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, | |||
480 | 480 | ||
481 | static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); | 481 | static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); |
482 | 482 | ||
483 | static ssize_t show_alarm(struct device *dev, struct device_attribute *attr, | ||
484 | char *buf) | ||
485 | { | ||
486 | int bitnr = to_sensor_dev_attr(attr)->index; | ||
487 | struct asb100_data *data = asb100_update_device(dev); | ||
488 | return sprintf(buf, "%u\n", (data->alarms >> bitnr) & 1); | ||
489 | } | ||
490 | static SENSOR_DEVICE_ATTR(in0_alarm, S_IRUGO, show_alarm, NULL, 0); | ||
491 | static SENSOR_DEVICE_ATTR(in1_alarm, S_IRUGO, show_alarm, NULL, 1); | ||
492 | static SENSOR_DEVICE_ATTR(in2_alarm, S_IRUGO, show_alarm, NULL, 2); | ||
493 | static SENSOR_DEVICE_ATTR(in3_alarm, S_IRUGO, show_alarm, NULL, 3); | ||
494 | static SENSOR_DEVICE_ATTR(in4_alarm, S_IRUGO, show_alarm, NULL, 8); | ||
495 | static SENSOR_DEVICE_ATTR(fan1_alarm, S_IRUGO, show_alarm, NULL, 6); | ||
496 | static SENSOR_DEVICE_ATTR(fan2_alarm, S_IRUGO, show_alarm, NULL, 7); | ||
497 | static SENSOR_DEVICE_ATTR(fan3_alarm, S_IRUGO, show_alarm, NULL, 11); | ||
498 | static SENSOR_DEVICE_ATTR(temp1_alarm, S_IRUGO, show_alarm, NULL, 4); | ||
499 | static SENSOR_DEVICE_ATTR(temp2_alarm, S_IRUGO, show_alarm, NULL, 5); | ||
500 | static SENSOR_DEVICE_ATTR(temp3_alarm, S_IRUGO, show_alarm, NULL, 13); | ||
501 | |||
483 | /* 1 PWM */ | 502 | /* 1 PWM */ |
484 | static ssize_t show_pwm1(struct device *dev, struct device_attribute *attr, | 503 | static ssize_t show_pwm1(struct device *dev, struct device_attribute *attr, |
485 | char *buf) | 504 | char *buf) |
@@ -575,6 +594,18 @@ static struct attribute *asb100_attributes[] = { | |||
575 | &sensor_dev_attr_temp4_max.dev_attr.attr, | 594 | &sensor_dev_attr_temp4_max.dev_attr.attr, |
576 | &sensor_dev_attr_temp4_max_hyst.dev_attr.attr, | 595 | &sensor_dev_attr_temp4_max_hyst.dev_attr.attr, |
577 | 596 | ||
597 | &sensor_dev_attr_in0_alarm.dev_attr.attr, | ||
598 | &sensor_dev_attr_in1_alarm.dev_attr.attr, | ||
599 | &sensor_dev_attr_in2_alarm.dev_attr.attr, | ||
600 | &sensor_dev_attr_in3_alarm.dev_attr.attr, | ||
601 | &sensor_dev_attr_in4_alarm.dev_attr.attr, | ||
602 | &sensor_dev_attr_fan1_alarm.dev_attr.attr, | ||
603 | &sensor_dev_attr_fan2_alarm.dev_attr.attr, | ||
604 | &sensor_dev_attr_fan3_alarm.dev_attr.attr, | ||
605 | &sensor_dev_attr_temp1_alarm.dev_attr.attr, | ||
606 | &sensor_dev_attr_temp2_alarm.dev_attr.attr, | ||
607 | &sensor_dev_attr_temp3_alarm.dev_attr.attr, | ||
608 | |||
578 | &dev_attr_cpu0_vid.attr, | 609 | &dev_attr_cpu0_vid.attr, |
579 | &dev_attr_vrm.attr, | 610 | &dev_attr_vrm.attr, |
580 | &dev_attr_alarms.attr, | 611 | &dev_attr_alarms.attr, |