1f5ad3800449b1b51fce27a650d593e28e2d7a7c
[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
22     fragment@0 {
23         target = <&am33xx_pinmux>;
24         __overlay__ {
25             keypad_pins: pinmux_gpio_pins{
26                 pinctrl-single,pins = <
27                     BONE_P8_07 (PIN_INPUT_PULLUP | MUX_MODE7)
28                     BONE_P8_08 (PIN_INPUT_PULLUP | MUX_MODE7)
29                     BONE_P8_09 (PIN_INPUT_PULLUP | MUX_MODE7)
30                     BONE_P8_10 (PIN_INPUT_PULLUP | MUX_MODE7)
31                 >;
32             };
33         };
34     };
35
36     fragment@1 {
37         target-path = "/";
38         __overlay__ {
39             gpio_keys {
40                 compatible = "gpio-keys";
41                 autorepeat;
42                 pinctrl-names = "default";
43                 pinctrl-0 = <&keypad_pins>;
44
45                 up {
46                     label = "GPIO Key UP";
47                     linux,code = <103>;
48                     gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
49                     debounce_interval = <50>;
50                 };
51                 left {
52                     label = "GPIO Key LEFT";
53                     linux,code = <105>;
54                     gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
55                     debounce_interval = <50>;
56                 };
57                 right {
58                     label = "GPIO Key RIGHT";
59                     linux,code = <106>;
60                     gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;
61                     debounce_interval = <50>;
62                 };
63                 down {
64                     label = "GPIO Key DOWN";
65                     linux,code = <108>;
66                     gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
67                     debounce_interval = <50>;
68                 };
69             };
70         };
71     };
72 };
73