]> git.baikalelectronics.ru Git - kernel.git/commit
Input: tca8418 - enable interrupt after it has been requested
authorDamien Riegel <damien.riegel@savoirfairelinux.com>
Thu, 19 Oct 2017 22:34:55 +0000 (15:34 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 19 Oct 2017 23:50:20 +0000 (16:50 -0700)
commita476c673cc9068a4ba839cfa78708becdb8b951c
tree57aeb0a0cec66cee30418034ba96ea5bd627fb70
parent59fdec972792626305429cc5fc640fdb020e5acd
Input: tca8418 - enable interrupt after it has been requested

Currently, enabling keypad interrupts is one of the first operations
done on the keypad, even before the interrupt is requested, so there is
a small time window where the keypad can fire interrupts but the driver
is not yet ready to handle them. It's fine for level interrupts because
they will be handled anyway, but not so much for edge ones.

This commit modifies and moves the function in charge of configuring the
keypad. Enabling interrupts is now the last thing done on the keypad,
and after the interrupt has been requested by the driver.

Writing to the config register was also used to determine if the device
was indeed present on the bus or not, this has been replaced by reading
the lock/event count register to keep the same functionality.

Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/keyboard/tca8418_keypad.c