@@ -285,6 +285,28 @@ static const struct apple_key_translation apple_fn_keys_spi[] = {
285285 { }
286286};
287287
288+ static const struct apple_key_translation apple_fn_keys_mbp13 [] = {
289+ { KEY_BACKSPACE , KEY_DELETE },
290+ { KEY_ENTER , KEY_INSERT },
291+ { KEY_UP , KEY_PAGEUP },
292+ { KEY_DOWN , KEY_PAGEDOWN },
293+ { KEY_LEFT , KEY_HOME },
294+ { KEY_RIGHT , KEY_END },
295+ { KEY_1 , KEY_F1 },
296+ { KEY_2 , KEY_F2 },
297+ { KEY_3 , KEY_F3 },
298+ { KEY_4 , KEY_F4 },
299+ { KEY_5 , KEY_F5 },
300+ { KEY_6 , KEY_F6 },
301+ { KEY_7 , KEY_F7 },
302+ { KEY_8 , KEY_F8 },
303+ { KEY_9 , KEY_F9 },
304+ { KEY_0 , KEY_F10 },
305+ { KEY_MINUS , KEY_F11 },
306+ { KEY_EQUAL , KEY_F12 },
307+ { }
308+ };
309+
288310static const struct apple_key_translation powerbook_fn_keys [] = {
289311 { KEY_BACKSPACE , KEY_DELETE },
290312 { KEY_F1 , KEY_BRIGHTNESSDOWN , APPLE_FLAG_FKEY },
@@ -496,6 +518,9 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
496518 else if (hid -> product >= USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI &&
497519 hid -> product <= USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS )
498520 table = macbookair_fn_keys ;
521+ else if (hid -> vendor == SPI_VENDOR_ID_APPLE &&
522+ hid -> product == SPI_DEVICE_ID_APPLE_MACBOOK_PRO13_2020 )
523+ table = apple_fn_keys_mbp13 ;
499524 else if (hid -> vendor == SPI_VENDOR_ID_APPLE )
500525 table = apple_fn_keys_spi ;
501526 else if (hid -> product < 0x21d || hid -> product >= 0x300 )
@@ -678,6 +703,7 @@ static void apple_setup_input(struct input_dev *input)
678703 /* Enable all needed keys */
679704 apple_setup_key_translation (input , apple_fn_keys );
680705 apple_setup_key_translation (input , apple_fn_keys_spi );
706+ apple_setup_key_translation (input , apple_fn_keys_mbp13 );
681707 apple_setup_key_translation (input , powerbook_fn_keys );
682708 apple_setup_key_translation (input , powerbook_numlock_keys );
683709 apple_setup_key_translation (input , apple_iso_keyboard );
0 commit comments