arm64: dts: salvator-x: Add overlay for polled GPIO keyboard
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v3:
- Use "fragment-foo" instead of "fragment@n",
v2:
- The gpio-keys-polled driver doesn't support dynamically adding key
nodes to the keyboard node. Hence make sure all keyboard nodes have
unique names,
- Add todo for internal pull-up.
diff --git a/arch/arm64/boot/dts/renesas/r8a7795-salvator-x-keyboard-polled.dtso b/arch/arm64/boot/dts/renesas/r8a7795-salvator-x-keyboard-polled.dtso
new file mode 100644
index 0000000..acdf0c3
--- /dev/null
+++ b/arch/arm64/boot/dts/renesas/r8a7795-salvator-x-keyboard-polled.dtso
@@ -0,0 +1,44 @@
+/*
+ * Device Tree Overlay for polled GPIO keyboard on r8a7795/salvator-x
+ *
+ * Copyright (C) 2015 Glider bvba
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+/dts-v1/ /plugin/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+ fragment-keyboard {
+ target-path = "/";
+
+ __overlay__ {
+ keyboard-sw2 {
+ compatible = "gpio-keys-polled";
+ poll-interval = <20>;
+
+ /* TODO Enable internal pull-up */
+ key-a {
+ gpios = <&gpio6 11 GPIO_ACTIVE_LOW>;
+ label = "SW20";
+ linux,code = <KEY_A>;
+ };
+ key-b {
+ gpios = <&gpio6 12 GPIO_ACTIVE_LOW>;
+ label = "SW21";
+ linux,code = <KEY_B>;
+ };
+ key-c {
+ gpios = <&gpio6 13 GPIO_ACTIVE_LOW>;
+ label = "SW22";
+ linux,code = <KEY_C>;
+ };
+ };
+ };
+ };
+};