summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/x86-android-tablets/other.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2023-05-05 23:59:01 +0300
committerHans de Goede <hdegoede@redhat.com>2023-05-09 12:54:43 +0300
commit24f7b9a0650561cea1a20e54f8a55522cbff10ab (patch)
tree08a52286c6a35461dbd30981f28fe561281f04a7 /drivers/platform/x86/x86-android-tablets/other.c
parent6dc6c0c13d2caa5263289a95d99fcc41cfdb6962 (diff)
downloadlinux-24f7b9a0650561cea1a20e54f8a55522cbff10ab.tar.xz
platform/x86: x86-android-tablets: Add support for extra buttons on Cyberbook T116
The Cyberbook T116 rugged tablet comes in both Windows and Android versions and even on the Android version the DSDT is mostly sane. This tablet has 2 extra general purpose buttons in the row with the power + volume-buttons, labeled P and F. Use the x86-android-tablets infra to create a gpio-button device for these 2 extra buttons. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20230505205901.42649-2-hdegoede@redhat.com
Diffstat (limited to 'drivers/platform/x86/x86-android-tablets/other.c')
-rw-r--r--drivers/platform/x86/x86-android-tablets/other.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/platform/x86/x86-android-tablets/other.c b/drivers/platform/x86/x86-android-tablets/other.c
index 4d54c89e6ca2..e79549c6aae1 100644
--- a/drivers/platform/x86/x86-android-tablets/other.c
+++ b/drivers/platform/x86/x86-android-tablets/other.c
@@ -197,6 +197,45 @@ const struct x86_dev_info chuwi_hi8_info __initconst = {
.init = chuwi_hi8_init,
};
+/*
+ * Cyberbook T116 Android version
+ * This comes in both Windows and Android versions and even on Android
+ * the DSDT is mostly sane. This tablet has 2 extra general purpose buttons
+ * in the button row with the power + volume-buttons labeled P and F.
+ * Use the x86-android-tablets infra to create a gpio-button device for these.
+ */
+static const struct x86_gpio_button cyberbook_t116_buttons[] __initconst = {
+ {
+ .button = {
+ .code = KEY_PROG1,
+ .active_low = true,
+ .desc = "prog1_key",
+ .type = EV_KEY,
+ .wakeup = false,
+ .debounce_interval = 50,
+ },
+ .chip = "INT33FF:00",
+ .pin = 30,
+ },
+ {
+ .button = {
+ .code = KEY_PROG2,
+ .active_low = true,
+ .desc = "prog2_key",
+ .type = EV_KEY,
+ .wakeup = false,
+ .debounce_interval = 50,
+ },
+ .chip = "INT33FF:03",
+ .pin = 48,
+ },
+};
+
+const struct x86_dev_info cyberbook_t116_info __initconst = {
+ .gpio_button = cyberbook_t116_buttons,
+ .gpio_button_count = ARRAY_SIZE(cyberbook_t116_buttons),
+};
+
#define CZC_EC_EXTRA_PORT 0x68
#define CZC_EC_ANDROID_KEYS 0x63