From 609646f1a6933ce126804b632a74e59729a72c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Date: Mon, 9 Mar 2015 21:56:15 +0100 Subject: dts: add a status property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Stewart Smith --- hw/dts.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'hw') diff --git a/hw/dts.c b/hw/dts.c index 4c42d264..4a4259a2 100644 --- a/hw/dts.c +++ b/hw/dts.c @@ -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); } } -- cgit v1.2.1