From nobody Thu Dec 18 07:34:01 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0063C61D92 for ; Tue, 21 Nov 2023 05:36:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229447AbjKUFgQ (ORCPT ); Tue, 21 Nov 2023 00:36:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233495AbjKUFgI (ORCPT ); Tue, 21 Nov 2023 00:36:08 -0500 Received: from mx1.riseup.net (mx1.riseup.net [198.252.153.129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74879116; Mon, 20 Nov 2023 21:36:01 -0800 (PST) Received: from fews02-sea.riseup.net (fews02-sea-pn.riseup.net [10.0.1.112]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx1.riseup.net (Postfix) with ESMTPS id 4SZClh4vxNzDr01; Tue, 21 Nov 2023 05:36:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1700544961; bh=jh3rezL5S7sb/M4VMN5CMI7+Ql0qBTS4jIusFA4OTRQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=QP0ehrOXgEkr/lkJEK2u1Y9zeYIevS2W27ALmoKt7dOPHYivv1PjYI6+EBV5nqxa6 +9JLyhxs6hfO8DwNLCWc523FWSqaCWSDz/J6nHVCDjE8Z5mY6SGs0PXHRd+Yq+oWPF sto0Hk0GUSQ3hVhhRF3G4AaN0C2woUDg7VllsZOo= X-Riseup-User-ID: 3E01EE7485026F2FC8F12AC2D886177E4C57932B1DEB81578F8D5C2E5591D05C Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews02-sea.riseup.net (Postfix) with ESMTPSA id 4SZCld5X2bzFvkn; Tue, 21 Nov 2023 05:35:57 +0000 (UTC) From: Dang Huynh Date: Tue, 21 Nov 2023 12:35:01 +0700 Subject: [PATCH v2 3/4] arm64: dts: qcom: Add PM8937 PMIC MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20231121-pm8937-v2-3-b0171ab62075@riseup.net> References: <20231121-pm8937-v2-0-b0171ab62075@riseup.net> In-Reply-To: <20231121-pm8937-v2-0-b0171ab62075@riseup.net> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stephen Boyd Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Dang Huynh , Dmitry Baryshkov Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The PM8937 features integrated peripherals like ADC, GPIO controller, MPPs, PON keys and others. Add the device tree so that any boards with this PMIC can use it. Reviewed-by: Dmitry Baryshkov Signed-off-by: Dang Huynh --- arch/arm64/boot/dts/qcom/pm8937.dtsi | 216 +++++++++++++++++++++++++++++++= ++++ 1 file changed, 216 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/pm8937.dtsi b/arch/arm64/boot/dts/qco= m/pm8937.dtsi new file mode 100644 index 000000000000..34e2b4cd0d5f --- /dev/null +++ b/arch/arm64/boot/dts/qcom/pm8937.dtsi @@ -0,0 +1,216 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2023, Dang Huynh + */ + +#include +#include +#include +#include +#include + +/ { + thermal-zones { + pm8937-thermal { + polling-delay-passive =3D <0>; + polling-delay =3D <0>; + thermal-sensors =3D <&pm8937_temp>; + + trips { + trip0 { + temperature =3D <105000>; + hysteresis =3D <0>; + type =3D "passive"; + }; + + trip1 { + temperature =3D <125000>; + hysteresis =3D <0>; + type =3D "hot"; + }; + + trip2 { + temperature =3D <145000>; + hysteresis =3D <0>; + type =3D "critical"; + }; + }; + }; + }; +}; + +&spmi_bus { + pmic@0 { + compatible =3D "qcom,pm8937", "qcom,spmi-pmic"; + reg =3D <0x0 SPMI_USID>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + pon@800 { + compatible =3D "qcom,pm8916-pon"; + reg =3D <0x800>; + mode-bootloader =3D <0x2>; + mode-recovery =3D <0x1>; + + pm8937_pwrkey: pwrkey { + compatible =3D "qcom,pm8941-pwrkey"; + interrupts =3D <0 0x8 0 IRQ_TYPE_EDGE_BOTH>; + debounce =3D <15625>; + bias-pull-up; + linux,code =3D ; + }; + + pm8937_resin: resin { + compatible =3D "qcom,pm8941-resin"; + interrupts =3D <0 0x8 1 IRQ_TYPE_EDGE_BOTH>; + debounce =3D <15625>; + bias-pull-up; + status =3D "disabled"; + }; + }; + + pm8937_gpios: gpio@c000 { + compatible =3D "qcom,pm8937-gpio", "qcom,spmi-gpio"; + reg =3D <0xc000>; + gpio-controller; + gpio-ranges =3D <&pm8937_gpios 0 0 8>; + #gpio-cells =3D <2>; + interrupt-controller; + #interrupt-cells =3D <2>; + }; + + pm8937_mpps: mpps@a000 { + compatible =3D "qcom,pm8937-mpp", "qcom,spmi-mpp"; + reg =3D <0xa000>; + gpio-controller; + gpio-ranges =3D <&pm8937_mpps 0 0 4>; + #gpio-cells =3D <2>; + interrupt-controller; + #interrupt-cells =3D <2>; + }; + + pm8937_temp: temp-alarm@2400 { + compatible =3D "qcom,spmi-temp-alarm"; + reg =3D <0x2400>; + interrupts =3D <0 0x24 0 IRQ_TYPE_EDGE_RISING>; + io-channels =3D <&pm8937_vadc VADC_DIE_TEMP>; + io-channel-names =3D "thermal"; + #thermal-sensor-cells =3D <0>; + }; + + pm8937_vadc: adc@3100 { + compatible =3D "qcom,spmi-vadc"; + reg =3D <0x3100>; + interrupts =3D <0 0x31 0 IRQ_TYPE_EDGE_RISING>; + #address-cells =3D <1>; + #size-cells =3D <0>; + #io-channel-cells =3D <1>; + + channel@5 { + reg =3D ; + qcom,pre-scaling =3D <1 1>; + label =3D "vcoin"; + }; + + channel@7 { + reg =3D ; + qcom,pre-scaling =3D <1 1>; + label =3D "vph_pwr"; + }; + + channel@8 { + reg =3D ; + qcom,pre-scaling =3D <1 1>; + label =3D "die_temp"; + }; + + channel@9 { + reg =3D ; + qcom,pre-scaling =3D <1 1>; + label =3D "ref_625mv"; + }; + + channel@a { + reg =3D ; + qcom,pre-scaling =3D <1 1>; + label =3D "ref_1250mv"; + }; + + channel@c { + reg =3D ; + qcom,pre-scaling =3D <1 1>; + label =3D "ref_buf_625mv"; + }; + + channel@e { + reg =3D ; + qcom,pre-scaling =3D <1 1>; + label =3D "ref_gnd"; + }; + + channel@f { + reg =3D ; + qcom,pre-scaling =3D <1 1>; + label =3D "ref_vdd"; + }; + + channel@11 { + reg =3D ; + qcom,pre-scaling =3D <1 1>; + qcom,ratiometric; + qcom,hw-settle-time =3D <200>; + label =3D "pa_therm1"; + }; + + channel@13 { + reg =3D ; + qcom,pre-scaling =3D <1 1>; + qcom,ratiometric; + qcom,hw-settle-time =3D <200>; + label =3D "case_therm"; + }; + + channel@32 { + reg =3D ; + qcom,pre-scaling =3D <1 1>; + qcom,ratiometric; + qcom,hw-settle-time =3D <200>; + label =3D "xo_therm"; + }; + + channel@36 { + reg =3D ; + qcom,pre-scaling =3D <1 1>; + qcom,ratiometric; + qcom,hw-settle-time =3D <200>; + label =3D "pa_therm0"; + }; + + channel@3c { + reg =3D ; + qcom,pre-scaling =3D <1 1>; + qcom,ratiometric; + qcom,hw-settle-time =3D <200>; + label =3D "xo_therm_buf"; + }; + }; + + rtc@6000 { + compatible =3D "qcom,pm8941-rtc"; + reg =3D <0x6000>, <0x6100>; + reg-names =3D "rtc", "alarm"; + interrupts =3D <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>; + }; + }; + + pmic@1 { + compatible =3D "qcom,pm8937", "qcom,spmi-pmic"; + reg =3D <0x1 SPMI_USID>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + pm8937_spmi_regulators: regulators { + compatible =3D "qcom,pm8937-regulators"; + }; + }; +}; --=20 2.42.1