All of lore.kernel.org
 help / color / mirror / Atom feed
From: kholk11@gmail.com
To: linux-arm-msm@vger.kernel.org
Cc: kholk11@gmail.com, marijns95@gmail.com, agross@kernel.org,
	mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org,
	mark.rutland@arm.com, bjorn.andersson@linaro.org,
	linus.walleij@linaro.org, linux-clk@vger.kernel.org,
	linux-gpio@vger.kernel.org
Subject: [PATCH 5/5] soc: qcom: rpmpd: Add rpm power domains for msm8956
Date: Sat, 21 Sep 2019 12:12:07 +0200	[thread overview]
Message-ID: <20190921101207.65042-6-kholk11@gmail.com> (raw)
In-Reply-To: <20190921101207.65042-1-kholk11@gmail.com>

From: "Angelo G. Del Regno" <kholk11@gmail.com>

The MSM8956 SoC has two main voltage-level power domains, VDD_CX
and VDD_MX, which also have their own voltage-floor-level (VFL)
corner.

Signed-off-by: Angelo G. Del Regno <kholk11@gmail.com>
---
 .../devicetree/bindings/power/qcom,rpmpd.txt  |  1 +
 drivers/soc/qcom/rpmpd.c                      | 23 +++++++++++++++++++
 include/dt-bindings/power/qcom-rpmpd.h        |  8 +++++++
 3 files changed, 32 insertions(+)

diff --git a/Documentation/devicetree/bindings/power/qcom,rpmpd.txt b/Documentation/devicetree/bindings/power/qcom,rpmpd.txt
index eb35b22f9e23..30176b1e595a 100644
--- a/Documentation/devicetree/bindings/power/qcom,rpmpd.txt
+++ b/Documentation/devicetree/bindings/power/qcom,rpmpd.txt
@@ -5,6 +5,7 @@ which then translates it into a corresponding voltage on a rail
 
 Required Properties:
  - compatible: Should be one of the following
+	* qcom,msm8956-rpmpd: RPM Power domain for the msm8956 family of SoC
 	* qcom,msm8996-rpmpd: RPM Power domain for the msm8996 family of SoC
 	* qcom,msm8998-rpmpd: RPM Power domain for the msm8998 family of SoC
 	* qcom,qcs404-rpmpd: RPM Power domain for the qcs404 family of SoC
diff --git a/drivers/soc/qcom/rpmpd.c b/drivers/soc/qcom/rpmpd.c
index 3c1a55cf25d6..b50f62851461 100644
--- a/drivers/soc/qcom/rpmpd.c
+++ b/drivers/soc/qcom/rpmpd.c
@@ -115,6 +115,28 @@ struct rpmpd_desc {
 
 static DEFINE_MUTEX(rpmpd_lock);
 
+/* msm8956 RPM Power Domains */
+DEFINE_RPMPD_PAIR(msm8956, vddcx, vddcx_ao, SMPA, LEVEL, 2);
+DEFINE_RPMPD_PAIR(msm8956, vddmx, vddmx_ao, SMPA, LEVEL, 6);
+
+DEFINE_RPMPD_VFL(msm8956, vddcx_vfl, RWSC, 2);
+DEFINE_RPMPD_VFL(msm8956, vddmx_vfl, RWSM, 6);
+
+static struct rpmpd *msm8956_rpmpds[] = {
+	[MSM8956_VDDCX] =	&msm8956_vddcx,
+	[MSM8956_VDDCX_AO] =	&msm8956_vddcx_ao,
+	[MSM8956_VDDCX_VFL] =	&msm8956_vddcx_vfl,
+	[MSM8956_VDDMX] =	&msm8956_vddmx,
+	[MSM8956_VDDMX_AO] =	&msm8956_vddmx_ao,
+	[MSM8956_VDDMX_VFL] =	&msm8956_vddmx_vfl,
+};
+
+static const struct rpmpd_desc msm8956_desc = {
+	.rpmpds = msm8956_rpmpds,
+	.num_pds = ARRAY_SIZE(msm8956_rpmpds),
+	.max_state = RPM_SMD_LEVEL_TURBO_HIGH,
+};
+
 /* msm8996 RPM Power domains */
 DEFINE_RPMPD_PAIR(msm8996, vddcx, vddcx_ao, SMPA, CORNER, 1);
 DEFINE_RPMPD_PAIR(msm8996, vddmx, vddmx_ao, SMPA, CORNER, 2);
@@ -198,6 +220,7 @@ static const struct rpmpd_desc qcs404_desc = {
 };
 
 static const struct of_device_id rpmpd_match_table[] = {
+	{ .compatible = "qcom,msm8956-rpmpd", .data = &msm8956_desc },
 	{ .compatible = "qcom,msm8996-rpmpd", .data = &msm8996_desc },
 	{ .compatible = "qcom,msm8998-rpmpd", .data = &msm8998_desc },
 	{ .compatible = "qcom,qcs404-rpmpd", .data = &qcs404_desc },
diff --git a/include/dt-bindings/power/qcom-rpmpd.h b/include/dt-bindings/power/qcom-rpmpd.h
index 30a0aee0df57..3423f964c233 100644
--- a/include/dt-bindings/power/qcom-rpmpd.h
+++ b/include/dt-bindings/power/qcom-rpmpd.h
@@ -27,6 +27,14 @@
 #define RPMH_REGULATOR_LEVEL_TURBO	384
 #define RPMH_REGULATOR_LEVEL_TURBO_L1	416
 
+/* MSM8956 Power Domain Indexes */
+#define MSM8956_VDDCX		0
+#define MSM8956_VDDCX_AO	1
+#define MSM8956_VDDCX_VFL	2
+#define MSM8956_VDDMX		3
+#define MSM8956_VDDMX_AO	4
+#define MSM8956_VDDMX_VFL	5
+
 /* MSM8996 Power Domain Indexes */
 #define MSM8996_VDDCX		0
 #define MSM8996_VDDCX_AO	1
-- 
2.21.0


  parent reply	other threads:[~2019-09-21 10:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-21 10:12 [PATCH 0/5] Add core MSM8956/76 SoC support drivers kholk11
2019-09-21 10:12 ` [PATCH 1/5] pinctrl: qcom: Add a pinctrl driver for MSM8976 and 8956 kholk11
2019-10-04 21:16   ` Linus Walleij
2019-10-05  3:59   ` Bjorn Andersson
2019-10-05  9:19     ` AngeloGioacchino Del Regno
2019-09-21 10:12 ` [PATCH 2/5] clk: qcom: Add MSM8976/56 Global Clock Controller (GCC) driver kholk11
2019-09-21 10:12 ` [PATCH 3/5] soc: qcom: smd-rpm: Add MSM8976 compatible kholk11
2019-10-05  4:23   ` Bjorn Andersson
2019-09-21 10:12 ` [PATCH 4/5] dt-bindings: power: Add missing rpmpd smd performance level kholk11
2019-10-05  4:27   ` Bjorn Andersson
2019-09-21 10:12 ` kholk11 [this message]
2019-10-05  4:25   ` [PATCH 5/5] soc: qcom: rpmpd: Add rpm power domains for msm8956 Bjorn Andersson
2019-10-05  9:23     ` AngeloGioacchino Del Regno

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=20190921101207.65042-6-kholk11@gmail.com \
    --to=kholk11@gmail.com \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=marijns95@gmail.com \
    --cc=mark.rutland@arm.com \
    --cc=mturquette@baylibre.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.