Path: blob/master/Documentation/devicetree/bindings/input/google,cros-ec-keyb.yaml
26308 views
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)1%YAML 1.22---34$id: http://devicetree.org/schemas/input/google,cros-ec-keyb.yaml#5$schema: http://devicetree.org/meta-schemas/core.yaml#67title: ChromeOS EC Keyboard89maintainers:10- Simon Glass <sjg@chromium.org>11- Benson Leung <bleung@chromium.org>1213description: |14Google's ChromeOS EC Keyboard is a simple matrix keyboard15implemented on a separate EC (Embedded Controller) device. It provides16a message for reading key scans from the EC. These are then converted17into keycodes for processing by the kernel. This device also supports18switches/buttons like power and volume buttons.1920properties:21compatible:22oneOf:23- description: ChromeOS EC with only buttons/switches24const: google,cros-ec-keyb-switches25- description: ChromeOS EC with keyboard and possibly buttons/switches26const: google,cros-ec-keyb2728google,needs-ghost-filter:29description:30Enable a ghost filter for the matrix keyboard. This is recommended31if the EC does not have its own logic or hardware for this.32type: boolean3334function-row-physmap:35$ref: /schemas/types.yaml#/definitions/uint32-array36minItems: 137maxItems: 1538description: |39An ordered u32 array describing the rows/columns (in the scan matrix)40of top row keys from physical left (KEY_F1) to right. Each entry41encodes the row/column as:42(((row) & 0xFF) << 24) | (((column) & 0xFF) << 16)43where the lower 16 bits are reserved. This property is specified only44when the keyboard has a custom design for the top row keys.4546dependencies:47function-row-physmap: [ 'linux,keymap' ]48google,needs-ghost-filter: [ 'linux,keymap' ]4950required:51- compatible5253if:54properties:55compatible:56contains:57const: google,cros-ec-keyb58then:59$ref: /schemas/input/matrix-keymap.yaml#60required:61- keypad,num-rows62- keypad,num-columns63- linux,keymap6465unevaluatedProperties: false6667examples:68- |69#include <dt-bindings/input/input.h>70keyboard-controller {71compatible = "google,cros-ec-keyb";72keypad,num-rows = <8>;73keypad,num-columns = <13>;74google,needs-ghost-filter;75function-row-physmap = <76MATRIX_KEY(0x00, 0x02, 0) /* T1 */77MATRIX_KEY(0x03, 0x02, 0) /* T2 */78MATRIX_KEY(0x02, 0x02, 0) /* T3 */79MATRIX_KEY(0x01, 0x02, 0) /* T4 */80MATRIX_KEY(0x03, 0x04, 0) /* T5 */81MATRIX_KEY(0x02, 0x04, 0) /* T6 */82MATRIX_KEY(0x01, 0x04, 0) /* T7 */83MATRIX_KEY(0x02, 0x09, 0) /* T8 */84MATRIX_KEY(0x01, 0x09, 0) /* T9 */85MATRIX_KEY(0x00, 0x04, 0) /* T10 */86>;87/*88* Keymap entries take the form of 0xRRCCKKKK where89* RR=Row CC=Column KKKK=Key Code90* The values below are for a US keyboard layout and91* are taken from the Linux driver. Note that the92* 102ND key is not used for US keyboards.93*/94linux,keymap = <95/* CAPSLCK F1 B F10 */960x0001003a 0x0002003b 0x00030030 0x0004004497/* N = R_ALT ESC */980x00060031 0x0008000d 0x000a0064 0x0101000199/* F4 G F7 H */1000x0102003e 0x01030022 0x01040041 0x01060023101/* ' F9 BKSPACE L_CTRL */1020x01080028 0x01090043 0x010b000e 0x0200001d103/* TAB F3 T F6 */1040x0201000f 0x0202003d 0x02030014 0x02040040105/* ] Y 102ND [ */1060x0205001b 0x02060015 0x02070056 0x0208001a107/* F8 GRAVE F2 5 */1080x02090042 0x03010029 0x0302003c 0x03030006109/* F5 6 - \ */1100x0304003f 0x03060007 0x0308000c 0x030b002b111/* R_CTRL A D F */1120x04000061 0x0401001e 0x04020020 0x04030021113/* S K J ; */1140x0404001f 0x04050025 0x04060024 0x04080027115/* L ENTER Z C */1160x04090026 0x040b001c 0x0501002c 0x0502002e117/* V X , M */1180x0503002f 0x0504002d 0x05050033 0x05060032119/* L_SHIFT / . SPACE */1200x0507002a 0x05080035 0x05090034 0x050B0039121/* 1 3 4 2 */1220x06010002 0x06020004 0x06030005 0x06040003123/* 8 7 0 9 */1240x06050009 0x06060008 0x0608000b 0x0609000a125/* L_ALT DOWN RIGHT Q */1260x060a0038 0x060b006c 0x060c006a 0x07010010127/* E R W I */1280x07020012 0x07030013 0x07040011 0x07050017129/* U R_SHIFT P O */1300x07060016 0x07070036 0x07080019 0x07090018131/* UP LEFT */1320x070b0067 0x070c0069>;133};134- |135/* No matrix keyboard, just buttons/switches */136keyboard-controller {137compatible = "google,cros-ec-keyb-switches";138};139...140141142