tmp75 userspace driver
[linux-gpio-pinout] / device-tree / gpio-button.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         fragment@0 {
12                 target = <&pio>;
13                 __overlay__ {
14                         gpio_button_0: gpio_button_0 {
15                                 pins = "PH3", "PH5";
16                                 function = "gpio_in";
17                                 bias-pull-up;
18                         };
19                 };
20         };
21
22         fragment@1 {
23                 target-path = "/";
24                 __overlay__ {
25                         gpio-keys-user {
26                                 /*
27                                  * Use "gpio-keys" for EINT capable pins, "gpio-keys-polled" for other pins
28                                  * add "poll-interval" property if using "gpio-keys-polled"
29                                  */
30                                 compatible = "gpio-keys";
31                                 pinctrl-names = "default";
32                                 pinctrl-0 = <&gpio_button_0>;
33
34                                 up {
35                                         label = "button-up";
36                                         linux,code = <103>; /* KEY_UP, see include/uapi/linux/input-event-codes.h */
37                                         gpios = <&pio 7 3 1>; /* PH3 GPIO_ACTIVE_LOW */
38                                 };
39
40                                 down {
41                                         label = "button-down";
42                                         linux,code = <108>; /* KEY_DOWN, see include/uapi/linux/input-event-codes.h */
43                                         gpios = <&pio 7 5 1>; /* PH5 GPIO_ACTIVE_LOW */
44                                 };
45                         };
46                 };
47         };
48 };