* [PATCH] pinctrl: meson: a4: Add input enable pin configuration
@ 2026-08-12 10:17 Xianwei Zhao via B4 Relay
2026-08-14 7:32 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: Xianwei Zhao via B4 Relay @ 2026-08-12 10:17 UTC (permalink / raw)
To: Linus Walleij, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl
Cc: linux-amlogic, linux-gpio, linux-arm-kernel, linux-kernel, Xianwei Zhao
From: Xianwei Zhao <xianwei.zhao@amlogic.com>
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>
---
drivers/pinctrl/meson/pinctrl-amlogic-a4.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
index 420f7915c010..39eb8cc7fc0d 100644
--- a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
+++ b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
@@ -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 = ret;
+ break;
+ case PIN_CONFIG_INPUT_ENABLE:
+ ret = aml_pinconf_get_output(info, pin);
+ if (ret < 0)
return -EINVAL;
- arg = 1;
+ 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;
---
base-commit: 761af93c9f1a100b8d9f71aa744b8f9abbbbbfb2
change-id: 20260812-input-enable-51166b444697
Best regards,
--
Xianwei Zhao <xianwei.zhao@amlogic.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] pinctrl: meson: a4: Add input enable pin configuration
2026-08-12 10:17 [PATCH] pinctrl: meson: a4: Add input enable pin configuration Xianwei Zhao via B4 Relay
@ 2026-08-14 7:32 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2026-08-14 7:32 UTC (permalink / raw)
To: xianwei.zhao
Cc: Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
linux-amlogic, linux-gpio, linux-arm-kernel, linux-kernel
On Wed, Aug 12, 2026 at 12:18 PM Xianwei Zhao via B4 Relay
<devnull+xianwei.zhao.amlogic.com@kernel.org> wrote:
> From: Xianwei Zhao <xianwei.zhao@amlogic.com>
>
> 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>
I just applied this because we are close to the merge window and
it seems important and looks good to me.
I can always pull it out if the maintainers object.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-14 7:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-12 10:17 [PATCH] pinctrl: meson: a4: Add input enable pin configuration Xianwei Zhao via B4 Relay
2026-08-14 7:32 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®