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: 13130902 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC58BC64EC4 for ; Tue, 7 Feb 2023 02:49:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229850AbjBGCtF (ORCPT ); Mon, 6 Feb 2023 21:49:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229882AbjBGCs7 (ORCPT ); Mon, 6 Feb 2023 21:48:59 -0500 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 143CA366AB for ; Mon, 6 Feb 2023 18:48:48 -0800 (PST) Received: by mail-pj1-x102e.google.com with SMTP id bx22so10674738pjb.3 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=NTcVE/dM5MCLa1fcQoeKo7laG7HrFQRMUazVa/1as14hjGX4hJpTsTTXC8nA3wJWIx MHq3jDYJv0Kk46Mk3gwmzPW/NuenasHZiZTucy7yivKK+b2g05cZHIJwNlMWiATdVgBt hWE3aSXGCV5zpl75EMRoBM8Vw4ySonSCr1//zXMfcBOAN0U2RMpoUNWjSJ5srDh1nqMe tE6TmyRFUf1MDRy4Wqi3r0XZsLFXgsolMF9u/4shjqtMKYpA3d/pkEMFhpTtZ2+C0WY9 xV1HeFErH3M4GWU7XZbZOSBUyPTVJtTzhWoliQ0Yxh5f/bcZiW6FlnLKYe6kWj9s31CN +NIw== X-Gm-Message-State: AO0yUKWmzn+3DibkW5fxHfyW1s/Z7C98rlIv29lbToLf59+GpdTP2H7m aqZjdfZFg756Vw+sW0oArozpDg== X-Google-Smtp-Source: AK7set8PakDpMdNYhbsDvMwLSodhrID1iJMRgN8+eGZpebp8JNWDDM9jPhQCsAOeKLomtmsV1bF78w== 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 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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: 13130903 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C934C05027 for ; Tue, 7 Feb 2023 02:49:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229890AbjBGCtN (ORCPT ); Mon, 6 Feb 2023 21:49:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229882AbjBGCtG (ORCPT ); Mon, 6 Feb 2023 21:49:06 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33733366B5 for ; Mon, 6 Feb 2023 18:48:49 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id f15-20020a17090ac28f00b00230a32f0c9eso5887105pjt.4 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=bg+WobbvQe6HQ7AAzSxa5BCtLFwrc3Gs7d/w2XlC2M0xf7tZ9IlXTo0sJNwqkG9ixC w/4bn0QIsV2yE1/48gOBXDC78nuBBPk4W+VY5fs8ViUNiRY6VQs4SFQD5eZ+4rHqfJ47 F1EG7STlRwoQ4cNZwjufi81pk6GnZxZB7HX314ivTH+gTL5uvSnSuZSPg2PcXhRduvEP YB/69QLBlUeDJXl1htLekg4rTpqWAW8KzpYC4CaT66S46G5TnxvzF1jphn28si0ofLv+ W4N2acn7Fls7CTG5h0JxLFcnAf27zEvRXEjuuqp3mtDbRLDdINdn34EFwfSs/GH/q6A2 VKLw== X-Gm-Message-State: AO0yUKUY3ytLql/kmCxCRD8+4OJLlSaNcbm6fGsh0f83ePTQDomp6qy/ 1IJc80e4BIBv8435fxLqNNP9lw== X-Google-Smtp-Source: AK7set/ujCEl41G9OUvH78qbpCbjatAiV4B04Ou2nFyAB2tImELNnn/ViZ0sW8r4i89QtNjIv9WUTA== 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 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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: 13130904 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6EA6C636D6 for ; Tue, 7 Feb 2023 02:49:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229565AbjBGCtZ (ORCPT ); Mon, 6 Feb 2023 21:49:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230057AbjBGCtO (ORCPT ); Mon, 6 Feb 2023 21:49:14 -0500 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6976D367DC for ; Mon, 6 Feb 2023 18:48:51 -0800 (PST) Received: by mail-pj1-x102e.google.com with SMTP id rm7-20020a17090b3ec700b0022c05558d22so13378716pjb.5 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=KjbhQ8OqBNn++DrTpbvH4YTcHiBgVlCtc0BVBTelQSqZ6YqPL57oL3er8UoeGQ/Hpo OBqzN1vdlquHQoQStbc9hKGhi2V1k7xF+e+leN/9I8ZrTOhBi84FT4pv9zNkaT1fpU3W xfO4Yn1m9r6Let4MNL3/eIBfnWmyeDnAEodGHZAlXA8rKyjJcF0phNHNOUg1/eP2aI71 vbjyxHInYcuiXlfPmbzfwHcVoI5s4OMmaaOlWBltp/s6ECx2JJrx+eOLRPEJdCUgWbdH etaI542ajc33iaXzTcahaZdfr9o6b2LAXQ3by2yrZLLMWAlrQZd2HSolozPDcH6VRV4f JNog== X-Gm-Message-State: AO0yUKXBBY8/06IpWIhKm4gc+LL0PjHzBWqUHc5cHntls/uloYjt/QBI iq/o7Y9ZQu2sS2A4HC8GDJQFyg== X-Google-Smtp-Source: AK7set9r0K5wQE49Me85/HS+/5oBqNAIPQwnmgekoSvS5JnHCqv7bOYV6QedD5I4PjWRoy5D7U40lA== 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 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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: 13130905 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34232C64EC7 for ; Tue, 7 Feb 2023 02:49:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230064AbjBGCt0 (ORCPT ); Mon, 6 Feb 2023 21:49:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229995AbjBGCtT (ORCPT ); Mon, 6 Feb 2023 21:49:19 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6417234C3A for ; Mon, 6 Feb 2023 18:48:53 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id z1so14241640plg.6 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=OgFnrNj1mmZ0WS5ibCAmpIAVfk/9xPaM0RNfk5ukGjope5rtt+fwKBElXdhBklssyP 8rvp+VIYn/h2+JGeBYlW5npXbrGIFHxb0xj6RzOMM5l1+lOaoqr4L6aiKGGE6U22Jxbs dUhOKS1Iz3ruDK7nGlR2+P6pbcg7yxplumeaSVMTzND5t8DCm9d3DnU3SZXg6A3RNf48 s+VSE4FA/MRDj+Mvtlv4loAN/Yq+N1l4YRZAr3khmQndwSyFLO8k6MU7iDiRI9Gfh+63 lt0Lo727+TGklH2rGuixB8qX8Q5eLALodXUHFajHHJG4jszhOfLc/9FFsqrcCV+z0CMu 44cA== X-Gm-Message-State: AO0yUKVZCMS2/9oona1iy5SWwhBE3J5th65/hANwo6r2y7qdyttTpPA6 MpS8v07D35EH71Jt12X5AEd4KQ== X-Google-Smtp-Source: AK7set8sEIe1FBkyL5NQBET+Qf2Emv3WKNXKo005ai96MzJv65aqQ1uD2XY4tb46mW3F2T23bDLG3g== 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 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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: 13130906 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDAB8C05027 for ; Tue, 7 Feb 2023 02:49:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229995AbjBGCt1 (ORCPT ); Mon, 6 Feb 2023 21:49:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230040AbjBGCtW (ORCPT ); Mon, 6 Feb 2023 21:49:22 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA55836467 for ; Mon, 6 Feb 2023 18:48:54 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id u9so9988329plf.3 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=rksvgrq79A6wGqQf5+tOuF/fVYedNzM3RFnM1eN6FxDvOTel6GNmk60F2+2CRN2p31 ZCws6Uy8WhdvWSfwSCfpwlEi+lcvo1+GCrXUjWLlnHhqXNbI4bxI23bNHN/OAr+0kKuX wrEbG3Rbvy6PpGJDKxSC5z+UlmVgDshzWrTAvAU6KBSRo3Z3Cj9VapPktyzr1tSFFBke rQCe9XTSFaCdWOkIeoqYh8RGk6jIfTVS3z6QU5ZT6RzSuthOmvkSSbWTVzsJ6oxXXvhY fuoW/slO58mcgL4Aa1yO/7FG2j+l8SAn+mx9f9rdbNK0UVGOjMEc2lE3z93mm0wxyXXU wg9w== X-Gm-Message-State: AO0yUKXrocg6/roCBW2Zni7AV37SD4Uek3Mcb/e1dwdCJZmCoM5Bx8ll tdMblhUQ94UMqWP+Ztt15xgfAQ== X-Google-Smtp-Source: AK7set83tUsQLSdz9QWf7CPd7HfWX3LT99NQj3Oy4gTb0a7vnTFojfY2y+AJUxutEn3uONkS8qeNwA== 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 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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: 13130907 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 378F2C636D6 for ; Tue, 7 Feb 2023 02:49:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230124AbjBGCta (ORCPT ); Mon, 6 Feb 2023 21:49:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230094AbjBGCtY (ORCPT ); Mon, 6 Feb 2023 21:49:24 -0500 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5648836456 for ; Mon, 6 Feb 2023 18:48:56 -0800 (PST) Received: by mail-pl1-x62e.google.com with SMTP id u9so9988380plf.3 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=JmytdEvyRwBxk+CC2tWLgB1Bhg/b9iG4wx7+ZZmngyfnshwODcXOi8HhpE/KfW18Mh BlrN/swvLjpFQxpVpfS5hkuHp21CddICa6rbw4DAblMrcanb2q/+toeaD1KzLtLtD6R1 xvOF7o9Lewg95juM70K5PzCGEmCgEqhnvFUuvHtiZXbKI++QUqTEv8ZTV5SKI8BN5Xrc fapQVqmmOujLkdSlVuUkKGvyiflT2/aWm5GZz4CpK3j8SYUduynb0Vs2I9fg6NbxDcSP vRkcV1mKnNuaVL3KNa2vaoJp87is5djz+j51oqXuNJN3NKg65gKsHWFh45BLqVsYmg5d NNuA== X-Gm-Message-State: AO0yUKUx8y8HqoDkIXJJ890dnD4LeyMxsmllPpI141NEbpFpa84mrWew IBVzAfYfvvOx6dN2eK4UgWIIVg== X-Google-Smtp-Source: AK7set+8Sx7+L05dQMtdW2yFX45Ga3BJe5QCG6gLFIc5l5Bhsxug8kSss0eC4tBn0Yh5xUGdwZeSpA== 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 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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: 13130908 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6163EC61DA4 for ; Tue, 7 Feb 2023 02:49:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230190AbjBGCtj (ORCPT ); Mon, 6 Feb 2023 21:49:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229822AbjBGCtZ (ORCPT ); Mon, 6 Feb 2023 21:49:25 -0500 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DCA13527D for ; Mon, 6 Feb 2023 18:48:58 -0800 (PST) Received: by mail-pl1-x62b.google.com with SMTP id b5so14269425plz.5 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=BfIzUOsEnUJqWIj+ekEuYfZXNK7rEFZI2uCOlQFltlb/zCTKH2yBjsOiz96l0GJ8ci 2de8TycBuCypabg5NkVOOr0ghZ6sUdz6OAnP0S626JgGsuRXlz1ohY8m6ls7w3+RUKdM pp1z8W69InB7B1HsCUjDzxjkl2+2PnBYQ37ewtTDYORcBSZNbCiRYI5hMktLNQCQCAtY TR5Me/2VUZFyD3Nsn2tB/u1nNQ4SoZhD/zsJ5OVtPEeJ4r0RWqaDGNKHkw7q9JzJtA39 Ojt2V6IwOWKqfjWgi2eOE50ks6wz99v8LbgorUr7BU6EjoW626T++8e2aGxmi/Vb6vSu 3psg== X-Gm-Message-State: AO0yUKV5BOpyJj/AMv6rUbu5BSrxCS8ry8k7ywvy/vUrBd15fS6FT7nm 0U/KJrUbVtDuZhoLMgt4vGPnbA== X-Google-Smtp-Source: AK7set96EDRUgjwqCjtZyjt3s7Fm+BlH1Yx2YTvIa8TC/AVnqJXNG1yYh3aohcd7sgmjs4Aq+3kYrQ== 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 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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>; }; };