Skip to content

Commit

Permalink
input: keyboard: adp5588-keys: support gpi key events as 'gpio keys'
Browse files Browse the repository at this point in the history
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-keys
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, we also
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>
  • Loading branch information
nunojsa authored and intel-lab-lkp committed Jul 21, 2022
1 parent ebfa004 commit 357979f
Show file tree
Hide file tree
Showing 3 changed files with 139 additions and 134 deletions.
2 changes: 2 additions & 0 deletions drivers/input/keyboard/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ config KEYBOARD_ADP5520
config KEYBOARD_ADP5588
tristate "ADP5588/87 I2C QWERTY Keypad and IO Expander"
depends on I2C
select GPIOLIB
select GPIOLIB_IRQCHIP
help
Say Y here if you want to use a ADP5588/87 attached to your
system I2C bus.
Expand Down

0 comments on commit 357979f

Please sign in to comment.