| 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 <[email protected]> |
| 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 |
gpio-activelow: |
| 44 |
type: boolean |
| 45 |
description: |
| 46 |
Force GPIO polarity to active low. |
| 47 |
In the absence of this property GPIOs are treated as active high. |
| 48 |
|
| 49 |
debounce-delay-ms: |
| 50 |
description: Debounce interval in milliseconds. |
| 51 |
default: 0 |
| 52 |
|
| 53 |
col-scan-delay-us: |
| 54 |
description: |
| 55 |
Delay, measured in microseconds, that is needed |
| 56 |
before we can scan keypad after activating column gpio. |
| 57 |
default: 0 |
| 58 |
|
| 59 |
all-cols-on-delay-us: |
| 60 |
description: |
| 61 |
Delay, measured in microseconds, that is needed |
| 62 |
after activating all column gpios. |
| 63 |
default: 0 |
| 64 |
|
| 65 |
drive-inactive-cols: |
| 66 |
type: boolean |
| 67 |
description: |
| 68 |
Drive inactive columns during scan, |
| 69 |
default is to turn inactive columns into inputs. |
| 70 |
|
| 71 |
wakeup-source: true |
| 72 |
|
| 73 |
required: |
| 74 |
- compatible |
| 75 |
- row-gpios |
| 76 |
- col-gpios |
| 77 |
- linux,keymap |
| 78 |
|
| 79 |
additionalProperties: false |
| 80 |
|
| 81 |
examples: |
| 82 |
- | |
| 83 |
matrix-keypad { |
| 84 |
compatible = "gpio-matrix-keypad"; |
| 85 |
debounce-delay-ms = <5>; |
| 86 |
col-scan-delay-us = <2>; |
| 87 |
|
| 88 |
row-gpios = <&gpio2 25 0 |
| 89 |
&gpio2 26 0 |
| 90 |
&gpio2 27 0>; |
| 91 |
|
| 92 |
col-gpios = <&gpio2 21 0 |
| 93 |
&gpio2 22 0>; |
| 94 |
|
| 95 |
linux,keymap = <0x0000008B |
| 96 |
0x0100009E |
| 97 |
0x02000069 |
| 98 |
0x0001006A |
| 99 |
0x0101001C |
| 100 |
0x0201006C>; |
| 101 |
|
| 102 |
wakeup-source; |
| 103 |
}; |