[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200504202243.5476-8-sibis@codeaurora.org>
Date: Tue, 5 May 2020 01:52:38 +0530
From: Sibi Sankar <sibis@...eaurora.org>
To: viresh.kumar@...aro.org, sboyd@...nel.org,
georgi.djakov@...aro.org, bjorn.andersson@...aro.org,
saravanak@...gle.com, mka@...omium.org
Cc: nm@...com, agross@...nel.org, david.brown@...aro.org,
robh+dt@...nel.org, mark.rutland@....com, rjw@...ysocki.net,
linux-arm-msm@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
dianders@...omium.org, vincent.guittot@...aro.org,
amit.kucheria@...aro.org, ulf.hansson@...aro.org,
lukasz.luba@....com, sudeep.holla@....com,
Sibi Sankar <sibis@...eaurora.org>
Subject: [PATCH v4 07/12] OPP: Add and export helper to get icc path count
Add and export 'dev_pm_opp_get_path_count' to get the icc path count
associated with the device.
Signed-off-by: Sibi Sankar <sibis@...eaurora.org>
---
drivers/opp/core.c | 20 ++++++++++++++++++++
include/linux/pm_opp.h | 6 ++++++
2 files changed, 26 insertions(+)
diff --git a/drivers/opp/core.c b/drivers/opp/core.c
index f157e2d768d76..6106146a582d5 100644
--- a/drivers/opp/core.c
+++ b/drivers/opp/core.c
@@ -343,6 +343,26 @@ int dev_pm_opp_get_opp_count(struct device *dev)
}
EXPORT_SYMBOL_GPL(dev_pm_opp_get_opp_count);
+int dev_pm_opp_get_path_count(struct device *dev)
+{
+ struct opp_table *opp_table;
+ int count;
+
+ opp_table = _find_opp_table(dev);
+ if (IS_ERR(opp_table)) {
+ count = PTR_ERR(opp_table);
+ dev_dbg(dev, "%s: OPP table not found (%d)\n",
+ __func__, count);
+ return count;
+ }
+
+ count = opp_table->path_count;
+ dev_pm_opp_put_opp_table(opp_table);
+
+ return count;
+}
+EXPORT_SYMBOL_GPL(dev_pm_opp_get_path_count);
+
/**
* dev_pm_opp_find_freq_exact() - search for an exact frequency
* @dev: device for which we do this operation
diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h
index 87ba295080a2b..ffd075c8da0ca 100644
--- a/include/linux/pm_opp.h
+++ b/include/linux/pm_opp.h
@@ -101,6 +101,7 @@ unsigned int dev_pm_opp_get_level(struct dev_pm_opp *opp);
bool dev_pm_opp_is_turbo(struct dev_pm_opp *opp);
int dev_pm_opp_get_opp_count(struct device *dev);
+int dev_pm_opp_get_path_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);
@@ -197,6 +198,11 @@ static inline int dev_pm_opp_get_opp_count(struct device *dev)
return 0;
}
+static inline int dev_pm_opp_get_path_count(struct device *dev)
+{
+ return 0;
+}
+
static inline unsigned long dev_pm_opp_get_max_clock_latency(struct device *dev)
{
return 0;
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Powered by blists - more mailing lists