From patchwork Thu Dec 21 06:25:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 122506 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp485145qgn; Wed, 20 Dec 2017 22:25:33 -0800 (PST) X-Google-Smtp-Source: ACJfBovd1Ws/FS8UOwaTdgeuQRLt8J/d483skguae8IzpxJmyANkXnTyVAAol2Smyy+sGYH58OUM X-Received: by 10.84.253.139 with SMTP id a11mr9487022plm.136.1513837532998; Wed, 20 Dec 2017 22:25:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513837532; cv=none; d=google.com; s=arc-20160816; b=rwaWa8xtDywvkTGI3glsaHqbjmycpmyaofuQEC0b7+BBLWXLuhUI62+8W8kUQ1xKRu gjbz94mss1nOw0ZGBVIj21XA8v2PKwFwYjK79Uuq0wbUQYQyQFMByD3D9BXldROcS8Mn 0exp0x3jT2FA0IRnhh9foFgwpwlFKUAQRaJNoDUXdO6UjDLLgFyUt6Sj6TDX70xlf2kX orUUn+iAZj1QUxgBOE9Iy7cZzKrRJyOeoLjcLc35Q3zrPsNcLeOBTQY7MS7mzBZvHzud eopEKy8pmTlGNfW3VcVPj3UZhXgoVZPH8ZUYqBC1I9wn++AC7zI68tW6Wh7OXRNC+rig 9cZg== 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=Rd5RS7dlKX2IoqesY95WtPy2zt8MMf9CE1TLe9sS4fE=; b=HwkLV3UPXGrSmtdvlauXKGsIsAuCRvNDpvrVEuCLeK96LeQGUvU+dSmFia9ia8uM09 IB/psFqaj/cdzZonLcpvbgLXZQJn5lEXmA2tGJJETyz79bwkOY//dIyVdQzdcwAJlxOI 6g56sGOYNYhd9rFYx3hdblLH6tkPAMgyFuCRWbp1TxcNS2/p03m21bOXle3FxXlUCkMF G80ry4DOtt7ozdFytnrvuiAYLyB5AT3t82SCdwn47oAZVGdm0e3ECoHz2SJgkDbY1ERx njfnIccyjQn5lelYViiGw4q8I9Qw1GGX2ODOD4fV3PBU4PvSldMnps4AIOF2XMH5f6RJ fMoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VM1JrACC; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (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 f7si14620439pln.789.2017.12.20.22.25.32; Wed, 20 Dec 2017 22:25:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VM1JrACC; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750871AbdLUGZ1 (ORCPT + 6 others); Thu, 21 Dec 2017 01:25:27 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:43494 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750797AbdLUGZ0 (ORCPT ); Thu, 21 Dec 2017 01:25:26 -0500 Received: by mail-pg0-f65.google.com with SMTP id b18so12892366pgv.10 for ; Wed, 20 Dec 2017 22:25:26 -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=ObNIyRGoIKBTyDo6l3gUBs2auV+y4/OnpU5rhIJ4Quw=; b=VM1JrACCPh//B3uqwgTCTcnQo56Se045moKKwE3adElg+5DdH4AQ9B0g55FLE6PKEb 9f71uzGgXEz1yvzm8U8v9RTeYAuZFvLjOFzEKkgRjrVKK+WU+CgYfehNvYqf+hTLetAc lD9FvBnQtdgx8LGJDakNojjO1EDcvdYJViSBw= 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=ObNIyRGoIKBTyDo6l3gUBs2auV+y4/OnpU5rhIJ4Quw=; b=lSgS+5VWvEVaCN1lbwLUyF3cnzWQ//qnhzy0W57I3WG6vlnbsrVQzyyKv9uyE08eMH m0IBwbgwVkWB8e4OK1Q+bqER/N06G75PNBQlRJ6y22MXLuqdex4XVWY0zjau/5Cj11Xj QasoPuTx7qx/HfBJ5vGaLOOgG9MGzrDiT5BeaubIQyy04/BYVjOLgjOjDBZcT8CnyhKy jRnkqCNyIW/RoIP5GRoVsdsqaT7DlSSHinuVn982tdIBG1pqubWoGEiZ9dajHiNruKYx yiO9TzuQEN7TrxRuuHL+bjVWmGDB1mUyjnE5ykop3+tEgs4diaw5L/2yT9DlE1/DZHtC lHmQ== X-Gm-Message-State: AKGB3mJZljZ+hbSVB67/lDs94bT88DaMZHsvKzA7Ln3bnOKJht+lFulA H/aIFjU2bUR/FbqQnT8hzaPTHg== X-Received: by 10.99.119.129 with SMTP id s123mr8259300pgc.50.1513837526371; Wed, 20 Dec 2017 22:25:26 -0800 (PST) Received: from ubt.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id o88sm36970683pfj.175.2017.12.20.22.25.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Dec 2017 22:25:24 -0800 (PST) From: Chunyan Zhang To: Mark Brown , Rob Herring Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Chunyan Zhang Subject: [PATCH 0/5] Add regulator suspend and resume support Date: Thu, 21 Dec 2017 14:25:01 +0800 Message-Id: <1513837506-26543-1-git-send-email-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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. Any comments would be greatly appreciated. Thanks, Chunyan 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 | 11 +- drivers/regulator/core.c | 342 ++++++++++++++------- drivers/regulator/internal.h | 18 +- drivers/regulator/of_regulator.c | 18 +- include/linux/regulator/driver.h | 2 + include/linux/regulator/machine.h | 31 +- 6 files changed, 299 insertions(+), 123 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html