|
| 1 | +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) |
| 2 | +%YAML 1.2 |
| 3 | +--- |
| 4 | + |
| 5 | +$id: http://devicetree.org/schemas/input/gpio-matrix-keypad.yaml# |
| 6 | +$schema: http://devicetree.org/meta-schemas/core.yaml# |
| 7 | + |
| 8 | +title: GPIO matrix keypad |
| 9 | + |
| 10 | +maintainers: |
| 11 | + - Marek Vasut <marek.vasut@gmail.com> |
| 12 | + |
| 13 | +description: |
| 14 | + GPIO driven matrix keypad is used to interface a SoC with a matrix keypad. |
| 15 | + The matrix keypad supports multiple row and column lines, a key can be |
| 16 | + placed at each intersection of a unique row and a unique column. The matrix |
| 17 | + keypad can sense a key-press and key-release by means of GPIO lines and |
| 18 | + report the event using GPIO interrupts to the cpu. |
| 19 | + |
| 20 | +allOf: |
| 21 | + - $ref: /schemas/input/matrix-keymap.yaml# |
| 22 | + |
| 23 | +properties: |
| 24 | + compatible: |
| 25 | + const: gpio-matrix-keypad |
| 26 | + |
| 27 | + row-gpios: |
| 28 | + description: |
| 29 | + List of GPIOs used as row lines. The gpio specifier for this property |
| 30 | + depends on the gpio controller to which these row lines are connected. |
| 31 | + |
| 32 | + col-gpios: |
| 33 | + description: |
| 34 | + List of GPIOs used as column lines. The gpio specifier for this property |
| 35 | + depends on the gpio controller to which these column lines are connected. |
| 36 | + |
| 37 | + linux,keymap: true |
| 38 | + |
| 39 | + linux,no-autorepeat: |
| 40 | + type: boolean |
| 41 | + description: Do not enable autorepeat feature. |
| 42 | + |
| 43 | + |
| 44 | + debounce-delay-ms: |
| 45 | + description: Debounce interval in milliseconds. |
| 46 | + default: 0 |
| 47 | + |
| 48 | + col-scan-delay-us: |
| 49 | + description: |
| 50 | + Delay, measured in microseconds, that is needed |
| 51 | + before we can scan keypad after activating column gpio. |
| 52 | + default: 0 |
| 53 | + |
| 54 | + drive-inactive-cols: |
| 55 | + type: boolean |
| 56 | + description: |
| 57 | + Drive inactive columns during scan, |
| 58 | + default is to turn inactive columns into inputs. |
| 59 | + |
| 60 | +required: |
| 61 | + - compatible |
| 62 | + - row-gpios |
| 63 | + - col-gpios |
| 64 | + - linux,keymap |
| 65 | + |
| 66 | +additionalProperties: false |
| 67 | + |
| 68 | +examples: |
| 69 | + - | |
| 70 | + matrix-keypad { |
| 71 | + compatible = "gpio-matrix-keypad"; |
| 72 | + debounce-delay-ms = <5>; |
| 73 | + col-scan-delay-us = <2>; |
| 74 | +
|
| 75 | + row-gpios = <&gpio2 25 0 |
| 76 | + &gpio2 26 0 |
| 77 | + &gpio2 27 0>; |
| 78 | +
|
| 79 | + col-gpios = <&gpio2 21 0 |
| 80 | + &gpio2 22 0>; |
| 81 | +
|
| 82 | + linux,keymap = <0x0000008B |
| 83 | + 0x0100009E |
| 84 | + 0x02000069 |
| 85 | + 0x0001006A |
| 86 | + 0x0101001C |
| 87 | + 0x0201006C>; |
| 88 | + }; |
0 commit comments