From patchwork Fri Jan 12 10:18:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 124264 Delivered-To: patch@linaro.org Received: by 10.80.140.226 with SMTP id r31csp1693850edr; Fri, 12 Jan 2018 02:18:55 -0800 (PST) X-Google-Smtp-Source: ACJfBovDhz6axFaoFlLYv+SpruHjGA/Kck4kdwXe+wSoXeO1vKrPLWGfDsfwSQJ+wcYZEWsR/QUk X-Received: by 10.84.244.2 with SMTP id g2mr19928029pll.206.1515752335014; Fri, 12 Jan 2018 02:18:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515752335; cv=none; d=google.com; s=arc-20160816; b=r2x9fgkZ+t2lZSiuq0Ow43D4IT8wSAHuZDmYAJEMGbc/IVkfAUfaRC5W63F6XDzE9h Rin9CPI2mjhWy5TiWSbaakIOYWIdS9uCq/jAfxepGN43TYliq31ofYk51cDyd30gN6JO gLvhrmYsiqC1fq4p1dPnXR6Crt0KtM3S2Qa22y69Ebd7193hdvd/aWimrI5uzvkzLpOI xMZ10tjmUvXISbPml3hrRG2D5wj+YAEqGCSI7KfIccX+cvTmtctdEq+ZUdy+3TZNXicq Jq9HbygoKmXQ75S60r+FPiFL/GwMsuydqfT1M2erEm08VgjNlU4ihnqrb1khzI4LI3Xh XShg== 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=XZAG2B1zMXVrrgNmE4JKBpRSPZzYYWZE9nVO5HqR3f8=; b=YfLK5agmOogalPDYTJBhCwOLIrS6EVZF0k9yW8hkNm4fwzXLkJ0jadY+orwk8zMhj1 DvsPugyP/5AsiiphFiUKkb+vE6HrdDIQ6SnGTOy2lW4T87xtFgXUVZQnyCh/Y+OHp/Nu wCPr3bThHTFaX86S0h8Fn42dOsAE5GAHUJcRqzDHsGr4jfmOZUUPREwhIG+lGF8P7rMG V6UZLrWgCpNUIqFCRZgSvKbYhDepa7BPCMziHCHjXYXuhJdJjrj/9wSrI32Z5wy8YLfS 2dRRLcdklPvaJLuXvYkNvVN+wefO1NC6udrk7RSH8RceW5YNvfwACCtZ9Iqgs1U0ee0p a4EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XRJ5eHkH; 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 w63si15085953pfd.289.2018.01.12.02.18.54; Fri, 12 Jan 2018 02:18:55 -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=XRJ5eHkH; 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 S1754660AbeALKSx (ORCPT + 6 others); Fri, 12 Jan 2018 05:18:53 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:39405 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754494AbeALKSw (ORCPT ); Fri, 12 Jan 2018 05:18:52 -0500 Received: by mail-pf0-f193.google.com with SMTP id e11so4080488pff.6 for ; Fri, 12 Jan 2018 02:18:52 -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=ooIC8YqSoG6TTyXq8RqHiNkZn8obbbSSTP8B6fkHPmM=; b=XRJ5eHkH+938+0ttXDGDsAZ4r9RV14aKwlStdYnInukVYepsPXEcis9uWswCR7cT3A LeQKmrv4bZK/ASz8Q8pnWT3DS6m2uyF/6ItcYirWX5ek+N+oNwpv1UHIv4vyr6nW40is b9eZPHKprZG+ZcLOYxnsNUEDtegNHZYigbvdY= 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=ooIC8YqSoG6TTyXq8RqHiNkZn8obbbSSTP8B6fkHPmM=; b=Ca/qkuFhic5E48SpfP2HqkVLeJpLSDpCa4I3dCEVKnROqQEZ48pB/Su7xTR1sfD5VW Ky37TDfnAy9ImREqPKaio4V0eA9ynmdM37prOKIWDX3fQ7gCSiZnsdvcfARctrSgacPY z94hgLyzeOapQIRKs6IYiTl97Ab+AjaHecXPChPza2NCJGIqM9PTMfHAGyHJ2lM6XVQK p6bzzWT+nQ/ruy1lorD+7tgJBnJ8BGPt+UDSLuclE9CupijWjrRvpWoRlToYO2GIx4Kw cKeOxZinxaOqkVOMjmvHwJGgiQViM7+4P3ExIgaUBJNAZXBCSpGFf1wpgYvU1FYg6QWC v6sw== X-Gm-Message-State: AKwxytd6IUVknVUjkO/FyvKb3xUaq9mjisjpMKkvQnfcNjme6chn7gxq htDdjR8prK/eYw4j0FwP5+ur7c/pjHc= X-Received: by 10.159.194.204 with SMTP id u12mr7153909plz.396.1515752331470; Fri, 12 Jan 2018 02:18:51 -0800 (PST) Received: from ubt.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id m22sm44692613pfg.120.2018.01.12.02.18.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Jan 2018 02:18:50 -0800 (PST) From: Chunyan Zhang To: Mark Brown , Rob Herring Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Ulf Hansson , Arnd Bergmann , Chunyan Zhang Subject: [PATCH v3 0/5] Add regulator suspend and resume support Date: Fri, 12 Jan 2018 18:18:20 +0800 Message-Id: <1515752305-15907-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 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. Changes from V2: (https://lkml.org/lkml/2018/1/4/75) * Correct the typo; * Removed redundant comments; * Export regulator_suspend_enable/disable(), on't call these two functions in regulator_set_suspend_voltage() instead; * Checking if rstate->min_uV == rstate->max_uV instead of checking the flag. 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 | 15 +- drivers/regulator/core.c | 336 ++++++++++++++------- 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, 302 insertions(+), 126 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