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: 7643181 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 446A5BF90C for ; Tue, 17 Nov 2015 22:41:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5D1E020494 for ; Tue, 17 Nov 2015 22:41:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2D09520524 for ; Tue, 17 Nov 2015 22:41:15 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZyouH-0005ph-VM; Tue, 17 Nov 2015 22:39:21 +0000 Received: from mail-pa0-x235.google.com ([2607:f8b0:400e:c03::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zyotd-0005X7-LC for linux-arm-kernel@lists.infradead.org; Tue, 17 Nov 2015 22:38:45 +0000 Received: by pacej9 with SMTP id ej9so22065335pac.2 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=amu8Ox2vVDg1R3TxlG4pwUOL+tfvXqLfp2T/dr2X2N8iVk4tvMKU+5NIVT8MY2bttG sfPqT+lpnF8nlLx4i8Bwqwl+FDWW/d2QFRyfxgvwls7rmV39H3+59jvneh7mwImT4voY lA0wltXZWUyz1y9znBQm7AJAvNhuarTXGTqsrIYyo+FVodJVQAX6SpE0GDr6dqhH9gSY KrH/xWylFRMafX8odUJnP7UBd6+Tu9wMYB6zl82fEJj4T2XPcJ2vivBEJHl8G2s5pR4b FvEIkt8SI4dPUwcmvcGWhbOd1LzyhxsXtvZbZP9COw1jtDHPW5o8ZDJ+sO5cmyhHg/To 9MYA== X-Gm-Message-State: ALoCoQmcyIf4T2m3SMzAZwKP6si7/vIx84MGHE0eNMvidY3Rnay/K+o3W7cqNnkCsNj+rDj9thDy 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151117_143841_850657_C4ACA861 X-CRM114-Status: GOOD ( 14.37 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: k.kozlowski@samsung.com, lorenzo.pieralisi@arm.com, ahaslam@baylibre.com, linux-arm-msm@vger.kernel.org, sboyd@codeaurora.org, msivasub@codeaurora.org, geert@linux-m68k.org, Lina Iyer , agross@codeaurora.org, mtitinger@baylibre.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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 {