diff options
-rw-r--r-- | arch/arm/plat-omap/include/plat/rpres.h | 2 | ||||
-rw-r--r-- | drivers/remoteproc/rpres.c | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/include/plat/rpres.h b/arch/arm/plat-omap/include/plat/rpres.h index 0dfb781..08ca599 100644 --- a/arch/arm/plat-omap/include/plat/rpres.h +++ b/arch/arm/plat-omap/include/plat/rpres.h @@ -54,4 +54,6 @@ struct rpres { struct rpres *rpres_get(const char *); void rpres_put(struct rpres *); int rpres_set_constraints(struct rpres *, enum rpres_constraint type, long val); +unsigned long rpres_get_max_freq(struct rpres *obj); + #endif /* _PLAT_OMAP_RPRES_H */ 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; |