d290093b991abdfbad98ff43344ffe623618638e
[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                 pinctrl-names = "default";
42                 pinctrl-0 = <&keypad_pins>;
43
44                 up {
45                     label = "GPIO Key UP";
46                     linux,code = <103>;
47                     gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
48                     debounce_interval = <50>;
49                 };
50                 left {
51                     label = "GPIO Key LEFT";
52                     linux,code = <105>;
53                     gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
54                     debounce_interval = <50>;
55                 };
56                 right {
57                     label = "GPIO Key RIGHT";
58                     linux,code = <106>;
59                     gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;
60                     debounce_interval = <50>;
61                 };
62                 down {
63                     label = "GPIO Key DOWN";
64                     linux,code = <108>;
65                     gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
66                     debounce_interval = <50>;
67                 };
68             };
69         };
70     };
71 };
72