2 * bbb-gpio-keypad - simple navigation keypad for the BeagleBone Black
4 * Copyright (C) 2018 Antonio Ospite <ao2@ao2.it>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include <dt-bindings/board/am335x-bbw-bbb-base.h>
24 #include <dt-bindings/gpio/gpio.h>
25 #include <dt-bindings/pinctrl/am33xx.h>
28 compatible = "ti,beaglebone", "ti,beaglebone-black";
31 part-number = "bbb-gpio-keypad";
34 // Resources this cape uses, see also https://ao2.it/137
43 // Free up the pins from the pinmux helper
47 P8_07_pinmux { status = "disabled"; };
48 P8_08_pinmux { status = "disabled"; };
49 P8_09_pinmux { status = "disabled"; };
50 P8_10_pinmux { status = "disabled"; };
51 P8_26_pinmux { status = "disabled"; };
52 P9_15_pinmux { status = "disabled"; };
57 target = <&am33xx_pinmux>;
59 keypad_pins: pinmux_gpio_pins {
60 pinctrl-single,pins = <
61 BONE_P8_07 (PIN_INPUT_PULLUP | MUX_MODE7)
62 BONE_P8_08 (PIN_INPUT_PULLUP | MUX_MODE7)
63 BONE_P8_09 (PIN_INPUT_PULLUP | MUX_MODE7)
64 BONE_P8_10 (PIN_INPUT_PULLUP | MUX_MODE7)
65 BONE_P8_26 (PIN_INPUT_PULLUP | MUX_MODE7)
66 BONE_P9_15 (PIN_INPUT_PULLUP | MUX_MODE7)
76 compatible = "gpio-keys";
78 pinctrl-names = "default";
79 pinctrl-0 = <&keypad_pins>;
82 label = "GPIO Key UP";
84 gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
85 debounce_interval = <50>;
88 label = "GPIO Key LEFT";
90 gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
91 debounce_interval = <50>;
94 label = "GPIO Key RIGHT";
96 gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;
97 debounce_interval = <50>;
100 label = "GPIO Key DOWN";
102 gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
103 debounce_interval = <50>;
106 label = "GPIO Key ENTER";
108 gpios = <&gpio1 29 GPIO_ACTIVE_LOW>;
109 debounce_interval = <50>;
112 label = "GPIO Key ESC";
114 gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
115 debounce_interval = <50>;