From patchwork Thu May 27 07:55:55 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: 12283659 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.1 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 AE992C47089 for ; Thu, 27 May 2021 08:01:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 68BC1613F4 for ; Thu, 27 May 2021 08:01:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 68BC1613F4 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=bombadil.20210309; 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=19dnOyE+ifXTgs0tYcRNRHgJamkvEv9qKRfiBPE0w8o=; b=q68D+J+mVknaow zv6AyWynacpPsk6f7bfiZ9G+Z78wEk2icTHlXQ6+zEjjDxV4tiVSBVLx9GekND3KUXxbFkLCx3EDD 7cnOX/UCQZWChKtP//8rXQj884sxcuCsu1vWdzmPWyVrtcXLj9VBrwAKTqTO7EIJOu1cZOCFJYHl1 /UZrf0Z/JkgGwqJ2V8h1yQ1zZ6XBbq9W37pZRtxN7Ucd2aIlTlIk37oUN4xLUFeNeVE8zHB6MrVW5 AZmUbBBGsloWj1F0QUqMrvix5I23QeB51RdtihqKBWspT3yCBzuGdmXg42Zl/Jh3cneJhUMp3iT+k ThPuim/1B+hjjll/WwNg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmAvU-003afB-UV; Thu, 27 May 2021 07:59:34 +0000 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmAsF-003YdK-D7 for linux-arm-kernel@lists.infradead.org; Thu, 27 May 2021 07:56:12 +0000 Received: by mail-pg1-x531.google.com with SMTP id v14so3084384pgi.6 for ; Thu, 27 May 2021 00:56:10 -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=8pyuCoGKMnN2+h3a3mvyZQi+Jw/dfI3iorf08UqC1XQ=; b=Bh1k5AsMvov0F8xhU0fy1JXtiKqODUjSEBaJH/LGR0vli6my0OASfRNaobtKGmuGra 0NicyBnDSjqwDNdJYbCBXlocfR3dyN8wQwphQ+txLBLfmIc1bW1CmAwxYf5RfPHxoxB9 GPaHUPZO1dOsaD7vOAlpSC38lh8+S3wQk6Ccw= 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=8pyuCoGKMnN2+h3a3mvyZQi+Jw/dfI3iorf08UqC1XQ=; b=mDqk0nFIj73Opl/JJYAFN4MfKlhOy8PsR9i/1nKlmuKllDdzYuW4q+bJ33CuM42Wtd ShzZfT5jTcYEQK1ULZF5f6J1J6qyWRh7EVEPoc7p6suBjVUXg3u78adlgxj/bu3H127e rXVd1tfEPM4jBJxBl+3IpjVo4Q75QiQ8dJ1k8CdqlHEVUdfEFj2giFhDSPekOOMJaTWs 7od4r1TunZ4ua3pI/MgaoJcRZY7p9kNiPpmFuoWAbEhqDCV4X63veD+wrBBZImRRLB8S oJSiUJuJ3WcTzRFlwySmgqbSkpLlcpy0SQrT+fgc8qKsuhRJXrki0WUg4nCaDSL2h184 7Rjg== X-Gm-Message-State: AOAM53219TF1Drnc8mdyuZI9Y8HY9nC8lESbyyDBB5BwgniDrFVFFTOT BgqGD3G2JA0ROiaJXYyecOqG3g== X-Google-Smtp-Source: ABdhPJy47jhHWTE50bdT7rNK/2BImA4ZBMyIusHrtkWOEZQI1HmguHizcP2LilT+5zCs4TFmn45X7Q== X-Received: by 2002:a65:625a:: with SMTP id q26mr2482964pgv.311.1622102170122; Thu, 27 May 2021 00:56:10 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:ece5:55a4:6ad3:d20f]) by smtp.gmail.com with ESMTPSA id 69sm1217790pfx.115.2021.05.27.00.56.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 May 2021 00:56:09 -0700 (PDT) From: Hsin-Yi Wang To: Wolfram Sang , Matthias Brugger , Jean Delvare , 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 v21 RESEND 3/4] i2c: mediatek: mt65xx: add optional vbus-supply Date: Thu, 27 May 2021 15:55:55 +0800 Message-Id: <20210527075556.1709140-4-hsinyi@chromium.org> X-Mailer: git-send-email 2.31.1.818.g46aad6cb9e-goog In-Reply-To: <20210527075556.1709140-1-hsinyi@chromium.org> References: <20210527075556.1709140-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210527_005611_505229_9B48CEE8 X-CRM114-Status: GOOD ( 13.87 ) 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 Reviewed-by: Matthias Brugger Reviewed-by: Qii 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 5ddfa4e56ee2..22d1d14b5de5 100644 --- a/drivers/i2c/busses/i2c-mt65xx.c +++ b/drivers/i2c/busses/i2c-mt65xx.c @@ -1220,6 +1220,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)