Skip to contentSkip to conversation

dt-bindings: power: reset: qcom: Add qcom,pm8998-pon compatability line

PATCH Superseded John Stultz 4 participants 6 messages Jun 3, 2019 – Jul 8, 2019

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 dt-bindings: power: reset: qcom: Add qcom,pm8998-pon compatability line

Update bindings to support for qcom,pm8998-pon which uses gen2 pon

Cc Andy Gross <[email protected]>
Cc David Brown <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc Amit Pundir <[email protected]>
Cc Rob Herring <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Sebastian Reichel <[email protected]>
---
 Documentation/devicetree/bindings/power/reset/qcom,pon.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/power/reset/qcom,pon.txt +1 -0
index 5705f575862df..0c0dc3a1e693e 100644
@@ -9,6 +9,7 @@ Required Properties:
 -compatible: Must be one of:
 	"qcom,pm8916-pon"
 	"qcom,pms405-pon"
+	"qcom,pm8998-pon"
 
 -reg: Specifies the physical address of the pon register
 
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 2/3 reset: qcom-pon: Add support for gen2 pon

Add support for gen2 pon register so "reboot bootloader" can work on pixel3 and db845.

Cc Andy Gross <[email protected]>
Cc David Brown <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc Amit Pundir <[email protected]>
Cc Rob Herring <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Sebastian Reichel <[email protected]>

v2:
* Split out dts changes into separate path
* Minor cleanups and remove unused variables

---
 drivers/power/reset/qcom-pon.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/power/reset/qcom-pon.c +9 -3
index 3fa1642d4c543..22a743a0bf28c 100644
@@ -14,11 +14,15 @@
 
 #define PON_SOFT_RB_SPARE		0x8f
 
+#define GEN1_REASON_SHIFT		2
+#define GEN2_REASON_SHIFT		1
+
 struct pm8916_pon {
 	struct device *dev;
 	struct regmap *regmap;
 	u32 baseaddr;
 	struct reboot_mode_driver reboot_mode;
+	long reason_shift;
 };
 
 static int pm8916_reboot_mode_write(struct reboot_mode_driver *reboot,
@@ -30,7 +34,7 @@ static int pm8916_reboot_mode_write(struct reboot_mode_driver *reboot,
 
 	ret = regmap_update_bits(pon->regmap,
 				 pon->baseaddr + PON_SOFT_RB_SPARE,
-				 0xfc, magic << 2);
+				 0xfc, magic << pon->reason_shift);
 	if (ret < 0)
 		dev_err(pon->dev, "update reboot mode bits failed\n");
 
@@ -60,6 +64,7 @@ static int pm8916_pon_probe(struct platform_device *pdev)
 		return error;
 
 	pon->reboot_mode.dev = &pdev->dev;
+	pon->reason_shift = (long)of_device_get_match_data(&pdev->dev);
 	pon->reboot_mode.write = pm8916_reboot_mode_write;
 	error = devm_reboot_mode_register(&pdev->dev, &pon->reboot_mode);
 	if (error) {
@@ -73,8 +78,9 @@ static int pm8916_pon_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id pm8916_pon_id_table[] = {
-	{ .compatible = "qcom,pm8916-pon" },
-	{ .compatible = "qcom,pms405-pon" },
+	{ .compatible = "qcom,pm8916-pon", .data = (void *)GEN1_REASON_SHIFT },
+	{ .compatible = "qcom,pms405-pon", .data = (void *)GEN1_REASON_SHIFT },
+	{ .compatible = "qcom,pm8998-pon", .data = (void *)GEN2_REASON_SHIFT },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, pm8916_pon_id_table);
Signature · 1 line
2.17.1
#2 lore raw

PATCH v2 3/3 arm64: dts: qcom: pm8998: Use qcom,pm8998-pon binding for second gen pon

In reply to John Stultz

This changes pm8998 to use the new qcom,pm8998-pon compatible string for the pon in order to support the gen2 pon functionality properly.

Cc Andy Gross <[email protected]>
Cc David Brown <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc Amit Pundir <[email protected]>
Cc Rob Herring <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Sebastian Reichel <[email protected]>
---
 arch/arm64/boot/dts/qcom/pm8998.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/pm8998.dtsi +1 -1
index d3ca35a940fb6..051a52df80f9e 100644
@@ -39,7 +39,7 @@
 		#size-cells = <0>;
 
 		pm8998_pon: pon@800 {
-			compatible = "qcom,pm8916-pon";
+			compatible = "qcom,pm8998-pon";
 
 			reg = <0x800>;
 			mode-bootloader = <0x2>;
Signature · 1 line
2.17.1
Reviewed-by on v2 3/3
#3 lore raw

Re: [PATCH 3/3 v2] arm64: dts: qcom: pm8998: Use qcom,pm8998-pon binding for second gen pon

Quoted 4 lines · John Stultz

This changes pm8998 to use the new qcom,pm8998-pon compatible string for the pon in order to support the gen2 pon functionality properly.

Quoted 9 lines
Cc Andy Gross <[email protected]>
Cc David Brown <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc Amit Pundir <[email protected]>
Cc Rob Herring <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Sebastian Reichel <[email protected]>
Quoted 21 lines
---
 arch/arm64/boot/dts/qcom/pm8998.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/pm8998.dtsi +1 -1
index d3ca35a940fb6..051a52df80f9e 100644
@@ -39,7 +39,7 @@
 		#size-cells = <0>;
 
 		pm8998_pon: pon@800 {
-			compatible = "qcom,pm8916-pon";
+			compatible = "qcom,pm8998-pon";
 
 			reg = <0x800>;
 			mode-bootloader = <0x2>;
Signature · 1 line
2.17.1
#4 lore raw
In reply to John Stultz
Quoted 1 line · John Stultz

Subject: [PATCH 1/3 v2] dt-bindings: power: reset: qcom: Add qcom,pm8998-pon compatability line

s/compatability/compatibility

Regards.

maintainer Reviewed-by on v2 1/3
#5 lore raw
In reply to John Stultz
Quoted 13 lines · John Stultz

Update bindings to support for qcom,pm8998-pon which uses gen2 pon

Cc Andy Gross <[email protected]>
Cc David Brown <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc Amit Pundir <[email protected]>
Cc Rob Herring <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Sebastian Reichel <[email protected]>
Quoted 4 lines
---
 Documentation/devicetree/bindings/power/reset/qcom,pon.txt | 1 +
 1 file changed, 1 insertion(+)