From: Robert Marko <robimarko@gmail.com>
To: ilia.lin@kernel.org, agross@kernel.org, andersson@kernel.org,
konrad.dybcio@linaro.org, rafael@kernel.org,
viresh.kumar@linaro.org, linux-kernel@vger.kernel.org,
linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org
Cc: Robert Marko <robimarko@gmail.com>
Subject: [PATCH 2/4] cpufreq: qcom-nvmem: reuse socinfo SMEM item struct
Date: Sat, 21 Jan 2023 12:29:45 +0100 [thread overview]
Message-ID: <20230121112947.53433-2-robimarko@gmail.com> (raw)
In-Reply-To: <20230121112947.53433-1-robimarko@gmail.com>
Now that socinfo SMEM item struct and defines have been moved to a header
so we can utilize that instead.
Now the SMEM value can be accesed directly, there is no need for defining
the ID for the SMEM request as well.
Signed-off-by: Robert Marko <robimarko@gmail.com>
---
drivers/cpufreq/qcom-cpufreq-nvmem.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c
index a577586b23be..c0a7841a56c1 100644
--- a/drivers/cpufreq/qcom-cpufreq-nvmem.c
+++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c
@@ -28,8 +28,7 @@
#include <linux/pm_opp.h>
#include <linux/slab.h>
#include <linux/soc/qcom/smem.h>
-
-#define MSM_ID_SMEM 137
+#include <linux/soc/qcom/socinfo.h>
enum _msm_id {
MSM8996V3 = 0xF6ul,
@@ -143,17 +142,14 @@ static void get_krait_bin_format_b(struct device *cpu_dev,
static enum _msm8996_version qcom_cpufreq_get_msm_id(void)
{
size_t len;
- u32 *msm_id;
+ struct socinfo *info;
enum _msm8996_version version;
- msm_id = qcom_smem_get(QCOM_SMEM_HOST_ANY, MSM_ID_SMEM, &len);
- if (IS_ERR(msm_id))
+ info = qcom_smem_get(QCOM_SMEM_HOST_ANY, SMEM_HW_SW_BUILD_ID, &len);
+ if (IS_ERR(info))
return NUM_OF_MSM8996_VERSIONS;
- /* The first 4 bytes are format, next to them is the actual msm-id */
- msm_id++;
-
- switch ((enum _msm_id)*msm_id) {
+ switch (info->id) {
case MSM8996V3:
case APQ8096V3:
version = MSM8996_V3;
--
2.39.1
next prev parent reply other threads:[~2023-01-21 11:29 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-21 11:29 [PATCH 1/4] soc: qcom: socinfo: move SMEM item struct and defines to a header Robert Marko
2023-01-21 11:29 ` Robert Marko [this message]
2023-02-06 20:38 ` [PATCH 2/4] cpufreq: qcom-nvmem: reuse socinfo SMEM item struct Bjorn Andersson
2023-02-07 4:15 ` Viresh Kumar
2023-01-21 11:29 ` [PATCH 3/4] cpufreq: qcom-nvmem: use SoC ID-s from bindings Robert Marko
2023-01-23 16:59 ` Konrad Dybcio
2023-02-06 20:40 ` Bjorn Andersson
2023-01-21 11:29 ` [PATCH 4/4] cpufreq: qcom-nvmem: make qcom_cpufreq_get_msm_id() return the SoC ID Robert Marko
2023-02-06 20:42 ` Bjorn Andersson
2023-02-18 14:43 ` Konrad Dybcio
2023-02-18 20:36 ` Dmitry Baryshkov
2023-02-18 20:40 ` Konrad Dybcio
2023-03-03 18:38 ` Robert Marko
2023-03-03 20:46 ` Konrad Dybcio
2023-03-03 21:38 ` Robert Marko
2023-03-03 21:40 ` Konrad Dybcio
2023-03-03 23:52 ` Dmitry Baryshkov
2023-01-21 11:33 ` [PATCH 1/4] soc: qcom: socinfo: move SMEM item struct and defines to a header Christophe JAILLET
2023-01-21 11:42 ` Robert Marko
2023-05-27 4:00 ` (subset) " Bjorn Andersson
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=20230121112947.53433-2-robimarko@gmail.com \
--to=robimarko@gmail.com \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=ilia.lin@kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=viresh.kumar@linaro.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).