From patchwork Fri May 7 13:14:01 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: 432230 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=-14.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 CF84DC433ED for ; Fri, 7 May 2021 13:14:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9734061468 for ; Fri, 7 May 2021 13:14:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237130AbhEGNPO (ORCPT ); Fri, 7 May 2021 09:15:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbhEGNPM (ORCPT ); Fri, 7 May 2021 09:15:12 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FB12C061574 for ; Fri, 7 May 2021 06:14:12 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id v20so5108089plo.10 for ; Fri, 07 May 2021 06:14:12 -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=sCOlyOIFiZk09QTc1wpSf9iIiwmNKJWxQ3gP9jIAbQE=; b=mSpLQhA/xa8vnl35yPqcyaIJv5x2iKpQ79RnozczBUFtCog64lxWk+cW6iEUvnFZR5 lXSMgIKXAE+diRkzI4rU8zgP6i0MQrZOM4NA32+kAechGNEOToZDzav/4bI5gQVttTG+ v8FkMm6GIZHzU8+QlMXwDkCy0gAB50XFsATUM= 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=sCOlyOIFiZk09QTc1wpSf9iIiwmNKJWxQ3gP9jIAbQE=; b=l2+kj2eV5abpAQ0kAaNHKib53KN0+pnK/ytHzjJ+L28VhrR5uVA09XWyygTE6APcxW NsDBlLuzwisoRAgEAKO5O6eoxpeR4jb2El14uJsLtjIEuNktZloQy3s+NX3Du0eGa1ys 285vXoauQhf8J74s85KwgQTAAVFbNM3rRexFQREtaWd6v8RpeM2E0nT980t8upu7Ittz D4eRle9YgU/7JeWCcHmQH6EjtZDzjP+KxfNQLpkp6Dwg/qvj/zy7tdG7LF14k/EpOeNF gdZHjJ3fDRG30aZiNJ6QP77rC7bL8uW4IQd01fek9SjGtAty82WCqo3AihSSZrbKyj0l LRwA== X-Gm-Message-State: AOAM5318/rz5IqikRWqC369yVuw8bQ+NtUf64YdVKwdTLduTpqjWgWk3 32UVxEKOCj1yLijI6dPWeGVlitbZ6np/Jg== X-Google-Smtp-Source: ABdhPJy9qeTIxg0nqdJ7guKT0auSMto/VTPsSqmgPnb9RJpyRnb5vWAaDpYKTMsGNe7bTpd2JRQCJQ== X-Received: by 2002:a17:90a:a589:: with SMTP id b9mr10307171pjq.80.1620393251736; Fri, 07 May 2021 06:14:11 -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.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 May 2021 06:14:11 -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 0/5] add power control in i2c Date: Fri, 7 May 2021 21:14:01 +0800 Message-Id: <20210507131406.2224177-1-hsinyi@chromium.org> X-Mailer: git-send-email 2.31.1.607.g51e8a6a459-goog MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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 (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 | 95 +++++++++++++++++++ drivers/misc/eeprom/at24.c | 6 +- include/linux/i2c.h | 2 + 8 files changed, 121 insertions(+), 2 deletions(-) Reviewed-by: Matthias Brugger Reviewed-by: Matthias Brugger Reviewed-by: Qii Wang