Commit 7faa6a37 authored by Azael Avalos's avatar Azael Avalos Committed by Darren Hart

toshiba_acpi: Add a module parameter to disable hotkeys registration

Some laptop models have working hotkeys without the need of the driver
to activate them.

This patch adds a module parameter to tell the driver not to register
the hotkeys.

The new parameter is useful in DE less installations or where the DE
does not handle the hotkeys (see bug 99501).
Signed-off-by: default avatarAzael Avalos <coproscefalo@gmail.com>
Signed-off-by: default avatarDarren Hart <dvhart@linux.intel.com>
parent 33f857a4
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
...@@ -220,6 +221,10 @@ struct toshiba_acpi_dev { ...@@ -220,6 +221,10 @@ struct toshiba_acpi_dev {
static struct toshiba_acpi_dev *toshiba_acpi; static struct toshiba_acpi_dev *toshiba_acpi;
static bool disable_hotkeys;
module_param(disable_hotkeys, bool, 0444);
MODULE_PARM_DESC(disable_hotkeys, "Disables the hotkeys activation");
static const struct acpi_device_id toshiba_device_ids[] = { static const struct acpi_device_id toshiba_device_ids[] = {
{"TOS6200", 0}, {"TOS6200", 0},
{"TOS6207", 0}, {"TOS6207", 0},
...@@ -2692,6 +2697,11 @@ static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev) ...@@ -2692,6 +2697,11 @@ static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev)
acpi_handle ec_handle; acpi_handle ec_handle;
int error; int error;
if (disable_hotkeys) {
pr_info("Hotkeys disabled by module parameter\n");
return 0;
}
if (wmi_has_guid(TOSHIBA_WMI_EVENT_GUID)) { if (wmi_has_guid(TOSHIBA_WMI_EVENT_GUID)) {
pr_info("WMI event detected, hotkeys will not be monitored\n"); pr_info("WMI event detected, hotkeys will not be monitored\n");
return 0; return 0;
......
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