aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>2018-03-22 16:14:00 +0530
committerStewart Smith <stewart@linux.ibm.com>2018-04-11 17:59:57 -0500
commit5954536a2f8c308bb8a396b0bda448fc09040be1 (patch)
tree5a6832c003ba0a7f5d8038363eefa2b692cc54ec
parent9f85e40904d8566acf4d022f47aa8a0f836675bc (diff)
downloadskiboot-5954536a2f8c308bb8a396b0bda448fc09040be1.zip
skiboot-5954536a2f8c308bb8a396b0bda448fc09040be1.tar.gz
skiboot-5954536a2f8c308bb8a396b0bda448fc09040be1.tar.bz2
occ: sensors-groups: Add DT properties to mark HWMON sensor groups
Fix the sensor type to match HWMON sensor types. Add compatible flag to indicate the environmental sensor groups so that operations on these groups can be handled by HWMON linux interface. Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
-rw-r--r--hw/occ.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/hw/occ.c b/hw/occ.c
index 2677640..c89d4d7 100644
--- a/hw/occ.c
+++ b/hw/occ.c
@@ -1590,13 +1590,13 @@ void occ_add_sensor_groups(struct dt_node *sg, u32 *phandles, u32 *ptype,
{ OCC_SENSOR_TYPE_GENERIC, "generic",
OPAL_SENSOR_GROUP_ENABLE
},
- { OCC_SENSOR_TYPE_CURRENT, "current",
+ { OCC_SENSOR_TYPE_CURRENT, "curr",
OPAL_SENSOR_GROUP_ENABLE
},
- { OCC_SENSOR_TYPE_VOLTAGE, "voltage",
+ { OCC_SENSOR_TYPE_VOLTAGE, "in",
OPAL_SENSOR_GROUP_ENABLE
},
- { OCC_SENSOR_TYPE_TEMPERATURE, "temperature",
+ { OCC_SENSOR_TYPE_TEMPERATURE, "temp",
OPAL_SENSOR_GROUP_ENABLE
},
{ OCC_SENSOR_TYPE_UTILIZATION, "utilization",
@@ -1643,6 +1643,17 @@ void occ_add_sensor_groups(struct dt_node *sg, u32 *phandles, u32 *ptype,
dt_add_property_cells(node, "sensor-group-id", handle);
dt_add_property_string(node, "type", groups[j].str);
+
+ if (groups[j].type == OCC_SENSOR_TYPE_CURRENT ||
+ groups[j].type == OCC_SENSOR_TYPE_VOLTAGE ||
+ groups[j].type == OCC_SENSOR_TYPE_TEMPERATURE ||
+ groups[j].type == OCC_SENSOR_TYPE_POWER) {
+ dt_add_property_string(node, "sensor-type",
+ groups[j].str);
+ dt_add_property_string(node, "compatible",
+ "ibm,opal-sensor");
+ }
+
dt_add_property_cells(node, "ibm,chip-id", chipid);
dt_add_property_cells(node, "reg", handle);
if (groups[j].ops == OPAL_SENSOR_GROUP_ENABLE) {