diff options
Diffstat (limited to 'drivers/media/platform/qcom/venus/core.c')
-rw-r--r-- | drivers/media/platform/qcom/venus/core.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 41eef376eb2d..3e5e60a8ac62 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -14,6 +14,7 @@ */ #include <linux/clk.h> #include <linux/init.h> +#include <linux/interconnect.h> #include <linux/ioctl.h> #include <linux/list.h> #include <linux/module.h> @@ -171,6 +172,18 @@ static int venus_probe(struct platform_device *pdev) if (IS_ERR(core->base)) return PTR_ERR(core->base); + core->path = of_icc_get(dev, "video"); + if (IS_ERR(core->path)) + return PTR_ERR(core->path); + + core->path_mdp0 = of_icc_get(dev, "mdp0"); + if (IS_ERR(core->path_mdp0)) + return PTR_ERR(core->path_mdp0); + + core->path_gpu = of_icc_get(dev, "gpu"); + if (IS_ERR(core->path_gpu)) + return PTR_ERR(core->path_gpu); + core->irq = platform_get_irq(pdev, 0); if (core->irq < 0) return core->irq; @@ -275,6 +288,10 @@ static __maybe_unused int venus_runtime_suspend(struct device *dev) struct venus_core *core = dev_get_drvdata(dev); int ret; + icc_set(core->path, 0, 0); + icc_set(core->path_mdp0, 0, 1000); + icc_set(core->path_mdp1, 0, 1000); + ret = hfi_core_suspend(core); venus_clks_disable(core); @@ -287,6 +304,11 @@ static __maybe_unused int venus_runtime_resume(struct device *dev) struct venus_core *core = dev_get_drvdata(dev); int ret; + icc_set(core->path, 677600, 1331000); + icc_set(core->path_mdp0, 0, 6400000); + icc_set(core->path_mdp1, 0, 6400000); + icc_set(core->path_gpu, 1066000, 4264000); + ret = venus_clks_enable(core); if (ret) return ret; |