From patchwork Wed Apr 14 08:38:07 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: 12202181 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=-16.8 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,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 CC1C2C433ED for ; Wed, 14 Apr 2021 08:41:07 +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 502A7613C3 for ; Wed, 14 Apr 2021 08:41:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 502A7613C3 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=wmFvrRNcOXVJGax9A1JoGzAbdWh3Cz9a2vIkJXpNSdE=; b=mtJp8SzF2xLITiIlPaLsUMRRS oBUyVHIchlBzZFbdKgG8AucWFEGQYGGmR99cXjPl8O1K+18WDQvxkgH14K16LTSf6Pw4pZLhbGm7j ErHmE8rHdlH2kQnUfpss3pggSWYSoAcVokAsBWtwpUoa6FUIlO4elgnuuFL46EokwjR1unvGPSvSI IEyJeu5l53B/ayy1NkGFSwIPncAZebrrNlf/yHhD5vngxoTFouy2z2OsCTwVAcybU5quSe9t4ceMU BySUYiEY12vGLEocvBIdB04w+sI59ihBPEbTUj5l4VHnw5Cjh+hbyC2pTb/tUF61SuuPMH+YzSGsa f9gJdL5Sw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lWb3U-00C0c1-Pn; Wed, 14 Apr 2021 08:39:24 +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 1lWb2X-00C0Pj-De for linux-arm-kernel@desiato.infradead.org; Wed, 14 Apr 2021 08:38:27 +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=plmO0AdMl820K1E1EewPUIFFIYm0UYQ8GWMNCMfiNMs=; b=E1GWnMkqWdmCHlIwtZeAPRbagw d8K7iQD2VZks3bM5Qd9NdLf8tCPZiTk6jdd782JHNFxC1IDtKUI20O6BXqj5CQYa1UiFo2Iu4vbya QE1h2JzwL9XbkYe2AoDEOd8GPVIlXEykdA+tSWQzPMIPNQ7X2+sS58ac4jHqsMdrP90XP5bMr6RyW SMtH9XXEVYA+diezismnnriA2hM0wJCWOw/if1yjDg71Zg84UdrutEk3uuIH4datWm4HjMGKODlES F7pDQ9qvrgb3VpDB1ZzdYWWKgS4+Oa3uSobH81WRYmiIUbePfp1n/HZq4nBbyBvcNWvjwSB9kht23 w8WTOIjg==; Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lWb2V-007cMK-0J for linux-arm-kernel@lists.infradead.org; Wed, 14 Apr 2021 08:38:24 +0000 Received: by mail-pj1-x102b.google.com with SMTP id il9-20020a17090b1649b0290114bcb0d6c2so12146346pjb.0 for ; Wed, 14 Apr 2021 01:38:22 -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=plmO0AdMl820K1E1EewPUIFFIYm0UYQ8GWMNCMfiNMs=; b=Y3NqiCd5rr7+LyVYEGOOOX4NYDJW2EOYrkF/TrtNRNqln3ctoJGKO0I0T0L0ApmQ3K N06EZWoCDwWvTUJ2L4ngADfH2WBuwxd73m6NYcBOtrsQQI3F9MRZMHIb1Y80f3kIAKNC j1j23aHDf+PkiUmZYXCsRhdPo49p+brePolV8= 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=plmO0AdMl820K1E1EewPUIFFIYm0UYQ8GWMNCMfiNMs=; b=CCBKMrYox+LJPDiYvfgUPyKpm6/DNH0bbBNUT/mNdCWopF1gM0ogKvcTC4TKY8gZRI syHqriqSfamEq6zkfYB7S8/xoYy8v1P96OHX4bdXXg3uW7d7CSTyIda34ZxffY3NGQUp IGDlZ7ln25J80UCs1SLxUCi/eTQM6utJ8pYmCxgy7Zif8gZArdi2+JtebpuOUEUkZnIT ScyKRsJXnJqA87Rgw3lqCcwUxrnexPVSXT7ixRn57x88FTJpBJAVufl/Bpg4UDHitDOH 4B2Msf3upfHbzFdrKiC2eFD3IebqQG4sHxPrf1IbMw7/C5rji06cNw1yiQS8gj8dWnqF WTXQ== X-Gm-Message-State: AOAM532/Td1iSo0YFf9gRlFqFmR5N69lDFDwXLK4p4+e+NPtAHVy9MQH T104y4jVu3adocpplwj+w+0xfw== X-Google-Smtp-Source: ABdhPJzlShITTMJUXTCs2zEaR/hzAirHlP9c/EZQo05/1A8Fi0UiYdumG++22lWtt4vLwGQbGoVQew== X-Received: by 2002:a17:90b:8d3:: with SMTP id ds19mr1590139pjb.197.1618389502547; Wed, 14 Apr 2021 01:38:22 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:bae3:4af0:9792:1539]) by smtp.gmail.com with ESMTPSA id g24sm8901582pfh.164.2021.04.14.01.38.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Apr 2021 01:38:22 -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 v18 3/5] i2c: mediatek: mt65xx: add optional vbus-supply Date: Wed, 14 Apr 2021 16:38:07 +0800 Message-Id: <20210414083809.1932133-4-hsinyi@chromium.org> X-Mailer: git-send-email 2.31.1.295.g9ea45b61b8-goog In-Reply-To: <20210414083809.1932133-1-hsinyi@chromium.org> References: <20210414083809.1932133-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210414_013823_064287_69380089 X-CRM114-Status: GOOD ( 13.88 ) 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)