xref: /openbmc/linux/Documentation/devicetree/bindings/input/matrix-keymap.yaml (revision db6da59cf27b5661ced03754ae0550f8914eda9e)
1639d6edaSAnson Huang# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2639d6edaSAnson Huang%YAML 1.2
3639d6edaSAnson Huang---
4639d6edaSAnson Huang$id: http://devicetree.org/schemas/input/matrix-keymap.yaml#
5639d6edaSAnson Huang$schema: http://devicetree.org/meta-schemas/core.yaml#
6639d6edaSAnson Huang
73367934dSKrzysztof Kozlowskititle: Common Key Matrices on Matrix-connected Key Boards
8639d6edaSAnson Huang
9639d6edaSAnson Huangmaintainers:
10639d6edaSAnson Huang  - Olof Johansson <olof@lixom.net>
11639d6edaSAnson Huang
12639d6edaSAnson Huangdescription: |
13639d6edaSAnson Huang  A simple common binding for matrix-connected key boards. Currently targeted at
14639d6edaSAnson Huang  defining the keys in the scope of linux key codes since that is a stable and
15639d6edaSAnson Huang  standardized interface at this time.
16639d6edaSAnson Huang
17639d6edaSAnson Huang  Some users of this binding might choose to specify secondary keymaps for
18639d6edaSAnson Huang  cases where there is a modifier key such as a Fn key. Proposed names
19639d6edaSAnson Huang  for said properties are "linux,fn-keymap" or with another descriptive
20639d6edaSAnson Huang  word for the modifier other from "Fn".
21639d6edaSAnson Huang
22639d6edaSAnson Huangproperties:
23639d6edaSAnson Huang  linux,keymap:
24*fcb52d7dSRob Herring    $ref: /schemas/types.yaml#/definitions/uint32-array
25639d6edaSAnson Huang    description: |
26639d6edaSAnson Huang      An array of packed 1-cell entries containing the equivalent of row,
27639d6edaSAnson Huang      column and linux key-code. The 32-bit big endian cell is packed as:
28639d6edaSAnson Huang          row << 24 | column << 16 | key-code
29639d6edaSAnson Huang
30639d6edaSAnson Huang  keypad,num-rows:
31639d6edaSAnson Huang    $ref: /schemas/types.yaml#/definitions/uint32
32639d6edaSAnson Huang    description: Number of row lines connected to the keypad controller.
33639d6edaSAnson Huang
34639d6edaSAnson Huang  keypad,num-columns:
35639d6edaSAnson Huang    $ref: /schemas/types.yaml#/definitions/uint32
36639d6edaSAnson Huang    description: Number of column lines connected to the keypad controller.
37639d6edaSAnson Huang
386a0e321eSRob HerringadditionalProperties: true
396a0e321eSRob Herring
40639d6edaSAnson Huangexamples:
41639d6edaSAnson Huang  - |
42639d6edaSAnson Huang    keypad {
43639d6edaSAnson Huang        /* ... */
44639d6edaSAnson Huang        linux,keymap = < 0x00030012
45639d6edaSAnson Huang                         0x0102003a >;
46639d6edaSAnson Huang        keypad,num-rows = <2>;
47639d6edaSAnson Huang        keypad,num-columns = <8>;
48639d6edaSAnson Huang    };
49