diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-07 19:15:38 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-07 19:15:38 -0800 |
commit | d7511ec8115487ccea2ce93bf58d5e5cd2c1c0a3 (patch) | |
tree | e428f9438a563f1fa77479e9c9c4ef8b2e451a8b /drivers/hwmon/lm77.c | |
parent | 0b61a2ba5dfd1620731e717d686e6ade657fd975 (diff) | |
parent | e84542f5db655d1ce7b4890832f0e5d19aae965d (diff) | |
download | kernel-crypto-d7511ec8115487ccea2ce93bf58d5e5cd2c1c0a3.tar.gz kernel-crypto-d7511ec8115487ccea2ce93bf58d5e5cd2c1c0a3.tar.xz kernel-crypto-d7511ec8115487ccea2ce93bf58d5e5cd2c1c0a3.zip |
Merge branch 'release' of git://lm-sensors.org/kernel/mhoffman/hwmon-2.6
* 'release' of git://lm-sensors.org/kernel/mhoffman/hwmon-2.6: (59 commits)
hwmon: (lm80) Add individual alarm files
hwmon: (lm80) De-macro the sysfs callbacks
hwmon: (lm80) Various cleanups
hwmon: (w83627hf) Refactor beep enable handling
hwmon: (w83627hf) Add individual alarm and beep files
hwmon: (w83627hf) Enable VBAT monitoring
hwmon: (w83627ehf) The W83627DHG has 8 VID pins
hwmon: (asb100) Add individual alarm files
hwmon: (asb100) De-macro the sysfs callbacks
hwmon: (asb100) Various cleanups
hwmon: VRM is not written to registers
hwmon: (dme1737) fix Super-IO device ID override
hwmon: (dme1737) fix divide-by-0
hwmon: (abituguru3) Add AUX4 fan input for Abit IP35 Pro
hwmon: Add support for Texas Instruments/Burr-Brown ADS7828
hwmon: (adm9240) Add individual alarm files
hwmon: (lm77) Add individual alarm files
hwmon: Discard useless I2C driver IDs
hwmon: (lm85) Make the pwmN_enable files writable
hwmon: (lm85) Return standard values in pwmN_enable
...
Diffstat (limited to 'drivers/hwmon/lm77.c')
-rw-r--r-- | drivers/hwmon/lm77.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/hwmon/lm77.c b/drivers/hwmon/lm77.c index cee5c2e8cfa..459b70ad6be 100644 --- a/drivers/hwmon/lm77.c +++ b/drivers/hwmon/lm77.c @@ -31,6 +31,7 @@ #include <linux/jiffies.h> #include <linux/i2c.h> #include <linux/hwmon.h> +#include <linux/hwmon-sysfs.h> #include <linux/err.h> #include <linux/mutex.h> @@ -113,7 +114,6 @@ show(temp_input); show(temp_crit); show(temp_min); show(temp_max); -show(alarms); /* read routines for hysteresis values */ static ssize_t show_temp_crit_hyst(struct device *dev, struct device_attribute *attr, char *buf) @@ -186,6 +186,14 @@ static ssize_t set_temp_crit(struct device *dev, struct device_attribute *attr, return count; } +static ssize_t show_alarm(struct device *dev, struct device_attribute *attr, + char *buf) +{ + int bitnr = to_sensor_dev_attr(attr)->index; + struct lm77_data *data = lm77_update_device(dev); + return sprintf(buf, "%u\n", (data->alarms >> bitnr) & 1); +} + static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp_input, NULL); static DEVICE_ATTR(temp1_crit, S_IWUSR | S_IRUGO, @@ -202,8 +210,9 @@ static DEVICE_ATTR(temp1_min_hyst, S_IRUGO, static DEVICE_ATTR(temp1_max_hyst, S_IRUGO, show_temp_max_hyst, NULL); -static DEVICE_ATTR(alarms, S_IRUGO, - show_alarms, NULL); +static SENSOR_DEVICE_ATTR(temp1_crit_alarm, S_IRUGO, show_alarm, NULL, 2); +static SENSOR_DEVICE_ATTR(temp1_min_alarm, S_IRUGO, show_alarm, NULL, 0); +static SENSOR_DEVICE_ATTR(temp1_max_alarm, S_IRUGO, show_alarm, NULL, 1); static int lm77_attach_adapter(struct i2c_adapter *adapter) { @@ -220,8 +229,9 @@ static struct attribute *lm77_attributes[] = { &dev_attr_temp1_crit_hyst.attr, &dev_attr_temp1_min_hyst.attr, &dev_attr_temp1_max_hyst.attr, - &dev_attr_alarms.attr, - + &sensor_dev_attr_temp1_crit_alarm.dev_attr.attr, + &sensor_dev_attr_temp1_min_alarm.dev_attr.attr, + &sensor_dev_attr_temp1_max_alarm.dev_attr.attr, NULL }; |