David Jander | fd05d08 | 2011-07-09 12:41:46 -0700 | [diff] [blame] | 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. |
| 9 | |
| 10 | Each button (key) is represented as a sub-node of "gpio-keys": |
| 11 | Subnode properties: |
| 12 | |
Dmitry Torokhov | 97d86e0 | 2014-11-14 15:57:09 -0800 | [diff] [blame] | 13 | - gpios: OF device-tree gpio specification. |
| 14 | - interrupts: the interrupt line for that input. |
David Jander | fd05d08 | 2011-07-09 12:41:46 -0700 | [diff] [blame] | 15 | - label: Descriptive name of the key. |
| 16 | - linux,code: Keycode to emit. |
| 17 | |
Dmitry Torokhov | 97d86e0 | 2014-11-14 15:57:09 -0800 | [diff] [blame] | 18 | Note that either "interrupts" or "gpios" properties can be omitted, but not |
| 19 | both at the same time. Specifying both properties is allowed. |
Alexander Stein | f2d347f | 2014-11-25 11:53:45 -0800 | [diff] [blame] | 20 | |
David Jander | fd05d08 | 2011-07-09 12:41:46 -0700 | [diff] [blame] | 21 | Optional subnode-properties: |
| 22 | - linux,input-type: Specify event type this button/key generates. |
| 23 | If not specified defaults to <1> == EV_KEY. |
| 24 | - debounce-interval: Debouncing interval time in milliseconds. |
| 25 | If not specified defaults to 5. |
| 26 | - gpio-key,wakeup: Boolean, button can wake-up the system. |
Dmitry Torokhov | 97d86e0 | 2014-11-14 15:57:09 -0800 | [diff] [blame] | 27 | - linux,can-disable: Boolean, indicates that button is connected |
| 28 | to dedicated (not shared) interrupt which can be disabled to |
| 29 | suppress events from the button. |
David Jander | fd05d08 | 2011-07-09 12:41:46 -0700 | [diff] [blame] | 30 | |
| 31 | Example nodes: |
| 32 | |
| 33 | gpio_keys { |
| 34 | compatible = "gpio-keys"; |
| 35 | #address-cells = <1>; |
| 36 | #size-cells = <0>; |
| 37 | autorepeat; |
| 38 | button@21 { |
| 39 | label = "GPIO Key UP"; |
| 40 | linux,code = <103>; |
| 41 | gpios = <&gpio1 0 1>; |
| 42 | }; |
Alexander Stein | f2d347f | 2014-11-25 11:53:45 -0800 | [diff] [blame] | 43 | button@22 { |
| 44 | label = "GPIO Key DOWN"; |
| 45 | linux,code = <108>; |
| 46 | interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; |
| 47 | }; |
David Jander | fd05d08 | 2011-07-09 12:41:46 -0700 | [diff] [blame] | 48 | ... |