diff options
author | Jean Delvare <khali@linux-fr.org> | 2010-10-28 14:31:49 -0400 |
---|---|---|
committer | Jean Delvare <khali@endymion.delvare> | 2010-10-28 14:31:49 -0400 |
commit | 24377101023d3c66136123bd8b20441814da6a90 (patch) | |
tree | 62ab04c9bfa0e0e71408bd5ac754aad1d152a1c3 /drivers/hwmon/w83795.c | |
parent | 00030af23153f1958f015df8b9fec8c29fcca8b8 (diff) |
hwmon: (w83795) Use standard attributes for chassis intrusion
Follow the standard attribute naming for the chassis intrusion
feature. I couldn't test the beeping (my board apparently doesn't do
that) but the alarm works fine.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Diffstat (limited to 'drivers/hwmon/w83795.c')
-rw-r--r-- | drivers/hwmon/w83795.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/hwmon/w83795.c b/drivers/hwmon/w83795.c index c461e753f9bf..1d840aa83782 100644 --- a/drivers/hwmon/w83795.c +++ b/drivers/hwmon/w83795.c | |||
@@ -713,7 +713,7 @@ store_beep(struct device *dev, struct device_attribute *attr, | |||
713 | return count; | 713 | return count; |
714 | } | 714 | } |
715 | 715 | ||
716 | /* Write any value to clear chassis alarm */ | 716 | /* Write 0 to clear chassis alarm */ |
717 | static ssize_t | 717 | static ssize_t |
718 | store_chassis_clear(struct device *dev, | 718 | store_chassis_clear(struct device *dev, |
719 | struct device_attribute *attr, const char *buf, | 719 | struct device_attribute *attr, const char *buf, |
@@ -721,7 +721,10 @@ store_chassis_clear(struct device *dev, | |||
721 | { | 721 | { |
722 | struct i2c_client *client = to_i2c_client(dev); | 722 | struct i2c_client *client = to_i2c_client(dev); |
723 | struct w83795_data *data = i2c_get_clientdata(client); | 723 | struct w83795_data *data = i2c_get_clientdata(client); |
724 | u8 val; | 724 | unsigned long val; |
725 | |||
726 | if (strict_strtoul(buf, 10, &val) < 0 || val != 0) | ||
727 | return -EINVAL; | ||
725 | 728 | ||
726 | mutex_lock(&data->update_lock); | 729 | mutex_lock(&data->update_lock); |
727 | val = w83795_read(client, W83795_REG_CLR_CHASSIS); | 730 | val = w83795_read(client, W83795_REG_CLR_CHASSIS); |
@@ -1709,8 +1712,10 @@ static const struct sensor_device_attribute_2 w83795_pwm[][7] = { | |||
1709 | }; | 1712 | }; |
1710 | 1713 | ||
1711 | static const struct sensor_device_attribute_2 sda_single_files[] = { | 1714 | static const struct sensor_device_attribute_2 sda_single_files[] = { |
1712 | SENSOR_ATTR_2(chassis, S_IWUSR | S_IRUGO, show_alarm_beep, | 1715 | SENSOR_ATTR_2(intrusion0_alarm, S_IWUSR | S_IRUGO, show_alarm_beep, |
1713 | store_chassis_clear, ALARM_STATUS, 46), | 1716 | store_chassis_clear, ALARM_STATUS, 46), |
1717 | SENSOR_ATTR_2(intrusion0_beep, S_IWUSR | S_IRUGO, show_alarm_beep, | ||
1718 | store_beep, BEEP_ENABLE, 46), | ||
1714 | SENSOR_ATTR_2(beep_enable, S_IWUSR | S_IRUGO, show_alarm_beep, | 1719 | SENSOR_ATTR_2(beep_enable, S_IWUSR | S_IRUGO, show_alarm_beep, |
1715 | store_beep, BEEP_ENABLE, 47), | 1720 | store_beep, BEEP_ENABLE, 47), |
1716 | #ifdef CONFIG_SENSORS_W83795_FANCTRL | 1721 | #ifdef CONFIG_SENSORS_W83795_FANCTRL |