Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp88330pxb; Tue, 15 Feb 2022 08:59:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJx6BrS5ejWShRKHzVvKK0x7mAKbjU7n899jcIcibcmyQwcQJyxvbISbtyrobSAjHunfjkrn X-Received: by 2002:a17:902:da8c:: with SMTP id j12mr5128591plx.17.1644944399160; Tue, 15 Feb 2022 08:59:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644944399; cv=none; d=google.com; s=arc-20160816; b=vVpouwvExd7ANO/e06/OOhQmzKByxIbaWzXi5iF7oLHffjkyi13XjAwLRa/L5Wc+ci X1ymPdqZL9UTvj28IhW3PezBQRA9ThEqiz9DJh0tRGDWNzEXZZh+bcAOqhwy2+e0l0Ly F9V2VG7HKYNE+/BCj979T/blKsrG3pIRrD00oRhCZCfEn5MKsomKInI6vMZwHyTvCgGw onw6jDhnZ3d8XTKVSvLxGrdHO7T1IW5KYTQupNaOJgbVBpkvZfnYSk4G23uLocpdb+hL kCscViFnvVOH08AF+ZLc0Spy1ti82ym1b9w8H/DW5o7knZeXMwuqvtu44EF+7xYuAzGm /lWA== 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=0fSwYZR4ALADtXKzBvSF8VxtJoOOid5JsNYQBbdCiU0=; b=W7xQaoMtXZlMmImRyg7o5ieODzqphGawJoteE6djrvTFmEWFGR4Z2iN7GUz530Lnyx GqjpRvnDfsf7GczaO/PMOJ6oSkFhtQQyVuUpVgKZaIwmDXvMNC6M+QUxjzDFhzONDcam wN8PR6CDnJSXabeMYyMrv+4ZFna61fnymWkh95fqiSF4gsB3vTjb1xkzTOGDIa/6jCAX /Fc2Gf1sWqNGz+TPNnJCD5zpfTaF9u+8YO/7EKwWdAXepcA0VQ22ItnoyNqAco1AHca4 wGQO07r8MJvORWuMyCes4j+cIZbKdVpcmN5ousFNytexXw/hY/eiSOi1Fj2MsrOoFMXx 6EKQ== 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 y16si34016765pfl.168.2022.02.15.08.59.42; Tue, 15 Feb 2022 08:59:59 -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 S241252AbiBOQCl (ORCPT + 99 others); Tue, 15 Feb 2022 11:02:41 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:59258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241147AbiBOQCe (ORCPT ); Tue, 15 Feb 2022 11:02:34 -0500 Received: from hs01.dk-develop.de (hs01.dk-develop.de [173.249.23.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 508C930B; Tue, 15 Feb 2022 08:02:24 -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 3/4] input: ps2-gpio: remove tx timeout from ps2_gpio_irq_tx() Date: Tue, 15 Feb 2022 17:02:07 +0100 Message-Id: <20220215160208.34826-4-danilokrummrich@dk-develop.de> In-Reply-To: <20220215160208.34826-1-danilokrummrich@dk-develop.de> References: <20220215160208.34826-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 246a583986e9..f47a967f7521 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 @@ -335,13 +334,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.35.1