diff options
author | Jaiprakash Khemkar <jkhemkar@nvidia.com> | 2012-12-14 13:38:09 +0530 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-12-20 15:03:25 -0800 |
commit | c27103c60370a1a62336a7e47a5d225d2c136acc (patch) | |
tree | 2842e837bc8001687a78b3c46bae82f186f2a9a1 /drivers/media/video | |
parent | 78d1e849fac14ed6d27da7fb3df495e3422361f5 (diff) |
Revert "video: tegra: nvavp: Disable powergating of VDE"
This reverts commit 09e38b074d327b2acadbd6c5ca5c745021efb3a9.
* Below changes takes care of enabling the clocks just before
programming the key to VDE for widevine
http://git-master/r/#change,169007
http://git-master/r/#change,169008
Bug 1190582
Change-Id: Ib127760375a5f073a927e80a7735f9455be69d18
Signed-off-by: Jaiprakash Khemkar <jkhemkar@nvidia.com>
Reviewed-on: http://git-master/r/171337
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/tegra/nvavp/nvavp_dev.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/media/video/tegra/nvavp/nvavp_dev.c b/drivers/media/video/tegra/nvavp/nvavp_dev.c index eb5e951e7294..2bd3bf0fbc4e 100644 --- a/drivers/media/video/tegra/nvavp/nvavp_dev.c +++ b/drivers/media/video/tegra/nvavp/nvavp_dev.c @@ -42,6 +42,7 @@ #include <mach/iomap.h> #include <mach/legacy_irq.h> #include <linux/nvmap.h> +#include <mach/powergate.h> #if defined(CONFIG_TEGRA_AVP_KERNEL_ON_MMU) #include "../avp/headavp.h" @@ -259,12 +260,45 @@ static struct clk *nvavp_clk_get(struct nvavp_info *nvavp, int id) return NULL; } +static int nvavp_powergate_vde(struct nvavp_info *nvavp) +{ + int ret = 0; + + dev_dbg(&nvavp->nvhost_dev->dev, "%s++\n", __func__); + + /* Powergate VDE */ + ret = tegra_powergate_partition(TEGRA_POWERGATE_VDEC); + if (ret) + dev_err(&nvavp->nvhost_dev->dev, + "%s: powergate failed\n", + __func__); + + return ret; +} + +static int nvavp_unpowergate_vde(struct nvavp_info *nvavp) +{ + int ret = 0; + + dev_dbg(&nvavp->nvhost_dev->dev, "%s++\n", __func__); + + /* UnPowergate VDE */ + ret = tegra_unpowergate_partition(TEGRA_POWERGATE_VDEC); + if (ret) + dev_err(&nvavp->nvhost_dev->dev, + "%s: unpowergate failed\n", + __func__); + + return ret; +} + static void nvavp_clks_enable(struct nvavp_info *nvavp) { if (nvavp->clk_enabled++ == 0) { nvhost_module_busy_ext(nvavp->nvhost_dev); clk_prepare_enable(nvavp->bsev_clk); clk_prepare_enable(nvavp->vde_clk); + nvavp_unpowergate_vde(nvavp); clk_set_rate(nvavp->emc_clk, nvavp->emc_clk_rate); clk_set_rate(nvavp->sclk, nvavp->sclk_rate); dev_dbg(&nvavp->nvhost_dev->dev, "%s: setting sclk to %lu\n", @@ -281,6 +315,7 @@ static void nvavp_clks_disable(struct nvavp_info *nvavp) clk_disable_unprepare(nvavp->vde_clk); clk_set_rate(nvavp->emc_clk, 0); clk_set_rate(nvavp->sclk, 0); + nvavp_powergate_vde(nvavp); nvhost_module_idle_ext(nvavp->nvhost_dev); dev_dbg(&nvavp->nvhost_dev->dev, "%s: resetting emc_clk " "and sclk\n", __func__); @@ -1863,6 +1898,11 @@ static int tegra_nvavp_suspend(struct platform_device *ndev, pm_message_t state) } } + /* Partition vde has to be left on before suspend for the + * device to wakeup on resume + */ + nvavp_unpowergate_vde(nvavp); + mutex_unlock(&nvavp->open_lock); return ret; } |