pinctrl: meson: sync some modify from A4
Subsystems (3)
PATCH 1/1 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.
---
Sync some fixes from A4.
--- drivers/pinctrl/meson/pinctrl-meson.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/pinctrl/meson/pinctrl-meson.c +4 -4
@@ -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);
---
base-commit: 761af93c9f1a100b8d9f71aa744b8f9abbbbbfb2
change-id: 20260812-sync_a4-011ae20ff31c
Best regards,
Signature · 1 line
Xianwei Zhao <[email protected]>
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] Returning 0 with arg=0 for disabled PIN_CONFIG_OUTPUT_ENABLE violates the pinctrl generic API…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Returning 0 with arg=0 for disabled PIN_CONFIG_OUTPUT_ENABLE violates the pinctrl generic API and breaks debugfs dumps. --
--- Patch [1]: [PATCH] pinctrl: meson: sync some modify from A4 --- commit 9cd4cd52945d3531f8a1944d79a8d453a832ce33
Author: Xianwei Zhao <[email protected]>
pinctrl: meson: sync some modify from A4
This commit syncs fixes from A4, setting the drive strength before enabling the output to prevent unintended drive strengths. It also modifies PIN_CONFIG_OUTPUT_ENABLE to report the actual output enable state.
Quoted 4 lines
drivers/pinctrl/meson/pinctrl-meson.c +0
-0
[ ... ]
drivers/pinctrl/meson/pinctrl-meson.c static int meson_pinconf_get(struct pinctrl_dev *pcdev, unsigned int pin, · line 503
Quoted 9 lines
drivers/pinctrl/meson/pinctrl-meson.c +2
-2@@ -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;
[Severity: Medium]
The generic pinctrl API defines PIN_CONFIG_OUTPUT_ENABLE as a boolean parameter without an argument.
When a feature is inactive or disabled, drivers are expected to return -EINVAL from the get callback. Because the parameter has no argument, the core pinctrl debugfs logic ignores the returned arg value.
By returning 0 with arg = 0 when the output is disabled, won't debugfs falsely report all disabled pins as having their output enabled?
Should this code still return -EINVAL when ret is 0 to avoid breaking debugfs output?
Quoted 2 lines
drivers/pinctrl/meson/pinctrl-meson.c +0
-0break ;case PIN_CONFIG_LEVEL :
Signature · 6 lines
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1 _______________________________________________ linux-amlogic mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-amlogic
Linus Walleij
maintainerQuoted 9 lines · On Wed, Aug 12, 2026 at 12:22 PM Xianwei Zhao via B4 Relay…
From: Xianwei Zhao <[email protected]>
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_ENABLEinstead of always reporting it as enabled.Signed-off-by Xianwei Zhao <[email protected]>
Applied this patch as well.
Yours,
Linus Walleij