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