Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp379568pxb; Tue, 15 Feb 2022 16:00:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxVCllQRSRGX92PDU0GiscIizpBuw38Jdu4gpQLnR47ErFxShZeQAQeP9Vls63X/Z9riWoM X-Received: by 2002:a63:a50d:0:b0:373:4c33:1292 with SMTP id n13-20020a63a50d000000b003734c331292mr70330pgf.286.1644969650933; Tue, 15 Feb 2022 16:00:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644969650; cv=none; d=google.com; s=arc-20160816; b=duIFjn67YWbOlKLVdH/LBWF0SZUGYWLSD+i8bn2nChNGVxXQbE7xF2l2913gI4Y+mb yPi0Vl9ir1Z+Q4PZaqETEOw6mfLEHFHV4Nu8XlcU5fGiZs3fngBBlJ5q8B7zmf/x0d08 Z2pz+zwJwqeE6VXaFLzKw6qxPRSQVmbrjCz8xLwy16ZpVxs7UNy8A1uBUGVNspVXXHkU pS/hqSGZzfrk2iJ0+32rO0KCFEV0ZlzHLy689Zz76+WHo4+MpAsdJEsHdyZValyAD/zu Z+tK6Idbre+4odwUVIwkiuJFdc+sMc1PthKuj/PW5lAdWmj5fdszIk5w57veGhaLG6iI H9pw== 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=sOqZgQcGdhbw/917ssXjuAHCgihytQMxnA5sDSo+Ii4=; b=GW+gZPfKcBAmqVUJHnoLY9lmGbYKDYI8WezhJkRK322JnRvaevw2vAkQZQ1emDuWNO zaYU5SHy0eMVFeME+EyFNO/fk7y/KQ7z7DWV0bPL0846VZEZdwFzoiwuAVmL5CZkxz2U SklPdz5nTin5LV2l2eX/nUqu/z4xHFwnP7tbE+6Kbmw/cdj77IYrqb5s6Kas2V97YUT+ fBBpX+j0lidqXlHXkSWPNRiPCI+euVNCIAtjlQcSG0WHe+qjmdiKuVjNTayLLYOFG2NF k4I5RHIFbKTxOdRQlYNUclEBhzKImolFFNGuikFpbQ3P3MTYUrsgVWC0kfPKb3kqsaMF ckRw== 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 c4si4166420pgv.278.2022.02.15.16.00.31; Tue, 15 Feb 2022 16:00:50 -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 S242883AbiBOSI5 (ORCPT + 99 others); Tue, 15 Feb 2022 13:08:57 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:54054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242884AbiBOSIu (ORCPT ); Tue, 15 Feb 2022 13:08:50 -0500 Received: from hs01.dk-develop.de (hs01.dk-develop.de [173.249.23.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C831DD97B; Tue, 15 Feb 2022 10:08:38 -0800 (PST) From: Danilo Krummrich To: krzysztof.kozlowski@canonical.com, dmitry.torokhov@gmail.com, robh+dt@kernel.org, devicetree@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linus.walleij@linaro.org, Danilo Krummrich Subject: [PATCH v3 3/3] input: ps2-gpio: enforce GPIOs flag open drain Date: Tue, 15 Feb 2022 19:08:29 +0100 Message-Id: <20220215180829.63543-4-danilokrummrich@dk-develop.de> In-Reply-To: <20220215180829.63543-1-danilokrummrich@dk-develop.de> References: <20220215180829.63543-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 The PS/2 bus defines the data and clock line be open drain, therefore for both enforce the particular GPIO flags in the driver. Without enforcing to flag at least the clock gpio as open drain we run into the following warning: WARNING: CPU: 1 PID: 40 at drivers/gpio/gpiolib.c:3175 gpiochip_enable_irq+0x54/0x90 gpiochip_enable_irq() warns on a GPIO being configured as output while serving as IRQ source without being flagged as open drain. Signed-off-by: Danilo Krummrich --- drivers/input/serio/ps2-gpio.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/input/serio/ps2-gpio.c b/drivers/input/serio/ps2-gpio.c index 8970b49ea09a..f562f396ba05 100644 --- a/drivers/input/serio/ps2-gpio.c +++ b/drivers/input/serio/ps2-gpio.c @@ -322,14 +322,19 @@ static irqreturn_t ps2_gpio_irq(int irq, void *dev_id) static int ps2_gpio_get_props(struct device *dev, struct ps2_gpio_data *drvdata) { - drvdata->gpio_data = devm_gpiod_get(dev, "data", GPIOD_IN); + enum gpiod_flags gflags; + + /* Enforce open drain, since this is required by the PS/2 bus. */ + gflags = GPIOD_IN | GPIOD_FLAGS_BIT_OPEN_DRAIN; + + drvdata->gpio_data = devm_gpiod_get(dev, "data", gflags); if (IS_ERR(drvdata->gpio_data)) { dev_err(dev, "failed to request data gpio: %ld", PTR_ERR(drvdata->gpio_data)); return PTR_ERR(drvdata->gpio_data); } - drvdata->gpio_clk = devm_gpiod_get(dev, "clk", GPIOD_IN); + drvdata->gpio_clk = devm_gpiod_get(dev, "clk", gflags); if (IS_ERR(drvdata->gpio_clk)) { dev_err(dev, "failed to request clock gpio: %ld", PTR_ERR(drvdata->gpio_clk)); -- 2.35.1