From patchwork Tue Nov 17 22:37:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lina Iyer X-Patchwork-Id: 56886 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp2218069lbb; Tue, 17 Nov 2015 14:38:35 -0800 (PST) X-Received: by 10.66.140.79 with SMTP id re15mr66125643pab.127.1447799905389; Tue, 17 Nov 2015 14:38:25 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ax2si60766904pbd.123.2015.11.17.14.38.25; Tue, 17 Nov 2015 14:38:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932473AbbKQWiY (ORCPT + 11 others); Tue, 17 Nov 2015 17:38:24 -0500 Received: from mail-pa0-f48.google.com ([209.85.220.48]:36360 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754985AbbKQWiW (ORCPT ); Tue, 17 Nov 2015 17:38:22 -0500 Received: by pacdm15 with SMTP id dm15so22071636pac.3 for ; Tue, 17 Nov 2015 14:38:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CiOHlHuozJcCtoRhK2qlP7NAQ6owJX15cCyfS38ylEc=; b=p4dmfHClGYm7c6CmgnN0wZflaZa6VY97fxdTSq+Tt6PHWqPigKrFpArn1kydWbTSR0 bwvx1+YlLSlC74e5mhUj6TsJ7ANWKdSwP81GLW0iMSu3zlxw2weW2Xmnla6MdGVHB7ms VBRGWeM9Lm913/Ada8AtqZLMAWL8Ue5SgwD8Fc0d0hKXO4Xw12U8nmcDDGLSAMEZKuH3 gI9M8Mx1dNSl0+RoPT4RlE/uq89mBM0yHusJJNfq9l3QdA5PKqo3CLvL72LjVa5rlMkk 2gvjJoGL0JEHr1Q/jYJ0BTOItpASpUB9FHPPBT7vsQ62azncrRUalgt1dywfPcAZJQQ7 koSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CiOHlHuozJcCtoRhK2qlP7NAQ6owJX15cCyfS38ylEc=; b=Tgy0x0Us5JKrJcFUCDLJnEGgz/QUs1N58WjsP3KRf+BvXKLfDwWw7rXrJx+YtwTmGB RYkhtWmHZlOhCsMP6dtkNQp9LtR+7Jxx/41jpcLkdRP9JIr8sjc/jBV93wU83EKZw4bD 5ScdNpfnt4ibXj/nnzrGA2l/7S5ZkRSjDtR1BvZu53H2+2sNB8ma2QsP2ZS99WSb2rT2 3s5yJqJv6eUs3JMQv20ISrUlHqH3Okkl9UD6EVvR8lfHnxv8HMo33xbRr8A3H8fCZo3N muSqiesWvCsfAXdOpcdctV3JbqUlqAVeAdYJdRnR4Os9Nxn7vS9XfWZNfpRh+mLjaMQt fNww== X-Gm-Message-State: ALoCoQkpac7TVNDmsRzMtplWjeaG+ctrp3J3NJL0188tR6+DUhoB8QjRXISnNJMH9x5F6mES6+OH X-Received: by 10.66.55.101 with SMTP id r5mr51254998pap.94.1447799902132; Tue, 17 Nov 2015 14:38:22 -0800 (PST) Received: from ubuntu.localdomain ([8.42.77.226]) by smtp.gmail.com with ESMTPSA id hy1sm14875199pbb.63.2015.11.17.14.38.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Nov 2015 14:38:21 -0800 (PST) From: Lina Iyer To: ulf.hansson@linaro.org, khilman@linaro.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: geert@linux-m68k.org, k.kozlowski@samsung.com, msivasub@codeaurora.org, agross@codeaurora.org, sboyd@codeaurora.org, linux-arm-msm@vger.kernel.org, lorenzo.pieralisi@arm.com, ahaslam@baylibre.com, mtitinger@baylibre.com, Lina Iyer Subject: [PATCH RFC 03/27] PM / Domain: Add additional state specific param Date: Tue, 17 Nov 2015 15:37:27 -0700 Message-Id: <1447799871-56374-4-git-send-email-lina.iyer@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1447799871-56374-1-git-send-email-lina.iyer@linaro.org> References: <1447799871-56374-1-git-send-email-lina.iyer@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Allow domain states to hold additional state related data in a u32 value. This may be used by the platform driver. Signed-off-by: Lina Iyer --- Documentation/devicetree/bindings/power/power_domain.txt | 6 ++++++ drivers/base/power/domain.c | 6 ++++++ include/linux/pm_domain.h | 1 + 3 files changed, 13 insertions(+) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Documentation/devicetree/bindings/power/power_domain.txt b/Documentation/devicetree/bindings/power/power_domain.txt index e2f542e..ecfaf44 100644 --- a/Documentation/devicetree/bindings/power/power_domain.txt +++ b/Documentation/devicetree/bindings/power/power_domain.txt @@ -67,6 +67,12 @@ have the following properties - If omitted, this is assumed to be equal to: entry-latency-us + exit-latency-us + - state-param: + Usage: Optional + Value type: + Definition: A u32 value as defined by the state. May be used + by the driver to hold state related u32 data. + Example: power: power-controller@12340000 { diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index fe1be88..3fb4c93 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1245,6 +1245,7 @@ static int genpd_alloc_states_data(struct generic_pm_domain *genpd, st[i].power_on_latency_ns; genpd->states[i].power_off_latency_ns = st[i].power_off_latency_ns; + genpd->states[i].param = st[i].param; } /* @@ -1527,6 +1528,7 @@ static int of_get_genpd_power_state(struct genpd_power_state *genpd_state, const struct of_device_id *match_id; int err = 0; u32 latency; + u32 param; match_id = of_match_node(power_state_match, state_node); if (!match_id) @@ -1567,6 +1569,10 @@ static int of_get_genpd_power_state(struct genpd_power_state *genpd_state, return -EINVAL; } + err = of_property_read_u32(state_node, "state-param", ¶m); + if (!err) + genpd_state->param = param; + genpd_state->power_off_latency_ns = 1000 * latency; return 0; diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index e425911..15df24c 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -41,6 +41,7 @@ struct genpd_power_state { char *name; s64 power_off_latency_ns; s64 power_on_latency_ns; + u32 param; }; struct generic_pm_domain {