]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
hwmon: (f71882fg) Separate max and crit alarm and beep
authorHans de Goede <hdegoede@redhat.com>
Wed, 7 Jan 2009 15:37:29 +0000 (16:37 +0100)
committerJean Delvare <khali@linux-fr.org>
Wed, 7 Jan 2009 15:37:29 +0000 (16:37 +0100)
While studying the datasheets for adding F8000 support, I noticed that the
F718x2 has separate alarms (and beep control) for its max and crit limits.

We keep the temp#_alarm attributes as they are, even though it would be more
logical to rename them to temp#_max_alarm. Because lm_sensors v2 depends
on them.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
drivers/hwmon/f71882fg.c

index 03a4f84b4e5cd4df420f9b2f99db045413c6cc3d..95a279f70264e3ebccb3413bf58cf8c880fc6b34 100644 (file)
@@ -270,42 +270,56 @@ static struct sensor_device_attribute_2 f718x2fg_in_temp_attr[] = {
                store_temp_max, 0, 1),
        SENSOR_ATTR_2(temp1_max_hyst, S_IRUGO|S_IWUSR, show_temp_max_hyst,
                store_temp_max_hyst, 0, 1),
+       /* Should really be temp1_max_alarm, but older versions did not handle
+          the max and crit alarms separately and lm_sensors v2 depends on the
+          presence of temp#_alarm files. The same goes for temp2/3 _alarm. */
+       SENSOR_ATTR_2(temp1_alarm, S_IRUGO, show_temp_alarm, NULL, 0, 1),
+       SENSOR_ATTR_2(temp1_max_beep, S_IRUGO|S_IWUSR, show_temp_beep,
+               store_temp_beep, 0, 1),
        SENSOR_ATTR_2(temp1_crit, S_IRUGO|S_IWUSR, show_temp_crit,
                store_temp_crit, 0, 1),
        SENSOR_ATTR_2(temp1_crit_hyst, S_IRUGO, show_temp_crit_hyst, NULL,
                0, 1),
+       SENSOR_ATTR_2(temp1_crit_alarm, S_IRUGO, show_temp_alarm, NULL, 0, 5),
+       SENSOR_ATTR_2(temp1_crit_beep, S_IRUGO|S_IWUSR, show_temp_beep,
+               store_temp_beep, 0, 5),
        SENSOR_ATTR_2(temp1_type, S_IRUGO, show_temp_type, NULL, 0, 1),
-       SENSOR_ATTR_2(temp1_beep, S_IRUGO|S_IWUSR, show_temp_beep,
-               store_temp_beep, 0, 1),
-       SENSOR_ATTR_2(temp1_alarm, S_IRUGO, show_temp_alarm, NULL, 0, 1),
        SENSOR_ATTR_2(temp1_fault, S_IRUGO, show_temp_fault, NULL, 0, 1),
        SENSOR_ATTR_2(temp2_input, S_IRUGO, show_temp, NULL, 0, 2),
        SENSOR_ATTR_2(temp2_max, S_IRUGO|S_IWUSR, show_temp_max,
                store_temp_max, 0, 2),
        SENSOR_ATTR_2(temp2_max_hyst, S_IRUGO|S_IWUSR, show_temp_max_hyst,
                store_temp_max_hyst, 0, 2),
+       /* Should be temp2_max_alarm, see temp1_alarm note */
+       SENSOR_ATTR_2(temp2_alarm, S_IRUGO, show_temp_alarm, NULL, 0, 2),
+       SENSOR_ATTR_2(temp2_max_beep, S_IRUGO|S_IWUSR, show_temp_beep,
+               store_temp_beep, 0, 2),
        SENSOR_ATTR_2(temp2_crit, S_IRUGO|S_IWUSR, show_temp_crit,
                store_temp_crit, 0, 2),
        SENSOR_ATTR_2(temp2_crit_hyst, S_IRUGO, show_temp_crit_hyst, NULL,
                0, 2),
+       SENSOR_ATTR_2(temp2_crit_alarm, S_IRUGO, show_temp_alarm, NULL, 0, 6),
+       SENSOR_ATTR_2(temp2_crit_beep, S_IRUGO|S_IWUSR, show_temp_beep,
+               store_temp_beep, 0, 6),
        SENSOR_ATTR_2(temp2_type, S_IRUGO, show_temp_type, NULL, 0, 2),
-       SENSOR_ATTR_2(temp2_beep, S_IRUGO|S_IWUSR, show_temp_beep,
-               store_temp_beep, 0, 2),
-       SENSOR_ATTR_2(temp2_alarm, S_IRUGO, show_temp_alarm, NULL, 0, 2),
        SENSOR_ATTR_2(temp2_fault, S_IRUGO, show_temp_fault, NULL, 0, 2),
        SENSOR_ATTR_2(temp3_input, S_IRUGO, show_temp, NULL, 0, 3),
        SENSOR_ATTR_2(temp3_max, S_IRUGO|S_IWUSR, show_temp_max,
                store_temp_max, 0, 3),
        SENSOR_ATTR_2(temp3_max_hyst, S_IRUGO|S_IWUSR, show_temp_max_hyst,
                store_temp_max_hyst, 0, 3),
+       /* Should be temp3_max_alarm, see temp1_alarm note */
+       SENSOR_ATTR_2(temp3_alarm, S_IRUGO, show_temp_alarm, NULL, 0, 3),
+       SENSOR_ATTR_2(temp3_max_beep, S_IRUGO|S_IWUSR, show_temp_beep,
+               store_temp_beep, 0, 3),
        SENSOR_ATTR_2(temp3_crit, S_IRUGO|S_IWUSR, show_temp_crit,
                store_temp_crit, 0, 3),
        SENSOR_ATTR_2(temp3_crit_hyst, S_IRUGO, show_temp_crit_hyst, NULL,
                0, 3),
+       SENSOR_ATTR_2(temp3_crit_alarm, S_IRUGO, show_temp_alarm, NULL, 0, 7),
+       SENSOR_ATTR_2(temp3_crit_beep, S_IRUGO|S_IWUSR, show_temp_beep,
+               store_temp_beep, 0, 7),
        SENSOR_ATTR_2(temp3_type, S_IRUGO, show_temp_type, NULL, 0, 3),
-       SENSOR_ATTR_2(temp3_beep, S_IRUGO|S_IWUSR, show_temp_beep,
-               store_temp_beep, 0, 3),
-       SENSOR_ATTR_2(temp3_alarm, S_IRUGO, show_temp_alarm, NULL, 0, 3),
        SENSOR_ATTR_2(temp3_fault, S_IRUGO, show_temp_fault, NULL, 0, 3),
 };