[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220516142158.1612109-3-caleb@connolly.tech>
Date: Mon, 16 May 2022 14:23:07 +0000
From: Caleb Connolly <caleb@...nolly.tech>
To: Andy Gross <agross@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
linux-arm-msm@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-input@...r.kernel.org,
phone-devel@...r.kernel.org
Cc: Caleb Connolly <caleb@...nolly.tech>,
Jami Kettunen <jami.kettunen@...ainline.org>
Subject: [PATCH 3/3] arm64: dts: qcom: msm8998-oneplus: add tri-state-key
The tri-state-key is a 3-state mute slider found on the OnePlus 5.
The default software maps the states to "mute", "vibrate" and "ring",
expose them as generic switch events so that they can be configured
by userspace.
Signed-off-by: Caleb Connolly <caleb@...nolly.tech>
Signed-off-by: Jami Kettunen <jami.kettunen@...ainline.org>
---
.../boot/dts/qcom/msm8998-oneplus-common.dtsi | 43 +++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8998-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/msm8998-oneplus-common.dtsi
index 9823d48a91b1..9ae6b3e4fc32 100644
--- a/arch/arm64/boot/dts/qcom/msm8998-oneplus-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8998-oneplus-common.dtsi
@@ -94,6 +94,41 @@ vol-up {
};
};
+ tri-state-key {
+ compatible = "gpio-keys";
+ label = "Tri-state key";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&tri_state_key_default>;
+
+ state-top {
+ label = "Tri-state key top";
+ linux,input-type = <EV_SW>;
+ linux,code = <SW_PROG1>;
+ gpios = <&tlmm 40 GPIO_ACTIVE_LOW>;
+ debounce-interval = <50>;
+ linux,can-disable;
+ };
+
+ state-middle {
+ label = "Tri-state key middle";
+ linux,input-type = <EV_SW>;
+ linux,code = <SW_PROG2>;
+ gpios = <&tlmm 42 GPIO_ACTIVE_LOW>;
+ debounce-interval = <50>;
+ linux,can-disable;
+ };
+
+ state-bottom {
+ label = "Tri-state key bottom";
+ linux,input-type = <EV_SW>;
+ linux,code = <SW_PROG3>;
+ gpios = <&tlmm 26 GPIO_ACTIVE_LOW>;
+ debounce-interval = <50>;
+ linux,can-disable;
+ };
+ };
+
gpio-hall-sensor {
compatible = "gpio-keys";
label = "Hall effect sensor";
@@ -441,6 +476,14 @@ vreg_bob: bob {
&tlmm {
gpio-reserved-ranges = <0 4>, <81 4>;
+ /* The GPIOs have a hardware pullup */
+ tri_state_key_default: tri-state-pins {
+ pins = "gpio40", "gpio42", "gpio26";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
hall_sensor_default: hall-sensor-default {
pins = "gpio124";
function = "gpio";
--
2.36.1
Powered by blists - more mailing lists