From patchwork Mon Jul 2 18:10:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 938117 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ku/SASSY"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41KFgx1Rmgz9s29 for ; Tue, 3 Jul 2018 04:11:41 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qQrJQNjvFK/QCYhpAyJddhD2gIUR75UQKIOU9ohtgPE=; b=ku/SASSY30fgct yxzEG1T5aPJDllsGLbyHsryww7c+QqomYJJwlFkJ5+UudzEefdxMGp6INQL/cvY05F1mP+iWNAE82 tFczTQKFgZXYWrnjPq5GoV3F+rHUSJdbKdYbsessr5uXVh6m9fRgPf9LWM9DUJXV3FQEVxTTHgr50 pEw0Yxa9aNmPOeOtcWVSl2WaBmzkz7D76uSzZkGSMG8c30ZnR5DZ9Lrgu9292j0qon0jA44mm0pOq 4T4oUWva8yGkcXh0X1xjHPJ16NBTyrs4cnxTsMI7UeTQmanQB9im/3YrO4W3i10ZMu5pPddEQxinw 7gVoag/LBgywCXqFSXEA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fa3IW-0007Ly-9Z; Mon, 02 Jul 2018 18:11:36 +0000 Received: from mail-pf0-f195.google.com ([209.85.192.195]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fa3IC-0006ty-Li for linux-arm-kernel@lists.infradead.org; Mon, 02 Jul 2018 18:11:18 +0000 Received: by mail-pf0-f195.google.com with SMTP id u16-v6so7871845pfh.3 for ; Mon, 02 Jul 2018 11:11:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1JwKOqWJyrr/39mWOVkjZxVWrT/c0a+cxPW5ln8IJw8=; b=Y65bN+QXa5lGhmcrqYVWYmyJMgJkYP3DytbHVJOmLyI/EllhiI/iNPTPVEWY0zfwlJ F9SjjV28sg74MPy8mHaqo1KVggcjmtZeI1QQkwS/tVEzi703O0CAInYOu8Xau8ZAkvJe 0W2xbwGUdEMMLxEC4YmK4IoIpNPU7BUHzSIQB2auKKTMCDDZwpbdYitn8XKujZxBYdfh WK/Fme0MXM9lQdOaLzeDFQznWPNnTtp9O3A++hv2irjAXEWYn3k3YQzWYHNuMXTrAt22 cVDXhvpOKLS2cnW24DWO/p+NWhc6cvG3nHHABrQPJRoK7+cbUq7DRcScy7fg6ss4mG+N /wLQ== X-Gm-Message-State: APt69E1d0o+R6jD4zDQhgUIAn3udcl/CXLXBYkR/PM+kQ/Pv+lmComkn 75kcUETHolAoGgIa9CJ0dT6P3A== X-Google-Smtp-Source: AAOMgpcWFnlOQzG5VEcAvfAJl+Ip/pJou2TYu9xA8GwIJRBNu2OYmIa3Y13fYxHrl0pItTPgpxWtrA== X-Received: by 2002:a62:fd0b:: with SMTP id p11-v6mr26498302pfh.52.1530555063334; Mon, 02 Jul 2018 11:11:03 -0700 (PDT) Received: from mka.mtv.corp.google.com ([2620:0:1000:1501:8e2d:4727:1211:622]) by smtp.gmail.com with ESMTPSA id h75-v6sm10048372pfh.86.2018.07.02.11.11.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 11:11:02 -0700 (PDT) From: Matthias Kaehlcke To: Andy Gross , David Brown , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon Subject: [PATCH v2 2/2] arm64: dts: qcom: pm8998: Add pm8998 thermal zone Date: Mon, 2 Jul 2018 11:10:05 -0700 Message-Id: <20180702181005.18247-2-mka@chromium.org> X-Mailer: git-send-email 2.18.0.399.gad0ab374a1-goog In-Reply-To: <20180702181005.18247-1-mka@chromium.org> References: <20180702181005.18247-1-mka@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180702_111116_705331_BE416548 X-CRM114-Status: GOOD ( 15.58 ) X-Spam-Score: -7.3 (-------) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-7.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.192.195 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.192.195 listed in wl.mailspike.net] 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -7.5 USER_IN_DEF_SPF_WL From: address is in the default SPF white-list -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Collins , Stephen Boyd , linux-arm-msm@vger.kernel.org, Douglas Anderson , linux-kernel@vger.kernel.org, Matthias Kaehlcke , linux-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org The thermal zone uses spmi-temp-alarm as sensor. If the sensor is configured without an IIO input it always reports 37°C for temperatures below the first hardware trip point at 105°C. This hardware trip point is configured as critical trip point, to initiate a system shutdown before the temperature reaches the next hardware trip point at 125°C, where the PMIC performs a partial shutdown. The temperature of the critical trip point can be raised after adding the die temperature ADC as IIO input for spmi-temp-alarm, which significantly increases the precision of the temperature measurements. Signed-off-by: Matthias Kaehlcke --- Changes in v2: - defined 'thermal-zones' node in pm8998.dtsi instead of using a label to refer to it - use 105°C hardware trip point as critical trip point - reduced number of trip points to 2 - lowered temperature of passive trip point - updated trip point names and added labels - updated commit message arch/arm64/boot/dts/qcom/pm8998.dtsi | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/pm8998.dtsi b/arch/arm64/boot/dts/qcom/pm8998.dtsi index 2f4989e7ef68..e7caa334e6c7 100644 --- a/arch/arm64/boot/dts/qcom/pm8998.dtsi +++ b/arch/arm64/boot/dts/qcom/pm8998.dtsi @@ -3,6 +3,7 @@ #include #include +#include &spmi_bus { pm8998_lsid0: pmic@0 { @@ -60,3 +61,27 @@ #size-cells = <0>; }; }; + +/ { + thermal-zones { + pm8998 { + polling-delay-passive = <250>; + polling-delay = <1000>; + + thermal-sensors = <&pm8998_temp>; + + trips { + pm8998_alert0: pm8998-alert0 { + temperature = <95000>; + hysteresis = <2000>; + type = "passive"; + }; + pm8998_crit: pm8998-crit { + temperature = <105000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + }; +};