summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/x86-android-tablets/other.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2023-02-20 23:26:42 +0300
committerHans de Goede <hdegoede@redhat.com>2023-03-07 14:08:31 +0300
commit772cbba5a877eb7c528f3659415373c40e48a057 (patch)
tree139d993f30961310588bfa0d0957f3e7d813320b /drivers/platform/x86/x86-android-tablets/other.c
parente2200d3f26dac108a519f014fb42a0a034105394 (diff)
downloadlinux-772cbba5a877eb7c528f3659415373c40e48a057.tar.xz
platform/x86: x86-android-tablets: Add support for the Dolby button on Peaq C1010
The Peaq C1010 tablet has a special "Dolby" button. This button has a WMI interface, but this is broken in several ways: 1. It only supports polling 2. The value read on polling goes from 0 -> 1 for one poll on both edges of the button, with no way to tell which edge causes the poll to return 1. 3. It uses a non unique GUID (it uses the Microsoft docs WMI example GUID). There currently is a WMI driver for this, but it uses several kludges to work around these issues and is not entirely reliable due to 2. Replace the unreliable WMI driver by using the x86-android-tablets code to instantiate a gpio_keys device for this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20230301092331.7038-11-hdegoede@redhat.com
Diffstat (limited to 'drivers/platform/x86/x86-android-tablets/other.c')
-rw-r--r--drivers/platform/x86/x86-android-tablets/other.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/platform/x86/x86-android-tablets/other.c b/drivers/platform/x86/x86-android-tablets/other.c
index c1bde42315c4..83cd7e16c84c 100644
--- a/drivers/platform/x86/x86-android-tablets/other.c
+++ b/drivers/platform/x86/x86-android-tablets/other.c
@@ -381,6 +381,34 @@ const struct x86_dev_info nextbook_ares8_info __initconst = {
};
/*
+ * Peaq C1010
+ * This is a standard Windows tablet, but it has a special Dolby button.
+ * This button has a WMI interface, but that is broken. Instead of trying to
+ * use the broken WMI interface, instantiate a gpio_keys device for this.
+ */
+static struct x86_gpio_button peaq_c1010_button = {
+ .button = {
+ .code = KEY_SOUND,
+ .active_low = true,
+ .desc = "dolby_key",
+ .type = EV_KEY,
+ .wakeup = false,
+ .debounce_interval = 50,
+ },
+ .chip = "INT33FC:00",
+ .pin = 3,
+};
+
+const struct x86_dev_info peaq_c1010_info __initconst = {
+ .gpio_button = &peaq_c1010_button,
+ /*
+ * Move the ACPI event handler used by the broken WMI interface out of
+ * the way. This is the only event handler on INT33FC:00.
+ */
+ .invalid_aei_gpiochip = "INT33FC:00",
+};
+
+/*
* Whitelabel (sold as various brands) TM800A550L tablets.
* These tablet's DSDT contains a whole bunch of bogus ACPI I2C devices
* (removed through acpi_quirk_skip_i2c_client_enumeration()) and