Skip to content

Commit 6b6a186

Browse files
superna9999khilman
authored andcommitted
ARM64: dts: meson-gxbb-p200: add ADC laddered keys
Add the 5 buttons connected to a resistor laddered matrix and sampled by the SAR ADC channel 0. Only the p200 board has these buttons, the P201 doesn't. Signed-off-by: Neil Armstrong <[email protected]> Signed-off-by: Kevin Hilman <[email protected]>
1 parent bd80ef5 commit 6b6a186

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,64 @@
4545
/dts-v1/;
4646

4747
#include "meson-gxbb-p20x.dtsi"
48+
#include <dt-bindings/input/input.h>
4849

4950
/ {
5051
compatible = "amlogic,p200", "amlogic,meson-gxbb";
5152
model = "Amlogic Meson GXBB P200 Development Board";
53+
54+
avdd18_usb_adc: regulator-avdd18_usb_adc {
55+
compatible = "regulator-fixed";
56+
regulator-name = "AVDD18_USB_ADC";
57+
regulator-min-microvolt = <1800000>;
58+
regulator-max-microvolt = <1800000>;
59+
};
60+
61+
adc_keys {
62+
compatible = "adc-keys";
63+
io-channels = <&saradc 0>;
64+
io-channel-names = "buttons";
65+
keyup-threshold-microvolt = <1800000>;
66+
67+
button-home {
68+
label = "Home";
69+
linux,code = <KEY_HOME>;
70+
press-threshold-microvolt = <900000>; /* 50% */
71+
};
72+
73+
button-esc {
74+
label = "Esc";
75+
linux,code = <KEY_ESC>;
76+
press-threshold-microvolt = <684000>; /* 38% */
77+
};
78+
79+
button-up {
80+
label = "Volume Up";
81+
linux,code = <KEY_VOLUMEUP>;
82+
press-threshold-microvolt = <468000>; /* 26% */
83+
};
84+
85+
button-down {
86+
label = "Volume Down";
87+
linux,code = <KEY_VOLUMEDOWN>;
88+
press-threshold-microvolt = <252000>; /* 14% */
89+
};
90+
91+
button-menu {
92+
label = "Menu";
93+
linux,code = <KEY_MENU>;
94+
press-threshold-microvolt = <0>; /* 0% */
95+
};
96+
};
5297
};
5398

5499
&i2c_B {
55100
status = "okay";
56101
pinctrl-0 = <&i2c_b_pins>;
57102
pinctrl-names = "default";
58103
};
104+
105+
&saradc {
106+
status = "okay";
107+
vref-supply = <&avdd18_usb_adc>;
108+
};

0 commit comments

Comments
 (0)