Skip to content

Commit d3150ed

Browse files
Ondrej Jirmanmmind
authored andcommitted
arm64: dts: rockchip: Add support for volume keys to rk3399-pinephone-pro
These are implemented via regular ADC, so regular polling is needed, for these keys to work. Co-developed-by: Martijn Braam <martijn@brixit.nl> Signed-off-by: Martijn Braam <martijn@brixit.nl> Co-developed-by: Kamil Trzciński <ayufan@ayufan.eu> Signed-off-by: Kamil Trzciński <ayufan@ayufan.eu> Signed-off-by: Ondrej Jirman <megi@xff.cz> Signed-off-by: Peter Robinson <pbrobinson@gmail.com> Tested-by: Ondrej Jirman <megi@xff.cz> Link: https://lore.kernel.org/r/20230405123813.2272919-1-pbrobinson@gmail.com [increased Volume-Down voltage to 600mV as suggested by Ondrej] Signed-off-by: Heiko Stuebner <heiko@sntech.de>
1 parent 1bb69cd commit d3150ed

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*/
1111

1212
/dts-v1/;
13+
#include <dt-bindings/input/gpio-keys.h>
1314
#include <dt-bindings/input/linux-event-codes.h>
1415
#include "rk3399.dtsi"
1516
#include "rk3399-opp.dtsi"
@@ -29,6 +30,26 @@
2930
stdout-path = "serial2:115200n8";
3031
};
3132

33+
adc-keys {
34+
compatible = "adc-keys";
35+
io-channels = <&saradc 1>;
36+
io-channel-names = "buttons";
37+
keyup-threshold-microvolt = <1600000>;
38+
poll-interval = <100>;
39+
40+
button-up {
41+
label = "Volume Up";
42+
linux,code = <KEY_VOLUMEUP>;
43+
press-threshold-microvolt = <100000>;
44+
};
45+
46+
button-down {
47+
label = "Volume Down";
48+
linux,code = <KEY_VOLUMEDOWN>;
49+
press-threshold-microvolt = <600000>;
50+
};
51+
};
52+
3253
backlight: backlight {
3354
compatible = "pwm-backlight";
3455
pwms = <&pwm0 0 50000 0>;
@@ -519,6 +540,11 @@
519540
status = "okay";
520541
};
521542

543+
&saradc {
544+
vref-supply = <&vcca1v8_s3>;
545+
status = "okay";
546+
};
547+
522548
&sdmmc {
523549
bus-width = <4>;
524550
cap-sd-highspeed;

0 commit comments

Comments
 (0)