aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2007-11-29 17:45:22 -0500
committerMark M. Hoffman <mhoffman@lightlink.com>2008-02-07 20:39:42 -0500
commita9273cb8eea503f6b8e28bd5f613962ecba278c5 (patch)
tree3a8723a095c4e8d1a608e074a913d849d62d4626 /drivers
parent0124dd78e28eec6c030f8d02929e81f05e1ce4e6 (diff)
hwmon: (adm1026) Add individual alarm files
The new libsensors needs these. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hwmon/adm1026.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/drivers/hwmon/adm1026.c b/drivers/hwmon/adm1026.c
index 3e63c1486770..69b7bc411c1f 100644
--- a/drivers/hwmon/adm1026.c
+++ b/drivers/hwmon/adm1026.c
@@ -1244,6 +1244,43 @@ static ssize_t show_alarms_reg(struct device *dev, struct device_attribute *attr
1244 1244
1245static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL); 1245static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL);
1246 1246
1247static ssize_t show_alarm(struct device *dev, struct device_attribute *attr,
1248 char *buf)
1249{
1250 struct adm1026_data *data = adm1026_update_device(dev);
1251 int bitnr = to_sensor_dev_attr(attr)->index;
1252 return sprintf(buf, "%ld\n", (data->alarms >> bitnr) & 1);
1253}
1254
1255static SENSOR_DEVICE_ATTR(temp2_alarm, S_IRUGO, show_alarm, NULL, 0);
1256static SENSOR_DEVICE_ATTR(temp3_alarm, S_IRUGO, show_alarm, NULL, 1);
1257static SENSOR_DEVICE_ATTR(in9_alarm, S_IRUGO, show_alarm, NULL, 1);
1258static SENSOR_DEVICE_ATTR(in11_alarm, S_IRUGO, show_alarm, NULL, 2);
1259static SENSOR_DEVICE_ATTR(in12_alarm, S_IRUGO, show_alarm, NULL, 3);
1260static SENSOR_DEVICE_ATTR(in13_alarm, S_IRUGO, show_alarm, NULL, 4);
1261static SENSOR_DEVICE_ATTR(in14_alarm, S_IRUGO, show_alarm, NULL, 5);
1262static SENSOR_DEVICE_ATTR(in15_alarm, S_IRUGO, show_alarm, NULL, 6);
1263static SENSOR_DEVICE_ATTR(in16_alarm, S_IRUGO, show_alarm, NULL, 7);
1264static SENSOR_DEVICE_ATTR(in0_alarm, S_IRUGO, show_alarm, NULL, 8);
1265static SENSOR_DEVICE_ATTR(in1_alarm, S_IRUGO, show_alarm, NULL, 9);
1266static SENSOR_DEVICE_ATTR(in2_alarm, S_IRUGO, show_alarm, NULL, 10);
1267static SENSOR_DEVICE_ATTR(in3_alarm, S_IRUGO, show_alarm, NULL, 11);
1268static SENSOR_DEVICE_ATTR(in4_alarm, S_IRUGO, show_alarm, NULL, 12);
1269static SENSOR_DEVICE_ATTR(in5_alarm, S_IRUGO, show_alarm, NULL, 13);
1270static SENSOR_DEVICE_ATTR(in6_alarm, S_IRUGO, show_alarm, NULL, 14);
1271static SENSOR_DEVICE_ATTR(in7_alarm, S_IRUGO, show_alarm, NULL, 15);
1272static SENSOR_DEVICE_ATTR(fan1_alarm, S_IRUGO, show_alarm, NULL, 16);
1273static SENSOR_DEVICE_ATTR(fan2_alarm, S_IRUGO, show_alarm, NULL, 17);
1274static SENSOR_DEVICE_ATTR(fan3_alarm, S_IRUGO, show_alarm, NULL, 18);
1275static SENSOR_DEVICE_ATTR(fan4_alarm, S_IRUGO, show_alarm, NULL, 19);
1276static SENSOR_DEVICE_ATTR(fan5_alarm, S_IRUGO, show_alarm, NULL, 20);
1277static SENSOR_DEVICE_ATTR(fan6_alarm, S_IRUGO, show_alarm, NULL, 21);
1278static SENSOR_DEVICE_ATTR(fan7_alarm, S_IRUGO, show_alarm, NULL, 22);
1279static SENSOR_DEVICE_ATTR(fan8_alarm, S_IRUGO, show_alarm, NULL, 23);
1280static SENSOR_DEVICE_ATTR(temp1_alarm, S_IRUGO, show_alarm, NULL, 24);
1281static SENSOR_DEVICE_ATTR(in10_alarm, S_IRUGO, show_alarm, NULL, 25);
1282static SENSOR_DEVICE_ATTR(in8_alarm, S_IRUGO, show_alarm, NULL, 26);
1283
1247static ssize_t show_alarm_mask(struct device *dev, struct device_attribute *attr, char *buf) 1284static ssize_t show_alarm_mask(struct device *dev, struct device_attribute *attr, char *buf)
1248{ 1285{
1249 struct adm1026_data *data = adm1026_update_device(dev); 1286 struct adm1026_data *data = adm1026_update_device(dev);
@@ -1444,87 +1481,115 @@ static struct attribute *adm1026_attributes[] = {
1444 &sensor_dev_attr_in0_input.dev_attr.attr, 1481 &sensor_dev_attr_in0_input.dev_attr.attr,
1445 &sensor_dev_attr_in0_max.dev_attr.attr, 1482 &sensor_dev_attr_in0_max.dev_attr.attr,
1446 &sensor_dev_attr_in0_min.dev_attr.attr, 1483 &sensor_dev_attr_in0_min.dev_attr.attr,
1484 &sensor_dev_attr_in0_alarm.dev_attr.attr,
1447 &sensor_dev_attr_in1_input.dev_attr.attr, 1485 &sensor_dev_attr_in1_input.dev_attr.attr,
1448 &sensor_dev_attr_in1_max.dev_attr.attr, 1486 &sensor_dev_attr_in1_max.dev_attr.attr,
1449 &sensor_dev_attr_in1_min.dev_attr.attr, 1487 &sensor_dev_attr_in1_min.dev_attr.attr,
1488 &sensor_dev_attr_in1_alarm.dev_attr.attr,
1450 &sensor_dev_attr_in2_input.dev_attr.attr, 1489 &sensor_dev_attr_in2_input.dev_attr.attr,
1451 &sensor_dev_attr_in2_max.dev_attr.attr, 1490 &sensor_dev_attr_in2_max.dev_attr.attr,
1452 &sensor_dev_attr_in2_min.dev_attr.attr, 1491 &sensor_dev_attr_in2_min.dev_attr.attr,
1492 &sensor_dev_attr_in2_alarm.dev_attr.attr,
1453 &sensor_dev_attr_in3_input.dev_attr.attr, 1493 &sensor_dev_attr_in3_input.dev_attr.attr,
1454 &sensor_dev_attr_in3_max.dev_attr.attr, 1494 &sensor_dev_attr_in3_max.dev_attr.attr,
1455 &sensor_dev_attr_in3_min.dev_attr.attr, 1495 &sensor_dev_attr_in3_min.dev_attr.attr,
1496 &sensor_dev_attr_in3_alarm.dev_attr.attr,
1456 &sensor_dev_attr_in4_input.dev_attr.attr, 1497 &sensor_dev_attr_in4_input.dev_attr.attr,
1457 &sensor_dev_attr_in4_max.dev_attr.attr, 1498 &sensor_dev_attr_in4_max.dev_attr.attr,
1458 &sensor_dev_attr_in4_min.dev_attr.attr, 1499 &sensor_dev_attr_in4_min.dev_attr.attr,
1500 &sensor_dev_attr_in4_alarm.dev_attr.attr,
1459 &sensor_dev_attr_in5_input.dev_attr.attr, 1501 &sensor_dev_attr_in5_input.dev_attr.attr,
1460 &sensor_dev_attr_in5_max.dev_attr.attr, 1502 &sensor_dev_attr_in5_max.dev_attr.attr,
1461 &sensor_dev_attr_in5_min.dev_attr.attr, 1503 &sensor_dev_attr_in5_min.dev_attr.attr,
1504 &sensor_dev_attr_in5_alarm.dev_attr.attr,
1462 &sensor_dev_attr_in6_input.dev_attr.attr, 1505 &sensor_dev_attr_in6_input.dev_attr.attr,
1463 &sensor_dev_attr_in6_max.dev_attr.attr, 1506 &sensor_dev_attr_in6_max.dev_attr.attr,
1464 &sensor_dev_attr_in6_min.dev_attr.attr, 1507 &sensor_dev_attr_in6_min.dev_attr.attr,
1508 &sensor_dev_attr_in6_alarm.dev_attr.attr,
1465 &sensor_dev_attr_in7_input.dev_attr.attr, 1509 &sensor_dev_attr_in7_input.dev_attr.attr,
1466 &sensor_dev_attr_in7_max.dev_attr.attr, 1510 &sensor_dev_attr_in7_max.dev_attr.attr,
1467 &sensor_dev_attr_in7_min.dev_attr.attr, 1511 &sensor_dev_attr_in7_min.dev_attr.attr,
1512 &sensor_dev_attr_in7_alarm.dev_attr.attr,
1468 &sensor_dev_attr_in8_input.dev_attr.attr, 1513 &sensor_dev_attr_in8_input.dev_attr.attr,
1469 &sensor_dev_attr_in8_max.dev_attr.attr, 1514 &sensor_dev_attr_in8_max.dev_attr.attr,
1470 &sensor_dev_attr_in8_min.dev_attr.attr, 1515 &sensor_dev_attr_in8_min.dev_attr.attr,
1516 &sensor_dev_attr_in8_alarm.dev_attr.attr,
1471 &sensor_dev_attr_in9_input.dev_attr.attr, 1517 &sensor_dev_attr_in9_input.dev_attr.attr,
1472 &sensor_dev_attr_in9_max.dev_attr.attr, 1518 &sensor_dev_attr_in9_max.dev_attr.attr,
1473 &sensor_dev_attr_in9_min.dev_attr.attr, 1519 &sensor_dev_attr_in9_min.dev_attr.attr,
1520 &sensor_dev_attr_in9_alarm.dev_attr.attr,
1474 &sensor_dev_attr_in10_input.dev_attr.attr, 1521 &sensor_dev_attr_in10_input.dev_attr.attr,
1475 &sensor_dev_attr_in10_max.dev_attr.attr, 1522 &sensor_dev_attr_in10_max.dev_attr.attr,
1476 &sensor_dev_attr_in10_min.dev_attr.attr, 1523 &sensor_dev_attr_in10_min.dev_attr.attr,
1524 &sensor_dev_attr_in10_alarm.dev_attr.attr,
1477 &sensor_dev_attr_in11_input.dev_attr.attr, 1525 &sensor_dev_attr_in11_input.dev_attr.attr,
1478 &sensor_dev_attr_in11_max.dev_attr.attr, 1526 &sensor_dev_attr_in11_max.dev_attr.attr,
1479 &sensor_dev_attr_in11_min.dev_attr.attr, 1527 &sensor_dev_attr_in11_min.dev_attr.attr,
1528 &sensor_dev_attr_in11_alarm.dev_attr.attr,
1480 &sensor_dev_attr_in12_input.dev_attr.attr, 1529 &sensor_dev_attr_in12_input.dev_attr.attr,
1481 &sensor_dev_attr_in12_max.dev_attr.attr, 1530 &sensor_dev_attr_in12_max.dev_attr.attr,
1482 &sensor_dev_attr_in12_min.dev_attr.attr, 1531 &sensor_dev_attr_in12_min.dev_attr.attr,
1532 &sensor_dev_attr_in12_alarm.dev_attr.attr,
1483 &sensor_dev_attr_in13_input.dev_attr.attr, 1533 &sensor_dev_attr_in13_input.dev_attr.attr,
1484 &sensor_dev_attr_in13_max.dev_attr.attr, 1534 &sensor_dev_attr_in13_max.dev_attr.attr,
1485 &sensor_dev_attr_in13_min.dev_attr.attr, 1535 &sensor_dev_attr_in13_min.dev_attr.attr,
1536 &sensor_dev_attr_in13_alarm.dev_attr.attr,
1486 &sensor_dev_attr_in14_input.dev_attr.attr, 1537 &sensor_dev_attr_in14_input.dev_attr.attr,
1487 &sensor_dev_attr_in14_max.dev_attr.attr, 1538 &sensor_dev_attr_in14_max.dev_attr.attr,
1488 &sensor_dev_attr_in14_min.dev_attr.attr, 1539 &sensor_dev_attr_in14_min.dev_attr.attr,
1540 &sensor_dev_attr_in14_alarm.dev_attr.attr,
1489 &sensor_dev_attr_in15_input.dev_attr.attr, 1541 &sensor_dev_attr_in15_input.dev_attr.attr,
1490 &sensor_dev_attr_in15_max.dev_attr.attr, 1542 &sensor_dev_attr_in15_max.dev_attr.attr,
1491 &sensor_dev_attr_in15_min.dev_attr.attr, 1543 &sensor_dev_attr_in15_min.dev_attr.attr,
1544 &sensor_dev_attr_in15_alarm.dev_attr.attr,
1492 &sensor_dev_attr_in16_input.dev_attr.attr, 1545 &sensor_dev_attr_in16_input.dev_attr.attr,
1493 &sensor_dev_attr_in16_max.dev_attr.attr, 1546 &sensor_dev_attr_in16_max.dev_attr.attr,
1494 &sensor_dev_attr_in16_min.dev_attr.attr, 1547 &sensor_dev_attr_in16_min.dev_attr.attr,
1548 &sensor_dev_attr_in16_alarm.dev_attr.attr,
1495 &sensor_dev_attr_fan1_input.dev_attr.attr, 1549 &sensor_dev_attr_fan1_input.dev_attr.attr,
1496 &sensor_dev_attr_fan1_div.dev_attr.attr, 1550 &sensor_dev_attr_fan1_div.dev_attr.attr,
1497 &sensor_dev_attr_fan1_min.dev_attr.attr, 1551 &sensor_dev_attr_fan1_min.dev_attr.attr,
1552 &sensor_dev_attr_fan1_alarm.dev_attr.attr,
1498 &sensor_dev_attr_fan2_input.dev_attr.attr, 1553 &sensor_dev_attr_fan2_input.dev_attr.attr,
1499 &sensor_dev_attr_fan2_div.dev_attr.attr, 1554 &sensor_dev_attr_fan2_div.dev_attr.attr,
1500 &sensor_dev_attr_fan2_min.dev_attr.attr, 1555 &sensor_dev_attr_fan2_min.dev_attr.attr,
1556 &sensor_dev_attr_fan2_alarm.dev_attr.attr,
1501 &sensor_dev_attr_fan3_input.dev_attr.attr, 1557 &sensor_dev_attr_fan3_input.dev_attr.attr,
1502 &sensor_dev_attr_fan3_div.dev_attr.attr, 1558 &sensor_dev_attr_fan3_div.dev_attr.attr,
1503 &sensor_dev_attr_fan3_min.dev_attr.attr, 1559 &sensor_dev_attr_fan3_min.dev_attr.attr,
1560 &sensor_dev_attr_fan3_alarm.dev_attr.attr,
1504 &sensor_dev_attr_fan4_input.dev_attr.attr, 1561 &sensor_dev_attr_fan4_input.dev_attr.attr,
1505 &sensor_dev_attr_fan4_div.dev_attr.attr, 1562 &sensor_dev_attr_fan4_div.dev_attr.attr,
1506 &sensor_dev_attr_fan4_min.dev_attr.attr, 1563 &sensor_dev_attr_fan4_min.dev_attr.attr,
1564 &sensor_dev_attr_fan4_alarm.dev_attr.attr,
1507 &sensor_dev_attr_fan5_input.dev_attr.attr, 1565 &sensor_dev_attr_fan5_input.dev_attr.attr,
1508 &sensor_dev_attr_fan5_div.dev_attr.attr, 1566 &sensor_dev_attr_fan5_div.dev_attr.attr,
1509 &sensor_dev_attr_fan5_min.dev_attr.attr, 1567 &sensor_dev_attr_fan5_min.dev_attr.attr,
1568 &sensor_dev_attr_fan5_alarm.dev_attr.attr,
1510 &sensor_dev_attr_fan6_input.dev_attr.attr, 1569 &sensor_dev_attr_fan6_input.dev_attr.attr,
1511 &sensor_dev_attr_fan6_div.dev_attr.attr, 1570 &sensor_dev_attr_fan6_div.dev_attr.attr,
1512 &sensor_dev_attr_fan6_min.dev_attr.attr, 1571 &sensor_dev_attr_fan6_min.dev_attr.attr,
1572 &sensor_dev_attr_fan6_alarm.dev_attr.attr,
1513 &sensor_dev_attr_fan7_input.dev_attr.attr, 1573 &sensor_dev_attr_fan7_input.dev_attr.attr,
1514 &sensor_dev_attr_fan7_div.dev_attr.attr, 1574 &sensor_dev_attr_fan7_div.dev_attr.attr,
1515 &sensor_dev_attr_fan7_min.dev_attr.attr, 1575 &sensor_dev_attr_fan7_min.dev_attr.attr,
1576 &sensor_dev_attr_fan7_alarm.dev_attr.attr,
1516 &sensor_dev_attr_fan8_input.dev_attr.attr, 1577 &sensor_dev_attr_fan8_input.dev_attr.attr,
1517 &sensor_dev_attr_fan8_div.dev_attr.attr, 1578 &sensor_dev_attr_fan8_div.dev_attr.attr,
1518 &sensor_dev_attr_fan8_min.dev_attr.attr, 1579 &sensor_dev_attr_fan8_min.dev_attr.attr,
1580 &sensor_dev_attr_fan8_alarm.dev_attr.attr,
1519 &sensor_dev_attr_temp1_input.dev_attr.attr, 1581 &sensor_dev_attr_temp1_input.dev_attr.attr,
1520 &sensor_dev_attr_temp1_max.dev_attr.attr, 1582 &sensor_dev_attr_temp1_max.dev_attr.attr,
1521 &sensor_dev_attr_temp1_min.dev_attr.attr, 1583 &sensor_dev_attr_temp1_min.dev_attr.attr,
1584 &sensor_dev_attr_temp1_alarm.dev_attr.attr,
1522 &sensor_dev_attr_temp2_input.dev_attr.attr, 1585 &sensor_dev_attr_temp2_input.dev_attr.attr,
1523 &sensor_dev_attr_temp2_max.dev_attr.attr, 1586 &sensor_dev_attr_temp2_max.dev_attr.attr,
1524 &sensor_dev_attr_temp2_min.dev_attr.attr, 1587 &sensor_dev_attr_temp2_min.dev_attr.attr,
1588 &sensor_dev_attr_temp2_alarm.dev_attr.attr,
1525 &sensor_dev_attr_temp3_input.dev_attr.attr, 1589 &sensor_dev_attr_temp3_input.dev_attr.attr,
1526 &sensor_dev_attr_temp3_max.dev_attr.attr, 1590 &sensor_dev_attr_temp3_max.dev_attr.attr,
1527 &sensor_dev_attr_temp3_min.dev_attr.attr, 1591 &sensor_dev_attr_temp3_min.dev_attr.attr,
1592 &sensor_dev_attr_temp3_alarm.dev_attr.attr,
1528 &sensor_dev_attr_temp1_offset.dev_attr.attr, 1593 &sensor_dev_attr_temp1_offset.dev_attr.attr,
1529 &sensor_dev_attr_temp2_offset.dev_attr.attr, 1594 &sensor_dev_attr_temp2_offset.dev_attr.attr,
1530 &sensor_dev_attr_temp3_offset.dev_attr.attr, 1595 &sensor_dev_attr_temp3_offset.dev_attr.attr,