74 lines
1.8 KiB
Diff
74 lines
1.8 KiB
Diff
From f4e1c98de506f2bcc54e6077d4e7a4fef43e2efe Mon Sep 17 00:00:00 2001
|
|
From: Ondrej Jirman <megi@xff.cz>
|
|
Date: Sun, 4 Sep 2022 22:53:30 +0200
|
|
Subject: [PATCH 274/391] arm64: dts: rk3399-pinephone-pro: Add support for
|
|
volume keys
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
These are implemented via regular ADC, so regular polling is needed,
|
|
for these keys to work.
|
|
|
|
Signed-off-by: Martijn Braam <martijn@brixit.nl>
|
|
Co-developed-by: Kamil Trzciński <ayufan@ayufan.eu>
|
|
Signed-off-by: Ondrej Jirman <megi@xff.cz>
|
|
---
|
|
.../dts/rockchip/rk3399-pinephone-pro.dts | 26 +++++++++++++++++++
|
|
1 file changed, 26 insertions(+)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
|
|
index a0795a2b1..ecd48040e 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
|
|
@@ -10,6 +10,7 @@
|
|
*/
|
|
|
|
/dts-v1/;
|
|
+#include <dt-bindings/input/gpio-keys.h>
|
|
#include <dt-bindings/input/linux-event-codes.h>
|
|
#include "rk3399.dtsi"
|
|
#include "rk3399-opp.dtsi"
|
|
@@ -29,6 +30,26 @@ chosen {
|
|
stdout-path = "serial2:115200n8";
|
|
};
|
|
|
|
+ adc-keys {
|
|
+ compatible = "adc-keys";
|
|
+ io-channels = <&saradc 1>;
|
|
+ io-channel-names = "buttons";
|
|
+ keyup-threshold-microvolt = <1600000>;
|
|
+ poll-interval = <100>;
|
|
+
|
|
+ button-up {
|
|
+ label = "Volume Up";
|
|
+ linux,code = <KEY_VOLUMEUP>;
|
|
+ press-threshold-microvolt = <100000>;
|
|
+ };
|
|
+
|
|
+ button-down {
|
|
+ label = "Volume Down";
|
|
+ linux,code = <KEY_VOLUMEDOWN>;
|
|
+ press-threshold-microvolt = <300000>;
|
|
+ };
|
|
+ };
|
|
+
|
|
gpio-keys {
|
|
compatible = "gpio-keys";
|
|
pinctrl-names = "default";
|
|
@@ -429,6 +450,11 @@ &sdio0 {
|
|
status = "okay";
|
|
};
|
|
|
|
+&saradc {
|
|
+ vref-supply = <&vcca1v8_s3>;
|
|
+ status = "okay";
|
|
+};
|
|
+
|
|
&sdmmc {
|
|
bus-width = <4>;
|
|
cap-sd-highspeed;
|
|
--
|
|
2.35.3
|
|
|