Skip to contentSkip to conversation

Add LV/MV subtypes support for QCOM PMIC GPIOs

PATCH Superseded [email protected] 3 participants 7 messages Jul 19, 2017 – Aug 11, 2017

Subsystems (6)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#1 lore raw

PATCH v2 1/2 pinctrl: qcom: spmi-gpio: Add support for GPIO LV/MV subtype

In reply to [email protected]

From: Fenglin Wu <[email protected]>

GPIO LV (low voltage)/MV (medium voltage) subtypes have different features and register mappings than 4CH/8CH subtypes. Add support for LV and MV subtypes.

---
 .../devicetree/bindings/pinctrl/qcom,pmic-gpio.txt |  17 +-
 drivers/pinctrl/qcom/pinctrl-spmi-gpio.c           | 281 +++++++++++++++++----
 include/dt-bindings/pinctrl/qcom,pmic-gpio.h       |   2 +
 3 files changed, 250 insertions(+), 50 deletions(-)
Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt +16 -1
index 8d893a8..d9d2054 100644
@@ -98,7 +98,10 @@ to specify in a pin configuration subnode:
 		    "dtest1",
 		    "dtest2",
 		    "dtest3",
-		    "dtest4"
+		    "dtest4",
+		    And following values are supported by LV/MV GPIO subtypes:
+		    "func3",
+		    "func4"
 
 - bias-disable:
 	Usage: optional
@@ -183,6 +186,18 @@ to specify in a pin configuration subnode:
 	Value type: <none>
 	Definition: The specified pins are configured in open-source mode.
 
+- qcom,analog-pass:
+	Usage: optional
+	Value type: <none>
+	Definition: The specified pins are configured in analog-pass-through mode.
+
+- qcom,atest:
+	Usage: optional
+	Value type: <u32>
+	Definition: Selects ATEST rail to route to GPIO when it's configured
+		    in analog-pass-through mode.
+		    Valid values are 1-4 corresponding to ATEST1 to ATEST4.
+
 Example:
 
 	pm8921_gpio: gpio@150 {
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c +232 -49

453 lines not on this page · raw message

include/dt-bindings/pinctrl/qcom,pmic-gpio.h +2 -0
index d33f17c..b8ff882 100644
@@ -98,6 +98,8 @@
 #define PMIC_GPIO_FUNC_PAIRED		"paired"
 #define PMIC_GPIO_FUNC_FUNC1		"func1"
 #define PMIC_GPIO_FUNC_FUNC2		"func2"
+#define PMIC_GPIO_FUNC_FUNC3		"func3"
+#define PMIC_GPIO_FUNC_FUNC4		"func4"
 #define PMIC_GPIO_FUNC_DTEST1		"dtest1"
 #define PMIC_GPIO_FUNC_DTEST2		"dtest2"
 #define PMIC_GPIO_FUNC_DTEST3		"dtest3"
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.
#4 lore raw

PATCH v2 2/2 pinctrl: qcom: spmi-gpio: Add dtest route for digital input

In reply to [email protected]

From: Fenglin Wu <[email protected]>

Add property "qcom,dtest-buffer" to specify which dtest rail to feed when the pin is configured as a digital input.

---
 .../devicetree/bindings/pinctrl/qcom,pmic-gpio.txt |  7 +++
 drivers/pinctrl/qcom/pinctrl-spmi-gpio.c           | 50 ++++++++++++++++++++++
 2 files changed, 57 insertions(+)
Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt +7 -0
index d9d2054..f4cf24f 100644
@@ -198,6 +198,13 @@ to specify in a pin configuration subnode:
 		    in analog-pass-through mode.
 		    Valid values are 1-4 corresponding to ATEST1 to ATEST4.
 
+- qcom,dtest-buffer:
+	Usage: optional
+	Value type: <u32>
+	Definition: Selects DTEST rail to route to GPIO when it's configured
+		    as digital input.
+		    Valid values are 1-4 corresponding to DTEST1 to DTEST4.
+
 Example:
 
 	pm8921_gpio: gpio@150 {
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c +50 -0

122 lines not on this page · raw message

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.
#0 lore raw

v2 cover Add LV/MV subtypes support for QCOM PMIC GPIOs

From: Fenglin Wu <[email protected]>

LV (low voltage) and MV (medium voltage) subtype GPIO modules are support in QCOM PMICs like PMI8998, PM660. These modules support addtional features (func3, func4, analog-pass-through mode) and the register mappings are also different compared with legacy 4CH/8CH subtypes.

These patches add the support for the new functions in LV/MV subtypes, and add "dtest-buffer" setting for digital input configuration.

Fenglin Wu (2):
pinctrl: qcom: spmi-gpio: Add support for GPIO LV/MV subtype
pinctrl: qcom: spmi-gpio: Add dtest route for digital input

 .../devicetree/bindings/pinctrl/qcom,pmic-gpio.txt |  24 +-
 drivers/pinctrl/qcom/pinctrl-spmi-gpio.c           | 321 ++++++++++++++++++---
 include/dt-bindings/pinctrl/qcom,pmic-gpio.h       |   2 +
 3 files changed, 302 insertions(+), 45 deletions(-)
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.
maintainer Acked-by on v2 2/2
#5 lore raw

Re: [PATCH V2 2/2] pinctrl: qcom: spmi-gpio: Add dtest route for digital input

In reply to [email protected]
Quoted 8 lines · On Wed, Jul 19, 2017 at 02:30:46PM +0800…

From: Fenglin Wu <[email protected]>

Add property "qcom,dtest-buffer" to specify which dtest rail to feed when the pin is configured as a digital input.

---
 .../devicetree/bindings/pinctrl/qcom,pmic-gpio.txt |  7 +++
Quoted 2 lines
 drivers/pinctrl/qcom/pinctrl-spmi-gpio.c           | 50 ++++++++++++++++++++++
 2 files changed, 57 insertions(+)

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer Acked-by on v2 1/2
#2 lore raw

Re: [PATCH V2 1/2] pinctrl: qcom: spmi-gpio: Add support for GPIO LV/MV subtype

In reply to [email protected]
Quoted 9 lines · On Wed, Jul 19, 2017 at 02:30:45PM +0800…

From: Fenglin Wu <[email protected]>

GPIO LV (low voltage)/MV (medium voltage) subtypes have different features and register mappings than 4CH/8CH subtypes. Add support for LV and MV subtypes.

---
 .../devicetree/bindings/pinctrl/qcom,pmic-gpio.txt |  17 +-
Quoted 3 lines
 drivers/pinctrl/qcom/pinctrl-spmi-gpio.c           | 281 +++++++++++++++++----
 include/dt-bindings/pinctrl/qcom,pmic-gpio.h       |   2 +
 3 files changed, 250 insertions(+), 50 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Acked-by on v2 1/2
#3 lore raw

Re: [PATCH V2 1/2] pinctrl: qcom: spmi-gpio: Add support for GPIO LV/MV subtype

In reply to [email protected]
Quoted 7 lines · On Tue 18 Jul 23:30 PDT 2017, [email protected] wrote:

From: Fenglin Wu <[email protected]>

GPIO LV (low voltage)/MV (medium voltage) subtypes have different features and register mappings than 4CH/8CH subtypes. Add support for LV and MV subtypes.

Regards,
Bjorn

Acked-by on v2 2/2
#6 lore raw

Re: [PATCH V2 2/2] pinctrl: qcom: spmi-gpio: Add dtest route for digital input

In reply to [email protected]

On Tue 18 Jul 23:30 PDT 2017, [email protected] wrote:
[..]

drivers/pinctrl/qcom/pinctrl-spmi-gpio.c static int pmic_gpio_config_set(struct pinctrl_dev *pctldev, unsigned int pin, · line 557

Quoted 12 lines
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c +8 -0
@@ -528,6 +547,20 @@ static int pmic_gpio_config_set(struct pinctrl_dev *pctldev, unsigned int pin,
 	if (ret < 0)
 		return ret;
 
+	if (pad->dtest_buffer == 0) {
+		val = 0;
+	} else {
+		if (pad->lv_mv_type) {
+			val = pad->dtest_buffer - 1;
+			val |= PMIC_GPIO_LV_MV_DIG_IN_DTEST_EN;
+		} else {
+			val = 1 << (pad->dtest_buffer - 1);

val = BIT(pad->dtest_buffer - 1);

Regards,
Bjorn