From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF2F163A0 for ; Thu, 3 Nov 2022 17:17:08 +0000 (UTC) Received: by mail-pj1-f46.google.com with SMTP id l6so2317822pjj.0 for ; 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=Cj5eCWSBb6SQINKsQu6MZaockm9Xj/uF6tUgWyOq4J5S2iVpOVZg6p6xMrJB69WFBt hDt30+LUmoPeNhI5U3LuzhNobFSHIO+Ek8gzvo+0pWalSz304E1DD1QWQ4ltZ4ptLvzv Zst9Uqo/WKTh56GRB4MhBJcylPxhOansi8j5Tbxqp/WxQd/pX330pFqyWB6sb76yUO+z Hs3D13PCgQDDOeTWTU9tAvIwPNIlk2v5GwR/Mw2Xcu0wrsHJ+rUcHFqQqyYxtOU13ZVz puPJI/YI/A41BKdNvPA+EYJuavzkv/YVmnM1eutZEPTHEN+sfIDHASfpgocIqyubYFcS IW3w== X-Gm-Message-State: ACrzQf2n9Bamy7dOSqT9odZvIqJyHVrA6fjikhHrsNId/hIhCQpdsf1y LYiyAR2aLy+q6x0dkAEOzaI= X-Google-Smtp-Source: AMsMyM4KXsk3pLBuAZJaQZE/nBZ7r1WJ0vPUvs2KpVzcs1jk2iH8wiq9zdv9D3GGG8xHFXhOLj6fbw== 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> Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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> 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