aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r--drivers/remoteproc/rpres.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/remoteproc/rpres.c b/drivers/remoteproc/rpres.c
index 186a63b..7a200a4 100644
--- a/drivers/remoteproc/rpres.c
+++ b/drivers/remoteproc/rpres.c
@@ -15,6 +15,7 @@
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/err.h>
+#include <linux/opp.h>
#include <plat/omap_device.h>
#include <plat/rpres.h>
@@ -124,6 +125,22 @@ int rpres_set_constraints(struct rpres *obj, enum rpres_constraint type,
}
EXPORT_SYMBOL(rpres_set_constraints);
+unsigned long rpres_get_max_freq(struct rpres *obj)
+{
+ struct platform_device *pdev = obj->pdev;
+ struct opp *opp;
+ unsigned long maxfreq = ULONG_MAX;
+
+ rcu_read_lock();
+ opp = opp_find_freq_floor(&pdev->dev, &maxfreq);
+ if (IS_ERR(opp))
+ maxfreq = 0;
+ rcu_read_unlock();
+
+ return maxfreq;
+}
+EXPORT_SYMBOL(rpres_get_max_freq);
+
static int rpres_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;