summaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/peaq-wmi.c
AgeCommit message (Collapse)AuthorFilesLines
2019-10-15platform/x86: peaq-wmi: switch to using polled mode of input devicesDmitry Torokhov1-24/+42
We have added polled mode to the normal input devices with the intent of retiring input_polled_dev. This converts peaq-wmi driver to use the polling mode of standard input devices and removes dependency on INPUT_POLLDEV. Because the new polling coded does not allow peeking inside the poller structure to get the poll interval, we change the "debounce" process to operate on the time basis, instead of counting events. We also fix error handling during initialization, as previously we leaked input device structure when we failed to register it. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner1-4/+1
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-03platform/x86: peaq-wmi: Remove unnecessary checks from peaq_wmi_exitHans de Goede1-7/+1
peaq_wmi_exit will only ever get called if peaq_wmi_init succeeds, so there is no need to repeat the checks from peaq_wmi_init. Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-11-03platform/x86: peaq_wmi: Fix missing terminating entry for peaq_dmi_tableHans de Goede1-0/+1
Add missing terminating entry to peaq_dmi_table. Fixes: 3b95206110a2 ("platform/x86: peaq-wmi: Add DMI check before ...") Cc: stable@vger.kernel.org Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-10-08platform/x86: peaq-wmi: Add DMI check before binding to the WMI interfaceHans de Goede1-0/+18
It seems that the WMI GUID used by the PEAQ 2-in-1 WMI hotkeys is not as unique as a GUID should be and is used on some other devices too. This is causing spurious key-press reports on these other devices. This commits adds a DMI check to the PEAQ 2-in-1 WMI hotkeys driver to ensure that it is actually running on a PEAQ 2-in-1, fixing the spurious key-presses on these other devices. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1497861 BugLink: https://bugzilla.suse.com/attachment.cgi?id=743182 Cc: stable@vger.kernel.org Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-10-08platform/x86: peaq-wmi: Revert Blacklist Lenovo ideapad 700-15ISKAndy Shevchenko1-15/+1
In favour of new approach this reverts commit ff74972e966bfc586cea116f976866858d1b0fec. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-10-04platform/x86: peaq-wmi: Blacklist Lenovo ideapad 700-15ISKKai Heng Feng1-1/+15
peaq-wmi on Lenovo ideapad 700-15ISK keeps sending KEY_SOUND, which makes user's repeated keys gets interrupted. The system does not have Dolby button, let's blacklist it. BugLink: https://bugs.launchpad.net/bugs/1720219 Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-08-13platform/x86: peaq-wmi: Evaluate wmi method with instance number 0x0Pali Rohár1-1/+1
According to Hans de Goede, WMI interface of thh peaq-wmi module has 10 instances but corresponding ACPI WMBC method does not check Arg0 (instance number) at all. Therefore evaluate WMI method with first instance number (0x0) instead of second (0x1). Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Cc: Hans de Goede <hdegoede@redhat.com> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-07-25platform/x86: peaq-wmi: silence a static checker warningDan Carpenter1-1/+1
There is a harmless static checker warning here that unsigned values are always >= 0. The code looks like: if (peaq_ignore_events_counter && --peaq_ignore_events_counter >= 0) The first part of the condition ensures that we never wrap around so the code works as intended. I've tweaked it slightly to avoid the warning. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-07-11platform/x86: peaq-wmi: Fix peaq_ignore_events_counter handling off by 1Hans de Goede1-1/+1
If peaq_ignore_events_counter gets set to 1 we should skip polling 1 time, rather then ignoring it. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-05-15platform/x86: peaq-wmi: Add new peaq-wmi driverHans de Goede1-0/+100
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 triple checked), but since I had already figured out the entire WMI interface for this I decided to go the full mile anyway and implement 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. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> [dvhart: minor declaration ordering and commit log typo fixes] Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>