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);