RE: [PATCH v3 01/10] input: keyboard: adp5588-keys: support gpi key events as 'gpio keys'
From: "Sa, Nuno" <Nuno.Sa@analog.com>
Date: 2022-08-31 12:28:23
Also in:
linux-devicetree, linux-gpio
From: Linus Walleij <redacted> Sent: Wednesday, August 31, 2022 2:24 PM To: Sa, Nuno <Nuno.Sa@analog.com> Cc: linux-input@vger.kernel.org; linux-gpio@vger.kernel.org; devicetree@vger.kernel.org; Krzysztof Kozlowski [off-list ref]; Hennerich, Michael [off-list ref]; Bartosz Golaszewski [off-list ref]; Andy Shevchenko [off-list ref]; Rob Herring [off-list ref]; Dmitry Torokhov [off-list ref] Subject: Re: [PATCH v3 01/10] input: keyboard: adp5588-keys: support gpi key events as 'gpio keys' [External] On Thu, Jul 21, 2022 at 10:03 AM Nuno Sá [off-list ref] wrote:quoted
This change replaces the support for GPIs as key event generators. Instead of reporting the events directly, we add a gpio based irqchip so that these events can be consumed by keys defined in the gpio-keysquoted
driver (as it's goal is indeed for keys on GPIOs capable of generating interrupts). With this, the gpio-adp5588 driver can also be dropped. The basic idea is that all the pins that are not being used as part of the keymap matrix can be possibly requested as GPIOs by gpio-keys (it's also fine to use these pins as plain interrupts though that's not really the point). Since the gpiochip now also has irqchip capabilities, we should only remove it after we free the device interrupt (otherwise we could, in theory, be handling GPIs interrupts while the gpiochip is concurrently removed). Thus the call 'adp5588_gpio_add()' is moved and since the setup phase also needs to come before making the gpios visible, wealsoquoted
need to move 'adp5588_setup()'. While at it, always select GPIOLIB so that we don't need to use #ifdef guards. Signed-off-by: Nuno Sá <nuno.sa@analog.com>Is there any input-related content in the driver after this or should the whole driver just be moved over to drivers/gpio and replace the old GPIO driver that you delete in patch 2?
Hi, Yes there is... The main usage for the device is to use it as a matrix keypad. However, all the keys that are not used will be then exposed through a gpiochip to be consumed for example by gpio-keys - Nuno Sá