summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Frid <afrid@nvidia.com>2011-08-19 20:27:34 -0700
committerNiket Sirsi <nsirsi@nvidia.com>2011-08-22 17:46:43 -0700
commit96a6d869cf22757430bdd7f54d53f73c0baefe79 (patch)
tree94c432db7ff290484175876173eeb1d1d3abc1ce
parentca49a65b1a560917220886af36bcc4893d497ac8 (diff)
tegra: nvhost: Set minimum rate for nvhost clocks
Define minimum rate level for nvhost clocks that is applied to all user space clients requests. Actually set minimum rate for EMC clock. Bug 859515 Change-Id: I85a7e835bacb11fd794cda6916e397e0f3cbd728 Reviewed-on: http://git-master/r/48325 Tested-by: Yu-Huan Hsu <yhsu@nvidia.com> Tested-by: Daniel Solomon <daniels@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
-rw-r--r--drivers/video/tegra/host/nvhost_acm.c16
-rw-r--r--drivers/video/tegra/host/nvhost_acm.h1
2 files changed, 14 insertions, 3 deletions
diff --git a/drivers/video/tegra/host/nvhost_acm.c b/drivers/video/tegra/host/nvhost_acm.c
index 9caaf4817257..caa49efbd61c 100644
--- a/drivers/video/tegra/host/nvhost_acm.c
+++ b/drivers/video/tegra/host/nvhost_acm.c
@@ -37,6 +37,8 @@
#define ACM_SUSPEND_WAIT_FOR_IDLE_TIMEOUT (2 * HZ)
#define POWERGATE_DELAY 10
+#define HOST_EMC_FLOOR 300000000
+
void nvhost_module_reset(struct nvhost_module *mod)
{
struct nvhost_master *dev;
@@ -417,7 +419,7 @@ int nvhost_module_get_rate(struct nvhost_module *mod, unsigned long *rate,
int nvhost_module_update_rate(struct nvhost_module *mod, int index)
{
- unsigned long rate = 0;
+ unsigned long rate = mod->min_rate[index];
struct nvhost_module_client *m;
list_for_each_entry(m, &mod->client_list, node) {
@@ -515,10 +517,18 @@ int nvhost_module_init(struct nvhost_module *mod, const char *name,
INIT_LIST_HEAD(&mod->client_list);
while (i < NVHOST_MODULE_MAX_CLOCKS) {
long rate;
- mod->clk[i] = clk_get(dev, get_module_clk_id(name, i));
+ const char *clk_name = get_module_clk_id(name, i);
+ mod->min_rate[i] = 0;
+ mod->clk[i] = clk_get(dev, clk_name);
if (IS_ERR_OR_NULL(mod->clk[i]))
break;
- if (strcmp(name, "gr2d") == 0
+
+ if (strcmp(clk_name, "emc") == 0
+ && tegra_get_chipid() != TEGRA_CHIPID_TEGRA2) {
+ rate = clk_round_rate(mod->clk[i], HOST_EMC_FLOOR);
+ if (!IS_ERR_VALUE(rate))
+ mod->min_rate[i] = rate;
+ } else if (strcmp(name, "gr2d") == 0
&& tegra_get_chipid() != TEGRA_CHIPID_TEGRA2)
rate = clk_round_rate(mod->clk[i], 0);
else
diff --git a/drivers/video/tegra/host/nvhost_acm.h b/drivers/video/tegra/host/nvhost_acm.h
index 42bc89ab9d4b..d021632c020e 100644
--- a/drivers/video/tegra/host/nvhost_acm.h
+++ b/drivers/video/tegra/host/nvhost_acm.h
@@ -50,6 +50,7 @@ struct nvhost_module {
nvhost_modulef func;
struct delayed_work powerdown;
struct clk *clk[NVHOST_MODULE_MAX_CLOCKS];
+ unsigned long min_rate[NVHOST_MODULE_MAX_CLOCKS];
int num_clks;
struct mutex lock;
bool powered;