Skip to contentSkip to conversation

Support qcom pm8994 regulators

PATCH New Stephen Boyd 1 participant 3 messages Mar 25, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Support qcom pm8994 regulators

These two patches add support for pm8994 regulators. The second patch is necessary to get things working because pm8994 has some regulators that can't typically be read/written due to the security policy.

Stephen Boyd (2):
regulator: qcom_spmi: Add support for pm8994
regulator: qcom_spmi: Keep trying to add regulators if read fails

 .../bindings/regulator/qcom,spmi-regulator.txt     | 37 +++++++++++++++
 drivers/regulator/qcom_spmi-regulator.c            | 55 +++++++++++++++++++++-
 2 files changed, 90 insertions(+), 2 deletions(-)
Signature · 1 line
2.8.0.rc4
#1 lore raw

PATCH 1/2 regulator: qcom_spmi: Add support for pm8994

Document the regulators available on pm8994 and add support for this PMIC to the SPMI PMIC regulator driver.

---
 .../bindings/regulator/qcom,spmi-regulator.txt     | 37 ++++++++++++++++
 drivers/regulator/qcom_spmi-regulator.c            | 51 ++++++++++++++++++++++
 2 files changed, 88 insertions(+)
Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.txt +37 -0
index d00bfd8624a5..46c6f3ed1a1c 100644
@@ -7,6 +7,7 @@ Qualcomm SPMI Regulators
 			"qcom,pm8841-regulators"
 			"qcom,pm8916-regulators"
 			"qcom,pm8941-regulators"
+			"qcom,pm8994-regulators"
 
 - interrupts:
 	Usage: optional
@@ -68,6 +69,37 @@ Qualcomm SPMI Regulators
 	Definition: Reference to regulator supplying the input pin, as
 		    described in the data sheet.
 
+- vdd_s1-supply:
+- vdd_s2-supply:
+- vdd_s3-supply:
+- vdd_s4-supply:
+- vdd_s5-supply:
+- vdd_s6-supply:
+- vdd_s7-supply:
+- vdd_s8-supply:
+- vdd_s9-supply:
+- vdd_s10-supply:
+- vdd_s11-supply:
+- vdd_s12-supply:
+- vdd_l1-supply:
+- vdd_l2_l26_l28-supply:
+- vdd_l3_l11-supply:
+- vdd_l4_l27_l31-supply:
+- vdd_l5_l7-supply:
+- vdd_l6_l12_l32-supply:
+- vdd_l8_l16_l30-supply:
+- vdd_l9_l10_l18_l22-supply:
+- vdd_l13_l19_l23_l24-supply:
+- vdd_l14_l15-supply:
+- vdd_l17_l29-supply:
+- vdd_l20_l21-supply:
+- vdd_l25-supply:
+- vdd_lvs_1_2-supply:
+	Usage: optional (pm8994 only)
+	Value type: <phandle>
+	Definition: Reference to regulator supplying the input pin, as
+		    described in the data sheet.
+
 
 The regulator node houses sub-nodes for each regulator within the device. Each
 sub-node is identified using the node's name, with valid values listed for each
@@ -85,6 +117,11 @@ pm8941:
 	l15, l16, l17, l18, l19, l20, l21, l22, l23, l24, lvs1, lvs2, lvs3,
 	mvs1, mvs2
 
+pm8994:
+	s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, l1, l2, l3, l4, l5,
+	l6, l7, l8, l9, l10, l11, l12, l13, l14, l15, l16, l17, l18, l19, l20,
+	l21, l22, l23, l24, l25, l26, l27, l28, l29, l30, l31, l32, lvs1, lvs2
+
 The content of each sub-node is defined by the standard binding for regulators -
 see regulator.txt - with additional custom properties described below:
 
drivers/regulator/qcom_spmi-regulator.c +51 -0

61 lines not on this page · raw message

Signature · 1 line
2.8.0.rc4
#2 lore raw

PATCH 2/2 regulator: qcom_spmi: Keep trying to add regulators if read fails

In reply to Stephen Boyd

On some designs, a handful of the regulators can't be read via SPMI transactions because they're "secure" and not intended to be touched by non-secure processors. This driver unconditionally attempts to read the id registers of all the regulators though, leading to probe failing and no regulators being registered. Let's ignore any errors from failing to read the registers and keep adding other regulators so that this driver can probe on such devices.

---
 drivers/regulator/qcom_spmi-regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/regulator/qcom_spmi-regulator.c +2 -2
index 07689fd0c0b0..3550f7f7c2eb 100644
@@ -1201,7 +1201,7 @@ static int spmi_regulator_match(struct spmi_regulator *vreg, u16 force_type)
 	ret = spmi_vreg_read(vreg, SPMI_COMMON_REG_DIG_MAJOR_REV, version,
 		ARRAY_SIZE(version));
 	if (ret) {
-		dev_err(vreg->dev, "could not read version registers\n");
+		dev_dbg(vreg->dev, "could not read version registers\n");
 		return ret;
 	}
 	dig_major_rev	= version[SPMI_COMMON_REG_DIG_MAJOR_REV
@@ -1624,7 +1624,7 @@ static int qcom_spmi_regulator_probe(struct platform_device *pdev)
 
 		ret = spmi_regulator_match(vreg, reg->force_type);
 		if (ret)
-			goto err;
+			continue;
 
 		config.dev = dev;
 		config.driver_data = vreg;
Signature · 1 line
2.8.0.rc4