diff mbox series

gpio: qcom_spmi_gpio: fix bias-pull-down

Message ID 20260902142736.2419504-3-casey.connolly@linaro.org
State New
Delegated to: Casey Connolly
Headers show
Series gpio: qcom_spmi_gpio: fix bias-pull-down | expand

Commit Message

Casey Connolly Sept. 2, 2026, 2:27 p.m. UTC
A small logic error resulted in bias-pull-down being interpreted as
bias-pull-up, fix this.

Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
---
 drivers/gpio/qcom_spmi_gpio.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Neil Armstrong Sept. 2, 2026, 2:37 p.m. UTC | #1
On 9/2/26 16:27, Casey Connolly wrote:
> A small logic error resulted in bias-pull-down being interpreted as
> bias-pull-up, fix this.
> 
> Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
> ---
>   drivers/gpio/qcom_spmi_gpio.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpio/qcom_spmi_gpio.c b/drivers/gpio/qcom_spmi_gpio.c
> index bd1d7a16e852..b218a3d3d585 100644
> --- a/drivers/gpio/qcom_spmi_gpio.c
> +++ b/drivers/gpio/qcom_spmi_gpio.c
> @@ -795,9 +795,9 @@ static const struct pinconf_param qcom_spmi_pmic_pinctrl_conf_params[] = {
>   	{ "drive-open-drain", PIN_CONFIG_DRIVE_OPEN_DRAIN, 0 },
>   	{ "drive-open-source", PIN_CONFIG_DRIVE_OPEN_SOURCE, 0 },
>   	{ "bias-disable", PIN_CONFIG_BIAS_DISABLE, 0 },
>   	{ "bias-pull-up", PIN_CONFIG_BIAS_PULL_UP, PMIC_GPIO_PULL_UP_30 },
> -	{ "bias-pull-down", PIN_CONFIG_BIAS_PULL_UP, 0 },
> +	{ "bias-pull-down", PIN_CONFIG_BIAS_PULL_DOWN, 0 },
>   	{ "bias-high-impedance", PIN_CONFIG_BIAS_HIGH_IMPEDANCE, 0 },
>   	{ "power-source", PIN_CONFIG_POWER_SOURCE, 0 },
>   	{ "input-disable", PIN_CONFIG_INPUT_ENABLE, 0 },
>   	{ "input-enable", PIN_CONFIG_INPUT_ENABLE, 1 },
> @@ -879,12 +879,9 @@ static int qcom_spmi_pmic_pinctrl_pinconf_set(struct udevice *dev, unsigned int
>   	case PIN_CONFIG_BIAS_PULL_UP:
>   		pad->pullup = PMIC_GPIO_PULL_UP_30;
>   		break;
>   	case PIN_CONFIG_BIAS_PULL_DOWN:
> -		if (arg)
> -			pad->pullup = PMIC_GPIO_PULL_DOWN;
> -		else
> -			pad->pullup = PMIC_GPIO_PULL_DISABLE;
> +		pad->pullup = PMIC_GPIO_PULL_DOWN;
>   		break;
>   	case PIN_CONFIG_BIAS_HIGH_IMPEDANCE:
>   		pad->is_enabled = false;
>   		break;

Good catch


Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

Thanks,
Neil
diff mbox series

Patch

diff --git a/drivers/gpio/qcom_spmi_gpio.c b/drivers/gpio/qcom_spmi_gpio.c
index bd1d7a16e852..b218a3d3d585 100644
--- a/drivers/gpio/qcom_spmi_gpio.c
+++ b/drivers/gpio/qcom_spmi_gpio.c
@@ -795,9 +795,9 @@  static const struct pinconf_param qcom_spmi_pmic_pinctrl_conf_params[] = {
 	{ "drive-open-drain", PIN_CONFIG_DRIVE_OPEN_DRAIN, 0 },
 	{ "drive-open-source", PIN_CONFIG_DRIVE_OPEN_SOURCE, 0 },
 	{ "bias-disable", PIN_CONFIG_BIAS_DISABLE, 0 },
 	{ "bias-pull-up", PIN_CONFIG_BIAS_PULL_UP, PMIC_GPIO_PULL_UP_30 },
-	{ "bias-pull-down", PIN_CONFIG_BIAS_PULL_UP, 0 },
+	{ "bias-pull-down", PIN_CONFIG_BIAS_PULL_DOWN, 0 },
 	{ "bias-high-impedance", PIN_CONFIG_BIAS_HIGH_IMPEDANCE, 0 },
 	{ "power-source", PIN_CONFIG_POWER_SOURCE, 0 },
 	{ "input-disable", PIN_CONFIG_INPUT_ENABLE, 0 },
 	{ "input-enable", PIN_CONFIG_INPUT_ENABLE, 1 },
@@ -879,12 +879,9 @@  static int qcom_spmi_pmic_pinctrl_pinconf_set(struct udevice *dev, unsigned int
 	case PIN_CONFIG_BIAS_PULL_UP:
 		pad->pullup = PMIC_GPIO_PULL_UP_30;
 		break;
 	case PIN_CONFIG_BIAS_PULL_DOWN:
-		if (arg)
-			pad->pullup = PMIC_GPIO_PULL_DOWN;
-		else
-			pad->pullup = PMIC_GPIO_PULL_DISABLE;
+		pad->pullup = PMIC_GPIO_PULL_DOWN;
 		break;
 	case PIN_CONFIG_BIAS_HIGH_IMPEDANCE:
 		pad->is_enabled = false;
 		break;