All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] intel-hid: add a DMI quirk to support Wacom Mobile Studio Pro
@ 2017-12-05  7:52 Alex Hung
  2017-12-05 18:01 ` Jason Gerecke
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Hung @ 2017-12-05  7:52 UTC (permalink / raw)
  To: alex.hung, dvhart, andy, platform-driver-x86; +Cc: killertofu

HEBC method reports capabilities of 5 button array but Wacom Mobile
Studio 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=197991

Reported-by: Jason Gerecke <killertofu@gmail.com>
Signed-off-by: Alex Hung <alex.hung@canonical.com>
---
 drivers/platform/x86/intel-hid.c | 34 +++++++++++++++++++++++++++++++---
 1 file changed, 31 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/intel-hid.c b/drivers/platform/x86/intel-hid.c
index f470279..54d761c 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,17 @@ static const struct key_entry intel_array_keymap[] = {
 	{ KE_END },
 };
 
+static const struct dmi_system_id button_array_table[] = {
+	{
+		.ident = "Wacom Mobile Studio Pro",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Skylake"),
+		},
+	},
+	{ }
+};
+
 struct intel_hid_priv {
 	struct input_dev *input_dev;
 	struct input_dev *array;
@@ -263,10 +275,27 @@ static void notify_handler(acpi_handle handle, u32 event, void *context)
 			 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 +328,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)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] intel-hid: add a DMI quirk to support Wacom Mobile Studio Pro
  2017-12-05  7:52 [PATCH] intel-hid: add a DMI quirk to support Wacom Mobile Studio Pro Alex Hung
@ 2017-12-05 18:01 ` Jason Gerecke
  2017-12-05 19:14   ` Jason Gerecke
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Gerecke @ 2017-12-05 18:01 UTC (permalink / raw)
  To: Alex Hung

On December 4, 2017 11:52:12 PM PST, Alex Hung <alex.hung@canonical.com> wrote:
>HEBC method reports capabilities of 5 button array but Wacom Mobile
>Studio Pro does not have this control method. A DMI quirk was created

Nit: s/Mobile Studio/MobileStudio/ here and in the subject and the `button_array_table`

>to
>enable 5 button array for this system.
>
>Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=197991
>
>Reported-by: Jason Gerecke <killertofu@gmail.com>

Please use "Reported-by: Jason Gerecke <jason.gerecke@wacom.com>" 

Thanks again for the fix! 

Jason
---
Now instead of four in the eights place /
you’ve got three, ‘Cause you added one  /
(That is to say, eight) to the two,     /
But you can’t take seven from three,    /
So you look at the sixty-fours....

>Signed-off-by: Alex Hung <alex.hung@canonical.com>
>---
>drivers/platform/x86/intel-hid.c | 34
>+++++++++++++++++++++++++++++++---
> 1 file changed, 31 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/platform/x86/intel-hid.c
>b/drivers/platform/x86/intel-hid.c
>index f470279..54d761c 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,17 @@ static const struct key_entry intel_array_keymap[] =
>{
> 	{ KE_END },
> };
> 
>+static const struct dmi_system_id button_array_table[] = {
>+	{
>+		.ident = "Wacom Mobile Studio Pro",
>+		.matches = {
>+			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
>+			DMI_MATCH(DMI_PRODUCT_NAME, "Skylake"),
>+		},
>+	},
>+	{ }
>+};
>+
> struct intel_hid_priv {
> 	struct input_dev *input_dev;
> 	struct input_dev *array;
>@@ -263,10 +275,27 @@ static void notify_handler(acpi_handle handle,
>u32 event, void *context)
> 			 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 +328,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)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] intel-hid: add a DMI quirk to support Wacom Mobile Studio Pro
  2017-12-05 18:01 ` Jason Gerecke
@ 2017-12-05 19:14   ` Jason Gerecke
  2017-12-06  2:15     ` Alex Hung
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Gerecke @ 2017-12-05 19:14 UTC (permalink / raw)
  To: Alex Hung, dvhart, andy, platform-driver-x86

I may have actually spoken too soon: the patch isn't working on a
second device. This second device is a smaller model with a slightly
different board, and is also the shipping version rather than a
pre-release version. I'm going to gather some more dmidecode data and
get back to you.

Jason
---
Now instead of four in the eights place /
you’ve got three, ‘Cause you added one  /
(That is to say, eight) to the two,     /
But you can’t take seven from three,    /
So you look at the sixty-fours....


On Tue, Dec 5, 2017 at 10:01 AM, Jason Gerecke <killertofu@gmail.com> wrote:
> On December 4, 2017 11:52:12 PM PST, Alex Hung <alex.hung@canonical.com> wrote:
>>HEBC method reports capabilities of 5 button array but Wacom Mobile
>>Studio Pro does not have this control method. A DMI quirk was created
>
> Nit: s/Mobile Studio/MobileStudio/ here and in the subject and the `button_array_table`
>
>>to
>>enable 5 button array for this system.
>>
>>Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=197991
>>
>>Reported-by: Jason Gerecke <killertofu@gmail.com>
>
> Please use "Reported-by: Jason Gerecke <jason.gerecke@wacom.com>"
>
> Thanks again for the fix!
>
> Jason
> ---
> Now instead of four in the eights place /
> you’ve got three, ‘Cause you added one  /
> (That is to say, eight) to the two,     /
> But you can’t take seven from three,    /
> So you look at the sixty-fours....
>
>>Signed-off-by: Alex Hung <alex.hung@canonical.com>
>>---
>>drivers/platform/x86/intel-hid.c | 34
>>+++++++++++++++++++++++++++++++---
>> 1 file changed, 31 insertions(+), 3 deletions(-)
>>
>>diff --git a/drivers/platform/x86/intel-hid.c
>>b/drivers/platform/x86/intel-hid.c
>>index f470279..54d761c 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,17 @@ static const struct key_entry intel_array_keymap[] =
>>{
>>       { KE_END },
>> };
>>
>>+static const struct dmi_system_id button_array_table[] = {
>>+      {
>>+              .ident = "Wacom Mobile Studio Pro",
>>+              .matches = {
>>+                      DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
>>+                      DMI_MATCH(DMI_PRODUCT_NAME, "Skylake"),
>>+              },
>>+      },
>>+      { }
>>+};
>>+
>> struct intel_hid_priv {
>>       struct input_dev *input_dev;
>>       struct input_dev *array;
>>@@ -263,10 +275,27 @@ static void notify_handler(acpi_handle handle,
>>u32 event, void *context)
>>                        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 +328,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)
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] intel-hid: add a DMI quirk to support Wacom Mobile Studio Pro
  2017-12-05 19:14   ` Jason Gerecke
@ 2017-12-06  2:15     ` Alex Hung
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Hung @ 2017-12-06  2:15 UTC (permalink / raw)
  To: Jason Gerecke; +Cc: Darren Hart, Andy Shevchenko, platform-driver-x86

On Wed, Dec 6, 2017 at 3:14 AM, Jason Gerecke <killertofu@gmail.com> wrote:
> I may have actually spoken too soon: the patch isn't working on a
> second device. This second device is a smaller model with a slightly
> different board, and is also the shipping version rather than a
> pre-release version. I'm going to gather some more dmidecode data and
> get back to you.

The updated DMI strings look better. I have updated intel-hid.c to bugzilla.

>
> Jason
> ---
> Now instead of four in the eights place /
> you’ve got three, ‘Cause you added one  /
> (That is to say, eight) to the two,     /
> But you can’t take seven from three,    /
> So you look at the sixty-fours....
>
>
> On Tue, Dec 5, 2017 at 10:01 AM, Jason Gerecke <killertofu@gmail.com> wrote:
>> On December 4, 2017 11:52:12 PM PST, Alex Hung <alex.hung@canonical.com> wrote:
>>>HEBC method reports capabilities of 5 button array but Wacom Mobile
>>>Studio Pro does not have this control method. A DMI quirk was created
>>
>> Nit: s/Mobile Studio/MobileStudio/ here and in the subject and the `button_array_table`
>>
>>>to
>>>enable 5 button array for this system.
>>>
>>>Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=197991
>>>
>>>Reported-by: Jason Gerecke <killertofu@gmail.com>
>>
>> Please use "Reported-by: Jason Gerecke <jason.gerecke@wacom.com>"

Okay and will do

>>
>> Thanks again for the fix!
>>
>> Jason
>> ---
>> Now instead of four in the eights place /
>> you’ve got three, ‘Cause you added one  /
>> (That is to say, eight) to the two,     /
>> But you can’t take seven from three,    /
>> So you look at the sixty-fours....
>>
>>>Signed-off-by: Alex Hung <alex.hung@canonical.com>
>>>---
>>>drivers/platform/x86/intel-hid.c | 34
>>>+++++++++++++++++++++++++++++++---
>>> 1 file changed, 31 insertions(+), 3 deletions(-)
>>>
>>>diff --git a/drivers/platform/x86/intel-hid.c
>>>b/drivers/platform/x86/intel-hid.c
>>>index f470279..54d761c 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,17 @@ static const struct key_entry intel_array_keymap[] =
>>>{
>>>       { KE_END },
>>> };
>>>
>>>+static const struct dmi_system_id button_array_table[] = {
>>>+      {
>>>+              .ident = "Wacom Mobile Studio Pro",
>>>+              .matches = {
>>>+                      DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
>>>+                      DMI_MATCH(DMI_PRODUCT_NAME, "Skylake"),
>>>+              },
>>>+      },
>>>+      { }
>>>+};
>>>+
>>> struct intel_hid_priv {
>>>       struct input_dev *input_dev;
>>>       struct input_dev *array;
>>>@@ -263,10 +275,27 @@ static void notify_handler(acpi_handle handle,
>>>u32 event, void *context)
>>>                        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 +328,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)
>>



-- 
Cheers,
Alex Hung

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-12-06  2:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-05  7:52 [PATCH] intel-hid: add a DMI quirk to support Wacom Mobile Studio Pro Alex Hung
2017-12-05 18:01 ` Jason Gerecke
2017-12-05 19:14   ` Jason Gerecke
2017-12-06  2:15     ` Alex Hung

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.