From: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
To: linux-kernel@vger.kernel.org
Cc: Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Stephan Gerhold <stephan@gerhold.net>,
Nikita Travkin <nikita@trvn.ru>,
linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
~postmarketos/upstreaming@lists.sr.ht
Subject: [PATCH 3/8] arm64: dts: qcom: msm8939-samsung-a7: Add touch key
Date: Thu, 22 Jun 2023 02:04:58 +0000 [thread overview]
Message-ID: <20230622020448.65791-1-linmengbo0689@protonmail.com> (raw)
In-Reply-To: <20230622020344.65745-1-linmengbo0689@protonmail.com>
Add the CORERIVER TC360 touch key together with the necessary
fixed regulator for it.
Note that for some reason Samsung decided to connect this to GPIOs
where no hardware I2C bus is available, so we need to fall back
to software bit-banging using i2c-gpio.
Signed-off-by: Lin, Meng-Bo <linmengbo0689@protonmail.com>
---
.../boot/dts/qcom/msm8939-samsung-a7.dts | 85 +++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
index cf2738bc3313..98a2738eb8ea 100644
--- a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
+++ b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
@@ -68,6 +68,63 @@ button-home {
linux,code = <KEY_HOMEPAGE>;
};
};
+
+ i2c-tkey {
+ compatible = "i2c-gpio";
+ sda-gpios = <&tlmm 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+ scl-gpios = <&tlmm 17 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+
+ pinctrl-0 = <&tkey_i2c_default>;
+ pinctrl-names = "default";
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ touchkey@20 {
+ /* Note: Actually an ABOV MCU that implements same interface */
+ compatible = "coreriver,tc360-touchkey";
+ reg = <0x20>;
+
+ interrupt-parent = <&tlmm>;
+ interrupts = <20 IRQ_TYPE_EDGE_FALLING>;
+
+ vcc-supply = <®_touch_key>;
+ vdd-supply = <®_keyled>;
+ vddio-supply = <&pm8916_l6>;
+
+ linux,keycodes = <KEY_APPSELECT KEY_BACK>;
+
+ pinctrl-0 = <&tkey_default>;
+ pinctrl-names = "default";
+ };
+ };
+
+ reg_keyled: regulator-keyled {
+ compatible = "regulator-fixed";
+ regulator-name = "keyled";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+
+ /* NOTE: On some variants e.g. SM-A700FD it's GPIO 91 */
+ gpio = <&tlmm 100 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+
+ pinctrl-0 = <&tkey_led_en_default>;
+ pinctrl-names = "default";
+ };
+
+ reg_touch_key: regulator-touch-key {
+ compatible = "regulator-fixed";
+ regulator-name = "touch_key";
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+
+ gpio = <&tlmm 56 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+
+ pinctrl-0 = <&tkey_en_default>;
+ pinctrl-names = "default";
+ };
};
&blsp_i2c1 {
@@ -160,4 +217,32 @@ sdc2_cd_default: sdc2-cd-default-state {
drive-strength = <2>;
bias-pull-up;
};
+
+ tkey_default: tkey-default-state {
+ pins = "gpio20";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ tkey_en_default: tkey-en-default-state {
+ pins = "gpio56";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ tkey_i2c_default: tkey-i2c-default-state {
+ pins = "gpio16", "gpio17";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ tkey_led_en_default: tkey-led-en-default-state {
+ pins = "gpio100";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
};
--
2.39.2
next prev parent reply other threads:[~2023-06-22 2:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-22 2:03 [PATCH 0/8] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts Lin, Meng-Bo
2023-06-22 2:04 ` [PATCH 1/8] dt-bindings: qcom: Document msm8939,a7 Lin, Meng-Bo
2023-06-22 14:41 ` Rob Herring
2023-06-22 2:04 ` [PATCH 2/8] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts Lin, Meng-Bo
2023-06-22 2:04 ` Lin, Meng-Bo [this message]
2023-06-22 15:11 ` [PATCH 3/8] arm64: dts: qcom: msm8939-samsung-a7: Add touch key Krzysztof Kozlowski
2023-06-22 2:05 ` [PATCH 4/8] arm64: dts: qcom: msm8939-samsung-a7: Add accelerometer/magnetometer Lin, Meng-Bo
2023-06-22 2:05 ` [PATCH 5/8] arm64: dts: qcom: msm8939-samsung-a7: Add rt5033 battery Lin, Meng-Bo
2023-06-22 2:05 ` [PATCH 6/8] arm64: dts: qcom: msm8939-samsung-a7: Add NFC Lin, Meng-Bo
2023-06-22 2:05 ` [PATCH 7/8] arm64: dts: qcom: msm8939-samsung-a7: Add vibrator Lin, Meng-Bo
2023-06-22 2:06 ` [PATCH 8/8] arm64: dts: qcom: msm8939-samsung-a7: Add touchscreen Lin, Meng-Bo
2023-06-23 10:01 ` [PATCH v2 0/2] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts Lin, Meng-Bo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230622020448.65791-1-linmengbo0689@protonmail.com \
--to=linmengbo0689@protonmail.com \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nikita@trvn.ru \
--cc=robh+dt@kernel.org \
--cc=stephan@gerhold.net \
--cc=~postmarketos/upstreaming@lists.sr.ht \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).