Commit 32158871 authored by Stanimir Varbanov's avatar Stanimir Varbanov Committed by Mauro Carvalho Chehab

media: venus: pm_helpers: Set opp clock name for v1

The rate of the core clock is set through devm_pm_opp_set_rate and
to avoid errors from it we have to set the name of the clock via
dev_pm_opp_set_clkname.

Fixes: 9a538b83 ("media: venus: core: Add support for opp tables/perf voting")
Cc: stable@vger.kernel.org # v5.10+
Signed-off-by: default avatarStanimir Varbanov <stanimir.varbanov@linaro.org>
Tested-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 9b5d8fd5
...@@ -279,7 +279,22 @@ static int load_scale_v1(struct venus_inst *inst) ...@@ -279,7 +279,22 @@ static int load_scale_v1(struct venus_inst *inst)
static int core_get_v1(struct venus_core *core) static int core_get_v1(struct venus_core *core)
{ {
return core_clks_get(core); int ret;
ret = core_clks_get(core);
if (ret)
return ret;
core->opp_table = dev_pm_opp_set_clkname(core->dev, "core");
if (IS_ERR(core->opp_table))
return PTR_ERR(core->opp_table);
return 0;
}
static void core_put_v1(struct venus_core *core)
{
dev_pm_opp_put_clkname(core->opp_table);
} }
static int core_power_v1(struct venus_core *core, int on) static int core_power_v1(struct venus_core *core, int on)
...@@ -296,6 +311,7 @@ static int core_power_v1(struct venus_core *core, int on) ...@@ -296,6 +311,7 @@ static int core_power_v1(struct venus_core *core, int on)
static const struct venus_pm_ops pm_ops_v1 = { static const struct venus_pm_ops pm_ops_v1 = {
.core_get = core_get_v1, .core_get = core_get_v1,
.core_put = core_put_v1,
.core_power = core_power_v1, .core_power = core_power_v1,
.load_scale = load_scale_v1, .load_scale = load_scale_v1,
}; };
...@@ -368,6 +384,7 @@ static int venc_power_v3(struct device *dev, int on) ...@@ -368,6 +384,7 @@ static int venc_power_v3(struct device *dev, int on)
static const struct venus_pm_ops pm_ops_v3 = { static const struct venus_pm_ops pm_ops_v3 = {
.core_get = core_get_v1, .core_get = core_get_v1,
.core_put = core_put_v1,
.core_power = core_power_v1, .core_power = core_power_v1,
.vdec_get = vdec_get_v3, .vdec_get = vdec_get_v3,
.vdec_power = vdec_power_v3, .vdec_power = vdec_power_v3,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment