Skip to content

Instantly share code, notes, and snippets.

@superna9999
Last active January 10, 2017 14:22
Show Gist options
  • Save superna9999/30af39db8f79d8e4af43ab4019babc11 to your computer and use it in GitHub Desktop.
Save superna9999/30af39db8f79d8e4af43ab4019babc11 to your computer and use it in GitHub Desktop.
p200 adc_keys patch
diff --git a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
index 5189eac..28c8493 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
@@ -242,6 +242,7 @@
status = "okay"; /* TODO */
interrupts = <GIC_SPI 9 IRQ_TYPE_EDGE_RISING>;
reg = <0x0 0x8680 0x0 0x30>;
+ #io-channel-cells = <1>;
};
pwm_ef: pwm@86c0 {
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts
index 03e3d76..d3e46b1 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts
@@ -45,10 +45,48 @@
/dts-v1/;
#include "meson-gxbb-p20x.dtsi"
+#include <dt-bindings/input/input.h>
/ {
compatible = "amlogic,p200", "amlogic,meson-gxbb";
model = "Amlogic Meson GXBB P200 Development Board";
+
+ adc_keys {
+ compatible = "adc-keys";
+ io-channels = <&saradc 0>;
+ io-channel-names = "buttons";
+ keyup-threshold-microvolt = <1787000>;
+
+ button-home {
+ label = "Home";
+ linux,code = <KEY_HOME>;
+ press-threshold-microvolt = <889000>;
+ };
+
+ button-esc {
+ label = "Esc";
+ linux,code = <KEY_ESC>;
+ press-threshold-microvolt = <671000>;
+ };
+
+ button-up {
+ label = "Volume Up";
+ linux,code = <KEY_VOLUMEUP>;
+ press-threshold-microvolt = <469000>;
+ };
+
+ button-down {
+ label = "Volume Down";
+ linux,code = <KEY_VOLUMEDOWN>;
+ press-threshold-microvolt = <246000>;
+ };
+
+ button-menu {
+ label = "Menu";
+ linux,code = <KEY_MENU>;
+ press-threshold-microvolt = <17000>;
+ };
+ };
};
&i2c_B {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment