pinctrl: meson: sync some modify from A4

Set the drive strength before enabling the output to avoid enabling
the output with an unintended drive strength.

Also return the actual output enable state from
PIN_CONFIG_OUTPUT_ENABLE instead of always reporting it 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:22:12 +00:00 committed by Linus Walleij
parent 44f10eb888
commit fa410c3165

View File

@ -252,11 +252,11 @@ static int meson_pinconf_set_output_drive(struct meson_pinctrl *pc,
{
int ret;
ret = meson_pinconf_set_output(pc, pin, true);
ret = meson_pinconf_set_drive(pc, pin, high);
if (ret)
return ret;
return meson_pinconf_set_drive(pc, pin, high);
return meson_pinconf_set_output(pc, pin, true);
}
static int meson_pinconf_disable_bias(struct meson_pinctrl *pc,
@ -498,9 +498,9 @@ static int meson_pinconf_get(struct pinctrl_dev *pcdev, unsigned int pin,
break;
case PIN_CONFIG_OUTPUT_ENABLE:
ret = meson_pinconf_get_output(pc, pin);
if (ret <= 0)
if (ret < 0)
return -EINVAL;
arg = 1;
arg = ret;
break;
case PIN_CONFIG_LEVEL:
ret = meson_pinconf_get_output(pc, pin);