1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * This header provides the constants of the standard Chrome OS key matrix 4 * for cros-ec keyboard-controller bindings. 5 * 6 * Copyright (c) 2021 Google, Inc 7 */ 8 9 #ifndef _CROS_EC_KEYBOARD_H 10 #define _CROS_EC_KEYBOARD_H 11 12 #define CROS_STD_TOP_ROW_KEYMAP \ 13 MATRIX_KEY(0x00, 0x02, KEY_F1) \ 14 MATRIX_KEY(0x03, 0x02, KEY_F2) \ 15 MATRIX_KEY(0x02, 0x02, KEY_F3) \ 16 MATRIX_KEY(0x01, 0x02, KEY_F4) \ 17 MATRIX_KEY(0x03, 0x04, KEY_F5) \ 18 MATRIX_KEY(0x02, 0x04, KEY_F6) \ 19 MATRIX_KEY(0x01, 0x04, KEY_F7) \ 20 MATRIX_KEY(0x02, 0x09, KEY_F8) \ 21 MATRIX_KEY(0x01, 0x09, KEY_F9) \ 22 MATRIX_KEY(0x00, 0x04, KEY_F10) 23 24 #define CROS_STD_MAIN_KEYMAP \ 25 MATRIX_KEY(0x00, 0x01, KEY_LEFTMETA) \ 26 MATRIX_KEY(0x00, 0x03, KEY_B) \ 27 MATRIX_KEY(0x00, 0x05, KEY_RO) \ 28 MATRIX_KEY(0x00, 0x06, KEY_N) \ 29 MATRIX_KEY(0x00, 0x08, KEY_EQUAL) \ 30 MATRIX_KEY(0x00, 0x0a, KEY_RIGHTALT) \ 31 MATRIX_KEY(0x01, 0x01, KEY_ESC) \ 32 MATRIX_KEY(0x01, 0x03, KEY_G) \ 33 MATRIX_KEY(0x01, 0x06, KEY_H) \ 34 MATRIX_KEY(0x01, 0x08, KEY_APOSTROPHE) \ 35 MATRIX_KEY(0x01, 0x0b, KEY_BACKSPACE) \ 36 MATRIX_KEY(0x01, 0x0c, KEY_HENKAN) \ 37 \ 38 MATRIX_KEY(0x02, 0x00, KEY_LEFTCTRL) \ 39 MATRIX_KEY(0x02, 0x01, KEY_TAB) \ 40 MATRIX_KEY(0x02, 0x03, KEY_T) \ 41 MATRIX_KEY(0x02, 0x05, KEY_RIGHTBRACE) \ 42 MATRIX_KEY(0x02, 0x06, KEY_Y) \ 43 MATRIX_KEY(0x02, 0x07, KEY_102ND) \ 44 MATRIX_KEY(0x02, 0x08, KEY_LEFTBRACE) \ 45 MATRIX_KEY(0x02, 0x0a, KEY_YEN) \ 46 \ 47 MATRIX_KEY(0x03, 0x00, KEY_LEFTMETA) \ 48 MATRIX_KEY(0x03, 0x01, KEY_GRAVE) \ 49 MATRIX_KEY(0x03, 0x03, KEY_5) \ 50 MATRIX_KEY(0x03, 0x06, KEY_6) \ 51 MATRIX_KEY(0x03, 0x08, KEY_MINUS) \ 52 MATRIX_KEY(0x03, 0x09, KEY_SLEEP) \ 53 MATRIX_KEY(0x03, 0x0b, KEY_BACKSLASH) \ 54 MATRIX_KEY(0x03, 0x0c, KEY_MUHENKAN) \ 55 \ 56 MATRIX_KEY(0x04, 0x00, KEY_RIGHTCTRL) \ 57 MATRIX_KEY(0x04, 0x01, KEY_A) \ 58 MATRIX_KEY(0x04, 0x02, KEY_D) \ 59 MATRIX_KEY(0x04, 0x03, KEY_F) \ 60 MATRIX_KEY(0x04, 0x04, KEY_S) \ 61 MATRIX_KEY(0x04, 0x05, KEY_K) \ 62 MATRIX_KEY(0x04, 0x06, KEY_J) \ 63 MATRIX_KEY(0x04, 0x08, KEY_SEMICOLON) \ 64 MATRIX_KEY(0x04, 0x09, KEY_L) \ 65 MATRIX_KEY(0x04, 0x0a, KEY_BACKSLASH) \ 66 MATRIX_KEY(0x04, 0x0b, KEY_ENTER) \ 67 \ 68 MATRIX_KEY(0x05, 0x01, KEY_Z) \ 69 MATRIX_KEY(0x05, 0x02, KEY_C) \ 70 MATRIX_KEY(0x05, 0x03, KEY_V) \ 71 MATRIX_KEY(0x05, 0x04, KEY_X) \ 72 MATRIX_KEY(0x05, 0x05, KEY_COMMA) \ 73 MATRIX_KEY(0x05, 0x06, KEY_M) \ 74 MATRIX_KEY(0x05, 0x07, KEY_LEFTSHIFT) \ 75 MATRIX_KEY(0x05, 0x08, KEY_SLASH) \ 76 MATRIX_KEY(0x05, 0x09, KEY_DOT) \ 77 MATRIX_KEY(0x05, 0x0b, KEY_SPACE) \ 78 \ 79 MATRIX_KEY(0x06, 0x01, KEY_1) \ 80 MATRIX_KEY(0x06, 0x02, KEY_3) \ 81 MATRIX_KEY(0x06, 0x03, KEY_4) \ 82 MATRIX_KEY(0x06, 0x04, KEY_2) \ 83 MATRIX_KEY(0x06, 0x05, KEY_8) \ 84 MATRIX_KEY(0x06, 0x06, KEY_7) \ 85 MATRIX_KEY(0x06, 0x08, KEY_0) \ 86 MATRIX_KEY(0x06, 0x09, KEY_9) \ 87 MATRIX_KEY(0x06, 0x0a, KEY_LEFTALT) \ 88 MATRIX_KEY(0x06, 0x0b, KEY_DOWN) \ 89 MATRIX_KEY(0x06, 0x0c, KEY_RIGHT) \ 90 \ 91 MATRIX_KEY(0x07, 0x01, KEY_Q) \ 92 MATRIX_KEY(0x07, 0x02, KEY_E) \ 93 MATRIX_KEY(0x07, 0x03, KEY_R) \ 94 MATRIX_KEY(0x07, 0x04, KEY_W) \ 95 MATRIX_KEY(0x07, 0x05, KEY_I) \ 96 MATRIX_KEY(0x07, 0x06, KEY_U) \ 97 MATRIX_KEY(0x07, 0x07, KEY_RIGHTSHIFT) \ 98 MATRIX_KEY(0x07, 0x08, KEY_P) \ 99 MATRIX_KEY(0x07, 0x09, KEY_O) \ 100 MATRIX_KEY(0x07, 0x0b, KEY_UP) \ 101 MATRIX_KEY(0x07, 0x0c, KEY_LEFT) 102 103 /* No numpad */ 104 #define CROS_TOP_ROW_KEYMAP_V30 \ 105 MATRIX_KEY(0x00, 0x01, KEY_F11) /* T11 */ \ 106 MATRIX_KEY(0x00, 0x02, KEY_F1) /* T1 */ \ 107 MATRIX_KEY(0x00, 0x04, KEY_F10) /* T10 */ \ 108 MATRIX_KEY(0x00, 0x0b, KEY_F14) /* T14 */ \ 109 MATRIX_KEY(0x00, 0x0c, KEY_F15) /* T15 */ \ 110 MATRIX_KEY(0x01, 0x02, KEY_F4) /* T4 */ \ 111 MATRIX_KEY(0x01, 0x04, KEY_F7) /* T7 */ \ 112 MATRIX_KEY(0x01, 0x05, KEY_F12) /* T12 */ \ 113 MATRIX_KEY(0x01, 0x09, KEY_F9) /* T9 */ \ 114 MATRIX_KEY(0x02, 0x02, KEY_F3) /* T3 */ \ 115 MATRIX_KEY(0x02, 0x04, KEY_F6) /* T6 */ \ 116 MATRIX_KEY(0x02, 0x0b, KEY_F8) /* T8 */ \ 117 MATRIX_KEY(0x03, 0x02, KEY_F2) /* T2 */ \ 118 MATRIX_KEY(0x03, 0x05, KEY_F13) /* T13 */ \ 119 MATRIX_KEY(0x04, 0x04, KEY_F5) /* T5 */ 120 121 #define CROS_MAIN_KEYMAP_V30 /* Keycode */ \ 122 MATRIX_KEY(0x00, 0x03, KEY_B) /* 50 */ \ 123 MATRIX_KEY(0x00, 0x05, KEY_N) /* 51 */ \ 124 MATRIX_KEY(0x00, 0x06, KEY_RO) /* 56 (JIS) */ \ 125 MATRIX_KEY(0x00, 0x08, KEY_EQUAL) /* 13 */ \ 126 MATRIX_KEY(0x00, 0x09, KEY_HOME) /* 80 (Numpad) */ \ 127 MATRIX_KEY(0x00, 0x0a, KEY_RIGHTALT) /* 62 */ \ 128 MATRIX_KEY(0x00, 0x10, KEY_FN) /* 127 */ \ 129 \ 130 MATRIX_KEY(0x01, 0x01, KEY_ESC) /* 110 */ \ 131 MATRIX_KEY(0x01, 0x03, KEY_G) /* 35 */ \ 132 MATRIX_KEY(0x01, 0x06, KEY_H) /* 36 */ \ 133 MATRIX_KEY(0x01, 0x08, KEY_APOSTROPHE) /* 41 */ \ 134 MATRIX_KEY(0x01, 0x0b, KEY_BACKSPACE) /* 15 */ \ 135 MATRIX_KEY(0x01, 0x0c, KEY_HENKAN) /* 65 (JIS) */ \ 136 MATRIX_KEY(0x01, 0x0e, KEY_LEFTCTRL) /* 58 */ \ 137 \ 138 MATRIX_KEY(0x02, 0x01, KEY_TAB) /* 16 */ \ 139 MATRIX_KEY(0x02, 0x03, KEY_T) /* 21 */ \ 140 MATRIX_KEY(0x02, 0x05, KEY_RIGHTBRACE) /* 28 */ \ 141 MATRIX_KEY(0x02, 0x06, KEY_Y) /* 22 */ \ 142 MATRIX_KEY(0x02, 0x08, KEY_LEFTBRACE) /* 27 */ \ 143 MATRIX_KEY(0x02, 0x09, KEY_DELETE) /* 76 (Numpad) */ \ 144 MATRIX_KEY(0x02, 0x0c, KEY_PAGEUP) /* 85 (Numpad) */ \ 145 MATRIX_KEY(0x02, 0x011, KEY_YEN) /* 14 (JIS) */ \ 146 \ 147 MATRIX_KEY(0x03, 0x00, KEY_LEFTMETA) /* Launcher */ \ 148 MATRIX_KEY(0x03, 0x01, KEY_GRAVE) /* 1 */ \ 149 MATRIX_KEY(0x03, 0x03, KEY_5) /* 6 */ \ 150 MATRIX_KEY(0x03, 0x04, KEY_S) /* 32 */ \ 151 MATRIX_KEY(0x03, 0x06, KEY_MINUS) /* 12 */ \ 152 MATRIX_KEY(0x03, 0x08, KEY_6) /* 7 */ \ 153 MATRIX_KEY(0x03, 0x09, KEY_SLEEP) /* Lock */ \ 154 MATRIX_KEY(0x03, 0x0b, KEY_BACKSLASH) /* 29 */ \ 155 MATRIX_KEY(0x03, 0x0c, KEY_MUHENKAN) /* 63 (JIS) */ \ 156 MATRIX_KEY(0x03, 0x0e, KEY_RIGHTCTRL) /* 64 */ \ 157 \ 158 MATRIX_KEY(0x04, 0x01, KEY_A) /* 31 */ \ 159 MATRIX_KEY(0x04, 0x02, KEY_D) /* 33 */ \ 160 MATRIX_KEY(0x04, 0x03, KEY_F) /* 34 */ \ 161 MATRIX_KEY(0x04, 0x05, KEY_K) /* 38 */ \ 162 MATRIX_KEY(0x04, 0x06, KEY_J) /* 37 */ \ 163 MATRIX_KEY(0x04, 0x08, KEY_SEMICOLON) /* 40 */ \ 164 MATRIX_KEY(0x04, 0x09, KEY_L) /* 39 */ \ 165 MATRIX_KEY(0x04, 0x0b, KEY_ENTER) /* 43 */ \ 166 MATRIX_KEY(0x04, 0x0c, KEY_END) /* 81 (Numpad) */ \ 167 \ 168 MATRIX_KEY(0x05, 0x01, KEY_1) /* 2 */ \ 169 MATRIX_KEY(0x05, 0x02, KEY_COMMA) /* 53 */ \ 170 MATRIX_KEY(0x05, 0x03, KEY_DOT) /* 54 */ \ 171 MATRIX_KEY(0x05, 0x04, KEY_SLASH) /* 55 */ \ 172 MATRIX_KEY(0x05, 0x05, KEY_C) /* 48 */ \ 173 MATRIX_KEY(0x05, 0x06, KEY_SPACE) /* 61 */ \ 174 MATRIX_KEY(0x05, 0x07, KEY_LEFTSHIFT) /* 44 */ \ 175 MATRIX_KEY(0x05, 0x08, KEY_X) /* 47 */ \ 176 MATRIX_KEY(0x05, 0x09, KEY_V) /* 49 */ \ 177 MATRIX_KEY(0x05, 0x0b, KEY_M) /* 52 */ \ 178 MATRIX_KEY(0x05, 0x0c, KEY_PAGEDOWN) /* 86 (Numpad) */ \ 179 \ 180 MATRIX_KEY(0x06, 0x01, KEY_Z) /* 46 */ \ 181 MATRIX_KEY(0x06, 0x02, KEY_3) /* 4 */ \ 182 MATRIX_KEY(0x06, 0x03, KEY_4) /* 5 */ \ 183 MATRIX_KEY(0x06, 0x04, KEY_2) /* 3 */ \ 184 MATRIX_KEY(0x06, 0x05, KEY_8) /* 9 */ \ 185 MATRIX_KEY(0x06, 0x06, KEY_0) /* 11 */ \ 186 MATRIX_KEY(0x06, 0x08, KEY_7) /* 8 */ \ 187 MATRIX_KEY(0x06, 0x09, KEY_9) /* 10 */ \ 188 MATRIX_KEY(0x06, 0x0b, KEY_DOWN) /* 84 */ \ 189 MATRIX_KEY(0x06, 0x0c, KEY_RIGHT) /* 89 */ \ 190 MATRIX_KEY(0x06, 0x0d, KEY_LEFTALT) /* 60 */ \ 191 MATRIX_KEY(0x06, 0x0f, KEY_ASSISTANT) /* 128 */ \ 192 MATRIX_KEY(0x06, 0x11, KEY_BACKSLASH) /* 42 (JIS, ISO) */ \ 193 \ 194 MATRIX_KEY(0x07, 0x01, KEY_U) /* 23 */ \ 195 MATRIX_KEY(0x07, 0x02, KEY_I) /* 24 */ \ 196 MATRIX_KEY(0x07, 0x03, KEY_O) /* 25 */ \ 197 MATRIX_KEY(0x07, 0x04, KEY_P) /* 26 */ \ 198 MATRIX_KEY(0x07, 0x05, KEY_Q) /* 17 */ \ 199 MATRIX_KEY(0x07, 0x06, KEY_W) /* 18 */ \ 200 MATRIX_KEY(0x07, 0x07, KEY_RIGHTSHIFT) /* 57 */ \ 201 MATRIX_KEY(0x07, 0x08, KEY_E) /* 19 */ \ 202 MATRIX_KEY(0x07, 0x09, KEY_R) /* 20 */ \ 203 MATRIX_KEY(0x07, 0x0b, KEY_UP) /* 83 */ \ 204 MATRIX_KEY(0x07, 0x0c, KEY_LEFT) /* 79 */ \ 205 MATRIX_KEY(0x07, 0x11, KEY_102ND) /* 45 (ISO) */ 206 207 #endif /* _CROS_EC_KEYBOARD_H */ 208
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.