summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/intel-hid.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2018-02-07 15:54:20 -0700
committerJens Axboe <axboe@kernel.dk>2018-02-07 15:54:20 -0700
commit61a695184fcc8f225327206b88320279dd8684af (patch)
tree6cbda2b0e7de94ebad95072d17cc0aa82c9d8ab3 /drivers/platform/x86/intel-hid.c
parent9e05c864993c5442227f83ae1694a737d7a102ed (diff)
parent581e400ff935d34d95811258586128bf11baef15 (diff)
Merge branch 'master' into test
* master: (1190 commits) ASoC: stm32: add of dependency for stm32 drivers ASoC: mt8173-rt5650: fix child-node lookup ASoC: dapm: fix debugfs read using path->connected platform/x86: samsung-laptop: Re-use DEFINE_SHOW_ATTRIBUTE() macro platform/x86: ideapad-laptop: Re-use DEFINE_SHOW_ATTRIBUTE() macro platform/x86: dell-laptop: Re-use DEFINE_SHOW_ATTRIBUTE() macro seq_file: Introduce DEFINE_SHOW_ATTRIBUTE() helper macro Documentation/sysctl/user.txt: fix typo MAINTAINERS: update ARM/QUALCOMM SUPPORT patterns MAINTAINERS: update various PALM patterns MAINTAINERS: update "ARM/OXNAS platform support" patterns MAINTAINERS: update Cortina/Gemini patterns MAINTAINERS: remove ARM/CLKDEV SUPPORT file pattern MAINTAINERS: remove ANDROID ION pattern mm: docs: add blank lines to silence sphinx "Unexpected indentation" errors mm: docs: fix parameter names mismatch mm: docs: fixup punctuation pipe: read buffer limits atomically pipe: simplify round_pipe_size() pipe: reject F_SETPIPE_SZ with size over UINT_MAX ...
Diffstat (limited to 'drivers/platform/x86/intel-hid.c')
-rw-r--r--drivers/platform/x86/intel-hid.c41
1 files changed, 38 insertions, 3 deletions
diff --git a/drivers/platform/x86/intel-hid.c b/drivers/platform/x86/intel-hid.c
index f470279c4c10..d1a01311c1a2 100644
--- a/drivers/platform/x86/intel-hid.c
+++ b/drivers/platform/x86/intel-hid.c
@@ -25,6 +25,7 @@
#include <linux/acpi.h>
#include <linux/suspend.h>
#include <acpi/acpi_bus.h>
+#include <linux/dmi.h>
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Alex Hung");
@@ -73,6 +74,24 @@ static const struct key_entry intel_array_keymap[] = {
{ KE_END },
};
+static const struct dmi_system_id button_array_table[] = {
+ {
+ .ident = "Wacom MobileStudio Pro 13",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Wacom Co.,Ltd"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Wacom MobileStudio Pro 13"),
+ },
+ },
+ {
+ .ident = "Wacom MobileStudio Pro 16",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Wacom Co.,Ltd"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Wacom MobileStudio Pro 16"),
+ },
+ },
+ { }
+};
+
struct intel_hid_priv {
struct input_dev *input_dev;
struct input_dev *array;
@@ -263,10 +282,27 @@ wakeup:
ev_index);
}
+static bool button_array_present(struct platform_device *device)
+{
+ acpi_handle handle = ACPI_HANDLE(&device->dev);
+ unsigned long long event_cap;
+ acpi_status status;
+ bool supported = false;
+
+ status = acpi_evaluate_integer(handle, "HEBC", NULL, &event_cap);
+ if (ACPI_SUCCESS(status) && (event_cap & 0x20000))
+ supported = true;
+
+ if (dmi_check_system(button_array_table))
+ supported = true;
+
+ return supported;
+}
+
static int intel_hid_probe(struct platform_device *device)
{
acpi_handle handle = ACPI_HANDLE(&device->dev);
- unsigned long long event_cap, mode;
+ unsigned long long mode;
struct intel_hid_priv *priv;
acpi_status status;
int err;
@@ -299,8 +335,7 @@ static int intel_hid_probe(struct platform_device *device)
}
/* Setup 5 button array */
- status = acpi_evaluate_integer(handle, "HEBC", NULL, &event_cap);
- if (ACPI_SUCCESS(status) && (event_cap & 0x20000)) {
+ if (button_array_present(device)) {
dev_info(&device->dev, "platform supports 5 button array\n");
err = intel_button_array_input_setup(device);
if (err)