@@ -263,6 +263,28 @@ static const struct apple_key_translation apple_fn_keys[] = {
263263 { }
264264};
265265
266+ static const struct apple_key_translation apple_fn_keys_spi [] = {
267+ { KEY_BACKSPACE , KEY_DELETE },
268+ { KEY_ENTER , KEY_INSERT },
269+ { KEY_F1 , KEY_BRIGHTNESSDOWN , APPLE_FLAG_FKEY },
270+ { KEY_F2 , KEY_BRIGHTNESSUP , APPLE_FLAG_FKEY },
271+ { KEY_F3 , KEY_SCALE , APPLE_FLAG_FKEY },
272+ { KEY_F4 , KEY_SEARCH , APPLE_FLAG_FKEY },
273+ { KEY_F5 , KEY_RECORD , APPLE_FLAG_FKEY },
274+ { KEY_F6 , KEY_SLEEP , APPLE_FLAG_FKEY },
275+ { KEY_F7 , KEY_PREVIOUSSONG , APPLE_FLAG_FKEY },
276+ { KEY_F8 , KEY_PLAYPAUSE , APPLE_FLAG_FKEY },
277+ { KEY_F9 , KEY_NEXTSONG , APPLE_FLAG_FKEY },
278+ { KEY_F10 , KEY_MUTE , APPLE_FLAG_FKEY },
279+ { KEY_F11 , KEY_VOLUMEDOWN , APPLE_FLAG_FKEY },
280+ { KEY_F12 , KEY_VOLUMEUP , APPLE_FLAG_FKEY },
281+ { KEY_UP , KEY_PAGEUP },
282+ { KEY_DOWN , KEY_PAGEDOWN },
283+ { KEY_LEFT , KEY_HOME },
284+ { KEY_RIGHT , KEY_END },
285+ { }
286+ };
287+
266288static const struct apple_key_translation powerbook_fn_keys [] = {
267289 { KEY_BACKSPACE , KEY_DELETE },
268290 { KEY_F1 , KEY_BRIGHTNESSDOWN , APPLE_FLAG_FKEY },
@@ -474,6 +496,8 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
474496 else if (hid -> product >= USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI &&
475497 hid -> product <= USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS )
476498 table = macbookair_fn_keys ;
499+ else if (hid -> vendor == SPI_VENDOR_ID_APPLE )
500+ table = apple_fn_keys_spi ;
477501 else if (hid -> product < 0x21d || hid -> product >= 0x300 )
478502 table = powerbook_fn_keys ;
479503 else
@@ -653,6 +677,7 @@ static void apple_setup_input(struct input_dev *input)
653677
654678 /* Enable all needed keys */
655679 apple_setup_key_translation (input , apple_fn_keys );
680+ apple_setup_key_translation (input , apple_fn_keys_spi );
656681 apple_setup_key_translation (input , powerbook_fn_keys );
657682 apple_setup_key_translation (input , powerbook_numlock_keys );
658683 apple_setup_key_translation (input , apple_iso_keyboard );
0 commit comments