@@ -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
@@ -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;
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@codeaurora.org> --- drivers/opp/core.c | 20 ++++++++++++++++++++ include/linux/pm_opp.h | 6 ++++++ 2 files changed, 26 insertions(+)