From patchwork Fri May 7 13:14:03 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: 432229 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=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 39515C43461 for ; Fri, 7 May 2021 13:14:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 062BB6146D for ; Fri, 7 May 2021 13:14:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237156AbhEGNPY (ORCPT ); Fri, 7 May 2021 09:15:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237135AbhEGNPS (ORCPT ); Fri, 7 May 2021 09:15:18 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6BF4C06138B for ; Fri, 7 May 2021 06:14:17 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id h127so7568781pfe.9 for ; Fri, 07 May 2021 06:14:17 -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=Z5uRcm+z5t4aeBxWsSjq74fZr3pDWXQjhRR69I0+uIA=; b=H3z2qCoLD7IfYuyroPiDy5fAoe2wbDqn1Vnl1mTG/23sUSa0pIb0dBthqVqkDnwxv5 +gkIBUv8mIFN5pvK/ryk7yl35ZYzq+8nnwQcXY1Bpe0XvVy4vkIQdRhY7J5N1+YssF8D 5HxJZYjzDawin42Sq91HpOpWvSq7lxCu0Nmcg= 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=Z5uRcm+z5t4aeBxWsSjq74fZr3pDWXQjhRR69I0+uIA=; b=XwdXOZCZRnRFw4HuM8dsRYDGXhUmEdGQQi5aNWd2tsyVI6vXAW0nEHulcgahQGeYml JuN1uhHiJ1yZOibdXo+ED+UYdwENwAxy17WoJR7pQkpBU6Va4pb/D0R16tM+JBk1Un7Q EBcYA3j8nuHFZYH2skY7N5KynhlhwdcOZDW/mGwtuRhiOb/67T8AQmo6UZkFMgbYfISe b0GYObosmuah9q9D3zQh1qY8dGVm+An+nT0NoC7pHKgvoHzLVIkHywLYCflEV/5B4I7m JEer2qLinToYeVdWlR0dPqwrjsLhOw+UOq8LICxdDnSa+o3P2OKHB/tRhamWVChYWvNC e6Jg== X-Gm-Message-State: AOAM531atDGf24Rzpi4R9AM29nNO+kK+SjlbjY1gkHR4eKM3WEW9/52x uDdzZlUva+YdCFoLm8kv2BTt3A== X-Google-Smtp-Source: ABdhPJwXgl15gc0vRklpyyJcdK2f9/dPf52EGEjnqBHI+xiQ73HrxYgQkGwIjLYder7XGpt9XbxDYQ== X-Received: by 2002:a62:3106:0:b029:25c:cd66:3be1 with SMTP id x6-20020a6231060000b029025ccd663be1mr10438925pfx.29.1620393257211; Fri, 07 May 2021 06:14:17 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:711f:8553:a124:a19]) by smtp.gmail.com with ESMTPSA id z29sm4656539pga.52.2021.05.07.06.14.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 May 2021 06:14:16 -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 v21 2/5] dt-binding: i2c: mt65xx: add vbus-supply property Date: Fri, 7 May 2021 21:14:03 +0800 Message-Id: <20210507131406.2224177-3-hsinyi@chromium.org> X-Mailer: git-send-email 2.31.1.607.g51e8a6a459-goog In-Reply-To: <20210507131406.2224177-1-hsinyi@chromium.org> References: <20210507131406.2224177-1-hsinyi@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add vbus-supply property for mt65xx. The regulator can be passed into core and turned off during suspend/sleep to reduce power consumption. Signed-off-by: Hsin-Yi Wang Acked-by: Rob Herring --- Documentation/devicetree/bindings/i2c/i2c-mt65xx.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/i2c/i2c-mt65xx.txt b/Documentation/devicetree/bindings/i2c/i2c-mt65xx.txt index 7f0194fdd0cc..2c45647e9f0b 100644 --- a/Documentation/devicetree/bindings/i2c/i2c-mt65xx.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-mt65xx.txt @@ -32,6 +32,7 @@ Optional properties: - mediatek,have-pmic: platform can control i2c form special pmic side. Only mt6589 and mt8135 support this feature. - mediatek,use-push-pull: IO config use push-pull mode. + - vbus-supply: phandle to the regulator that provides power to SCL/SDA. Example: From patchwork Fri May 7 13:14:05 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: 432228 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=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 5C423C433B4 for ; Fri, 7 May 2021 13:15:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 25F5561466 for ; Fri, 7 May 2021 13:15:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230131AbhEGNQE (ORCPT ); Fri, 7 May 2021 09:16:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237152AbhEGNPY (ORCPT ); Fri, 7 May 2021 09:15:24 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D4C5C061342 for ; Fri, 7 May 2021 06:14:23 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id t4so5115274plc.6 for ; Fri, 07 May 2021 06:14:23 -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=xcouiPP4ZWr6sE0GiZdxnLUxfCWsAQ8aBA7BAFbwZSg=; b=Bn7vnWvwErgkHww/wyQaRKbnP9HyfiwnkzeUkAsUBO0BgofkV3NljJIagFWPurDaho YOgo+zkazaGGORdA2xpfpMGYBWtNss8jXkpPQf801I83KdaJkDXqOa8Na8gPZY/8+62T w2M9LP5s2KYkB90H9MdCsCEPDNiPtvh/h8Fmg= 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=xcouiPP4ZWr6sE0GiZdxnLUxfCWsAQ8aBA7BAFbwZSg=; b=I8acIt2oBuU2x6MFhHgj7j6rCQ0bQ/nTpPmaOIo1GtSLSNaaLAbu7P8Kch/TaYGf5/ bpnLb7CMPKFSSBJqE7EMkB1JN3+Tx/36seWEWzbnXYxnyQ75h21QXmXuRe2OsE+S0Utw N/iTgrtKldxiTuHDs1JGpxgpd+nrV+OCT0AtqNxRVpsAsc23teqlpB9VG/nZ/JeappiO q9+OGEGcq+Q8yNmnGZHEAFNKQ3od+ZGkJ88SMlnkyMB7jJSSYuegbPFRdIc61bAMQpbq GjJWntKZZu0h4zOAEqbOZTkYMlBCy78U5zHU0x42LSQeHpu8qv0p9fBHfl1bSkf0o4kw qESg== X-Gm-Message-State: AOAM533mmKL6rMZp80kR/QF3DzVzlLj0umxVd0kTcaLD/f98BN/xkc5f FY0Sn8Yy0FWUbHkqKw+rIo+F/A== X-Google-Smtp-Source: ABdhPJzNumxAR1eE6lJcWpdeibTL2dL9mK96HWGhUZ0Oi+h7BgBrA3QkEyBkkzCtGm7At7VQeu0w8g== X-Received: by 2002:a17:902:7205:b029:ed:6fc0:bbd4 with SMTP id ba5-20020a1709027205b02900ed6fc0bbd4mr10509724plb.4.1620393262574; Fri, 07 May 2021 06:14:22 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:711f:8553:a124:a19]) by smtp.gmail.com with ESMTPSA id z29sm4656539pga.52.2021.05.07.06.14.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 May 2021 06:14: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 v21 4/5] misc: eeprom: at24: check suspend status before disable regulator Date: Fri, 7 May 2021 21:14:05 +0800 Message-Id: <20210507131406.2224177-5-hsinyi@chromium.org> X-Mailer: git-send-email 2.31.1.607.g51e8a6a459-goog In-Reply-To: <20210507131406.2224177-1-hsinyi@chromium.org> References: <20210507131406.2224177-1-hsinyi@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org cd5676db0574 ("misc: eeprom: at24: support pm_runtime control") disables regulator in runtime suspend. If runtime suspend is called before regulator disable, it will results in regulator unbalanced disabling. Fixes: cd5676db0574 ("misc: eeprom: at24: support pm_runtime control") Signed-off-by: Hsin-Yi Wang Acked-by: Bartosz Golaszewski --- drivers/misc/eeprom/at24.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c index 926408b41270..7a6f01ace78a 100644 --- a/drivers/misc/eeprom/at24.c +++ b/drivers/misc/eeprom/at24.c @@ -763,7 +763,8 @@ static int at24_probe(struct i2c_client *client) at24->nvmem = devm_nvmem_register(dev, &nvmem_config); if (IS_ERR(at24->nvmem)) { pm_runtime_disable(dev); - regulator_disable(at24->vcc_reg); + if (!pm_runtime_status_suspended(dev)) + regulator_disable(at24->vcc_reg); return PTR_ERR(at24->nvmem); } @@ -774,7 +775,8 @@ static int at24_probe(struct i2c_client *client) err = at24_read(at24, 0, &test_byte, 1); if (err) { pm_runtime_disable(dev); - regulator_disable(at24->vcc_reg); + if (!pm_runtime_status_suspended(dev)) + regulator_disable(at24->vcc_reg); return -ENODEV; }