aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/via686a.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2008-01-06 09:42:04 -0500
committerMark M. Hoffman <mhoffman@lightlink.com>2008-02-17 09:27:18 -0500
commit13ff05e9f87101407445f79c7402aca087ddbd02 (patch)
tree56d4c26d8c41ee2ab0bd60f3407730232fc8ea01 /drivers/hwmon/via686a.c
parent1f08af7ea95e0f4ec632664b9f21a687426df658 (diff)
hwmon: (via686a) Add individual alarm files
The new libsensors needs these individual alarm files. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Juerg Haefliger <juergh at gmail.com> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
Diffstat (limited to 'drivers/hwmon/via686a.c')
-rw-r--r--drivers/hwmon/via686a.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/hwmon/via686a.c b/drivers/hwmon/via686a.c
index 2635bba1e3fc..f1ee5e731968 100644
--- a/drivers/hwmon/via686a.c
+++ b/drivers/hwmon/via686a.c
@@ -533,6 +533,24 @@ static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, ch
533} 533}
534static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); 534static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
535 535
536static ssize_t show_alarm(struct device *dev, struct device_attribute *attr,
537 char *buf)
538{
539 int bitnr = to_sensor_dev_attr(attr)->index;
540 struct via686a_data *data = via686a_update_device(dev);
541 return sprintf(buf, "%u\n", (data->alarms >> bitnr) & 1);
542}
543static SENSOR_DEVICE_ATTR(in0_alarm, S_IRUGO, show_alarm, NULL, 0);
544static SENSOR_DEVICE_ATTR(in1_alarm, S_IRUGO, show_alarm, NULL, 1);
545static SENSOR_DEVICE_ATTR(in2_alarm, S_IRUGO, show_alarm, NULL, 2);
546static SENSOR_DEVICE_ATTR(in3_alarm, S_IRUGO, show_alarm, NULL, 3);
547static SENSOR_DEVICE_ATTR(in4_alarm, S_IRUGO, show_alarm, NULL, 8);
548static SENSOR_DEVICE_ATTR(temp1_alarm, S_IRUGO, show_alarm, NULL, 4);
549static SENSOR_DEVICE_ATTR(temp2_alarm, S_IRUGO, show_alarm, NULL, 11);
550static SENSOR_DEVICE_ATTR(temp3_alarm, S_IRUGO, show_alarm, NULL, 15);
551static SENSOR_DEVICE_ATTR(fan1_alarm, S_IRUGO, show_alarm, NULL, 6);
552static SENSOR_DEVICE_ATTR(fan2_alarm, S_IRUGO, show_alarm, NULL, 7);
553
536static ssize_t show_name(struct device *dev, struct device_attribute 554static ssize_t show_name(struct device *dev, struct device_attribute
537 *devattr, char *buf) 555 *devattr, char *buf)
538{ 556{
@@ -557,6 +575,11 @@ static struct attribute *via686a_attributes[] = {
557 &sensor_dev_attr_in2_max.dev_attr.attr, 575 &sensor_dev_attr_in2_max.dev_attr.attr,
558 &sensor_dev_attr_in3_max.dev_attr.attr, 576 &sensor_dev_attr_in3_max.dev_attr.attr,
559 &sensor_dev_attr_in4_max.dev_attr.attr, 577 &sensor_dev_attr_in4_max.dev_attr.attr,
578 &sensor_dev_attr_in0_alarm.dev_attr.attr,
579 &sensor_dev_attr_in1_alarm.dev_attr.attr,
580 &sensor_dev_attr_in2_alarm.dev_attr.attr,
581 &sensor_dev_attr_in3_alarm.dev_attr.attr,
582 &sensor_dev_attr_in4_alarm.dev_attr.attr,
560 583
561 &sensor_dev_attr_temp1_input.dev_attr.attr, 584 &sensor_dev_attr_temp1_input.dev_attr.attr,
562 &sensor_dev_attr_temp2_input.dev_attr.attr, 585 &sensor_dev_attr_temp2_input.dev_attr.attr,
@@ -567,6 +590,9 @@ static struct attribute *via686a_attributes[] = {
567 &sensor_dev_attr_temp1_max_hyst.dev_attr.attr, 590 &sensor_dev_attr_temp1_max_hyst.dev_attr.attr,
568 &sensor_dev_attr_temp2_max_hyst.dev_attr.attr, 591 &sensor_dev_attr_temp2_max_hyst.dev_attr.attr,
569 &sensor_dev_attr_temp3_max_hyst.dev_attr.attr, 592 &sensor_dev_attr_temp3_max_hyst.dev_attr.attr,
593 &sensor_dev_attr_temp1_alarm.dev_attr.attr,
594 &sensor_dev_attr_temp2_alarm.dev_attr.attr,
595 &sensor_dev_attr_temp3_alarm.dev_attr.attr,
570 596
571 &sensor_dev_attr_fan1_input.dev_attr.attr, 597 &sensor_dev_attr_fan1_input.dev_attr.attr,
572 &sensor_dev_attr_fan2_input.dev_attr.attr, 598 &sensor_dev_attr_fan2_input.dev_attr.attr,
@@ -574,6 +600,8 @@ static struct attribute *via686a_attributes[] = {
574 &sensor_dev_attr_fan2_min.dev_attr.attr, 600 &sensor_dev_attr_fan2_min.dev_attr.attr,
575 &sensor_dev_attr_fan1_div.dev_attr.attr, 601 &sensor_dev_attr_fan1_div.dev_attr.attr,
576 &sensor_dev_attr_fan2_div.dev_attr.attr, 602 &sensor_dev_attr_fan2_div.dev_attr.attr,
603 &sensor_dev_attr_fan1_alarm.dev_attr.attr,
604 &sensor_dev_attr_fan2_alarm.dev_attr.attr,
577 605
578 &dev_attr_alarms.attr, 606 &dev_attr_alarms.attr,
579 &dev_attr_name.attr, 607 &dev_attr_name.attr,