From patchwork Sun Jun 21 19:28:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 198738 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAABCC433E0 for ; Sun, 21 Jun 2020 19:28:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A6C932523E for ; Sun, 21 Jun 2020 19:28:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="n++c/NF/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729948AbgFUT23 (ORCPT ); Sun, 21 Jun 2020 15:28:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728016AbgFUT22 (ORCPT ); Sun, 21 Jun 2020 15:28:28 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74979C061794 for ; Sun, 21 Jun 2020 12:28:28 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id s1so16956376ljo.0 for ; Sun, 21 Jun 2020 12:28:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=L9TQFVzt0zHBbW68TgkD9/2LYR7mWH10co/0ufY2ehU=; b=n++c/NF/Z6xfvP/Iz7CkJwiZGUaDTCQwxJ8qc/1KFTqM1ZNZbi7CgXg0lRsZy4skON lsO+t0GNd1OKfE4sWMep9SrSrxieTMmo1GRsgk1S9kfRJeJt6ArmKGeaAHT113WMdhAy 6oGN5mqV1ouATT7XIXmJW4ejIOKBchSM/wOmQHqFNdaCEbLknalJKaleAa/SqbAsjEPu 5LH1aNSeKouhxnL0KrK7gyqncIAi9clvdKw5shKuzXXLAm7o+66GsePXbq8tTIK2d6ot KjjuWYL3m7NJafw8jY6bYCOrsyrGbkIDfuLG/2ze/kBnn48sktTr9pxExPpER0bFrrcj bHoQ== 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:mime-version :content-transfer-encoding; bh=L9TQFVzt0zHBbW68TgkD9/2LYR7mWH10co/0ufY2ehU=; b=bw7sJ4Ssh8JLTUY/iO4x6GvN8j2PopPPwyXgCmtiNf0VHzesycNwXrJBXy/P0ZBNul tRHAXOglaGJmUK4RDbRKwD6QMEE8RpbI7lu0S7zBWZPE/qOtD2sYKK9vhun9K2j+azOr RzSu5nmSYiHeU5e0QgIN2esw08AZlbEtE1urhdB7Y8uQmh373gApUxs/zSONWO0IBZKv AkMw051gMr6zHq/vO0jGjfXG/IcwANmY+7sO2A5pavHecD3sCSQTKMtOU6/sTFr6ndyW 62hYWspeWl7EZKWFRsgPOq398cS9dLYnn5QdGtCxhqScFeTTrYbWWd2YdHAKAcGuUB7C AhsQ== X-Gm-Message-State: AOAM532DYVuE2tPYJMu1RcaSwyMh/loRg7KxvB+bgWwGiIdLev06B5Kd c6E2Jx4+9JGxStLCc6Z3Lr+SAw== X-Google-Smtp-Source: ABdhPJwjXFpUeB2IOebJxfj3AE4fMZNgbwgEcO1wGFqhfp2TqUKJBAGG8TCth8ZfnQmKMsvoUL631A== X-Received: by 2002:a2e:b4b6:: with SMTP id q22mr6250647ljm.53.1592767706603; Sun, 21 Jun 2020 12:28:26 -0700 (PDT) Received: from eriador.lan ([188.162.65.109]) by smtp.gmail.com with ESMTPSA id o201sm2917205lff.8.2020.06.21.12.28.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Jun 2020 12:28:26 -0700 (PDT) From: Dmitry Baryshkov To: Andy Gross , Bjorn Andersson , Rob Herring Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Vinod Koul Subject: [PATCH 1/3] arm64: dts: qcom: pm8009: Add base dts file Date: Sun, 21 Jun 2020 22:28:22 +0300 Message-Id: <20200621192824.2069145-1-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add base DTS file for pm8009 along with GPIOs and power-on nodes. Signed-off-by: Dmitry Baryshkov --- arch/arm64/boot/dts/qcom/pm8009.dtsi | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 arch/arm64/boot/dts/qcom/pm8009.dtsi diff --git a/arch/arm64/boot/dts/qcom/pm8009.dtsi b/arch/arm64/boot/dts/qcom/pm8009.dtsi new file mode 100644 index 000000000000..cb1a10e72474 --- /dev/null +++ b/arch/arm64/boot/dts/qcom/pm8009.dtsi @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2020, Linaro Limited + */ + +#include + +&spmi_bus { + pmic@a { + compatible = "qcom,pm8009", "qcom,spmi-pmic"; + reg = <0xa SPMI_USID>; + #address-cells = <1>; + #size-cells = <0>; + + pon@800 { + compatible = "qcom,pm8916-pon"; + reg = <0x0800>; + }; + + pm8009_gpios: gpio@c000 { + compatible = "qcom,pm8005-gpio"; + reg = <0xc000>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + }; + + pmic@b { + compatible = "qcom,pm8009", "qcom,spmi-pmic"; + reg = <0xb SPMI_USID>; + #address-cells = <1>; + #size-cells = <0>; + }; +}; From patchwork Sun Jun 21 19:28:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 191293 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp439254ile; Sun, 21 Jun 2020 12:28:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxd7C7WhkmcLvtPWWXNQSDLBz6Fdyu+Ip9pH/rJJpqJI6UJuOGmwooKBg5KZiAE98u7+tgL X-Received: by 2002:a05:6402:b31:: with SMTP id bo17mr14172710edb.152.1592767714397; Sun, 21 Jun 2020 12:28:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592767714; cv=none; d=google.com; s=arc-20160816; b=OvjQ7P6/I9zcnwC839Nv54Qxn6eij+Ly2ZVLcOkXdPw06lFcLiKHLXsBwZVE5JdM1J OEhR64WmbUzleNxGkwPA84qMkS25820QASOyyq+XtkDlfp4O5PPOSzsjKSWVsIocfUmY HlK3OSKj0PVN4CUym/JWXZ9pUgpYGW1ivEPfrHUbIV03n/W3sBb/7Fws74iVb+LkJBiz /BTCN9fAAblGW+hQwkGZrisX89TySetcTSpRUlCwYb6hHro7rT+Za/NwhqOwmFg5eQzF CUJR9c/ik8QdoOZl6PSz8gT1H+i4e7EazmZU0zELrb7seaCuNgBv70wxgs/1FUC9hTYt p7ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Rr0BOI8BzffYBcJ3FrPC0MKxNzbBaaA0ciNFW/6okKs=; b=YO/Vfy/mr5lM5tXnzmHnuitfyv/UPxpXNhaCUbEM5i1feuXQ5QzwU3K9Ovyw+7Isog s/gh6aNegnz4LBYRVKa7qWJluxnP4WP9LmKQV0mZPwypJbNUX1vVPzBRiumzZJUE+pee oLWW51Np+mCQ12PBy0fFTYg6glIG7NH+C163RRhJ+XkWiXtzBVyZLu7P+6o4WGN23Uky tCUEspnWpLBkcUzYpDmX1mhGlYsMRR5hwLH04CI7uNi6rXsV2XFPhzr+6DHvfsJSjIsA gBomZdM6uSapcJw5MScEdDlOOZOO1A909xeLEwFtGmKnfWpLbE9676lNYpVD5sTR+XGq Mbxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WgxoW93h; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r17si8113448edw.77.2020.06.21.12.28.34; Sun, 21 Jun 2020 12:28:34 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WgxoW93h; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729810AbgFUT2b (ORCPT + 6 others); Sun, 21 Jun 2020 15:28:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730036AbgFUT2b (ORCPT ); Sun, 21 Jun 2020 15:28:31 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8B18C061797 for ; Sun, 21 Jun 2020 12:28:30 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id c17so16883077lji.11 for ; Sun, 21 Jun 2020 12:28:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Rr0BOI8BzffYBcJ3FrPC0MKxNzbBaaA0ciNFW/6okKs=; b=WgxoW93hkrr52DkMnv53XZXZ/WRm4lRtO0An32UplYwfNbG97G89CBt/RhSS+yZ0bd 2zXwmAnGs9mCmwjD29AZ1CgmNXbSslJQyDE+hDVmY2D1rDsFdztX29NVrHBkqvpeM0vn xQVzqbGkX6PRfMscHhj7sOgL5Pmfu3bQZqeVzl6wHagiKa7WVDLu2lIFbUpbcjOdT7ko N84MLvuCXnoMEPzDm4T7QkhNOk0PgORc9dljfVKhd+5AO4fV8lbQxVBMQqZh0qo54W+f HbrHwYJ4xrfW6gDpGW4mM5ZTQzNjWmwjmF9ro33DcNkiUbvccgWzEZKm/Vjyx80lIDNN HRbg== 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=Rr0BOI8BzffYBcJ3FrPC0MKxNzbBaaA0ciNFW/6okKs=; b=HMgg3y1zKB9Gdb83LnexOtcd1H4QBO6WmJnLPZsYttpQOk1CatRKui4LZTpCGqKwtZ NMEVBeM7OQBjLHbjuUzBed5iOnTxvXcPVPhGIG3wY10md+3StebiOx7VuA82BmEc/HtY 2WUsAIyHQ+hb7Rmp/snG/OmILr74+Mz9eARgcz8yFgLa8pyv40Tpqm5lgiC/3eEluhfo 35fNsjNJNiDhV7k9IcAQKFqYbVKA4wHeSJqpW03orPrCg6B70xiiloJhvMlKktFVKNLS 2qWRsGyhOhLPlQnH7whjPEbEytzLUnJpqIbVeL1qkvO2OTEJUl9LYJVuexO8KlK01ZJ/ 89+A== X-Gm-Message-State: AOAM532MCy0aB3nJYedlxW8vBkREAJLajj+dDG5f19zQLW+/b3dPb+hk 3IiVI9Qn1koSPi3pqHHABd8f0Q== X-Received: by 2002:a2e:970c:: with SMTP id r12mr6764967lji.145.1592767709125; Sun, 21 Jun 2020 12:28:29 -0700 (PDT) Received: from eriador.lan ([188.162.65.109]) by smtp.gmail.com with ESMTPSA id o201sm2917205lff.8.2020.06.21.12.28.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Jun 2020 12:28:28 -0700 (PDT) From: Dmitry Baryshkov To: Andy Gross , Bjorn Andersson , Rob Herring Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Vinod Koul Subject: [PATCH 3/3] arm64: dts: qcom: pm8150x: add thermal alarms and thermal zones Date: Sun, 21 Jun 2020 22:28:24 +0300 Message-Id: <20200621192824.2069145-3-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200621192824.2069145-1-dmitry.baryshkov@linaro.org> References: <20200621192824.2069145-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add temperature alarm and thermal zone configuration to all three pm8150 instances. Configuration is largely based on the msm-4.19 tree. These alarms use main adc of the pmic. Separate temperature adc is not supported yet. Signed-off-by: Dmitry Baryshkov --- arch/arm64/boot/dts/qcom/pm8150.dtsi | 42 +++++++++++++++++++++++-- arch/arm64/boot/dts/qcom/pm8150b.dtsi | 44 +++++++++++++++++++++++++-- arch/arm64/boot/dts/qcom/pm8150l.dtsi | 44 +++++++++++++++++++++++++-- 3 files changed, 122 insertions(+), 8 deletions(-) -- 2.27.0 diff --git a/arch/arm64/boot/dts/qcom/pm8150.dtsi b/arch/arm64/boot/dts/qcom/pm8150.dtsi index c0b197458665..1b6406927509 100644 --- a/arch/arm64/boot/dts/qcom/pm8150.dtsi +++ b/arch/arm64/boot/dts/qcom/pm8150.dtsi @@ -9,6 +9,37 @@ #include #include +/ { + thermal-zones { + pm8150 { + polling-delay-passive = <100>; + polling-delay = <0>; + + thermal-sensors = <&pm8150_temp>; + + trips { + trip0 { + temperature = <95000>; + hysteresis = <0>; + type = "passive"; + }; + + trip1 { + temperature = <115000>; + hysteresis = <0>; + type = "hot"; + }; + + trip2 { + temperature = <145000>; + hysteresis = <0>; + type = "critical"; + }; + }; + }; + }; +}; + &spmi_bus { pm8150_0: pmic@0 { compatible = "qcom,pm8150", "qcom,spmi-pmic"; @@ -30,6 +61,15 @@ pwrkey { }; }; + pm8150_temp: temp-alarm@2400 { + compatible = "qcom,spmi-temp-alarm"; + reg = <0x2400>; + interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_BOTH>; + io-channels = <&pm8150_adc ADC5_DIE_TEMP>; + io-channel-names = "thermal"; + #thermal-sensor-cells = <0>; + }; + pm8150_adc: adc@3100 { compatible = "qcom,spmi-adc5"; reg = <0x3100>; @@ -38,8 +78,6 @@ pm8150_adc: adc@3100 { #io-channel-cells = <1>; interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>; - status = "disabled"; - ref-gnd@0 { reg = ; qcom,pre-scaling = <1 1>; diff --git a/arch/arm64/boot/dts/qcom/pm8150b.dtsi b/arch/arm64/boot/dts/qcom/pm8150b.dtsi index 40b5d75a4a1d..e112e8876db6 100644 --- a/arch/arm64/boot/dts/qcom/pm8150b.dtsi +++ b/arch/arm64/boot/dts/qcom/pm8150b.dtsi @@ -8,6 +8,37 @@ #include #include +/ { + thermal-zones { + pm8150b { + polling-delay-passive = <100>; + polling-delay = <0>; + + thermal-sensors = <&pm8150b_temp>; + + trips { + trip0 { + temperature = <95000>; + hysteresis = <0>; + type = "passive"; + }; + + trip1 { + temperature = <115000>; + hysteresis = <0>; + type = "hot"; + }; + + trip2 { + temperature = <145000>; + hysteresis = <0>; + type = "critical"; + }; + }; + }; + }; +}; + &spmi_bus { pmic@2 { compatible = "qcom,pm8150b", "qcom,spmi-pmic"; @@ -22,7 +53,16 @@ power-on@800 { status = "disabled"; }; - adc@3100 { + pm8150b_temp: temp-alarm@2400 { + compatible = "qcom,spmi-temp-alarm"; + reg = <0x2400>; + interrupts = <0x2 0x24 0x0 IRQ_TYPE_EDGE_BOTH>; + io-channels = <&pm8150b_adc ADC5_DIE_TEMP>; + io-channel-names = "thermal"; + #thermal-sensor-cells = <0>; + }; + + pm8150b_adc: adc@3100 { compatible = "qcom,spmi-adc5"; reg = <0x3100>; #address-cells = <1>; @@ -30,8 +70,6 @@ adc@3100 { #io-channel-cells = <1>; interrupts = <0x2 0x31 0x0 IRQ_TYPE_EDGE_RISING>; - status = "disabled"; - ref-gnd@0 { reg = ; qcom,pre-scaling = <1 1>; diff --git a/arch/arm64/boot/dts/qcom/pm8150l.dtsi b/arch/arm64/boot/dts/qcom/pm8150l.dtsi index cf05e0685d10..62139538b7d9 100644 --- a/arch/arm64/boot/dts/qcom/pm8150l.dtsi +++ b/arch/arm64/boot/dts/qcom/pm8150l.dtsi @@ -8,6 +8,37 @@ #include #include +/ { + thermal-zones { + pm8150l { + polling-delay-passive = <100>; + polling-delay = <0>; + + thermal-sensors = <&pm8150l_temp>; + + trips { + trip0 { + temperature = <95000>; + hysteresis = <0>; + type = "passive"; + }; + + trip1 { + temperature = <115000>; + hysteresis = <0>; + type = "hot"; + }; + + trip2 { + temperature = <145000>; + hysteresis = <0>; + type = "critical"; + }; + }; + }; + }; +}; + &spmi_bus { pmic@4 { compatible = "qcom,pm8150l", "qcom,spmi-pmic"; @@ -22,7 +53,16 @@ power-on@800 { status = "disabled"; }; - adc@3100 { + pm8150l_temp: temp-alarm@2400 { + compatible = "qcom,spmi-temp-alarm"; + reg = <0x2400>; + interrupts = <0x4 0x24 0x0 IRQ_TYPE_EDGE_BOTH>; + io-channels = <&pm8150l_adc ADC5_DIE_TEMP>; + io-channel-names = "thermal"; + #thermal-sensor-cells = <0>; + }; + + pm8150l_adc: adc@3100 { compatible = "qcom,spmi-adc5"; reg = <0x3100>; #address-cells = <1>; @@ -30,8 +70,6 @@ adc@3100 { #io-channel-cells = <1>; interrupts = <0x4 0x31 0x0 IRQ_TYPE_EDGE_RISING>; - status = "disabled"; - ref-gnd@0 { reg = ; qcom,pre-scaling = <1 1>;