Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp1942543rwi; Thu, 3 Nov 2022 10:44:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5BQTNefCuT76IXFktJtwSlNldBue+sYoe4h37xTUE3tHwFPr0i7fXvH7bK0VNLBfYdZm0G X-Received: by 2002:a65:4084:0:b0:463:aa4:49cf with SMTP id t4-20020a654084000000b004630aa449cfmr26625723pgp.164.1667497495357; Thu, 03 Nov 2022 10:44:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667497495; cv=none; d=google.com; s=arc-20160816; b=1CUTL1O5tfkFGoE68H/63AV36aMzyW8Rqa4jsLjARa7hsQfUvBByN1eAPOUetmdYo4 p5z0tWZH+bVFO1NocbpYk3hW8Pa+EXcZ2x2cVO9d415b4Zis8HS91aGNIg9gy/gSDUxO 7iKQidGALIkvhAlQN0++JmV8SOvibB1oupZB2JvXN07S198EkSLVKsrEhLoAXxPcVaJY zigWZh+qs9HCOza8iSTqioGzcKzQVAi1f8wKtMTg7oEEkNlP7JdE5fYBSN0eR9QATKKV CBbtJGh1GC8anzZUnMNpJfDuGxWfp5sQXGG0pG188gQJP4xS4ymuAAwJox/gmUr5aXcA +6CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=jMLMgTZnXG3qE89gvGIdlg9xWS4kfSGRYT+JSAUdRFU=; b=LX3/29ZKTt4GCAmtEsjHMy3LQ9DCjq4eN9eqziVdgImpRS2PCGBerN+OhGpcFvhqpJ sa3vJNMdAEUv0I465bfC0l+4Ag2g73y+HKCagjCFyUANIu2zJXiuPcT2t8EV4LOAa6Gc s3Vk3lQokj+E6FgILVe+dczSpvzyQItR6s3o0nc9iZcC4Q7fiWWFe0TBfNprH1hptjSp 11WeEFImmNjoTmUS7U02bDOTWothRI4W+YEAiIqrj6Y4mi2uF6XX0TiCj9OElfwdLiWi qy89EKW5SEW2A3Yb9ROKHbHwKTmkWAljoiwuJBw+viztkgKWVNhAfwxlKmLI31CvLQLl szsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BgB2Qdom; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g6-20020a17090a714600b002141d9f78e9si482940pjs.179.2022.11.03.10.44.40; Thu, 03 Nov 2022 10:44:55 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BgB2Qdom; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230017AbiKCRRM (ORCPT + 98 others); Thu, 3 Nov 2022 13:17:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230473AbiKCRRJ (ORCPT ); Thu, 3 Nov 2022 13:17:09 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF22A2F4; Thu, 3 Nov 2022 10:17:08 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id d59-20020a17090a6f4100b00213202d77e1so5875565pjk.2; Thu, 03 Nov 2022 10:17:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=jMLMgTZnXG3qE89gvGIdlg9xWS4kfSGRYT+JSAUdRFU=; b=BgB2QdomzPzge4VbrqFYuwzmD3h1QhxfbsY4GqKYtF5a7n/NJTfmNYMPOXy/hbqOWI UOogT5U8gyicW6RQR/+0gY1M5xA06FG71qdz5iPYkpXjkd8COGd6E2KRPV/wJhK/hn0T 91kPejzsqsK6/+/s8S3Ya4F6JXYNJCFwcE0RmL9LN4LgpLulk8sGgCby2gcfyRjPHGoe dNGSpDbtye5tFxt1gNOkjao1EjHsmyUC3l2C0CqCKRCZwq9rWrfOQdV4Um3RsRQ6Lvq/ 98nWPLYjLm7G2YQ3inoFWS4IrlRIm5o311J2uVLnqg75THYPSf2Ql8OZ0HAVZrMVTTcN 6ltw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jMLMgTZnXG3qE89gvGIdlg9xWS4kfSGRYT+JSAUdRFU=; b=2FgAn38WhSWWw+eHyrTO1A3zNlSOMLPNNLMvY2Fkg8zJ02J3VfSj0AOicpTAXfEdmd rhwWmAPpz2sLhdI/OvI3TlUFD7xMuTmVxU2otZoLbIAJo5ZLApLizBaLp1o0pfpy4fGV 2qRIXXZChmOP34IvkhySQ081I6PzUonS3/2jWbar4kP//71G21o9B4nXeSVWCi8pKo5h jfXDr86GNec6I9y2Hd+bMXOfSUNjywkxGQkUWnWKbn0nYLSnAfYmpSKQLB9M1Qntiw84 Bq4psa7VvK5C89nhGUjCcvpj+8UOm/0DuEKO6Ug8w34P+uBF/WvHCXq7+jkG9Fg4cHm5 1e0g== X-Gm-Message-State: ACrzQf3XUzLRveE5Lz8yZv5dPDOdWStjIstJWd5Ay8Jwb8bIEevlNgE3 z3SYNH5cNNg5+Txzp4PihCk= X-Received: by 2002:a17:90b:70a:b0:211:f163:ddff with SMTP id s10-20020a17090b070a00b00211f163ddffmr31949799pjz.202.1667495827938; Thu, 03 Nov 2022 10:17:07 -0700 (PDT) Received: from google.com ([2620:15c:9d:2:a6ae:11ff:fe11:fcc3]) by smtp.gmail.com with ESMTPSA id d14-20020aa797ae000000b0056ddd2ac8f1sm960026pfq.211.2022.11.03.10.17.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 10:17:07 -0700 (PDT) Date: Thu, 3 Nov 2022 10:17:03 -0700 From: Dmitry Torokhov To: Quentin Schulz Cc: hadess@hadess.net, hdegoede@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, wens@csie.org, jernej.skrabec@gmail.com, samuel@sholland.org, agross@kernel.org, andersson@kernel.org, konrad.dybcio@somainline.org, heiko@sntech.de, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-rockchip@lists.infradead.org, Quentin Schulz Subject: Re: [RFC PATCH 0/7] fix reset line polarity for Goodix touchscreen controllers Message-ID: References: <20221103-upstream-goodix-reset-v1-0-87b49ae589f1@theobroma-systems.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221103-upstream-goodix-reset-v1-0-87b49ae589f1@theobroma-systems.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,FSL_HELO_FAKE, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 Hi Quentin, On Thu, Nov 03, 2022 at 03:43:45PM +0100, Quentin Schulz wrote: > The Goodix touchscreen controller has a reset line active low. It happens to > also be used to configure its i2c address at runtime. If the reset line is > incorrectly asserted, the address will be wrongly configured. This cost me a few > hours yesterday, trying to figure out why the touchscreen wouldn't work. > > The driver is "asserting" this reset GPIO by setting its output to 0, probably > to reflect the physical state of the line. However, this relies on the fact that > the Device Tree node setting the reset line polarity to active high, which is > incorrect since the reset is active low in hardware. > > To fix this inconsistency, the polarity is inverted to not confuse the user > about the reset line polarity. > > This is marked as RFC because it breaks DT compatibility and also the Google > CoachZ device is the only one with an active low polarity for the reset GPIO > in DT, so not sure if it is a typo or its state is actually inverted (so GPIO > active high to drive the reset line low). Changing it anyways since the polarity > is changed in the driver so it needs to be changed in DT too. I would like to get gpio handling into a better shape, but the above is completely incorrect. "goodix,gt7375p" that is used in CoachZ and other Google designs is using i2c-hid compatible firmware and is not being driven by drivers/input/touchscreen/goodix.c driver, but rather by i2c-hid + hid-multitouch combo. You should not be touching arch/arm64/boot/dts/qcom/sc7180* at all. > > I'm all ears if there's a better way to handle this. We could document this in > the DT binding but this kinda breaks the promise we make that the DT is not > bound to the driver implementation. I think Hans has already voiced concerns about x86 devices using these devices and having GPIO data encoded in the driver, so we need to accommodate them. On DT side we can add a quirk to gpiolib-of.c to [maybe temporary] override polarity of reset GPIO lines, then update DTS to match the reality. Thanks. -- Dmitry