From patchwork Fri Oct 28 07:54:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 12150 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp688881wru; Fri, 28 Oct 2022 01:09:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6jSsanaZ6IDc89uMebQddYsC9/XnFNw34VjQ1UQQ2q+HGVbxsoCV15el/N8maeJKEZlKET X-Received: by 2002:a17:907:25c1:b0:77b:9966:ccf1 with SMTP id ae1-20020a17090725c100b0077b9966ccf1mr45738978ejc.763.1666944557407; Fri, 28 Oct 2022 01:09:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666944557; cv=none; d=google.com; s=arc-20160816; b=zcL3vSBa7qbZUAy6Vh+fqcVwHl1XwJCsUCo/WL27xblkaN5ji0UrcX1YKVBZCmnzcd EqCgESWppNQ7oHy2c+x9Pepe2j3LnIMcTGfkEzqgRvFOHZ8u/LWL0cL2GwpPEnVsNoEF yOoilHkX2jqSrA44OLOsLo5adLtqvQd6lUKbuRXFxV9b1gb97Afsf529/xT4Lt6kjT7j rkOMq94YzxRdObHC1tyscIGXz7rVNEHbamKhnrP+BLz5We5VH0LJ19AJzWQ/rUQbLSH2 8cmu4J56J53WoWfKUrIun/IqWSk298OqmoFfCPhEwvOFCx5EpkxpqNSUxQe5Wgs5B/2h TXxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Hp4/jQvbIENnP1QtwrwaDwXz/OkxdZKv0tvGrojWyT4=; b=AGoAT93lhNPQiP7aoZ8x0sW5yAXK3W92BfDaQYzXgBnMpM8cFFFNJbGVyu7Qil1w3M BX1k5l8cNlwjVzI9Pl/StNZLaqViEUhSTW8o6k5xHn1Yc9YEBDH/70b0nv0IHOwE1PM9 4QPMQ0dsTjrXrVihPXa27eGMMrwn238oCbAozXGwN1swSR5I9E7Y1jBoLH41l7e3URRl CNC1SrKXBz0A6ls5eNRRwjafbcb7ngFIFqJNiyFMM09v/AkQ8OW6oq3zQ/E9OltSCND7 SyTobin4GT450B6EHhZJX5NDzjWGeHKnXAhP7QccQLU8p60h1MrGKqE42Zo6WggorHxA QWBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=MjpM9MZ7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fairphone.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r14-20020a170906a20e00b007a1b49ca799si2961445ejy.385.2022.10.28.01.08.53; Fri, 28 Oct 2022 01:09:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=MjpM9MZ7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fairphone.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229519AbiJ1HyY (ORCPT + 99 others); Fri, 28 Oct 2022 03:54:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229914AbiJ1HyT (ORCPT ); Fri, 28 Oct 2022 03:54:19 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9141E1C0717 for ; Fri, 28 Oct 2022 00:54:17 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id f7so1045271edc.6 for ; Fri, 28 Oct 2022 00:54:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Hp4/jQvbIENnP1QtwrwaDwXz/OkxdZKv0tvGrojWyT4=; b=MjpM9MZ7KQ626nARv3VQkkMBWuqaYLA6tkr1hOd6GZ6IAtXB4zudJ4/iuy9hAz458Y tEI167n/yqixhstwbRoAcgOvgZ5kKQ7iJf3Zv0yuL/tB/p2uCBMZls68h18JOHYPQV8X 2sqqBopQf1M93sNmQIK1oOAk+fi8GYwIigwZYoe3T7I397UzonpZPRaF0MD/XL3AGTFa HfzoW2auUjhvGYQba1WKljPugn7/u5PuByl5ff0q4tRocNkS13rRrma6G1MBo9oCnTsH qajoTRk2kFwVfiibOtu9V/a7RWdvfsr2rbIhVJ8VSXt3JwuMYSZw7Jtz/RPeRZQ9hJku w/0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Hp4/jQvbIENnP1QtwrwaDwXz/OkxdZKv0tvGrojWyT4=; b=cqQMRj0NHvlEoALzkMDkAYdM0HVmlGGyRTtS/C1ek1zUEYuJeQSv7ypZFSAUClpIIY aPGnssTdHNEhPrvZLwa99u5YTDXdUcYxK7cmV1JY1iN4kiD3e975NiILkJXckE9SKUAc tCjmslfJpyZmMS+re1wsswqdQzQBH2dmtu31J8uZl44rCbls5ZNrYYvyCrmlfH9KrgRB f3+HWfj9HLbleO6SSW/xXP1mcezfcCHQZSO3Zn8uM8AAEs6bMxY9E+luXoXd6k2zkwS8 r73qTw9EC1tyvDt515adgwJqnoGQBaRGAbm5Zq3ZbkfzlpobSynLURsFw4ESHEhC0ZcE RpOA== X-Gm-Message-State: ACrzQf0sIyk5T/GUr+7m3I31TcuL23dBaJxZ5SNX4ZhrJhFuPM7VyHI+ vXLhZ0IIFnrrN747pxqNNAvhaw== X-Received: by 2002:a05:6402:414f:b0:456:c2c1:23ec with SMTP id x15-20020a056402414f00b00456c2c123ecmr50812155eda.420.1666943656207; Fri, 28 Oct 2022 00:54:16 -0700 (PDT) Received: from otso.. (31-151-115-246.dynamic.upc.nl. [31.151.115.246]) by smtp.gmail.com with ESMTPSA id v8-20020a170906b00800b0078dce9984afsm1776009ejy.220.2022.10.28.00.54.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 00:54:15 -0700 (PDT) From: Luca Weiss To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Luca Weiss , Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] arm64: dts: qcom: pm6150l: add temp sensor and thermal zone config Date: Fri, 28 Oct 2022 09:54:05 +0200 Message-Id: <20221028075405.124809-2-luca.weiss@fairphone.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221028075405.124809-1-luca.weiss@fairphone.com> References: <20221028075405.124809-1-luca.weiss@fairphone.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747918056123400488?= X-GMAIL-MSGID: =?utf-8?q?1747918056123400488?= Add temp-alarm device tree node and a default configuration for the corresponding thermal zone for this PMIC. Temperatures are based on downstream values, except for trip2 where 125°C is used instead of 145°C due to limitations without a configured ADC. Signed-off-by: Luca Weiss --- Changes in v2: * new patch, very similar to pm6350 one arch/arm64/boot/dts/qcom/pm6150l.dtsi | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/pm6150l.dtsi b/arch/arm64/boot/dts/qcom/pm6150l.dtsi index f02c223ef448..3f7e047cfc06 100644 --- a/arch/arm64/boot/dts/qcom/pm6150l.dtsi +++ b/arch/arm64/boot/dts/qcom/pm6150l.dtsi @@ -5,6 +5,37 @@ #include #include +/ { + thermal-zones { + pm6150l-thermal { + polling-delay-passive = <0>; + polling-delay = <0>; + + thermal-sensors = <&pm6150l_temp>; + + trips { + trip0 { + temperature = <95000>; + hysteresis = <0>; + type = "passive"; + }; + + trip1 { + temperature = <115000>; + hysteresis = <0>; + type = "hot"; + }; + + trip2 { + temperature = <125000>; + hysteresis = <0>; + type = "critical"; + }; + }; + }; + }; +}; + &spmi_bus { pm6150l_lsid4: pmic@4 { compatible = "qcom,pm6150l", "qcom,spmi-pmic"; @@ -12,6 +43,13 @@ pm6150l_lsid4: pmic@4 { #address-cells = <1>; #size-cells = <0>; + pm6150l_temp: temp-alarm@2400 { + compatible = "qcom,spmi-temp-alarm"; + reg = <0x2400>; + interrupts = <0x4 0x24 0x0 IRQ_TYPE_EDGE_BOTH>; + #thermal-sensor-cells = <0>; + }; + pm6150l_adc: adc@3100 { compatible = "qcom,spmi-adc5"; reg = <0x3100>;