Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	Johan Hovold <johan+linaro@kernel.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	linux-iio@vger.kernel.org
Subject: [PATCH v2 21/22] arch: arm64: dts: qcom: pm8150: support SID greater that 9
Date: Sun,  2 Apr 2023 01:08:09 +0300	[thread overview]
Message-ID: <20230401220810.3563708-22-dmitry.baryshkov@linaro.org> (raw)
In-Reply-To: <20230401220810.3563708-1-dmitry.baryshkov@linaro.org>

Supporting SIDs greater than 9 required additional handling in order to
properly generatae hex values. Apply this customization to pm8150.dtsi.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 arch/arm64/boot/dts/qcom/pm8150.dtsi          | 16 ++++++++--------
 arch/arm64/boot/dts/qcom/pmic-dyn-footer.dtsi |  6 ++++++
 arch/arm64/boot/dts/qcom/pmic-dyn-header.dtsi |  6 ++++++
 3 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/pm8150.dtsi b/arch/arm64/boot/dts/qcom/pm8150.dtsi
index 77bb325e425b..37cc99e5d1a6 100644
--- a/arch/arm64/boot/dts/qcom/pm8150.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm8150.dtsi
@@ -58,7 +58,7 @@ trip2 {
 &spmi_bus {
 	pmic@0 {
 		compatible = "qcom,pm8150", "qcom,spmi-pmic";
-		reg = <PMIC_SID SPMI_USID>;
+		reg = <PMIC_SID_HEX SPMI_USID>;
 		#address-cells = <1>;
 		#size-cells = <0>;
 
@@ -70,7 +70,7 @@ pon: pon@800 {
 
 			pon_pwrkey: pwrkey {
 				compatible = "qcom,pm8941-pwrkey";
-				interrupts = <PMIC_SID 0x8 0x0 IRQ_TYPE_EDGE_BOTH>;
+				interrupts = <PMIC_SID_HEX 0x8 0x0 IRQ_TYPE_EDGE_BOTH>;
 				debounce = <15625>;
 				bias-pull-up;
 				linux,code = <KEY_POWER>;
@@ -80,7 +80,7 @@ pon_pwrkey: pwrkey {
 
 			pon_resin: resin {
 				compatible = "qcom,pm8941-resin";
-				interrupts = <PMIC_SID 0x8 0x1 IRQ_TYPE_EDGE_BOTH>;
+				interrupts = <PMIC_SID_HEX 0x8 0x1 IRQ_TYPE_EDGE_BOTH>;
 				debounce = <15625>;
 				bias-pull-up;
 
@@ -91,7 +91,7 @@ pon_resin: resin {
 		LABEL(temp): temp-alarm@2400 {
 			compatible = "qcom,spmi-temp-alarm";
 			reg = <0x2400>;
-			interrupts = <PMIC_SID 0x24 0x0 IRQ_TYPE_EDGE_BOTH>;
+			interrupts = <PMIC_SID_HEX 0x24 0x0 IRQ_TYPE_EDGE_BOTH>;
 			io-channels = <&LABEL(adc) ADC5_DIE_TEMP>;
 			io-channel-names = "thermal";
 			#thermal-sensor-cells = <0>;
@@ -103,7 +103,7 @@ LABEL(adc): adc@3100 {
 			#address-cells = <1>;
 			#size-cells = <0>;
 			#io-channel-cells = <1>;
-			interrupts = <PMIC_SID 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
+			interrupts = <PMIC_SID_HEX 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
 
 			ref-gnd@0 {
 				reg = <ADC5_REF_GND>;
@@ -127,7 +127,7 @@ die-temp@6 {
 		LABEL(adc_tm): adc-tm@3500 {
 			compatible = "qcom,spmi-adc-tm5";
 			reg = <0x3500>;
-			interrupts = <PMIC_SID 0x35 0x0 IRQ_TYPE_EDGE_RISING>;
+			interrupts = <PMIC_SID_HEX 0x35 0x0 IRQ_TYPE_EDGE_RISING>;
 			#thermal-sensor-cells = <1>;
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -138,7 +138,7 @@ rtc@6000 {
 			compatible = "qcom,pm8941-rtc";
 			reg = <0x6000>, <0x6100>;
 			reg-names = "rtc", "alarm";
-			interrupts = <PMIC_SID 0x61 0x1 IRQ_TYPE_NONE>;
+			interrupts = <PMIC_SID_HEX 0x61 0x1 IRQ_TYPE_NONE>;
 		};
 
 		LABEL(gpios): gpio@c000 {
@@ -154,7 +154,7 @@ LABEL(gpios): gpio@c000 {
 
 	pmic@PMIC_SID1 {
 		compatible = "qcom,pm8150", "qcom,spmi-pmic";
-		reg = <PMIC_SID1 SPMI_USID>;
+		reg = <PMIC_SID1_HEX SPMI_USID>;
 		#address-cells = <1>;
 		#size-cells = <0>;
 	};
diff --git a/arch/arm64/boot/dts/qcom/pmic-dyn-footer.dtsi b/arch/arm64/boot/dts/qcom/pmic-dyn-footer.dtsi
index 83a2bada48ff..f3743ef3aa13 100644
--- a/arch/arm64/boot/dts/qcom/pmic-dyn-footer.dtsi
+++ b/arch/arm64/boot/dts/qcom/pmic-dyn-footer.dtsi
@@ -11,6 +11,12 @@
 
 #undef NODE
 
+#undef HEX
+#undef _HEX
+
+#undef PMIC_SID_HEX
+#undef PMIC_SID1_HEX
+
 #undef PMIC_SID
 #undef PMIC_SID1
 #undef PMIC_LABEL
diff --git a/arch/arm64/boot/dts/qcom/pmic-dyn-header.dtsi b/arch/arm64/boot/dts/qcom/pmic-dyn-header.dtsi
index bb41c9387aba..640d1bf5ce8e 100644
--- a/arch/arm64/boot/dts/qcom/pmic-dyn-header.dtsi
+++ b/arch/arm64/boot/dts/qcom/pmic-dyn-header.dtsi
@@ -18,3 +18,9 @@
 #define __LABEL(pmic, name) pmic ## _ ## name
 
 #define NODE(name) PMIC_NODE ##-##  name
+
+#define HEX(sid) _HEX(sid)
+#define _HEX(sid) 0x## sid
+
+#define PMIC_SID_HEX HEX(PMIC_SID)
+#define PMIC_SID1_HEX HEX(PMIC_SID1)
-- 
2.30.2


  parent reply	other threads:[~2023-04-01 22:08 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-01 22:07 [PATCH v2 00/22] arm64: dts: qcom: remove duplication in PMIC declarations Dmitry Baryshkov
2023-04-01 22:07 ` [PATCH v2 01/22] arm64: dts: qcom: pm8350: fix thermal zone node name Dmitry Baryshkov
2023-04-03  9:55   ` Konrad Dybcio
2023-04-01 22:07 ` [PATCH v2 02/22] arm64: dts: qcom: pm8350b: " Dmitry Baryshkov
2023-04-02 10:34   ` Krzysztof Kozlowski
2023-04-02 11:02     ` Dmitry Baryshkov
2023-04-03  9:09       ` Krzysztof Kozlowski
2023-04-03  9:50         ` Dmitry Baryshkov
2023-04-03 10:00           ` Konrad Dybcio
2023-04-03 10:06             ` Krzysztof Kozlowski
2023-04-01 22:07 ` [PATCH v2 03/22] arm64: dts: qcom: sc8280xp-pmics: use pmk8350 specifics for pon device Dmitry Baryshkov
2023-04-02  9:42   ` Krzysztof Kozlowski
2023-04-02 10:25     ` Dmitry Baryshkov
2023-04-02 10:32       ` Krzysztof Kozlowski
2023-04-02 11:03         ` Dmitry Baryshkov
2023-04-02 11:12           ` Krzysztof Kozlowski
2023-04-03 10:06             ` Konrad Dybcio
2023-04-03  6:32   ` Johan Hovold
2023-04-01 22:07 ` [PATCH v2 04/22] arm64: dts: qcom: sc8280xp-pmics: correct interrupt routing for pm8280_2_temp_alarm Dmitry Baryshkov
2023-04-03 10:07   ` Konrad Dybcio
2023-04-01 22:07 ` [PATCH v2 05/22] dt-bindings: iio: qcom,spmi-adc7-pmk8350.h: include sid into defines Dmitry Baryshkov
2023-04-01 22:07 ` [PATCH v2 06/22] arm64: dts: qcom: pmk8350: rename pon label Dmitry Baryshkov
2023-04-01 22:07 ` [PATCH v2 07/22] arm64: dts: qcom: pmk8350: port sdam_6 device from sc8280xp-pmics Dmitry Baryshkov
2023-04-03 10:09   ` Konrad Dybcio
2023-04-01 22:07 ` [PATCH v2 08/22] arm64: dts: qcom: pmk8350: rename PMK8350_SID to PMIC_SID Dmitry Baryshkov
2023-04-03 10:11   ` Konrad Dybcio
2023-04-01 22:07 ` [PATCH v2 09/22] arm64: dts: qcom: pmk8350: allow overriding the label Dmitry Baryshkov
2023-04-02  9:44   ` Krzysztof Kozlowski
2023-04-02 11:54     ` Dmitry Baryshkov
2023-04-03 10:14   ` Konrad Dybcio
2023-04-03 11:06     ` Dmitry Baryshkov
2023-04-01 22:07 ` [PATCH v2 10/22] arm64: dts: qcom: pmk8350: use interrupts-extended for IRQ specification Dmitry Baryshkov
2023-04-03 10:16   ` Konrad Dybcio
2023-04-01 22:07 ` [PATCH v2 11/22] arm64: dts: qcom: sc8280xp*: use pmk8350.dtsi Dmitry Baryshkov
2023-04-01 22:08 ` [PATCH v2 12/22] arm64: dts: qcom: pm8350: allow overriding SID and label Dmitry Baryshkov
2023-04-01 22:08 ` [PATCH v2 13/22] arm64: dts: qcom: pm8350: use interrupts-extended for IRQ specification Dmitry Baryshkov
2023-04-01 22:08 ` [PATCH v2 14/22] arm64: dts: qcom: sc8280xp*: use pm8350.dtsi Dmitry Baryshkov
2023-04-01 22:08 ` [PATCH v2 15/22] arm64: dts: qcom: pm8350c: move thermal zone declaration to the top Dmitry Baryshkov
2023-04-01 22:08 ` [PATCH v2 16/22] arm64: dts: qcom: pm8350c: allow overriding SID and label Dmitry Baryshkov
2023-04-01 22:08 ` [PATCH v2 17/22] arm64: dts: qcom: pm8350c: use interrupts-extended for IRQ specification Dmitry Baryshkov
2023-04-01 22:08 ` [PATCH v2 18/22] arm64: dts: qcom: sc8280xp*: use pm8350c.dtsi Dmitry Baryshkov
2023-04-01 22:08 ` [PATCH v2 19/22] arm64: dts: qcom: sc8280xp*: use pmr735a.dtsi Dmitry Baryshkov
2023-04-01 22:08 ` [PATCH v2 20/22] arm64: dts: qcom: pm8150: convert to use dynamic SID/LABEL Dmitry Baryshkov
2023-04-02  9:47   ` Krzysztof Kozlowski
2023-04-01 22:08 ` Dmitry Baryshkov [this message]
2023-04-02  9:51   ` [PATCH v2 21/22] arch: arm64: dts: qcom: pm8150: support SID greater that 9 Krzysztof Kozlowski
2023-04-03 10:35     ` Konrad Dybcio
2023-04-03 11:45       ` Dmitry Baryshkov
2023-04-03 12:56         ` Krzysztof Kozlowski
2023-04-03 13:56           ` Dmitry Baryshkov
2023-04-01 22:08 ` [PATCH v2 22/22] arm64: dts: qcom sa8540p-pmics: switch to pm8150.dtsi Dmitry Baryshkov
2023-04-02  9:55 ` [PATCH v2 00/22] arm64: dts: qcom: remove duplication in PMIC declarations Krzysztof Kozlowski
2023-04-03 10:44   ` Konrad Dybcio
2023-04-03 11:37     ` Dmitry Baryshkov
2023-04-03 13:00     ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230401220810.3563708-22-dmitry.baryshkov@linaro.org \
    --to=dmitry.baryshkov@linaro.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=johan+linaro@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lars@metafoo.de \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox