aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/pmbus
diff options
context:
space:
mode:
authorGuenter Roeck <guenter.roeck@ericsson.com>2011-09-10 15:59:15 -0400
committerGuenter Roeck <guenter.roeck@ericsson.com>2011-10-24 14:09:42 -0400
commit3d790287c4e6caa8790421737b1cf8f0a6531559 (patch)
tree447422fa83da2a4ca54ad66f9381f1980bf25433 /drivers/hwmon/pmbus
parent4f3a659581cabf1be441d6467b523be914615496 (diff)
hwmon: (pmbus) Add support for TEMP2 peak attributes
At least one PMBus chip supports peak attributes for READ_TEMPERATURE2. Add virtual registers to be able to report it to the user. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
Diffstat (limited to 'drivers/hwmon/pmbus')
-rw-r--r--drivers/hwmon/pmbus/pmbus.h3
-rw-r--r--drivers/hwmon/pmbus/pmbus_core.c45
2 files changed, 43 insertions, 5 deletions
diff --git a/drivers/hwmon/pmbus/pmbus.h b/drivers/hwmon/pmbus/pmbus.h
index cfa912d0f0b0..5d31d1c2c0f5 100644
--- a/drivers/hwmon/pmbus/pmbus.h
+++ b/drivers/hwmon/pmbus/pmbus.h
@@ -168,6 +168,9 @@
168#define PMBUS_VIRT_READ_IOUT_MIN (PMBUS_VIRT_BASE + 19) 168#define PMBUS_VIRT_READ_IOUT_MIN (PMBUS_VIRT_BASE + 19)
169#define PMBUS_VIRT_READ_IOUT_MAX (PMBUS_VIRT_BASE + 20) 169#define PMBUS_VIRT_READ_IOUT_MAX (PMBUS_VIRT_BASE + 20)
170#define PMBUS_VIRT_RESET_IOUT_HISTORY (PMBUS_VIRT_BASE + 21) 170#define PMBUS_VIRT_RESET_IOUT_HISTORY (PMBUS_VIRT_BASE + 21)
171#define PMBUS_VIRT_READ_TEMP2_MIN (PMBUS_VIRT_BASE + 22)
172#define PMBUS_VIRT_READ_TEMP2_MAX (PMBUS_VIRT_BASE + 23)
173#define PMBUS_VIRT_RESET_TEMP2_HISTORY (PMBUS_VIRT_BASE + 24)
171 174
172/* 175/*
173 * CAPABILITY 176 * CAPABILITY
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index f241a4d2cf8f..814ebb198346 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -1401,7 +1401,42 @@ static const struct pmbus_limit_attr temp_limit_attrs[] = {
1401 } 1401 }
1402}; 1402};
1403 1403
1404static const struct pmbus_limit_attr temp_limit_attrs23[] = { 1404static const struct pmbus_limit_attr temp_limit_attrs2[] = {
1405 {
1406 .reg = PMBUS_UT_WARN_LIMIT,
1407 .low = true,
1408 .attr = "min",
1409 .alarm = "min_alarm",
1410 .sbit = PB_TEMP_UT_WARNING,
1411 }, {
1412 .reg = PMBUS_UT_FAULT_LIMIT,
1413 .low = true,
1414 .attr = "lcrit",
1415 .alarm = "lcrit_alarm",
1416 .sbit = PB_TEMP_UT_FAULT,
1417 }, {
1418 .reg = PMBUS_OT_WARN_LIMIT,
1419 .attr = "max",
1420 .alarm = "max_alarm",
1421 .sbit = PB_TEMP_OT_WARNING,
1422 }, {
1423 .reg = PMBUS_OT_FAULT_LIMIT,
1424 .attr = "crit",
1425 .alarm = "crit_alarm",
1426 .sbit = PB_TEMP_OT_FAULT,
1427 }, {
1428 .reg = PMBUS_VIRT_READ_TEMP2_MIN,
1429 .attr = "lowest",
1430 }, {
1431 .reg = PMBUS_VIRT_READ_TEMP2_MAX,
1432 .attr = "highest",
1433 }, {
1434 .reg = PMBUS_VIRT_RESET_TEMP2_HISTORY,
1435 .attr = "reset_history",
1436 }
1437};
1438
1439static const struct pmbus_limit_attr temp_limit_attrs3[] = {
1405 { 1440 {
1406 .reg = PMBUS_UT_WARN_LIMIT, 1441 .reg = PMBUS_UT_WARN_LIMIT,
1407 .low = true, 1442 .low = true,
@@ -1450,8 +1485,8 @@ static const struct pmbus_sensor_attr temp_attributes[] = {
1450 .sfunc = PMBUS_HAVE_STATUS_TEMP, 1485 .sfunc = PMBUS_HAVE_STATUS_TEMP,
1451 .sbase = PB_STATUS_TEMP_BASE, 1486 .sbase = PB_STATUS_TEMP_BASE,
1452 .gbit = PB_STATUS_TEMPERATURE, 1487 .gbit = PB_STATUS_TEMPERATURE,
1453 .limit = temp_limit_attrs23, 1488 .limit = temp_limit_attrs2,
1454 .nlimit = ARRAY_SIZE(temp_limit_attrs23), 1489 .nlimit = ARRAY_SIZE(temp_limit_attrs2),
1455 }, { 1490 }, {
1456 .reg = PMBUS_READ_TEMPERATURE_3, 1491 .reg = PMBUS_READ_TEMPERATURE_3,
1457 .class = PSC_TEMPERATURE, 1492 .class = PSC_TEMPERATURE,
@@ -1462,8 +1497,8 @@ static const struct pmbus_sensor_attr temp_attributes[] = {
1462 .sfunc = PMBUS_HAVE_STATUS_TEMP, 1497 .sfunc = PMBUS_HAVE_STATUS_TEMP,
1463 .sbase = PB_STATUS_TEMP_BASE, 1498 .sbase = PB_STATUS_TEMP_BASE,
1464 .gbit = PB_STATUS_TEMPERATURE, 1499 .gbit = PB_STATUS_TEMPERATURE,
1465 .limit = temp_limit_attrs23, 1500 .limit = temp_limit_attrs3,
1466 .nlimit = ARRAY_SIZE(temp_limit_attrs23), 1501 .nlimit = ARRAY_SIZE(temp_limit_attrs3),
1467 } 1502 }
1468}; 1503};
1469 1504