@@ -114,6 +114,12 @@ static int dts_read_core_temp(uint32_t pir, struct dts *dts)
prlog(PR_TRACE, "DTS: Chip %x Core %x temp:%dC trip:%x\n",
chip_id, core, dts->temp, dts->trip);
+
+ /*
+ * FIXME: The trip bits are always set ?! Just discard
+ * them for the moment until we understand why.
+ */
+ dts->trip = 0;
return 0;
}
@@ -194,6 +200,9 @@ bool dts_sensor_create_nodes(struct dt_node *sensors)
dt_add_property_string(node, "compatible",
"ibm,opal-sensor");
dt_add_property_cells(node, "sensor-data", handler);
+ handler = sensor_make_handler(sensor_class,
+ c->pir, SENSOR_DTS_ATTR_TEMP_TRIP);
+ dt_add_property_cells(node, "sensor-status", handler);
}
}
The Linux driver should use this property to reflect the status as a hwmon *_alarm or *_fault attribute. The temperature sensors trip bits are currently always set, so we brutaly assign the value to nil until we know why. Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> --- Changes since v2 : - removed the device tree modifications of the FSP sensors - simplified the returned status value which was taking into account the FSP sensors in the previous patchset. Changes since RFC : - added DTS status hw/dts.c | 9 +++++++++ 1 file changed, 9 insertions(+)