From patchwork Mon Jul 9 21:25:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 10515781 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 CA9FD6032C for ; Mon, 9 Jul 2018 21:26:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8CEE28D37 for ; Mon, 9 Jul 2018 21:26:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD3BA28D9C; Mon, 9 Jul 2018 21:26:03 +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 5C16928D37 for ; Mon, 9 Jul 2018 21:26:03 +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=RkOMCaS9jgmcPpkqs1GeaupBAWZ5NcnWqM57jqTqQ6o=; b=n6jcxH7ydePIuS r6L7m2ZiEfSO8urmXVza9ID1TCINcMtXUvo3X6at23/84dYXjb4kxBEgeZqorOxwdq1EQ5MF51xVB cTlitNoK30h8n8NaCs8AUiw/zweKiU5q+/6ZzaXlqCvb9+Y16wRv/HtxatBpqisqVs4x7M7ayq7EK T8GCbTs5Y7fj+cfFgfh9//rfUMk2U0aKPl/81YxpsoGa4u9pwqrDwazDz+h2ZqGbRL6T9l77x2glB mgnGxt9SD1+PTAAUaX4SQwpqi+eAHZrPiVabtqRLI3vYQODv31iWVyJ688gqJCCjTSHXZWNwkX4vA N6WKOE8SZYMFXi/+M0tw==; 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 1fcdfR-0002xr-Nb; Mon, 09 Jul 2018 21:25:57 +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 1fcdfD-0002dz-Sg for linux-arm-kernel@lists.infradead.org; Mon, 09 Jul 2018 21:25:45 +0000 Received: by mail-pf0-f195.google.com with SMTP id l9-v6so2908543pff.9 for ; Mon, 09 Jul 2018 14:25:29 -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=4QSC1XjZ85hv+T9C9ra9S9sf5IMwZc+y3e+ROIYg7CI=; b=fCZ13mXYUMi+uWj1tfQASVK9dlaVQ+sgh1vN4q87rYpCmA2x606zkXCUz9SRRDKKE0 28mGwBbNCRd/GOVvZNA6GCXA55jxrregFpYmSHUJl8A9kd1A6cZ18gFa2SHj0JpaUo0S 3HirIwzrhQPJVOWki+S2h1aT61ma9s6bOS+z2xagYv0YozpfgHNdDuKMnz1iac9jz0my GYKy0EjbHGTzmQFrYSYbhQUB7eVSn3A6Oi0do++SBwzyvAbS995EP+Sh7OeU76JLeDVB 4l8bHfhEMvtgJhWz1uzEcDK4zV0fFjUoHuhMtGqDt+B31555Fox1MUFAYm5KYi6f7zw4 2/Bg== X-Gm-Message-State: APt69E1la9vJymzoAgJSTRuoFRiNKqR2JZ+wIuFuWc7teIeQNxM5fkgC 8WAhgUv0xZGDqUqyjZlJaXJiqg== X-Google-Smtp-Source: AAOMgpew67XywVog+yjtECUMth5hS+nWk3DGGoQvwrURvozM29GuHSFZWJdpidDdVYyiIgwsXUUx0g== X-Received: by 2002:a63:c608:: with SMTP id w8-v6mr391628pgg.16.1531171529295; Mon, 09 Jul 2018 14:25:29 -0700 (PDT) Received: from mka.mtv.corp.google.com ([2620:0:1000:1501:8e2d:4727:1211:622]) by smtp.gmail.com with ESMTPSA id m9-v6sm22566221pge.25.2018.07.09.14.25.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jul 2018 14:25:28 -0700 (PDT) From: Matthias Kaehlcke To: Andy Gross , David Brown , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon Subject: [PATCH v3 2/2] arm64: dts: qcom: pm8998: Add pm8998 thermal zone Date: Mon, 9 Jul 2018 14:25:22 -0700 Message-Id: <20180709212522.187257-2-mka@chromium.org> X-Mailer: git-send-email 2.18.0.203.gfac676dfb9-goog In-Reply-To: <20180709212522.187257-1-mka@chromium.org> References: <20180709212522.187257-1-mka@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180709_142543_920385_A5536C8B X-CRM114-Status: GOOD ( 15.56 ) 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 increased 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 v3: - moved 'thermal-zones' node to the beginning of the .dtsi 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 7eea94701b23..52c5e797aab2 100644 --- a/arch/arm64/boot/dts/qcom/pm8998.dtsi +++ b/arch/arm64/boot/dts/qcom/pm8998.dtsi @@ -3,6 +3,31 @@ #include #include +#include + +/ { + 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"; + }; + }; + }; + }; +}; &spmi_bus { pm8998_lsid0: pmic@0 {