15def4c47SEmmanuel Vadot /* SPDX-License-Identifier: GPL-2.0 */ 25def4c47SEmmanuel Vadot /* 35def4c47SEmmanuel Vadot * This header provides the constants of the standard Chrome OS key matrix 45def4c47SEmmanuel Vadot * for cros-ec keyboard-controller bindings. 55def4c47SEmmanuel Vadot * 65def4c47SEmmanuel Vadot * Copyright (c) 2021 Google, Inc 75def4c47SEmmanuel Vadot */ 85def4c47SEmmanuel Vadot 95def4c47SEmmanuel Vadot #ifndef _CROS_EC_KEYBOARD_H 105def4c47SEmmanuel Vadot #define _CROS_EC_KEYBOARD_H 115def4c47SEmmanuel Vadot 125def4c47SEmmanuel Vadot #define CROS_STD_TOP_ROW_KEYMAP \ 135def4c47SEmmanuel Vadot MATRIX_KEY(0x00, 0x02, KEY_F1) \ 145def4c47SEmmanuel Vadot MATRIX_KEY(0x03, 0x02, KEY_F2) \ 155def4c47SEmmanuel Vadot MATRIX_KEY(0x02, 0x02, KEY_F3) \ 165def4c47SEmmanuel Vadot MATRIX_KEY(0x01, 0x02, KEY_F4) \ 175def4c47SEmmanuel Vadot MATRIX_KEY(0x03, 0x04, KEY_F5) \ 185def4c47SEmmanuel Vadot MATRIX_KEY(0x02, 0x04, KEY_F6) \ 195def4c47SEmmanuel Vadot MATRIX_KEY(0x01, 0x04, KEY_F7) \ 205def4c47SEmmanuel Vadot MATRIX_KEY(0x02, 0x09, KEY_F8) \ 215def4c47SEmmanuel Vadot MATRIX_KEY(0x01, 0x09, KEY_F9) \ 225def4c47SEmmanuel Vadot MATRIX_KEY(0x00, 0x04, KEY_F10) 235def4c47SEmmanuel Vadot 245def4c47SEmmanuel Vadot #define CROS_STD_MAIN_KEYMAP \ 255def4c47SEmmanuel Vadot MATRIX_KEY(0x00, 0x01, KEY_LEFTMETA) \ 265def4c47SEmmanuel Vadot MATRIX_KEY(0x00, 0x03, KEY_B) \ 275def4c47SEmmanuel Vadot MATRIX_KEY(0x00, 0x05, KEY_RO) \ 285def4c47SEmmanuel Vadot MATRIX_KEY(0x00, 0x06, KEY_N) \ 295def4c47SEmmanuel Vadot MATRIX_KEY(0x00, 0x08, KEY_EQUAL) \ 305def4c47SEmmanuel Vadot MATRIX_KEY(0x00, 0x0a, KEY_RIGHTALT) \ 315def4c47SEmmanuel Vadot MATRIX_KEY(0x01, 0x01, KEY_ESC) \ 325def4c47SEmmanuel Vadot MATRIX_KEY(0x01, 0x03, KEY_G) \ 335def4c47SEmmanuel Vadot MATRIX_KEY(0x01, 0x06, KEY_H) \ 345def4c47SEmmanuel Vadot MATRIX_KEY(0x01, 0x08, KEY_APOSTROPHE) \ 355def4c47SEmmanuel Vadot MATRIX_KEY(0x01, 0x0b, KEY_BACKSPACE) \ 365def4c47SEmmanuel Vadot MATRIX_KEY(0x01, 0x0c, KEY_HENKAN) \ 375def4c47SEmmanuel Vadot \ 385def4c47SEmmanuel Vadot MATRIX_KEY(0x02, 0x00, KEY_LEFTCTRL) \ 395def4c47SEmmanuel Vadot MATRIX_KEY(0x02, 0x01, KEY_TAB) \ 405def4c47SEmmanuel Vadot MATRIX_KEY(0x02, 0x03, KEY_T) \ 415def4c47SEmmanuel Vadot MATRIX_KEY(0x02, 0x05, KEY_RIGHTBRACE) \ 425def4c47SEmmanuel Vadot MATRIX_KEY(0x02, 0x06, KEY_Y) \ 435def4c47SEmmanuel Vadot MATRIX_KEY(0x02, 0x07, KEY_102ND) \ 445def4c47SEmmanuel Vadot MATRIX_KEY(0x02, 0x08, KEY_LEFTBRACE) \ 455def4c47SEmmanuel Vadot MATRIX_KEY(0x02, 0x0a, KEY_YEN) \ 465def4c47SEmmanuel Vadot \ 475def4c47SEmmanuel Vadot MATRIX_KEY(0x03, 0x00, KEY_LEFTMETA) \ 485def4c47SEmmanuel Vadot MATRIX_KEY(0x03, 0x01, KEY_GRAVE) \ 495def4c47SEmmanuel Vadot MATRIX_KEY(0x03, 0x03, KEY_5) \ 505def4c47SEmmanuel Vadot MATRIX_KEY(0x03, 0x06, KEY_6) \ 515def4c47SEmmanuel Vadot MATRIX_KEY(0x03, 0x08, KEY_MINUS) \ 525def4c47SEmmanuel Vadot MATRIX_KEY(0x03, 0x09, KEY_SLEEP) \ 535def4c47SEmmanuel Vadot MATRIX_KEY(0x03, 0x0b, KEY_BACKSLASH) \ 545def4c47SEmmanuel Vadot MATRIX_KEY(0x03, 0x0c, KEY_MUHENKAN) \ 555def4c47SEmmanuel Vadot \ 565def4c47SEmmanuel Vadot MATRIX_KEY(0x04, 0x00, KEY_RIGHTCTRL) \ 575def4c47SEmmanuel Vadot MATRIX_KEY(0x04, 0x01, KEY_A) \ 585def4c47SEmmanuel Vadot MATRIX_KEY(0x04, 0x02, KEY_D) \ 595def4c47SEmmanuel Vadot MATRIX_KEY(0x04, 0x03, KEY_F) \ 605def4c47SEmmanuel Vadot MATRIX_KEY(0x04, 0x04, KEY_S) \ 615def4c47SEmmanuel Vadot MATRIX_KEY(0x04, 0x05, KEY_K) \ 625def4c47SEmmanuel Vadot MATRIX_KEY(0x04, 0x06, KEY_J) \ 635def4c47SEmmanuel Vadot MATRIX_KEY(0x04, 0x08, KEY_SEMICOLON) \ 645def4c47SEmmanuel Vadot MATRIX_KEY(0x04, 0x09, KEY_L) \ 655def4c47SEmmanuel Vadot MATRIX_KEY(0x04, 0x0a, KEY_BACKSLASH) \ 665def4c47SEmmanuel Vadot MATRIX_KEY(0x04, 0x0b, KEY_ENTER) \ 675def4c47SEmmanuel Vadot \ 685def4c47SEmmanuel Vadot MATRIX_KEY(0x05, 0x01, KEY_Z) \ 695def4c47SEmmanuel Vadot MATRIX_KEY(0x05, 0x02, KEY_C) \ 705def4c47SEmmanuel Vadot MATRIX_KEY(0x05, 0x03, KEY_V) \ 715def4c47SEmmanuel Vadot MATRIX_KEY(0x05, 0x04, KEY_X) \ 725def4c47SEmmanuel Vadot MATRIX_KEY(0x05, 0x05, KEY_COMMA) \ 735def4c47SEmmanuel Vadot MATRIX_KEY(0x05, 0x06, KEY_M) \ 745def4c47SEmmanuel Vadot MATRIX_KEY(0x05, 0x07, KEY_LEFTSHIFT) \ 755def4c47SEmmanuel Vadot MATRIX_KEY(0x05, 0x08, KEY_SLASH) \ 765def4c47SEmmanuel Vadot MATRIX_KEY(0x05, 0x09, KEY_DOT) \ 775def4c47SEmmanuel Vadot MATRIX_KEY(0x05, 0x0b, KEY_SPACE) \ 785def4c47SEmmanuel Vadot \ 795def4c47SEmmanuel Vadot MATRIX_KEY(0x06, 0x01, KEY_1) \ 805def4c47SEmmanuel Vadot MATRIX_KEY(0x06, 0x02, KEY_3) \ 815def4c47SEmmanuel Vadot MATRIX_KEY(0x06, 0x03, KEY_4) \ 825def4c47SEmmanuel Vadot MATRIX_KEY(0x06, 0x04, KEY_2) \ 835def4c47SEmmanuel Vadot MATRIX_KEY(0x06, 0x05, KEY_8) \ 845def4c47SEmmanuel Vadot MATRIX_KEY(0x06, 0x06, KEY_7) \ 855def4c47SEmmanuel Vadot MATRIX_KEY(0x06, 0x08, KEY_0) \ 865def4c47SEmmanuel Vadot MATRIX_KEY(0x06, 0x09, KEY_9) \ 875def4c47SEmmanuel Vadot MATRIX_KEY(0x06, 0x0a, KEY_LEFTALT) \ 885def4c47SEmmanuel Vadot MATRIX_KEY(0x06, 0x0b, KEY_DOWN) \ 895def4c47SEmmanuel Vadot MATRIX_KEY(0x06, 0x0c, KEY_RIGHT) \ 905def4c47SEmmanuel Vadot \ 915def4c47SEmmanuel Vadot MATRIX_KEY(0x07, 0x01, KEY_Q) \ 925def4c47SEmmanuel Vadot MATRIX_KEY(0x07, 0x02, KEY_E) \ 935def4c47SEmmanuel Vadot MATRIX_KEY(0x07, 0x03, KEY_R) \ 945def4c47SEmmanuel Vadot MATRIX_KEY(0x07, 0x04, KEY_W) \ 955def4c47SEmmanuel Vadot MATRIX_KEY(0x07, 0x05, KEY_I) \ 965def4c47SEmmanuel Vadot MATRIX_KEY(0x07, 0x06, KEY_U) \ 975def4c47SEmmanuel Vadot MATRIX_KEY(0x07, 0x07, KEY_RIGHTSHIFT) \ 985def4c47SEmmanuel Vadot MATRIX_KEY(0x07, 0x08, KEY_P) \ 995def4c47SEmmanuel Vadot MATRIX_KEY(0x07, 0x09, KEY_O) \ 1005def4c47SEmmanuel Vadot MATRIX_KEY(0x07, 0x0b, KEY_UP) \ 1015def4c47SEmmanuel Vadot MATRIX_KEY(0x07, 0x0c, KEY_LEFT) 1025def4c47SEmmanuel Vadot 103*0e8011faSEmmanuel Vadot /* No numpad */ 104*0e8011faSEmmanuel Vadot #define CROS_TOP_ROW_KEYMAP_V30 \ 105*0e8011faSEmmanuel Vadot MATRIX_KEY(0x00, 0x01, KEY_F11) /* T11 */ \ 106*0e8011faSEmmanuel Vadot MATRIX_KEY(0x00, 0x02, KEY_F1) /* T1 */ \ 107*0e8011faSEmmanuel Vadot MATRIX_KEY(0x00, 0x04, KEY_F10) /* T10 */ \ 108*0e8011faSEmmanuel Vadot MATRIX_KEY(0x00, 0x0b, KEY_F14) /* T14 */ \ 109*0e8011faSEmmanuel Vadot MATRIX_KEY(0x00, 0x0c, KEY_F15) /* T15 */ \ 110*0e8011faSEmmanuel Vadot MATRIX_KEY(0x01, 0x02, KEY_F4) /* T4 */ \ 111*0e8011faSEmmanuel Vadot MATRIX_KEY(0x01, 0x04, KEY_F7) /* T7 */ \ 112*0e8011faSEmmanuel Vadot MATRIX_KEY(0x01, 0x05, KEY_F12) /* T12 */ \ 113*0e8011faSEmmanuel Vadot MATRIX_KEY(0x01, 0x09, KEY_F9) /* T9 */ \ 114*0e8011faSEmmanuel Vadot MATRIX_KEY(0x02, 0x02, KEY_F3) /* T3 */ \ 115*0e8011faSEmmanuel Vadot MATRIX_KEY(0x02, 0x04, KEY_F6) /* T6 */ \ 116*0e8011faSEmmanuel Vadot MATRIX_KEY(0x02, 0x0b, KEY_F8) /* T8 */ \ 117*0e8011faSEmmanuel Vadot MATRIX_KEY(0x03, 0x02, KEY_F2) /* T2 */ \ 118*0e8011faSEmmanuel Vadot MATRIX_KEY(0x03, 0x05, KEY_F13) /* T13 */ \ 119*0e8011faSEmmanuel Vadot MATRIX_KEY(0x04, 0x04, KEY_F5) /* T5 */ 120*0e8011faSEmmanuel Vadot 121*0e8011faSEmmanuel Vadot #define CROS_MAIN_KEYMAP_V30 /* Keycode */ \ 122*0e8011faSEmmanuel Vadot MATRIX_KEY(0x00, 0x03, KEY_B) /* 50 */ \ 123*0e8011faSEmmanuel Vadot MATRIX_KEY(0x00, 0x05, KEY_N) /* 51 */ \ 124*0e8011faSEmmanuel Vadot MATRIX_KEY(0x00, 0x06, KEY_RO) /* 56 (JIS) */ \ 125*0e8011faSEmmanuel Vadot MATRIX_KEY(0x00, 0x08, KEY_EQUAL) /* 13 */ \ 126*0e8011faSEmmanuel Vadot MATRIX_KEY(0x00, 0x09, KEY_HOME) /* 80 (Numpad) */ \ 127*0e8011faSEmmanuel Vadot MATRIX_KEY(0x00, 0x0a, KEY_RIGHTALT) /* 62 */ \ 128*0e8011faSEmmanuel Vadot MATRIX_KEY(0x00, 0x10, KEY_FN) /* 127 */ \ 129*0e8011faSEmmanuel Vadot \ 130*0e8011faSEmmanuel Vadot MATRIX_KEY(0x01, 0x01, KEY_ESC) /* 110 */ \ 131*0e8011faSEmmanuel Vadot MATRIX_KEY(0x01, 0x03, KEY_G) /* 35 */ \ 132*0e8011faSEmmanuel Vadot MATRIX_KEY(0x01, 0x06, KEY_H) /* 36 */ \ 133*0e8011faSEmmanuel Vadot MATRIX_KEY(0x01, 0x08, KEY_APOSTROPHE) /* 41 */ \ 134*0e8011faSEmmanuel Vadot MATRIX_KEY(0x01, 0x0b, KEY_BACKSPACE) /* 15 */ \ 135*0e8011faSEmmanuel Vadot MATRIX_KEY(0x01, 0x0c, KEY_HENKAN) /* 65 (JIS) */ \ 136*0e8011faSEmmanuel Vadot MATRIX_KEY(0x01, 0x0e, KEY_LEFTCTRL) /* 58 */ \ 137*0e8011faSEmmanuel Vadot \ 138*0e8011faSEmmanuel Vadot MATRIX_KEY(0x02, 0x01, KEY_TAB) /* 16 */ \ 139*0e8011faSEmmanuel Vadot MATRIX_KEY(0x02, 0x03, KEY_T) /* 21 */ \ 140*0e8011faSEmmanuel Vadot MATRIX_KEY(0x02, 0x05, KEY_RIGHTBRACE) /* 28 */ \ 141*0e8011faSEmmanuel Vadot MATRIX_KEY(0x02, 0x06, KEY_Y) /* 22 */ \ 142*0e8011faSEmmanuel Vadot MATRIX_KEY(0x02, 0x08, KEY_LEFTBRACE) /* 27 */ \ 143*0e8011faSEmmanuel Vadot MATRIX_KEY(0x02, 0x09, KEY_DELETE) /* 76 (Numpad) */ \ 144*0e8011faSEmmanuel Vadot MATRIX_KEY(0x02, 0x0c, KEY_PAGEUP) /* 85 (Numpad) */ \ 145*0e8011faSEmmanuel Vadot MATRIX_KEY(0x02, 0x011, KEY_YEN) /* 14 (JIS) */ \ 146*0e8011faSEmmanuel Vadot \ 147*0e8011faSEmmanuel Vadot MATRIX_KEY(0x03, 0x00, KEY_LEFTMETA) /* Launcher */ \ 148*0e8011faSEmmanuel Vadot MATRIX_KEY(0x03, 0x01, KEY_GRAVE) /* 1 */ \ 149*0e8011faSEmmanuel Vadot MATRIX_KEY(0x03, 0x03, KEY_5) /* 6 */ \ 150*0e8011faSEmmanuel Vadot MATRIX_KEY(0x03, 0x04, KEY_S) /* 32 */ \ 151*0e8011faSEmmanuel Vadot MATRIX_KEY(0x03, 0x06, KEY_MINUS) /* 12 */ \ 152*0e8011faSEmmanuel Vadot MATRIX_KEY(0x03, 0x08, KEY_6) /* 7 */ \ 153*0e8011faSEmmanuel Vadot MATRIX_KEY(0x03, 0x09, KEY_SLEEP) /* Lock */ \ 154*0e8011faSEmmanuel Vadot MATRIX_KEY(0x03, 0x0b, KEY_BACKSLASH) /* 29 */ \ 155*0e8011faSEmmanuel Vadot MATRIX_KEY(0x03, 0x0c, KEY_MUHENKAN) /* 63 (JIS) */ \ 156*0e8011faSEmmanuel Vadot MATRIX_KEY(0x03, 0x0e, KEY_RIGHTCTRL) /* 64 */ \ 157*0e8011faSEmmanuel Vadot \ 158*0e8011faSEmmanuel Vadot MATRIX_KEY(0x04, 0x01, KEY_A) /* 31 */ \ 159*0e8011faSEmmanuel Vadot MATRIX_KEY(0x04, 0x02, KEY_D) /* 33 */ \ 160*0e8011faSEmmanuel Vadot MATRIX_KEY(0x04, 0x03, KEY_F) /* 34 */ \ 161*0e8011faSEmmanuel Vadot MATRIX_KEY(0x04, 0x05, KEY_K) /* 38 */ \ 162*0e8011faSEmmanuel Vadot MATRIX_KEY(0x04, 0x06, KEY_J) /* 37 */ \ 163*0e8011faSEmmanuel Vadot MATRIX_KEY(0x04, 0x08, KEY_SEMICOLON) /* 40 */ \ 164*0e8011faSEmmanuel Vadot MATRIX_KEY(0x04, 0x09, KEY_L) /* 39 */ \ 165*0e8011faSEmmanuel Vadot MATRIX_KEY(0x04, 0x0b, KEY_ENTER) /* 43 */ \ 166*0e8011faSEmmanuel Vadot MATRIX_KEY(0x04, 0x0c, KEY_END) /* 81 (Numpad) */ \ 167*0e8011faSEmmanuel Vadot \ 168*0e8011faSEmmanuel Vadot MATRIX_KEY(0x05, 0x01, KEY_1) /* 2 */ \ 169*0e8011faSEmmanuel Vadot MATRIX_KEY(0x05, 0x02, KEY_COMMA) /* 53 */ \ 170*0e8011faSEmmanuel Vadot MATRIX_KEY(0x05, 0x03, KEY_DOT) /* 54 */ \ 171*0e8011faSEmmanuel Vadot MATRIX_KEY(0x05, 0x04, KEY_SLASH) /* 55 */ \ 172*0e8011faSEmmanuel Vadot MATRIX_KEY(0x05, 0x05, KEY_C) /* 48 */ \ 173*0e8011faSEmmanuel Vadot MATRIX_KEY(0x05, 0x06, KEY_SPACE) /* 61 */ \ 174*0e8011faSEmmanuel Vadot MATRIX_KEY(0x05, 0x07, KEY_LEFTSHIFT) /* 44 */ \ 175*0e8011faSEmmanuel Vadot MATRIX_KEY(0x05, 0x08, KEY_X) /* 47 */ \ 176*0e8011faSEmmanuel Vadot MATRIX_KEY(0x05, 0x09, KEY_V) /* 49 */ \ 177*0e8011faSEmmanuel Vadot MATRIX_KEY(0x05, 0x0b, KEY_M) /* 52 */ \ 178*0e8011faSEmmanuel Vadot MATRIX_KEY(0x05, 0x0c, KEY_PAGEDOWN) /* 86 (Numpad) */ \ 179*0e8011faSEmmanuel Vadot \ 180*0e8011faSEmmanuel Vadot MATRIX_KEY(0x06, 0x01, KEY_Z) /* 46 */ \ 181*0e8011faSEmmanuel Vadot MATRIX_KEY(0x06, 0x02, KEY_3) /* 4 */ \ 182*0e8011faSEmmanuel Vadot MATRIX_KEY(0x06, 0x03, KEY_4) /* 5 */ \ 183*0e8011faSEmmanuel Vadot MATRIX_KEY(0x06, 0x04, KEY_2) /* 3 */ \ 184*0e8011faSEmmanuel Vadot MATRIX_KEY(0x06, 0x05, KEY_8) /* 9 */ \ 185*0e8011faSEmmanuel Vadot MATRIX_KEY(0x06, 0x06, KEY_0) /* 11 */ \ 186*0e8011faSEmmanuel Vadot MATRIX_KEY(0x06, 0x08, KEY_7) /* 8 */ \ 187*0e8011faSEmmanuel Vadot MATRIX_KEY(0x06, 0x09, KEY_9) /* 10 */ \ 188*0e8011faSEmmanuel Vadot MATRIX_KEY(0x06, 0x0b, KEY_DOWN) /* 84 */ \ 189*0e8011faSEmmanuel Vadot MATRIX_KEY(0x06, 0x0c, KEY_RIGHT) /* 89 */ \ 190*0e8011faSEmmanuel Vadot MATRIX_KEY(0x06, 0x0d, KEY_LEFTALT) /* 60 */ \ 191*0e8011faSEmmanuel Vadot MATRIX_KEY(0x06, 0x0f, KEY_ASSISTANT) /* 128 */ \ 192*0e8011faSEmmanuel Vadot MATRIX_KEY(0x06, 0x11, KEY_BACKSLASH) /* 42 (JIS, ISO) */ \ 193*0e8011faSEmmanuel Vadot \ 194*0e8011faSEmmanuel Vadot MATRIX_KEY(0x07, 0x01, KEY_U) /* 23 */ \ 195*0e8011faSEmmanuel Vadot MATRIX_KEY(0x07, 0x02, KEY_I) /* 24 */ \ 196*0e8011faSEmmanuel Vadot MATRIX_KEY(0x07, 0x03, KEY_O) /* 25 */ \ 197*0e8011faSEmmanuel Vadot MATRIX_KEY(0x07, 0x04, KEY_P) /* 26 */ \ 198*0e8011faSEmmanuel Vadot MATRIX_KEY(0x07, 0x05, KEY_Q) /* 17 */ \ 199*0e8011faSEmmanuel Vadot MATRIX_KEY(0x07, 0x06, KEY_W) /* 18 */ \ 200*0e8011faSEmmanuel Vadot MATRIX_KEY(0x07, 0x07, KEY_RIGHTSHIFT) /* 57 */ \ 201*0e8011faSEmmanuel Vadot MATRIX_KEY(0x07, 0x08, KEY_E) /* 19 */ \ 202*0e8011faSEmmanuel Vadot MATRIX_KEY(0x07, 0x09, KEY_R) /* 20 */ \ 203*0e8011faSEmmanuel Vadot MATRIX_KEY(0x07, 0x0b, KEY_UP) /* 83 */ \ 204*0e8011faSEmmanuel Vadot MATRIX_KEY(0x07, 0x0c, KEY_LEFT) /* 79 */ \ 205*0e8011faSEmmanuel Vadot MATRIX_KEY(0x07, 0x11, KEY_102ND) /* 45 (ISO) */ 206*0e8011faSEmmanuel Vadot 2075def4c47SEmmanuel Vadot #endif /* _CROS_EC_KEYBOARD_H */ 208