summaryrefslogtreecommitdiff
path: root/drivers/rpmsg/omap_rpmsg_resmgr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rpmsg/omap_rpmsg_resmgr.c')
-rw-r--r--drivers/rpmsg/omap_rpmsg_resmgr.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/rpmsg/omap_rpmsg_resmgr.c b/drivers/rpmsg/omap_rpmsg_resmgr.c
index c856eeee73f7..a0e712430db4 100644
--- a/drivers/rpmsg/omap_rpmsg_resmgr.c
+++ b/drivers/rpmsg/omap_rpmsg_resmgr.c
@@ -570,6 +570,21 @@ static int _device_bandwidth(struct device *rdev, void *handle,
return 0;
}
+static unsigned long _get_max_freq(void *handle)
+{
+ struct rprm_gen_device_handle *obj = handle;
+ struct opp *opp;
+ unsigned long maxfreq = ULONG_MAX;
+
+ rcu_read_lock();
+ opp = opp_find_freq_floor(obj->dev, &maxfreq);
+ if (IS_ERR(opp))
+ maxfreq = 0;
+ rcu_read_unlock();
+
+ return maxfreq;
+}
+
static int rprm_iva_request(void **handle, void *data, size_t len)
{
static struct device *dev;
@@ -664,6 +679,7 @@ static struct rprm_res_ops iva_ops = {
.latency = _device_latency,
.bandwidth = _device_bandwidth,
.scale = _device_scale,
+ .get_max_freq = _get_max_freq,
};
static struct rprm_res_ops iva_seq0_ops = {
@@ -682,6 +698,7 @@ static struct rprm_res_ops fdif_ops = {
.latency = _device_latency,
.bandwidth = _device_bandwidth,
.scale = _device_scale,
+ .get_max_freq = _get_max_freq,
};
static struct rprm_res_ops sl2if_ops = {
@@ -694,6 +711,7 @@ static struct rprm_res_ops iss_ops = {
.release = rprm_iss_release,
.latency = _device_latency,
.bandwidth = _device_bandwidth,
+ .get_max_freq = _get_max_freq,
};
static struct rprm_res omap_res[] = {