From patchwork Tue Apr 27 05:36:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 12225383 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80C4EC433ED for ; Tue, 27 Apr 2021 05:39:56 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E1AA461164 for ; Tue, 27 Apr 2021 05:39:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E1AA461164 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2IkKtw+5wlz1k+OGYXGyAkZu/QZiRgSj/GiSFgEE6vM=; b=DvF+7VhpuzYffX/P/IBgi0zl0 lUc4g5uPQ2nMJB8qf/LbP4qqAL6byVPplj8b8sPqAv/4o2a72pIECTbRsjhViTsIaIaQWvImXVZ94 MzTAywkEsJQf9v2TYK/E8RTrsQZbsbIKN08+vwiFGyGDiB1s75WJLvhSki03x/R6oBe/O4FuzrqSZ nnfW4HKukyhdwrNg7hEl9jieOaexDj6ZS2JGLuFQdz7vArxlfpiVzmKAxkzl2mrurhkZCqtxP8FfX TeNkqOVf4G7G3INQry2zvPSOraoFw6XODfuOBSZT4O+oYYfXIR9a1h2kYsuDr2zw5dGf1R/dTAu6m 6RMwX4WLw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lbGPs-000lFt-Ea; Tue, 27 Apr 2021 05:37:48 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lbGOg-000l7w-2N for linux-arm-kernel@desiato.infradead.org; Tue, 27 Apr 2021 05:36:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=oOSiNAIFbF5oM0OgD4JWcfn+rkikH5kg1ZaUYL3whtQ=; b=ulf7QQelJ4dC6rH5n3s4HtmrDm K4BcuRD/CvrjJQgNnD3ubW5Jqnt1Sf5EXxKVj7Q8PEkYFxhS37iarnEKQzibeiN8aunTiewyuv6N9 ZxjVZJgyTfkZsVm++l6axyG4r4IKp6MKla/ihPtgz8KzDh/RCt81xyqUUsfDcetF3Bv0MMTD5cvxW Fl46ixJM+vW7zgp6PN+83AEsJSfrbJ6P2AQa84Qoq5tprFx2Eo4phS8+9WtMWH3OBavypi9aZ9wFw 9y6X2cFA1KbppUBuUHhJHUl2iTkQ/e/3kSxOBsyu2QLOGpEWNAJeFRLrQiPbaiXIGJCmxhdUnLX+l 2dcjiibQ==; Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lbGOd-00GSEZ-LM for linux-arm-kernel@lists.infradead.org; Tue, 27 Apr 2021 05:36:32 +0000 Received: by mail-pg1-x529.google.com with SMTP id s22so20469163pgk.6 for ; Mon, 26 Apr 2021 22:36:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oOSiNAIFbF5oM0OgD4JWcfn+rkikH5kg1ZaUYL3whtQ=; b=VOWdUtYAgwq1bQG3/NsqLEKs/W1eKLs6RW9BQiWCYyD/Rfqvg890AjJ+GEoGMq5OrA AJ5KHj4U1HvetQeuUVJVOIRQXy84KxIekLczgZ69sB4zUtPWSuutk3TpnMuHMTjWm4+8 h8G+8PZFnH5Rm1K+s/a+i9Kx1KocC5TA7BsS0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oOSiNAIFbF5oM0OgD4JWcfn+rkikH5kg1ZaUYL3whtQ=; b=tvu+N+EjEetMo9+nEFacGBJ/AcjXqLI4kRnPTwfJ9TOLu0OORLLK6i6AC2eS0o+iTj SiwF/AQUhQW0h3Ze8+uxZhHdoenYPJ+39XISnuA24g+/IFMvvc1sX9mKCFWB1IfRZ8Iz WsPlZIEPSclw1D9hT7lcOBM6w3LKGfqzO0pYhH3890aJuXC9v6KRZ3MDWoRhkB0rDmw+ CLFuxqYzRL9u7vCxSHlQBAwTTpizaa/pBLyHijb2Te9rH0Kn8V2KfwjsyrXw9HfgkmMg 5Dr78yM0v5T2iroDZvDxKKHnnqeseinwmUHf9eXYQZtFk0tWAR1wPA+jCetCPJyQ8sjQ aIag== X-Gm-Message-State: AOAM533BOU1yaa8+a4bRzYVezsUsHTmg0gJlVP3YcPom9IIMB5L+aEEx G6Pp+63hfRiTLOCGDlHtPdsX8w== X-Google-Smtp-Source: ABdhPJyrLflzW+OohhHuQBd5kScDJnTZGVrPGqJeEKaquqlC5N0ZXttwfYEPggjDOml6EKMuunb2XA== X-Received: by 2002:aa7:82ce:0:b029:242:deb4:9442 with SMTP id f14-20020aa782ce0000b0290242deb49442mr21579555pfn.73.1619501790821; Mon, 26 Apr 2021 22:36:30 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:3984:c4f5:8612:6b3e]) by smtp.gmail.com with ESMTPSA id gc15sm993529pjb.2.2021.04.26.22.36.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Apr 2021 22:36:30 -0700 (PDT) From: Hsin-Yi Wang To: Wolfram Sang , Matthias Brugger , Rob Herring , Bartosz Golaszewski Cc: linux-i2c@vger.kernel.org, Qii Wang , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Mark Brown , Marek Szyprowski , Bibby Hsieh , Arnd Bergmann Subject: [PATCH v20 3/5] i2c: mediatek: mt65xx: add optional vbus-supply Date: Tue, 27 Apr 2021 13:36:15 +0800 Message-Id: <20210427053617.27972-4-hsinyi@chromium.org> X-Mailer: git-send-email 2.31.1.498.g6c1eba8ee3d-goog In-Reply-To: <20210427053617.27972-1-hsinyi@chromium.org> References: <20210427053617.27972-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210426_223631_704785_E8912F41 X-CRM114-Status: GOOD ( 14.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add vbus-supply which provides power to SCL/SDA. Pass this regulator into core so it can be turned on/off for low power mode support. Signed-off-by: Hsin-Yi Wang --- drivers/i2c/busses/i2c-mt65xx.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c index 2ffd2f354d0a..82f2b6716005 100644 --- a/drivers/i2c/busses/i2c-mt65xx.c +++ b/drivers/i2c/busses/i2c-mt65xx.c @@ -1215,6 +1215,13 @@ static int mtk_i2c_probe(struct platform_device *pdev) i2c->adap.quirks = i2c->dev_comp->quirks; i2c->adap.timeout = 2 * HZ; i2c->adap.retries = 1; + i2c->adap.bus_regulator = devm_regulator_get_optional(&pdev->dev, "vbus"); + if (IS_ERR(i2c->adap.bus_regulator)) { + if (PTR_ERR(i2c->adap.bus_regulator) == -ENODEV) + i2c->adap.bus_regulator = NULL; + else + return PTR_ERR(i2c->adap.bus_regulator); + } ret = mtk_i2c_parse_dt(pdev->dev.of_node, i2c); if (ret)