keys artive high, pull-downs are on board
[linux-gpio-pinout] / device-tree / EPSON-B184.dts
1 /dts-v1/;
2 /plugin/;
3
4 / {
5         compatible = "allwinner,sun4i-a10", "allwinner,sun7i-a20", "allwinner,sun50i-a64", "allwinner,sun50i-h5";
6
7         /*
8          * This fragment is needed only for the internal pull-up activation,
9          * external pull-up resistor is highly recommended if using long wires
10          *
11          * if you connect vcc to keyboard board, remote this fragment!
12          */
13
14         fragment@0 {
15                 target = <&pio>;
16                 __overlay__ {
17                         gpio_button_0: gpio_button_0 {
18                                 pins = "PE11","PE10","PE9", "PE8";
19                                 function = "gpio_in";
20                                 /* bias-pull-down; */
21                         };
22                 };
23         };
24
25         fragment@1 {
26                 target-path = "/";
27                 __overlay__ {
28                         EPSON-B184 {
29                                 /*
30                                  * Use "gpio-keys" for EINT capable pins, "gpio-keys-polled" for other pins
31                                  * add "poll-interval" property if using "gpio-keys-polled"
32                                  */
33 /*
34                                 compatible = "gpio-keys";
35 */
36                                 compatible = "gpio-keys-polled";
37                                 poll-interval = <100>;
38                                 autorepeat;
39
40                                 pinctrl-names = "default";
41                                 pinctrl-0 = <&gpio_button_0>;
42
43                                 kp_1 {
44                                         label = "Keypad 1";
45                                         linux,code = <79>; /* KEY_KP1, see include/uapi/linux/input-event-codes.h */
46                                         gpios = <&pio 4 11 0>; /* PE11 GPIO_ACTIVE_HIGH */
47                                 };
48
49                                 kp_2 {
50                                         label = "Keypad 2";
51                                         linux,code = <80>; /* KEY_KP2, see include/uapi/linux/input-event-codes.h */
52                                         gpios = <&pio 4 10 0>; /* PE10 GPIO_ACTIVE_HIGH */
53                                 };
54
55                                 kp_3 {
56                                         label = "Keypad 3";
57                                         linux,code = <81>; /* KEY_KP3, see include/uapi/linux/input-event-codes.h */
58                                         gpios = <&pio 4 9 0>; /* PE9 GPIO_ACTIVE_HIGH */
59                                 };
60
61                                 kp_0 {
62                                         label = "Keypad 0";
63                                         linux,code = <82>; /* KEY_KP0, see include/uapi/linux/input-event-codes.h */
64                                         gpios = <&pio 4 8 0>; /* PE8 GPIO_ACTIVE_HIGH */
65                                 };
66                         };
67                 };
68         };
69 };