summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSubramaniam Chanderashekarapuram <subramaniam.ca@ti.com>2012-06-12 16:08:45 -0500
committerGuillaume Aubertin <g-aubertin@ti.com>2012-06-26 12:20:52 +0200
commit7f2be6dbd25e7a8b6f18b7c4c8999bce74934faf (patch)
tree9c97ff0c5d695c542096f906af6e277bde75d549
parent0bbf992f72190aab568e0dced09bf19946989baa (diff)
rpmsg: resmgr: omap: enable iss optional clock
The Camera usecases require the ISS optional clock to be enabled for complete functionality. This optional clock drives the CSI interfaces required for the camera sensors. The ISS request and release functions now properly enable and disable the optional clock using the clock API directly and using the name retrieved from the platform data. Change-Id: I7f806b79aa86e6badfcd7abaf2ffaf334df29d97 Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com> Signed-off-by: Subramaniam Chanderashekarapuram <subramaniam.ca@ti.com> Signed-off-by: Suman Anna <s-anna@ti.com>
-rw-r--r--drivers/rpmsg/omap_rpmsg_resmgr.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/drivers/rpmsg/omap_rpmsg_resmgr.c b/drivers/rpmsg/omap_rpmsg_resmgr.c
index 499f9a6b33fd..38046d0b7a0c 100644
--- a/drivers/rpmsg/omap_rpmsg_resmgr.c
+++ b/drivers/rpmsg/omap_rpmsg_resmgr.c
@@ -27,6 +27,7 @@
#include <plat/dma.h>
#include <plat/dmtimer.h>
#include <plat/omap-pm.h>
+#include <plat/clock.h>
#include <plat/rpmsg_resmgr.h>
#include "omap_rpmsg_resmgr.h"
@@ -542,13 +543,35 @@ static int rprm_sl2if_request(void **handle, void *data, size_t len)
return _enable_device_exclusive(handle, &dev, "sl2if");
}
+static struct clk *iss_opt_clk;
+
static int rprm_iss_request(void **handle, void *data, size_t len)
{
static struct device *dev;
+ int ret;
+
+ /* enable the iss optional clock, if present */
+ if (iss_opt_clk) {
+ ret = clk_enable(iss_opt_clk);
+ if (ret)
+ return ret;
+ }
return _enable_device_exclusive(handle, &dev, "iss");
}
+static int rprm_iss_release(void *handle)
+{
+ int ret;
+
+ ret = _device_release(handle);
+ /* disable the iss optional clock, if present */
+ if (!ret && iss_opt_clk)
+ clk_disable(iss_opt_clk);
+
+ return ret;
+}
+
static struct rprm_res_ops gptimer_ops = {
.request = rprm_gptimer_request,
.release = rprm_gptimer_release,
@@ -606,7 +629,7 @@ static struct rprm_res_ops sl2if_ops = {
static struct rprm_res_ops iss_ops = {
.request = rprm_iss_request,
- .release = _device_release,
+ .release = rprm_iss_release,
.latency = _device_latency,
.bandwidth = _device_bandwidth,
};
@@ -658,9 +681,15 @@ static int omap_rprm_probe(struct platform_device *pdev)
{
struct omap_rprm_pdata *pdata = pdev->dev.platform_data;
- /* set iss optional clock */
+ /* get iss optional clock if any */
+ if (pdata->iss_opt_clk_name) {
+ iss_opt_clk = omap_clk_get_by_name(pdata->iss_opt_clk_name);
+ if (!iss_opt_clk) {
+ dev_err(&pdev->dev, "error getting iss opt clk\n");
+ return -ENOENT;
+ }
+ }
- iss_opt_clk = pdata->iss_opt_clk;
mach_ops = pdata->ops;
return 0;