Alexandre Pereira da Silva | a2f2524 | 2012-07-31 22:08:45 -0700 | [diff] [blame] | 1 | Device-Tree bindings for input/gpio_keys_polled.c keyboard driver |
| 2 | |
| 3 | Required properties: |
| 4 | - compatible = "gpio-keys-polled"; |
| 5 | - poll-interval: Poll interval time in milliseconds |
| 6 | |
| 7 | Optional properties: |
| 8 | - autorepeat: Boolean, Enable auto repeat feature of Linux input |
| 9 | subsystem. |
| 10 | |
| 11 | Each button (key) is represented as a sub-node of "gpio-keys-polled": |
| 12 | Subnode properties: |
| 13 | |
| 14 | - gpios: OF device-tree gpio specification. |
| 15 | - label: Descriptive name of the key. |
Hans de Goede | 6f29d3b | 2015-10-14 16:44:35 -0700 | [diff] [blame] | 16 | - linux,code: Key / Axis code to emit. |
Alexandre Pereira da Silva | a2f2524 | 2012-07-31 22:08:45 -0700 | [diff] [blame] | 17 | |
| 18 | Optional subnode-properties: |
| 19 | - linux,input-type: Specify event type this button/key generates. |
| 20 | If not specified defaults to <1> == EV_KEY. |
Hans de Goede | 6f29d3b | 2015-10-14 16:44:35 -0700 | [diff] [blame] | 21 | - linux,input-value: If linux,input-type is EV_ABS or EV_REL then this |
| 22 | value is sent for events this button generates when pressed. |
| 23 | EV_ABS/EV_REL axis will generate an event with a value of 0 when |
| 24 | all buttons with linux,input-type == type and linux,code == axis |
| 25 | are released. This value is interpreted as a signed 32 bit value, |
| 26 | e.g. to make a button generate a value of -1 use: |
| 27 | linux,input-value = <0xffffffff>; /* -1 */ |
Alexandre Pereira da Silva | a2f2524 | 2012-07-31 22:08:45 -0700 | [diff] [blame] | 28 | - debounce-interval: Debouncing interval time in milliseconds. |
| 29 | If not specified defaults to 5. |
Dmitry Torokhov | 99b4ffb | 2015-07-16 12:10:05 -0700 | [diff] [blame] | 30 | - wakeup-source: Boolean, button can wake-up the system. |
Sudeep Holla | 71a0151 | 2015-10-21 11:09:59 +0100 | [diff] [blame] | 31 | (Legacy property supported: "gpio-key,wakeup") |
Alexandre Pereira da Silva | a2f2524 | 2012-07-31 22:08:45 -0700 | [diff] [blame] | 32 | |
| 33 | Example nodes: |
| 34 | |
| 35 | gpio_keys_polled { |
| 36 | compatible = "gpio-keys-polled"; |
Alexandre Pereira da Silva | a2f2524 | 2012-07-31 22:08:45 -0700 | [diff] [blame] | 37 | poll-interval = <100>; |
| 38 | autorepeat; |
Vladimir Zapolskiy | de56bea | 2016-09-03 10:39:07 -0700 | [diff] [blame] | 39 | |
| 40 | button21 { |
Alexandre Pereira da Silva | a2f2524 | 2012-07-31 22:08:45 -0700 | [diff] [blame] | 41 | label = "GPIO Key UP"; |
| 42 | linux,code = <103>; |
| 43 | gpios = <&gpio1 0 1>; |
| 44 | }; |
| 45 | ... |