Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp4433620pxb; Sat, 12 Feb 2022 05:08:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5+cS/qdonJFydjBrGK+hDBCYnqwPSd99cArQKgAKbIglnSJ3Jt2ThNl3PWIwbge2z5eYU X-Received: by 2002:a17:902:ecc3:: with SMTP id a3mr5868319plh.84.1644671291640; Sat, 12 Feb 2022 05:08:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644671291; cv=none; d=google.com; s=arc-20160816; b=VLqzJeEdmaUHotshRe2t8kjRFao/oVed65HfY3MifV1pD/EU33IVaLGj5qjgAmary9 NsifWU+U83q5JA1k4W/7ExhFuktLcf5mCHujCyJ6njLHRYvwKapJt+44JKkSKZfBqJfA iY7MBaAr5aEJeVj6MuF9sseNgDBt4CcDc89mrlL52SvHHul9pqzq4v9TeSHO9oN3CoVO 6RoDH+Bb79/gyfYOBFuHvkaq5jgVtIZcJACkmXI63i2f5KDEmIhOfjqI1duDAhxYv9VG DCVJ3K4d/b50bsRlbACOrqFVSJewQQ0v8ttH+9U51UhetoNH/U7oYDO/1K+MEDNu1VVO AdhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=DbVpZOnPsDsELR1rFuyT3pLa+NOcpWZz4UrVP21vEDI=; b=LiEkmbge5nfKSr5ncJGJzWDeW92tfjYRrQeIoNoPqtzgEiJ5YyhYCr2/V9LYadeAMw WjB2ybQoD5RfPYDjBlNdPLviPsdI+EHmaAbnUO/5rFlMrOPfy0oRTrW7i3jzK3E8aA1F qDXvC+AJM7mpa+xxeUxdNpbu8VUaTNokNfHq6zINbGeJcjREXU8n7jims9IjFxPCOxZf 7QN4TJOMalV/UfGPotOaAMMRzSDmmgh0No2mIFGxl5Zho850zfsjvqNSjRyH5AH0LgiK +bpvS23mNXN7OeexFJjJYJZPO/4SF/8EHYjrXzFJ1BGEvYFSruEHbZMey3zZ5LIpPAA9 OIjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w5si11899767pfu.209.2022.02.12.05.08.00; Sat, 12 Feb 2022 05:08:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353702AbiBKVXP (ORCPT + 93 others); Fri, 11 Feb 2022 16:23:15 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:46092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347295AbiBKVXK (ORCPT ); Fri, 11 Feb 2022 16:23:10 -0500 Received: from hs01.dk-develop.de (hs01.dk-develop.de [IPv6:2a02:c207:3002:6234::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1261DC5A for ; Fri, 11 Feb 2022 13:23:09 -0800 (PST) From: Danilo Krummrich To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linus.walleij@linaro.org, Danilo Krummrich Subject: [PATCH 2/3] input: ps2-gpio: remove tx timeout from ps2_gpio_irq_tx() Date: Fri, 11 Feb 2022 22:22:57 +0100 Message-Id: <20220211212258.80345-3-danilokrummrich@dk-develop.de> In-Reply-To: <20220211212258.80345-1-danilokrummrich@dk-develop.de> References: <20220211212258.80345-1-danilokrummrich@dk-develop.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/input/serio/ps2-gpio.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/input/serio/ps2-gpio.c b/drivers/input/serio/ps2-gpio.c index 7fef4176bdd1..336928a8a127 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 @@ -323,13 +322,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"); -- 2.34.1