xref: /freebsd/sys/contrib/device-tree/Bindings/input/google,cros-ec-keyb.yaml (revision 5def4c47d4bd90b209b9b4a4ba9faec15846d8fd)
16be33864SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
26be33864SEmmanuel Vadot%YAML 1.2
36be33864SEmmanuel Vadot---
46be33864SEmmanuel Vadot
56be33864SEmmanuel Vadot$id: http://devicetree.org/schemas/input/google,cros-ec-keyb.yaml#
66be33864SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
76be33864SEmmanuel Vadot
86be33864SEmmanuel Vadottitle: ChromeOS EC Keyboard
96be33864SEmmanuel Vadot
106be33864SEmmanuel Vadotmaintainers:
116be33864SEmmanuel Vadot  - Simon Glass <sjg@chromium.org>
126be33864SEmmanuel Vadot  - Benson Leung <bleung@chromium.org>
136be33864SEmmanuel Vadot  - Enric Balletbo i Serra <enric.balletbo@collabora.com>
146be33864SEmmanuel Vadot
156be33864SEmmanuel Vadotdescription: |
166be33864SEmmanuel Vadot  Google's ChromeOS EC Keyboard is a simple matrix keyboard
176be33864SEmmanuel Vadot  implemented on a separate EC (Embedded Controller) device. It provides
186be33864SEmmanuel Vadot  a message for reading key scans from the EC. These are then converted
196be33864SEmmanuel Vadot  into keycodes for processing by the kernel.
206be33864SEmmanuel Vadot
216be33864SEmmanuel VadotallOf:
226be33864SEmmanuel Vadot  - $ref: "/schemas/input/matrix-keymap.yaml#"
236be33864SEmmanuel Vadot
246be33864SEmmanuel Vadotproperties:
256be33864SEmmanuel Vadot  compatible:
266be33864SEmmanuel Vadot    const: google,cros-ec-keyb
276be33864SEmmanuel Vadot
286be33864SEmmanuel Vadot  google,needs-ghost-filter:
296be33864SEmmanuel Vadot    description:
306be33864SEmmanuel Vadot      Enable a ghost filter for the matrix keyboard. This is recommended
316be33864SEmmanuel Vadot      if the EC does not have its own logic or hardware for this.
326be33864SEmmanuel Vadot    type: boolean
336be33864SEmmanuel Vadot
34*5def4c47SEmmanuel Vadot  function-row-physmap:
35*5def4c47SEmmanuel Vadot    minItems: 1
36*5def4c47SEmmanuel Vadot    maxItems: 15
37*5def4c47SEmmanuel Vadot    description: |
38*5def4c47SEmmanuel Vadot      An ordered u32 array describing the rows/columns (in the scan matrix)
39*5def4c47SEmmanuel Vadot      of top row keys from physical left (KEY_F1) to right. Each entry
40*5def4c47SEmmanuel Vadot      encodes the row/column as:
41*5def4c47SEmmanuel Vadot      (((row) & 0xFF) << 24) | (((column) & 0xFF) << 16)
42*5def4c47SEmmanuel Vadot      where the lower 16 bits are reserved. This property is specified only
43*5def4c47SEmmanuel Vadot      when the keyboard has a custom design for the top row keys.
44*5def4c47SEmmanuel Vadot
456be33864SEmmanuel Vadotrequired:
466be33864SEmmanuel Vadot  - compatible
476be33864SEmmanuel Vadot
486be33864SEmmanuel VadotunevaluatedProperties: false
496be33864SEmmanuel Vadot
506be33864SEmmanuel Vadotexamples:
516be33864SEmmanuel Vadot  - |
52*5def4c47SEmmanuel Vadot    #include <dt-bindings/input/input.h>
536be33864SEmmanuel Vadot    cros-ec-keyb {
546be33864SEmmanuel Vadot        compatible = "google,cros-ec-keyb";
556be33864SEmmanuel Vadot        keypad,num-rows = <8>;
566be33864SEmmanuel Vadot        keypad,num-columns = <13>;
576be33864SEmmanuel Vadot        google,needs-ghost-filter;
58*5def4c47SEmmanuel Vadot        function-row-physmap = <
59*5def4c47SEmmanuel Vadot            MATRIX_KEY(0x00, 0x02, 0)   /* T1 */
60*5def4c47SEmmanuel Vadot            MATRIX_KEY(0x03, 0x02, 0)   /* T2 */
61*5def4c47SEmmanuel Vadot            MATRIX_KEY(0x02, 0x02, 0)   /* T3 */
62*5def4c47SEmmanuel Vadot            MATRIX_KEY(0x01, 0x02, 0)   /* T4 */
63*5def4c47SEmmanuel Vadot            MATRIX_KEY(0x03, 0x04, 0)   /* T5 */
64*5def4c47SEmmanuel Vadot            MATRIX_KEY(0x02, 0x04, 0)   /* T6 */
65*5def4c47SEmmanuel Vadot            MATRIX_KEY(0x01, 0x04, 0)   /* T7 */
66*5def4c47SEmmanuel Vadot            MATRIX_KEY(0x02, 0x09, 0)   /* T8 */
67*5def4c47SEmmanuel Vadot            MATRIX_KEY(0x01, 0x09, 0)   /* T9 */
68*5def4c47SEmmanuel Vadot            MATRIX_KEY(0x00, 0x04, 0)   /* T10 */
69*5def4c47SEmmanuel Vadot        >;
706be33864SEmmanuel Vadot        /*
716be33864SEmmanuel Vadot         * Keymap entries take the form of 0xRRCCKKKK where
726be33864SEmmanuel Vadot         * RR=Row CC=Column KKKK=Key Code
736be33864SEmmanuel Vadot         * The values below are for a US keyboard layout and
746be33864SEmmanuel Vadot         * are taken from the Linux driver. Note that the
756be33864SEmmanuel Vadot         * 102ND key is not used for US keyboards.
766be33864SEmmanuel Vadot         */
776be33864SEmmanuel Vadot        linux,keymap = <
786be33864SEmmanuel Vadot            /* CAPSLCK F1         B          F10     */
796be33864SEmmanuel Vadot            0x0001003a 0x0002003b 0x00030030 0x00040044
806be33864SEmmanuel Vadot            /* N       =          R_ALT      ESC     */
816be33864SEmmanuel Vadot            0x00060031 0x0008000d 0x000a0064 0x01010001
826be33864SEmmanuel Vadot            /* F4      G          F7         H       */
836be33864SEmmanuel Vadot            0x0102003e 0x01030022 0x01040041 0x01060023
846be33864SEmmanuel Vadot            /* '       F9         BKSPACE    L_CTRL  */
856be33864SEmmanuel Vadot            0x01080028 0x01090043 0x010b000e 0x0200001d
866be33864SEmmanuel Vadot            /* TAB     F3         T          F6      */
876be33864SEmmanuel Vadot            0x0201000f 0x0202003d 0x02030014 0x02040040
886be33864SEmmanuel Vadot            /* ]       Y          102ND      [       */
896be33864SEmmanuel Vadot            0x0205001b 0x02060015 0x02070056 0x0208001a
906be33864SEmmanuel Vadot            /* F8      GRAVE      F2         5       */
916be33864SEmmanuel Vadot            0x02090042 0x03010029 0x0302003c 0x03030006
926be33864SEmmanuel Vadot            /* F5      6          -          \       */
936be33864SEmmanuel Vadot            0x0304003f 0x03060007 0x0308000c 0x030b002b
946be33864SEmmanuel Vadot            /* R_CTRL  A          D          F       */
956be33864SEmmanuel Vadot            0x04000061 0x0401001e 0x04020020 0x04030021
966be33864SEmmanuel Vadot            /* S       K          J          ;       */
976be33864SEmmanuel Vadot            0x0404001f 0x04050025 0x04060024 0x04080027
986be33864SEmmanuel Vadot            /* L       ENTER      Z          C       */
996be33864SEmmanuel Vadot            0x04090026 0x040b001c 0x0501002c 0x0502002e
1006be33864SEmmanuel Vadot            /* V       X          ,          M       */
1016be33864SEmmanuel Vadot            0x0503002f 0x0504002d 0x05050033 0x05060032
1026be33864SEmmanuel Vadot            /* L_SHIFT /          .          SPACE   */
1036be33864SEmmanuel Vadot            0x0507002a 0x05080035 0x05090034 0x050B0039
1046be33864SEmmanuel Vadot            /* 1       3          4          2       */
1056be33864SEmmanuel Vadot            0x06010002 0x06020004 0x06030005 0x06040003
1066be33864SEmmanuel Vadot            /* 8       7          0          9       */
1076be33864SEmmanuel Vadot            0x06050009 0x06060008 0x0608000b 0x0609000a
1086be33864SEmmanuel Vadot            /* L_ALT   DOWN       RIGHT      Q       */
1096be33864SEmmanuel Vadot            0x060a0038 0x060b006c 0x060c006a 0x07010010
1106be33864SEmmanuel Vadot            /* E       R          W          I       */
1116be33864SEmmanuel Vadot            0x07020012 0x07030013 0x07040011 0x07050017
1126be33864SEmmanuel Vadot            /* U       R_SHIFT    P          O       */
1136be33864SEmmanuel Vadot            0x07060016 0x07070036 0x07080019 0x07090018
1146be33864SEmmanuel Vadot            /* UP      LEFT    */
1156be33864SEmmanuel Vadot            0x070b0067 0x070c0069>;
1166be33864SEmmanuel Vadot    };
117