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:00 +0300
committerHans de Goede <hdegoede@redhat.com>2023-05-09 12:54:43 +0300
commit6dc6c0c13d2caa5263289a95d99fcc41cfdb6962 (patch)
tree87b311137dfb76c1053b86a98c036b930aab5a33 /drivers/platform/x86/x86-android-tablets/other.c
parentfbc29478aa60662711679a8b0b56962b35db8df6 (diff)
downloadlinux-6dc6c0c13d2caa5263289a95d99fcc41cfdb6962.tar.xz
platform/x86: x86-android-tablets: Add support for more then 1 gpio_key
Modify the gpio_keys support in x86_android_tablet_init() for tablets which have more then 1 key/button which needs to be handled by the gpio_keys driver. This requires copying over the struct gpio_keys_button from the x86_gpio_button struct array to a new gpio_keys_button struct array, as an added benefit this allows marking the per model x86_gpio_button arrays __initconst so that they all can be freed after module init(). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20230505205901.42649-1-hdegoede@redhat.com
Diffstat (limited to 'drivers/platform/x86/x86-android-tablets/other.c')
-rw-r--r--drivers/platform/x86/x86-android-tablets/other.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/platform/x86/x86-android-tablets/other.c b/drivers/platform/x86/x86-android-tablets/other.c
index 3754d2453cdb..4d54c89e6ca2 100644
--- a/drivers/platform/x86/x86-android-tablets/other.c
+++ b/drivers/platform/x86/x86-android-tablets/other.c
@@ -94,7 +94,7 @@ const struct x86_dev_info acer_b1_750_info __initconst = {
* which is not described in the ACPI tables in anyway.
* Use the x86-android-tablets infra to create a gpio-button device for this.
*/
-static struct x86_gpio_button advantech_mica_071_button = {
+static const struct x86_gpio_button advantech_mica_071_button __initconst = {
.button = {
.code = KEY_PROG1,
.active_low = true,
@@ -109,6 +109,7 @@ static struct x86_gpio_button advantech_mica_071_button = {
const struct x86_dev_info advantech_mica_071_info __initconst = {
.gpio_button = &advantech_mica_071_button,
+ .gpio_button_count = 1,
};
/*
@@ -449,7 +450,7 @@ const struct x86_dev_info nextbook_ares8a_info __initconst = {
* 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 = {
+static const struct x86_gpio_button peaq_c1010_button __initconst = {
.button = {
.code = KEY_SOUND,
.active_low = true,
@@ -464,6 +465,7 @@ static struct x86_gpio_button peaq_c1010_button = {
const struct x86_dev_info peaq_c1010_info __initconst = {
.gpio_button = &peaq_c1010_button,
+ .gpio_button_count = 1,
/*
* Move the ACPI event handler used by the broken WMI interface out of
* the way. This is the only event handler on INT33FC:00.