aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio
diff options
context:
space:
mode:
authorDanilo Krummrich <danilokrummrich@dk-develop.de>2022-02-15 14:44:26 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2022-02-15 17:25:38 -0800
commit6283cc9e7785e3df6160dbce4940b3a5925cb728 (patch)
tree2d6496785780487aac32f1c0fad10710b9365101 /drivers/input/serio
parentInput: ps2-gpio - use ktime for IRQ timekeeping (diff)
downloadlinux-dev-6283cc9e7785e3df6160dbce4940b3a5925cb728.tar.xz
linux-dev-6283cc9e7785e3df6160dbce4940b3a5925cb728.zip
Input: ps2-gpio - remove tx timeout from ps2_gpio_irq_tx()
Actually, there's no extra clock pulse to wait for. The assumption of an extra clock pulse was mistakenly derived from the fact that by the time this driver was introduced the GPIO controller of the test machine (bcm2835) generated spurious interrupts. Since now spurious interrupts are handled properly this can and must be removed in order to make TX xfers work properly. While at it, remove duplicate gpiod_direction_input(). The data gpio must already be configured to act as input when receiving the ACK bit. This patch is tested with the original hardware (peripherals and board) the driver was developed on. Signed-off-by: Danilo Krummrich <danilokrummrich@dk-develop.de> Link: https://lore.kernel.org/r/20220215160208.34826-4-danilokrummrich@dk-develop.de Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/serio')
-rw-r--r--drivers/input/serio/ps2-gpio.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/input/serio/ps2-gpio.c b/drivers/input/serio/ps2-gpio.c
index f1b7313a0866..e471c0fec536 100644
--- a/drivers/input/serio/ps2-gpio.c
+++ b/drivers/input/serio/ps2-gpio.c
@@ -37,8 +37,7 @@
#define PS2_DATA_BIT7 8
#define PS2_PARITY_BIT 9
#define PS2_STOP_BIT 10
-#define PS2_TX_TIMEOUT 11
-#define PS2_ACK_BIT 12
+#define PS2_ACK_BIT 11
#define PS2_DEV_RET_ACK 0xfa
#define PS2_DEV_RET_NACK 0xfe
@@ -333,14 +332,7 @@ static irqreturn_t ps2_gpio_irq_tx(struct ps2_gpio_data *drvdata)
/* release data line to generate stop bit */
gpiod_direction_input(drvdata->gpio_data);
break;
- case PS2_TX_TIMEOUT:
- /*
- * Devices generate one extra clock pulse before sending the
- * acknowledgment.
- */
- break;
case PS2_ACK_BIT:
- gpiod_direction_input(drvdata->gpio_data);
data = gpiod_get_value(drvdata->gpio_data);
if (data) {
dev_warn(drvdata->dev, "TX: received NACK, retry\n");