From patchwork Mon Dec 5 13:40:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 29682 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2261240wrr; Mon, 5 Dec 2022 05:45:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf4P8n5JUmdo1wG36ENjz1Cjc4dDTM39JbdvnfgGmg0Z78Whh2/1GuYJjpShkU+1BJq8Y5wL X-Received: by 2002:a17:907:16a5:b0:7be:42dc:4cfc with SMTP id hc37-20020a17090716a500b007be42dc4cfcmr35057797ejc.128.1670247916671; Mon, 05 Dec 2022 05:45:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670247916; cv=none; d=google.com; s=arc-20160816; b=IWUGplYixq06cir6uDcQyMSN0ORqeizXAm//bUcqKOPZPl7O2I7W/wbl7d6n96QzLd CdjIHX31JSLkwLiiDOmTd6k5d4KWLSrcgJufkHae8ljhjczKf787Dvri9BvNM+KOpL/Y vLW0Q6e1puSe3pUpQyr+lJ5aBYiL9UMtleKfhSbw2HZWd+3ON9L92sgGqtuzMBVUkW93 rSP/IdncF3xnQOCrtsTYU8fuusK0SkE18wk2NSHV24G4VpMkaXbRKLtouZ5UnFsYHCK3 rY7G8FS1YEWZDVt2e25vb9QnZpGPvRoTLHwxCprHOlacY9N2VElsUGwf5pluB8NbxYMF wKgQ== 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=94BFeRFCOf5gyLvKTVdQmG6EZ7WPUpd9iE1F1/oGgfI=; b=OUHQORu2xwYpn2Slv6oJ+lKHDzDaU2YthL8WQC7HV9BxnzY8FEt+DgY7F8JJ/q2lrV T3XEoj9TLcNauHQzIVxqVYYkLx3llK4B17gnY2rd6dVkKShUafqOEfThMduVtKf0lNjp dPkEra9Ka7prMEo2R43bt4zbUClnCi5Xz8QiQcutGFfiMOUmUixxlI61/LiEc195xepl a+Y6jGGjG4AVglUxm8k4+/vkTlV1LS/9XnlEoHWyRK8c3bc7ivolUdTBL5Znx9UzlY03 MugFF1979aT1JszRO4BCvbrNM6BnJu3LbXRrcsZ5mT2DrIyMDgqidJy+TpVAQz8NufnY NaNQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa10-20020a170907868a00b00773db351c39si9784875ejc.64.2022.12.05.05.44.52; Mon, 05 Dec 2022 05:45:16 -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 S231826AbiLENlc (ORCPT + 99 others); Mon, 5 Dec 2022 08:41:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232143AbiLENl2 (ORCPT ); Mon, 5 Dec 2022 08:41:28 -0500 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A5011CFDB; Mon, 5 Dec 2022 05:41:27 -0800 (PST) Received: (Authenticated sender: foss@0leil.net) by mail.gandi.net (Postfix) with ESMTPSA id 79BC4FF811; Mon, 5 Dec 2022 13:41:14 +0000 (UTC) From: Quentin Schulz To: Samuel Holland , Bastien Nocera , =?utf-8?q?Guido_G=C3=BCnther?= , Sascha Hauer , Pengutronix Kernel Team , Angus Ainslie , Ondrej Jirman , Icenowy Zheng , Andy Gross , Aleksei Mamlin , Fabio Estevam , David Jander , Frieder Schrempf , Bjorn Andersson , Konrad Dybcio , Peter Geis , Heiko Stuebner , Shawn Guo , Jernej Skrabec , Lukasz Majewski , AngeloGioacchino Del Regno , Chen-Yu Tsai , Michael Riesch , Rob Herring , NXP Linux Team , Dmitry Torokhov , Hans de Goede , Jagan Teki , Krzysztof Kozlowski Cc: Quentin Schulz , linux-input@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org Subject: [PATCH v3 2/9] Input: goodix - make gpiod_get honor GPIOD_ASIS Date: Mon, 5 Dec 2022 14:40:31 +0100 Message-Id: <20221103-upstream-goodix-reset-v3-2-0975809eb183@theobroma-systems.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221103-upstream-goodix-reset-v3-0-0975809eb183@theobroma-systems.com> References: <20221103-upstream-goodix-reset-v3-0-0975809eb183@theobroma-systems.com> MIME-Version: 1.0 X-Mailer: b4 0.10.1 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751381879670768221?= X-GMAIL-MSGID: =?utf-8?q?1751381879670768221?= From: Quentin Schulz For some reason the ACPI GPIO lookup code (acpi_find_gpio followed by acpi_gpio_update_gpiod_flags) will override the gpiod_flags passed to gpiod_get() if it can determine a set of flags from the ACPI GpioIo entry. For output pins like the reset pin, this requires a pull bias to be set, which often is not the case, so then the GPIOD_ASIS which we pass in is used. But if a pull bias is specified in the ACPI GpioIo entry for the reset pin then that gets translated to GPIOD_OUT_LOW or GPIOD_OUT_HIGH meaning we cannot guarantee the same behavior on all boards. So this may cause unintended side-effects, c.f. commit a2fd46cd3dbb ("Input: goodix - try not to touch the reset-pin on x86/ACPI devices") for some background. This is something which we can fix though, we can force the ACPI GPIO code to honor the GPIOD_ASIS we pass in by passing ACPI_GPIO_QUIRK_NO_IO_RESTRICTION to the ACPI gpio mapping. Suggested-by: Hans de Goede Signed-off-by: Quentin Schulz --- drivers/input/touchscreen/goodix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c index d73d4272a8ea5..1639f2f8a31e3 100644 --- a/drivers/input/touchscreen/goodix.c +++ b/drivers/input/touchscreen/goodix.c @@ -803,6 +803,7 @@ static int goodix_reset(struct goodix_ts_data *ts) .name = _name, \ .data = _params, \ .size = _size, \ + .quirks = ACPI_GPIO_QUIRK_NO_IO_RESTRICTION, \ } static const struct acpi_gpio_params first_gpio = { 0, 0, false };