From patchwork Mon Mar 9 20:56:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 448221 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1AF9114007D for ; Tue, 10 Mar 2015 07:57:26 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 00E461A03CA for ; Tue, 10 Mar 2015 07:57:26 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 059041A03CA for ; Tue, 10 Mar 2015 07:57:08 +1100 (AEDT) Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 9 Mar 2015 20:57:05 -0000 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 9 Mar 2015 20:57:02 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 128A92190046 for ; Mon, 9 Mar 2015 20:56:53 +0000 (GMT) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t29Kv1W76881606 for ; Mon, 9 Mar 2015 20:57:01 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t29Kv028011710 for ; Mon, 9 Mar 2015 14:57:01 -0600 Received: from hermes.kaod.org (sig-9-78-86-133.uk.ibm.com [9.78.86.133]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t29Kuu4x011655; Mon, 9 Mar 2015 14:57:00 -0600 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: skiboot@lists.ozlabs.org Date: Mon, 9 Mar 2015 21:56:15 +0100 Message-Id: <1425934582-7556-5-git-send-email-clg@fr.ibm.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1423117857-32759-1-git-send-email-clg@fr.ibm.com> References: <1423117857-32759-1-git-send-email-clg@fr.ibm.com> MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15030920-0041-0000-0000-00000383B99B Subject: [Skiboot] [PATCH v3 04/11] dts: add a status property X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" 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 --- 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(+) diff --git a/hw/dts.c b/hw/dts.c index a58703cf28de..1ac3aad50905 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); } }