pinctrl: meson: a4: Add input enable pin configuration

Add support for PIN_CONFIG_INPUT_ENABLE in the Amlogic A4 pinctrl
driver.

Use the existing output enable control to configure the input enable
state, since the hardware uses the same control with inverse semantics.

Also update PIN_CONFIG_OUTPUT_ENABLE handling to return the actual
output enable state instead of treating any non-zero value as enabled.

Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
This commit is contained in:
Xianwei Zhao 2026-08-12 10:17:44 +00:00 committed by Linus Walleij
parent f080cfd001
commit 44f10eb888

View File

@ -469,9 +469,15 @@ static int aml_pinconf_get(struct pinctrl_dev *pcdev, unsigned int pin,
break;
case PIN_CONFIG_OUTPUT_ENABLE:
ret = aml_pinconf_get_output(info, pin);
if (ret <= 0)
if (ret < 0)
return -EINVAL;
arg = 1;
arg = ret;
break;
case PIN_CONFIG_INPUT_ENABLE:
ret = aml_pinconf_get_output(info, pin);
if (ret < 0)
return -EINVAL;
arg = !ret;
break;
case PIN_CONFIG_LEVEL:
ret = aml_pinconf_get_output(info, pin);
@ -619,6 +625,7 @@ static int aml_pinconf_set(struct pinctrl_dev *pcdev, unsigned int pin,
switch (param) {
case PIN_CONFIG_DRIVE_STRENGTH_UA:
case PIN_CONFIG_OUTPUT_ENABLE:
case PIN_CONFIG_INPUT_ENABLE:
case PIN_CONFIG_LEVEL:
arg = pinconf_to_config_argument(configs[i]);
break;
@ -643,6 +650,9 @@ static int aml_pinconf_set(struct pinctrl_dev *pcdev, unsigned int pin,
case PIN_CONFIG_OUTPUT_ENABLE:
ret = aml_pinconf_set_output(info, pin, arg);
break;
case PIN_CONFIG_INPUT_ENABLE:
ret = aml_pinconf_set_output(info, pin, !arg);
break;
case PIN_CONFIG_LEVEL:
ret = aml_pinconf_set_output_drive(info, pin, arg);
break;