From 797195a376dc9ffa0341e64f28f9ffe5d1ed184f Mon Sep 17 00:00:00 2001
From: Jan-Marek Glogowski <glogow@fbihome.de>
Date: Mon, 12 Feb 2018 13:08:51 +0100
Subject: [PATCH] platform/x86: fujitsu-laptop: Support Lifebook U7x7 hotkeys
Git-commit: 797195a376dc9ffa0341e64f28f9ffe5d1ed184f
Patch-mainline: v4.17-rc1
References: bsc#1087284
Generate input events for hotkeys present in Fujitsu Lifebook
U727 and U757 laptops:
- Fn+F1 (KEY_MICMUTE)
- Fn+F5 (KEY_RFKILL)
[ adjusted the context to match with SLE15 -- tiwai ]
Signed-off-by: Jan-Marek Glogowski <glogow@fbihome.de>
Reviewed-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
Acked-by: Takashi Iwai <tiwai@suse.de>
---
drivers/platform/x86/fujitsu-laptop.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
--- a/drivers/platform/x86/fujitsu-laptop.c
+++ b/drivers/platform/x86/fujitsu-laptop.c
@@ -479,7 +479,9 @@ static const struct key_entry keymap_def
{ KE_KEY, KEY3_CODE, { KEY_PROG3 } },
{ KE_KEY, KEY4_CODE, { KEY_PROG4 } },
{ KE_KEY, KEY5_CODE, { KEY_RFKILL } },
+ { KE_KEY, BIT(5), { KEY_RFKILL } },
{ KE_KEY, BIT(26), { KEY_TOUCHPAD_TOGGLE } },
+ { KE_KEY, BIT(29), { KEY_MICMUTE } },
{ KE_END, 0 }
};
@@ -915,7 +917,7 @@ static void acpi_fujitsu_laptop_release(
static void acpi_fujitsu_laptop_notify(struct acpi_device *device, u32 event)
{
struct input_dev *input;
- int scancode, i = 0;
+ int scancode, i = 0, ret;
unsigned int irb;
input = fujitsu_laptop->input;
@@ -947,9 +949,18 @@ static void acpi_fujitsu_laptop_notify(s
* E736/E746/E756), the touchpad toggle hotkey (Fn+F4) is
* handled in software; its state is queried using FUNC_FLAGS
*/
- if ((fujitsu_laptop->flags_supported & BIT(26)) &&
- (call_fext_func(FUNC_FLAGS, 0x1, 0x0, 0x0) & BIT(26)))
- sparse_keymap_report_event(input, BIT(26), 1, true);
+ if (fujitsu_laptop->flags_supported & (BIT(5) | BIT(26) | BIT(29))) {
+ ret = call_fext_func(FUNC_FLAGS, 0x1, 0x0, 0x0);
+ if (ret & BIT(5))
+ sparse_keymap_report_event(input,
+ BIT(5), 1, true);
+ if (ret & BIT(26))
+ sparse_keymap_report_event(input,
+ BIT(26), 1, true);
+ if (ret & BIT(29))
+ sparse_keymap_report_event(input,
+ BIT(29), 1, true);
+ }
}
/* Initialization */