linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanimir Varbanov <stanimir.varbanov@linaro.org>
To: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: bryan.odonoghue@linaro.org,
	Stanimir Varbanov <stanimir.varbanov@linaro.org>,
	stable@vger.kernel.org
Subject: [PATCH 3/5] venus: pm_helpers: Set opp clock name for v1
Date: Mon,  8 Mar 2021 12:52:03 +0200	[thread overview]
Message-ID: <20210308105205.445148-4-stanimir.varbanov@linaro.org> (raw)
In-Reply-To: <20210308105205.445148-1-stanimir.varbanov@linaro.org>

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: 9a538b83612c ("media: venus: core: Add support for opp tables/perf voting")
Cc: stable@vger.kernel.org # v5.10+
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
---
 .../media/platform/qcom/venus/pm_helpers.c    | 20 ++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index 43c4e3d9e281..12f6d3ab89ff 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -280,8 +280,24 @@ static int load_scale_v1(struct venus_inst *inst)
 static int core_get_v1(struct device *dev)
 {
 	struct venus_core *core = dev_get_drvdata(dev);
+	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 core_clks_get(core);
+	return 0;
+}
+
+static void core_put_v1(struct device *dev)
+{
+	struct venus_core *core = dev_get_drvdata(dev);
+
+	dev_pm_opp_put_clkname(core->opp_table);
 }
 
 static int core_power_v1(struct device *dev, int on)
@@ -299,6 +315,7 @@ static int core_power_v1(struct device *dev, int on)
 
 static const struct venus_pm_ops pm_ops_v1 = {
 	.core_get = core_get_v1,
+	.core_put = core_put_v1,
 	.core_power = core_power_v1,
 	.load_scale = load_scale_v1,
 };
@@ -371,6 +388,7 @@ static int venc_power_v3(struct device *dev, int on)
 
 static const struct venus_pm_ops pm_ops_v3 = {
 	.core_get = core_get_v1,
+	.core_put = core_put_v1,
 	.core_power = core_power_v1,
 	.vdec_get = vdec_get_v3,
 	.vdec_power = vdec_power_v3,
-- 
2.25.1


  parent reply	other threads:[~2021-03-08 10:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-08 10:52 [PATCH 0/5] Venus msm8916 fixes Stanimir Varbanov
2021-03-08 10:52 ` [PATCH 1/5] venus: hfi_parser: Don't initialize parser on v1 Stanimir Varbanov
2021-03-08 10:52 ` [PATCH 2/5] venus: hfi_parser: Check for instance after hfi platform get Stanimir Varbanov
2021-03-08 10:52 ` Stanimir Varbanov [this message]
2021-03-08 10:52 ` [PATCH 4/5] venus: venc_ctrls: Change default header mode Stanimir Varbanov
2021-03-08 10:52 ` [PATCH 5/5] venus: hfi_cmds: Support plane-actual-info property from v1 Stanimir Varbanov
2021-03-09 20:55 ` [PATCH 0/5] Venus msm8916 fixes Bryan O'Donoghue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210308105205.445148-4-stanimir.varbanov@linaro.org \
    --to=stanimir.varbanov@linaro.org \
    --cc=bryan.odonoghue@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).