xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/input/matrix-keymap.yaml (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*4882a593Smuzhiyun%YAML 1.2
3*4882a593Smuzhiyun---
4*4882a593Smuzhiyun$id: http://devicetree.org/schemas/input/matrix-keymap.yaml#
5*4882a593Smuzhiyun$schema: http://devicetree.org/meta-schemas/core.yaml#
6*4882a593Smuzhiyun
7*4882a593Smuzhiyuntitle: Common key matrices binding for matrix-connected key boards
8*4882a593Smuzhiyun
9*4882a593Smuzhiyunmaintainers:
10*4882a593Smuzhiyun  - Olof Johansson <olof@lixom.net>
11*4882a593Smuzhiyun
12*4882a593Smuzhiyundescription: |
13*4882a593Smuzhiyun  A simple common binding for matrix-connected key boards. Currently targeted at
14*4882a593Smuzhiyun  defining the keys in the scope of linux key codes since that is a stable and
15*4882a593Smuzhiyun  standardized interface at this time.
16*4882a593Smuzhiyun
17*4882a593Smuzhiyun  Some users of this binding might choose to specify secondary keymaps for
18*4882a593Smuzhiyun  cases where there is a modifier key such as a Fn key. Proposed names
19*4882a593Smuzhiyun  for said properties are "linux,fn-keymap" or with another descriptive
20*4882a593Smuzhiyun  word for the modifier other from "Fn".
21*4882a593Smuzhiyun
22*4882a593Smuzhiyunproperties:
23*4882a593Smuzhiyun  linux,keymap:
24*4882a593Smuzhiyun    $ref: '/schemas/types.yaml#/definitions/uint32-array'
25*4882a593Smuzhiyun    description: |
26*4882a593Smuzhiyun      An array of packed 1-cell entries containing the equivalent of row,
27*4882a593Smuzhiyun      column and linux key-code. The 32-bit big endian cell is packed as:
28*4882a593Smuzhiyun          row << 24 | column << 16 | key-code
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun  keypad,num-rows:
31*4882a593Smuzhiyun    $ref: /schemas/types.yaml#/definitions/uint32
32*4882a593Smuzhiyun    description: Number of row lines connected to the keypad controller.
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun  keypad,num-columns:
35*4882a593Smuzhiyun    $ref: /schemas/types.yaml#/definitions/uint32
36*4882a593Smuzhiyun    description: Number of column lines connected to the keypad controller.
37*4882a593Smuzhiyun
38*4882a593SmuzhiyunadditionalProperties: true
39*4882a593Smuzhiyun
40*4882a593Smuzhiyunexamples:
41*4882a593Smuzhiyun  - |
42*4882a593Smuzhiyun    keypad {
43*4882a593Smuzhiyun        /* ... */
44*4882a593Smuzhiyun        linux,keymap = < 0x00030012
45*4882a593Smuzhiyun                         0x0102003a >;
46*4882a593Smuzhiyun        keypad,num-rows = <2>;
47*4882a593Smuzhiyun        keypad,num-columns = <8>;
48*4882a593Smuzhiyun    };
49