Add ENTER and ESC key
[experiments/bbb-gpio-keypad.git] / bbb-gpio-keypad-00A0.dts
1 /dts-v1/;
2 /plugin/;
3
4 #include <dt-bindings/board/am335x-bbw-bbb-base.h>
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/pinctrl/am33xx.h>
7
8 / {
9     compatible = "ti,beaglebone", "ti,beaglebone-black";
10
11     /* identification */
12     part-number = "gpio-keypad-ao2";
13     version = "00A0";
14
15     // resources this cape uses
16     exclusive-use =
17       "P8.07",
18       "P8.08",
19       "P8.09",
20       "P8.10",
21       "P8.26",
22       "P9.15";
23
24     fragment@0 {
25         target = <&am33xx_pinmux>;
26         __overlay__ {
27             keypad_pins: pinmux_gpio_pins{
28                 pinctrl-single,pins = <
29                     BONE_P8_07 (PIN_INPUT_PULLUP | MUX_MODE7)
30                     BONE_P8_08 (PIN_INPUT_PULLUP | MUX_MODE7)
31                     BONE_P8_09 (PIN_INPUT_PULLUP | MUX_MODE7)
32                     BONE_P8_10 (PIN_INPUT_PULLUP | MUX_MODE7)
33                     BONE_P8_26 (PIN_INPUT_PULLUP | MUX_MODE7)
34                     BONE_P9_15 (PIN_INPUT_PULLUP | MUX_MODE7)
35                 >;
36             };
37         };
38     };
39
40     fragment@1 {
41         target-path = "/";
42         __overlay__ {
43             gpio_keys {
44                 compatible = "gpio-keys";
45                 autorepeat;
46                 pinctrl-names = "default";
47                 pinctrl-0 = <&keypad_pins>;
48
49                 up {
50                     label = "GPIO Key UP";
51                     linux,code = <103>;
52                     gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
53                     debounce_interval = <50>;
54                 };
55                 left {
56                     label = "GPIO Key LEFT";
57                     linux,code = <105>;
58                     gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
59                     debounce_interval = <50>;
60                 };
61                 right {
62                     label = "GPIO Key RIGHT";
63                     linux,code = <106>;
64                     gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;
65                     debounce_interval = <50>;
66                 };
67                 down {
68                     label = "GPIO Key DOWN";
69                     linux,code = <108>;
70                     gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
71                     debounce_interval = <50>;
72                 };
73                 enter {
74                     label = "GPIO Key ENTER";
75                     linux,code = <28>;
76                     gpios = <&gpio1 29 GPIO_ACTIVE_LOW>;
77                     debounce_interval = <50>;
78                 };
79                 esc {
80                     label = "GPIO Key ESC";
81                     linux,code = <1>;
82                     gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
83                     debounce_interval = <50>;
84                 };
85             };
86         };
87     };
88 };
89