platform/x86: x86-android-tablets: Add support for more then 1 gpio_key
authorHans de Goede <hdegoede@redhat.com>
Fri, 5 May 2023 20:59:00 +0000 (22:59 +0200)
committerHans de Goede <hdegoede@redhat.com>
Tue, 9 May 2023 09:54:43 +0000 (11:54 +0200)
commit6dc6c0c13d2caa5263289a95d99fcc41cfdb6962
tree87b311137dfb76c1053b86a98c036b930aab5a33
parentfbc29478aa60662711679a8b0b56962b35db8df6
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
drivers/platform/x86/x86-android-tablets/asus.c
drivers/platform/x86/x86-android-tablets/core.c
drivers/platform/x86/x86-android-tablets/lenovo.c
drivers/platform/x86/x86-android-tablets/other.c
drivers/platform/x86/x86-android-tablets/x86-android-tablets.h