Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1329912

[PATCH V3 04/16] PM / OPP: Introduce dev_pm_opp_get_max_transition_latency()

Path csiph.com!news.freedyn.net!newsfeed.datemas.de!weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Viresh Kumar <viresh.kumar@linaro.org>
Newsgroups linux.kernel
Subject [PATCH V3 04/16] PM / OPP: Introduce dev_pm_opp_get_max_transition_latency()
Date Tue, 09 Feb 2016 06:10:02 +0100
Message-ID <r08IO-7Ps-7@gated-at.bofh.it> (permalink)
References <r08IN-7Ps-3@gated-at.bofh.it>
X-Original-To Rafael Wysocki <rjw@rjwysocki.net>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=4SNR+SJXPNIoNJJs/ZaKPAEXbQ5t080bR/4wMNvVcYQ=; b=D1Jry6CCDiEBr1Q28JmOeBJdvVnLFAvzdBZGq3YtPVFq3/QjYfkmEBPsuvip0c3F19 f485j55TGs0CDNEtjG2wUM7YjxywW9SDo4mKg04H2bPrYIi/MWQWDXJQGYo4z17ytYcw 6Zrn2FK7OLB/a6sFfPapZ2V47cevWdaDaQMsE=
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:in-reply-to:references; bh=4SNR+SJXPNIoNJJs/ZaKPAEXbQ5t080bR/4wMNvVcYQ=; b=KKOSLUsO1+02mcbmsuaot32PDpuLR64oskXVdSy+OJdbgIxpleBLD9zLm9SFCIDp6V ihCtt2d+ljWPeyiCEBWebFImyvCRc7yAa+uMZqbJYavA0Dx5kj1AibX0wVhDtcCSVuvZ nt8o5Nt+sOSEIsRR4Z2FmIwZVabJfGHdG4Ae1HNlomMN7AIKeQJhnk1GyTmU3JRliSEp NA/E/t178EylCC0KM8nO3WST4cQ8Z1G/tRRx6EGs0kkN4vXn8hh9ld2JsPiMQoynyYtJ NzrYsLbBZTkWpqQc/jMzAextOUwlfmyYQIUsQiOi3LLklQXzq/Wvro1eOe52ax/CYYDj KGPQ==
X-Gm-Message-State AG10YOS+6hccIjNxiirMF6LV94rRRsKmsREWS2GcvwahJdbK7ARQjJFuEG3zk2WNXTozh0E8
X-Received by 10.67.1.164 with SMTP id bh4mr47871565pad.118.1454994087886; Mon, 08 Feb 2016 21:01:27 -0800 (PST)
X-Mailer git-send-email 2.7.1.370.gb2aa7f8
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 64
Organization linux.* mail to news gateway
X-Original-Cc linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Stephen Boyd <sboyd@codeaurora.org>, nm@ti.com, Viresh Kumar <viresh.kumar@linaro.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Len Brown <len.brown@intel.com>, linux-kernel@vger.kernel.org (open list), Pavel Machek <pavel@ucw.cz>, Viresh Kumar <vireshk@kernel.org>
X-Original-Date Tue, 9 Feb 2016 10:30:36 +0530
X-Original-Message-ID <d1b7a10043a011e50c28d9ca95afc6f9d5cad734.1454992186.git.viresh.kumar@linaro.org>
X-Original-References <cover.1454992186.git.viresh.kumar@linaro.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1329912

Show key headers only | View raw


In few use cases (like: cpufreq), it is desired to get the maximum
latency for changing OPPs. Add support for that.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
---
 drivers/base/power/opp/core.c | 17 +++++++++++++++++
 include/linux/pm_opp.h        |  6 ++++++
 2 files changed, 23 insertions(+)

diff --git a/drivers/base/power/opp/core.c b/drivers/base/power/opp/core.c
index ffe2406af882..b0f5c72f0fc3 100644
--- a/drivers/base/power/opp/core.c
+++ b/drivers/base/power/opp/core.c
@@ -290,6 +290,23 @@ unsigned long dev_pm_opp_get_max_volt_latency(struct device *dev)
 EXPORT_SYMBOL_GPL(dev_pm_opp_get_max_volt_latency);
 
 /**
+ * dev_pm_opp_get_max_transition_latency() - Get max transition latency in
+ *					     nanoseconds
+ * @dev: device for which we do this operation
+ *
+ * Return: This function returns the max transition latency, in nanoseconds, to
+ * switch from one OPP to other.
+ *
+ * Locking: This function takes rcu_read_lock().
+ */
+unsigned long dev_pm_opp_get_max_transition_latency(struct device *dev)
+{
+	return dev_pm_opp_get_max_volt_latency(dev) +
+		dev_pm_opp_get_max_clock_latency(dev);
+}
+EXPORT_SYMBOL_GPL(dev_pm_opp_get_max_transition_latency);
+
+/**
  * dev_pm_opp_get_suspend_opp() - Get suspend opp
  * @dev:	device for which we do this operation
  *
diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h
index 5daa43058ac1..59da3d9e11ea 100644
--- a/include/linux/pm_opp.h
+++ b/include/linux/pm_opp.h
@@ -35,6 +35,7 @@ bool dev_pm_opp_is_turbo(struct dev_pm_opp *opp);
 int dev_pm_opp_get_opp_count(struct device *dev);
 unsigned long dev_pm_opp_get_max_clock_latency(struct device *dev);
 unsigned long dev_pm_opp_get_max_volt_latency(struct device *dev);
+unsigned long dev_pm_opp_get_max_transition_latency(struct device *dev);
 struct dev_pm_opp *dev_pm_opp_get_suspend_opp(struct device *dev);
 
 struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev,
@@ -94,6 +95,11 @@ static inline unsigned long dev_pm_opp_get_max_volt_latency(struct device *dev)
 	return 0;
 }
 
+static inline unsigned long dev_pm_opp_get_max_transition_latency(struct device *dev)
+{
+	return 0;
+}
+
 static inline struct dev_pm_opp *dev_pm_opp_get_suspend_opp(struct device *dev)
 {
 	return NULL;
-- 
2.7.1.370.gb2aa7f8

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH V3 04/16] PM / OPP: Introduce dev_pm_opp_get_max_transition_latency() Viresh Kumar <viresh.kumar@linaro.org> - 2016-02-09 06:10 +0100

csiph-web