Skip to contentSkip to conversation

ARM: dts: qcom: msm8960: expressatt: Add coreriver,tc360-touchkey

PATCH Applied Rudraksha Gupta 4 participants 4 messages May 28 – Jul 8

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

PATCH v2 1/1 ARM: dts: qcom: msm8960: expressatt: Add coreriver,tc360-touchkey

Add the tc360 touchkey. It's unknown if this is the actual model of the touchkey, as downstream doesn't mention a variant, but this works.

Link:
https://github.com/LineageOS/android_kernel_samsung_d2/blob/stable/cm-12.0-YNG4N/drivers/input/keyboard/cypress_touchkey_236/Makefile#L5

Assisted-by Claude:claude-opus-4.6

---
Add the tc360 touchkey. It's unknown if this is the actual model of the touchkey, as downstream doesn't mention a variant, but this works.

Link:
https://github.com/LineageOS/android_kernel_samsung_d2/blob/stable/cm-12.0-YNG4N/drivers/input/keyboard/cypress_touchkey_236/Makefile#L5

Test:
=============
- LEDs:

samsung-expressatt:/sys/class/leds/tm2-touchkey$ echo heartbeat > trigger
// Flashes LEDs :)

- Touching buttons:

samsung-expressatt:/sys/class/leds/tm2-touchkey$ evtest
No device specified, trying to scan all of /dev/input/event*
Not running as root, no devices may be available.
Available devices:
/dev/input/event0:      pmic8xxx_pwrkey
/dev/input/event1:      gpio-keys
/dev/input/event2:      tm2-touchkey
/dev/input/event3:      Atmel maXTouch Touchscreen
Select the device event number [0-3]: 2
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0
Input device name: "tm2-touchkey"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 139 (KEY_MENU)
    Event code 158 (KEY_BACK)
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)
Event: time 1761059686.899755, type 4 (EV_MSC), code 4 (MSC_SCAN), value 00
Event: time 1761059686.899755, type 1 (EV_KEY), code 139 (KEY_MENU), value 1
Event: time 1761059686.899755, -------------- SYN_REPORT ------------
Event: time 1761059687.113489, type 4 (EV_MSC), code 4 (MSC_SCAN), value 00
Event: time 1761059687.113489, type 1 (EV_KEY), code 139 (KEY_MENU), value 0
Event: time 1761059687.113489, -------------- SYN_REPORT ------------
Event: time 1761059688.764757, type 4 (EV_MSC), code 4 (MSC_SCAN), value 01
Event: time 1761059688.764757, type 1 (EV_KEY), code 158 (KEY_BACK), value 1
Event: time 1761059688.764757, -------------- SYN_REPORT ------------
Event: time 1761059688.817516, type 4 (EV_MSC), code 4 (MSC_SCAN), value 01
Event: time 1761059688.817516, type 1 (EV_KEY), code 158 (KEY_BACK), value 0
Event: time 1761059688.817516, -------------- SYN_REPORT ------------
---
Changes in v2:
- drop status = okay
- reorder pinctrl-{n,names}
- Resend of v1: https://lore.kernel.org/all/[email protected]/
- Link to v1: https://lore.kernel.org/r/[email protected]
---
 .../dts/qcom/qcom-msm8960-samsung-expressatt.dts   | 54 ++++++++++++++++++++++
 1 file changed, 54 insertions(+)
arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts +54 -0
index 5a39abd6f3ce..5a3d88e31cf5 100644
@@ -52,6 +52,40 @@ key-volume-down {
 			linux,code = <KEY_VOLUMEDOWN>;
 		};
 	};
+
+	touchkey_enable: touchkey-enable {
+		compatible = "regulator-fixed";
+		regulator-name = "touchkey_enable";
+		gpio = <&tlmm 51 GPIO_ACTIVE_HIGH>;
+		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-0 = <&touchkey_i2c_pins>;
+		pinctrl-names = "default";
+		i2c-gpio,delay-us = <2>;
+
+		touchkey@20 {
+			compatible = "coreriver,tc360-touchkey";
+			reg = <0x20>;
+
+			interrupts-extended = <&tlmm 52 IRQ_TYPE_EDGE_FALLING>;
+			pinctrl-0 = <&touchkey_irq_pin>;
+			pinctrl-names = "default";
+
+			vddio-supply = <&touchkey_enable>;
+			vdd-supply = <&pm8921_l29>;
+			vcc-supply = <&pm8921_l29>;
+
+			linux,keycodes = <KEY_MENU KEY_BACK>;
+		};
+	};
 };
 
 &gsbi2 {
@@ -198,6 +232,20 @@ firmware-pins {
 			bias-disable;
 		};
 	};
+
+	touchkey_i2c_pins: touchkey-i2c-state {
+		pins = "gpio71", "gpio72";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	touchkey_irq_pin: touchkey-irq-state {
+		pins = "gpio52";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
 };
 
 &pm8921 {
@@ -420,6 +468,12 @@ pm8921_l25: l25 {
 			bias-pull-down;
 		};
 
+		pm8921_l29: l29 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <3300000>;
+			bias-pull-down;
+		};
+
 		/* Low Voltage Switch */
 		pm8921_lvs1: lvs1 {
 			bias-pull-down;

---
base-commit: 3131ff5a117498bb4b9db3a238bb311cbf8383ce
change-id: 20251205-expressatt-touchkey-1747c503a2f3

Best regards,

Signature · 1 line
Rudraksha Gupta <[email protected]>
#1 lore raw
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] The `pm8921_l29` regulator provides a wide voltage range instead of a fixed voltage, which is…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The pm8921_l29 regulator provides a wide voltage range instead of a fixed voltage, which is incompatible with the tc360-touchkey driver that expects a fixed regulator.
- [Low] The newly added nodes i2c-gpio-touchkey and touchkey-enable violate standard devicetree node naming schemas and will trigger dtbs_check warnings. --

commit df1b82e005a06f9e0f91c39a21c42b56f537d34d
Author: Rudraksha Gupta <[email protected]>

ARM: dts: qcom: msm8960: expressatt: Add coreriver,tc360-touchkey

This commit adds the tc360 touchkey using an i2c-gpio bus for the msm8960 samsung expressatt device. It includes the necessary pin configurations, regulators, and interrupt mappings.

arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts key-volume-down { · line 56

Quoted 9 lines
arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts +2 -0
@@ -52,6 +52,40 @@ key-volume-down {
 			linux,code = <KEY_VOLUMEDOWN>;
 		};
 	};
+
+	touchkey_enable: touchkey-enable {

[Severity: Low]
Will this node name trigger dtbs_check warnings? The fixed regulator schema typically requires nodes to match the regular expression ^regulator(-[0-9]+v[0-9]+|-[0-9a-z-]+)?$. Would renaming this to something like regulator-touchkey be more compliant?

arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts key-volume-down { · line 64

Quoted 8 lines
arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts +8 -0
+		compatible = "regulator-fixed";
+		regulator-name = "touchkey_enable";
+		gpio = <&tlmm 51 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		regulator-boot-on;
+	};
+
+	i2c-gpio-touchkey {

[Severity: Low]
Does this node name violate the standard I2C controller schema? The standard schema expects the bus node to match the regular expression ^i2c(@.*)?$. Should this be named just i2c instead?

Quoted 3 lines
arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts +3 -0
+		compatible = "i2c-gpio";
+		#address-cells = <1>;
+		#size-cells = <0>;

[ ... ]

arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts pm8921_l25: l25 { · line 473

Quoted 7 lines
arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts +3 -0
@@ -420,6 +468,12 @@ pm8921_l25: l25 {
 			bias-pull-down;
 		};
 
+		pm8921_l29: l29 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <3300000>;

[Severity: High]
Will the wide voltage range here cause the touchkey to fail?

The tc360-touchkey driver is configured as a fixed regulator and only enables it without calling regulator_set_voltage(). If the core regulator framework enables this at the minimum voltage of 1.8V, will it be below the typical voltage expected by the hardware?

Should the min and max microvolts be constrained to the exact required fixed voltage?

Quoted 3 lines
arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts +3 -0
+			bias-pull-down;
+		};
+
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Reviewed-by on v2 1/1
#2 lore raw
In reply to Rudraksha Gupta
Quoted 5 lines · On 5/28/26 4:13 AM, Rudraksha Gupta via B4 Relay wrote:

From: Rudraksha Gupta <[email protected]>

Add the tc360 touchkey. It's unknown if this is the actual model of the touchkey, as downstream doesn't mention a variant, but this works.

Quoted 7 lines

Link:
https://github.com/LineageOS/android_kernel_samsung_d2/blob/stable/cm-12.0-YNG4N/drivers/input/keyboard/cypress_touchkey_236/Makefile#L5

Assisted-by Claude:claude-opus-4.6

---

Konrad

maintainer Applied
#3 lore raw
In reply to Rudraksha Gupta
Quoted 8 lines · Rudraksha Gupta

Add the tc360 touchkey. It's unknown if this is the actual model of the touchkey, as downstream doesn't mention a variant, but this works.

Link:
https://github.com/LineageOS/android_kernel_samsung_d2/blob/stable/cm-12.0-YNG4N/drivers/input/keyboard/cypress_touchkey_236/Makefile#L5

[...]

Applied, thanks!

[1/1] ARM: dts: qcom: msm8960: expressatt: Add coreriver,tc360-touchkey

      commit: 346e9112f3dab91a5cf3100a99ec256ff0b7f0fe

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>