Commit | Line | Data |
---|---|---|
fd05d089 DJ |
1 | Device-Tree bindings for input/gpio_keys.c keyboard driver |
2 | ||
3 | Required properties: | |
4 | - compatible = "gpio-keys"; | |
5 | ||
6 | Optional properties: | |
7 | - autorepeat: Boolean, Enable auto repeat feature of Linux input | |
8 | subsystem. | |
c4dc5f8c | 9 | - label: String, name of the input device. |
fd05d089 DJ |
10 | |
11 | Each button (key) is represented as a sub-node of "gpio-keys": | |
12 | Subnode properties: | |
13 | ||
97d86e07 DT |
14 | - gpios: OF device-tree gpio specification. |
15 | - interrupts: the interrupt line for that input. | |
fd05d089 DJ |
16 | - label: Descriptive name of the key. |
17 | - linux,code: Keycode to emit. | |
18 | ||
97d86e07 DT |
19 | Note that either "interrupts" or "gpios" properties can be omitted, but not |
20 | both at the same time. Specifying both properties is allowed. | |
f2d347ff | 21 | |
fd05d089 DJ |
22 | Optional subnode-properties: |
23 | - linux,input-type: Specify event type this button/key generates. | |
24 | If not specified defaults to <1> == EV_KEY. | |
25 | - debounce-interval: Debouncing interval time in milliseconds. | |
26 | If not specified defaults to 5. | |
99b4ffbd | 27 | - wakeup-source: Boolean, button can wake-up the system. |
71a0151c | 28 | (Legacy property supported: "gpio-key,wakeup") |
97d86e07 DT |
29 | - linux,can-disable: Boolean, indicates that button is connected |
30 | to dedicated (not shared) interrupt which can be disabled to | |
31 | suppress events from the button. | |
fd05d089 DJ |
32 | |
33 | Example nodes: | |
34 | ||
35 | gpio_keys { | |
36 | compatible = "gpio-keys"; | |
37 | #address-cells = <1>; | |
38 | #size-cells = <0>; | |
39 | autorepeat; | |
40 | button@21 { | |
41 | label = "GPIO Key UP"; | |
42 | linux,code = <103>; | |
43 | gpios = <&gpio1 0 1>; | |
44 | }; | |
f2d347ff AS |
45 | button@22 { |
46 | label = "GPIO Key DOWN"; | |
47 | linux,code = <108>; | |
48 | interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; | |
49 | }; | |
fd05d089 | 50 | ... |