Skip to contentSkip to conversation

gpio: qcom_spmi_gpio: fix bias-pull-down

PATCH Applied Casey Connolly 2 participants 3 messages Sep 2 – Oct 28

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: qcom_spmi_gpio: fix bias-pull-down

A small logic error resulted in bias-pull-down being interpreted as bias-pull-up, fix this.

---
 drivers/gpio/qcom_spmi_gpio.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/gpio/qcom_spmi_gpio.c +2 -5
index bd1d7a16e852..b218a3d3d585 100644
@@ -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;
Signature · 1 line
2.55.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 27 lines · Casey Connolly

A small logic error resulted in bias-pull-down being interpreted as bias-pull-up, fix this.

---
  drivers/gpio/qcom_spmi_gpio.c | 7 ++-----
  1 file changed, 2 insertions(+), 5 deletions(-)
drivers/gpio/qcom_spmi_gpio.c +1 -1
index bd1d7a16e852..b218a3d3d585 100644
@@ -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;

drivers/gpio/qcom_spmi_gpio.c static int qcom_spmi_pmic_pinctrl_pinconf_set(struct udevice *dev, unsigned int · line 887

Quoted 10 lines
drivers/gpio/qcom_spmi_gpio.c +1 -4
  	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

Thanks,
Neil