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: 10502219 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 41BF16035E for ; Mon, 2 Jul 2018 18:11:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 353152846F for ; Mon, 2 Jul 2018 18:11:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 298602847A; Mon, 2 Jul 2018 18:11:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 989342846F for ; Mon, 2 Jul 2018 18:11:44 +0000 (UTC) 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 1fa3IU-0007Ly-Gy; Mon, 02 Jul 2018 18:11:34 +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-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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"; + }; + }; + }; + }; +};