Commit 772be1da authored by Ryan Wanner's avatar Ryan Wanner Committed by Linus Walleij
Browse files

pinctrl: at91-pio4: Enable Push-Pull configuration



Enable push-pull configuration. Remove integer value argument from
open-drain configuration as it is discarded when pinconf function is
called from gpiolib. Add push-pull do debug and get functions.

Signed-off-by: default avatarRyan Wanner <Ryan.Wanner@microchip.com>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/d898c31277f6bce6f7d830edf4332ff605498c7b.1684313910.git.Ryan.Wanner@microchip.com


[Fix two coding style issues]
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 93bd39f0
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -762,6 +762,11 @@ static int atmel_conf_pin_config_group_get(struct pinctrl_dev *pctldev,
			return -EINVAL;
		arg = 1;
		break;
	case PIN_CONFIG_DRIVE_PUSH_PULL:
		if (res & ATMEL_PIO_OPD_MASK)
			return -EINVAL;
		arg = 1;
		break;
	case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
		if (!(res & ATMEL_PIO_SCHMITT_MASK))
			return -EINVAL;
@@ -827,11 +832,11 @@ static int atmel_conf_pin_config_group_set(struct pinctrl_dev *pctldev,
			conf &= (~ATMEL_PIO_PUEN_MASK);
			break;
		case PIN_CONFIG_DRIVE_OPEN_DRAIN:
			if (arg == 0)
				conf &= (~ATMEL_PIO_OPD_MASK);
			else
			conf |= ATMEL_PIO_OPD_MASK;
			break;
		case PIN_CONFIG_DRIVE_PUSH_PULL:
			conf &= ~ATMEL_PIO_OPD_MASK;
			break;
		case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
			if (arg == 0)
				conf |= ATMEL_PIO_SCHMITT_MASK;
@@ -948,6 +953,8 @@ static void atmel_conf_pin_config_dbg_show(struct pinctrl_dev *pctldev,
		seq_printf(s, "%s ", "debounce");
	if (conf & ATMEL_PIO_OPD_MASK)
		seq_printf(s, "%s ", "open-drain");
	else
		seq_printf(s, "%s ", "push-pull");
	if (conf & ATMEL_PIO_SCHMITT_MASK)
		seq_printf(s, "%s ", "schmitt");
	if (atmel_pioctrl->slew_rate_support && (conf & ATMEL_PIO_SR_MASK))