From patchwork Tue Apr 27 05:36:12 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: 12225377 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.0 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 60D09C433B4 for ; Tue, 27 Apr 2021 05:38:43 +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 B6DC861090 for ; Tue, 27 Apr 2021 05:38:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B6DC861090 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: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=vFLJQ1/hou5wGNd46DBqvy/1grnvjCWfEwu44a1wj2I=; b=V7ziFWbt7PUWcwmDEWzruxXzQV MLyyoMcxvRxH/v07dIqbbRncFp9yl8ISXFOjNuXE41kEOW+WIdANruzAODIPhUmOBiNJOoMkAt8KP jSQNnlWCj47LhEujSEtFSbB4Hd4/taHQ7ISJCujOXhp4eFudUjzv3oUle17MUZp7Mql5jqfzTuDHU FKD1rqFTBCONYE+cGzzWSdYtpEsCOOIY9VxvdL5bsm/J1BFLtxwpoFHJmgRkH1ZCP9eknMYSvnmdL mTHH2OjwZs+K9ZsEt9VAnrG6Jgy00wVe50jFMvwjDvQ3yqndEGwG3CW16b9AEgpy1v3JAptzrNY3U 8eSX+sKg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lbGOj-000l8L-6Z; Tue, 27 Apr 2021 05:36:37 +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 1lbGOZ-000l73-Bi for linux-arm-kernel@desiato.infradead.org; Tue, 27 Apr 2021 05:36: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:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=aTHnAMIQD5s8JadjAbGJIjLqhqT66XAtuscyCUM1Exg=; b=YeqN/jnVczG1UmWmCedqP30hkj FGO2O4AfqZbHXxcCUADSysVyN9DgA2scPc77GThJdrD+CYG/O0OvEkB254vN2wAGE0bZ+MBFMa4N2 OSpsU8y8cS8D2mvK2Sv7O8Tf4kntmiauFPVIdsPhk4npK8M9xaKgs5R2rcS3ddLEfpkXw1O8vRymB fthqpYRCQcCAAIGtXF6MyXFeJGpmhpKK5geRMtK05ZVuuj3J3V5IrruXQ7B/99abZI3Q4xpEsHm7B jmnLoAIaEKD6C2s7yZzXIXx0S6xodxi/YDXJ+r2AvIQQdP4V04HqZ0NAV6DOG7rcFHT0suqsAP9JJ wr+7zbQQ==; Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lbGOW-00GSCt-ET for linux-arm-kernel@lists.infradead.org; Tue, 27 Apr 2021 05:36:26 +0000 Received: by mail-pj1-x102f.google.com with SMTP id l10-20020a17090a850ab0290155b06f6267so388726pjn.5 for ; Mon, 26 Apr 2021 22:36: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:mime-version :content-transfer-encoding; bh=aTHnAMIQD5s8JadjAbGJIjLqhqT66XAtuscyCUM1Exg=; b=iDVXwOEZxmA8fOzgfknudnogPZoKYmxt3u8dTcHSHwypV0CykQKeRziphRLC3veOyJ AnOIFpfBBOdlNpdVwEX7841ZSHmTd/+D00vrCuLcizuefC4WPLuMgL6v9IyHllx2fhBm qc1fJPhDE1Z3eibkPtW/NYxlStO0vq/IeLVNc= 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=aTHnAMIQD5s8JadjAbGJIjLqhqT66XAtuscyCUM1Exg=; b=Y9erQijuFFEYd4KDfRvaBOohniSDs6iav9fIXNQ/DJMdFON4SZ8TMHGiAUmfz7rFaB v/098HhAWTMxVImzD+P8UEvrS9xyCA6Z0einjCqdjKYuauWVb36sC0gF/UA0EGZilLr4 kzk/JymgqlMkcdXBx7fBpWsqkq8XzEEbKtLRvgUwY2vfeSgLyFhlCe7Sf3cIGJgF7gEp kUcfh8pwm0pesMK5F3Sx06e2W1yJlR0Yr13gGVLvULSRcdR2ccq3iX4WLIEQ0OvSFYl3 UtuxQ84VGY1u1k0NsZvWmgOQGs3uC3YNDUUFuTT5z9NBCTQGF+uonD8foJNTwNk99SLX Dl3A== X-Gm-Message-State: AOAM5337DNO4keuWpkQbWXRxvSJa2b8+x595f6XGGa1kpoUmrne9qmoi h0u9qrQr5otHIlGnlV1lP4HS2EBDPNemxw== X-Google-Smtp-Source: ABdhPJwhDlroLXq4uzG2AtyLbgaJBtpApsdyh91sUIMYLFNmkYl6oY9Myfj40DiDCM4x+JYA/8iPoA== X-Received: by 2002:a17:90a:5907:: with SMTP id k7mr3159032pji.197.1619501782729; Mon, 26 Apr 2021 22:36:22 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:3984:c4f5:8612:6b3e]) by smtp.gmail.com with ESMTPSA id gc15sm993529pjb.2.2021.04.26.22.36.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Apr 2021 22:36: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 v20 0/5] add power control in i2c Date: Tue, 27 Apr 2021 13:36:12 +0800 Message-Id: <20210427053617.27972-1-hsinyi@chromium.org> X-Mailer: git-send-email 2.31.1.498.g6c1eba8ee3d-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210426_223624_520826_801D4D31 X-CRM114-Status: GOOD ( 15.61 ) 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 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 (4): dt-binding: i2c: mt65xx: add vbus-supply property i2c: mediatek: mt65xx: add optional vbus-supply misc: eeprom: at24: check suspend status before disable regulator 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 | 88 +++++++++++++++++++ drivers/misc/eeprom/at24.c | 6 +- include/linux/i2c.h | 2 + 8 files changed, 114 insertions(+), 2 deletions(-)