summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSubramaniam Chanderashekarapuram <subramaniam.ca@ti.com>2012-06-18 17:46:40 -0500
committerAndy Green <andy.green@linaro.org>2012-09-07 13:05:42 +0800
commit72a42216472eff5bc73fa3e7cbecc30577b34d99 (patch)
tree3db0af7d3859b96f84a593efc8c0bf1787ca445f /drivers
parentac9d57d673cd1d8fb541f9a2a4dac48ff114c736 (diff)
remoteproc: omap: use pm qos api for memory throughput
The omap remoteproc driver expects the bandwidth API (for memory throughput requests) to be defined by the device platform data. This is no longer required since the pm_qos API would be used for requesting the same. The patch removes the machine specific calls for throughput and calls the pm_qos APIs from the omap remoteproc driver. Change-Id: Iad71a08017171c818915963963099a576af040f9 Signed-off-by: Subramaniam Chanderashekarapuram <subramaniam.ca@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/remoteproc/omap_remoteproc.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c
index e4db09f0cec7..6d1606d77310 100644
--- a/drivers/remoteproc/omap_remoteproc.c
+++ b/drivers/remoteproc/omap_remoteproc.c
@@ -49,6 +49,7 @@
* @rproc: rproc handle
* @boot_reg: virtual address of the register where the bootaddr is stored
* @qos_req: for requesting latency constraints for rproc
+ * @bw_req: for requesting L3 bandwidth constraints on behalf of rproc
* @pm_comp: completion needed for suspend respond
* @idle: address to the idle register
* @idle_mask: mask of the idle register
@@ -63,6 +64,7 @@ struct omap_rproc {
struct rproc *rproc;
void __iomem *boot_reg;
struct dev_pm_qos_request qos_req;
+ struct pm_qos_request bw_req;
atomic_t thrd_cnt;
struct completion pm_comp;
void __iomem *idle;
@@ -190,14 +192,9 @@ omap_rproc_set_latency(struct device *dev, struct rproc *rproc, long val)
static int
omap_rproc_set_bandwidth(struct device *dev, struct rproc *rproc, long val)
{
- struct platform_device *pdev = to_platform_device(rproc->dev.parent);
- struct omap_rproc_pdata *pdata = pdev->dev.platform_data;
-
- /* Call device specific api if any */
- if (pdata->ops && pdata->ops->set_bandwidth)
- return pdata->ops->set_bandwidth(dev, rproc, val);
+ struct omap_rproc *oproc = rproc->priv;
- /* TODO: call platform specific */
+ pm_qos_update_request(&oproc->bw_req, val);
return 0;
}
@@ -480,6 +477,9 @@ static int __devinit omap_rproc_probe(struct platform_device *pdev)
if (ret)
goto iounmap;
+ pm_qos_add_request(&oproc->bw_req, PM_QOS_MEMORY_THROUGHPUT,
+ PM_QOS_MEMORY_THROUGHPUT_DEFAULT_VALUE);
+
ret = rproc_register(rproc);
if (ret)
goto remove_req;
@@ -487,6 +487,7 @@ static int __devinit omap_rproc_probe(struct platform_device *pdev)
return 0;
remove_req:
+ pm_qos_remove_request(&oproc->bw_req);
dev_pm_qos_remove_request(&oproc->qos_req);
iounmap:
if (oproc->idle)
@@ -509,6 +510,7 @@ static int __devexit omap_rproc_remove(struct platform_device *pdev)
if (oproc->boot_reg)
iounmap(oproc->boot_reg);
+ pm_qos_remove_request(&oproc->bw_req);
dev_pm_qos_remove_request(&oproc->qos_req);
return rproc_unregister(rproc);
}