OSDN Git Service

arm64: dts: qcom: pmk8350: Allow specifying arbitrary SID
authorKonrad Dybcio <konrad.dybcio@linaro.org>
Tue, 15 Nov 2022 15:27:20 +0000 (16:27 +0100)
committerBjorn Andersson <andersson@kernel.org>
Tue, 6 Dec 2022 17:05:29 +0000 (11:05 -0600)
PMK8350 is shipped on SID6 with some SoCs, for example with SM6375.
Add some preprocessor logic to allow changing the SID in cases like
this.

While I am not in favour of adding #if's into the device tree, this
is the least messy way to handle this. If one isn't specified, it
will default to 0 (as it has been previously).

Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20221115152727.9736-3-konrad.dybcio@linaro.org
arch/arm64/boot/dts/qcom/pmk8350.dtsi

index a7ec9d1..2730d97 100644 (file)
@@ -8,10 +8,15 @@
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/spmi/spmi.h>
 
+/* (Sadly) this PMIC can be configured to be at different SIDs */
+#ifndef PMK8350_SID
+       #define PMK8350_SID 0
+#endif
+
 &spmi_bus {
-       pmk8350: pmic@0 {
+       pmk8350: pmic@PMK8350_SID {
                compatible = "qcom,pmk8350", "qcom,spmi-pmic";
-               reg = <0x0 SPMI_USID>;
+               reg = <PMK8350_SID SPMI_USID>;
                #address-cells = <1>;
                #size-cells = <0>;
 
 
                        pon_pwrkey: pwrkey {
                                compatible = "qcom,pmk8350-pwrkey";
-                               interrupts = <0x0 0x13 0x7 IRQ_TYPE_EDGE_BOTH>;
+                               interrupts = <PMK8350_SID 0x13 0x7 IRQ_TYPE_EDGE_BOTH>;
                                linux,code = <KEY_POWER>;
                                status = "disabled";
                        };
 
                        pon_resin: resin {
                                compatible = "qcom,pmk8350-resin";
-                               interrupts = <0x0 0x13 0x6 IRQ_TYPE_EDGE_BOTH>;
+                               interrupts = <PMK8350_SID 0x13 0x6 IRQ_TYPE_EDGE_BOTH>;
                                status = "disabled";
                        };
                };
                        reg = <0x3100>;
                        #address-cells = <1>;
                        #size-cells = <0>;
-                       interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
+                       interrupts = <PMK8350_SID 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
                        #io-channel-cells = <1>;
                };
 
                pmk8350_adc_tm: adc-tm@3400 {
                        compatible = "qcom,adc-tm7";
                        reg = <0x3400>;
-                       interrupts = <0x0 0x34 0x0 IRQ_TYPE_EDGE_RISING>;
+                       interrupts = <PMK8350_SID 0x34 0x0 IRQ_TYPE_EDGE_RISING>;
                        #address-cells = <1>;
                        #size-cells = <0>;
                        #thermal-sensor-cells = <1>;
@@ -56,7 +61,7 @@
                        compatible = "qcom,pmk8350-rtc";
                        reg = <0x6100>, <0x6200>;
                        reg-names = "rtc", "alarm";
-                       interrupts = <0x0 0x62 0x1 IRQ_TYPE_EDGE_RISING>;
+                       interrupts = <PMK8350_SID 0x62 0x1 IRQ_TYPE_EDGE_RISING>;
                        status = "disabled";
                };