Commit c454a99d authored by Alex Hung's avatar Alex Hung Committed by Darren Hart (VMware)

intel-hid: add a DMI quirk to support Wacom MobileStudio Pro

HEBC method reports capabilities of 5 button array but Wacom
MobileStudio Pro does not have this control method. A DMI quirk
was created to enable 5 button array for this system.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=197991Reported-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: default avatarAlex Hung <alex.hung@canonical.com>
Tested-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: default avatarDarren Hart (VMware) <dvhart@infradead.org>
parent 91c73e80
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/suspend.h> #include <linux/suspend.h>
#include <acpi/acpi_bus.h> #include <acpi/acpi_bus.h>
#include <linux/dmi.h>
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_AUTHOR("Alex Hung"); MODULE_AUTHOR("Alex Hung");
...@@ -73,6 +74,24 @@ static const struct key_entry intel_array_keymap[] = { ...@@ -73,6 +74,24 @@ static const struct key_entry intel_array_keymap[] = {
{ KE_END }, { 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 intel_hid_priv {
struct input_dev *input_dev; struct input_dev *input_dev;
struct input_dev *array; struct input_dev *array;
...@@ -263,10 +282,27 @@ static void notify_handler(acpi_handle handle, u32 event, void *context) ...@@ -263,10 +282,27 @@ static void notify_handler(acpi_handle handle, u32 event, void *context)
ev_index); 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) static int intel_hid_probe(struct platform_device *device)
{ {
acpi_handle handle = ACPI_HANDLE(&device->dev); acpi_handle handle = ACPI_HANDLE(&device->dev);
unsigned long long event_cap, mode; unsigned long long mode;
struct intel_hid_priv *priv; struct intel_hid_priv *priv;
acpi_status status; acpi_status status;
int err; int err;
...@@ -299,8 +335,7 @@ static int intel_hid_probe(struct platform_device *device) ...@@ -299,8 +335,7 @@ static int intel_hid_probe(struct platform_device *device)
} }
/* Setup 5 button array */ /* Setup 5 button array */
status = acpi_evaluate_integer(handle, "HEBC", NULL, &event_cap); if (button_array_present(device)) {
if (ACPI_SUCCESS(status) && (event_cap & 0x20000)) {
dev_info(&device->dev, "platform supports 5 button array\n"); dev_info(&device->dev, "platform supports 5 button array\n");
err = intel_button_array_input_setup(device); err = intel_button_array_input_setup(device);
if (err) if (err)
......
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