* [PATCH v2 0/4] Add Support for Qualcomm SPMI GPIOs
@ 2022-09-12 21:06 Anjelique Melendez
2022-09-12 21:06 ` [PATCH v2 1/4] pinctrl: qcom: spmi-gpio: add support for LV_VIN2 and MV_VIN3 subtypes Anjelique Melendez
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: Anjelique Melendez @ 2022-09-12 21:06 UTC (permalink / raw)
To: agross, andersson, linus.walleij, robh+dt, krzysztof.kozlowski+dt
Cc: konrad.dybcio, linux-arm-msm, linux-gpio, devicetree,
linux-kernel, quic_collinsd, quic_jprakash, Anjelique Melendez
This series provides support and fixes for Qualcomm SPMI GPIOs.
Changes since v1:
- Updated 2/4 so that changes only take place in driver
- Updated 4/4 to add in allOf: constraints
Anjelique Melendez (2):
pinctrl: qcom: spmi-gpio: Fix the GPIO strength mapping
dt-bindings: qcom-pmic-gpio: Add PM7250B and PM8450 bindings
David Collins (1):
pinctrl: qcom: spmi-gpio: add support for LV_VIN2 and MV_VIN3 subtypes
Jishnu Prakash (1):
pinctrl: qcom: spmi-gpio: Add compatible for PM7250B
.../bindings/pinctrl/qcom,pmic-gpio.yaml | 4 ++
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 41 ++++++++++++++++++-
2 files changed, 43 insertions(+), 2 deletions(-)
--
2.35.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 1/4] pinctrl: qcom: spmi-gpio: add support for LV_VIN2 and MV_VIN3 subtypes
2022-09-12 21:06 [PATCH v2 0/4] Add Support for Qualcomm SPMI GPIOs Anjelique Melendez
@ 2022-09-12 21:06 ` Anjelique Melendez
2022-09-12 21:06 ` [PATCH v2 2/4] pinctrl: qcom: spmi-gpio: Fix the GPIO strength mapping Anjelique Melendez
` (3 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Anjelique Melendez @ 2022-09-12 21:06 UTC (permalink / raw)
To: agross, andersson, linus.walleij, robh+dt, krzysztof.kozlowski+dt
Cc: konrad.dybcio, linux-arm-msm, linux-gpio, devicetree,
linux-kernel, quic_collinsd, quic_jprakash, Anjelique Melendez
From: David Collins <quic_collinsd@quicinc.com>
Add support for SPMI PMIC GPIO subtypes GPIO_LV_VIN2 and
GPIO_MV_VIN3.
GPIO_LV_VIN2 GPIOs support two input reference voltages: VIN0 and
VIN1. These are typically connected to 1.8 V and 1.2 V supplies
respectively.
GPIO_MV_VIN3 GPIOs support three input reference voltages: VIN0,
VIN1, and VIN2. These are typically connected to Vph, 1.8 V, and
1.2 V supplies respectively.
Signed-off-by: David Collins <quic_collinsd@quicinc.com>
Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
---
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
index ccaf40a9c0e6..cf6b6047de8d 100644
--- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
+++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2012-2014, 2016-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/gpio/driver.h>
@@ -36,6 +37,8 @@
#define PMIC_GPIO_SUBTYPE_GPIOC_8CH 0xd
#define PMIC_GPIO_SUBTYPE_GPIO_LV 0x10
#define PMIC_GPIO_SUBTYPE_GPIO_MV 0x11
+#define PMIC_GPIO_SUBTYPE_GPIO_LV_VIN2 0x12
+#define PMIC_GPIO_SUBTYPE_GPIO_MV_VIN3 0x13
#define PMIC_MPP_REG_RT_STS 0x10
#define PMIC_MPP_REG_RT_STS_VAL_MASK 0x1
@@ -823,6 +826,16 @@ static int pmic_gpio_populate(struct pmic_gpio_state *state,
pad->have_buffer = true;
pad->lv_mv_type = true;
break;
+ case PMIC_GPIO_SUBTYPE_GPIO_LV_VIN2:
+ pad->num_sources = 2;
+ pad->have_buffer = true;
+ pad->lv_mv_type = true;
+ break;
+ case PMIC_GPIO_SUBTYPE_GPIO_MV_VIN3:
+ pad->num_sources = 3;
+ pad->have_buffer = true;
+ pad->lv_mv_type = true;
+ break;
default:
dev_err(state->dev, "unknown GPIO type 0x%x\n", subtype);
return -ENODEV;
--
2.35.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/4] pinctrl: qcom: spmi-gpio: Fix the GPIO strength mapping
2022-09-12 21:06 [PATCH v2 0/4] Add Support for Qualcomm SPMI GPIOs Anjelique Melendez
2022-09-12 21:06 ` [PATCH v2 1/4] pinctrl: qcom: spmi-gpio: add support for LV_VIN2 and MV_VIN3 subtypes Anjelique Melendez
@ 2022-09-12 21:06 ` Anjelique Melendez
2022-09-13 10:56 ` Krzysztof Kozlowski
2022-09-12 21:06 ` [PATCH v2 3/4] pinctrl: qcom: spmi-gpio: Add compatible for PM7250B Anjelique Melendez
` (2 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Anjelique Melendez @ 2022-09-12 21:06 UTC (permalink / raw)
To: agross, andersson, linus.walleij, robh+dt, krzysztof.kozlowski+dt
Cc: konrad.dybcio, linux-arm-msm, linux-gpio, devicetree,
linux-kernel, quic_collinsd, quic_jprakash, Anjelique Melendez
The SPMI based PMICs have the HIGH and LOW GPIO output strength mappings
interchanged, fix them.
Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
---
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 27 ++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
index cf6b6047de8d..3973ea77aada 100644
--- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
+++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
@@ -101,6 +101,9 @@
#define PMIC_GPIO_OUT_BUF_OPEN_DRAIN_NMOS 1
#define PMIC_GPIO_OUT_BUF_OPEN_DRAIN_PMOS 2
+#define PMIC_GPIO_OUT_STRENGTH_LOW 1
+#define PMIC_GPIO_OUT_STRENGTH_HIGH 3
+
/* PMIC_GPIO_REG_EN_CTL */
#define PMIC_GPIO_REG_MASTER_EN_SHIFT 7
@@ -440,7 +443,17 @@ static int pmic_gpio_config_get(struct pinctrl_dev *pctldev,
arg = pad->pullup;
break;
case PMIC_GPIO_CONF_STRENGTH:
- arg = pad->strength;
+ switch (pad->strength) {
+ case PMIC_GPIO_OUT_STRENGTH_HIGH:
+ arg = PMIC_GPIO_STRENGTH_HIGH;
+ break;
+ case PMIC_GPIO_OUT_STRENGTH_LOW:
+ arg = PMIC_GPIO_STRENGTH_LOW;
+ break;
+ default:
+ arg = pad->strength;
+ break;
+ }
break;
case PMIC_GPIO_CONF_ATEST:
arg = pad->atest;
@@ -527,7 +540,17 @@ static int pmic_gpio_config_set(struct pinctrl_dev *pctldev, unsigned int pin,
case PMIC_GPIO_CONF_STRENGTH:
if (arg > PMIC_GPIO_STRENGTH_LOW)
return -EINVAL;
- pad->strength = arg;
+ switch (arg) {
+ case PMIC_GPIO_STRENGTH_HIGH:
+ pad->strength = PMIC_GPIO_OUT_STRENGTH_HIGH;
+ break;
+ case PMIC_GPIO_STRENGTH_LOW:
+ pad->strength = PMIC_GPIO_OUT_STRENGTH_LOW;
+ break;
+ default:
+ pad->strength = arg;
+ break;
+ }
break;
case PMIC_GPIO_CONF_ATEST:
if (!pad->lv_mv_type || arg > 4)
--
2.35.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 3/4] pinctrl: qcom: spmi-gpio: Add compatible for PM7250B
2022-09-12 21:06 [PATCH v2 0/4] Add Support for Qualcomm SPMI GPIOs Anjelique Melendez
2022-09-12 21:06 ` [PATCH v2 1/4] pinctrl: qcom: spmi-gpio: add support for LV_VIN2 and MV_VIN3 subtypes Anjelique Melendez
2022-09-12 21:06 ` [PATCH v2 2/4] pinctrl: qcom: spmi-gpio: Fix the GPIO strength mapping Anjelique Melendez
@ 2022-09-12 21:06 ` Anjelique Melendez
2022-09-12 21:06 ` [PATCH v2 4/4] dt-bindings: qcom-pmic-gpio: Add PM7250B and PM8450 bindings Anjelique Melendez
2022-09-19 11:52 ` [PATCH v2 0/4] Add Support for Qualcomm SPMI GPIOs Linus Walleij
4 siblings, 0 replies; 8+ messages in thread
From: Anjelique Melendez @ 2022-09-12 21:06 UTC (permalink / raw)
To: agross, andersson, linus.walleij, robh+dt, krzysztof.kozlowski+dt
Cc: konrad.dybcio, linux-arm-msm, linux-gpio, devicetree,
linux-kernel, quic_collinsd, quic_jprakash, Anjelique Melendez,
Krzysztof Kozlowski
From: Jishnu Prakash <quic_jprakash@quicinc.com>
Add support for qcom,pm7250b-gpio variant.
Signed-off-by: Jishnu Prakash <quic_jprakash@quicinc.com>
Signed-off-by: David Collins <quic_collinsd@quicinc.com>
Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
index 3973ea77aada..3a0ab319e9a5 100644
--- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
+++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
@@ -1183,6 +1183,7 @@ static const struct of_device_id pmic_gpio_of_match[] = {
{ .compatible = "qcom,pm6150-gpio", .data = (void *) 10 },
{ .compatible = "qcom,pm6150l-gpio", .data = (void *) 12 },
{ .compatible = "qcom,pm6350-gpio", .data = (void *) 9 },
+ { .compatible = "qcom,pm7250b-gpio", .data = (void *) 12 },
{ .compatible = "qcom,pm7325-gpio", .data = (void *) 10 },
{ .compatible = "qcom,pm8005-gpio", .data = (void *) 4 },
{ .compatible = "qcom,pm8008-gpio", .data = (void *) 2 },
--
2.35.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 4/4] dt-bindings: qcom-pmic-gpio: Add PM7250B and PM8450 bindings
2022-09-12 21:06 [PATCH v2 0/4] Add Support for Qualcomm SPMI GPIOs Anjelique Melendez
` (2 preceding siblings ...)
2022-09-12 21:06 ` [PATCH v2 3/4] pinctrl: qcom: spmi-gpio: Add compatible for PM7250B Anjelique Melendez
@ 2022-09-12 21:06 ` Anjelique Melendez
2022-09-13 10:55 ` Krzysztof Kozlowski
2022-09-19 11:52 ` [PATCH v2 0/4] Add Support for Qualcomm SPMI GPIOs Linus Walleij
4 siblings, 1 reply; 8+ messages in thread
From: Anjelique Melendez @ 2022-09-12 21:06 UTC (permalink / raw)
To: agross, andersson, linus.walleij, robh+dt, krzysztof.kozlowski+dt
Cc: konrad.dybcio, linux-arm-msm, linux-gpio, devicetree,
linux-kernel, quic_collinsd, quic_jprakash, Anjelique Melendez
Update the Qualcomm Technologies, Inc. PMIC GPIO binding documentation
to include compatible strings for PM7250B and PM8450 PMICs.
Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
---
Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
index 694898f382be..29dd503f9522 100644
--- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
@@ -24,6 +24,7 @@ properties:
- qcom,pm6150-gpio
- qcom,pm6150l-gpio
- qcom,pm6350-gpio
+ - qcom,pm7250b-gpio
- qcom,pm7325-gpio
- qcom,pm8005-gpio
- qcom,pm8008-gpio
@@ -231,6 +232,7 @@ allOf:
enum:
- qcom,pm660l-gpio
- qcom,pm6150l-gpio
+ - qcom,pm7250b-gpio
- qcom,pm8038-gpio
- qcom,pm8150b-gpio
- qcom,pm8150l-gpio
@@ -392,6 +394,7 @@ $defs:
- gpio1-gpio10 for pm6150
- gpio1-gpio12 for pm6150l
- gpio1-gpio9 for pm6350
+ - gpio1-gpio12 for pm7250b
- gpio1-gpio10 for pm7325
- gpio1-gpio4 for pm8005
- gpio1-gpio2 for pm8008
@@ -407,6 +410,7 @@ $defs:
- gpio1-gpio10 for pm8350
- gpio1-gpio8 for pm8350b
- gpio1-gpio9 for pm8350c
+ - gpio1-gpio4 for pm8450
- gpio1-gpio38 for pm8917
- gpio1-gpio44 for pm8921
- gpio1-gpio36 for pm8941
--
2.35.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 4/4] dt-bindings: qcom-pmic-gpio: Add PM7250B and PM8450 bindings
2022-09-12 21:06 ` [PATCH v2 4/4] dt-bindings: qcom-pmic-gpio: Add PM7250B and PM8450 bindings Anjelique Melendez
@ 2022-09-13 10:55 ` Krzysztof Kozlowski
0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-13 10:55 UTC (permalink / raw)
To: Anjelique Melendez, agross, andersson, linus.walleij, robh+dt,
krzysztof.kozlowski+dt
Cc: konrad.dybcio, linux-arm-msm, linux-gpio, devicetree,
linux-kernel, quic_collinsd, quic_jprakash
On 12/09/2022 23:06, Anjelique Melendez wrote:
> Update the Qualcomm Technologies, Inc. PMIC GPIO binding documentation
> to include compatible strings for PM7250B and PM8450 PMICs.
>
> Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/4] pinctrl: qcom: spmi-gpio: Fix the GPIO strength mapping
2022-09-12 21:06 ` [PATCH v2 2/4] pinctrl: qcom: spmi-gpio: Fix the GPIO strength mapping Anjelique Melendez
@ 2022-09-13 10:56 ` Krzysztof Kozlowski
0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-13 10:56 UTC (permalink / raw)
To: Anjelique Melendez, agross, andersson, linus.walleij, robh+dt,
krzysztof.kozlowski+dt
Cc: konrad.dybcio, linux-arm-msm, linux-gpio, devicetree,
linux-kernel, quic_collinsd, quic_jprakash
On 12/09/2022 23:06, Anjelique Melendez wrote:
> The SPMI based PMICs have the HIGH and LOW GPIO output strength mappings
> interchanged, fix them.
This looks like a fix, so should have Fixes tag and Cc-stable.
Code looks good, thanks.
>
> Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
> ---
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 0/4] Add Support for Qualcomm SPMI GPIOs
2022-09-12 21:06 [PATCH v2 0/4] Add Support for Qualcomm SPMI GPIOs Anjelique Melendez
` (3 preceding siblings ...)
2022-09-12 21:06 ` [PATCH v2 4/4] dt-bindings: qcom-pmic-gpio: Add PM7250B and PM8450 bindings Anjelique Melendez
@ 2022-09-19 11:52 ` Linus Walleij
4 siblings, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2022-09-19 11:52 UTC (permalink / raw)
To: Anjelique Melendez
Cc: agross, andersson, robh+dt, krzysztof.kozlowski+dt,
konrad.dybcio, linux-arm-msm, linux-gpio, devicetree,
linux-kernel, quic_collinsd, quic_jprakash
On Mon, Sep 12, 2022 at 11:06 PM Anjelique Melendez
<quic_amelende@quicinc.com> wrote:
> This series provides support and fixes for Qualcomm SPMI GPIOs.
Patches applied for next!
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-09-19 11:53 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-12 21:06 [PATCH v2 0/4] Add Support for Qualcomm SPMI GPIOs Anjelique Melendez
2022-09-12 21:06 ` [PATCH v2 1/4] pinctrl: qcom: spmi-gpio: add support for LV_VIN2 and MV_VIN3 subtypes Anjelique Melendez
2022-09-12 21:06 ` [PATCH v2 2/4] pinctrl: qcom: spmi-gpio: Fix the GPIO strength mapping Anjelique Melendez
2022-09-13 10:56 ` Krzysztof Kozlowski
2022-09-12 21:06 ` [PATCH v2 3/4] pinctrl: qcom: spmi-gpio: Add compatible for PM7250B Anjelique Melendez
2022-09-12 21:06 ` [PATCH v2 4/4] dt-bindings: qcom-pmic-gpio: Add PM7250B and PM8450 bindings Anjelique Melendez
2022-09-13 10:55 ` Krzysztof Kozlowski
2022-09-19 11:52 ` [PATCH v2 0/4] Add Support for Qualcomm SPMI GPIOs Linus Walleij
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).