Skip to content

Commit a7e255f

Browse files
vkoskivij-intel
authored andcommitted
platform/x86: fujitsu-laptop: Support Lifebook S2110 hotkeys
The S2110 has an additional set of media playback control keys enabled by a hardware toggle button that switches the keys between "Application" and "Player" modes. Toggling "Player" mode just shifts the scancode of each hotkey up by 4. Add defines for new scancodes, and a keymap and dmi id for the S2110. Tested on a Fujitsu Lifebook S2110. Signed-off-by: Valtteri Koskivuori <[email protected]> Acked-by: Jonathan Woithe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent bfcfe6d commit a7e255f

File tree

1 file changed

+29
-4
lines changed

1 file changed

+29
-4
lines changed

drivers/platform/x86/fujitsu-laptop.c

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
/*
1818
* fujitsu-laptop.c - Fujitsu laptop support, providing access to additional
1919
* features made available on a range of Fujitsu laptops including the
20-
* P2xxx/P5xxx/S6xxx/S7xxx series.
20+
* P2xxx/P5xxx/S2xxx/S6xxx/S7xxx series.
2121
*
2222
* This driver implements a vendor-specific backlight control interface for
2323
* Fujitsu laptops and provides support for hotkeys present on certain Fujitsu
2424
* laptops.
2525
*
26-
* This driver has been tested on a Fujitsu Lifebook S6410, S7020 and
26+
* This driver has been tested on a Fujitsu Lifebook S2110, S6410, S7020 and
2727
* P8010. It should work on most P-series and S-series Lifebooks, but
2828
* YMMV.
2929
*
@@ -107,7 +107,11 @@
107107
#define KEY2_CODE 0x411
108108
#define KEY3_CODE 0x412
109109
#define KEY4_CODE 0x413
110-
#define KEY5_CODE 0x420
110+
#define KEY5_CODE 0x414
111+
#define KEY6_CODE 0x415
112+
#define KEY7_CODE 0x416
113+
#define KEY8_CODE 0x417
114+
#define KEY9_CODE 0x420
111115

112116
/* Hotkey ringbuffer limits */
113117
#define MAX_HOTKEY_RINGBUFFER_SIZE 100
@@ -560,7 +564,7 @@ static const struct key_entry keymap_default[] = {
560564
{ KE_KEY, KEY2_CODE, { KEY_PROG2 } },
561565
{ KE_KEY, KEY3_CODE, { KEY_PROG3 } },
562566
{ KE_KEY, KEY4_CODE, { KEY_PROG4 } },
563-
{ KE_KEY, KEY5_CODE, { KEY_RFKILL } },
567+
{ KE_KEY, KEY9_CODE, { KEY_RFKILL } },
564568
/* Soft keys read from status flags */
565569
{ KE_KEY, FLAG_RFKILL, { KEY_RFKILL } },
566570
{ KE_KEY, FLAG_TOUCHPAD_TOGGLE, { KEY_TOUCHPAD_TOGGLE } },
@@ -584,6 +588,18 @@ static const struct key_entry keymap_p8010[] = {
584588
{ KE_END, 0 }
585589
};
586590

591+
static const struct key_entry keymap_s2110[] = {
592+
{ KE_KEY, KEY1_CODE, { KEY_PROG1 } }, /* "A" */
593+
{ KE_KEY, KEY2_CODE, { KEY_PROG2 } }, /* "B" */
594+
{ KE_KEY, KEY3_CODE, { KEY_WWW } }, /* "Internet" */
595+
{ KE_KEY, KEY4_CODE, { KEY_EMAIL } }, /* "E-mail" */
596+
{ KE_KEY, KEY5_CODE, { KEY_STOPCD } },
597+
{ KE_KEY, KEY6_CODE, { KEY_PLAYPAUSE } },
598+
{ KE_KEY, KEY7_CODE, { KEY_PREVIOUSSONG } },
599+
{ KE_KEY, KEY8_CODE, { KEY_NEXTSONG } },
600+
{ KE_END, 0 }
601+
};
602+
587603
static const struct key_entry *keymap = keymap_default;
588604

589605
static int fujitsu_laptop_dmi_keymap_override(const struct dmi_system_id *id)
@@ -621,6 +637,15 @@ static const struct dmi_system_id fujitsu_laptop_dmi_table[] = {
621637
},
622638
.driver_data = (void *)keymap_p8010
623639
},
640+
{
641+
.callback = fujitsu_laptop_dmi_keymap_override,
642+
.ident = "Fujitsu LifeBook S2110",
643+
.matches = {
644+
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
645+
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK S2110"),
646+
},
647+
.driver_data = (void *)keymap_s2110
648+
},
624649
{}
625650
};
626651

0 commit comments

Comments
 (0)