[PATCH v2 3/6] arm64: dts: qcom: r0q: add touchscreen support

Eric Gonçalves posted 6 patches 2 months ago
[PATCH v2 3/6] arm64: dts: qcom: r0q: add touchscreen support
Posted by Eric Gonçalves 2 months ago
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.

Signed-off-by: Eric Gonçalves <ghatto404@gmail.com>
---
 .../boot/dts/qcom/sm8450-samsung-r0q.dts      | 134 ++++++++++++++++++
 1 file changed, 134 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts b/arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts
index 5ca45b040a99..96a8a0e69681 100644
--- a/arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts
+++ b/arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts
@@ -56,6 +56,50 @@ splash-region@b8000000 {
 		};
 	};
 
+	/*
+	 * 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.
+	 */
+
+	spi8 {
+		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>;
+
+		#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";
@@ -138,6 +182,20 @@ vreg_l1c_1p8: ldo1 {
 			regulator-max-microvolt = <1800000>;
 			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
 		};
+
+		vreg_l8c_1p8: ldo8 {
+			regulator-name = "vreg_l8c_1p8";
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};
+
+		vreg_l11c_3p0: ldo11 {
+			regulator-name = "vreg_l11c_3p0";
+			regulator-min-microvolt = <3000000>;
+			regulator-max-microvolt = <3000000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};
 	};
 };
 
@@ -162,6 +220,82 @@ &pon_resin {
 
 &tlmm {
 	gpio-reserved-ranges = <36 4>; /* SPI (Unused) */
+
+	spi_clk_tsp_active: spi-clk-tsp-active {
+		pins = "gpio30";
+		function = "gpio";
+		drive-strength = <6>;
+		bias-disable;
+	};
+
+	spi_clk_tsp_sleep: spi-clk-tsp-sleep {
+		pins = "gpio30";
+		function = "gpio";
+		drive-strength = <6>;
+		input-enable;
+		bias-pull-down;
+	};
+
+	spi_cs_tsp_active: spi-cs-tsp-active {
+		pins = "gpio31";
+		function = "gpio";
+		drive-strength = <6>;
+		bias-disable;
+	};
+
+	spi_cs_tsp_sleep: spi-cs-tsp-sleep {
+		pins = "gpio31";
+		function = "gpio";
+		drive-strength = <6>;
+		input-enable;
+		bias-pull-down;
+	};
+
+	spi_miso_tsp_active: spi-miso-tsp-active {
+		pins = "gpio28";
+		function = "gpio";
+		drive-strength = <6>;
+		bias-disable;
+	};
+
+	spi_miso_tsp_sleep: spi-miso-tsp-sleep {
+		pins = "gpio28";
+		function = "gpio";
+		drive-strength = <6>;
+		input-enable;
+		bias-pull-down;
+	};
+
+	spi_mosi_tsp_active: spi-mosi-tsp-active {
+		pins = "gpio29";
+		function = "gpio";
+		drive-strength = <6>;
+		bias-disable;
+	};
+
+	spi_mosi_tsp_sleep: spi-mosi-tsp-sleep {
+		pins = "gpio29";
+		function = "gpio";
+		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 {
-- 
2.51.0

Re: [PATCH v2 3/6] arm64: dts: qcom: r0q: add touchscreen support
Posted by Konrad Dybcio 2 months ago
On 10/14/25 6:41 AM, Eric Gonçalves wrote:
> Enable the ST-Microelectronics FTS2BA61Y touchscreen. This patch
> depends on "Input: add support for the STM FTS2BA61Y touchscreen".

The second sentence doesn't really make sense to be included in
the git log

> 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.

Some Samsung devices used to use spi/i2c-gpio intentionally, also
on downstream. I'm assuming this isn't the case for r0q.

Did you enable gpi_dma1, qupv3_id_1 before spi8, when testing
that? I don't see any obvious errors in the dt that would cause
problems

Konrad
Re: [PATCH v2 3/6] arm64: dts: qcom: r0q: add touchscreen support
Posted by Ghatto 2 months ago
On Tue, Oct 14, 2025 at 7:01 AM Konrad Dybcio
<konrad.dybcio@oss.qualcomm.com> wrote:
>
> On 10/14/25 6:41 AM, Eric Gonçalves wrote:
> > Enable the ST-Microelectronics FTS2BA61Y touchscreen. This patch
> > depends on "Input: add support for the STM FTS2BA61Y touchscreen".
>
> The second sentence doesn't really make sense to be included in
> the git log
I'll keep it to the cover letter then
>
> > 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.
>
> Some Samsung devices used to use spi/i2c-gpio intentionally, also
> on downstream. I'm assuming this isn't the case for r0q.
It isn't, the device uses fts2ba61y on the spi8 bus - I hosted the
DT at https://github.com/ghatt-o/ss_experiments/blob/main/r0q.dts if you
want to take a look.
>
> Did you enable gpi_dma1, qupv3_id_1 before spi8, when testing
The driver probes, but it fails to recognize the touchscreen device
and ends up erroring, spi-gpio solves this and I did try enabling those.
It also works on the S22+ with spi-gpio, so I decided to do the same on r0q.
> that? I don't see any obvious errors in the dt that would cause
> problems
>
> Konrad
Re: [PATCH v2 3/6] arm64: dts: qcom: r0q: add touchscreen support
Posted by Konrad Dybcio 2 months ago
On 10/14/25 5:10 PM, Ghatto wrote:
> On Tue, Oct 14, 2025 at 7:01 AM Konrad Dybcio
> <konrad.dybcio@oss.qualcomm.com> wrote:
>>
>> On 10/14/25 6:41 AM, Eric Gonçalves wrote:
>>> Enable the ST-Microelectronics FTS2BA61Y touchscreen. This patch
>>> depends on "Input: add support for the STM FTS2BA61Y touchscreen".
>>
>> The second sentence doesn't really make sense to be included in
>> the git log
> I'll keep it to the cover letter then
>>
>>> 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.
>>
>> Some Samsung devices used to use spi/i2c-gpio intentionally, also
>> on downstream. I'm assuming this isn't the case for r0q.
> It isn't, the device uses fts2ba61y on the spi8 bus - I hosted the
> DT at https://github.com/ghatt-o/ss_experiments/blob/main/r0q.dts if you
> want to take a look.
>>
>> Did you enable gpi_dma1, qupv3_id_1 before spi8, when testing
> The driver probes, but it fails to recognize the touchscreen device

Could you post a complete dmesg and the precise DT diff you used?

Konrad