aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDikshita Agarwal <dikshita@codeaurora.org>2021-04-02 12:06:40 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-04-06 15:53:44 +0200
commitc22b1a29497c3919b86dc2c87292d24b5965e4a5 (patch)
treec8bc508939a3ce079ae97b2dcd5be018a2160539
parentf24afa95bb2e401e9267c722ec109808a0537e60 (diff)
media: venus: core,pm: Vote for min clk freq during venus boot
Vote for min clk frequency for core clks during prepare and enable clocks at boot sequence. Without this the controller clock runs at very low value (9.6MHz) which is not sufficient to boot venus. Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r--drivers/media/platform/qcom/venus/pm_helpers.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index a23e490b6139..a91dc24de2a4 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -41,10 +41,24 @@ static int core_clks_get(struct venus_core *core)
static int core_clks_enable(struct venus_core *core)
{
const struct venus_resources *res = core->res;
+ const struct freq_tbl *freq_tbl = core->res->freq_tbl;
+ unsigned int freq_tbl_size = core->res->freq_tbl_size;
+ unsigned long freq;
unsigned int i;
int ret;
+ if (!freq_tbl)
+ return -EINVAL;
+
+ freq = freq_tbl[freq_tbl_size - 1].freq;
+
for (i = 0; i < res->clks_num; i++) {
+ if (IS_V6(core)) {
+ ret = clk_set_rate(core->clks[i], freq);
+ if (ret)
+ goto err;
+ }
+
ret = clk_prepare_enable(core->clks[i]);
if (ret)
goto err;

Privacy Policy