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 <[email protected]> Signed-off-by: Martijn Braam <[email protected]> Co-developed-by: Kamil Trzciński <[email protected]> Signed-off-by: Kamil Trzciński <[email protected]> Signed-off-by: Ondrej Jirman <[email protected]> Signed-off-by: Peter Robinson <[email protected]> Tested-by: Ondrej Jirman <[email protected]> Link: https://lore.kernel.org/r/[email protected] [increased Volume-Down voltage to 600mV as suggested by Ondrej] Signed-off-by: Heiko Stuebner <[email protected]>
1 parent 1bb69cd commit d3150ed

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

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)