Received: by 10.223.176.46 with SMTP id f43csp673630wra; Fri, 26 Jan 2018 05:11:30 -0800 (PST) X-Google-Smtp-Source: AH8x225WTh1eGBr7jOjZMeUlDvdIM6MDH7GUy5FYSn5pbq0qzl13T4g7KimcqmC2lXtdnzwRSzUl X-Received: by 2002:a17:902:7597:: with SMTP id j23-v6mr4839029pll.191.1516972290795; Fri, 26 Jan 2018 05:11:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516972290; cv=none; d=google.com; s=arc-20160816; b=iaQBC+EfchpQmOOPEvjca7NJ38/FHJ5O4A9VFWv8mYM4FNbaqFSMCtMMErt2C38t6H N9Ehhh7kOG9IJsvUEajMAiDSc4Dhu4Nnrp0p8by9VWd0EXahg/xDrvAx80rif8YLV3Rr Ahn8zxp2yNFd2nr5L2kgFP5uwAXVda9WCPPU6siOlW8cRneVBlTw0EEWlAlyUp2Rbtiq 5A8eGM+rI+LAQjESsKppqztJhSIljI0iXaSnOW/Z+v8s6KD1JxeFVftRLOR7kqTK4/0m W6Su1JEE5h2WN139avu4/9CZi8fRyWaEBlqJBI5uKnM7ACCjuCbr10z7x2o8XbfG3OQq BCOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=/VQiUOViCOmkJxfW4KaOe3eb0ccrivWaLGTVh06Y4MY=; b=FW7ZmEDWs7oYHS2zzS4SWaRd+XgGZEYc46xfMNdxSCILy+E1BejgvumcbRW8edUtOi rn8wbRPRhN2jt1vbH2XKGhfEQaDsmIY41qsPp2QWNaTequpo/LIN+oYfYQd11C53NFRz /gfDTwqZw0OvU7ay1I6foAO4rWq0kCfhOp/0tpNAVg5I7pQuuZhKiDpJwLIFOvPWt2/l 5VjSV7K/0QdkZ8Sp/Nxyj9r3jY3xryPX4YC/NOCmF+K0E3UzTwFjKRzSRyFeHWWl36Ae Bk39plR3IpnU7rT2rwZJYn1qae6JxbR53vCg13i7JVRd0kKrcpkRh8bvQCLyrOhIK9nq 5ELQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DgvHktoU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h8-v6si3715256pll.421.2018.01.26.05.11.16; Fri, 26 Jan 2018 05:11:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DgvHktoU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751507AbeAZNJH (ORCPT + 99 others); Fri, 26 Jan 2018 08:09:07 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:41648 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751174AbeAZNJG (ORCPT ); Fri, 26 Jan 2018 08:09:06 -0500 Received: by mail-pg0-f67.google.com with SMTP id 136so240208pgd.8 for ; Fri, 26 Jan 2018 05:09:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=/VQiUOViCOmkJxfW4KaOe3eb0ccrivWaLGTVh06Y4MY=; b=DgvHktoUA3Rhu41nNYNHibm/2nnKNqBDdEZ1ULdD3GJd0ISpa2j1zwGMNrAW4y4327 CtcRINFUmLR5HoZb3/YE5W+tcMH4gkjcElX4k+9d6Kmv78Z7SfC1lIhUyblJDajF8pis TfKz9LEDFCejJuxHAeU+w60TAGETrqV9Z1dwg= 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; bh=/VQiUOViCOmkJxfW4KaOe3eb0ccrivWaLGTVh06Y4MY=; b=S3cn4rToNgeOnmClgnZEmcJzrqCjuKB7F7NL3acheg6MTdMs972vVtzOqPGOGzBL21 Fgm3zSAdLoFVs37gpuKDetoBf0Sb7+1ETh/KTsRl3z26DCZ5beSGFBiVAjdnrqWQQj2f +TZHs4J9n1JvjrewBeoF3mZYTjz2ddfmkplC/TL1OJtq+2h6mpSPEg28Koe2ybOpM+iy hW4nAYiwgtBNkvrCngLtVnCXL1CMmSPKLbPzQqxUWBtUII/+6jAE8v5+aIM3VAgizuFv e4w8mWoldJ0uIehF01jOosseZNO5+EOdxRh9C5o1xzj6jJn8ollkG8e8wx5y4jItkx// Byvg== X-Gm-Message-State: AKwxytdhaJ47S+4v4LW5zGYzxM/tUXGkF83Hhmlazwn4rzfGE8yDB0Ac bCAEHxzR5dnj8jPhHSZ04IbVcQ== X-Received: by 10.99.97.87 with SMTP id v84mr15841250pgb.342.1516972145676; Fri, 26 Jan 2018 05:09:05 -0800 (PST) Received: from ubt.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id b6sm18663238pfe.85.2018.01.26.05.09.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Jan 2018 05:09:04 -0800 (PST) From: Chunyan Zhang To: Mark Brown , Rob Herring Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Chunyan Zhang Subject: [PATCH V5 0/5] Add regulator suspend and resume support Date: Fri, 26 Jan 2018 21:08:42 +0800 Message-Id: <1516972127-972-1-git-send-email-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chunyan Zhang Some systems need to set regulators to specific states when they enter low power modes, especially around CPUs. Currently the regulator driver, for suspend and resume features, provides two functions which are exported for being called directly by any modules or subsystems when they thought the regulator should be entering into suspend states. This patchset adds hooks to PM suspend core and provides suspend/resume callback functions to regulator device, for those who can be switched off or set low voltage in suspend states only need to implement the callback functions in the driver, and set the right configurations for suspend states via device tree and the APIs which regulator core driver provides. Those drivers who use the old interfaces - i.e. regulator_suspend_prepare() and regulator_suspend_finish() should stop using that, since we leave these two functions empty and plan to remove them one day in the future. Thanks, Chunyan Changes from V4: (https://lkml.org/lkml/2018/1/23/220) * Fixed the kbuild-test error, the glable variable 'pm_suspend_target_state' only can be referred when CONFIG_SUSPEND is selected. * Added Rob's Reviewed-by. Changes from V3: * Addressed comments from Rob: - Rephrase the binding documentation. Changes from V2: (https://lkml.org/lkml/2018/1/4/75) * Correct the typo; * Removed redundant comments; * Export regulator_suspend_enable/disable(), don't call these two functions in regulator_set_suspend_voltage() instead; * Checking if rstate->min_uV == rstate->max_uV instead of checking the flag when setting the suspend voltage. Changes from V1: (https://lkml.org/lkml/2017/12/21/9) * Rephrased the commit message of patch 0001; * Declared the property 'regulator-suspend-microvolt' deperated and documented the way recommended; * Revised of_regulator.c, use suspend_state::min_uV as default suspend voltage if the property 'regulator-suspend-microvolt' is not used. Chunyan Zhang (5): bindings: regulator: added support for suspend states regulator: make regulator voltage be an array to support more states drivers: regulator: leave one item to record whether regulator is enabled drivers: regulator: empty the old suspend functions regulator: add PM suspend and resume hooks .../devicetree/bindings/regulator/regulator.txt | 12 +- drivers/regulator/core.c | 346 ++++++++++++++------- drivers/regulator/internal.h | 18 +- drivers/regulator/of_regulator.c | 20 +- include/linux/regulator/driver.h | 2 + include/linux/regulator/machine.h | 37 ++- 6 files changed, 309 insertions(+), 126 deletions(-) -- 2.7.4