aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/hwmon/it873
-rw-r--r--drivers/hwmon/it87.c29
2 files changed, 31 insertions, 1 deletions
diff --git a/Documentation/hwmon/it87 b/Documentation/hwmon/it87
index 38425f0f2645..6f496a586732 100644
--- a/Documentation/hwmon/it87
+++ b/Documentation/hwmon/it87
@@ -76,7 +76,8 @@ IT8718F, IT8720F, IT8721F, IT8726F, IT8758E and SiS950 chips.
76These chips are 'Super I/O chips', supporting floppy disks, infrared ports, 76These chips are 'Super I/O chips', supporting floppy disks, infrared ports,
77joysticks and other miscellaneous stuff. For hardware monitoring, they 77joysticks and other miscellaneous stuff. For hardware monitoring, they
78include an 'environment controller' with 3 temperature sensors, 3 fan 78include an 'environment controller' with 3 temperature sensors, 3 fan
79rotation speed sensors, 8 voltage sensors, and associated alarms. 79rotation speed sensors, 8 voltage sensors, associated alarms, and chassis
80intrusion detection.
80 81
81The IT8712F and IT8716F additionally feature VID inputs, used to report 82The IT8712F and IT8716F additionally feature VID inputs, used to report
82the Vcore voltage of the processor. The early IT8712F have 5 VID pins, 83the Vcore voltage of the processor. The early IT8712F have 5 VID pins,
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index 5f5247750430..d912649fac50 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -1172,6 +1172,32 @@ static ssize_t show_alarm(struct device *dev, struct device_attribute *attr,
1172 struct it87_data *data = it87_update_device(dev); 1172 struct it87_data *data = it87_update_device(dev);
1173 return sprintf(buf, "%u\n", (data->alarms >> bitnr) & 1); 1173 return sprintf(buf, "%u\n", (data->alarms >> bitnr) & 1);
1174} 1174}
1175
1176static ssize_t clear_intrusion(struct device *dev, struct device_attribute
1177 *attr, const char *buf, size_t count)
1178{
1179 struct it87_data *data = dev_get_drvdata(dev);
1180 long val;
1181 int config;
1182
1183 if (strict_strtol(buf, 10, &val) < 0 || val != 0)
1184 return -EINVAL;
1185
1186 mutex_lock(&data->update_lock);
1187 config = it87_read_value(data, IT87_REG_CONFIG);
1188 if (config < 0) {
1189 count = config;
1190 } else {
1191 config |= 1 << 5;
1192 it87_write_value(data, IT87_REG_CONFIG, config);
1193 /* Invalidate cache to force re-read */
1194 data->valid = 0;
1195 }
1196 mutex_unlock(&data->update_lock);
1197
1198 return count;
1199}
1200
1175static SENSOR_DEVICE_ATTR(in0_alarm, S_IRUGO, show_alarm, NULL, 8); 1201static SENSOR_DEVICE_ATTR(in0_alarm, S_IRUGO, show_alarm, NULL, 8);
1176static SENSOR_DEVICE_ATTR(in1_alarm, S_IRUGO, show_alarm, NULL, 9); 1202static SENSOR_DEVICE_ATTR(in1_alarm, S_IRUGO, show_alarm, NULL, 9);
1177static SENSOR_DEVICE_ATTR(in2_alarm, S_IRUGO, show_alarm, NULL, 10); 1203static SENSOR_DEVICE_ATTR(in2_alarm, S_IRUGO, show_alarm, NULL, 10);
@@ -1188,6 +1214,8 @@ static SENSOR_DEVICE_ATTR(fan5_alarm, S_IRUGO, show_alarm, NULL, 6);
1188static SENSOR_DEVICE_ATTR(temp1_alarm, S_IRUGO, show_alarm, NULL, 16); 1214static SENSOR_DEVICE_ATTR(temp1_alarm, S_IRUGO, show_alarm, NULL, 16);
1189static SENSOR_DEVICE_ATTR(temp2_alarm, S_IRUGO, show_alarm, NULL, 17); 1215static SENSOR_DEVICE_ATTR(temp2_alarm, S_IRUGO, show_alarm, NULL, 17);
1190static SENSOR_DEVICE_ATTR(temp3_alarm, S_IRUGO, show_alarm, NULL, 18); 1216static SENSOR_DEVICE_ATTR(temp3_alarm, S_IRUGO, show_alarm, NULL, 18);
1217static SENSOR_DEVICE_ATTR(intrusion0_alarm, S_IRUGO | S_IWUSR,
1218 show_alarm, clear_intrusion, 4);
1191 1219
1192static ssize_t show_beep(struct device *dev, struct device_attribute *attr, 1220static ssize_t show_beep(struct device *dev, struct device_attribute *attr,
1193 char *buf) 1221 char *buf)
@@ -1350,6 +1378,7 @@ static struct attribute *it87_attributes[] = {
1350 &sensor_dev_attr_temp3_alarm.dev_attr.attr, 1378 &sensor_dev_attr_temp3_alarm.dev_attr.attr,
1351 1379
1352 &dev_attr_alarms.attr, 1380 &dev_attr_alarms.attr,
1381 &sensor_dev_attr_intrusion0_alarm.dev_attr.attr,
1353 &dev_attr_name.attr, 1382 &dev_attr_name.attr,
1354 NULL 1383 NULL
1355}; 1384};