lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YUpUUdx9UJ+aL0Fu@builder.lan>
Date:   Tue, 21 Sep 2021 16:53:21 -0500
From:   Bjorn Andersson <bjorn.andersson@...aro.org>
To:     Subbaraman Narayanamurthy <quic_subbaram@...cinc.com>
Cc:     Andy Gross <agross@...nel.org>,
        Linus Walleij <linus.walleij@...aro.org>,
        Rob Herring <robh+dt@...nel.org>,
        linux-arm-msm@...r.kernel.org, linux-gpio@...r.kernel.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] pinctrl: qcom: spmi-gpio: add support to
 enable/disable output

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@...cinc.com>

Reviewed-by: Bjorn Andersson <bjorn.andersson@...aro.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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ