ps2-gpio: use ktime for IRQ timekeeping

From: Danilo Krummrich
Date: Tue Feb 15 2022 - 11:02:26 EST


Changes since v1
================
- add patch to refactor struct ps2_gpio_data for clear separation between
RX and TX
- make all variables for IRQ timekeeping per-port and initialize them in
ps2_gpio_open()

This patch series implements the usage of ktime for IRQ timekeeping to
overcome:

(1) The resolution limitations of jiffies.
(2) Potential spurious IRQs generated by gpio controllers.

Besides that, based on the newly implemented timekeeping, it fixes a wrongly
suspected extra clock cycle for TX transfers and a race condition when
starting an immediate TX transfer based on data received from an RX transfer.

Danilo Krummrich (4):
input: ps2-gpio: refactor struct ps2_gpio_data
input: ps2-gpio: use ktime for IRQ timekeeping
input: ps2-gpio: remove tx timeout from ps2_gpio_irq_tx()
input: ps2-gpio: don't send rx data before the stop bit

drivers/input/serio/ps2-gpio.c | 180 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------
1 file changed, 116 insertions(+), 64 deletions(-)