From patchwork Tue Feb 7 02:48:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 53610 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2607541wrn; Mon, 6 Feb 2023 18:51:27 -0800 (PST) X-Google-Smtp-Source: AK7set8AQ3vP6uzHzlwWeQj/jF0KsnF+VZnMf4OIMqfOTRAre/2LD5bDF8ivnZ2gcvF8lQ8Ug7xz X-Received: by 2002:a05:6a20:3d86:b0:bf:6e94:3721 with SMTP id s6-20020a056a203d8600b000bf6e943721mr2098675pzi.26.1675738287063; Mon, 06 Feb 2023 18:51:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675738287; cv=none; d=google.com; s=arc-20160816; b=X6PVv90il5I5z3ToIZtYkUaFOgIVH3/6P8f70my9wnapfA8oCGRyQcvdb0lOQr3Zor 12tfL5jNWdmYyc8YqTuTBPFzdZbND9qzQehXky3ZH/gA4z/IbZho10PDT9SgfYFrjj91 c7A4G2OGKI8S3G0bka1j0wr//eXkTkRXw7VRax7RcPwnoPFUCsQ6bABnsve8sXrW1MoT FJCPeTW7ZUq/paMIJIwzDsQ1prlbps28N64EGGhLz4TlJf3jpARtmwYsYxioRpWX6pTn yDoDolMkVC03+n/NnxxVo6PhETMnXF76Bxy4oClY5pDPHlEAxxZIco1AU1QXTDHRDzUP 9rnA== 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 :dkim-signature; bh=FtYd96w13o2OREzHMRA9bmLEb9XbyiE/swWiI2WGNPk=; b=uXd+iB/vRAqniEWi7FImWBy7b0xBI9xTJh4w0y6MsivVn4YEj2h127Qm8vGJ/Mt3Em T7Kx8qAj2wBaAg2d4B6BuuvScTPOmD+CGQkFzwJy9qgm79aJ6QOtvtP/00W9SNyMD/Ne XjZnQwu0fUJXwIkeKwUoQ8C+vebnm6xgwM1triK8p7h3oZUX4gBEuYHlzyxHVM407ZKI CUT3z3QDfMW2imTG0TsGDZbvHSIYqegzSpopHZrofuZVDATdLOXNMe11Eet/3di8ms1J cIDHd6i8Kk/FIiiz8RukyssnH27w/5UQKXNe/ZBoSd+eFMUTP52OfjEqbEjB+CAbFMRB fyeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=alBdbTs4; 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=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f68-20020a625147000000b00590021d0b97si12347917pfb.104.2023.02.06.18.51.14; Mon, 06 Feb 2023 18:51:27 -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; dkim=pass header.i=@chromium.org header.s=google header.b=alBdbTs4; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229969AbjBGCtH (ORCPT + 99 others); Mon, 6 Feb 2023 21:49:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229939AbjBGCtB (ORCPT ); Mon, 6 Feb 2023 21:49:01 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41B5036681 for ; Mon, 6 Feb 2023 18:48:48 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id mi9so13568286pjb.4 for ; Mon, 06 Feb 2023 18:48:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FtYd96w13o2OREzHMRA9bmLEb9XbyiE/swWiI2WGNPk=; b=alBdbTs4aYTpqvsvp5qXhFdhnTI2epGijKZElaHhBcVXZvnCcyMKZgCAcxYLjgqh87 oQNA7vnnvFTkbN1ys+txiF+FEZ2cDXgAK6tqUBRrNy8loJXv7iETNjXb/20vr5U+waJY cHQyz7Lsrf1udFnBDmpP5HMe1t8mqJNef+3Xc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FtYd96w13o2OREzHMRA9bmLEb9XbyiE/swWiI2WGNPk=; b=UrUvrj07GpZxaNmJMHCur71R2fWE+LAtv9cAxzRy8pSp8lOw+9rbVyjqSkgc6HrQON lcs8qK8txyvgH9+ovjcuSMfH5S1L7iVvInhNzST38+FGdYgI4JoAJmTtIp7Hfr9HvWCO 5mOs+CtLKTxfRR/9FCKny8Knj13d8heKG6fq/H22LHIY+QcX0EcKSVTHm9ROTEkTl01C 8YsiJu3rbsdP5OtpIFO8Qb5/ZSSZBip+3xhYt07BoNXWP3S72G2/NACL/MBDEqNfh+xq tlgqwEJ4kzgJnZ7FxsQHf9MO1Qz760eoa5RaMnuUEsh0dsi8FD+W1fT2l9VAChD3M0mp rSPA== X-Gm-Message-State: AO0yUKWgIne1y5ckS6tU/DRnm7Glh4Mz2tzRmG8eoEg7z/LLiUcVW3J9 tcSn+HL7mL7asidPx4ZQTMGhjg== X-Received: by 2002:a05:6a21:6713:b0:bf:1769:347f with SMTP id wh19-20020a056a21671300b000bf1769347fmr1304873pzb.47.1675738127561; Mon, 06 Feb 2023 18:48:47 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:29fb:a635:f0df:f45a]) by smtp.gmail.com with ESMTPSA id s17-20020a63a311000000b0045dc85c4a5fsm6882430pge.44.2023.02.06.18.48.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Feb 2023 18:48:47 -0800 (PST) From: Douglas Anderson To: Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Jiri Kosina , Benjamin Tissoires Cc: linux-input@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dmitry Torokhov , devicetree@vger.kernel.org, Stephen Kitt , Konrad Dybcio , Douglas Anderson , Andy Gross , linux-kernel@vger.kernel.org Subject: [PATCH 1/7] arm64: dts: qcom: sc7280: On QCard, regulator L3C should be 1.8V Date: Mon, 6 Feb 2023 18:48:10 -0800 Message-Id: <20230206184744.1.I784f4b3d7e4a06edafff4a3129f52e749889bc05@changeid> X-Mailer: git-send-email 2.39.1.519.gcb327c4b5f-goog In-Reply-To: <20230207024816.525938-1-dianders@chromium.org> References: <20230207024816.525938-1-dianders@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1757138950104219560?= X-GMAIL-MSGID: =?utf-8?q?1757138950104219560?= On the first sc7280 QCards the L3C rail was never really used for anything. Stuffing options on the QCard meant that the QCard itself didn't use this rail for anything. This rail did get sent to the mainboard, but no existing mainboards ever did anything with it other that route it to a testpoint. On later sc7280 QCards, the L3C rail was repurposed. Instead of being a (nominally) 3.3V rail, it was decided to make it a 1.8V rail. It is now provided to the display connector (which might route it to the touchscreen) and also used to power some buffers relating to touchscreen IO. This rail is getting the additional tag "ts_avccio", though some places still refer to it as "vreg_l3c_3p0" despite the fact that the name now specifies the wrong voltage. Since it never hurts for this rail to be 1.8V (even on old QCards / old boards), let's just change it to 1.8V across the board and add the extra "ts_avccio" moniker as a label in the device tree. Future patches will start using this rail in their touchscreens. Signed-off-by: Douglas Anderson Reviewed-by: Matthias Kaehlcke --- arch/arm64/boot/dts/qcom/sc7280-qcard.dtsi | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sc7280-qcard.dtsi b/arch/arm64/boot/dts/qcom/sc7280-qcard.dtsi index df49564ae6dc..50d963957303 100644 --- a/arch/arm64/boot/dts/qcom/sc7280-qcard.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280-qcard.dtsi @@ -230,9 +230,15 @@ vreg_l2c_1p8: ldo2 { regulator-initial-mode = ; }; + /* + * The initial design of this regulator was to use it as 3.3V, + * but due to later changes in design it was changed to 1.8V. + * The original name is kept due to same schematic. + */ + ts_avccio: vreg_l3c_3p0: ldo3 { - regulator-min-microvolt = <2800000>; - regulator-max-microvolt = <3540000>; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; regulator-initial-mode = ; }; From patchwork Tue Feb 7 02:48:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 53608 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2607089wrn; Mon, 6 Feb 2023 18:50:09 -0800 (PST) X-Google-Smtp-Source: AK7set8SxNqgYp0PSTf6v2iYxp6M0nRbSRvGUBo75dS47/VtPPjPG4DiTjQJ65o08IAZuZpkKC3Y X-Received: by 2002:aa7:94ad:0:b0:592:543e:85e0 with SMTP id a13-20020aa794ad000000b00592543e85e0mr1466237pfl.23.1675738209372; Mon, 06 Feb 2023 18:50:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675738209; cv=none; d=google.com; s=arc-20160816; b=rf7lM3EAwU9cLcvA4rWCb1i6gJgSC0KCMgQ2cd6wB8OfZg4R9rDwX2RkLXXadGujhp uymOHOwilhM56H3KYTJig54QHjGxNmtyQuSTMIabVcZIg5HcF0lasIceEs93qzp6gFVZ aM2v6nzJvy7/nCvWRqz0AYvrqv60TnGvxVzIe7k3sWCw1uhJ/5H6umXKpr9fIlsd9/D9 kOJ4m4+5PyAE32OhxgRi1EPbry4CAinOR7XsMQ/c3AJSL7hczux5r2Zf7MaJHVPs/f9T fv+wt44/7CSQ2pLPW/CU9I1v4xH7ht2g2XKjH+bQwxsbHUe+Dup7cIVUEAEZXMxQqwwP pI6g== 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 :dkim-signature; bh=sR7ruv35Qv2TJdi+hb5jSOiaV9SREkd+tD+3wSx+p6o=; b=04aTtUOXLp1qU/7XnFnfLIhsIF+Wh6iWl6ZZPQY2YQm4nIQW+/ZhpomJU/bGnfiljR xcTJmOZOWIPV0beKGRPyfl3Hv6z7cM1nwgtlYtNDhUZ+PBOZbjmb6iis+mMcmq/rSLWH aZb531sAzOZ5XjFMkB7C7e6uOlnjha5jm2gUAGLGtFbnsaXTx4m2T/7gQzZTm8pcdI76 4JBKaDuA3dcFVvwK83l2Eoy+GArYj/AavKOuUokVWMnxeE/o2DOLUuClKwFImA85ANIl RpPJmWQmWQ/SH8MoFpdnnIF5guLnFyx8KqBmWX+5PANtemGd1At+j3hbsU0bDltk11kr vYeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="I/dDS/7/"; 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=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a17-20020a621a11000000b00591b0cab4f0si14133104pfa.0.2023.02.06.18.49.56; Mon, 06 Feb 2023 18:50:09 -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; dkim=pass header.i=@chromium.org header.s=google header.b="I/dDS/7/"; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229879AbjBGCtO (ORCPT + 99 others); Mon, 6 Feb 2023 21:49:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229878AbjBGCtG (ORCPT ); Mon, 6 Feb 2023 21:49:06 -0500 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19F7736696 for ; Mon, 6 Feb 2023 18:48:49 -0800 (PST) Received: by mail-pj1-x102a.google.com with SMTP id f16-20020a17090a9b1000b0023058bbd7b2so12795104pjp.0 for ; Mon, 06 Feb 2023 18:48:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sR7ruv35Qv2TJdi+hb5jSOiaV9SREkd+tD+3wSx+p6o=; b=I/dDS/7/aq/F71hBSixMoQhmOnHuXMaj4Gu8pVRWSBCxP77H7aRnbunjchMAzDsu3H EK+oxIIDoDiFMjNzXc4aFvzy8BYeVkCpbanOwknlhoqlocl3kud9TOo7xSVpU8An8MO1 /OhgsooZYMUfIRWnZJZYprfyXICN5kGFzree8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sR7ruv35Qv2TJdi+hb5jSOiaV9SREkd+tD+3wSx+p6o=; b=Snvkryn/Tb7JC2f4Fg2njlUCi6hMEL1g4m0on5xNLt84eC8s+ndnCs6C0GaP917Bae +mfsbeCqwZMpG0fKgPTSySAqOWaKqrH/FaE9dEl3sLhvCXI65/HnYFtPSr/NOPkT/qxl BIca1NpcRu8zi17VhKEJnKA7uHhnE12ftAe4gBqTyC+UU46lGs+5Az5+HeNQ2Iro4v8X TCk8XFBbkveCxcR8o9ZcBAPYh0LKtPHWjJsejU/82ji1CiEzvMJnk+RNrVkfiJ28ti0O QKQO4dQMtwYdKVYrAbGD3duxNXKOoQY+Nx3/KKdG7X2ZgmE3MKIjas5adeog0GKHwRK9 gouA== X-Gm-Message-State: AO0yUKW/d0wZTy0zvZfI5L0lailwOWKa/G1LJ7jXo3em9lEqGPhAYr1L XlZHiUHgAL2lkQ8DL4ghSO0ZnQ== X-Received: by 2002:a05:6a21:3386:b0:be:bea0:7137 with SMTP id yy6-20020a056a21338600b000bebea07137mr2236057pzb.5.1675738129232; Mon, 06 Feb 2023 18:48:49 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:29fb:a635:f0df:f45a]) by smtp.gmail.com with ESMTPSA id s17-20020a63a311000000b0045dc85c4a5fsm6882430pge.44.2023.02.06.18.48.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Feb 2023 18:48:48 -0800 (PST) From: Douglas Anderson To: Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Jiri Kosina , Benjamin Tissoires Cc: linux-input@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dmitry Torokhov , devicetree@vger.kernel.org, Stephen Kitt , Konrad Dybcio , Douglas Anderson , Andy Gross , linux-kernel@vger.kernel.org Subject: [PATCH 2/7] arm64: dts: qcom: sc7280: Add 3ms ramp to herobrine's pp3300_left_in_mlb Date: Mon, 6 Feb 2023 18:48:11 -0800 Message-Id: <20230206184744.2.I13814cefc5ab3e0a39ebd09f052e3fd25d4e8f1d@changeid> X-Mailer: git-send-email 2.39.1.519.gcb327c4b5f-goog In-Reply-To: <20230207024816.525938-1-dianders@chromium.org> References: <20230207024816.525938-1-dianders@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1757138868767690117?= X-GMAIL-MSGID: =?utf-8?q?1757138868767690117?= The "pp3300_left_in_mlb" rail on herobrine eventually connects up to "vreg_edp_3p3" on the qcard. On several herobrine designs this rail has been measured to need more than 1ms to turn on. While technically a herobrine derivative (defined as anyone including the "herobrine.dtsi") could change the board to make the rail rise faster or slower, the fact that two boards (evoker and villager) both measured it as taking more than 1ms implies that it's probably going to be the norm. Thus, let's add a "regulator-enable-ramp-delay" straight into the herobrine.dtsi to handle this. If a particular derivative board needs a faster or slower one then they can override it, though that feels unlikely. While we measured something a bit over 1ms, we'll choose 3ms to give us a tiny bit of margin. This isn't a rail that turns off and on all the time anyway and 3ms is nothing compared to the total amount of time to power on a panel. Signed-off-by: Douglas Anderson Reviewed-by: Matthias Kaehlcke --- arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi b/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi index 27f479ff9d80..ded36b5d28c7 100644 --- a/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi @@ -108,6 +108,8 @@ pp3300_left_in_mlb: pp3300-left-in-mlb-regulator { pinctrl-names = "default"; pinctrl-0 = <&en_pp3300_dx_edp>; + regulator-enable-ramp-delay = <3000>; + vin-supply = <&pp3300_z1>; }; From patchwork Tue Feb 7 02:48:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 53609 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2607154wrn; Mon, 6 Feb 2023 18:50:19 -0800 (PST) X-Google-Smtp-Source: AK7set9Y5R5YKiOyKcUgg0Wd5u/Tho1b4yoV2xPPEMa+WYS9TzYTuDNvjYTEyMYXYtKt/aNLUxIc X-Received: by 2002:a62:158f:0:b0:593:a800:2abc with SMTP id 137-20020a62158f000000b00593a8002abcmr1593797pfv.8.1675738219364; Mon, 06 Feb 2023 18:50:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675738219; cv=none; d=google.com; s=arc-20160816; b=XsIDt4JAgMCLlqfi6edHVoWz3yb4LkHDlD/Q21S5k77tb2a2qX0qZwPdKy6r8rkW8P MccdLXx4E/MeaGRadut41JxeMVn/G8J+WVYMD4mvat4chKUfpfAR8Hsarh6Bqek5Sw3w huUwPY7pkAuaOiK73Hz3J3REUe9Sk0QU0BnN5uziY/37gufHZcoA2VI7Egt7diUq0y0H 2S28JWeGoShPNhkPjAgDDz7ji3wjIfOunaAVrTkD9xJ69pTe65aLJOPWVcngNUVP1o84 GdWl3FBM3N9XRzFezdDeTDO+Ix4K280jQ/FszNXp94QWPZu6R6rwkDSi2cO1OhOJiiO0 HIXw== 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 :dkim-signature; bh=sLp+h7RkE9BAbz0zHyr/CLuP3RxRPDj/C10VVagvrZo=; b=fQlZ/x3zeAIP596QnRIxMyHdj3tqH5o1HWwaJ65EXXJVy/bJmGPt3F1GSOF44yjvNt SpNJw8agFbHI/ern8ILd26G36Poe/r7CpKcfEeYaLCN6RppWp9zxwDfj17HO8A1sYGBM z6Ye7N7hVegPGNer/aHbT3VRlGbE7g4TBJzLijytMiGUg2XJ+aVGE5+d20uG8+1SCeqC XL6f9vZtfsEn4KX0EiwZNvCURBIVvE0kDvbRMjv2VLqPtuhG9MUrthaAGSKNrNz/l4ow ZTZFBraV1b6MvmiH+/ti5XhotQJcnzvdb2bo32WAE9mfD/geL4P8V9tn3KnlWVJfv7M8 DlXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Xi4CLe1Y; 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=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i127-20020a625485000000b00592db3b9fd3si14114522pfb.275.2023.02.06.18.50.05; Mon, 06 Feb 2023 18:50:19 -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; dkim=pass header.i=@chromium.org header.s=google header.b=Xi4CLe1Y; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230080AbjBGCtX (ORCPT + 99 others); Mon, 6 Feb 2023 21:49:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229970AbjBGCtO (ORCPT ); Mon, 6 Feb 2023 21:49:14 -0500 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 6966B367DA for ; Mon, 6 Feb 2023 18:48:51 -0800 (PST) Received: by mail-pj1-x1035.google.com with SMTP id bg10-20020a17090b0d8a00b00230c7f312d4so4044147pjb.3 for ; Mon, 06 Feb 2023 18:48:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sLp+h7RkE9BAbz0zHyr/CLuP3RxRPDj/C10VVagvrZo=; b=Xi4CLe1YUFGbQK9fHIDP7TOLa8HqqV10AofMQWhjvwuTAXDntSKh1G/0F0QlQVCzcc pEhIqIqhOmAdXm5aLGgYzXsLbW+CsNfBJpQt5WROcPEyPuuo7KN4Ys2FrBfQhEn2+/bE tham9kJH0m7c5ZHgU5I9beRFL9JBbZKhyMs5g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sLp+h7RkE9BAbz0zHyr/CLuP3RxRPDj/C10VVagvrZo=; b=buPfZHSO47BmXoJIaiVc5ihO5+R3VIAQmIKL9N6Uf9dU9+Ka4XkkySBSBHx7wTgk2q FQ5BS7gCYdzUIOYW5kGmCD6K//r1Nkv/p8hXWjwOD2LAaWMBmaRpZgjWpfF79kRpUvV7 bzcahlxYCz4CWaRNh7NFJjq7XqJKB5YlZ2E2Ifa4z+vi/oQjnZvTHXShw+hGeiYvE0PK oZZ3KfJEWvI72+syAtCPPxXqvnCLwAZ0M3Cc5FxfqPqiFR0z1B+1RWiEL6vMJ0u7eV6J 13Rk6mVlhnj0Ylu5nmqvKDq64xwsSR/2ickyjT1i0eVhJu8+0J7m6F8rTJOdzIlr9yq4 mgiw== X-Gm-Message-State: AO0yUKWBuoDpT1W+TZDIwdmJmHb61Z+0+Sb6G0CXHYa9zvMZU+9ME+Q+ QVkzWdz4R7TYGQ9JJABNvM9ksw== X-Received: by 2002:a05:6a20:4421:b0:b9:2705:4e46 with SMTP id ce33-20020a056a20442100b000b927054e46mr2102261pzb.22.1675738130907; Mon, 06 Feb 2023 18:48:50 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:29fb:a635:f0df:f45a]) by smtp.gmail.com with ESMTPSA id s17-20020a63a311000000b0045dc85c4a5fsm6882430pge.44.2023.02.06.18.48.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Feb 2023 18:48:50 -0800 (PST) From: Douglas Anderson To: Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Jiri Kosina , Benjamin Tissoires Cc: linux-input@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dmitry Torokhov , devicetree@vger.kernel.org, Stephen Kitt , Konrad Dybcio , Douglas Anderson , Andy Gross , linux-kernel@vger.kernel.org Subject: [PATCH 3/7] arm64: dts: qcom: sc7280: Hook up the touchscreen IO rail on villager Date: Mon, 6 Feb 2023 18:48:12 -0800 Message-Id: <20230206184744.3.I740d409bc5bb69bf4a7b3c4568ea6e7a92f16ccd@changeid> X-Mailer: git-send-email 2.39.1.519.gcb327c4b5f-goog In-Reply-To: <20230207024816.525938-1-dianders@chromium.org> References: <20230207024816.525938-1-dianders@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1757138879224611046?= X-GMAIL-MSGID: =?utf-8?q?1757138879224611046?= On never revs of sc7280-herobrine-villager (rev2+) the L3C rail is provided to the touchscreen as the IO voltage rail. Let's add it in the device tree. NOTE: Even though this is only really needed on rev2+ villagers (-rev0 had non-functioning touchscreen and -rev1 had some hacky hardware magic), it doesn't actually hurt to do this for old villager revs. As talked about in the patch ("arm64: dts: qcom: sc7280: On QCard, regulator L3C should be 1.8V") the L3C regulator didn't go anywhere at all on older revs. That means that turning it on for older revs doesn't hurt other than drawing a tiny bit of extra power. Since -rev0 and -rev1 villagers will never make it to real customers and it's nice not to have too many old device trees, the better tradeoff seems to be to enable it everywhere. Signed-off-by: Douglas Anderson Reviewed-by: Matthias Kaehlcke --- arch/arm64/boot/dts/qcom/sc7280-herobrine-villager.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine-villager.dtsi b/arch/arm64/boot/dts/qcom/sc7280-herobrine-villager.dtsi index 17553e0fd6fd..818d4046d2c7 100644 --- a/arch/arm64/boot/dts/qcom/sc7280-herobrine-villager.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280-herobrine-villager.dtsi @@ -55,6 +55,7 @@ ap_ts: touchscreen@10 { reset-gpios = <&tlmm 54 GPIO_ACTIVE_LOW>; vcc33-supply = <&ts_avdd>; + vccio-supply = <&ts_avccio>; }; }; From patchwork Tue Feb 7 02:48:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 53611 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2607805wrn; Mon, 6 Feb 2023 18:52:26 -0800 (PST) X-Google-Smtp-Source: AK7set8GuWQsDErwZcCBDWR5/w0VGgjaNCM+b7B5uDqiCdJPLaeI1mLKoZzKE/X8RhdV1hVOb6yk X-Received: by 2002:aa7:9aef:0:b0:592:7341:781f with SMTP id y15-20020aa79aef000000b005927341781fmr1580623pfp.31.1675738345854; Mon, 06 Feb 2023 18:52:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675738345; cv=none; d=google.com; s=arc-20160816; b=IeIEiRAiHhw9gIc+wQZMfr3xBXUQZBmqNCBRZ1BDykgtnOULV0LNAyX04xQYvpXQ90 UjVbs+/PbnZAg8fAFw1EHnzc/on7UXW6EWnlLjD8fsCCTsfIJB1C8vfQ4KXf4hdhh1HZ Wt6PBmxHrNGDVArRtRjvXgMPhH/QdekMb+3GK3EC9Kc6ZxDkEvEJsgkQ53AXtYXqYG4U DTlvoEj0cn/3lszB5Lwb5WSiysnh3ChGTrOS1nPMsVh60WygwRRKQveeValLQySY3z4g AfaezWzwKjKIW9KZzYQDxlzqj7YDmd/tV9DIhTy9J6TUz8hkSuOY7PJ5E+jUhWsxdVGd tO2g== 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 :dkim-signature; bh=O6jont/dbO+nORSLqiqDytFP+Uh0L7GWlhz+rxNBQKA=; b=O4gHIHPdW3Y9dYtd+AcENcDFGzUgpdyXWMz0stOItEZ4bnUB08rro86crHAAq43nMr ybWbE6DXFABUC2t0vCMLuiyEHR4NcQvLLth111mImTeCSuEvY/XpoimQxxrmLFTVu47i OeRDhn9V9INrsEhcaYSiHvPgAG+dciqVFnc7RHyzzpsgggbwRtDeNi7Yb+ZWylODW1rl vRC9oXZRLq+Jy2t3CdGmqOAdGzpQfo2Bix0y4zBf86PfyPTBfVG7DL5ThcpP1tiLMZAm 3NfBE8LqFezQQ6U28I0dSJryEw/2A+0lSHW4HaAVz0O6zXvYf+OGioKoLKJX54QZqpZH vHyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OSKhwTjy; 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=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c142-20020a624e94000000b005906f0abf4esi13687344pfb.174.2023.02.06.18.52.12; Mon, 06 Feb 2023 18:52:25 -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; dkim=pass header.i=@chromium.org header.s=google header.b=OSKhwTjy; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229601AbjBGCt1 (ORCPT + 99 others); Mon, 6 Feb 2023 21:49:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229994AbjBGCtT (ORCPT ); Mon, 6 Feb 2023 21:49:19 -0500 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50FB9367E5 for ; Mon, 6 Feb 2023 18:48:53 -0800 (PST) Received: by mail-pl1-x62c.google.com with SMTP id iy2so4121227plb.11 for ; Mon, 06 Feb 2023 18:48:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=O6jont/dbO+nORSLqiqDytFP+Uh0L7GWlhz+rxNBQKA=; b=OSKhwTjyDvJbE40sNuBp05ERbqh+IEDTPCezceFFAzQlrjXbOjDso+cWZKB2hZDMs8 TotVR4ZFs9a/wi+7QF2rcQmHqkvs/UVmKayP1YZzj7TfsumwRVieRiJKTTQMqixM/QXf BWgKA9UQF9Ea2+/QRkT11P5xrJ4s5hA+Yo934= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O6jont/dbO+nORSLqiqDytFP+Uh0L7GWlhz+rxNBQKA=; b=UXpGde004gVde8YBs6NgZBbWlIOoGohGcRrTrY0gVjb/7bmiRBhpfOJHq0AedOUFNf i6Dj08u6lRZvrRXcFIdV0ajqFZ3jx+KrFoqz2jCn2GuJVLtLABs3Hv3/exRWz/19k12I f7+wPKraTF85LR5B4JHPIHrmGrpBKqE4qRJkDjkAfxXAUaiZoV4usOF9RETu3aKZXpBy WU9jtU8T4BXlJ66u4lR7wICW1u8FuT9sl54ZE01Jif2hlyJgPahtz3ckZsl8a5dLiGRn YqrETz5UoUxxpM4LZuqyw0fpymZq3NzcavqFAx4kccFsyd9oPZmsmAoiwbDqlBlRE9Gv rBCg== X-Gm-Message-State: AO0yUKXa9nf5VDL0N1VRPRAuuZocpOgVJq6nwsvEhdzM++vL+E/cB64Q mRv1la9C4ctHLJ5sAXfWkJQo6A== X-Received: by 2002:a05:6a20:3550:b0:c0:df49:1382 with SMTP id f16-20020a056a20355000b000c0df491382mr1288195pze.48.1675738132541; Mon, 06 Feb 2023 18:48:52 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:29fb:a635:f0df:f45a]) by smtp.gmail.com with ESMTPSA id s17-20020a63a311000000b0045dc85c4a5fsm6882430pge.44.2023.02.06.18.48.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Feb 2023 18:48:52 -0800 (PST) From: Douglas Anderson To: Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Jiri Kosina , Benjamin Tissoires Cc: linux-input@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dmitry Torokhov , devicetree@vger.kernel.org, Stephen Kitt , Konrad Dybcio , Douglas Anderson , linux-kernel@vger.kernel.org Subject: [PATCH 4/7] HID: i2c-hid: goodix: Stop tying the reset line to the regulator Date: Mon, 6 Feb 2023 18:48:13 -0800 Message-Id: <20230206184744.4.I085b32b6140c7d1ac4e7e97b712bff9dd5962b62@changeid> X-Mailer: git-send-email 2.39.1.519.gcb327c4b5f-goog In-Reply-To: <20230207024816.525938-1-dianders@chromium.org> References: <20230207024816.525938-1-dianders@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1757139011460349027?= X-GMAIL-MSGID: =?utf-8?q?1757139011460349027?= In commit 18eeef46d359 ("HID: i2c-hid: goodix: Tie the reset line to true state of the regulator"), we started tying the reset line of Goodix touchscreens to the regulator. The primary motivation for that patch was some pre-production hardware (specifically sc7180-trogdor-homestar) where it was proposed to hook the touchscreen's main 3.3V power rail to an always-on supply. In such a case, when we turned "off" the touchscreen in Linux it was bad to assert the "reset" GPIO because that was causing a power drain. The patch accomplished that goal and did it in a general sort of way that didn't require special properties to be added in the device tree for homestar. It turns out that the design of using an always-on power rail for the touchscreen was rejected soon after the patch was written and long before sc7180-trogdor-homestar went into production. The final design of homestar actually fully separates the rail for the touchscreen and the display panel and both can be powered off and on. That means that the original motivation for the feature is gone. There are 3 other users of the goodix i2c-hid driver in mainline. I'll first talk about 2 of the other users in mainline: coachz and mrbland. On both coachz and mrbland the touchscreen power and panel power _are_ shared. That means that the patch to tie the reset line to the true state of the regulator _is_ doing something on those boards. Specifically, the patch reduced power consumption by tens of mA in the case where we turned the touchscreen off but left the panel on. Other than saving a small bit of power, the patch wasn't truly necessary. That being said, even though a small bit of power was saved in the state of "panel on + touchscreen off", that's not actually a state we ever expect to be in, except perhaps for very short periods of time at boot or during suspend/resume. Thus, the patch is truly not necessary. It should be further noted that, as documented in the original patch, the current code still didn't optimize power for every corner case of the "shared rail" situation. The last user in mainline was very recently added: evoker. Evoker is actually the motivation for me removing this bit of code. It turns out that for evoker we need to manage a second power rail for IO to the touchscreen. Trying to fit the management of this IO rail into the regulator notifiers turns out to be extremely hard. To avoid lockdep splats you shouldn't enable/disable other regulators in regulator notifiers and trying to find a way around this was going to be fairly difficult. Given the lack of any true motivation to tie the reset line to the regulator, lets go back to the simpler days and remove the code. This is, effectively, a revert of commit bdbc65eb77ee ("HID: i2c-hid: goodix: Fix a lockdep splat"), commit 25ddd7cfc582 ("HID: i2c-hid: goodix: Use the devm variant of regulator_register_notifier()"), and commit 18eeef46d359 ("HID: i2c-hid: goodix: Tie the reset line to true state of the regulator"). Signed-off-by: Douglas Anderson Reviewed-by: Dmitry Torokhov Reviewed-by: Matthias Kaehlcke --- drivers/hid/i2c-hid/i2c-hid-of-goodix.c | 88 ++++--------------------- 1 file changed, 13 insertions(+), 75 deletions(-) diff --git a/drivers/hid/i2c-hid/i2c-hid-of-goodix.c b/drivers/hid/i2c-hid/i2c-hid-of-goodix.c index 29c6cb174032..584d833dc0aa 100644 --- a/drivers/hid/i2c-hid/i2c-hid-of-goodix.c +++ b/drivers/hid/i2c-hid/i2c-hid-of-goodix.c @@ -26,28 +26,28 @@ struct i2c_hid_of_goodix { struct i2chid_ops ops; struct regulator *vdd; - struct notifier_block nb; struct gpio_desc *reset_gpio; const struct goodix_i2c_hid_timing_data *timings; }; -static void goodix_i2c_hid_deassert_reset(struct i2c_hid_of_goodix *ihid_goodix, - bool regulator_just_turned_on) +static int goodix_i2c_hid_power_up(struct i2chid_ops *ops) { - if (regulator_just_turned_on && ihid_goodix->timings->post_power_delay_ms) + struct i2c_hid_of_goodix *ihid_goodix = + container_of(ops, struct i2c_hid_of_goodix, ops); + int ret; + + ret = regulator_enable(ihid_goodix->vdd); + if (ret) + return ret; + + if (ihid_goodix->timings->post_power_delay_ms) msleep(ihid_goodix->timings->post_power_delay_ms); gpiod_set_value_cansleep(ihid_goodix->reset_gpio, 0); if (ihid_goodix->timings->post_gpio_reset_delay_ms) msleep(ihid_goodix->timings->post_gpio_reset_delay_ms); -} - -static int goodix_i2c_hid_power_up(struct i2chid_ops *ops) -{ - struct i2c_hid_of_goodix *ihid_goodix = - container_of(ops, struct i2c_hid_of_goodix, ops); - return regulator_enable(ihid_goodix->vdd); + return 0; } static void goodix_i2c_hid_power_down(struct i2chid_ops *ops) @@ -55,42 +55,14 @@ static void goodix_i2c_hid_power_down(struct i2chid_ops *ops) struct i2c_hid_of_goodix *ihid_goodix = container_of(ops, struct i2c_hid_of_goodix, ops); + gpiod_set_value_cansleep(ihid_goodix->reset_gpio, 1); regulator_disable(ihid_goodix->vdd); } -static int ihid_goodix_vdd_notify(struct notifier_block *nb, - unsigned long event, - void *ignored) -{ - struct i2c_hid_of_goodix *ihid_goodix = - container_of(nb, struct i2c_hid_of_goodix, nb); - int ret = NOTIFY_OK; - - switch (event) { - case REGULATOR_EVENT_PRE_DISABLE: - gpiod_set_value_cansleep(ihid_goodix->reset_gpio, 1); - break; - - case REGULATOR_EVENT_ENABLE: - goodix_i2c_hid_deassert_reset(ihid_goodix, true); - break; - - case REGULATOR_EVENT_ABORT_DISABLE: - goodix_i2c_hid_deassert_reset(ihid_goodix, false); - break; - - default: - ret = NOTIFY_DONE; - break; - } - - return ret; -} - static int i2c_hid_of_goodix_probe(struct i2c_client *client) { struct i2c_hid_of_goodix *ihid_goodix; - int ret; + ihid_goodix = devm_kzalloc(&client->dev, sizeof(*ihid_goodix), GFP_KERNEL); if (!ihid_goodix) @@ -111,40 +83,6 @@ static int i2c_hid_of_goodix_probe(struct i2c_client *client) ihid_goodix->timings = device_get_match_data(&client->dev); - /* - * We need to control the "reset" line in lockstep with the regulator - * actually turning on an off instead of just when we make the request. - * This matters if the regulator is shared with another consumer. - * - If the regulator is off then we must assert reset. The reset - * line is active low and on some boards it could cause a current - * leak if left high. - * - If the regulator is on then we don't want reset asserted for very - * long. Holding the controller in reset apparently draws extra - * power. - */ - ihid_goodix->nb.notifier_call = ihid_goodix_vdd_notify; - ret = devm_regulator_register_notifier(ihid_goodix->vdd, &ihid_goodix->nb); - if (ret) - return dev_err_probe(&client->dev, ret, - "regulator notifier request failed\n"); - - /* - * If someone else is holding the regulator on (or the regulator is - * an always-on one) we might never be told to deassert reset. Do it - * now... and temporarily bump the regulator reference count just to - * make sure it is impossible for this to race with our own notifier! - * We also assume that someone else might have _just barely_ turned - * the regulator on so we'll do the full "post_power_delay" just in - * case. - */ - if (ihid_goodix->reset_gpio && regulator_is_enabled(ihid_goodix->vdd)) { - ret = regulator_enable(ihid_goodix->vdd); - if (ret) - return ret; - goodix_i2c_hid_deassert_reset(ihid_goodix, true); - regulator_disable(ihid_goodix->vdd); - } - return i2c_hid_core_probe(client, &ihid_goodix->ops, 0x0001, 0); } From patchwork Tue Feb 7 02:48:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 53612 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2607978wrn; Mon, 6 Feb 2023 18:53:00 -0800 (PST) X-Google-Smtp-Source: AK7set8q0y5QX9E2125XADYClInLutxtf4i63yX40mTRy/onB/vXKZmKrf2T6cM6mnPtogV1QkT4 X-Received: by 2002:a05:6a20:8426:b0:be:b137:9d1c with SMTP id c38-20020a056a20842600b000beb1379d1cmr2075402pzd.37.1675738380202; Mon, 06 Feb 2023 18:53:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675738380; cv=none; d=google.com; s=arc-20160816; b=heFFdORCmr4+PQH7EqaWuBt0S+UNDDwjGrDJ6dk+GeRF6nX3CQRvFJlCM1hiRYZo6x UdDcEt6sR9SM51Vy82LAxmYp48tz8vIqosSywmnYjWrDQRS4oJY43/2dEvUXYVqXYJBy d6G3xLpq6BQ1XUI6q2tBpnfHC4VwROJzKhDGM+7f6+6SSFfXxvMqejLaPSLojFD6SYDk 6v2BelEcGxenAfoUieMaPiPo0FfUR6NRadbOqHW3kxzFcEx51WQ35sgwb2YBXyKN+kyq 7D9GDUjTSXMnRrlUzsmyd/5fi0s3LPKQwfFOdzjF+qnlMaCxH2GBq+vrFndbHMMwCLZ4 5J2g== 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 :dkim-signature; bh=oAnZqwf1tmgF/Ssjms0XjO2WrbdQH0082JXWCubZ7GA=; b=Z5A12qFV0MKuAzOX3BZnv1weHgGxkPEeDuic/h+Qv37J5r3RWczflutdmFGxbMVoQ5 YD+hwYuUm1FOIrYfP5+Z8BCosKc7kGvX9P1HewjcTY0iQoTb9fFHjTnFOiUi0EWhCHSS 47sxHuyIhwYVtztEiANyLwalWoBustsoc5xPIey197FkldNcFgFxLJowk+q2M5HAOea7 VaC7zr52ebvN+SQSt4Kdt1txzwPUaRjT67zm1Phb9XBCu+lelkPlnMnGvX4yKaPsGUQa bQM/+KgyIzU1+ByIxE9GdsiPgK1DFlZwQwzySJzIdPYAwqkhWX9Fb4mhtja7zgxrptZ4 Cp9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gwnCBpHC; 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=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o5-20020a656a45000000b004f1ee7825fesi17352234pgu.469.2023.02.06.18.52.47; Mon, 06 Feb 2023 18:53:00 -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; dkim=pass header.i=@chromium.org header.s=google header.b=gwnCBpHC; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230136AbjBGCta (ORCPT + 99 others); Mon, 6 Feb 2023 21:49:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230041AbjBGCtW (ORCPT ); Mon, 6 Feb 2023 21:49:22 -0500 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3E80366A7 for ; Mon, 6 Feb 2023 18:48:54 -0800 (PST) Received: by mail-pl1-x632.google.com with SMTP id h15so6890036plk.12 for ; Mon, 06 Feb 2023 18:48:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oAnZqwf1tmgF/Ssjms0XjO2WrbdQH0082JXWCubZ7GA=; b=gwnCBpHCBDwOtQoT/Xv+4JH01cTWKaRzALTEjRtfr/lkLw+nV9Aokjd5EWM9AiBqh/ bZPfhy8IBVPjNhXUESF6U1wHXte5oBSZSEINYQsMNiQ9dXYhNOSITiYhh4R0QfVMbH8z htR46L+KtpRlEwzuJAaidtqQxrmPHBtQxTy5A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oAnZqwf1tmgF/Ssjms0XjO2WrbdQH0082JXWCubZ7GA=; b=DljWNqiVpNmdaURD1rUcowRsn5fmPuTfvN3wlb5RNmgpJVi9/FxmZ1InAnR8B+EDlp R6LmqN4zkeI/aVHjAGxQLzf3/X6AMsp/VU6haCfs6mGnFsuztcVzsE1JvPr11NfjqGeT MQdH3dzzt7MNl5cCavXDGWCULgHGVCOidkMndMBAvAmA6Thv5Cyo7l9n2+Sx6QdQl9ce orReYm6k3q0voTqcy7jQFBJ09cr0XeoLrZf3N9goMvewByGV8UkZ0ixcufLqS3b3MK/n G0s1GbDa4CjxrDmlciPcaFYcCXSR1SD1kxHXnqJ4jGswjOn6mOr75/7+yxbVDA/2ESV6 3xug== X-Gm-Message-State: AO0yUKWkSPVJmAg3GTVX9G2zmFBt7xaJz+Nkob4U3ASbSTMaa7/r0bHx Y5O4wnMiIMMO/rE84730usVjZw== X-Received: by 2002:a05:6a20:a5a8:b0:bc:e82a:5c73 with SMTP id bc40-20020a056a20a5a800b000bce82a5c73mr1580561pzb.9.1675738134171; Mon, 06 Feb 2023 18:48:54 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:29fb:a635:f0df:f45a]) by smtp.gmail.com with ESMTPSA id s17-20020a63a311000000b0045dc85c4a5fsm6882430pge.44.2023.02.06.18.48.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Feb 2023 18:48:53 -0800 (PST) From: Douglas Anderson To: Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Jiri Kosina , Benjamin Tissoires Cc: linux-input@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dmitry Torokhov , devicetree@vger.kernel.org, Stephen Kitt , Konrad Dybcio , Douglas Anderson , linux-kernel@vger.kernel.org Subject: [PATCH 5/7] dt-bindings: HID: i2c-hid: goodix: Add mainboard-vddio-supply Date: Mon, 6 Feb 2023 18:48:14 -0800 Message-Id: <20230206184744.5.Ia77a96c6c5564f9cc25e6220b5a9171d5c2639e8@changeid> X-Mailer: git-send-email 2.39.1.519.gcb327c4b5f-goog In-Reply-To: <20230207024816.525938-1-dianders@chromium.org> References: <20230207024816.525938-1-dianders@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1757139047504956478?= X-GMAIL-MSGID: =?utf-8?q?1757139047504956478?= The goodix i2c-hid bindings currently support two models of touchscreen: GT7375P and GT7986U. The datasheets of both touchscreens show the following things: * The mainboard that the touchscreen is connected to is only expected to supply one voltage to the touchscreen: 3.3V. * The touchscreen, depending on stuffing options, can accept IO to the touchscreen as either 3.3V or 1.8V. Presumably this means that the touchscreen has its own way internally to make or deal with 1.8V signals when it's configured for 1.8V IO. NOTE: you've got to look very carefully at the datasheet for the touchscreen to see that the above bullets are true. Specifically, the datasheet shows a signal called VDDIO and one might think that this is where a mainboard would provide VDDIO to the touchscreen. Upon closer inspection, however, a footnote can be found that says "When VDDIO is left floating, the logic level is 1.8V [...]; when VDDIO is connected to AVDD, the logic level is AVDD.". Thus the VDDIO pin on the touchscreen IC is actually a selector and not a pin whre the mainboard would pass a reference voltage. The fact that the touchscreen isn't supplied 1.8V by the mainboard means that when I originally submitted bindings for these touchscreens I only listed the 3.3V rail in the bindings. It can be noted that the original bindings and driver were added for sc7180-trogdor boards and these boards all use 3.3V IO via a level shifter on the mainboard. It turns out that with sc7280-herobrine-evoker, we've got a bit of a strange monkey on our hands. Due to some very interesting but (unfortunately) set-in-stone hardware design, we are doing 1.8V IO to the touchscreen but we _also_ have some extra buffers on the mainboard that need to be powered up to make the IO lines work. After much pondering about this, it seems like the best way to handle this is to add an optional "mainboard-vddio" rail to the bindings that is used to power up the buffers. Specifically, the fact that the touchscreen datasheet documents that its IOs can be at a different voltage level than its main power rail means that there truly are two voltage rails associated with the touchscreen, even if we don't actually provide the IO rail to it. Thus it doesn't feel absurd for the DT node on the host to have a 1.8V rail to power up anything related to its 1.8V logic. Signed-off-by: Douglas Anderson Reviewed-by: Dmitry Torokhov Acked-by: Rob Herring --- .../devicetree/bindings/input/goodix,gt7375p.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/input/goodix,gt7375p.yaml b/Documentation/devicetree/bindings/input/goodix,gt7375p.yaml index 1c191bc5a178..ce18d7dadae2 100644 --- a/Documentation/devicetree/bindings/input/goodix,gt7375p.yaml +++ b/Documentation/devicetree/bindings/input/goodix,gt7375p.yaml @@ -36,6 +36,13 @@ properties: vdd-supply: description: The 3.3V supply to the touchscreen. + mainboard-vddio-supply: + description: + The supply on the main board needed to power up IO signals going + to the touchscreen. This supply need not go to the touchscreen + itself as long as it allows the main board to make signals compatible + with what the touchscreen is expecting for its IO rails. + required: - compatible - reg From patchwork Tue Feb 7 02:48:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 53614 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2608165wrn; Mon, 6 Feb 2023 18:53:31 -0800 (PST) X-Google-Smtp-Source: AK7set8+P+sMePW/3hr7QlduI2DzGoTTqiHczw9OPQbmlxsrs3djgRYm/GU4lxOZqiXy0SCX30Fo X-Received: by 2002:a17:90a:5d14:b0:229:4dcd:ff61 with SMTP id s20-20020a17090a5d1400b002294dcdff61mr2041620pji.28.1675738410839; Mon, 06 Feb 2023 18:53:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675738410; cv=none; d=google.com; s=arc-20160816; b=S5X4hGgvBPKKw+8AuKXyZyRnKfyzV1IqIfGa7ThFDNYHpGylYtPVieajKUmvTTWAd9 zF0/hZCx/yX7OqRPJzXsjKJGpilgnjxaRWoDImFCtSyprcFU5lbyTdvsNMsETrpf2Mqz mWabmgMlGaVJ2kYZ7EsE75cebr+elLt3+a9YtdyWdg4ajfo4UIKCWf98KXtN4LGL5eY0 iyIxNHNDV6fUZdF6OjlydqpLo+y3cwU47lCPjYtpNf1hX2SarsfarcOtjVSA21YybwlO AMM+FezuDRij/KzI1pbinpcPSdTKgM5j1IuvpfKFcy3cHQMZJEwXRn0Ph1nNmnrFllsn QMqA== 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 :dkim-signature; bh=mHOxy0yjbuzT3CsBPRlqzRmrlyQ1Ah6MquxggTwVj5Y=; b=hd0tK3/HVvs+rCCYLJHuoCGZg7pJXUAKJ6sY1n+hWgJfYN+NJZJs4nkO4QTJOQJzYV fa1gA//FQx146NE+sXjgXWyjLQ1AOwW5KXakzUn5r+hHkTYscvA2/37T8l72csCCq3g8 keiGGN8aO3mnv5F4wqFvVzuWm+Wzio53xKzmi7zpEyfAGaP31ONE21gvmFlP5sQiTiKY RnI10WztbZltGbLO2iA8ahMK++wpoEaG+fubPFpJ48uGz0pw0vbEBN5OQ1mbtfOGW1vS Sp619C4oyUdoghRbJtiMFB5TebPlsGF7xzfqF5+Kye8vZ/FJ6BJFpP0abm8uuJEBa53i mfVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=a5aCRZAF; 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=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mn22-20020a17090b189600b00215dedefc32si13642204pjb.163.2023.02.06.18.53.18; Mon, 06 Feb 2023 18:53:30 -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; dkim=pass header.i=@chromium.org header.s=google header.b=a5aCRZAF; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230173AbjBGCtf (ORCPT + 99 others); Mon, 6 Feb 2023 21:49:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230093AbjBGCtY (ORCPT ); Mon, 6 Feb 2023 21:49:24 -0500 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50EC134C15 for ; Mon, 6 Feb 2023 18:48:56 -0800 (PST) Received: by mail-pl1-x636.google.com with SMTP id h15so6890089plk.12 for ; Mon, 06 Feb 2023 18:48:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mHOxy0yjbuzT3CsBPRlqzRmrlyQ1Ah6MquxggTwVj5Y=; b=a5aCRZAFkj1OvRq3aqzQYp5C/iomdSqyPvH0qs3MIsi9GhYOKB1JCv8ovy4qRDbgFV PGEk4cw3cimKms0el816jGpQXBeI6qKZVKnPCX5ZatMXnvu9gpulLU3CUulpZZE8fwPd Yr1iSkY2FUYdtvnLvlTM1qr4Al/kx3d7Nj2z0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mHOxy0yjbuzT3CsBPRlqzRmrlyQ1Ah6MquxggTwVj5Y=; b=Mz2iAklQ2YCTGwcDmHCHiAb9K3Ey7kqCBNnoYI4rdG8daM4hSfkAKk3jhBc3CmJB10 APYCiKhbUAAHOity0UTVb3AZdowtjuNCgyw2pMj0Ba9ZUBTf6O9YBLrwaVVIbHbZvAeE dPGBrGOPUpAUm7H71HEyG6xplMYYagSm5X5gG36UcKEr9xSmyLx3ElhKWQ3f5CjbdAWH TS3UxMFR6xLhoF4OYWzdxGwMco7AaLTZeVimv6IyUBkIr551GFYw/bnSffQAYYXITHIz PBZFnQR6m7JA+RqQ4TbZsWE8n0odr9bX+BPB7inTzUDnTtyU5CDPzb36OKiB8TIC4dXd X0/A== X-Gm-Message-State: AO0yUKV/9hCjQ3t/9kcmfgoRWrfIUzvOdh623yJRpzyWytCIbSngGEc3 BcyDC5Y7gpANS/m/eWmfdatk8rNn8IlX/9Eg X-Received: by 2002:a17:902:dac6:b0:196:59a0:bffe with SMTP id q6-20020a170902dac600b0019659a0bffemr1485572plx.17.1675738135842; Mon, 06 Feb 2023 18:48:55 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:29fb:a635:f0df:f45a]) by smtp.gmail.com with ESMTPSA id s17-20020a63a311000000b0045dc85c4a5fsm6882430pge.44.2023.02.06.18.48.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Feb 2023 18:48:55 -0800 (PST) From: Douglas Anderson To: Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Jiri Kosina , Benjamin Tissoires Cc: linux-input@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dmitry Torokhov , devicetree@vger.kernel.org, Stephen Kitt , Konrad Dybcio , Douglas Anderson , linux-kernel@vger.kernel.org Subject: [PATCH 6/7] HID: i2c-hid: goodix: Add mainboard-vddio-supply Date: Mon, 6 Feb 2023 18:48:15 -0800 Message-Id: <20230206184744.6.Ic234b931025d1f920ce9e06fff294643943a65ad@changeid> X-Mailer: git-send-email 2.39.1.519.gcb327c4b5f-goog In-Reply-To: <20230207024816.525938-1-dianders@chromium.org> References: <20230207024816.525938-1-dianders@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757139079574670909?= X-GMAIL-MSGID: =?utf-8?q?1757139079574670909?= As talked about in the patch ("dt-bindings: HID: i2c-hid: goodix: Add mainboard-vddio-supply") we may need to power up a 1.8V rail on the host associated with touchscreen IO. Let's add support in the driver for it. Signed-off-by: Douglas Anderson Reviewed-by: Dmitry Torokhov Reviewed-by: Matthias Kaehlcke --- Unfortunately, I haven't been able to actually test this on real hardware yet. However, the change is very simple, I believe it is correct, and it doesn't break other boards I've tested it on. drivers/hid/i2c-hid/i2c-hid-of-goodix.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/hid/i2c-hid/i2c-hid-of-goodix.c b/drivers/hid/i2c-hid/i2c-hid-of-goodix.c index 584d833dc0aa..0060e3dcd775 100644 --- a/drivers/hid/i2c-hid/i2c-hid-of-goodix.c +++ b/drivers/hid/i2c-hid/i2c-hid-of-goodix.c @@ -26,6 +26,7 @@ struct i2c_hid_of_goodix { struct i2chid_ops ops; struct regulator *vdd; + struct regulator *vddio; struct gpio_desc *reset_gpio; const struct goodix_i2c_hid_timing_data *timings; }; @@ -40,6 +41,10 @@ static int goodix_i2c_hid_power_up(struct i2chid_ops *ops) if (ret) return ret; + ret = regulator_enable(ihid_goodix->vddio); + if (ret) + return ret; + if (ihid_goodix->timings->post_power_delay_ms) msleep(ihid_goodix->timings->post_power_delay_ms); @@ -56,6 +61,7 @@ static void goodix_i2c_hid_power_down(struct i2chid_ops *ops) container_of(ops, struct i2c_hid_of_goodix, ops); gpiod_set_value_cansleep(ihid_goodix->reset_gpio, 1); + regulator_disable(ihid_goodix->vddio); regulator_disable(ihid_goodix->vdd); } @@ -81,6 +87,10 @@ static int i2c_hid_of_goodix_probe(struct i2c_client *client) if (IS_ERR(ihid_goodix->vdd)) return PTR_ERR(ihid_goodix->vdd); + ihid_goodix->vddio = devm_regulator_get(&client->dev, "mainboard-vddio"); + if (IS_ERR(ihid_goodix->vddio)) + return PTR_ERR(ihid_goodix->vddio); + ihid_goodix->timings = device_get_match_data(&client->dev); return i2c_hid_core_probe(client, &ihid_goodix->ops, 0x0001, 0); From patchwork Tue Feb 7 02:48:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 53613 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2608149wrn; Mon, 6 Feb 2023 18:53:28 -0800 (PST) X-Google-Smtp-Source: AK7set+EY5LaBpLRW90DrL3dp+7qtiAZByWF3NrUTG/DJO6MVKWnwblKBzwY98LFcrSyQKay9TJ0 X-Received: by 2002:a05:6a20:12cc:b0:be:c80b:a8c3 with SMTP id v12-20020a056a2012cc00b000bec80ba8c3mr1928572pzg.42.1675738407853; Mon, 06 Feb 2023 18:53:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675738407; cv=none; d=google.com; s=arc-20160816; b=NQIK6qRQ++NlVqyeKj8esCi5OcSD0R+Xht6Qvzhl7OA7EFM+lH6oTY8DXztQaMKrxS UWp3+WvxnajPWBescDbeeLGTcAXqg4z09nO+U76LQFcnQxkt7hKJ57N7j/IjmjLZJg1n Gb2uLpjWRuYZiwv3Ge/AJOjIWu5l4UUko0uHCUToDqsxfv2VXveRryGU8HMgP6xwMsnp I/+vsTJXQ16NYT/C26VoYb5vNdDtubEUannCR20toWlZH0N8testAntivHL0+Tq3NdQu 45KwjAQjPjbMpd5L6ATt6rqGIQ3R3bqIjvvsbtyco61QgeGo4a6xqMe8MBeemr12w5aD 90dA== 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 :dkim-signature; bh=IHoW6eYbAc4fXAYhlPFT1Ci+6Xw0RaXHqNRq/Iskxrc=; b=dfiuwaEgqiuErk8kmmCuTHUVxJcZy+KYQkilEygjEx3knx37O5O8eQKhR/MhxwV5KD G2FTwb8EeTvSSA2QtopgqNH47ogdmkFYa+I0F6utEeLvai1HelSeIK3odjStBqAedjKP T5VGn/RBYaAxgB3bGrgP8wBFzG41DwK2sLhQSkNOjUVbgvjKy2grTYk4fM/npDFtkC7I VzOtg1GgLTLdVjDWfzV2fOjFWmKxfwx0nNZLrzO4UP+z7gzXozFCKp91FnGfUPa9FFAk EC56ShG34mkAYiJjPdhdVvW0YIsumL4w++NRR0eGfR8DqD6vOtQ1zPN0rOVqeF9jgh3b Hfjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=kT7BMzYX; 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=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o10-20020a63a80a000000b004b1e9a32931si13253678pgf.595.2023.02.06.18.53.15; Mon, 06 Feb 2023 18:53:27 -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; dkim=pass header.i=@chromium.org header.s=google header.b=kT7BMzYX; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229923AbjBGCtj (ORCPT + 99 others); Mon, 6 Feb 2023 21:49:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230106AbjBGCtY (ORCPT ); Mon, 6 Feb 2023 21:49:24 -0500 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 194E7303C6 for ; Mon, 6 Feb 2023 18:48:58 -0800 (PST) Received: by mail-pj1-x1036.google.com with SMTP id v6-20020a17090ad58600b00229eec90a7fso588857pju.0 for ; Mon, 06 Feb 2023 18:48:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IHoW6eYbAc4fXAYhlPFT1Ci+6Xw0RaXHqNRq/Iskxrc=; b=kT7BMzYXud6r+jZSY+nLPRfwUgsmnKvXesh1AVQcFAPTBzPv/4nhg7vAPr5s+pVHkd 1WEt3k0CjvfXwHJbSCzgtIGYtq2rEYzWkm6msNnbMvWJb2d5+bNQo+fF6h9M8lPp6zyF bgSiWjx6zCR/Boregwm3PEK4q2RR76aHTIZYc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IHoW6eYbAc4fXAYhlPFT1Ci+6Xw0RaXHqNRq/Iskxrc=; b=iX+Kx4V8dev5TV6+aJCADt1e78zl+W0SOPl0jufjh5tSMSswA2eYtx2sSw7jBRiqKb 5GGHXW4yPepN2Bcpyz7lx/KafbRKboZhcRe7cOIXeAsHbochzEQaw+GxBn6z8Jqcjyse c2k68m6JpsybIL7vNiWrJuRIhrMKgjB5r6iejFgk3BIvCtuHxJha8Fd4XywR3KU0kS2c 6SBMQBRRKIvA3pnFNSfz6NhFY+wKbS+fHFXpKe7qZ38iwIEfxPAqu/TVuslsc9SQvtZd Ot5CuwUEWz5e6/bVQClz6RQSF/nyjWg6CtHgGSnq1bZ6sBDzSc+zGTOTRe83bHsv0lwq GDMw== X-Gm-Message-State: AO0yUKUy3kjE/RUnt2BACQ4V8gsRr/JHl1mtC0a6mUd9ZDA1rkoN4gNh E4HxbnwT7iWBRoAX2PnabBk9MA== X-Received: by 2002:a17:903:1cc:b0:192:5282:6833 with SMTP id e12-20020a17090301cc00b0019252826833mr1495566plh.29.1675738137588; Mon, 06 Feb 2023 18:48:57 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:29fb:a635:f0df:f45a]) by smtp.gmail.com with ESMTPSA id s17-20020a63a311000000b0045dc85c4a5fsm6882430pge.44.2023.02.06.18.48.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Feb 2023 18:48:57 -0800 (PST) From: Douglas Anderson To: Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Jiri Kosina , Benjamin Tissoires Cc: linux-input@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dmitry Torokhov , devicetree@vger.kernel.org, Stephen Kitt , Konrad Dybcio , Douglas Anderson , Andy Gross , linux-kernel@vger.kernel.org Subject: [PATCH 7/7] arm64: dts: qcom: sc7280: Hook up the touchscreen IO rail on evoker Date: Mon, 6 Feb 2023 18:48:16 -0800 Message-Id: <20230206184744.7.I2d960ed7f2445db0cf3d227fde985fbd740f3c4d@changeid> X-Mailer: git-send-email 2.39.1.519.gcb327c4b5f-goog In-Reply-To: <20230207024816.525938-1-dianders@chromium.org> References: <20230207024816.525938-1-dianders@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1757139076654500098?= X-GMAIL-MSGID: =?utf-8?q?1757139076654500098?= On older revisions of evoker, the touchscreen was either non-functional or needed special hardware magic to get it talking properly. It's been decided that the proper way going forward is to use L3C to power some buffers on the QCard and then configure the touchscreens for 1.8V. Let's do that. Note that this is safe to do even on older revs even if it might not make the touchscreen work there (because they didn't have a properly stuffed QCard). As talked about in the patch ("arm64: dts: qcom: sc7280: On QCard, regulator L3C should be 1.8V") the L3C regulator didn't go anywhere at all on older revs. This patch relies on the patch ("HID: i2c-hid: goodix: Add mainboard-vddio-supply") in order to function properly. Without that patch this one won't do any harm but it won't actually accomplish its goal. Signed-off-by: Douglas Anderson Reviewed-by: Matthias Kaehlcke --- I haven't yet received real hardware to test this on, but it's a very simple patch and, in the very least, highly unlikely to make anything worse. No real users have these boards yet. arch/arm64/boot/dts/qcom/sc7280-herobrine-evoker.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine-evoker.dtsi b/arch/arm64/boot/dts/qcom/sc7280-herobrine-evoker.dtsi index 3d639c70a06e..0add7a2a099c 100644 --- a/arch/arm64/boot/dts/qcom/sc7280-herobrine-evoker.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280-herobrine-evoker.dtsi @@ -55,6 +55,7 @@ ap_ts: touchscreen@5d { reset-gpios = <&tlmm 54 GPIO_ACTIVE_LOW>; vdd-supply = <&ts_avdd>; + mainboard-vddio-supply = <&ts_avccio>; }; };