Skip to contentSkip to conversation

arm64: dts: qcom: r0q: enable more peripherals

PATCH Superseded Eric Gonçalves 4 participants 33 messages Sep 20, 2025 – Oct 20, 2025

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover arm64: dts: qcom: r0q: enable more peripherals

This patchset adds support for multiple devices found on the Galaxy S22, side buttons, touchscreen, max77705 charger/fuelgauge, RTC and UFS. It depends on "Input: add support for the STM FTS2BA61Y touchscreen" for TS to be enabled.

Thanks!

Eric Gonçalves (5):
arm64: dts: qcom: r0q: add gpio keys
arm64: dts: qcom: r0q: add touchscreen support
arm64: dts: qcom: r0q: enable max77705 PMIC
arm64: dts: qcom: r0q: enable hardware clocks
arm64: dts: qcom: r0q: enable ufs storage

 .../boot/dts/qcom/sm8450-samsung-r0q.dts      | 308 +++++++++++++++++-
 1 file changed, 299 insertions(+), 9 deletions(-)
Signature · 1 line
2.51.0
#1 lore raw

PATCH 1/5 arm64: dts: qcom: r0q: add gpio keys

Add GPIO keys support to Samsung Galaxy S22 (r0q).

---
 .../boot/dts/qcom/sm8450-samsung-r0q.dts      | 53 +++++++++++++++----
 1 file changed, 44 insertions(+), 9 deletions(-)
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +44 -9
index 880d74ae6032..70e953824996 100644
@@ -2,11 +2,12 @@
 
 /dts-v1/;
 
+#include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
-
 #include "sm8450.dtsi"
 #include "pm8350.dtsi"
 #include "pm8350c.dtsi"
+#include "pmk8350.dtsi"
 
 / {
 	model = "Samsung Galaxy S22 5G";
@@ -28,13 +29,19 @@ framebuffer: framebuffer@b8000000 {
 		};
 	};
 
-	vph_pwr: regulator-vph-pwr {
-		compatible = "regulator-fixed";
-		regulator-name = "vph_pwr";
-		regulator-min-microvolt = <3700000>;
-		regulator-max-microvolt = <3700000>;
-		regulator-always-on;
-		regulator-boot-on;
+	gpio-keys {
+		compatible = "gpio-keys";
+		autorepeat;
+
+		pinctrl-0 = <&vol_up_n>;
+		pinctrl-names = "default";
+
+		key-vol-up {
+			label = "Volume Up";
+			linux,code = <KEY_VOLUMEUP>;
+			gpios = <&pm8350_gpios 6 GPIO_ACTIVE_LOW>;
+			debounce-interval = <15>;
+		};
 	};
 
 	reserved-memory {
@@ -47,6 +54,15 @@ splash-region@b8000000 {
 			no-map;
 		};
 	};
+
+	vph_pwr: regulator-vph-pwr {
+		compatible = "regulator-fixed";
+		regulator-name = "vph_pwr";
+		regulator-min-microvolt = <3700000>;
+		regulator-max-microvolt = <3700000>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
 };
 
 &apps_rsc {
@@ -119,8 +135,27 @@ vreg_l1c_1p8: ldo1 {
 	};
 };
 
+&pm8350_gpios {
+	vol_up_n: vol-up-n-state {
+		pins = "gpio6";
+		function = "normal";
+		power-source = <1>;
+		input-enable;
+	};
+};
+
+&pon_pwrkey {
+	status = "okay";
+};
+
+&pon_resin {
+	linux,code = <KEY_VOLUMEDOWN>;
+
+	status = "okay";
+};
+
 &tlmm {
-	gpio-reserved-ranges = <36 4>; /* SPI (not linked to anything) */
+	gpio-reserved-ranges = <36 4>; /* SPI (Unused) */
 };
 
 &usb_1 {
Signature · 1 line
2.51.0
#2 lore raw

Re: [PATCH 1/5] arm64: dts: qcom: r0q: add gpio keys

Quoted 26 lines · Eric Gonçalves

Add GPIO keys support to Samsung Galaxy S22 (r0q).

---
 .../boot/dts/qcom/sm8450-samsung-r0q.dts      | 53 +++++++++++++++----
 1 file changed, 44 insertions(+), 9 deletions(-)
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +2 -1
index 880d74ae6032..70e953824996 100644
@@ -2,11 +2,12 @@
 
 /dts-v1/;
 
+#include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
-
 #include "sm8450.dtsi"
 #include "pm8350.dtsi"
 #include "pm8350c.dtsi"
+#include "pmk8350.dtsi"
 
 / {
 	model = "Samsung Galaxy S22 5G";

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts framebuffer: framebuffer@b8000000 { · line 37

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +0 -7
@@ -28,13 +29,19 @@ framebuffer: framebuffer@b8000000 {
 		};
 	};
 
-	vph_pwr: regulator-vph-pwr {
-		compatible = "regulator-fixed";
-		regulator-name = "vph_pwr";
-		regulator-min-microvolt = <3700000>;
-		regulator-max-microvolt = <3700000>;
-		regulator-always-on;
-		regulator-boot-on;

Please don't mix up refactorings and new features. Split this patch into several.

Quoted 64 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +42 -1
+	gpio-keys {
+		compatible = "gpio-keys";
+		autorepeat;
+
+		pinctrl-0 = <&vol_up_n>;
+		pinctrl-names = "default";
+
+		key-vol-up {
+			label = "Volume Up";
+			linux,code = <KEY_VOLUMEUP>;
+			gpios = <&pm8350_gpios 6 GPIO_ACTIVE_LOW>;
+			debounce-interval = <15>;
+		};
 	};
 
 	reserved-memory {
@@ -47,6 +54,15 @@ splash-region@b8000000 {
 			no-map;
 		};
 	};
+
+	vph_pwr: regulator-vph-pwr {
+		compatible = "regulator-fixed";
+		regulator-name = "vph_pwr";
+		regulator-min-microvolt = <3700000>;
+		regulator-max-microvolt = <3700000>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
 };
 
 &apps_rsc {
@@ -119,8 +135,27 @@ vreg_l1c_1p8: ldo1 {
 	};
 };
 
+&pm8350_gpios {
+	vol_up_n: vol-up-n-state {
+		pins = "gpio6";
+		function = "normal";
+		power-source = <1>;
+		input-enable;
+	};
+};
+
+&pon_pwrkey {
+	status = "okay";
+};
+
+&pon_resin {
+	linux,code = <KEY_VOLUMEDOWN>;
+
+	status = "okay";
+};
+
 &tlmm {
-	gpio-reserved-ranges = <36 4>; /* SPI (not linked to anything) */
+	gpio-reserved-ranges = <36 4>; /* SPI (Unused) */
 };
 
 &usb_1 {
Signature · 1 line
2.51.0
Signature · 2 lines
With best wishes
Dmitry
#3 lore raw

Re: [PATCH 1/5] arm64: dts: qcom: r0q: add gpio keys

Quoted 30 lines · Dmitry Baryshkov
Quoted 29 lines · Eric Gonçalves

Add GPIO keys support to Samsung Galaxy S22 (r0q).

---
 .../boot/dts/qcom/sm8450-samsung-r0q.dts      | 53 +++++++++++++++----
 1 file changed, 44 insertions(+), 9 deletions(-)
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +2 -1
index 880d74ae6032..70e953824996 100644
@@ -2,11 +2,12 @@
 
 /dts-v1/;
 
+#include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
-
 #include "sm8450.dtsi"
 #include "pm8350.dtsi"
 #include "pm8350c.dtsi"
+#include "pmk8350.dtsi"
 
 / {
 	model = "Samsung Galaxy S22 5G";
@@ -28,13 +29,19 @@ framebuffer: framebuffer@b8000000 {
 		};
 	};
 
Quoted 10 lines

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts framebuffer: framebuffer@b8000000 { · line 37

Quoted 7 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +0 -7
-	vph_pwr: regulator-vph-pwr {
-		compatible = "regulator-fixed";
-		regulator-name = "vph_pwr";
-		regulator-min-microvolt = <3700000>;
-		regulator-max-microvolt = <3700000>;
-		regulator-always-on;
-		regulator-boot-on;

Please don't mix up refactorings and new features. Split this patch into several.

The patch only added gpio-keys node and pon_resin, pon_pwrkey. Do you mean I have to split each button into separate patches?

Quoted 61 lines
Quoted 61 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +42 -1
+	gpio-keys {
+		compatible = "gpio-keys";
+		autorepeat;
+
+		pinctrl-0 = <&vol_up_n>;
+		pinctrl-names = "default";
+
+		key-vol-up {
+			label = "Volume Up";
+			linux,code = <KEY_VOLUMEUP>;
+			gpios = <&pm8350_gpios 6 GPIO_ACTIVE_LOW>;
+			debounce-interval = <15>;
+		};
 	};
 
 	reserved-memory {
@@ -47,6 +54,15 @@ splash-region@b8000000 {
 			no-map;
 		};
 	};
+
+	vph_pwr: regulator-vph-pwr {
+		compatible = "regulator-fixed";
+		regulator-name = "vph_pwr";
+		regulator-min-microvolt = <3700000>;
+		regulator-max-microvolt = <3700000>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
 };
 
 &apps_rsc {
@@ -119,8 +135,27 @@ vreg_l1c_1p8: ldo1 {
 	};
 };
 
+&pm8350_gpios {
+	vol_up_n: vol-up-n-state {
+		pins = "gpio6";
+		function = "normal";
+		power-source = <1>;
+		input-enable;
+	};
+};
+
+&pon_pwrkey {
+	status = "okay";
+};
+
+&pon_resin {
+	linux,code = <KEY_VOLUMEDOWN>;
+
+	status = "okay";
+};
+
 &tlmm {
-	gpio-reserved-ranges = <36 4>; /* SPI (not linked to anything) */
+	gpio-reserved-ranges = <36 4>; /* SPI (Unused) */
 };
 
Quoted 5 lines
Quoted 4 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +0 -0
 &usb_1 {
Signature · 1 line
2.51.0

Resend because I forgot to CC the mailing lists

#4 lore raw

Re: [PATCH 1/5] arm64: dts: qcom: r0q: add gpio keys

Quoted 43 lines · Eric Gonçalves
Quoted 30 lines · Dmitry Baryshkov
Quoted 29 lines · Eric Gonçalves

Add GPIO keys support to Samsung Galaxy S22 (r0q).

---
 .../boot/dts/qcom/sm8450-samsung-r0q.dts      | 53 +++++++++++++++----
 1 file changed, 44 insertions(+), 9 deletions(-)
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +2 -1
index 880d74ae6032..70e953824996 100644
@@ -2,11 +2,12 @@
 
 /dts-v1/;
 
+#include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
-
 #include "sm8450.dtsi"
 #include "pm8350.dtsi"
 #include "pm8350c.dtsi"
+#include "pmk8350.dtsi"
 
 / {
 	model = "Samsung Galaxy S22 5G";
@@ -28,13 +29,19 @@ framebuffer: framebuffer@b8000000 {
 		};
 	};
 
Quoted 10 lines

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts framebuffer: framebuffer@b8000000 { · line 37

Quoted 7 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +0 -7
-	vph_pwr: regulator-vph-pwr {
-		compatible = "regulator-fixed";
-		regulator-name = "vph_pwr";
-		regulator-min-microvolt = <3700000>;
-		regulator-max-microvolt = <3700000>;
-		regulator-always-on;
-		regulator-boot-on;

Please don't mix up refactorings and new features. Split this patch into several.

Quoted 3 lines

The patch only added gpio-keys node and pon_resin, pon_pwrkey. Do you mean I have to split each button into separate patches?

No. The patch also moves regulator-vph-pwr and changes the comment in the TLMM node.

Quoted 67 lines
Quoted 61 lines
Quoted 61 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +42 -1
+	gpio-keys {
+		compatible = "gpio-keys";
+		autorepeat;
+
+		pinctrl-0 = <&vol_up_n>;
+		pinctrl-names = "default";
+
+		key-vol-up {
+			label = "Volume Up";
+			linux,code = <KEY_VOLUMEUP>;
+			gpios = <&pm8350_gpios 6 GPIO_ACTIVE_LOW>;
+			debounce-interval = <15>;
+		};
 	};
 
 	reserved-memory {
@@ -47,6 +54,15 @@ splash-region@b8000000 {
 			no-map;
 		};
 	};
+
+	vph_pwr: regulator-vph-pwr {
+		compatible = "regulator-fixed";
+		regulator-name = "vph_pwr";
+		regulator-min-microvolt = <3700000>;
+		regulator-max-microvolt = <3700000>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
 };
 
 &apps_rsc {
@@ -119,8 +135,27 @@ vreg_l1c_1p8: ldo1 {
 	};
 };
 
+&pm8350_gpios {
+	vol_up_n: vol-up-n-state {
+		pins = "gpio6";
+		function = "normal";
+		power-source = <1>;
+		input-enable;
+	};
+};
+
+&pon_pwrkey {
+	status = "okay";
+};
+
+&pon_resin {
+	linux,code = <KEY_VOLUMEDOWN>;
+
+	status = "okay";
+};
+
 &tlmm {
-	gpio-reserved-ranges = <36 4>; /* SPI (not linked to anything) */
+	gpio-reserved-ranges = <36 4>; /* SPI (Unused) */
 };
 
Quoted 5 lines
Quoted 4 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +0 -0
 &usb_1 {
Signature · 1 line
2.51.0

Resend because I forgot to CC the mailing lists

Signature · 2 lines
With best wishes
Dmitry
#5 lore raw

Re: [PATCH 1/5] arm64: dts: qcom: r0q: add gpio keys

Quoted 44 lines · Dmitry Baryshkov
Quoted 43 lines · Eric Gonçalves
Quoted 40 lines · Dmitry Baryshkov
Quoted 26 lines · Eric Gonçalves

Add GPIO keys support to Samsung Galaxy S22 (r0q).

---
 .../boot/dts/qcom/sm8450-samsung-r0q.dts      | 53 +++++++++++++++----
 1 file changed, 44 insertions(+), 9 deletions(-)
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +2 -1
index 880d74ae6032..70e953824996 100644
@@ -2,11 +2,12 @@
 
 /dts-v1/;
 
+#include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
-
 #include "sm8450.dtsi"
 #include "pm8350.dtsi"
 #include "pm8350c.dtsi"
+#include "pmk8350.dtsi"
 
 / {
 	model = "Samsung Galaxy S22 5G";

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts framebuffer: framebuffer@b8000000 { · line 37

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +0 -7
@@ -28,13 +29,19 @@ framebuffer: framebuffer@b8000000 {
 		};
 	};
 
-	vph_pwr: regulator-vph-pwr {
-		compatible = "regulator-fixed";
-		regulator-name = "vph_pwr";
-		regulator-min-microvolt = <3700000>;
-		regulator-max-microvolt = <3700000>;
-		regulator-always-on;
-		regulator-boot-on;

Please don't mix up refactorings and new features. Split this patch into several.

Quoted 7 lines
Quoted 3 lines

The patch only added gpio-keys node and pon_resin, pon_pwrkey. Do you mean I have to split each button into separate patches?

No. The patch also moves regulator-vph-pwr and changes the comment in the TLMM node.

I thought they would be too small to be patches on their own. Is it okay if I split them into 2: arm64: dts: qcom: r0q: small refactor and arm64: dts: qcom: r0q: add gpio keys?

Quoted 68 lines
Quoted 67 lines
Quoted 61 lines
Quoted 61 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +42 -1
+	gpio-keys {
+		compatible = "gpio-keys";
+		autorepeat;
+
+		pinctrl-0 = <&vol_up_n>;
+		pinctrl-names = "default";
+
+		key-vol-up {
+			label = "Volume Up";
+			linux,code = <KEY_VOLUMEUP>;
+			gpios = <&pm8350_gpios 6 GPIO_ACTIVE_LOW>;
+			debounce-interval = <15>;
+		};
 	};
 
 	reserved-memory {
@@ -47,6 +54,15 @@ splash-region@b8000000 {
 			no-map;
 		};
 	};
+
+	vph_pwr: regulator-vph-pwr {
+		compatible = "regulator-fixed";
+		regulator-name = "vph_pwr";
+		regulator-min-microvolt = <3700000>;
+		regulator-max-microvolt = <3700000>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
 };
 
 &apps_rsc {
@@ -119,8 +135,27 @@ vreg_l1c_1p8: ldo1 {
 	};
 };
 
+&pm8350_gpios {
+	vol_up_n: vol-up-n-state {
+		pins = "gpio6";
+		function = "normal";
+		power-source = <1>;
+		input-enable;
+	};
+};
+
+&pon_pwrkey {
+	status = "okay";
+};
+
+&pon_resin {
+	linux,code = <KEY_VOLUMEDOWN>;
+
+	status = "okay";
+};
+
 &tlmm {
-	gpio-reserved-ranges = <36 4>; /* SPI (not linked to anything) */
+	gpio-reserved-ranges = <36 4>; /* SPI (Unused) */
 };
 
Quoted 5 lines
Quoted 4 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +0 -0
 &usb_1 {
Signature · 1 line
2.51.0

Resend because I forgot to CC the mailing lists

#6 lore raw

Re: [PATCH 1/5] arm64: dts: qcom: r0q: add gpio keys

Quoted 51 lines · Eric Gonçalves
Quoted 48 lines · Dmitry Baryshkov
Quoted 46 lines · Eric Gonçalves
Quoted 30 lines · Dmitry Baryshkov
Quoted 29 lines · Eric Gonçalves

Add GPIO keys support to Samsung Galaxy S22 (r0q).

---
 .../boot/dts/qcom/sm8450-samsung-r0q.dts      | 53 +++++++++++++++----
 1 file changed, 44 insertions(+), 9 deletions(-)
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +2 -1
index 880d74ae6032..70e953824996 100644
@@ -2,11 +2,12 @@
 
 /dts-v1/;
 
+#include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
-
 #include "sm8450.dtsi"
 #include "pm8350.dtsi"
 #include "pm8350c.dtsi"
+#include "pmk8350.dtsi"
 
 / {
 	model = "Samsung Galaxy S22 5G";
@@ -28,13 +29,19 @@ framebuffer: framebuffer@b8000000 {
 		};
 	};
 
Quoted 10 lines

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts framebuffer: framebuffer@b8000000 { · line 37

Quoted 7 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +0 -7
-	vph_pwr: regulator-vph-pwr {
-		compatible = "regulator-fixed";
-		regulator-name = "vph_pwr";
-		regulator-min-microvolt = <3700000>;
-		regulator-max-microvolt = <3700000>;
-		regulator-always-on;
-		regulator-boot-on;

Please don't mix up refactorings and new features. Split this patch into several.

The patch only added gpio-keys node and pon_resin, pon_pwrkey. Do you mean I have to split each button into separate patches?

Quoted 7 lines
Quoted 3 lines

No. The patch also moves regulator-vph-pwr and changes the comment in the TLMM node.

I thought they would be too small to be patches on their own. Is it okay if I split them into 2: arm64: dts: qcom: r0q: small refactor and arm64: dts: qcom: r0q: add gpio keys?

SGTM.

Quoted 68 lines
Quoted 68 lines
Quoted 67 lines
Quoted 61 lines
Quoted 61 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +42 -1
+	gpio-keys {
+		compatible = "gpio-keys";
+		autorepeat;
+
+		pinctrl-0 = <&vol_up_n>;
+		pinctrl-names = "default";
+
+		key-vol-up {
+			label = "Volume Up";
+			linux,code = <KEY_VOLUMEUP>;
+			gpios = <&pm8350_gpios 6 GPIO_ACTIVE_LOW>;
+			debounce-interval = <15>;
+		};
 	};
 
 	reserved-memory {
@@ -47,6 +54,15 @@ splash-region@b8000000 {
 			no-map;
 		};
 	};
+
+	vph_pwr: regulator-vph-pwr {
+		compatible = "regulator-fixed";
+		regulator-name = "vph_pwr";
+		regulator-min-microvolt = <3700000>;
+		regulator-max-microvolt = <3700000>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
 };
 
 &apps_rsc {
@@ -119,8 +135,27 @@ vreg_l1c_1p8: ldo1 {
 	};
 };
 
+&pm8350_gpios {
+	vol_up_n: vol-up-n-state {
+		pins = "gpio6";
+		function = "normal";
+		power-source = <1>;
+		input-enable;
+	};
+};
+
+&pon_pwrkey {
+	status = "okay";
+};
+
+&pon_resin {
+	linux,code = <KEY_VOLUMEDOWN>;
+
+	status = "okay";
+};
+
 &tlmm {
-	gpio-reserved-ranges = <36 4>; /* SPI (not linked to anything) */
+	gpio-reserved-ranges = <36 4>; /* SPI (Unused) */
 };
 
Quoted 5 lines
Quoted 4 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +0 -0
 &usb_1 {
Signature · 1 line
2.51.0

Resend because I forgot to CC the mailing lists

Signature · 2 lines
With best wishes
Dmitry
#7 lore raw

PATCH 2/5 arm64: dts: qcom: r0q: add touchscreen support

In reply to Eric Gonçalves

Enable the ST-Microelectronics FTS2BA61Y touchscreen. This patch depends on "Input: add support for the STM FTS2BA61Y touchscreen".

The device has an issue where SPI 8 (the bus which the touchscreen is connected to) is not working properly right now, so spi-gpio is used instead.

---
 .../boot/dts/qcom/sm8450-samsung-r0q.dts      | 167 ++++++++++++++++++
 1 file changed, 167 insertions(+)
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +167 -0
index 70e953824996..7bf56564dfc6 100644
@@ -55,6 +55,45 @@ splash-region@b8000000 {
 		};
 	};
 
+	spi_gpio: spi-gpio@0 {
+		compatible = "spi-gpio";
+		pinctrl-names = "default", "sleep";
+		pinctrl-0 = <&spi_clk_tsp_active &spi_mosi_tsp_active &spi_miso_tsp_active>;
+		pinctrl-1 = <&spi_clk_tsp_sleep &spi_mosi_tsp_sleep &spi_miso_tsp_sleep>;
+
+		status = "okay";
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		sck-gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>;
+		mosi-gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>;
+		miso-gpios = <&tlmm 28 GPIO_ACTIVE_HIGH>;
+		cs-gpios = <&tlmm 31 GPIO_ACTIVE_LOW>;
+
+		num-chipselects = <1>;
+
+		spi-max-frequency = <5000000>;
+
+		touchscreen@0 {
+			compatible = "st,fts2ba61y";
+			reg = <0>;
+			spi-max-frequency = <5000000>;
+
+			vdd-supply = <&vreg_l8c_1p8>;
+			avdd-supply = <&vreg_l11c_3p0>;
+
+			interrupt-parent = <&tlmm>;
+			interrupts = <46 IRQ_TYPE_LEVEL_LOW>;
+
+			pinctrl-names = "default", "sleep";
+			pinctrl-0 = <&tsp_int_active>;
+			pinctrl-1 = <&tsp_int_sleep>;
+
+			status = "okay";
+		};
+	};
+
 	vph_pwr: regulator-vph-pwr {
 		compatible = "regulator-fixed";
 		regulator-name = "vph_pwr";
@@ -132,6 +171,18 @@ vreg_l1c_1p8: ldo1 {
 			regulator-max-microvolt = <1800000>;
 			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
 		};
+
+		vreg_l8c_1p8: ldo8 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};
+
+		vreg_l11c_3p0: ldo11 {
+			regulator-min-microvolt = <3000000>;
+			regulator-max-microvolt = <3000000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};
 	};
 };
 
@@ -156,6 +207,122 @@ &pon_resin {
 
 &tlmm {
 	gpio-reserved-ranges = <36 4>; /* SPI (Unused) */
+
+	spi_clk_tsp_active: spi_clk_tsp_active {
+		mux {
+			pins = "gpio30";
+			function = "gpio";
+		};
+		config {
+			pins = "gpio30";
+			drive-strength = <6>;
+			bias-disable;
+		};
+	};
+
+	spi_clk_tsp_sleep: spi_clk_tsp_sleep {
+		mux {
+			pins = "gpio30";
+			function = "gpio";
+		};
+		config {
+			pins = "gpio30";
+			drive-strength = <6>;
+			input-enable;
+			bias-pull-down;
+		};
+	};
+
+	spi_cs_tsp_active: spi_cs_tsp_active {
+		mux {
+			pins = "gpio31";
+			function = "gpio";
+		};
+		config {
+			pins = "gpio31";
+			drive-strength = <6>;
+			bias-disable;
+		};
+	};
+
+	spi_cs_tsp_sleep: spi_cs_tsp_sleep {
+		mux {
+			pins = "gpio31";
+			function = "gpio";
+		};
+		config {
+			pins = "gpio31";
+			drive-strength = <6>;
+			input-enable;
+			bias-pull-down;
+		};
+	};
+
+	spi_miso_tsp_active: spi_miso_tsp_active {
+		mux {
+			pins = "gpio28";
+			function = "gpio";
+		};
+		config {
+			pins = "gpio28";
+			drive-strength = <6>;
+			bias-disable;
+		};
+	};
+
+	spi_miso_tsp_sleep: spi_miso_tsp_sleep {
+		mux {
+			pins = "gpio28";
+			function = "gpio";
+		};
+		config {
+			pins = "gpio28";
+			drive-strength = <6>;
+			input-enable;
+			bias-pull-down;
+		};
+	};
+
+	spi_mosi_tsp_active: spi_mosi_tsp_active {
+		mux {
+			pins = "gpio29";
+			function = "gpio";
+		};
+		config {
+			pins = "gpio29";
+			drive-strength = <6>;
+			bias-disable;
+		};
+	};
+
+	spi_mosi_tsp_sleep: spi_mosi_tsp_sleep {
+		mux {
+			pins = "gpio29";
+			function = "gpio";
+		};
+		config {
+			pins = "gpio29";
+			drive-strength = <6>;
+			input-enable;
+			bias-pull-down;
+		};
+	};
+
+	tsp_int_active: tsp_int_active {
+		pins = "gpio46";
+		function = "gpio";
+		drive-strength = <2>;
+		input-enable;
+		bias-disable;
+	};
+
+	tsp_int_sleep: tsp_int_sleep_state {
+		pins = "gpio46";
+		function = "gpio";
+		drive-strength = <2>;
+		input-enable;
+		bias-disable;
+	};
 };
 
 &usb_1 {
Signature · 1 line
2.51.0
#8 lore raw

Re: [PATCH 2/5] arm64: dts: qcom: r0q: add touchscreen support

Quoted 17 lines · Eric Gonçalves

Enable the ST-Microelectronics FTS2BA61Y touchscreen. This patch depends on "Input: add support for the STM FTS2BA61Y touchscreen".

The device has an issue where SPI 8 (the bus which the touchscreen is connected to) is not working properly right now, so spi-gpio is used instead.

---
 .../boot/dts/qcom/sm8450-samsung-r0q.dts      | 167 ++++++++++++++++++
 1 file changed, 167 insertions(+)
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +0 -0
index 70e953824996..7bf56564dfc6 100644

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts splash-region@b8000000 { · line 57

Quoted 3 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +0 -0
@@ -55,6 +55,45 @@ splash-region@b8000000 {
 		};
 	};
 

Please add a comment that you have to use spi-gpio and ideally a brief description of the issue.

With that fixed:

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts splash-region@b8000000 { · line 64

Quoted 7 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +7 -0
+	spi_gpio: spi-gpio@0 {
+		compatible = "spi-gpio";
+		pinctrl-names = "default", "sleep";
+		pinctrl-0 = <&spi_clk_tsp_active &spi_mosi_tsp_active &spi_miso_tsp_active>;
+		pinctrl-1 = <&spi_clk_tsp_sleep &spi_mosi_tsp_sleep &spi_miso_tsp_sleep>;
+
+		status = "okay";

status isn't necessary for new devices. It's a default value.

Quoted 180 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +160 -0
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		sck-gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>;
+		mosi-gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>;
+		miso-gpios = <&tlmm 28 GPIO_ACTIVE_HIGH>;
+		cs-gpios = <&tlmm 31 GPIO_ACTIVE_LOW>;
+
+		num-chipselects = <1>;
+
+		spi-max-frequency = <5000000>;
+
+		touchscreen@0 {
+			compatible = "st,fts2ba61y";
+			reg = <0>;
+			spi-max-frequency = <5000000>;
+
+			vdd-supply = <&vreg_l8c_1p8>;
+			avdd-supply = <&vreg_l11c_3p0>;
+
+			interrupt-parent = <&tlmm>;
+			interrupts = <46 IRQ_TYPE_LEVEL_LOW>;
+
+			pinctrl-names = "default", "sleep";
+			pinctrl-0 = <&tsp_int_active>;
+			pinctrl-1 = <&tsp_int_sleep>;
+
+			status = "okay";
+		};
+	};
+
 	vph_pwr: regulator-vph-pwr {
 		compatible = "regulator-fixed";
 		regulator-name = "vph_pwr";
@@ -132,6 +171,18 @@ vreg_l1c_1p8: ldo1 {
 			regulator-max-microvolt = <1800000>;
 			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
 		};
+
+		vreg_l8c_1p8: ldo8 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};
+
+		vreg_l11c_3p0: ldo11 {
+			regulator-min-microvolt = <3000000>;
+			regulator-max-microvolt = <3000000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};
 	};
 };
 
@@ -156,6 +207,122 @@ &pon_resin {
 
 &tlmm {
 	gpio-reserved-ranges = <36 4>; /* SPI (Unused) */
+
+	spi_clk_tsp_active: spi_clk_tsp_active {
+		mux {
+			pins = "gpio30";
+			function = "gpio";
+		};
+		config {
+			pins = "gpio30";
+			drive-strength = <6>;
+			bias-disable;
+		};
+	};
+
+	spi_clk_tsp_sleep: spi_clk_tsp_sleep {
+		mux {
+			pins = "gpio30";
+			function = "gpio";
+		};
+		config {
+			pins = "gpio30";
+			drive-strength = <6>;
+			input-enable;
+			bias-pull-down;
+		};
+	};
+
+	spi_cs_tsp_active: spi_cs_tsp_active {
+		mux {
+			pins = "gpio31";
+			function = "gpio";
+		};
+		config {
+			pins = "gpio31";
+			drive-strength = <6>;
+			bias-disable;
+		};
+	};
+
+	spi_cs_tsp_sleep: spi_cs_tsp_sleep {
+		mux {
+			pins = "gpio31";
+			function = "gpio";
+		};
+		config {
+			pins = "gpio31";
+			drive-strength = <6>;
+			input-enable;
+			bias-pull-down;
+		};
+	};
+
+	spi_miso_tsp_active: spi_miso_tsp_active {
+		mux {
+			pins = "gpio28";
+			function = "gpio";
+		};
+		config {
+			pins = "gpio28";
+			drive-strength = <6>;
+			bias-disable;
+		};
+	};
+
+	spi_miso_tsp_sleep: spi_miso_tsp_sleep {
+		mux {
+			pins = "gpio28";
+			function = "gpio";
+		};
+		config {
+			pins = "gpio28";
+			drive-strength = <6>;
+			input-enable;
+			bias-pull-down;
+		};
+	};
+
+	spi_mosi_tsp_active: spi_mosi_tsp_active {
+		mux {
+			pins = "gpio29";
+			function = "gpio";
+		};
+		config {
+			pins = "gpio29";
+			drive-strength = <6>;
+			bias-disable;
+		};
+	};
+
+	spi_mosi_tsp_sleep: spi_mosi_tsp_sleep {
+		mux {
+			pins = "gpio29";
+			function = "gpio";
+		};
+		config {
+			pins = "gpio29";
+			drive-strength = <6>;
+			input-enable;
+			bias-pull-down;
+		};
+	};
+
+	tsp_int_active: tsp_int_active {
+		pins = "gpio46";
+		function = "gpio";
+		drive-strength = <2>;
+		input-enable;
+		bias-disable;
+	};
+
+	tsp_int_sleep: tsp_int_sleep_state {
+		pins = "gpio46";
+		function = "gpio";
+		drive-strength = <2>;
+		input-enable;
+		bias-disable;
+	};
 };
 
 &usb_1 {
Signature · 1 line
2.51.0
Signature · 2 lines
With best wishes
Dmitry
#9 lore raw

Re: [PATCH 2/5] arm64: dts: qcom: r0q: add touchscreen support

In reply to Eric Gonçalves
Quoted 9 lines · Eric Gonçalves

Enable the ST-Microelectronics FTS2BA61Y touchscreen. This patch depends on "Input: add support for the STM FTS2BA61Y touchscreen".

The device has an issue where SPI 8 (the bus which the touchscreen is connected to) is not working properly right now, so spi-gpio is used instead.

---

[...]

Quoted 4 lines

&tlmm {

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +2 -0
 	gpio-reserved-ranges = <36 4>; /* SPI (Unused) */
+
+	spi_clk_tsp_active: spi_clk_tsp_active {

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts &pon_resin { · line 221

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +10 -0
+		mux {
+			pins = "gpio30";
+			function = "gpio";
+		};
+		config {
+			pins = "gpio30";
+			drive-strength = <6>;
+			bias-disable;
+		};
+	};

Drop mux/config, put all the properties right under the pin definition

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+	spi_clk_tsp_sleep: spi_clk_tsp_sleep {

Underscores are forbidden in node names, use dashes instead

Konrad

#10 lore raw

Re: [PATCH 2/5] arm64: dts: qcom: r0q: add touchscreen support

Quoted 30 lines · Konrad Dybcio
Quoted 9 lines · Eric Gonçalves

Enable the ST-Microelectronics FTS2BA61Y touchscreen. This patch depends on "Input: add support for the STM FTS2BA61Y touchscreen".

The device has an issue where SPI 8 (the bus which the touchscreen is connected to) is not working properly right now, so spi-gpio is used instead.

---

[...]

Quoted 4 lines

&tlmm {

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +2 -0
 	gpio-reserved-ranges = <36 4>; /* SPI (Unused) */
+
+	spi_clk_tsp_active: spi_clk_tsp_active {

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts &pon_resin { · line 221

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +10 -0
+		mux {
+			pins = "gpio30";
+			function = "gpio";
+		};
+		config {
+			pins = "gpio30";
+			drive-strength = <6>;
+			bias-disable;
+		};
+	};

Drop mux/config, put all the properties right under the pin definition

Quoted 6 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+	spi_clk_tsp_sleep: spi_clk_tsp_sleep {

Underscores are forbidden in node names, use dashes instead

Konrad

Will do, thanks

#11 lore raw

PATCH 3/5 arm64: dts: qcom: r0q: enable max77705 PMIC

In reply to Eric Gonçalves

The Samsung Galaxy S22 uses max77705 as its charger, fuelgauge and haptic PMIC, enable the fuelgauge and charger for now.

---
 .../boot/dts/qcom/sm8450-samsung-r0q.dts      | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +34 -0
index 7bf56564dfc6..c1b0b21c0ec5 100644
@@ -14,6 +14,16 @@ / {
 	compatible = "samsung,r0q", "qcom,sm8450";
 	chassis-type = "handset";
 
+	battery: battery {
+		compatible = "simple-battery";
+
+		constant-charge-current-max-microamp = <2150000>;
+		charge-full-design-microamp-hours = <3700000>;
+		over-voltage-threshold-microvolt = <4500000>;
+		voltage-min-design-microvolt = <3400000>;
+		voltage-max-design-microvolt = <4350000>;
+	};
+
 	chosen {
 		#address-cells = <2>;
 		#size-cells = <2>;
@@ -186,6 +196,26 @@ vreg_l11c_3p0: ldo11 {
 	};
 };
 
+&i2c5 {
+	status = "okay";
+
+	max77705_charger: charger@69 {
+	    compatible = "maxim,max77705-charger";
+	    reg = <0x69>;
+	    monitored-battery = <&battery>;
+	    interrupt-parent = <&tlmm>;
+	    interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
+	};
+
+	fuel-gauge@36 {
+		reg = <0x36>;
+		compatible = "maxim,max77705-battery";
+		power-supplies = <&max77705_charger>;
+		interrupt-parent = <&tlmm>;
+		interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
+	};
+};
+
 &pm8350_gpios {
 	vol_up_n: vol-up-n-state {
 		pins = "gpio6";
@@ -345,3 +375,7 @@ &usb_1_hsphy {
 
 	status = "okay";
 };
+
+&qupv3_id_0 {
+	status = "okay";
+};
Signature · 1 line
2.51.0
#12 lore raw

Re: [PATCH 3/5] arm64: dts: qcom: r0q: enable max77705 PMIC

Quoted 30 lines · Eric Gonçalves

The Samsung Galaxy S22 uses max77705 as its charger, fuelgauge and haptic PMIC, enable the fuelgauge and charger for now.

---
 .../boot/dts/qcom/sm8450-samsung-r0q.dts      | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +10 -0
index 7bf56564dfc6..c1b0b21c0ec5 100644
@@ -14,6 +14,16 @@ / {
 	compatible = "samsung,r0q", "qcom,sm8450";
 	chassis-type = "handset";
 
+	battery: battery {
+		compatible = "simple-battery";
+
+		constant-charge-current-max-microamp = <2150000>;
+		charge-full-design-microamp-hours = <3700000>;
+		over-voltage-threshold-microvolt = <4500000>;
+		voltage-min-design-microvolt = <3400000>;
+		voltage-max-design-microvolt = <4350000>;
+	};
+
 	chosen {
 		#address-cells = <2>;
 		#size-cells = <2>;

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vreg_l11c_3p0: ldo11 { · line 200

Quoted 5 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +2 -0
@@ -186,6 +196,26 @@ vreg_l11c_3p0: ldo11 {
 	};
 };
 
+&i2c5 {
+	status = "okay";

Could you please also add 'clock-frequency' for this bus?

LGTM otherwise.

Quoted 32 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +22 -0
+
+	max77705_charger: charger@69 {
+	    compatible = "maxim,max77705-charger";
+	    reg = <0x69>;
+	    monitored-battery = <&battery>;
+	    interrupt-parent = <&tlmm>;
+	    interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
+	};
+
+	fuel-gauge@36 {
+		reg = <0x36>;
+		compatible = "maxim,max77705-battery";
+		power-supplies = <&max77705_charger>;
+		interrupt-parent = <&tlmm>;
+		interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
+	};
+};
+
 &pm8350_gpios {
 	vol_up_n: vol-up-n-state {
 		pins = "gpio6";
@@ -345,3 +375,7 @@ &usb_1_hsphy {
 
 	status = "okay";
 };
+
+&qupv3_id_0 {
+	status = "okay";
+};
Signature · 1 line
2.51.0
Signature · 2 lines
With best wishes
Dmitry
#13 lore raw

Re: [PATCH 3/5] arm64: dts: qcom: r0q: enable max77705 PMIC

Quoted 34 lines · Dmitry Baryshkov
Quoted 33 lines · Eric Gonçalves

The Samsung Galaxy S22 uses max77705 as its charger, fuelgauge and haptic PMIC, enable the fuelgauge and charger for now.

---
 .../boot/dts/qcom/sm8450-samsung-r0q.dts      | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +10 -0
index 7bf56564dfc6..c1b0b21c0ec5 100644
@@ -14,6 +14,16 @@ / {
 	compatible = "samsung,r0q", "qcom,sm8450";
 	chassis-type = "handset";
 
+	battery: battery {
+		compatible = "simple-battery";
+
+		constant-charge-current-max-microamp = <2150000>;
+		charge-full-design-microamp-hours = <3700000>;
+		over-voltage-threshold-microvolt = <4500000>;
+		voltage-min-design-microvolt = <3400000>;
+		voltage-max-design-microvolt = <4350000>;
+	};
+
 	chosen {
 		#address-cells = <2>;
 		#size-cells = <2>;
@@ -186,6 +196,26 @@ vreg_l11c_3p0: ldo11 {
 	};
 };
 
Quoted 4 lines

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vreg_l11c_3p0: ldo11 { · line 200

Quoted 2 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +2 -0
+&i2c5 {
+	status = "okay";

Could you please also add 'clock-frequency' for this bus?

Will do, thanks

Quoted 36 lines

LGTM otherwise.

Quoted 32 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +22 -0
+
+	max77705_charger: charger@69 {
+	    compatible = "maxim,max77705-charger";
+	    reg = <0x69>;
+	    monitored-battery = <&battery>;
+	    interrupt-parent = <&tlmm>;
+	    interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
+	};
+
+	fuel-gauge@36 {
+		reg = <0x36>;
+		compatible = "maxim,max77705-battery";
+		power-supplies = <&max77705_charger>;
+		interrupt-parent = <&tlmm>;
+		interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
+	};
+};
+
 &pm8350_gpios {
 	vol_up_n: vol-up-n-state {
 		pins = "gpio6";
@@ -345,3 +375,7 @@ &usb_1_hsphy {
 
 	status = "okay";
 };
+
+&qupv3_id_0 {
+	status = "okay";
+};
Signature · 1 line
2.51.0
#14 lore raw

Re: [PATCH 3/5] arm64: dts: qcom: r0q: enable max77705 PMIC

In reply to Eric Gonçalves
Quoted 5 lines · Eric Gonçalves

The Samsung Galaxy S22 uses max77705 as its charger, fuelgauge and haptic PMIC, enable the fuelgauge and charger for now.

---

[...]

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vreg_l11c_3p0: ldo11 { · line 204

Quoted 6 lines

+&i2c5 {

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +5 -0
+	status = "okay";
+
+	max77705_charger: charger@69 {
+	    compatible = "maxim,max77705-charger";
+	    reg = <0x69>;

Please use tabs consistently

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vreg_l11c_3p0: ldo11 { · line 207

Quoted 3 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +3 -0
+	    monitored-battery = <&battery>;
+	    interrupt-parent = <&tlmm>;
+	    interrupts = <5 IRQ_TYPE_LEVEL_LOW>;

interrupts-extended = <&tlmm 5 IRQ...>, here and below

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vreg_l11c_3p0: ldo11 { · line 211

Quoted 4 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +4 -0
+	};
+
+	fuel-gauge@36 {
+		reg = <0x36>;

sorting by unit address is welcome

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vreg_l11c_3p0: ldo11 { · line 216

Quoted 5 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +5 -0
+		compatible = "maxim,max77705-battery";
+		power-supplies = <&max77705_charger>;
+		interrupt-parent = <&tlmm>;
+		interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
+	};

These nodes should be children of "maxim,max77705" (see drivers/mfd/max77705.c)

Konrad

#15 lore raw

Re: [PATCH 3/5] arm64: dts: qcom: r0q: enable max77705 PMIC

Quoted 9 lines · Konrad Dybcio
Quoted 5 lines · Eric Gonçalves

The Samsung Galaxy S22 uses max77705 as its charger, fuelgauge and haptic PMIC, enable the fuelgauge and charger for now.

---

[...]

Quoted 8 lines

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vreg_l11c_3p0: ldo11 { · line 204

Quoted 6 lines

+&i2c5 {

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +5 -0
+	status = "okay";
+
+	max77705_charger: charger@69 {
+	    compatible = "maxim,max77705-charger";
+	    reg = <0x69>;

Please use tabs consistently

Sure

Quoted 6 lines

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vreg_l11c_3p0: ldo11 { · line 207

Quoted 4 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +3 -0
+	    monitored-battery = <&battery>;
+	    interrupt-parent = <&tlmm>;
+	    interrupts = <5 IRQ_TYPE_LEVEL_LOW>;

interrupts-extended = <&tlmm 5 IRQ...>, here and below

why extended?

Quoted 7 lines

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vreg_l11c_3p0: ldo11 { · line 211

Quoted 5 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +4 -0
+	};
+
+	fuel-gauge@36 {
+		reg = <0x36>;

sorting by unit address is welcome

Sure

Quoted 9 lines

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vreg_l11c_3p0: ldo11 { · line 216

Quoted 6 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +5 -0
+		compatible = "maxim,max77705-battery";
+		power-supplies = <&max77705_charger>;
+		interrupt-parent = <&tlmm>;
+		interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
+	};

These nodes should be children of "maxim,max77705" (see drivers/mfd/max77705.c)

What do you mean by this? I looked at the driver, should I add the pmic@66 node and put
the units inside of it? Because starqltechn doesn't do that and places them outside. Also, by adding the
pmic@66
node it expects to have led/haptics nodes as well.

Quoted 2 lines

Konrad

#16 lore raw

Re: [PATCH 3/5] arm64: dts: qcom: r0q: enable max77705 PMIC

Quoted 45 lines · Eric Gonçalves
Quoted 9 lines · Konrad Dybcio
Quoted 5 lines · Eric Gonçalves

The Samsung Galaxy S22 uses max77705 as its charger, fuelgauge and haptic PMIC, enable the fuelgauge and charger for now.

---

[...]

Quoted 8 lines

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vreg_l11c_3p0: ldo11 { · line 204

Quoted 6 lines

+&i2c5 {

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +5 -0
+	status = "okay";
+
+	max77705_charger: charger@69 {
+	    compatible = "maxim,max77705-charger";
+	    reg = <0x69>;

Please use tabs consistently

Sure

Quoted 6 lines

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vreg_l11c_3p0: ldo11 { · line 207

Quoted 4 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +3 -0
+	    monitored-battery = <&battery>;
+	    interrupt-parent = <&tlmm>;
+	    interrupts = <5 IRQ_TYPE_LEVEL_LOW>;

interrupts-extended = <&tlmm 5 IRQ...>, here and below

why extended?

Quoted 7 lines

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vreg_l11c_3p0: ldo11 { · line 211

Quoted 5 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +4 -0
+	};
+
+	fuel-gauge@36 {
+		reg = <0x36>;

sorting by unit address is welcome

Sure

Quoted 9 lines

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vreg_l11c_3p0: ldo11 { · line 216

Quoted 6 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +5 -0
+		compatible = "maxim,max77705-battery";
+		power-supplies = <&max77705_charger>;
+		interrupt-parent = <&tlmm>;
+		interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
+	};

These nodes should be children of "maxim,max77705" (see drivers/mfd/max77705.c)

Quoted 6 lines

What do you mean by this? I looked at the driver, should I add the pmic@66 node and put
the units inside of it? Because starqltechn doesn't do that and places them outside. Also, by adding the
pmic@66
node it expects to have led/haptics nodes as well.

Well, the chip comes as a single package, so this only makes sense and the bindings (mfd/maxim,max77705.yaml) corroborate that.

Just looking at the YAML, you should be able to omit the LED part if it's not connected anywhere

Konrad

#17 lore raw

Re: [PATCH 3/5] arm64: dts: qcom: r0q: enable max77705 PMIC

Quoted 53 lines · Konrad Dybcio
Quoted 45 lines · Eric Gonçalves
Quoted 9 lines · Konrad Dybcio
Quoted 5 lines · Eric Gonçalves

The Samsung Galaxy S22 uses max77705 as its charger, fuelgauge and haptic PMIC, enable the fuelgauge and charger for now.

---

[...]

Quoted 8 lines

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vreg_l11c_3p0: ldo11 { · line 204

Quoted 6 lines

+&i2c5 {

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +5 -0
+	status = "okay";
+
+	max77705_charger: charger@69 {
+	    compatible = "maxim,max77705-charger";
+	    reg = <0x69>;

Please use tabs consistently

Sure

Quoted 6 lines

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vreg_l11c_3p0: ldo11 { · line 207

Quoted 4 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +3 -0
+	    monitored-battery = <&battery>;
+	    interrupt-parent = <&tlmm>;
+	    interrupts = <5 IRQ_TYPE_LEVEL_LOW>;

interrupts-extended = <&tlmm 5 IRQ...>, here and below

why extended?

Quoted 7 lines

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vreg_l11c_3p0: ldo11 { · line 211

Quoted 5 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +4 -0
+	};
+
+	fuel-gauge@36 {
+		reg = <0x36>;

sorting by unit address is welcome

Sure

Quoted 9 lines

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vreg_l11c_3p0: ldo11 { · line 216

Quoted 6 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +5 -0
+		compatible = "maxim,max77705-battery";
+		power-supplies = <&max77705_charger>;
+		interrupt-parent = <&tlmm>;
+		interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
+	};

These nodes should be children of "maxim,max77705" (see drivers/mfd/max77705.c)

Quoted 6 lines

What do you mean by this? I looked at the driver, should I add the pmic@66 node and put
the units inside of it? Because starqltechn doesn't do that and places them outside. Also, by adding the
pmic@66
node it expects to have led/haptics nodes as well.

Quoted 5 lines

Well, the chip comes as a single package, so this only makes sense and the bindings (mfd/maxim,max77705.yaml) corroborate that.

Just looking at the YAML, you should be able to omit the LED part if it's not connected anywhere

Well, looking at power/supply/maxim,max77705.yaml shows that this is how it's meant to be defined, (outside the maxim,max77705 node), no?

Quoted 2 lines

Konrad

#18 lore raw

Re: [PATCH 3/5] arm64: dts: qcom: r0q: enable max77705 PMIC

Quoted 56 lines · Eric Gonçalves
Quoted 53 lines · Konrad Dybcio
Quoted 51 lines · Eric Gonçalves
Quoted 9 lines · Konrad Dybcio
Quoted 5 lines · Eric Gonçalves

The Samsung Galaxy S22 uses max77705 as its charger, fuelgauge and haptic PMIC, enable the fuelgauge and charger for now.

---

[...]

Quoted 8 lines

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vreg_l11c_3p0: ldo11 { · line 204

Quoted 6 lines

+&i2c5 {

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +5 -0
+	status = "okay";
+
+	max77705_charger: charger@69 {
+	    compatible = "maxim,max77705-charger";
+	    reg = <0x69>;

Please use tabs consistently

Sure

Quoted 6 lines

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vreg_l11c_3p0: ldo11 { · line 207

Quoted 4 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +3 -0
+	    monitored-battery = <&battery>;
+	    interrupt-parent = <&tlmm>;
+	    interrupts = <5 IRQ_TYPE_LEVEL_LOW>;

interrupts-extended = <&tlmm 5 IRQ...>, here and below

why extended?

Quoted 7 lines

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vreg_l11c_3p0: ldo11 { · line 211

Quoted 5 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +4 -0
+	};
+
+	fuel-gauge@36 {
+		reg = <0x36>;

sorting by unit address is welcome

Sure

Quoted 9 lines

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vreg_l11c_3p0: ldo11 { · line 216

Quoted 6 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +5 -0
+		compatible = "maxim,max77705-battery";
+		power-supplies = <&max77705_charger>;
+		interrupt-parent = <&tlmm>;
+		interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
+	};

These nodes should be children of "maxim,max77705" (see drivers/mfd/max77705.c)

What do you mean by this? I looked at the driver, should I add the pmic@66 node and put
the units inside of it? Because starqltechn doesn't do that and places them outside. Also, by adding the
pmic@66
node it expects to have led/haptics nodes as well.

Quoted 8 lines
Quoted 5 lines

Well, the chip comes as a single package, so this only makes sense and the bindings (mfd/maxim,max77705.yaml) corroborate that.

Just looking at the YAML, you should be able to omit the LED part if it's not connected anywhere

Well, looking at power/supply/maxim,max77705.yaml shows that this is how it's meant to be defined, (outside the maxim,max77705 node), no?

If you grep for maxim,max77705-charger, you'll notice that the MFD driver defines a MFD_CELL_OF

So it's reasonable to assume the bindings example is simply not making this obvious

Konrad

#19 lore raw

PATCH 4/5 arm64: dts: qcom: r0q: enable hardware clocks

In reply to Eric Gonçalves

Enable the real-time clocks found in R0Q board.

---
 arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +15 -0
index c1b0b21c0ec5..c088f1acf6ea 100644
@@ -225,6 +225,21 @@ vol_up_n: vol-up-n-state {
 	};
 };
 
+&pmk8350_rtc {
+	nvmem-cells = <&rtc_offset>;
+	nvmem-cell-names = "offset";
+
+	status = "okay";
+};
+
+&pmk8350_sdam_2 {
+	status = "okay";
+
+	rtc_offset: rtc-offset@bc {
+		reg = <0xbc 0x4>;
+	};
+};
+
 &pon_pwrkey {
 	status = "okay";
 };
Signature · 1 line
2.51.0
#20 lore raw

Re: [PATCH 4/5] arm64: dts: qcom: r0q: enable hardware clocks

Quoted 16 lines · Eric Gonçalves

Enable the real-time clocks found in R0Q board.

---
 arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +1 -0
index c1b0b21c0ec5..c088f1acf6ea 100644
@@ -225,6 +225,21 @@ vol_up_n: vol-up-n-state {
 	};
 };
 
+&pmk8350_rtc {

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vol_up_n: vol-up-n-state { · line 238

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +10 -0
+	nvmem-cells = <&rtc_offset>;
+	nvmem-cell-names = "offset";
+
+	status = "okay";
+};
+
+&pmk8350_sdam_2 {
+	status = "okay";
+
+	rtc_offset: rtc-offset@bc {

Is this an offset you took from somewhere downstream?

Generally you *really don't want to* poke at random SDAM cells, as they contain a lot of important settings (incl. battery/charging)

Konrad

#21 lore raw

Re: [PATCH 4/5] arm64: dts: qcom: r0q: enable hardware clocks

Quoted 30 lines · Konrad Dybcio
Quoted 16 lines · Eric Gonçalves

Enable the real-time clocks found in R0Q board.

---
 arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +1 -0
index c1b0b21c0ec5..c088f1acf6ea 100644
@@ -225,6 +225,21 @@ vol_up_n: vol-up-n-state {
 	};
 };
 
+&pmk8350_rtc {

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vol_up_n: vol-up-n-state { · line 238

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +10 -0
+	nvmem-cells = <&rtc_offset>;
+	nvmem-cell-names = "offset";
+
+	status = "okay";
+};
+
+&pmk8350_sdam_2 {
+	status = "okay";
+
+	rtc_offset: rtc-offset@bc {

Is this an offset you took from somewhere downstream?

Quoted 2 lines

Generally you *really don't want to* poke at random SDAM cells, as they contain a lot of important settings (incl. battery/charging)

From another sm8450 device, I'm sure it's okay.

Quoted 2 lines

Konrad

#22 lore raw

Re: [PATCH 4/5] arm64: dts: qcom: r0q: enable hardware clocks

Quoted 33 lines · Eric Gonçalves
Quoted 30 lines · Konrad Dybcio
Quoted 16 lines · Eric Gonçalves

Enable the real-time clocks found in R0Q board.

---
 arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +1 -0
index c1b0b21c0ec5..c088f1acf6ea 100644
@@ -225,6 +225,21 @@ vol_up_n: vol-up-n-state {
 	};
 };
 
+&pmk8350_rtc {

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vol_up_n: vol-up-n-state { · line 238

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +10 -0
+	nvmem-cells = <&rtc_offset>;
+	nvmem-cell-names = "offset";
+
+	status = "okay";
+};
+
+&pmk8350_sdam_2 {
+	status = "okay";
+
+	rtc_offset: rtc-offset@bc {

Is this an offset you took from somewhere downstream?

Quoted 3 lines
Quoted 2 lines

Generally you *really don't want to* poke at random SDAM cells, as they contain a lot of important settings (incl. battery/charging)

From another sm8450 device, I'm sure it's okay.

That as an argument alone doesn't sound convincing to me, since vendors also sometimes repurpose unused-by-Qualcomm SDAM cells

I actually found a data source internally and this cell you're trying to use is reserved for PBS (see drivers/soc/qcom/qcom-pbs.c), meaning you already fell into this trap..

Konrad

#23 lore raw

Re: [PATCH 4/5] arm64: dts: qcom: r0q: enable hardware clocks

Quoted 36 lines · Konrad Dybcio
Quoted 35 lines · Eric Gonçalves
Quoted 32 lines · Konrad Dybcio
Quoted 16 lines · Eric Gonçalves

Enable the real-time clocks found in R0Q board.

---
 arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +1 -0
index c1b0b21c0ec5..c088f1acf6ea 100644
@@ -225,6 +225,21 @@ vol_up_n: vol-up-n-state {
 	};
 };
 
+&pmk8350_rtc {

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vol_up_n: vol-up-n-state { · line 238

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +10 -0
+	nvmem-cells = <&rtc_offset>;
+	nvmem-cell-names = "offset";
+
+	status = "okay";
+};
+
+&pmk8350_sdam_2 {
+	status = "okay";
+
+	rtc_offset: rtc-offset@bc {

Is this an offset you took from somewhere downstream?

Generally you *really don't want to* poke at random SDAM cells, as they contain a lot of important settings (incl. battery/charging)

Quoted 8 lines
Quoted 1 line

From another sm8450 device, I'm sure it's okay.

That as an argument alone doesn't sound convincing to me, since vendors also sometimes repurpose unused-by-Qualcomm SDAM cells

I actually found a data source internally and this cell you're trying to use is reserved for PBS (see drivers/soc/qcom/qcom-pbs.c), meaning you already fell into this trap..

Interesting, in this case then why does rtc still work? And how can I find the real cell? It's not in downstream DT.

Quoted 2 lines

Konrad

#24 lore raw

Re: [PATCH 4/5] arm64: dts: qcom: r0q: enable hardware clocks

Quoted 41 lines · Eric Gonçalves
Quoted 38 lines · Konrad Dybcio
Quoted 36 lines · Eric Gonçalves
Quoted 30 lines · Konrad Dybcio
Quoted 16 lines · Eric Gonçalves

Enable the real-time clocks found in R0Q board.

---
 arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +1 -0
index c1b0b21c0ec5..c088f1acf6ea 100644
@@ -225,6 +225,21 @@ vol_up_n: vol-up-n-state {
 	};
 };
 
+&pmk8350_rtc {

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vol_up_n: vol-up-n-state { · line 238

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +10 -0
+	nvmem-cells = <&rtc_offset>;
+	nvmem-cell-names = "offset";
+
+	status = "okay";
+};
+
+&pmk8350_sdam_2 {
+	status = "okay";
+
+	rtc_offset: rtc-offset@bc {

Is this an offset you took from somewhere downstream?

Quoted 2 lines

Generally you *really don't want to* poke at random SDAM cells, as they contain a lot of important settings (incl. battery/charging)

From another sm8450 device, I'm sure it's okay.

Quoted 8 lines
Quoted 6 lines

That as an argument alone doesn't sound convincing to me, since vendors also sometimes repurpose unused-by-Qualcomm SDAM cells

I actually found a data source internally and this cell you're trying to use is reserved for PBS (see drivers/soc/qcom/qcom-pbs.c), meaning you already fell into this trap..

Interesting, in this case then why does rtc still work? And how can I find the real cell? It's not in downstream DT.

Well if nothing accesses that cell between your last write and your first read, it will of course work, because SDAM is just a means of storage

As for downstream/Android, it does not use SDAM at all

Konrad

#25 lore raw

Re: [PATCH 4/5] arm64: dts: qcom: r0q: enable hardware clocks

Quoted 48 lines · Konrad Dybcio
Quoted 47 lines · Eric Gonçalves
Quoted 44 lines · Konrad Dybcio
Quoted 33 lines · Eric Gonçalves
Quoted 30 lines · Konrad Dybcio
Quoted 16 lines · Eric Gonçalves

Enable the real-time clocks found in R0Q board.

---
 arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +1 -0
index c1b0b21c0ec5..c088f1acf6ea 100644
@@ -225,6 +225,21 @@ vol_up_n: vol-up-n-state {
 	};
 };
 
+&pmk8350_rtc {

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts vol_up_n: vol-up-n-state { · line 238

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +10 -0
+	nvmem-cells = <&rtc_offset>;
+	nvmem-cell-names = "offset";
+
+	status = "okay";
+};
+
+&pmk8350_sdam_2 {
+	status = "okay";
+
+	rtc_offset: rtc-offset@bc {

Is this an offset you took from somewhere downstream?

Quoted 3 lines
Quoted 2 lines

Generally you *really don't want to* poke at random SDAM cells, as they contain a lot of important settings (incl. battery/charging)

From another sm8450 device, I'm sure it's okay.

That as an argument alone doesn't sound convincing to me, since vendors also sometimes repurpose unused-by-Qualcomm SDAM cells

I actually found a data source internally and this cell you're trying to use is reserved for PBS (see drivers/soc/qcom/qcom-pbs.c), meaning you already fell into this trap..

Quoted 7 lines
Quoted 2 lines

Interesting, in this case then why does rtc still work? And how can I find the real cell? It's not in downstream DT.

Well if nothing accesses that cell between your last write and your first read, it will of course work, because SDAM is just a means of storage

As for downstream/Android, it does not use SDAM at all

Alright, I'll drop this patch then, thanks

Quoted 2 lines

Konrad

#26 lore raw

PATCH 5/5 arm64: dts: qcom: r0q: enable ufs storage

In reply to Eric Gonçalves

Enable UFS internal storage of the Samsung Galaxy S22.

---
 .../boot/dts/qcom/sm8450-samsung-r0q.dts      | 39 +++++++++++++++++++
 1 file changed, 39 insertions(+)
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +39 -0
index c088f1acf6ea..0a55ce952f93 100644
@@ -146,6 +146,24 @@ vreg_l5b_0p88: ldo5 {
 			regulator-max-microvolt = <888000>;
 			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
 		};
+
+		vreg_l6b_1p2: ldo6 {
+			regulator-min-microvolt = <1200000>;
+			regulator-max-microvolt = <1200000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};
+
+		vreg_l7b_2p5: ldo7 {
+			regulator-min-microvolt = <2504000>;
+			regulator-max-microvolt = <2504000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};
+
+		vreg_l9b_1p2: ldo9 {
+			regulator-min-microvolt = <1200000>;
+			regulator-max-microvolt = <1200000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};
 	};
 
 	regulators-1 {
@@ -370,6 +388,27 @@ tsp_int_sleep: tsp_int_sleep_state {
 	};
 };
 
+&ufs_mem_hc {
+	reset-gpios = <&tlmm 210 GPIO_ACTIVE_LOW>;
+
+	vcc-supply = <&vreg_l7b_2p5>;
+	vcc-max-microamp = <1100000>;
+	vccq-supply = <&vreg_l9b_1p2>;
+	vccq-max-microamp = <1200000>;
+	vccq2-supply = <&vreg_l9b_1p2>;
+	vccq2-max-microamp = <1200000>;
+	vdd-hba-supply = <&vreg_l9b_1p2>;
+
+	status = "okay";
+};
+
+&ufs_mem_phy {
+	vdda-phy-supply = <&vreg_l5b_0p88>;
+	vdda-pll-supply = <&vreg_l6b_1p2>;
+
+	status = "okay";
+};
+
 &usb_1 {
 	/* Keep USB 2.0 only for now */
 	qcom,select-utmi-as-pipe-clk;
Signature · 1 line
2.51.0
#28 lore raw

Re: [PATCH 5/5] arm64: dts: qcom: r0q: enable ufs storage

In reply to Eric Gonçalves
Quoted 37 lines · Eric Gonçalves

Enable UFS internal storage of the Samsung Galaxy S22.

---
 .../boot/dts/qcom/sm8450-samsung-r0q.dts      | 39 +++++++++++++++++++
 1 file changed, 39 insertions(+)
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +18 -0
index c088f1acf6ea..0a55ce952f93 100644
@@ -146,6 +146,24 @@ vreg_l5b_0p88: ldo5 {
 			regulator-max-microvolt = <888000>;
 			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
 		};
+
+		vreg_l6b_1p2: ldo6 {
+			regulator-min-microvolt = <1200000>;
+			regulator-max-microvolt = <1200000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};
+
+		vreg_l7b_2p5: ldo7 {
+			regulator-min-microvolt = <2504000>;
+			regulator-max-microvolt = <2504000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};
+
+		vreg_l9b_1p2: ldo9 {
+			regulator-min-microvolt = <1200000>;
+			regulator-max-microvolt = <1200000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};
 	};
 
 	regulators-1 {

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts tsp_int_sleep: tsp_int_sleep_state { · line 395

Quoted 8 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +5 -0
@@ -370,6 +388,27 @@ tsp_int_sleep: tsp_int_sleep_state {
 	};
 };
 
+&ufs_mem_hc {
+	reset-gpios = <&tlmm 210 GPIO_ACTIVE_LOW>;
+
+	vcc-supply = <&vreg_l7b_2p5>;
+	vcc-max-microamp = <1100000>;

because you set this, you should also set regulator-allow-set-mode and regulator-allowed-modes

Konrad

#29 lore raw

Re: [PATCH 5/5] arm64: dts: qcom: r0q: enable ufs storage

Quoted 50 lines · Konrad Dybcio
Quoted 37 lines · Eric Gonçalves

Enable UFS internal storage of the Samsung Galaxy S22.

---
 .../boot/dts/qcom/sm8450-samsung-r0q.dts      | 39 +++++++++++++++++++
 1 file changed, 39 insertions(+)
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +18 -0
index c088f1acf6ea..0a55ce952f93 100644
@@ -146,6 +146,24 @@ vreg_l5b_0p88: ldo5 {
 			regulator-max-microvolt = <888000>;
 			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
 		};
+
+		vreg_l6b_1p2: ldo6 {
+			regulator-min-microvolt = <1200000>;
+			regulator-max-microvolt = <1200000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};
+
+		vreg_l7b_2p5: ldo7 {
+			regulator-min-microvolt = <2504000>;
+			regulator-max-microvolt = <2504000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};
+
+		vreg_l9b_1p2: ldo9 {
+			regulator-min-microvolt = <1200000>;
+			regulator-max-microvolt = <1200000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};
 	};
 
 	regulators-1 {

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts tsp_int_sleep: tsp_int_sleep_state { · line 395

Quoted 8 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +5 -0
@@ -370,6 +388,27 @@ tsp_int_sleep: tsp_int_sleep_state {
 	};
 };
 
+&ufs_mem_hc {
+	reset-gpios = <&tlmm 210 GPIO_ACTIVE_LOW>;
+
+	vcc-supply = <&vreg_l7b_2p5>;
+	vcc-max-microamp = <1100000>;

because you set this, you should also set regulator-allow-set-mode and regulator-allowed-modes

Quoted 1 line

Konrad

Why is that necessary?

#30 lore raw

Re: [PATCH 5/5] arm64: dts: qcom: r0q: enable ufs storage

Quoted 53 lines · Eric Gonçalves
Quoted 50 lines · Konrad Dybcio
Quoted 37 lines · Eric Gonçalves

Enable UFS internal storage of the Samsung Galaxy S22.

---
 .../boot/dts/qcom/sm8450-samsung-r0q.dts      | 39 +++++++++++++++++++
 1 file changed, 39 insertions(+)
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +18 -0
index c088f1acf6ea..0a55ce952f93 100644
@@ -146,6 +146,24 @@ vreg_l5b_0p88: ldo5 {
 			regulator-max-microvolt = <888000>;
 			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
 		};
+
+		vreg_l6b_1p2: ldo6 {
+			regulator-min-microvolt = <1200000>;
+			regulator-max-microvolt = <1200000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};
+
+		vreg_l7b_2p5: ldo7 {
+			regulator-min-microvolt = <2504000>;
+			regulator-max-microvolt = <2504000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};
+
+		vreg_l9b_1p2: ldo9 {
+			regulator-min-microvolt = <1200000>;
+			regulator-max-microvolt = <1200000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};
 	};
 
 	regulators-1 {

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts tsp_int_sleep: tsp_int_sleep_state { · line 395

Quoted 8 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +5 -0
@@ -370,6 +388,27 @@ tsp_int_sleep: tsp_int_sleep_state {
 	};
 };
 
+&ufs_mem_hc {
+	reset-gpios = <&tlmm 210 GPIO_ACTIVE_LOW>;
+
+	vcc-supply = <&vreg_l7b_2p5>;
+	vcc-max-microamp = <1100000>;

because you set this, you should also set regulator-allow-set-mode and regulator-allowed-modes

Quoted 2 lines
Quoted 1 line

Konrad

Why is that necessary?

Because that is then translated into the mode selection, based on the aggregated usage

That said, you may also choose to omit this if you want to run all regulators at high-power mode (less efficient at idle), which forcefully ensures you're not hitting any current limits

Konrad

#31 lore raw

Re: [PATCH 5/5] arm64: dts: qcom: r0q: enable ufs storage

Quoted 55 lines · Konrad Dybcio
Quoted 54 lines · Eric Gonçalves
Quoted 51 lines · Konrad Dybcio
Quoted 37 lines · Eric Gonçalves

Enable UFS internal storage of the Samsung Galaxy S22.

---
 .../boot/dts/qcom/sm8450-samsung-r0q.dts      | 39 +++++++++++++++++++
 1 file changed, 39 insertions(+)
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +18 -0
index c088f1acf6ea..0a55ce952f93 100644
@@ -146,6 +146,24 @@ vreg_l5b_0p88: ldo5 {
 			regulator-max-microvolt = <888000>;
 			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
 		};
+
+		vreg_l6b_1p2: ldo6 {
+			regulator-min-microvolt = <1200000>;
+			regulator-max-microvolt = <1200000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};
+
+		vreg_l7b_2p5: ldo7 {
+			regulator-min-microvolt = <2504000>;
+			regulator-max-microvolt = <2504000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};
+
+		vreg_l9b_1p2: ldo9 {
+			regulator-min-microvolt = <1200000>;
+			regulator-max-microvolt = <1200000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};
 	};
 
 	regulators-1 {

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts tsp_int_sleep: tsp_int_sleep_state { · line 395

Quoted 8 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts +5 -0
@@ -370,6 +388,27 @@ tsp_int_sleep: tsp_int_sleep_state {
 	};
 };
 
+&ufs_mem_hc {
+	reset-gpios = <&tlmm 210 GPIO_ACTIVE_LOW>;
+
+	vcc-supply = <&vreg_l7b_2p5>;
+	vcc-max-microamp = <1100000>;

because you set this, you should also set regulator-allow-set-mode and regulator-allowed-modes

Konrad

Quoted 8 lines
Quoted 1 line

Why is that necessary?

Because that is then translated into the mode selection, based on the aggregated usage

That said, you may also choose to omit this if you want to run all regulators at high-power mode (less efficient at idle), which forcefully ensures you're not hitting any current limits

Will do, thanks

Quoted 2 lines

Konrad

#32 lore raw
In reply to Eric Gonçalves
Quoted 14 lines · Eric Gonçalves

This patchset adds support for multiple devices found on the Galaxy S22, side buttons, touchscreen, max77705 charger/fuelgauge, RTC and UFS. It depends on "Input: add support for the STM FTS2BA61Y touchscreen" for TS to be enabled.

Thanks!

Eric Gonçalves (5):
arm64: dts: qcom: r0q: add gpio keys
arm64: dts: qcom: r0q: add touchscreen support
arm64: dts: qcom: r0q: enable max77705 PMIC
arm64: dts: qcom: r0q: enable hardware clocks
arm64: dts: qcom: r0q: enable ufs storage

Quoted 8 lines
 .../boot/dts/qcom/sm8450-samsung-r0q.dts      | 308 +++++++++++++++++-
 1 file changed, 299 insertions(+), 9 deletions(-)

--
2.51.0

My bot found new DTB warnings on the .dts files added or changed in this series.

Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings are fixed by another series. Ultimately, it is up to the platform maintainer whether these warnings are acceptable or not. No need to reply unless the platform maintainer has comments.

If you already ran DT checks and didn't see these error(s), then make sure dt-schema is up to date:

  pip3 install dtschema --upgrade

This patch series was applied (using b4) to base:
Base: attempting to guess base-commit...
Base: tags/v6.17-rc1-242-g11cf389c103f (exact match)

If this is not the correct base, please add 'base-commit' tag (or use b4 which does this automatically)

New warnings running 'make CHECK_DTBS=y for arch/arm64/boot/dts/qcom/' for [email protected]:

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dtb: / (samsung,r0q): spi-gpio@0: 'anyOf' conditional failed, one must be fixed:
'reg' is a required property
'ranges' is a required property
from schema $id: http://devicetree.org/schemas/root-node.yaml#
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dtb: pinctrl@f100000 (qcom,sm8450-tlmm): Unevaluated properties are not allowed ('spi_clk_tsp_active', 'spi_clk_tsp_sleep', 'spi_cs_tsp_active', 'spi_cs_tsp_sleep', 'spi_miso_tsp_active', 'spi_miso_tsp_sleep', 'spi_mosi_tsp_active', 'spi_mosi_tsp_sleep', 'tsp_int_active', 'tsp_int_sleep_state' were unexpected)
from schema $id: http://devicetree.org/schemas/pinctrl/qcom,sm8450-tlmm.yaml#
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dtb: spi-gpio@0 (spi-gpio): $nodename:0: 'spi-gpio@0' does not match '^spi(@.*|-([0-9]|[1-9][0-9]+))?$'
from schema $id: http://devicetree.org/schemas/spi/spi-gpio.yaml#
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dtb: spi-gpio@0 (spi-gpio): Unevaluated properties are not allowed ('#address-cells', '#size-cells', 'spi-max-frequency', 'touchscreen@0' were unexpected)
from schema $id: http://devicetree.org/schemas/spi/spi-gpio.yaml#
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dtb: /spi-gpio@0/touchscreen@0: failed to match any schema with compatible: ['st,fts2ba61y']