Skip to contentSkip to conversation

platform/x86: peaq-wmi: Add new peaq-wmi driver

PATCH In review Hans de Goede 2 participants 2 messages May 12, 2017 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 platform/x86: peaq-wmi: Add new peaq-wmi driver

PEAQ is a new European OEM, I've bought one of their 2-in-1 x86 devices, which is actually quite a nice device. Under Windows it has Dolby software for "better" sound and you can select different equalizer presets using a special button.

This WMI interface for this button is not really nice, as it does not do notifies (it really does not I tripple checked), but since I had already figured out the entire WMI interface for this I decided to go the full mile anyways and also implent a WMI based input driver for this using input_polldev since, well, we need to poll.

This commit adds support for this button making it report KEY_SOUND input events. KEY_SOUND is already used in various places to switch sound into theatre mode and things like that so it seems appropriate here.

---
Changes in v2:
-Drop unneeded #include <linux/input.h>
-Add and use PEAQ_POLL_IGNORE_MS and PEAQ_POLL_MAX_MS defines -Make globals static
-Call input_sync between reporting the button down and up -Ignore events for at least 1 poll after an event even if the user has set
poll_interval > PEAQ_POLL_IGNORE_MS
Changes in v3:
-Pass in a dummy input argument to wmi_evaluate_method to fix
ACPI warnings about the WMBC method expecting 3 arguments and us providing only 2 (the method does not do anything with the 3th argument hence the dummy name and hence I missed this before)

---
 drivers/platform/x86/Kconfig    |  7 +++
 drivers/platform/x86/Makefile   |  1 +
 drivers/platform/x86/peaq-wmi.c | 99 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 107 insertions(+)
 create mode 100644 drivers/platform/x86/peaq-wmi.c
drivers/platform/x86/Kconfig +7 -0
index be2ffbd6eb6c..2bac2b2644f9 100644
@@ -660,6 +660,13 @@ config MSI_WMI
 	 To compile this driver as a module, choose M here: the module will
 	 be called msi-wmi.
 
+config PEAQ_WMI
+	tristate "PEAQ 2-in-1 WMI hotkey driver"
+	depends on ACPI_WMI
+	depends on INPUT
+	help
+	 Say Y here if you want to support WMI-based hotkeys on PEAQ 2-in-1s.
+
 config TOPSTAR_LAPTOP
 	tristate "Topstar Laptop Extras"
 	depends on ACPI
drivers/platform/x86/Makefile +1 -0
index de4ffb594ba5..02487f95dd27 100644
@@ -34,6 +34,7 @@ obj-$(CONFIG_PANASONIC_LAPTOP)	+= panasonic-laptop.o
 obj-$(CONFIG_INTEL_MENLOW)	+= intel_menlow.o
 obj-$(CONFIG_ACPI_WMI)		+= wmi.o
 obj-$(CONFIG_MSI_WMI)		+= msi-wmi.o
+obj-$(CONFIG_PEAQ_WMI)		+= peaq-wmi.o
 obj-$(CONFIG_SURFACE3_WMI)	+= surface3-wmi.o
 obj-$(CONFIG_TOPSTAR_LAPTOP)	+= topstar-laptop.o
 
drivers/platform/x86/peaq-wmi.c new file +99 -0

99 lines not on this page · raw message

Signature · 1 line
2.12.2
#1 lore raw
Quoted 11 lines · Hans de Goede

PEAQ is a new European OEM, I've bought one of their 2-in-1 x86 devices, which is actually quite a nice device. Under Windows it has Dolby software for "better" sound and you can select different equalizer presets using a special button.

This WMI interface for this button is not really nice, as it does not do notifies (it really does not I tripple checked), but since I had already figured out the entire WMI interface for this I decided to go the full mile anyways and also implent a WMI based input driver for this using input_polldev since, well, we need to poll.

Quoted 7 lines

This commit adds support for this button making it report KEY_SOUND input events. KEY_SOUND is already used in various places to switch sound into theatre mode and things like that so it seems appropriate here.

Queued to testing, thanks.

Signature · 2 lines
Darren Hart
VMware Open Source Technology Center