diff options
author | Juan Gutierrez <jgutierrez@ti.com> | 2012-08-03 18:58:34 -0500 |
---|---|---|
committer | Ziyann <jaraidaniel@gmail.com> | 2014-10-01 12:58:53 +0200 |
commit | 042c5a29f894a84bae794a44532bed4afa949d92 (patch) | |
tree | 7e610142cace21b07ae25f0582baeea191153ce6 | |
parent | 7b6c790adcb99ce9ae49e0965dfa9c418cf37bbe (diff) | |
download | kernel_samsung_tuna-042c5a29f894a84bae794a44532bed4afa949d92.zip kernel_samsung_tuna-042c5a29f894a84bae794a44532bed4afa949d92.tar.gz kernel_samsung_tuna-042c5a29f894a84bae794a44532bed4afa949d92.tar.bz2 |
omap: rpres: add api to lookup max frequency for a remote device
A new public function, rpres_get_max_freq, is added to perform a
lookup for the maximum supported frequency from the OPP table for
a remote processor device.
This API can be used by the remote resource layer in sharing this
data to the remote processor application code for performing power
related policy decisions.
Change-Id: Idbea6884fa47b3bd1f000b6f696fbbcf7036a6ee
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Juan Gutierrez <jgutierrez@ti.com>
Signed-off-by: Paul Hunt <hunt@ti.com>
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
-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 e839f70..56dad98 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> @@ -123,6 +124,22 @@ int rpres_set_constraints(struct rpres *obj, enum rpres_constraint type, long va } 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; |