[PATCH v3 4/7] pinctrl: add optional .release_mux() callback

Linus Walleij linusw at kernel.org
Mon Mar 16 02:39:12 PDT 2026


On Wed, Mar 11, 2026 at 8:08 PM Frank Li <Frank.Li at nxp.com> wrote:

> Add an optional .release_mux() callback to struct pinmux_ops.
>
> Some drivers acquire additional resources in .set_mux(), such as software
> locks. These resources may need to be released when the mux function is no
> longer active. Introducing a dedicated .release_mux() callback allows
> drivers to clean up such resources.
>
> The callback is optional and does not affect existing drivers.
>
> Commit 2243a87d90b42 ("pinctrl: avoid duplicated calling
> enable_pinmux_setting for a pin") removed the .disable() callback
> to resolve two issues:
>
>   1. desc->mux_usecount increasing monotonically
>   2. Hardware glitches caused by repeated .disable()/.enable() calls
>
> Adding .release_mux() does not reintroduce those problems. The callback is
> intended only for releasing driver-side resources (e.g. locks) and must not
> modify hardware registers.
>
> Signed-off-by: Frank Li <Frank.Li at nxp.com>

OK fair enough, I think I'm convinced about this now, also it has
a nice pairing with set_mux(). Let's see if someone else has comments,
I might apply v4 after fixing the generic function issue in patch 2.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list