linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] regulator: fix pm8009 bindings on sm8250
@ 2020-12-31 12:23 Dmitry Baryshkov
  2020-12-31 12:23 ` [PATCH 1/4] dt-bindings: regulator: qcom,rpmh-regulator: add pm8009 revision Dmitry Baryshkov
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Dmitry Baryshkov @ 2020-12-31 12:23 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Liam Girdwood, Mark Brown
  Cc: Vinod Koul, linux-arm-msm, Manivannan Sadhasivam, devicetree,
	linux-kernel


PM8009 has special revision (P=1), which is to be used for sm8250
platform. The major difference is the S2 regulator which supplies 0.95 V
instead of 2.848V. Declare regulators data to be used for this chip
revision. The datasheet calls the chip just pm8009-1, so use the same
name.


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

* [PATCH 1/4] dt-bindings: regulator: qcom,rpmh-regulator: add pm8009 revision
  2020-12-31 12:23 [PATCH 0/4] regulator: fix pm8009 bindings on sm8250 Dmitry Baryshkov
@ 2020-12-31 12:23 ` Dmitry Baryshkov
  2020-12-31 12:23 ` [PATCH 2/4] regulator: qcom-rpmh-regulator: correct hfsmps515 definition Dmitry Baryshkov
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Dmitry Baryshkov @ 2020-12-31 12:23 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Liam Girdwood, Mark Brown
  Cc: Vinod Koul, linux-arm-msm, Manivannan Sadhasivam, devicetree,
	linux-kernel

PMIC pm8009 has special revision (P=1) made for sm8250 platform. The
major difference is the S2 regulator which supplies 0.95 V instead of
2.848V. Add special compatibility string for this chip revision.
The datasheet calls the chip just pm8009-1, so use the same name.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 .../devicetree/bindings/regulator/qcom,rpmh-regulator.txt        | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.txt b/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.txt
index b8f0b7809c02..7d462b899473 100644
--- a/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.txt
@@ -44,6 +44,7 @@ First Level Nodes - PMIC
 	Definition: Must be one of below:
 		    "qcom,pm8005-rpmh-regulators"
 		    "qcom,pm8009-rpmh-regulators"
+		    "qcom,pm8009-1-rpmh-regulators"
 		    "qcom,pm8150-rpmh-regulators"
 		    "qcom,pm8150l-rpmh-regulators"
 		    "qcom,pm8350-rpmh-regulators"
-- 
2.29.2


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

* [PATCH 2/4] regulator: qcom-rpmh-regulator: correct hfsmps515 definition
  2020-12-31 12:23 [PATCH 0/4] regulator: fix pm8009 bindings on sm8250 Dmitry Baryshkov
  2020-12-31 12:23 ` [PATCH 1/4] dt-bindings: regulator: qcom,rpmh-regulator: add pm8009 revision Dmitry Baryshkov
@ 2020-12-31 12:23 ` Dmitry Baryshkov
  2020-12-31 12:23 ` [PATCH 3/4] regulator: qcom-rpmh-regulator: add pm8009-1 chip revision Dmitry Baryshkov
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Dmitry Baryshkov @ 2020-12-31 12:23 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Liam Girdwood, Mark Brown
  Cc: Vinod Koul, linux-arm-msm, Manivannan Sadhasivam, devicetree,
	linux-kernel

According to the datasheet pm8009's HFS515 regulators have 16mV
resolution rather than declared 1.6 mV. Correct the resolution.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Fixes: 06369bcc15a1 ("regulator: qcom-rpmh: Add support for SM8150")
---
 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 fe030ec4b7db..c395a8dda6f7 100644
--- a/drivers/regulator/qcom-rpmh-regulator.c
+++ b/drivers/regulator/qcom-rpmh-regulator.c
@@ -726,7 +726,7 @@ static const struct rpmh_vreg_hw_data pmic5_ftsmps510 = {
 static const struct rpmh_vreg_hw_data pmic5_hfsmps515 = {
 	.regulator_type = VRM,
 	.ops = &rpmh_regulator_vrm_ops,
-	.voltage_range = REGULATOR_LINEAR_RANGE(2800000, 0, 4, 1600),
+	.voltage_range = REGULATOR_LINEAR_RANGE(2800000, 0, 4, 16000),
 	.n_voltages = 5,
 	.pmic_mode_map = pmic_mode_map_pmic5_smps,
 	.of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode,
-- 
2.29.2


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

* [PATCH 3/4] regulator: qcom-rpmh-regulator: add pm8009-1 chip revision
  2020-12-31 12:23 [PATCH 0/4] regulator: fix pm8009 bindings on sm8250 Dmitry Baryshkov
  2020-12-31 12:23 ` [PATCH 1/4] dt-bindings: regulator: qcom,rpmh-regulator: add pm8009 revision Dmitry Baryshkov
  2020-12-31 12:23 ` [PATCH 2/4] regulator: qcom-rpmh-regulator: correct hfsmps515 definition Dmitry Baryshkov
@ 2020-12-31 12:23 ` Dmitry Baryshkov
  2020-12-31 12:23 ` [PATCH 4/4] arm64: dts: qcom: qrb5165-rb5: fix pm8009 regulators Dmitry Baryshkov
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Dmitry Baryshkov @ 2020-12-31 12:23 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Liam Girdwood, Mark Brown
  Cc: Vinod Koul, linux-arm-msm, Manivannan Sadhasivam, devicetree,
	linux-kernel

PM8009 has special revision (P=1), which is to be used for sm8250
platform. The major difference is the S2 regulator which supplies 0.95 V
instead of 2.848V. Declare regulators data to be used for this chip
revision. The datasheet calls the chip just pm8009-1, so use the same
name.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Fixes: 06369bcc15a1 ("regulator: qcom-rpmh: Add support for SM8150")
---
 drivers/regulator/qcom-rpmh-regulator.c | 26 +++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c
index c395a8dda6f7..98320e1d8bf6 100644
--- a/drivers/regulator/qcom-rpmh-regulator.c
+++ b/drivers/regulator/qcom-rpmh-regulator.c
@@ -732,6 +732,15 @@ static const struct rpmh_vreg_hw_data pmic5_hfsmps515 = {
 	.of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode,
 };
 
+static const struct rpmh_vreg_hw_data pmic5_hfsmps515_1 = {
+	.regulator_type = VRM,
+	.ops = &rpmh_regulator_vrm_ops,
+	.voltage_range = REGULATOR_LINEAR_RANGE(900000, 0, 4, 16000),
+	.n_voltages = 5,
+	.pmic_mode_map = pmic_mode_map_pmic5_smps,
+	.of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode,
+};
+
 static const struct rpmh_vreg_hw_data pmic5_bob = {
 	.regulator_type = VRM,
 	.ops = &rpmh_regulator_vrm_bypass_ops,
@@ -932,6 +941,19 @@ static const struct rpmh_vreg_init_data pm8009_vreg_data[] = {
 	{},
 };
 
+static const struct rpmh_vreg_init_data pm8009_1_vreg_data[] = {
+	RPMH_VREG("smps1",  "smp%s1",  &pmic5_hfsmps510, "vdd-s1"),
+	RPMH_VREG("smps2",  "smp%s2",  &pmic5_hfsmps515_1, "vdd-s2"),
+	RPMH_VREG("ldo1",   "ldo%s1",  &pmic5_nldo,      "vdd-l1"),
+	RPMH_VREG("ldo2",   "ldo%s2",  &pmic5_nldo,      "vdd-l2"),
+	RPMH_VREG("ldo3",   "ldo%s3",  &pmic5_nldo,      "vdd-l3"),
+	RPMH_VREG("ldo4",   "ldo%s4",  &pmic5_nldo,      "vdd-l4"),
+	RPMH_VREG("ldo5",   "ldo%s5",  &pmic5_pldo,      "vdd-l5-l6"),
+	RPMH_VREG("ldo6",   "ldo%s6",  &pmic5_pldo,      "vdd-l5-l6"),
+	RPMH_VREG("ldo7",   "ldo%s6",  &pmic5_pldo_lv,   "vdd-l7"),
+	{},
+};
+
 static const struct rpmh_vreg_init_data pm6150_vreg_data[] = {
 	RPMH_VREG("smps1",  "smp%s1",  &pmic5_ftsmps510, "vdd-s1"),
 	RPMH_VREG("smps2",  "smp%s2",  &pmic5_ftsmps510, "vdd-s2"),
@@ -1057,6 +1079,10 @@ static const struct of_device_id __maybe_unused rpmh_regulator_match_table[] = {
 		.compatible = "qcom,pm8009-rpmh-regulators",
 		.data = pm8009_vreg_data,
 	},
+	{
+		.compatible = "qcom,pm8009-1-rpmh-regulators",
+		.data = pm8009_1_vreg_data,
+	},
 	{
 		.compatible = "qcom,pm8150-rpmh-regulators",
 		.data = pm8150_vreg_data,
-- 
2.29.2


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

* [PATCH 4/4] arm64: dts: qcom: qrb5165-rb5: fix pm8009 regulators
  2020-12-31 12:23 [PATCH 0/4] regulator: fix pm8009 bindings on sm8250 Dmitry Baryshkov
                   ` (2 preceding siblings ...)
  2020-12-31 12:23 ` [PATCH 3/4] regulator: qcom-rpmh-regulator: add pm8009-1 chip revision Dmitry Baryshkov
@ 2020-12-31 12:23 ` Dmitry Baryshkov
  2021-01-04  5:56 ` [PATCH 0/4] regulator: fix pm8009 bindings on sm8250 Vinod Koul
  2021-01-04 17:40 ` Mark Brown
  5 siblings, 0 replies; 7+ messages in thread
From: Dmitry Baryshkov @ 2020-12-31 12:23 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Liam Girdwood, Mark Brown
  Cc: Vinod Koul, linux-arm-msm, Manivannan Sadhasivam, devicetree,
	linux-kernel

Fix pm8009 compatibility string to reference pm8009 revision specific to
sm8250 platform. Also add S2 regulator to be used for qca639x.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Fixes: b1d2674e6121 ("arm64: dts: qcom: Add basic devicetree support for QRB5165 RB5")
---
 arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
index cbced45d7f51..5c1cc836920f 100644
--- a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
+++ b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
@@ -140,7 +140,7 @@ qca639x: qca639x {
 
 &apps_rsc {
 	pm8009-rpmh-regulators {
-		compatible = "qcom,pm8009-rpmh-regulators";
+		compatible = "qcom,pm8009-1-rpmh-regulators";
 		qcom,pmic-id = "f";
 
 		vdd-s1-supply = <&vph_pwr>;
@@ -149,6 +149,13 @@ pm8009-rpmh-regulators {
 		vdd-l5-l6-supply = <&vreg_bob>;
 		vdd-l7-supply = <&vreg_s4a_1p8>;
 
+		vreg_s2f_0p95: smps2 {
+			regulator-name = "vreg_s2f_0p95";
+			regulator-min-microvolt = <900000>;
+			regulator-max-microvolt = <952000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
+		};
+
 		vreg_l1f_1p1: ldo1 {
 			regulator-name = "vreg_l1f_1p1";
 			regulator-min-microvolt = <1104000>;
-- 
2.29.2


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

* Re: [PATCH 0/4] regulator: fix pm8009 bindings on sm8250
  2020-12-31 12:23 [PATCH 0/4] regulator: fix pm8009 bindings on sm8250 Dmitry Baryshkov
                   ` (3 preceding siblings ...)
  2020-12-31 12:23 ` [PATCH 4/4] arm64: dts: qcom: qrb5165-rb5: fix pm8009 regulators Dmitry Baryshkov
@ 2021-01-04  5:56 ` Vinod Koul
  2021-01-04 17:40 ` Mark Brown
  5 siblings, 0 replies; 7+ messages in thread
From: Vinod Koul @ 2021-01-04  5:56 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Andy Gross, Bjorn Andersson, Liam Girdwood, Mark Brown,
	linux-arm-msm, Manivannan Sadhasivam, devicetree, linux-kernel

On 31-12-20, 15:23, Dmitry Baryshkov wrote:
> 
> PM8009 has special revision (P=1), which is to be used for sm8250
> platform. The major difference is the S2 regulator which supplies 0.95 V
> instead of 2.848V. Declare regulators data to be used for this chip
> revision. The datasheet calls the chip just pm8009-1, so use the same
> name.

Thanks, this looks sane to me:

Reviewed-by: Vinod Koul <vkoul@kernel.org>

-- 
~Vinod

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

* Re: [PATCH 0/4] regulator: fix pm8009 bindings on sm8250
  2020-12-31 12:23 [PATCH 0/4] regulator: fix pm8009 bindings on sm8250 Dmitry Baryshkov
                   ` (4 preceding siblings ...)
  2021-01-04  5:56 ` [PATCH 0/4] regulator: fix pm8009 bindings on sm8250 Vinod Koul
@ 2021-01-04 17:40 ` Mark Brown
  5 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2021-01-04 17:40 UTC (permalink / raw)
  To: Dmitry Baryshkov, Liam Girdwood, Bjorn Andersson, Andy Gross
  Cc: Manivannan Sadhasivam, devicetree, Vinod Koul, linux-arm-msm,
	linux-kernel

On Thu, 31 Dec 2020 15:23:44 +0300, Dmitry Baryshkov wrote:
> PM8009 has special revision (P=1), which is to be used for sm8250
> platform. The major difference is the S2 regulator which supplies 0.95 V
> instead of 2.848V. Declare regulators data to be used for this chip
> revision. The datasheet calls the chip just pm8009-1, so use the same
> name.

Applied to

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

Thanks!

[1/4] dt-bindings: regulator: qcom,rpmh-regulator: add pm8009 revision
      commit: 2bf3a72b08e7f6356a2db9e1571ca65f683510bb
[2/4] regulator: qcom-rpmh-regulator: correct hfsmps515 definition
      commit: df6b92fa40050e59ea89784294bf6d04c0c47705
[3/4] regulator: qcom-rpmh-regulator: add pm8009-1 chip revision
      commit: 951384cabc5dfb09251d440dbc26058eba86f97e
[4/4] arm64: dts: qcom: qrb5165-rb5: fix pm8009 regulators
      commit: c3da02421230639bf6ee5462b70b58f5b7f3b7c6

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

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

end of thread, other threads:[~2021-01-04 17:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-31 12:23 [PATCH 0/4] regulator: fix pm8009 bindings on sm8250 Dmitry Baryshkov
2020-12-31 12:23 ` [PATCH 1/4] dt-bindings: regulator: qcom,rpmh-regulator: add pm8009 revision Dmitry Baryshkov
2020-12-31 12:23 ` [PATCH 2/4] regulator: qcom-rpmh-regulator: correct hfsmps515 definition Dmitry Baryshkov
2020-12-31 12:23 ` [PATCH 3/4] regulator: qcom-rpmh-regulator: add pm8009-1 chip revision Dmitry Baryshkov
2020-12-31 12:23 ` [PATCH 4/4] arm64: dts: qcom: qrb5165-rb5: fix pm8009 regulators Dmitry Baryshkov
2021-01-04  5:56 ` [PATCH 0/4] regulator: fix pm8009 bindings on sm8250 Vinod Koul
2021-01-04 17:40 ` Mark Brown

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).