Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=739ba2486e8444b27a3ec975205798ef17def963
Commit:     739ba2486e8444b27a3ec975205798ef17def963
Parent:     a8d6646e24fa72de38de5838df8bd1f21af59710
Author:     Krzysztof Helt <[EMAIL PROTECTED]>
AuthorDate: Sun Sep 9 19:16:03 2007 +0200
Committer:  Mark M. Hoffman <[EMAIL PROTECTED]>
CommitDate: Tue Oct 9 22:56:31 2007 -0400

    hwmon: (adm1021) individual alarm files
    
    This patch converts the driver to individual alarm files
    as required by the new lmsensors library.
    
    Signed-off-by: Krzysztof Helt <[EMAIL PROTECTED]>
    Acked-by: Jean Delvare <[EMAIL PROTECTED]>
    Signed-off-by: Mark M. Hoffman <[EMAIL PROTECTED]>
---
 drivers/hwmon/adm1021.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/drivers/hwmon/adm1021.c b/drivers/hwmon/adm1021.c
index cc40970..ebdc6d7 100644
--- a/drivers/hwmon/adm1021.c
+++ b/drivers/hwmon/adm1021.c
@@ -147,6 +147,14 @@ static ssize_t show_temp_min(struct device *dev,
        return sprintf(buf, "%d\n", 1000 * data->temp_min[index]);
 }
 
+static ssize_t show_alarm(struct device *dev, struct device_attribute *attr,
+                         char *buf)
+{
+       int index = to_sensor_dev_attr(attr)->index;
+       struct adm1021_data *data = adm1021_update_device(dev);
+       return sprintf(buf, "%u\n", (data->alarms >> index) & 1);
+}
+
 static ssize_t show_alarms(struct device *dev,
                           struct device_attribute *attr,
                           char *buf)
@@ -203,6 +211,12 @@ static SENSOR_DEVICE_ATTR(temp2_max, S_IWUSR | S_IRUGO, 
show_temp_max,
                          set_temp_max, 1);
 static SENSOR_DEVICE_ATTR(temp2_min, S_IWUSR | S_IRUGO, show_temp_min,
                          set_temp_min, 1);
+static SENSOR_DEVICE_ATTR(temp1_max_alarm, S_IRUGO, show_alarm, NULL, 6);
+static SENSOR_DEVICE_ATTR(temp1_min_alarm, S_IRUGO, show_alarm, NULL, 5);
+static SENSOR_DEVICE_ATTR(temp2_max_alarm, S_IRUGO, show_alarm, NULL, 4);
+static SENSOR_DEVICE_ATTR(temp2_min_alarm, S_IRUGO, show_alarm, NULL, 3);
+static SENSOR_DEVICE_ATTR(temp2_fault, S_IRUGO, show_alarm, NULL, 2);
+
 static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
 
 static int adm1021_attach_adapter(struct i2c_adapter *adapter)
@@ -219,6 +233,11 @@ static struct attribute *adm1021_attributes[] = {
        &sensor_dev_attr_temp2_max.dev_attr.attr,
        &sensor_dev_attr_temp2_min.dev_attr.attr,
        &sensor_dev_attr_temp2_input.dev_attr.attr,
+       &sensor_dev_attr_temp1_max_alarm.dev_attr.attr,
+       &sensor_dev_attr_temp1_min_alarm.dev_attr.attr,
+       &sensor_dev_attr_temp2_max_alarm.dev_attr.attr,
+       &sensor_dev_attr_temp2_min_alarm.dev_attr.attr,
+       &sensor_dev_attr_temp2_fault.dev_attr.attr,
        &dev_attr_alarms.attr,
        NULL
 };
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to