diff options
author | Juan Gutierrez <jgutierrez@ti.com> | 2012-08-03 18:58:34 -0500 |
---|---|---|
committer | Dmytro Kedrovskyi <x0169235@ti.com> | 2012-08-09 14:30:19 +0300 |
commit | 688e3990fadbed8275977f41bdad23288ec3719b (patch) | |
tree | ee09b321a96c9213731b4e13d7aa021dfcf71c55 /drivers/remoteproc | |
parent | 6b67035734f91d50bf8f1a5a8e6956247fe2182c (diff) | |
download | kernel_samsung_espresso10-688e3990fadbed8275977f41bdad23288ec3719b.zip kernel_samsung_espresso10-688e3990fadbed8275977f41bdad23288ec3719b.tar.gz kernel_samsung_espresso10-688e3990fadbed8275977f41bdad23288ec3719b.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>
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r-- | drivers/remoteproc/rpres.c | 17 |
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; |