Linux-ARM-MSM Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 1/4] regulator: dt-bindings: Sort the compatibles and nodes
@ 2019-08-09  7:36 Vinod Koul
  2019-08-09  7:36 ` [PATCH 2/4] regulator: qcom-rpmh: Sort the compatibles Vinod Koul
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Vinod Koul @ 2019-08-09  7:36 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-arm-msm, Bjorn Andersson, Vinod Koul, Andy Gross,
	Liam Girdwood, Rob Herring, Mark Rutland, linux-kernel,
	devicetree

It helps to keep sorted order for compatibles and nodes, so sort them

Suggested-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
---
 .../regulator/qcom,rpmh-regulator.txt         | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.txt b/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.txt
index 1a9cab50503a..bab9f71140b8 100644
--- a/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.txt
@@ -22,12 +22,12 @@ RPMh resource.
 
 The names used for regulator nodes must match those supported by a given PMIC.
 Supported regulator node names:
-	PM8998:		smps1 - smps13, ldo1 - ldo28, lvs1 - lvs2
-	PMI8998:	bob
 	PM8005:		smps1 - smps4
+	PM8009:		smps1 - smps2, ldo1 - ldo7
 	PM8150:		smps1 - smps10, ldo1 - ldo18
 	PM8150L:	smps1 - smps8, ldo1 - ldo11, bob, flash, rgb
-	PM8009:		smps1 - smps2, ld01 - ldo7
+	PM8998:		smps1 - smps13, ldo1 - ldo28, lvs1 - lvs2
+	PMI8998:	bob
 
 ========================
 First Level Nodes - PMIC
@@ -36,12 +36,13 @@ First Level Nodes - PMIC
 - compatible
 	Usage:      required
 	Value type: <string>
-	Definition: Must be one of: "qcom,pm8998-rpmh-regulators",
-		    "qcom,pmi8998-rpmh-regulators" or
-		    "qcom,pm8005-rpmh-regulators" or
-		    "qcom,pm8150-rpmh-regulators" or
-		    "qcom,pm8150l-rpmh-regulators" or
-		    "qcom,pm8009-rpmh-regulators".
+	Definition: Must be one of below:
+		    "qcom,pm8005-rpmh-regulators"
+		    "qcom,pm8009-rpmh-regulators"
+		    "qcom,pm8150-rpmh-regulators"
+		    "qcom,pm8150l-rpmh-regulators"
+		    "qcom,pm8998-rpmh-regulators"
+		    "qcom,pmi8998-rpmh-regulators"
 
 - qcom,pmic-id
 	Usage:      required
-- 
2.20.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 2/4] regulator: qcom-rpmh: Sort the compatibles
  2019-08-09  7:36 [PATCH 1/4] regulator: dt-bindings: Sort the compatibles and nodes Vinod Koul
@ 2019-08-09  7:36 ` Vinod Koul
  2019-08-09 12:31   ` Applied "regulator: qcom-rpmh: Sort the compatibles" to the regulator tree Mark Brown
  2019-08-09 17:02   ` [PATCH 2/4] regulator: qcom-rpmh: Sort the compatibles Bjorn Andersson
  2019-08-09  7:36 ` [PATCH 3/4] regulator: qcom-rpmh: Fix pmic5_bob voltage count Vinod Koul
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 12+ messages in thread
From: Vinod Koul @ 2019-08-09  7:36 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-arm-msm, Bjorn Andersson, Vinod Koul, Andy Gross,
	Liam Girdwood, Rob Herring, Mark Rutland, linux-kernel,
	devicetree

It helps to keep sorted order for compatibles, so sort them

Suggested-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
---
 drivers/regulator/qcom-rpmh-regulator.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c
index 693ffec62f3e..0ef2716da3bd 100644
--- a/drivers/regulator/qcom-rpmh-regulator.c
+++ b/drivers/regulator/qcom-rpmh-regulator.c
@@ -878,18 +878,14 @@ static int rpmh_regulator_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id rpmh_regulator_match_table[] = {
-	{
-		.compatible = "qcom,pm8998-rpmh-regulators",
-		.data = pm8998_vreg_data,
-	},
-	{
-		.compatible = "qcom,pmi8998-rpmh-regulators",
-		.data = pmi8998_vreg_data,
-	},
 	{
 		.compatible = "qcom,pm8005-rpmh-regulators",
 		.data = pm8005_vreg_data,
 	},
+	{
+		.compatible = "qcom,pm8009-rpmh-regulators",
+		.data = pm8009_vreg_data,
+	},
 	{
 		.compatible = "qcom,pm8150-rpmh-regulators",
 		.data = pm8150_vreg_data,
@@ -899,8 +895,12 @@ static const struct of_device_id rpmh_regulator_match_table[] = {
 		.data = pm8150l_vreg_data,
 	},
 	{
-		.compatible = "qcom,pm8009-rpmh-regulators",
-		.data = pm8009_vreg_data,
+		.compatible = "qcom,pm8998-rpmh-regulators",
+		.data = pm8998_vreg_data,
+	},
+	{
+		.compatible = "qcom,pmi8998-rpmh-regulators",
+		.data = pmi8998_vreg_data,
 	},
 	{}
 };
-- 
2.20.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 3/4] regulator: qcom-rpmh: Fix pmic5_bob voltage count
  2019-08-09  7:36 [PATCH 1/4] regulator: dt-bindings: Sort the compatibles and nodes Vinod Koul
  2019-08-09  7:36 ` [PATCH 2/4] regulator: qcom-rpmh: Sort the compatibles Vinod Koul
@ 2019-08-09  7:36 ` Vinod Koul
  2019-08-09 12:31   ` Applied "regulator: qcom-rpmh: Fix pmic5_bob voltage count" to the regulator tree Mark Brown
  2019-08-09 17:03   ` [PATCH 3/4] regulator: qcom-rpmh: Fix pmic5_bob voltage count Bjorn Andersson
  2019-08-09  7:36 ` [PATCH 4/4] regulator: qcom-rpmh: Update PMIC modes for PMIC5 Vinod Koul
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 12+ messages in thread
From: Vinod Koul @ 2019-08-09  7:36 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-arm-msm, Bjorn Andersson, Vinod Koul, Andy Gross,
	Liam Girdwood, Rob Herring, Mark Rutland, linux-kernel,
	devicetree

pmic5_bob voltages count is 136 [0,135] so update it

Signed-off-by: Vinod Koul <vkoul@kernel.org>
---
 drivers/regulator/qcom-rpmh-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c
index 0ef2716da3bd..391ed844a251 100644
--- a/drivers/regulator/qcom-rpmh-regulator.c
+++ b/drivers/regulator/qcom-rpmh-regulator.c
@@ -698,7 +698,7 @@ static const struct rpmh_vreg_hw_data pmic5_bob = {
 	.regulator_type = VRM,
 	.ops = &rpmh_regulator_vrm_bypass_ops,
 	.voltage_range = REGULATOR_LINEAR_RANGE(300000, 0, 135, 32000),
-	.n_voltages = 135,
+	.n_voltages = 136,
 	.pmic_mode_map = pmic_mode_map_pmic4_bob,
 	.of_map_mode = rpmh_regulator_pmic4_bob_of_map_mode,
 };
-- 
2.20.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 4/4] regulator: qcom-rpmh: Update PMIC modes for PMIC5
  2019-08-09  7:36 [PATCH 1/4] regulator: dt-bindings: Sort the compatibles and nodes Vinod Koul
  2019-08-09  7:36 ` [PATCH 2/4] regulator: qcom-rpmh: Sort the compatibles Vinod Koul
  2019-08-09  7:36 ` [PATCH 3/4] regulator: qcom-rpmh: Fix pmic5_bob voltage count Vinod Koul
@ 2019-08-09  7:36 ` Vinod Koul
  2019-08-09 12:31   ` Applied "regulator: qcom-rpmh: Update PMIC modes for PMIC5" to the regulator tree Mark Brown
  2019-08-09 18:00   ` [PATCH 4/4] regulator: qcom-rpmh: Update PMIC modes for PMIC5 Bjorn Andersson
  2019-08-09 12:31 ` Applied "regulator: dt-bindings: Sort the compatibles and nodes" to the regulator tree Mark Brown
  2019-08-09 17:01 ` [PATCH 1/4] regulator: dt-bindings: Sort the compatibles and nodes Bjorn Andersson
  4 siblings, 2 replies; 12+ messages in thread
From: Vinod Koul @ 2019-08-09  7:36 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-arm-msm, Bjorn Andersson, Vinod Koul, Andy Gross,
	Liam Girdwood, Rob Herring, Mark Rutland, linux-kernel,
	devicetree

Add the PMIC5 modes and use them pmic5 ldo and smps

Signed-off-by: Vinod Koul <vkoul@kernel.org>
---
 drivers/regulator/qcom-rpmh-regulator.c | 52 +++++++++++++++++++++----
 1 file changed, 45 insertions(+), 7 deletions(-)

diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c
index 391ed844a251..db6c085da65e 100644
--- a/drivers/regulator/qcom-rpmh-regulator.c
+++ b/drivers/regulator/qcom-rpmh-regulator.c
@@ -50,6 +50,20 @@ enum rpmh_regulator_type {
 #define PMIC4_BOB_MODE_AUTO			2
 #define PMIC4_BOB_MODE_PWM			3
 
+#define PMIC5_LDO_MODE_RETENTION		3
+#define PMIC5_LDO_MODE_LPM			4
+#define PMIC5_LDO_MODE_HPM			7
+
+#define PMIC5_SMPS_MODE_RETENTION		3
+#define PMIC5_SMPS_MODE_PFM			4
+#define PMIC5_SMPS_MODE_AUTO			6
+#define PMIC5_SMPS_MODE_PWM			7
+
+#define PMIC5_BOB_MODE_PASS			2
+#define PMIC5_BOB_MODE_PFM			4
+#define PMIC5_BOB_MODE_AUTO			6
+#define PMIC5_BOB_MODE_PWM			7
+
 /**
  * struct rpmh_vreg_hw_data - RPMh regulator hardware configurations
  * @regulator_type:		RPMh accelerator type used to manage this
@@ -488,6 +502,14 @@ static const int pmic_mode_map_pmic4_ldo[REGULATOR_MODE_STANDBY + 1] = {
 	[REGULATOR_MODE_FAST]    = -EINVAL,
 };
 
+static const int pmic_mode_map_pmic5_ldo[REGULATOR_MODE_STANDBY + 1] = {
+	[REGULATOR_MODE_INVALID] = -EINVAL,
+	[REGULATOR_MODE_STANDBY] = PMIC5_LDO_MODE_RETENTION,
+	[REGULATOR_MODE_IDLE]    = PMIC5_LDO_MODE_LPM,
+	[REGULATOR_MODE_NORMAL]  = PMIC5_LDO_MODE_HPM,
+	[REGULATOR_MODE_FAST]    = -EINVAL,
+};
+
 static unsigned int rpmh_regulator_pmic4_ldo_of_map_mode(unsigned int rpmh_mode)
 {
 	unsigned int mode;
@@ -518,6 +540,14 @@ static const int pmic_mode_map_pmic4_smps[REGULATOR_MODE_STANDBY + 1] = {
 	[REGULATOR_MODE_FAST]    = PMIC4_SMPS_MODE_PWM,
 };
 
+static const int pmic_mode_map_pmic5_smps[REGULATOR_MODE_STANDBY + 1] = {
+	[REGULATOR_MODE_INVALID] = -EINVAL,
+	[REGULATOR_MODE_STANDBY] = PMIC5_SMPS_MODE_RETENTION,
+	[REGULATOR_MODE_IDLE]    = PMIC5_SMPS_MODE_PFM,
+	[REGULATOR_MODE_NORMAL]  = PMIC5_SMPS_MODE_AUTO,
+	[REGULATOR_MODE_FAST]    = PMIC5_SMPS_MODE_PWM,
+};
+
 static unsigned int
 rpmh_regulator_pmic4_smps_of_map_mode(unsigned int rpmh_mode)
 {
@@ -552,6 +582,14 @@ static const int pmic_mode_map_pmic4_bob[REGULATOR_MODE_STANDBY + 1] = {
 	[REGULATOR_MODE_FAST]    = PMIC4_BOB_MODE_PWM,
 };
 
+static const int pmic_mode_map_pmic5_bob[REGULATOR_MODE_STANDBY + 1] = {
+	[REGULATOR_MODE_INVALID] = -EINVAL,
+	[REGULATOR_MODE_STANDBY] = -EINVAL,
+	[REGULATOR_MODE_IDLE]    = PMIC5_BOB_MODE_PFM,
+	[REGULATOR_MODE_NORMAL]  = PMIC5_BOB_MODE_AUTO,
+	[REGULATOR_MODE_FAST]    = PMIC5_BOB_MODE_PWM,
+};
+
 static unsigned int rpmh_regulator_pmic4_bob_of_map_mode(unsigned int rpmh_mode)
 {
 	unsigned int mode;
@@ -643,7 +681,7 @@ static const struct rpmh_vreg_hw_data pmic5_pldo = {
 	.voltage_range = REGULATOR_LINEAR_RANGE(1504000, 0, 255, 8000),
 	.n_voltages = 256,
 	.hpm_min_load_uA = 10000,
-	.pmic_mode_map = pmic_mode_map_pmic4_ldo,
+	.pmic_mode_map = pmic_mode_map_pmic5_ldo,
 	.of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode,
 };
 
@@ -653,7 +691,7 @@ static const struct rpmh_vreg_hw_data pmic5_pldo_lv = {
 	.voltage_range = REGULATOR_LINEAR_RANGE(1504000, 0, 62, 8000),
 	.n_voltages = 63,
 	.hpm_min_load_uA = 10000,
-	.pmic_mode_map = pmic_mode_map_pmic4_ldo,
+	.pmic_mode_map = pmic_mode_map_pmic5_ldo,
 	.of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode,
 };
 
@@ -663,7 +701,7 @@ static const struct rpmh_vreg_hw_data pmic5_nldo = {
 	.voltage_range = REGULATOR_LINEAR_RANGE(320000, 0, 123, 8000),
 	.n_voltages = 124,
 	.hpm_min_load_uA = 30000,
-	.pmic_mode_map = pmic_mode_map_pmic4_ldo,
+	.pmic_mode_map = pmic_mode_map_pmic5_ldo,
 	.of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode,
 };
 
@@ -672,7 +710,7 @@ static const struct rpmh_vreg_hw_data pmic5_hfsmps510 = {
 	.ops = &rpmh_regulator_vrm_ops,
 	.voltage_range = REGULATOR_LINEAR_RANGE(320000, 0, 215, 8000),
 	.n_voltages = 216,
-	.pmic_mode_map = pmic_mode_map_pmic4_smps,
+	.pmic_mode_map = pmic_mode_map_pmic5_smps,
 	.of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode,
 };
 
@@ -681,7 +719,7 @@ static const struct rpmh_vreg_hw_data pmic5_ftsmps510 = {
 	.ops = &rpmh_regulator_vrm_ops,
 	.voltage_range = REGULATOR_LINEAR_RANGE(300000, 0, 263, 4000),
 	.n_voltages = 264,
-	.pmic_mode_map = pmic_mode_map_pmic4_smps,
+	.pmic_mode_map = pmic_mode_map_pmic5_smps,
 	.of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode,
 };
 
@@ -690,7 +728,7 @@ static const struct rpmh_vreg_hw_data pmic5_hfsmps515 = {
 	.ops = &rpmh_regulator_vrm_ops,
 	.voltage_range = REGULATOR_LINEAR_RANGE(2800000, 0, 4, 1600),
 	.n_voltages = 5,
-	.pmic_mode_map = pmic_mode_map_pmic4_smps,
+	.pmic_mode_map = pmic_mode_map_pmic5_smps,
 	.of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode,
 };
 
@@ -699,7 +737,7 @@ static const struct rpmh_vreg_hw_data pmic5_bob = {
 	.ops = &rpmh_regulator_vrm_bypass_ops,
 	.voltage_range = REGULATOR_LINEAR_RANGE(300000, 0, 135, 32000),
 	.n_voltages = 136,
-	.pmic_mode_map = pmic_mode_map_pmic4_bob,
+	.pmic_mode_map = pmic_mode_map_pmic5_bob,
 	.of_map_mode = rpmh_regulator_pmic4_bob_of_map_mode,
 };
 
-- 
2.20.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Applied "regulator: qcom-rpmh: Update PMIC modes for PMIC5" to the regulator tree
  2019-08-09  7:36 ` [PATCH 4/4] regulator: qcom-rpmh: Update PMIC modes for PMIC5 Vinod Koul
@ 2019-08-09 12:31   ` Mark Brown
  2019-08-09 18:00   ` [PATCH 4/4] regulator: qcom-rpmh: Update PMIC modes for PMIC5 Bjorn Andersson
  1 sibling, 0 replies; 12+ messages in thread
From: Mark Brown @ 2019-08-09 12:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Andy Gross, Bjorn Andersson, devicetree, Liam Girdwood,
	linux-arm-msm, linux-kernel, Mark Brown, Mark Rutland,
	Rob Herring

The patch

   regulator: qcom-rpmh: Update PMIC modes for PMIC5

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-5.4

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 610f29e5cc0e8d5864dd049b0b3576d9437ae7b4 Mon Sep 17 00:00:00 2001
From: Vinod Koul <vkoul@kernel.org>
Date: Fri, 9 Aug 2019 13:06:16 +0530
Subject: [PATCH] regulator: qcom-rpmh: Update PMIC modes for PMIC5

Add the PMIC5 modes and use them pmic5 ldo and smps

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20190809073616.1235-4-vkoul@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/regulator/qcom-rpmh-regulator.c | 52 +++++++++++++++++++++----
 1 file changed, 45 insertions(+), 7 deletions(-)

diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c
index 391ed844a251..db6c085da65e 100644
--- a/drivers/regulator/qcom-rpmh-regulator.c
+++ b/drivers/regulator/qcom-rpmh-regulator.c
@@ -50,6 +50,20 @@ enum rpmh_regulator_type {
 #define PMIC4_BOB_MODE_AUTO			2
 #define PMIC4_BOB_MODE_PWM			3
 
+#define PMIC5_LDO_MODE_RETENTION		3
+#define PMIC5_LDO_MODE_LPM			4
+#define PMIC5_LDO_MODE_HPM			7
+
+#define PMIC5_SMPS_MODE_RETENTION		3
+#define PMIC5_SMPS_MODE_PFM			4
+#define PMIC5_SMPS_MODE_AUTO			6
+#define PMIC5_SMPS_MODE_PWM			7
+
+#define PMIC5_BOB_MODE_PASS			2
+#define PMIC5_BOB_MODE_PFM			4
+#define PMIC5_BOB_MODE_AUTO			6
+#define PMIC5_BOB_MODE_PWM			7
+
 /**
  * struct rpmh_vreg_hw_data - RPMh regulator hardware configurations
  * @regulator_type:		RPMh accelerator type used to manage this
@@ -488,6 +502,14 @@ static const int pmic_mode_map_pmic4_ldo[REGULATOR_MODE_STANDBY + 1] = {
 	[REGULATOR_MODE_FAST]    = -EINVAL,
 };
 
+static const int pmic_mode_map_pmic5_ldo[REGULATOR_MODE_STANDBY + 1] = {
+	[REGULATOR_MODE_INVALID] = -EINVAL,
+	[REGULATOR_MODE_STANDBY] = PMIC5_LDO_MODE_RETENTION,
+	[REGULATOR_MODE_IDLE]    = PMIC5_LDO_MODE_LPM,
+	[REGULATOR_MODE_NORMAL]  = PMIC5_LDO_MODE_HPM,
+	[REGULATOR_MODE_FAST]    = -EINVAL,
+};
+
 static unsigned int rpmh_regulator_pmic4_ldo_of_map_mode(unsigned int rpmh_mode)
 {
 	unsigned int mode;
@@ -518,6 +540,14 @@ static const int pmic_mode_map_pmic4_smps[REGULATOR_MODE_STANDBY + 1] = {
 	[REGULATOR_MODE_FAST]    = PMIC4_SMPS_MODE_PWM,
 };
 
+static const int pmic_mode_map_pmic5_smps[REGULATOR_MODE_STANDBY + 1] = {
+	[REGULATOR_MODE_INVALID] = -EINVAL,
+	[REGULATOR_MODE_STANDBY] = PMIC5_SMPS_MODE_RETENTION,
+	[REGULATOR_MODE_IDLE]    = PMIC5_SMPS_MODE_PFM,
+	[REGULATOR_MODE_NORMAL]  = PMIC5_SMPS_MODE_AUTO,
+	[REGULATOR_MODE_FAST]    = PMIC5_SMPS_MODE_PWM,
+};
+
 static unsigned int
 rpmh_regulator_pmic4_smps_of_map_mode(unsigned int rpmh_mode)
 {
@@ -552,6 +582,14 @@ static const int pmic_mode_map_pmic4_bob[REGULATOR_MODE_STANDBY + 1] = {
 	[REGULATOR_MODE_FAST]    = PMIC4_BOB_MODE_PWM,
 };
 
+static const int pmic_mode_map_pmic5_bob[REGULATOR_MODE_STANDBY + 1] = {
+	[REGULATOR_MODE_INVALID] = -EINVAL,
+	[REGULATOR_MODE_STANDBY] = -EINVAL,
+	[REGULATOR_MODE_IDLE]    = PMIC5_BOB_MODE_PFM,
+	[REGULATOR_MODE_NORMAL]  = PMIC5_BOB_MODE_AUTO,
+	[REGULATOR_MODE_FAST]    = PMIC5_BOB_MODE_PWM,
+};
+
 static unsigned int rpmh_regulator_pmic4_bob_of_map_mode(unsigned int rpmh_mode)
 {
 	unsigned int mode;
@@ -643,7 +681,7 @@ static const struct rpmh_vreg_hw_data pmic5_pldo = {
 	.voltage_range = REGULATOR_LINEAR_RANGE(1504000, 0, 255, 8000),
 	.n_voltages = 256,
 	.hpm_min_load_uA = 10000,
-	.pmic_mode_map = pmic_mode_map_pmic4_ldo,
+	.pmic_mode_map = pmic_mode_map_pmic5_ldo,
 	.of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode,
 };
 
@@ -653,7 +691,7 @@ static const struct rpmh_vreg_hw_data pmic5_pldo_lv = {
 	.voltage_range = REGULATOR_LINEAR_RANGE(1504000, 0, 62, 8000),
 	.n_voltages = 63,
 	.hpm_min_load_uA = 10000,
-	.pmic_mode_map = pmic_mode_map_pmic4_ldo,
+	.pmic_mode_map = pmic_mode_map_pmic5_ldo,
 	.of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode,
 };
 
@@ -663,7 +701,7 @@ static const struct rpmh_vreg_hw_data pmic5_nldo = {
 	.voltage_range = REGULATOR_LINEAR_RANGE(320000, 0, 123, 8000),
 	.n_voltages = 124,
 	.hpm_min_load_uA = 30000,
-	.pmic_mode_map = pmic_mode_map_pmic4_ldo,
+	.pmic_mode_map = pmic_mode_map_pmic5_ldo,
 	.of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode,
 };
 
@@ -672,7 +710,7 @@ static const struct rpmh_vreg_hw_data pmic5_hfsmps510 = {
 	.ops = &rpmh_regulator_vrm_ops,
 	.voltage_range = REGULATOR_LINEAR_RANGE(320000, 0, 215, 8000),
 	.n_voltages = 216,
-	.pmic_mode_map = pmic_mode_map_pmic4_smps,
+	.pmic_mode_map = pmic_mode_map_pmic5_smps,
 	.of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode,
 };
 
@@ -681,7 +719,7 @@ static const struct rpmh_vreg_hw_data pmic5_ftsmps510 = {
 	.ops = &rpmh_regulator_vrm_ops,
 	.voltage_range = REGULATOR_LINEAR_RANGE(300000, 0, 263, 4000),
 	.n_voltages = 264,
-	.pmic_mode_map = pmic_mode_map_pmic4_smps,
+	.pmic_mode_map = pmic_mode_map_pmic5_smps,
 	.of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode,
 };
 
@@ -690,7 +728,7 @@ static const struct rpmh_vreg_hw_data pmic5_hfsmps515 = {
 	.ops = &rpmh_regulator_vrm_ops,
 	.voltage_range = REGULATOR_LINEAR_RANGE(2800000, 0, 4, 1600),
 	.n_voltages = 5,
-	.pmic_mode_map = pmic_mode_map_pmic4_smps,
+	.pmic_mode_map = pmic_mode_map_pmic5_smps,
 	.of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode,
 };
 
@@ -699,7 +737,7 @@ static const struct rpmh_vreg_hw_data pmic5_bob = {
 	.ops = &rpmh_regulator_vrm_bypass_ops,
 	.voltage_range = REGULATOR_LINEAR_RANGE(300000, 0, 135, 32000),
 	.n_voltages = 136,
-	.pmic_mode_map = pmic_mode_map_pmic4_bob,
+	.pmic_mode_map = pmic_mode_map_pmic5_bob,
 	.of_map_mode = rpmh_regulator_pmic4_bob_of_map_mode,
 };
 
-- 
2.20.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Applied "regulator: dt-bindings: Sort the compatibles and nodes" to the regulator tree
  2019-08-09  7:36 [PATCH 1/4] regulator: dt-bindings: Sort the compatibles and nodes Vinod Koul
                   ` (2 preceding siblings ...)
  2019-08-09  7:36 ` [PATCH 4/4] regulator: qcom-rpmh: Update PMIC modes for PMIC5 Vinod Koul
@ 2019-08-09 12:31 ` Mark Brown
  2019-08-09 17:01 ` [PATCH 1/4] regulator: dt-bindings: Sort the compatibles and nodes Bjorn Andersson
  4 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2019-08-09 12:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Andy Gross, Bjorn Andersson, devicetree, Liam Girdwood,
	linux-arm-msm, linux-kernel, Mark Brown, Mark Rutland,
	Rob Herring

The patch

   regulator: dt-bindings: Sort the compatibles and nodes

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-5.4

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From c6e20fa49818381dfa7288fad4c33b84408aab54 Mon Sep 17 00:00:00 2001
From: Vinod Koul <vkoul@kernel.org>
Date: Fri, 9 Aug 2019 13:06:13 +0530
Subject: [PATCH] regulator: dt-bindings: Sort the compatibles and nodes

It helps to keep sorted order for compatibles and nodes, so sort them

Suggested-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20190809073616.1235-1-vkoul@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 .../regulator/qcom,rpmh-regulator.txt         | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.txt b/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.txt
index 1a9cab50503a..bab9f71140b8 100644
--- a/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.txt
@@ -22,12 +22,12 @@ RPMh resource.
 
 The names used for regulator nodes must match those supported by a given PMIC.
 Supported regulator node names:
-	PM8998:		smps1 - smps13, ldo1 - ldo28, lvs1 - lvs2
-	PMI8998:	bob
 	PM8005:		smps1 - smps4
+	PM8009:		smps1 - smps2, ldo1 - ldo7
 	PM8150:		smps1 - smps10, ldo1 - ldo18
 	PM8150L:	smps1 - smps8, ldo1 - ldo11, bob, flash, rgb
-	PM8009:		smps1 - smps2, ld01 - ldo7
+	PM8998:		smps1 - smps13, ldo1 - ldo28, lvs1 - lvs2
+	PMI8998:	bob
 
 ========================
 First Level Nodes - PMIC
@@ -36,12 +36,13 @@ First Level Nodes - PMIC
 - compatible
 	Usage:      required
 	Value type: <string>
-	Definition: Must be one of: "qcom,pm8998-rpmh-regulators",
-		    "qcom,pmi8998-rpmh-regulators" or
-		    "qcom,pm8005-rpmh-regulators" or
-		    "qcom,pm8150-rpmh-regulators" or
-		    "qcom,pm8150l-rpmh-regulators" or
-		    "qcom,pm8009-rpmh-regulators".
+	Definition: Must be one of below:
+		    "qcom,pm8005-rpmh-regulators"
+		    "qcom,pm8009-rpmh-regulators"
+		    "qcom,pm8150-rpmh-regulators"
+		    "qcom,pm8150l-rpmh-regulators"
+		    "qcom,pm8998-rpmh-regulators"
+		    "qcom,pmi8998-rpmh-regulators"
 
 - qcom,pmic-id
 	Usage:      required
-- 
2.20.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Applied "regulator: qcom-rpmh: Fix pmic5_bob voltage count" to the regulator tree
  2019-08-09  7:36 ` [PATCH 3/4] regulator: qcom-rpmh: Fix pmic5_bob voltage count Vinod Koul
@ 2019-08-09 12:31   ` Mark Brown
  2019-08-09 17:03   ` [PATCH 3/4] regulator: qcom-rpmh: Fix pmic5_bob voltage count Bjorn Andersson
  1 sibling, 0 replies; 12+ messages in thread
From: Mark Brown @ 2019-08-09 12:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Andy Gross, Bjorn Andersson, devicetree, Liam Girdwood,
	linux-arm-msm, linux-kernel, Mark Brown, Mark Rutland,
	Rob Herring

The patch

   regulator: qcom-rpmh: Fix pmic5_bob voltage count

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-5.4

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 553c452d6093d66e7617ed6c68cc93547d07075f Mon Sep 17 00:00:00 2001
From: Vinod Koul <vkoul@kernel.org>
Date: Fri, 9 Aug 2019 13:06:15 +0530
Subject: [PATCH] regulator: qcom-rpmh: Fix pmic5_bob voltage count

pmic5_bob voltages count is 136 [0,135] so update it

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20190809073616.1235-3-vkoul@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/regulator/qcom-rpmh-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c
index 0ef2716da3bd..391ed844a251 100644
--- a/drivers/regulator/qcom-rpmh-regulator.c
+++ b/drivers/regulator/qcom-rpmh-regulator.c
@@ -698,7 +698,7 @@ static const struct rpmh_vreg_hw_data pmic5_bob = {
 	.regulator_type = VRM,
 	.ops = &rpmh_regulator_vrm_bypass_ops,
 	.voltage_range = REGULATOR_LINEAR_RANGE(300000, 0, 135, 32000),
-	.n_voltages = 135,
+	.n_voltages = 136,
 	.pmic_mode_map = pmic_mode_map_pmic4_bob,
 	.of_map_mode = rpmh_regulator_pmic4_bob_of_map_mode,
 };
-- 
2.20.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Applied "regulator: qcom-rpmh: Sort the compatibles" to the regulator tree
  2019-08-09  7:36 ` [PATCH 2/4] regulator: qcom-rpmh: Sort the compatibles Vinod Koul
@ 2019-08-09 12:31   ` Mark Brown
  2019-08-09 17:02   ` [PATCH 2/4] regulator: qcom-rpmh: Sort the compatibles Bjorn Andersson
  1 sibling, 0 replies; 12+ messages in thread
From: Mark Brown @ 2019-08-09 12:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Andy Gross, Bjorn Andersson, devicetree, Liam Girdwood,
	linux-arm-msm, linux-kernel, Mark Brown, Mark Rutland,
	Rob Herring

The patch

   regulator: qcom-rpmh: Sort the compatibles

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-5.4

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 7172fb7f3abea4787ca01dda7297241c4b0f0af5 Mon Sep 17 00:00:00 2001
From: Vinod Koul <vkoul@kernel.org>
Date: Fri, 9 Aug 2019 13:06:14 +0530
Subject: [PATCH] regulator: qcom-rpmh: Sort the compatibles

It helps to keep sorted order for compatibles, so sort them

Suggested-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20190809073616.1235-2-vkoul@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/regulator/qcom-rpmh-regulator.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c
index 693ffec62f3e..0ef2716da3bd 100644
--- a/drivers/regulator/qcom-rpmh-regulator.c
+++ b/drivers/regulator/qcom-rpmh-regulator.c
@@ -878,18 +878,14 @@ static int rpmh_regulator_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id rpmh_regulator_match_table[] = {
-	{
-		.compatible = "qcom,pm8998-rpmh-regulators",
-		.data = pm8998_vreg_data,
-	},
-	{
-		.compatible = "qcom,pmi8998-rpmh-regulators",
-		.data = pmi8998_vreg_data,
-	},
 	{
 		.compatible = "qcom,pm8005-rpmh-regulators",
 		.data = pm8005_vreg_data,
 	},
+	{
+		.compatible = "qcom,pm8009-rpmh-regulators",
+		.data = pm8009_vreg_data,
+	},
 	{
 		.compatible = "qcom,pm8150-rpmh-regulators",
 		.data = pm8150_vreg_data,
@@ -899,8 +895,12 @@ static const struct of_device_id rpmh_regulator_match_table[] = {
 		.data = pm8150l_vreg_data,
 	},
 	{
-		.compatible = "qcom,pm8009-rpmh-regulators",
-		.data = pm8009_vreg_data,
+		.compatible = "qcom,pm8998-rpmh-regulators",
+		.data = pm8998_vreg_data,
+	},
+	{
+		.compatible = "qcom,pmi8998-rpmh-regulators",
+		.data = pmi8998_vreg_data,
 	},
 	{}
 };
-- 
2.20.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/4] regulator: dt-bindings: Sort the compatibles and nodes
  2019-08-09  7:36 [PATCH 1/4] regulator: dt-bindings: Sort the compatibles and nodes Vinod Koul
                   ` (3 preceding siblings ...)
  2019-08-09 12:31 ` Applied "regulator: dt-bindings: Sort the compatibles and nodes" to the regulator tree Mark Brown
@ 2019-08-09 17:01 ` Bjorn Andersson
  4 siblings, 0 replies; 12+ messages in thread
From: Bjorn Andersson @ 2019-08-09 17:01 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Mark Brown, linux-arm-msm, Andy Gross, Liam Girdwood,
	Rob Herring, Mark Rutland, linux-kernel, devicetree

On Fri 09 Aug 00:36 PDT 2019, Vinod Koul wrote:

> It helps to keep sorted order for compatibles and nodes, so sort them
> 
> Suggested-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> Signed-off-by: Vinod Koul <vkoul@kernel.org>
> ---
>  .../regulator/qcom,rpmh-regulator.txt         | 19 ++++++++++---------
>  1 file changed, 10 insertions(+), 9 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.txt b/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.txt
> index 1a9cab50503a..bab9f71140b8 100644
> --- a/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.txt
> +++ b/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.txt
> @@ -22,12 +22,12 @@ RPMh resource.
>  
>  The names used for regulator nodes must match those supported by a given PMIC.
>  Supported regulator node names:
> -	PM8998:		smps1 - smps13, ldo1 - ldo28, lvs1 - lvs2
> -	PMI8998:	bob
>  	PM8005:		smps1 - smps4
> +	PM8009:		smps1 - smps2, ldo1 - ldo7
>  	PM8150:		smps1 - smps10, ldo1 - ldo18
>  	PM8150L:	smps1 - smps8, ldo1 - ldo11, bob, flash, rgb
> -	PM8009:		smps1 - smps2, ld01 - ldo7
> +	PM8998:		smps1 - smps13, ldo1 - ldo28, lvs1 - lvs2
> +	PMI8998:	bob
>  
>  ========================
>  First Level Nodes - PMIC
> @@ -36,12 +36,13 @@ First Level Nodes - PMIC
>  - compatible
>  	Usage:      required
>  	Value type: <string>
> -	Definition: Must be one of: "qcom,pm8998-rpmh-regulators",
> -		    "qcom,pmi8998-rpmh-regulators" or
> -		    "qcom,pm8005-rpmh-regulators" or
> -		    "qcom,pm8150-rpmh-regulators" or
> -		    "qcom,pm8150l-rpmh-regulators" or
> -		    "qcom,pm8009-rpmh-regulators".
> +	Definition: Must be one of below:
> +		    "qcom,pm8005-rpmh-regulators"
> +		    "qcom,pm8009-rpmh-regulators"
> +		    "qcom,pm8150-rpmh-regulators"
> +		    "qcom,pm8150l-rpmh-regulators"
> +		    "qcom,pm8998-rpmh-regulators"
> +		    "qcom,pmi8998-rpmh-regulators"

Thanks for dropping the "or" as well.

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

>  
>  - qcom,pmic-id
>  	Usage:      required
> -- 
> 2.20.1
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/4] regulator: qcom-rpmh: Sort the compatibles
  2019-08-09  7:36 ` [PATCH 2/4] regulator: qcom-rpmh: Sort the compatibles Vinod Koul
  2019-08-09 12:31   ` Applied "regulator: qcom-rpmh: Sort the compatibles" to the regulator tree Mark Brown
@ 2019-08-09 17:02   ` Bjorn Andersson
  1 sibling, 0 replies; 12+ messages in thread
From: Bjorn Andersson @ 2019-08-09 17:02 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Mark Brown, linux-arm-msm, Andy Gross, Liam Girdwood,
	Rob Herring, Mark Rutland, linux-kernel, devicetree

On Fri 09 Aug 00:36 PDT 2019, Vinod Koul wrote:

> It helps to keep sorted order for compatibles, so sort them
> 
> Suggested-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> Signed-off-by: Vinod Koul <vkoul@kernel.org>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

> ---
>  drivers/regulator/qcom-rpmh-regulator.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c
> index 693ffec62f3e..0ef2716da3bd 100644
> --- a/drivers/regulator/qcom-rpmh-regulator.c
> +++ b/drivers/regulator/qcom-rpmh-regulator.c
> @@ -878,18 +878,14 @@ static int rpmh_regulator_probe(struct platform_device *pdev)
>  }
>  
>  static const struct of_device_id rpmh_regulator_match_table[] = {
> -	{
> -		.compatible = "qcom,pm8998-rpmh-regulators",
> -		.data = pm8998_vreg_data,
> -	},
> -	{
> -		.compatible = "qcom,pmi8998-rpmh-regulators",
> -		.data = pmi8998_vreg_data,
> -	},
>  	{
>  		.compatible = "qcom,pm8005-rpmh-regulators",
>  		.data = pm8005_vreg_data,
>  	},
> +	{
> +		.compatible = "qcom,pm8009-rpmh-regulators",
> +		.data = pm8009_vreg_data,
> +	},
>  	{
>  		.compatible = "qcom,pm8150-rpmh-regulators",
>  		.data = pm8150_vreg_data,
> @@ -899,8 +895,12 @@ static const struct of_device_id rpmh_regulator_match_table[] = {
>  		.data = pm8150l_vreg_data,
>  	},
>  	{
> -		.compatible = "qcom,pm8009-rpmh-regulators",
> -		.data = pm8009_vreg_data,
> +		.compatible = "qcom,pm8998-rpmh-regulators",
> +		.data = pm8998_vreg_data,
> +	},
> +	{
> +		.compatible = "qcom,pmi8998-rpmh-regulators",
> +		.data = pmi8998_vreg_data,
>  	},
>  	{}
>  };
> -- 
> 2.20.1
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/4] regulator: qcom-rpmh: Fix pmic5_bob voltage count
  2019-08-09  7:36 ` [PATCH 3/4] regulator: qcom-rpmh: Fix pmic5_bob voltage count Vinod Koul
  2019-08-09 12:31   ` Applied "regulator: qcom-rpmh: Fix pmic5_bob voltage count" to the regulator tree Mark Brown
@ 2019-08-09 17:03   ` Bjorn Andersson
  1 sibling, 0 replies; 12+ messages in thread
From: Bjorn Andersson @ 2019-08-09 17:03 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Mark Brown, linux-arm-msm, Andy Gross, Liam Girdwood,
	Rob Herring, Mark Rutland, linux-kernel, devicetree

On Fri 09 Aug 00:36 PDT 2019, Vinod Koul wrote:

> pmic5_bob voltages count is 136 [0,135] so update it
> 
> Signed-off-by: Vinod Koul <vkoul@kernel.org>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

> ---
>  drivers/regulator/qcom-rpmh-regulator.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c
> index 0ef2716da3bd..391ed844a251 100644
> --- a/drivers/regulator/qcom-rpmh-regulator.c
> +++ b/drivers/regulator/qcom-rpmh-regulator.c
> @@ -698,7 +698,7 @@ static const struct rpmh_vreg_hw_data pmic5_bob = {
>  	.regulator_type = VRM,
>  	.ops = &rpmh_regulator_vrm_bypass_ops,
>  	.voltage_range = REGULATOR_LINEAR_RANGE(300000, 0, 135, 32000),
> -	.n_voltages = 135,
> +	.n_voltages = 136,
>  	.pmic_mode_map = pmic_mode_map_pmic4_bob,
>  	.of_map_mode = rpmh_regulator_pmic4_bob_of_map_mode,
>  };
> -- 
> 2.20.1
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/4] regulator: qcom-rpmh: Update PMIC modes for PMIC5
  2019-08-09  7:36 ` [PATCH 4/4] regulator: qcom-rpmh: Update PMIC modes for PMIC5 Vinod Koul
  2019-08-09 12:31   ` Applied "regulator: qcom-rpmh: Update PMIC modes for PMIC5" to the regulator tree Mark Brown
@ 2019-08-09 18:00   ` Bjorn Andersson
  1 sibling, 0 replies; 12+ messages in thread
From: Bjorn Andersson @ 2019-08-09 18:00 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Mark Brown, linux-arm-msm, Andy Gross, Liam Girdwood,
	Rob Herring, Mark Rutland, linux-kernel, devicetree

On Fri 09 Aug 00:36 PDT 2019, Vinod Koul wrote:

> Add the PMIC5 modes and use them pmic5 ldo and smps
> 
> Signed-off-by: Vinod Koul <vkoul@kernel.org>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

> ---
>  drivers/regulator/qcom-rpmh-regulator.c | 52 +++++++++++++++++++++----
>  1 file changed, 45 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c
> index 391ed844a251..db6c085da65e 100644
> --- a/drivers/regulator/qcom-rpmh-regulator.c
> +++ b/drivers/regulator/qcom-rpmh-regulator.c
> @@ -50,6 +50,20 @@ enum rpmh_regulator_type {
>  #define PMIC4_BOB_MODE_AUTO			2
>  #define PMIC4_BOB_MODE_PWM			3
>  
> +#define PMIC5_LDO_MODE_RETENTION		3
> +#define PMIC5_LDO_MODE_LPM			4
> +#define PMIC5_LDO_MODE_HPM			7
> +
> +#define PMIC5_SMPS_MODE_RETENTION		3
> +#define PMIC5_SMPS_MODE_PFM			4
> +#define PMIC5_SMPS_MODE_AUTO			6
> +#define PMIC5_SMPS_MODE_PWM			7
> +
> +#define PMIC5_BOB_MODE_PASS			2
> +#define PMIC5_BOB_MODE_PFM			4
> +#define PMIC5_BOB_MODE_AUTO			6
> +#define PMIC5_BOB_MODE_PWM			7
> +
>  /**
>   * struct rpmh_vreg_hw_data - RPMh regulator hardware configurations
>   * @regulator_type:		RPMh accelerator type used to manage this
> @@ -488,6 +502,14 @@ static const int pmic_mode_map_pmic4_ldo[REGULATOR_MODE_STANDBY + 1] = {
>  	[REGULATOR_MODE_FAST]    = -EINVAL,
>  };
>  
> +static const int pmic_mode_map_pmic5_ldo[REGULATOR_MODE_STANDBY + 1] = {
> +	[REGULATOR_MODE_INVALID] = -EINVAL,
> +	[REGULATOR_MODE_STANDBY] = PMIC5_LDO_MODE_RETENTION,
> +	[REGULATOR_MODE_IDLE]    = PMIC5_LDO_MODE_LPM,
> +	[REGULATOR_MODE_NORMAL]  = PMIC5_LDO_MODE_HPM,
> +	[REGULATOR_MODE_FAST]    = -EINVAL,
> +};
> +
>  static unsigned int rpmh_regulator_pmic4_ldo_of_map_mode(unsigned int rpmh_mode)
>  {
>  	unsigned int mode;
> @@ -518,6 +540,14 @@ static const int pmic_mode_map_pmic4_smps[REGULATOR_MODE_STANDBY + 1] = {
>  	[REGULATOR_MODE_FAST]    = PMIC4_SMPS_MODE_PWM,
>  };
>  
> +static const int pmic_mode_map_pmic5_smps[REGULATOR_MODE_STANDBY + 1] = {
> +	[REGULATOR_MODE_INVALID] = -EINVAL,
> +	[REGULATOR_MODE_STANDBY] = PMIC5_SMPS_MODE_RETENTION,
> +	[REGULATOR_MODE_IDLE]    = PMIC5_SMPS_MODE_PFM,
> +	[REGULATOR_MODE_NORMAL]  = PMIC5_SMPS_MODE_AUTO,
> +	[REGULATOR_MODE_FAST]    = PMIC5_SMPS_MODE_PWM,
> +};
> +
>  static unsigned int
>  rpmh_regulator_pmic4_smps_of_map_mode(unsigned int rpmh_mode)
>  {
> @@ -552,6 +582,14 @@ static const int pmic_mode_map_pmic4_bob[REGULATOR_MODE_STANDBY + 1] = {
>  	[REGULATOR_MODE_FAST]    = PMIC4_BOB_MODE_PWM,
>  };
>  
> +static const int pmic_mode_map_pmic5_bob[REGULATOR_MODE_STANDBY + 1] = {
> +	[REGULATOR_MODE_INVALID] = -EINVAL,
> +	[REGULATOR_MODE_STANDBY] = -EINVAL,
> +	[REGULATOR_MODE_IDLE]    = PMIC5_BOB_MODE_PFM,
> +	[REGULATOR_MODE_NORMAL]  = PMIC5_BOB_MODE_AUTO,
> +	[REGULATOR_MODE_FAST]    = PMIC5_BOB_MODE_PWM,
> +};
> +
>  static unsigned int rpmh_regulator_pmic4_bob_of_map_mode(unsigned int rpmh_mode)
>  {
>  	unsigned int mode;
> @@ -643,7 +681,7 @@ static const struct rpmh_vreg_hw_data pmic5_pldo = {
>  	.voltage_range = REGULATOR_LINEAR_RANGE(1504000, 0, 255, 8000),
>  	.n_voltages = 256,
>  	.hpm_min_load_uA = 10000,
> -	.pmic_mode_map = pmic_mode_map_pmic4_ldo,
> +	.pmic_mode_map = pmic_mode_map_pmic5_ldo,
>  	.of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode,
>  };
>  
> @@ -653,7 +691,7 @@ static const struct rpmh_vreg_hw_data pmic5_pldo_lv = {
>  	.voltage_range = REGULATOR_LINEAR_RANGE(1504000, 0, 62, 8000),
>  	.n_voltages = 63,
>  	.hpm_min_load_uA = 10000,
> -	.pmic_mode_map = pmic_mode_map_pmic4_ldo,
> +	.pmic_mode_map = pmic_mode_map_pmic5_ldo,
>  	.of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode,
>  };
>  
> @@ -663,7 +701,7 @@ static const struct rpmh_vreg_hw_data pmic5_nldo = {
>  	.voltage_range = REGULATOR_LINEAR_RANGE(320000, 0, 123, 8000),
>  	.n_voltages = 124,
>  	.hpm_min_load_uA = 30000,
> -	.pmic_mode_map = pmic_mode_map_pmic4_ldo,
> +	.pmic_mode_map = pmic_mode_map_pmic5_ldo,
>  	.of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode,
>  };
>  
> @@ -672,7 +710,7 @@ static const struct rpmh_vreg_hw_data pmic5_hfsmps510 = {
>  	.ops = &rpmh_regulator_vrm_ops,
>  	.voltage_range = REGULATOR_LINEAR_RANGE(320000, 0, 215, 8000),
>  	.n_voltages = 216,
> -	.pmic_mode_map = pmic_mode_map_pmic4_smps,
> +	.pmic_mode_map = pmic_mode_map_pmic5_smps,
>  	.of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode,
>  };
>  
> @@ -681,7 +719,7 @@ static const struct rpmh_vreg_hw_data pmic5_ftsmps510 = {
>  	.ops = &rpmh_regulator_vrm_ops,
>  	.voltage_range = REGULATOR_LINEAR_RANGE(300000, 0, 263, 4000),
>  	.n_voltages = 264,
> -	.pmic_mode_map = pmic_mode_map_pmic4_smps,
> +	.pmic_mode_map = pmic_mode_map_pmic5_smps,
>  	.of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode,
>  };
>  
> @@ -690,7 +728,7 @@ static const struct rpmh_vreg_hw_data pmic5_hfsmps515 = {
>  	.ops = &rpmh_regulator_vrm_ops,
>  	.voltage_range = REGULATOR_LINEAR_RANGE(2800000, 0, 4, 1600),
>  	.n_voltages = 5,
> -	.pmic_mode_map = pmic_mode_map_pmic4_smps,
> +	.pmic_mode_map = pmic_mode_map_pmic5_smps,
>  	.of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode,
>  };
>  
> @@ -699,7 +737,7 @@ static const struct rpmh_vreg_hw_data pmic5_bob = {
>  	.ops = &rpmh_regulator_vrm_bypass_ops,
>  	.voltage_range = REGULATOR_LINEAR_RANGE(300000, 0, 135, 32000),
>  	.n_voltages = 136,
> -	.pmic_mode_map = pmic_mode_map_pmic4_bob,
> +	.pmic_mode_map = pmic_mode_map_pmic5_bob,
>  	.of_map_mode = rpmh_regulator_pmic4_bob_of_map_mode,
>  };
>  
> -- 
> 2.20.1
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, back to index

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-09  7:36 [PATCH 1/4] regulator: dt-bindings: Sort the compatibles and nodes Vinod Koul
2019-08-09  7:36 ` [PATCH 2/4] regulator: qcom-rpmh: Sort the compatibles Vinod Koul
2019-08-09 12:31   ` Applied "regulator: qcom-rpmh: Sort the compatibles" to the regulator tree Mark Brown
2019-08-09 17:02   ` [PATCH 2/4] regulator: qcom-rpmh: Sort the compatibles Bjorn Andersson
2019-08-09  7:36 ` [PATCH 3/4] regulator: qcom-rpmh: Fix pmic5_bob voltage count Vinod Koul
2019-08-09 12:31   ` Applied "regulator: qcom-rpmh: Fix pmic5_bob voltage count" to the regulator tree Mark Brown
2019-08-09 17:03   ` [PATCH 3/4] regulator: qcom-rpmh: Fix pmic5_bob voltage count Bjorn Andersson
2019-08-09  7:36 ` [PATCH 4/4] regulator: qcom-rpmh: Update PMIC modes for PMIC5 Vinod Koul
2019-08-09 12:31   ` Applied "regulator: qcom-rpmh: Update PMIC modes for PMIC5" to the regulator tree Mark Brown
2019-08-09 18:00   ` [PATCH 4/4] regulator: qcom-rpmh: Update PMIC modes for PMIC5 Bjorn Andersson
2019-08-09 12:31 ` Applied "regulator: dt-bindings: Sort the compatibles and nodes" to the regulator tree Mark Brown
2019-08-09 17:01 ` [PATCH 1/4] regulator: dt-bindings: Sort the compatibles and nodes Bjorn Andersson

Linux-ARM-MSM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-msm/0 linux-arm-msm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-msm linux-arm-msm/ https://lore.kernel.org/linux-arm-msm \
		linux-arm-msm@vger.kernel.org linux-arm-msm@archiver.kernel.org
	public-inbox-index linux-arm-msm


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-arm-msm


AGPL code for this site: git clone https://public-inbox.org/ public-inbox