lkml.org 
[lkml]   [2022]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 2/3] arm64: dts: qcom: sdm845-oneplus: add tri-state-key
The tri-state-key is a 3-state mute slider found on the OnePlus 6.
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@connolly.tech>
---
.../boot/dts/qcom/sdm845-oneplus-common.dtsi | 44 +++++++++++++++++--
1 file changed, 40 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
index 07b729f9fec5..f134c51e17ec 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
@@ -7,7 +7,7 @@

/dts-v1/;

-#include <dt-bindings/input/linux-event-codes.h>
+#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/regulator/qcom,rpmh-regulator.h>

#include "sdm845.dtsi"
@@ -26,7 +26,7 @@ chosen {
stdout-path = "serial0:115200n8";
};

- gpio-keys {
+ volume-keys {
compatible = "gpio-keys";
label = "Volume keys";
autorepeat;
@@ -49,6 +49,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 126 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 52 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 24 GPIO_ACTIVE_LOW>;
+ debounce-interval = <50>;
+ linux,can-disable;
+ };
+ };
+
reserved-memory {
/* The rmtfs_mem needs to be guarded due to "XPU limitations"
* it is otherwise possible for an allocation adjacent to the
@@ -607,9 +642,10 @@ &usb_1_hsphy {
&tlmm {
gpio-reserved-ranges = <0 4>, <81 4>;

- tri_state_key_default: tri_state_key_default {
+ /* The GPIOs have a hardware pullup */
+ tri_state_key_default: tri-state-pins {
mux {
- pins = "gpio40", "gpio42", "gpio26";
+ pins = "gpio126", "gpio52", "gpio24";
function = "gpio";
drive-strength = <2>;
bias-disable;
--
2.36.1

\
 
 \ /
  Last update: 2022-05-16 16:24    [W:0.150 / U:0.944 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site