* [PATCH 0/2] pinctrl: qcom: spmi-gpio: Add support to enable/disable output @ 2021-09-14 2:57 Subbaraman Narayanamurthy 2021-09-14 2:57 ` [PATCH 1/2] dt-bindings: pinctrl: qcom-pmic-gpio: Add output-{enable,disable} properties Subbaraman Narayanamurthy 2021-09-14 2:57 ` [PATCH 2/2] pinctrl: qcom: spmi-gpio: add support to enable/disable output Subbaraman Narayanamurthy 0 siblings, 2 replies; 6+ messages in thread From: Subbaraman Narayanamurthy @ 2021-09-14 2:57 UTC (permalink / raw) To: Andy Gross, Bjorn Andersson, Linus Walleij, Rob Herring Cc: linux-arm-msm, linux-gpio, devicetree, linux-kernel, Subbaraman Narayanamurthy Add support to enable/disable output for Qualcomm SPMI GPIO. Subbaraman Narayanamurthy (2): dt-bindings: pinctrl: qcom-pmic-gpio: Add output-{enable,disable} properties pinctrl: qcom: spmi-gpio: add support to enable/disable output Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml | 2 ++ drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) -- 2.7.4 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] dt-bindings: pinctrl: qcom-pmic-gpio: Add output-{enable,disable} properties 2021-09-14 2:57 [PATCH 0/2] pinctrl: qcom: spmi-gpio: Add support to enable/disable output Subbaraman Narayanamurthy @ 2021-09-14 2:57 ` Subbaraman Narayanamurthy 2021-09-21 20:23 ` Rob Herring 2021-09-23 21:34 ` Linus Walleij 2021-09-14 2:57 ` [PATCH 2/2] pinctrl: qcom: spmi-gpio: add support to enable/disable output Subbaraman Narayanamurthy 1 sibling, 2 replies; 6+ messages in thread From: Subbaraman Narayanamurthy @ 2021-09-14 2:57 UTC (permalink / raw) To: Andy Gross, Bjorn Andersson, Linus Walleij, Rob Herring Cc: linux-arm-msm, linux-gpio, devicetree, linux-kernel, Subbaraman Narayanamurthy Add support for the pinconf DT property output-enable, output-disable so that output can be enabled/disabled. Signed-off-by: Subbaraman Narayanamurthy <quic_subbaram@quicinc.com> --- Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml index 9bd01db..fa7c319 100644 --- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml +++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml @@ -170,6 +170,8 @@ $defs: input-enable: true output-high: true output-low: true + output-enable: true + output-disable: true power-source: true qcom,drive-strength: -- 2.7.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] dt-bindings: pinctrl: qcom-pmic-gpio: Add output-{enable,disable} properties 2021-09-14 2:57 ` [PATCH 1/2] dt-bindings: pinctrl: qcom-pmic-gpio: Add output-{enable,disable} properties Subbaraman Narayanamurthy @ 2021-09-21 20:23 ` Rob Herring 2021-09-23 21:34 ` Linus Walleij 1 sibling, 0 replies; 6+ messages in thread From: Rob Herring @ 2021-09-21 20:23 UTC (permalink / raw) To: Subbaraman Narayanamurthy Cc: devicetree, linux-kernel, Rob Herring, linux-gpio, Andy Gross, linux-arm-msm, Linus Walleij, Bjorn Andersson On Mon, 13 Sep 2021 19:57:25 -0700, Subbaraman Narayanamurthy wrote: > Add support for the pinconf DT property output-enable, output-disable > so that output can be enabled/disabled. > > Signed-off-by: Subbaraman Narayanamurthy <quic_subbaram@quicinc.com> > --- > Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml | 2 ++ > 1 file changed, 2 insertions(+) > Acked-by: Rob Herring <robh@kernel.org> ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] dt-bindings: pinctrl: qcom-pmic-gpio: Add output-{enable,disable} properties 2021-09-14 2:57 ` [PATCH 1/2] dt-bindings: pinctrl: qcom-pmic-gpio: Add output-{enable,disable} properties Subbaraman Narayanamurthy 2021-09-21 20:23 ` Rob Herring @ 2021-09-23 21:34 ` Linus Walleij 1 sibling, 0 replies; 6+ messages in thread From: Linus Walleij @ 2021-09-23 21:34 UTC (permalink / raw) To: Subbaraman Narayanamurthy Cc: Andy Gross, Bjorn Andersson, Rob Herring, MSM, open list:GPIO SUBSYSTEM, open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, linux-kernel On Tue, Sep 14, 2021 at 4:57 AM Subbaraman Narayanamurthy <quic_subbaram@quicinc.com> wrote: > Add support for the pinconf DT property output-enable, output-disable > so that output can be enabled/disabled. > > Signed-off-by: Subbaraman Narayanamurthy <quic_subbaram@quicinc.com> Both patches applied! Thanks! Yours, Linus Walleij ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] pinctrl: qcom: spmi-gpio: add support to enable/disable output 2021-09-14 2:57 [PATCH 0/2] pinctrl: qcom: spmi-gpio: Add support to enable/disable output Subbaraman Narayanamurthy 2021-09-14 2:57 ` [PATCH 1/2] dt-bindings: pinctrl: qcom-pmic-gpio: Add output-{enable,disable} properties Subbaraman Narayanamurthy @ 2021-09-14 2:57 ` Subbaraman Narayanamurthy 2021-09-21 21:53 ` Bjorn Andersson 1 sibling, 1 reply; 6+ messages in thread From: Subbaraman Narayanamurthy @ 2021-09-14 2:57 UTC (permalink / raw) To: Andy Gross, Bjorn Andersson, Linus Walleij, Rob Herring Cc: linux-arm-msm, linux-gpio, devicetree, linux-kernel, Subbaraman Narayanamurthy Currently, if the GPIO is configured as output in the bootloader and user changes the mode to input in HLOS, it would end up getting configured as input/output. Functionally, this is fine; however, there may be some requirements where the output needs to be disabled so that it can be used only for input. Add support to enable/disable output mode through "output-enable" or "output-disable" pinctrl properties. Signed-off-by: Subbaraman Narayanamurthy <quic_subbaram@quicinc.com> --- drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c index 98bf0e2..39a18aa 100644 --- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c +++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2014, 2021, The Linux Foundation. All rights reserved. */ #include <linux/gpio/driver.h> @@ -424,6 +424,9 @@ static int pmic_gpio_config_get(struct pinctrl_dev *pctldev, return -EINVAL; arg = 1; break; + case PIN_CONFIG_OUTPUT_ENABLE: + arg = pad->output_enabled; + break; case PIN_CONFIG_OUTPUT: arg = pad->out_value; break; @@ -503,6 +506,9 @@ static int pmic_gpio_config_set(struct pinctrl_dev *pctldev, unsigned int pin, case PIN_CONFIG_INPUT_ENABLE: pad->input_enabled = arg ? true : false; break; + case PIN_CONFIG_OUTPUT_ENABLE: + pad->output_enabled = arg ? true : false; + break; case PIN_CONFIG_OUTPUT: pad->output_enabled = true; pad->out_value = arg; -- 2.7.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] pinctrl: qcom: spmi-gpio: add support to enable/disable output 2021-09-14 2:57 ` [PATCH 2/2] pinctrl: qcom: spmi-gpio: add support to enable/disable output Subbaraman Narayanamurthy @ 2021-09-21 21:53 ` Bjorn Andersson 0 siblings, 0 replies; 6+ messages in thread From: Bjorn Andersson @ 2021-09-21 21:53 UTC (permalink / raw) To: Subbaraman Narayanamurthy Cc: Andy Gross, Linus Walleij, Rob Herring, linux-arm-msm, linux-gpio, devicetree, linux-kernel On Mon 13 Sep 21:57 CDT 2021, Subbaraman Narayanamurthy wrote: > Currently, if the GPIO is configured as output in the bootloader > and user changes the mode to input in HLOS, it would end up > getting configured as input/output. Functionally, this is fine; > however, there may be some requirements where the output needs > to be disabled so that it can be used only for input. > > Add support to enable/disable output mode through "output-enable" > or "output-disable" pinctrl properties. > > Signed-off-by: Subbaraman Narayanamurthy <quic_subbaram@quicinc.com> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Regards, Bjorn > --- > drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c > index 98bf0e2..39a18aa 100644 > --- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c > +++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c > @@ -1,6 +1,6 @@ > // SPDX-License-Identifier: GPL-2.0-only > /* > - * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. > + * Copyright (c) 2012-2014, 2021, The Linux Foundation. All rights reserved. > */ > > #include <linux/gpio/driver.h> > @@ -424,6 +424,9 @@ static int pmic_gpio_config_get(struct pinctrl_dev *pctldev, > return -EINVAL; > arg = 1; > break; > + case PIN_CONFIG_OUTPUT_ENABLE: > + arg = pad->output_enabled; > + break; > case PIN_CONFIG_OUTPUT: > arg = pad->out_value; > break; > @@ -503,6 +506,9 @@ static int pmic_gpio_config_set(struct pinctrl_dev *pctldev, unsigned int pin, > case PIN_CONFIG_INPUT_ENABLE: > pad->input_enabled = arg ? true : false; > break; > + case PIN_CONFIG_OUTPUT_ENABLE: > + pad->output_enabled = arg ? true : false; > + break; > case PIN_CONFIG_OUTPUT: > pad->output_enabled = true; > pad->out_value = arg; > -- > 2.7.4 > ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-09-23 21:34 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-09-14 2:57 [PATCH 0/2] pinctrl: qcom: spmi-gpio: Add support to enable/disable output Subbaraman Narayanamurthy 2021-09-14 2:57 ` [PATCH 1/2] dt-bindings: pinctrl: qcom-pmic-gpio: Add output-{enable,disable} properties Subbaraman Narayanamurthy 2021-09-21 20:23 ` Rob Herring 2021-09-23 21:34 ` Linus Walleij 2021-09-14 2:57 ` [PATCH 2/2] pinctrl: qcom: spmi-gpio: add support to enable/disable output Subbaraman Narayanamurthy 2021-09-21 21:53 ` Bjorn Andersson
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.