Skip to content

Commit 097a288

Browse files
vkoskivaloktiwa
authored andcommitted
platform/x86: fujitsu-laptop: Support Lifebook S2110 hotkeys
[ Upstream commit a7e255f ] 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 <vkoskiv@gmail.com> Acked-by: Jonathan Woithe <jwoithe@just42.net> Link: https://lore.kernel.org/r/20250509184251.713003-1-vkoskiv@gmail.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org> (cherry picked from commit 7614a710a6d8582b8a7918745af626d220e5bc8f) Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
1 parent b14422c commit 097a288

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
*
@@ -102,7 +102,11 @@
102102
#define KEY2_CODE 0x411
103103
#define KEY3_CODE 0x412
104104
#define KEY4_CODE 0x413
105-
#define KEY5_CODE 0x420
105+
#define KEY5_CODE 0x414
106+
#define KEY6_CODE 0x415
107+
#define KEY7_CODE 0x416
108+
#define KEY8_CODE 0x417
109+
#define KEY9_CODE 0x420
106110

107111
/* Hotkey ringbuffer limits */
108112
#define MAX_HOTKEY_RINGBUFFER_SIZE 100
@@ -450,7 +454,7 @@ static const struct key_entry keymap_default[] = {
450454
{ KE_KEY, KEY2_CODE, { KEY_PROG2 } },
451455
{ KE_KEY, KEY3_CODE, { KEY_PROG3 } },
452456
{ KE_KEY, KEY4_CODE, { KEY_PROG4 } },
453-
{ KE_KEY, KEY5_CODE, { KEY_RFKILL } },
457+
{ KE_KEY, KEY9_CODE, { KEY_RFKILL } },
454458
/* Soft keys read from status flags */
455459
{ KE_KEY, FLAG_RFKILL, { KEY_RFKILL } },
456460
{ KE_KEY, FLAG_TOUCHPAD_TOGGLE, { KEY_TOUCHPAD_TOGGLE } },
@@ -474,6 +478,18 @@ static const struct key_entry keymap_p8010[] = {
474478
{ KE_END, 0 }
475479
};
476480

481+
static const struct key_entry keymap_s2110[] = {
482+
{ KE_KEY, KEY1_CODE, { KEY_PROG1 } }, /* "A" */
483+
{ KE_KEY, KEY2_CODE, { KEY_PROG2 } }, /* "B" */
484+
{ KE_KEY, KEY3_CODE, { KEY_WWW } }, /* "Internet" */
485+
{ KE_KEY, KEY4_CODE, { KEY_EMAIL } }, /* "E-mail" */
486+
{ KE_KEY, KEY5_CODE, { KEY_STOPCD } },
487+
{ KE_KEY, KEY6_CODE, { KEY_PLAYPAUSE } },
488+
{ KE_KEY, KEY7_CODE, { KEY_PREVIOUSSONG } },
489+
{ KE_KEY, KEY8_CODE, { KEY_NEXTSONG } },
490+
{ KE_END, 0 }
491+
};
492+
477493
static const struct key_entry *keymap = keymap_default;
478494

479495
static int fujitsu_laptop_dmi_keymap_override(const struct dmi_system_id *id)
@@ -511,6 +527,15 @@ static const struct dmi_system_id fujitsu_laptop_dmi_table[] = {
511527
},
512528
.driver_data = (void *)keymap_p8010
513529
},
530+
{
531+
.callback = fujitsu_laptop_dmi_keymap_override,
532+
.ident = "Fujitsu LifeBook S2110",
533+
.matches = {
534+
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
535+
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK S2110"),
536+
},
537+
.driver_data = (void *)keymap_s2110
538+
},
514539
{}
515540
};
516541

0 commit comments

Comments
 (0)