From patchwork Tue Mar 9 13:31:31 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: 12125307 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,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 3D82EC433DB for ; Tue, 9 Mar 2021 13:47:02 +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 F2C3864F85 for ; Tue, 9 Mar 2021 13:47:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F2C3864F85 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=PyWA5TR5CA30RTMDcf4H2/gFfN9/SSrlMriQepKlUl8=; b=lYDRG4GU4DqBHi2d7tBEXbGzP eYOeGvygr555pquILaDYO7EROy6z5Cz9kkTGyBC1S6DxZpaqunZcAtyC0AUkNUArkROl0jOeTtWPp XW+ljrpRGXGpcCE2Iv318n3gdqwmq8UnlcmqHwMtOfvCwkacF8u7BoZepZqm4+U6/BI1rIIUQCwBu XDB9x8YojW3bF/u2hunYmTSeKQSViTFxwHfTu1QPQxaTV5F7CLgUz7nAXrLAYFf+AuXq+beIpbrO7 Zb4Abvi4y0pyzjFpQGU0RSxM/3I1sGnCzjTneeC7iQrzyLA0g/Xu+6vK8FaSOdnOlgC80SsJ8zeFE tRRNfwB1g==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lJcfI-004j7X-QD; Tue, 09 Mar 2021 13:44:49 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lJcSg-004eTs-MD for linux-arm-kernel@lists.infradead.org; Tue, 09 Mar 2021 13:31:53 +0000 Received: by mail-pj1-x102c.google.com with SMTP id q6-20020a17090a4306b02900c42a012202so5201121pjg.5 for ; Tue, 09 Mar 2021 05:31:45 -0800 (PST) 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=sICRVh7f2CnaIXch/ljbyTh/YiC3SaJQVi2yY8F3cEI=; b=H12N7b5h918WXCPFRBD3eFjypWHlemJ2NEedlhsK4Y+jW/gPKmGoNQc/PuaNJZysRR O9rPB4lDgPsuLYfCGmP0oD9DK35lxHEK089L1VvuXMX7OjlJxtqglA1b6npGAoY+vCuG Iv4K2qLnYtfQP+whL2ahLwhq8K/2r4b0YX+HU= 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=sICRVh7f2CnaIXch/ljbyTh/YiC3SaJQVi2yY8F3cEI=; b=pBSPxXL2xzdZ2RcyWuBM3ve3HdCV75sXqYYu75ZGEm+sPMuQvV+EDHTEgluPVW/cyX CniFbNU2g4J2b/KRwx8EG7ARirEmJFNu1G+Qj2w2/Fq+vRYsbKJEY/Wbs3rY54SdfR6i OCj0WHyfBtdU0CT177ri55tD6eapUzQa6nWbW2WNiq5gzgg5rSnkFXUAmyiRCR3B+SBB Htl5hJ4zOKTuHodVOLPsP0R8MRZJjFAV5/6f8010jr/P4xpqc6iXQ65UHjhLxBVsvA2f +Ijoks6sVUZonZSAhKQE/aeoRH7VmXIpbO6eHznp5Qn93IQaTtDMh6kT7s76jW6hVqeN aVJw== X-Gm-Message-State: AOAM533oN2AExhIx+nhppU2FRFTTStoqL2rk/1gYcmYd+TIKp/NXZeJg 6QSa/qurFOXAQ1uK8Txa2FCq3A== X-Google-Smtp-Source: ABdhPJxYtfPzJ7zMOJQNlO3kd9jxglEEHuxGkZlj7HUcxp/hZAfpbUv7ryxiLwxa9+QzytyaAMsfJw== X-Received: by 2002:a17:90a:5413:: with SMTP id z19mr4622848pjh.137.1615296704224; Tue, 09 Mar 2021 05:31:44 -0800 (PST) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:f936:57e5:154d:e0d9]) by smtp.gmail.com with ESMTPSA id 138sm13678649pfv.192.2021.03.09.05.31.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Mar 2021 05:31:43 -0800 (PST) From: Hsin-Yi Wang To: Wolfram Sang , Bartosz Golaszewski , linux-i2c@vger.kernel.org, Mark Brown Cc: Matthias Brugger , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Bibby Hsieh , Rob Herring , Marek Szyprowski Subject: [PATCH v17 3/3] i2c: mediatek: mt65xx: add optional vbus-supply Date: Tue, 9 Mar 2021 21:31:31 +0800 Message-Id: <20210309133131.1585838-4-hsinyi@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210309133131.1585838-1-hsinyi@chromium.org> References: <20210309133131.1585838-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210309_133147_127435_3F4A2763 X-CRM114-Status: GOOD ( 13.39 ) 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)