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 8title: GPIO matrix keypad 9 10maintainers: 11 - Marek Vasut <marek.vasut@gmail.com> 12 13description: 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 20allOf: 21 - $ref: input.yaml# 22 - $ref: /schemas/input/matrix-keymap.yaml# 23 24properties: 25 compatible: 26 const: gpio-matrix-keypad 27 28 row-gpios: 29 description: 30 List of GPIOs used as row lines. The gpio specifier for this property 31 depends on the gpio controller to which these row lines are connected. 32 33 col-gpios: 34 description: 35 List of GPIOs used as column lines. The gpio specifier for this property 36 depends on the gpio controller to which these column lines are connected. 37 38 linux,keymap: true 39 40 linux,no-autorepeat: 41 type: boolean 42 description: Do not enable autorepeat feature. 43 44 gpio-activelow: 45 type: boolean 46 description: 47 Force GPIO polarity to active low. 48 In the absence of this property GPIOs are treated as active high. 49 50 debounce-delay-ms: true 51 52 col-scan-delay-us: 53 description: 54 Delay, measured in microseconds, that is needed 55 before we can scan keypad after activating column gpio. 56 default: 0 57 58 all-cols-on-delay-us: 59 description: 60 Delay, measured in microseconds, that is needed 61 after activating all column gpios. 62 default: 0 63 64 drive-inactive-cols: 65 type: boolean 66 description: 67 Drive inactive columns during scan, 68 default is to turn inactive columns into inputs. 69 70 wakeup-source: true 71 72required: 73 - compatible 74 - row-gpios 75 - col-gpios 76 - linux,keymap 77 78additionalProperties: false 79 80examples: 81 - | 82 matrix-keypad { 83 compatible = "gpio-matrix-keypad"; 84 debounce-delay-ms = <5>; 85 col-scan-delay-us = <2>; 86 87 row-gpios = <&gpio2 25 0 88 &gpio2 26 0 89 &gpio2 27 0>; 90 91 col-gpios = <&gpio2 21 0 92 &gpio2 22 0>; 93 94 linux,keymap = <0x0000008B 95 0x0100009E 96 0x02000069 97 0x0001006A 98 0x0101001C 99 0x0201006C>; 100 101 wakeup-source; 102 }; 103