Skip to contentSkip to conversation

ARM: dts: qcom: pm8226: style fixes and new nodes

PATCH In review Rayyan Ansari 4 participants 10 messages Dec 28, 2022 – Dec 30, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover ARM: dts: qcom: pm8226: style fixes and new nodes

Hello,

The following patches sort the nodes and includes in PM8226's device tree file, and add new nodes for PON (with the resin sub-node) and IADC.

Changes since v1:
- Use adc@ generic node name
- Use specific PM8226 IADC compatible with fallback
- Document PM8226 IADC compatible

Rayyan Ansari (4):
ARM: dts: qcom: pm8226: sort includes alphabetically and nodes by
address
ARM: dts: qcom: pm8226: add PON device node along with resin sub-node
ARM: dts: qcom: pm8226: add IADC node
dt-bindings: iio/adc: qcom,spmi-iadc: document PM8226 compatible

 .../bindings/iio/adc/qcom,spmi-iadc.yaml      |  1 +
 arch/arm/boot/dts/qcom-pm8226.dtsi            | 46 +++++++++++++------
 2 files changed, 34 insertions(+), 13 deletions(-)
Signature · 1 line
2.39.0
#1 lore raw

PATCH v2 1/4 ARM: dts: qcom: pm8226: sort includes alphabetically and nodes by address

Sort the includes and nodes for consistency.

---
 arch/arm/boot/dts/qcom-pm8226.dtsi | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
arch/arm/boot/dts/qcom-pm8226.dtsi +8 -8
index eb36d3662464..a2092569970a 100644
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: BSD-3-Clause
+#include <dt-bindings/iio/qcom,spmi-vadc.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/spmi/spmi.h>
-#include <dt-bindings/iio/qcom,spmi-vadc.h>
 
 &spmi_bus {
 	pm8226_0: pm8226@0 {
@@ -41,13 +41,6 @@ smbb: charger@1000 {
 			chg_otg: otg-vbus { };
 		};
 
-		rtc@6000 {
-			compatible = "qcom,pm8941-rtc";
-			reg = <0x6000>, <0x6100>;
-			reg-names = "rtc", "alarm";
-			interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
-		};
-
 		pm8226_vadc: adc@3100 {
 			compatible = "qcom,spmi-vadc";
 			reg = <0x3100>;
@@ -81,6 +74,13 @@ adc-chan@f {
 			};
 		};
 
+		rtc@6000 {
+			compatible = "qcom,pm8941-rtc";
+			reg = <0x6000>, <0x6100>;
+			reg-names = "rtc", "alarm";
+			interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
+		};
+
 		pm8226_mpps: mpps@a000 {
 			compatible = "qcom,pm8226-mpp", "qcom,spmi-mpp";
 			reg = <0xa000>;
Signature · 1 line
2.39.0
Reviewed-by on v2 1/4
#2 lore raw

Re: [PATCH v2 1/4] ARM: dts: qcom: pm8226: sort includes alphabetically and nodes by address

Quoted 4 lines · Rayyan Ansari

Sort the includes and nodes for consistency.

---

Konrad

Quoted 44 lines
 arch/arm/boot/dts/qcom-pm8226.dtsi | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
arch/arm/boot/dts/qcom-pm8226.dtsi +8 -8
index eb36d3662464..a2092569970a 100644
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: BSD-3-Clause
+#include <dt-bindings/iio/qcom,spmi-vadc.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/spmi/spmi.h>
-#include <dt-bindings/iio/qcom,spmi-vadc.h>
 
 &spmi_bus {
 	pm8226_0: pm8226@0 {
@@ -41,13 +41,6 @@ smbb: charger@1000 {
 			chg_otg: otg-vbus { };
 		};
 
-		rtc@6000 {
-			compatible = "qcom,pm8941-rtc";
-			reg = <0x6000>, <0x6100>;
-			reg-names = "rtc", "alarm";
-			interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
-		};
-
 		pm8226_vadc: adc@3100 {
 			compatible = "qcom,spmi-vadc";
 			reg = <0x3100>;
@@ -81,6 +74,13 @@ adc-chan@f {
 			};
 		};
 
+		rtc@6000 {
+			compatible = "qcom,pm8941-rtc";
+			reg = <0x6000>, <0x6100>;
+			reg-names = "rtc", "alarm";
+			interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
+		};
+
 		pm8226_mpps: mpps@a000 {
 			compatible = "qcom,pm8226-mpp", "qcom,spmi-mpp";
 			reg = <0xa000>;
#3 lore raw

PATCH v2 2/4 ARM: dts: qcom: pm8226: add PON device node along with resin sub-node

In reply to Rayyan Ansari

The PON (Power On) device in PM8226 supports both the power key and resin (reset input).
The reset input is usually connected to a physical volume up/down button.

---
 arch/arm/boot/dts/qcom-pm8226.dtsi | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)
arch/arm/boot/dts/qcom-pm8226.dtsi +19 -5
index a2092569970a..6af259218f63 100644
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: BSD-3-Clause
 #include <dt-bindings/iio/qcom,spmi-vadc.h>
+#include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/spmi/spmi.h>
 
@@ -10,12 +11,25 @@ pm8226_0: pm8226@0 {
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-		pwrkey@800 {
-			compatible = "qcom,pm8941-pwrkey";
+		pon@800 {
+			compatible = "qcom,pm8916-pon";
 			reg = <0x800>;
-			interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
-			debounce = <15625>;
-			bias-pull-up;
+
+			pwrkey {
+				compatible = "qcom,pm8941-pwrkey";
+				interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
+				debounce = <15625>;
+				bias-pull-up;
+				linux,code = <KEY_POWER>;
+			};
+
+			pm8226_resin: resin {
+				compatible = "qcom,pm8941-resin";
+				interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
+				debounce = <15625>;
+				bias-pull-up;
+				status = "disabled";
+			};
 		};
 
 		smbb: charger@1000 {
Signature · 1 line
2.39.0
#4 lore raw

Re: [PATCH v2 2/4] ARM: dts: qcom: pm8226: add PON device node along with resin sub-node

Quoted 29 lines · Rayyan Ansari

The PON (Power On) device in PM8226 supports both the power key and resin (reset input).
The reset input is usually connected to a physical volume up/down button.

---
 arch/arm/boot/dts/qcom-pm8226.dtsi | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)
arch/arm/boot/dts/qcom-pm8226.dtsi +3 -2
index a2092569970a..6af259218f63 100644
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: BSD-3-Clause
 #include <dt-bindings/iio/qcom,spmi-vadc.h>
+#include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/spmi/spmi.h>
 
@@ -10,12 +11,25 @@ pm8226_0: pm8226@0 {
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-		pwrkey@800 {
-			compatible = "qcom,pm8941-pwrkey";
+		pon@800 {
+			compatible = "qcom,pm8916-pon";
 			reg = <0x800>;

arch/arm/boot/dts/qcom-pm8226.dtsi pm8226_0: pm8226@0 { · line 23

Quoted 10 lines
arch/arm/boot/dts/qcom-pm8226.dtsi +7 -3
-			interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
-			debounce = <15625>;
-			bias-pull-up;
+
+			pwrkey {
+				compatible = "qcom,pm8941-pwrkey";
+				interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
+				debounce = <15625>;
+				bias-pull-up;
+				linux,code = <KEY_POWER>;

That's redundant, the driver sets this by default if linux,code is not found.

Konrad

Quoted 12 lines
arch/arm/boot/dts/qcom-pm8226.dtsi +9 -0
+			};
+
+			pm8226_resin: resin {
+				compatible = "qcom,pm8941-resin";
+				interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
+				debounce = <15625>;
+				bias-pull-up;
+				status = "disabled";
+			};
 		};
 
 		smbb: charger@1000 {
#5 lore raw

PATCH v2 3/4 ARM: dts: qcom: pm8226: add IADC node

In reply to Rayyan Ansari

Add a node for the current ADC (IADC) found in PM8226.

---
 arch/arm/boot/dts/qcom-pm8226.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/boot/dts/qcom-pm8226.dtsi +6 -0
index 6af259218f63..46ba84f86c9f 100644
@@ -88,6 +88,12 @@ adc-chan@f {
 			};
 		};
 
+		pm8226_iadc: adc@3600 {
+			compatible = "qcom,pm8226-iadc", "qcom,spmi-iadc";
+			reg = <0x3600>;
+			interrupts = <0x0 0x36 0x0 IRQ_TYPE_EDGE_RISING>;
+		};
+
 		rtc@6000 {
 			compatible = "qcom,pm8941-rtc";
 			reg = <0x6000>, <0x6100>;
Signature · 1 line
2.39.0
#6 lore raw

Re: [PATCH v2 3/4] ARM: dts: qcom: pm8226: add IADC node

Quoted 12 lines · Rayyan Ansari

Add a node for the current ADC (IADC) found in PM8226.

---
 arch/arm/boot/dts/qcom-pm8226.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/boot/dts/qcom-pm8226.dtsi +0 -0
index 6af259218f63..46ba84f86c9f 100644

arch/arm/boot/dts/qcom-pm8226.dtsi adc-chan@f { · line 92

Quoted 5 lines
arch/arm/boot/dts/qcom-pm8226.dtsi +2 -0
@@ -88,6 +88,12 @@ adc-chan@f {
 			};
 		};
 
+		pm8226_iadc: adc@3600 {
+			compatible = "qcom,pm8226-iadc", "qcom,spmi-iadc";

This needs a bindings update (unless it was merged beforehand somehow).

Konrad

Quoted 7 lines
arch/arm/boot/dts/qcom-pm8226.dtsi +4 -0
+			reg = <0x3600>;
+			interrupts = <0x0 0x36 0x0 IRQ_TYPE_EDGE_RISING>;
+		};
+
 		rtc@6000 {
 			compatible = "qcom,pm8941-rtc";
 			reg = <0x6000>, <0x6100>;
#7 lore raw

PATCH v2 4/4 dt-bindings: iio/adc: qcom,spmi-iadc: document PM8226 compatible

In reply to Rayyan Ansari

Document the compatible for the IADC used on PM8226.

---
 Documentation/devicetree/bindings/iio/adc/qcom,spmi-iadc.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/iio/adc/qcom,spmi-iadc.yaml +1 -0
index fa855baa368c..18aaf6df179d 100644
@@ -20,6 +20,7 @@ properties:
   compatible:
     items:
       - enum:
+          - qcom,pm8226-iadc
           - qcom,pm8941-iadc
       - const: qcom,spmi-iadc
 
Signature · 1 line
2.39.0
maintainer
#9 lore raw

Re: [PATCH v2 4/4] dt-bindings: iio/adc: qcom,spmi-iadc: document PM8226 compatible

Quoted 7 lines · On Thu, 29 Dec 2022 09:47:27 +0100 Krzysztof Kozlowski…
Quoted 3 lines · Rayyan Ansari

Document the compatible for the IADC used on PM8226.

Applied to the togreg branch of iio.git and initially pushed out as testing for 0-day to take a poke at it.

Thanks,

Jonathan

Quoted 4 lines

Best regards,
Krzysztof