Re: [PATCH] ARM: dts: qcom: msm8960: expressatt: Add coreriver,tc360-touchkey

From: Rudraksha Gupta

Date: Fri Dec 05 2025 - 22:54:57 EST


+ sda-gpios = <&tlmm 71 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+ scl-gpios = <&tlmm 72 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
I don't have docs at hand, but it looks like these pins belong to
GSBI10. Have you tried using it directly?

This is the log when I use GSBI10:

samsung-expressatt:~$ dmesg | grep tm2
[   79.555802] input: tm2-touchkey as /devices/platform/soc/1a200000.gsbi/1a280000.i2c/i2c-4/4-0020/input/input3
[  110.242881] leds tm2-touchkey: Setting an LED's brightness failed (-110)
[  167.074920] tm2-touchkey 4-0020: failed to read i2c data: -110
[  182.435009] tm2-touchkey 4-0020: failed to read i2c data: -110

I could be doing something wrong, so here are the changes I made on top of this diff

diff --git a/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts b/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts
index c4b98af6955d..fde5f739a314 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts
+++ b/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts
@@ -60,33 +60,6 @@ touchkey_enable: touchkey-enable {
         enable-active-high;
         regulator-boot-on;
     };
-
-    i2c-gpio-touchkey {
-        compatible = "i2c-gpio";
-        #address-cells = <1>;
-        #size-cells = <0>;
-        sda-gpios = <&tlmm 71 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
-        scl-gpios = <&tlmm 72 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
-        pinctrl-names = "default";
-        pinctrl-0 = <&touchkey_i2c_pins>;
-        status = "okay";
-        i2c-gpio,delay-us = <2>;
-
-        touchkey@20 {
-            compatible = "coreriver,tc360-touchkey";
-            reg = <0x20>;
-
-            interrupts-extended = <&tlmm 52 IRQ_TYPE_EDGE_FALLING>;
-            pinctrl-names = "default";
-            pinctrl-0 = <&touchkey_irq_pin>;
-
-            vddio-supply = <&touchkey_enable>;
-            vdd-supply = <&pm8921_l29>;
-            vcc-supply = <&pm8921_l29>;
-
-            linux,keycodes = <KEY_MENU KEY_BACK>;
-        };
-    };
 };

 &gsbi2 {
@@ -572,3 +545,28 @@ magnetometer@2e {
         /* TODO: Figure out Mount Matrix */
     };
 };
+
+&gsbi10 {
+    qcom,mode = <GSBI_PROT_I2C>;
+
+    status = "okay";
+};
+
+&gsbi10_i2c {
+    status = "okay";
+
+    touchkey@20 {
+        compatible = "coreriver,tc360-touchkey";
+        reg = <0x20>;
+
+        interrupts-extended = <&tlmm 52 IRQ_TYPE_EDGE_FALLING>;
+        pinctrl-names = "default";
+        pinctrl-0 = <&touchkey_irq_pin>;
+
+        vddio-supply = <&touchkey_enable>;
+        vdd-supply = <&pm8921_l29>;
+        vcc-supply = <&pm8921_l29>;
+
+        linux,keycodes = <KEY_MENU KEY_BACK>;
+    };
+};
diff --git a/arch/arm/boot/dts/qcom/qcom-msm8960.dtsi b/arch/arm/boot/dts/qcom/qcom-msm8960.dtsi
index fd28401cebb5..c598fb324e7d 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8960.dtsi
+++ b/arch/arm/boot/dts/qcom/qcom-msm8960.dtsi
@@ -223,7 +223,7 @@ i2c8-pins {

             i2c10_default_state: i2c10-default-state {
                 i2c10-pins {
-                    pins = "gpio73", "gpio74";
+                    pins = "gpio71", "gpio72";
                     function = "gsbi10";
                     drive-strength = <8>;
                     bias-disable;
@@ -232,7 +232,7 @@ i2c10-pins {

             i2c10_sleep_state: i2c10-sleep-state {
                 i2c10-pins {
-                    pins = "gpio73", "gpio74";
+                    pins = "gpio71", "gpio72";
                     function = "gpio";
                     drive-strength = <2>;
                     bias-bus-hold;
diff --git a/arch/arm/configs/qcom_defconfig b/arch/arm/configs/qcom_defconfig
index 29a1dea500f0..49baa91937ca 100644
--- a/arch/arm/configs/qcom_defconfig
+++ b/arch/arm/configs/qcom_defconfig
@@ -321,3 +321,4 @@ CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
 # CONFIG_SLUB_DEBUG is not set
 # CONFIG_SCHED_DEBUG is not set
+CONFIG_KEYBOARD_TM2_TOUCHKEY=m
\ No newline at end of file