diff options
author | Colin Cross <ccross@android.com> | 2010-12-07 18:47:38 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2010-12-08 19:44:29 -0800 |
commit | 85f7f645fb1c386b7b01044f2402587d9beda517 (patch) | |
tree | 31ae6e6032d8dc692831d4b875f2cf1bfe6a139b | |
parent | a1243f678346f467701ec5c8026bf28fc97c7056 (diff) |
media: video: tegra: avp_svc: Force memory bus to full when avp is enabled
Change-Id: I51382f58f296df939f99d60926ba97f0b4e04aed
Signed-off-by: Colin Cross <ccross@android.com>
-rw-r--r-- | drivers/media/video/tegra/avp/avp_svc.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/media/video/tegra/avp/avp_svc.c b/drivers/media/video/tegra/avp/avp_svc.c index 57cd8019c305..2eed2891e556 100644 --- a/drivers/media/video/tegra/avp/avp_svc.c +++ b/drivers/media/video/tegra/avp/avp_svc.c @@ -82,6 +82,7 @@ struct avp_svc_info { struct avp_clk clks[NUM_CLK_REQUESTS]; /* used for dvfs */ struct clk *sclk; + struct clk *emcclk; struct mutex clk_lock; @@ -352,6 +353,7 @@ static void do_svc_module_clock(struct avp_svc_info *avp_svc, aclk = &avp_svc->clks[mod->clk_req]; if (msg->enable) { if (aclk->refcnt++ == 0) { + clk_enable(avp_svc->emcclk); clk_enable(avp_svc->sclk); clk_enable(aclk->clk); } @@ -362,6 +364,7 @@ static void do_svc_module_clock(struct avp_svc_info *avp_svc, } else if (--aclk->refcnt == 0) { clk_disable(aclk->clk); clk_disable(avp_svc->sclk); + clk_disable(avp_svc->emcclk); } } mutex_unlock(&avp_svc->clk_lock); @@ -631,8 +634,9 @@ void avp_svc_stop(struct avp_svc_info *avp_svc) pr_info("%s: remote left clock '%s' on\n", __func__, aclk->mod->name); clk_disable(aclk->clk); - /* sclk was enabled once for every clock */ + /* sclk/emcclk was enabled once for every clock */ clk_disable(avp_svc->sclk); + clk_disable(avp_svc->emcclk); } aclk->refcnt = 0; } @@ -682,6 +686,21 @@ struct avp_svc_info *avp_svc_init(struct platform_device *pdev, ret = -ENOENT; goto err_get_clks; } + + avp_svc->emcclk = clk_get(&pdev->dev, "emc"); + if (IS_ERR(avp_svc->emcclk)) { + pr_err("avp_svc: Couldn't get emcclk for dvfs\n"); + ret = -ENOENT; + goto err_get_clks; + } + + /* + * The emc is a shared clock, it will be set to the highest + * requested rate from any user. Set the rate to ULONG_MAX to + * always request the max rate whenever this request is enabled + */ + clk_set_rate(avp_svc->emcclk, ULONG_MAX); + avp_svc->rpc_node = rpc_node; mutex_init(&avp_svc->clk_lock); @@ -694,6 +713,8 @@ err_get_clks: clk_put(avp_svc->clks[i].clk); if (!IS_ERR_OR_NULL(avp_svc->sclk)) clk_put(avp_svc->sclk); + if (!IS_ERR_OR_NULL(avp_svc->emcclk)) + clk_put(avp_svc->emcclk); err_alloc: return ERR_PTR(ret); } @@ -705,6 +726,7 @@ void avp_svc_destroy(struct avp_svc_info *avp_svc) for (i = 0; i < NUM_CLK_REQUESTS; i++) clk_put(avp_svc->clks[i].clk); clk_put(avp_svc->sclk); + clk_put(avp_svc->emcclk); kfree(avp_svc); } |