From patchwork Thu May 27 07:55:52 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: 12283653 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=-12.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 C2147C47089 for ; Thu, 27 May 2021 07:59:06 +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 840F7613E2 for ; Thu, 27 May 2021 07:59:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 840F7613E2 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: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:In-Reply-To:References: List-Owner; bh=aiSkVG7yNmyfn79GncDRY/prOOmdDoBxLou3VfMpXnk=; b=LVRdII7yxYbXm1 d72HHnfAAMAgtP0tNCmwhGrtQBjnRZ9JG2VY4PpN1BElVO+YM6SMt0ZDeNOqxksgLyHC2PuhyGKlv yVVtWfWrb3fBJBLE7jnl+vHOiZn4qraQ2D4NIMPlW209qf3IoRjQWLYWXhCQkNSu5eH6oeFMTtxX+ CiB3MqmDbCYComYQF55BCzaaYRDmPFu/QoL3OSoWkbvKco2xSDtT7mBUZLYqtJHT8yOELQ24f1slr ON8hCk7vBu0t1+D7C9LcLljh4n3tA0zDhW14e2UFM3jnld7n7wspU5VWOjQgVVXo4zf7IxoN4a9aB mm8pobYqY//XsH18BaaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmAtC-003Z7r-W0; Thu, 27 May 2021 07:57:11 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmAs6-003YXy-UH for linux-arm-kernel@lists.infradead.org; Thu, 27 May 2021 07:56:04 +0000 Received: by mail-pj1-x102b.google.com with SMTP id gb21-20020a17090b0615b029015d1a863a91so1863308pjb.2 for ; Thu, 27 May 2021 00:56:02 -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:mime-version :content-transfer-encoding; bh=/doZaj7RzG7nsTUhqK4KmB6iqriYK3erH2nH1FOUD68=; b=Du/bJjPCbg4kECu8cN42XUDMYzFFqM5hhuJsKuyni/Iegd+QkpFdn3erdTrw336+Je MCwLbsMBWJXz9lKm8LpL3AbKjpXSOXT5Q8Ntiqk2nW/bsG0pjlMkmDWdZVLJ1OskB9oK ElmGvZ2xGkaz9Wb4LxkotNheavjAAy9N3UN8A= 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:mime-version :content-transfer-encoding; bh=/doZaj7RzG7nsTUhqK4KmB6iqriYK3erH2nH1FOUD68=; b=M+azfravApDzgugwiECwwcOj3p9wQRTIH6W7IJhI36bvAbKQXNrZIr6kfHeT8EsLAL pf7nysh6JTqclO9bOpb+zmdMkfe+RLOXZFPP4m3BRlafaOIC3df4yydPkuQ5dxL2eRxI Osksi/Vz0fmkoONHHM0WjRGx5Yv+Wyy/ud+pj6r9E96gTyCu/vTegcH1reuYEVjBxjRI 3i4XiE+n4EeWs3T2I8LTNQ2ZAYqQOh3lE0kVOOyhgXlKeg34BwqPYimDiq8ic3M6gq59 XTwgFGk59fPYHCcRIyie2XxyY3UhJDmwqqFfK/Q/OrRm+N5WHpa15SMqtHPz2qGsqiky 56aA== X-Gm-Message-State: AOAM531KOKn7i7ck12n2OqBf2iPbTZ8YliJruYPuELekgMV8Hyzpg1Qg uvDmiCCh1N+FcCOyjT9Mc8ysAq7NP0iPpw== X-Google-Smtp-Source: ABdhPJw9vM3CRZoYcvKhq2sIemcpggZaXiWzX+hqAh8djv70fHOy2wHjuL36qI4azOgorAmQvAePXg== X-Received: by 2002:a17:90a:e553:: with SMTP id ei19mr2447297pjb.175.1622102161697; Thu, 27 May 2021 00:56:01 -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.55.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 May 2021 00:56:01 -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 0/4] add power control in i2c Date: Thu, 27 May 2021 15:55:52 +0800 Message-Id: <20210527075556.1709140-1-hsinyi@chromium.org> X-Mailer: git-send-email 2.31.1.818.g46aad6cb9e-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210527_005603_063118_36E91BF1 X-CRM114-Status: GOOD ( 14.71 ) 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 Although in the most platforms, the power of eeprom and i2c are alway on, some platforms disable the eeprom and i2c power in order to meet low power request. This patch add the pm_runtime ops to control power to support all platforms. Changes since v20: - fix regulator check logic in suspend/resume. Changes since v19: - resend v19 with fix tag added. Changes since v18: - Fix a function name conflict with drivers/gpu/drm/i915/selftests/i915_gem.c Changes since v17: - Add a patch to fix unbalanced regulator disabling. - Add dts patch. Changes since v16: - request regulator in device instead of in the core. - control regulator only if it's provided. Changes since v15: - Squash the fix[1] for v15. [1] https://patchwork.ozlabs.org/project/linux-i2c/patch/20200522101327.13456-1-m.szyprowski@samsung.com/ Changes since v14: - change the return value in normal condition - access the variable after NULL pointer checking - add ack tag Changes since v13: - fixup some logic error Changes since v12: - rebase onto v5.7-rc1 - change the property description in binding Changes since v11: - use suspend_late/resume_early instead of suspend/resume - rebase onto v5.6-rc1 Changes since v10: - fixup some worng codes Changes since v9: - fixup build error - remove redundant code Changes since v8: - fixup some wrong code - remove redundant message [... snip ...] Bibby Hsieh (1): i2c: core: support bus regulator controlling in adapter Hsin-Yi Wang (3): dt-binding: i2c: mt65xx: add vbus-supply property i2c: mediatek: mt65xx: add optional vbus-supply arm64: dts: mt8183: add supply name for eeprom .../devicetree/bindings/i2c/i2c-mt65xx.txt | 1 + .../dts/mediatek/mt8183-kukui-kakadu.dtsi | 4 + .../dts/mediatek/mt8183-kukui-kodama.dtsi | 4 + .../boot/dts/mediatek/mt8183-kukui-krane.dtsi | 4 + drivers/i2c/busses/i2c-mt65xx.c | 7 ++ drivers/i2c/i2c-core-base.c | 95 +++++++++++++++++++ include/linux/i2c.h | 2 + 7 files changed, 117 insertions(+)