Commit fd1e3344 authored by Mark Pearson's avatar Mark Pearson Committed by Hans de Goede

platform/x86: thinkpad_acpi: Support hotkey to disable trackpoint doubletap

The hotkey combination Fn + G can be used to disable the trackpoint
doubletap feature on Windows. Add matching functionality for Linux.
Signed-off-by: default avatarMark Pearson <mpearson-lenovo@squebb.ca>
Signed-off-by: default avatarVishnu Sankar <vishnuocv@gmail.com>
Link: https://lore.kernel.org/r/20240417173124.9953-4-mpearson-lenovo@squebb.ca
[hdegoede@redhat.com: Adjust for switch to sparse-keymap keymaps]
[hdegoede@redhat.com: Do not log unknown event msg for doubletap when disabled]
Tested-by: default avatarMark Pearson <mpearson-lenovo@squebb.ca>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Reviewed-by: default avatarMark Pearson <mpearson-lenovo@squebb.ca>
Reviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240424122834.19801-25-hdegoede@redhat.com
parent 1a22cb1c
...@@ -183,6 +183,7 @@ enum tpacpi_hkey_event_t { ...@@ -183,6 +183,7 @@ enum tpacpi_hkey_event_t {
* directly in the sparse-keymap. * directly in the sparse-keymap.
*/ */
TP_HKEY_EV_AMT_TOGGLE = 0x131a, /* Toggle AMT on/off */ TP_HKEY_EV_AMT_TOGGLE = 0x131a, /* Toggle AMT on/off */
TP_HKEY_EV_DOUBLETAP_TOGGLE = 0x131c, /* Toggle trackpoint doubletap on/off */
TP_HKEY_EV_PROFILE_TOGGLE = 0x131f, /* Toggle platform profile */ TP_HKEY_EV_PROFILE_TOGGLE = 0x131f, /* Toggle platform profile */
/* Reasons for waking up from S3/S4 */ /* Reasons for waking up from S3/S4 */
...@@ -372,6 +373,7 @@ static struct { ...@@ -372,6 +373,7 @@ static struct {
u32 hotkey_poll_active:1; u32 hotkey_poll_active:1;
u32 has_adaptive_kbd:1; u32 has_adaptive_kbd:1;
u32 kbd_lang:1; u32 kbd_lang:1;
u32 trackpoint_doubletap:1;
struct quirk_entry *quirks; struct quirk_entry *quirks;
} tp_features; } tp_features;
...@@ -3527,6 +3529,9 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) ...@@ -3527,6 +3529,9 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
hotkey_poll_setup_safe(true); hotkey_poll_setup_safe(true);
/* Enable doubletap by default */
tp_features.trackpoint_doubletap = 1;
return 0; return 0;
} }
...@@ -3826,7 +3831,9 @@ static bool hotkey_notify_8xxx(const u32 hkey, bool *send_acpi_ev) ...@@ -3826,7 +3831,9 @@ static bool hotkey_notify_8xxx(const u32 hkey, bool *send_acpi_ev)
{ {
switch (hkey) { switch (hkey) {
case TP_HKEY_EV_TRACK_DOUBLETAP: case TP_HKEY_EV_TRACK_DOUBLETAP:
tpacpi_input_send_key(hkey, send_acpi_ev); if (tp_features.trackpoint_doubletap)
tpacpi_input_send_key(hkey, send_acpi_ev);
return true; return true;
default: default:
return false; return false;
...@@ -11033,6 +11040,9 @@ static bool tpacpi_driver_event(const unsigned int hkey_event) ...@@ -11033,6 +11040,9 @@ static bool tpacpi_driver_event(const unsigned int hkey_event)
else else
dytc_control_amt(!dytc_amt_active); dytc_control_amt(!dytc_amt_active);
return true;
case TP_HKEY_EV_DOUBLETAP_TOGGLE:
tp_features.trackpoint_doubletap = !tp_features.trackpoint_doubletap;
return true; return true;
case TP_HKEY_EV_PROFILE_TOGGLE: case TP_HKEY_EV_PROFILE_TOGGLE:
platform_profile_cycle(); platform_profile_cycle();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment