diff options
author | Karan Jhavar <kjhavar@nvidia.com> | 2011-05-16 17:00:43 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:47:21 -0800 |
commit | 939622838082223cf57304a1252808641da5c5a8 (patch) | |
tree | 8f27981a6f35fc631a7f19740f852cf65b45143e /drivers/video/tegra/host/nvhost_acm.c | |
parent | 8ffe7f45623875526685d9d4ef5096dcee7a5e38 (diff) |
ARM: tegra: power: Refactored kernel powergate code
This change provides a centralized location for powergating modules.
It would take care of switching on/off clocks while un-powergating/
powergating modules respectively.
Bug: 814267
Original-Change-Id: Ic80dc517f634c29085c8e089bdaa32c6fd742710
Reviewed-on: http://git-master/r/31776
Reviewed-by: Niket Sirsi <nsirsi@nvidia.com>
Tested-by: Niket Sirsi <nsirsi@nvidia.com>
Rebase-Id: Rc0aac0edd4e693c15d22d998c882fceeeb85765d
Diffstat (limited to 'drivers/video/tegra/host/nvhost_acm.c')
-rw-r--r-- | drivers/video/tegra/host/nvhost_acm.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/video/tegra/host/nvhost_acm.c b/drivers/video/tegra/host/nvhost_acm.c index e7a890902feb..8d06ee731dca 100644 --- a/drivers/video/tegra/host/nvhost_acm.c +++ b/drivers/video/tegra/host/nvhost_acm.c @@ -41,11 +41,9 @@ void nvhost_module_busy(struct nvhost_module *mod) if (mod->parent) nvhost_module_busy(mod->parent); if (mod->powergate_id != -1) - tegra_powergate_sequence_power_up( - mod->powergate_id, mod->clk[i++]); + tegra_unpowergate_partition(mod->powergate_id); if (mod->powergate_id2 != -1) - tegra_powergate_sequence_power_up( - mod->powergate_id2, mod->clk[i++]); + tegra_unpowergate_partition(mod->powergate_id2); while (i < mod->num_clks) clk_enable(mod->clk[i++]); if (mod->func) @@ -66,14 +64,12 @@ static void powerdown_handler(struct work_struct *work) mod->func(mod, NVHOST_POWER_ACTION_OFF); for (i = 0; i < mod->num_clks; i++) clk_disable(mod->clk[i]); - if (mod->powergate_id != -1) { - tegra_periph_reset_assert(mod->clk[0]); - tegra_powergate_power_off(mod->powergate_id); - } - if (mod->powergate_id2 != -1) { - tegra_periph_reset_assert(mod->clk[1]); - tegra_powergate_power_off(mod->powergate_id2); - } + if (mod->powergate_id != -1) + tegra_powergate_partition(mod->powergate_id); + + if (mod->powergate_id2 != -1) + tegra_powergate_partition(mod->powergate_id2); + mod->powered = false; if (mod->parent) nvhost_module_idle(mod->parent); @@ -175,15 +171,13 @@ int nvhost_module_init(struct nvhost_module *mod, const char *name, * is to disable 3d block power gating. */ if (mod->powergate_id == TEGRA_POWERGATE_3D) { - tegra_powergate_sequence_power_up(mod->powergate_id, - mod->clk[0]); + tegra_unpowergate_partition(mod->powergate_id); clk_disable(mod->clk[0]); mod->powergate_id = -1; } #ifndef CONFIG_ARCH_TEGRA_2x_SOC if (mod->powergate_id2 == TEGRA_POWERGATE_3D1) { - tegra_powergate_sequence_power_up(mod->powergate_id2, - mod->clk[1]); + tegra_unpowergate_partition(mod->powergate_id2); clk_disable(mod->clk[1]); mod->powergate_id2 = -1; } |