[PATCH v2 3/6] pinctrl: add optional .release_mux() callback

Frank Li Frank.li at nxp.com
Fri Feb 27 07:32:30 PST 2026


On Fri, Feb 27, 2026 at 10:07:05AM +0100, Linus Walleij wrote:
> On Thu, Feb 26, 2026 at 12:55 AM Frank Li <Frank.Li at nxp.com> wrote:
>
> > Add an optional .release_mux() callback to the pinmux_ops.
> >
> > Some devices require releasing resources that were previously acquired in
> > .set_mux(). Providing a dedicated .release_mux() callback allows drivers to
> > properly clean up hardware state or associated resources when a mux
> > function is no longer active.
> >
> > The callback is optional and does not affect existing drivers.
> >
> > Signed-off-by: Frank Li <Frank.Li at nxp.com>
>
> Can you explain why you need this custom code for this?
>
> Nominally pin control defines and puts the hardware into a
> number of states such as:
> "default"
> "idle"
> "sleep"
> "init"
>
> Usually (at least for silicon) what .release_mux() would to
> is semantically equivalent to a transition into the "init" or
> "sleep" state. And if these are not descriptive enough you can
> even define a "released" state.
>
> Is it not possible to reach the set-up of the hardware that you
> are desiring by just defining such a relaxed state?

I am not familiar with pinctrl code. I just need a place to call a callback
which do opposite work at .set_mux() function.

I see pair function pinmux_enable_setting() call .set_mux() and
 pinmux_disable_setting() just missing do oppsite work of .set_mux();

I may think too simple. I just do insmod/rmmod test. Any suggestion where
is good place to put it?

Does it call pair pinmux_enable(disable)_setting when switch state?

Frank

>
> Yours,
> Linus Walleij



More information about the linux-arm-kernel mailing list