Skip to content

Commit 797195a

Browse files
jmglogowdvhart
authored andcommitted
platform/x86: fujitsu-laptop: Support Lifebook U7x7 hotkeys
Generate input events for hotkeys present in Fujitsu Lifebook U727 and U757 laptops: - Fn+F1 (KEY_MICMUTE) - Fn+F5 (KEY_RFKILL) Signed-off-by: Jan-Marek Glogowski <[email protected]> Reviewed-by: Jonathan Woithe <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
1 parent ef0f622 commit 797195a

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

drivers/platform/x86/fujitsu-laptop.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,9 @@ static const struct key_entry keymap_default[] = {
461461
{ KE_KEY, KEY3_CODE, { KEY_PROG3 } },
462462
{ KE_KEY, KEY4_CODE, { KEY_PROG4 } },
463463
{ KE_KEY, KEY5_CODE, { KEY_RFKILL } },
464+
{ KE_KEY, BIT(5), { KEY_RFKILL } },
464465
{ KE_KEY, BIT(26), { KEY_TOUCHPAD_TOGGLE } },
466+
{ KE_KEY, BIT(29), { KEY_MICMUTE } },
465467
{ KE_END, 0 }
466468
};
467469

@@ -901,7 +903,7 @@ static void acpi_fujitsu_laptop_release(struct acpi_device *device)
901903
static void acpi_fujitsu_laptop_notify(struct acpi_device *device, u32 event)
902904
{
903905
struct fujitsu_laptop *priv = acpi_driver_data(device);
904-
int scancode, i = 0;
906+
int scancode, i = 0, ret;
905907
unsigned int irb;
906908

907909
if (event != ACPI_FUJITSU_NOTIFY_CODE) {
@@ -932,9 +934,18 @@ static void acpi_fujitsu_laptop_notify(struct acpi_device *device, u32 event)
932934
* E736/E746/E756), the touchpad toggle hotkey (Fn+F4) is
933935
* handled in software; its state is queried using FUNC_FLAGS
934936
*/
935-
if ((priv->flags_supported & BIT(26)) &&
936-
(call_fext_func(device, FUNC_FLAGS, 0x1, 0x0, 0x0) & BIT(26)))
937-
sparse_keymap_report_event(priv->input, BIT(26), 1, true);
937+
if (priv->flags_supported & (BIT(5) | BIT(26) | BIT(29))) {
938+
ret = call_fext_func(device, FUNC_FLAGS, 0x1, 0x0, 0x0);
939+
if (ret & BIT(5))
940+
sparse_keymap_report_event(priv->input,
941+
BIT(5), 1, true);
942+
if (ret & BIT(26))
943+
sparse_keymap_report_event(priv->input,
944+
BIT(26), 1, true);
945+
if (ret & BIT(29))
946+
sparse_keymap_report_event(priv->input,
947+
BIT(29), 1, true);
948+
}
938949
}
939950

940951
/* Initialization */

0 commit comments

Comments
 (0)