Re: [PATCH v2 4/6] pinctrl: add generic board-level pinctrl driver using mux framework

From: Linus Walleij

Date: Sun Mar 08 2026 - 19:49:37 EST


On Thu, Mar 5, 2026 at 6:38 PM Frank Li <Frank.li@xxxxxxx> wrote:

> init state is before probe if exist, which not fit this case because:
> - on board mux need be enabled before probe, some device need communicate
> with periphal at probe, such as SD card. SD data/cmd line must be ready
> to scan SD, similar case for all mtd devices.
>
> if add new state "release", when the pinctrl may switch between default,
> sleep, ... , "release" have to switch between switch state, such as default
> -> sleep have to change to default->release->sleep.
>
> mux device also have idle state, which map to pinctrl's "init" or "sleep"
> state.
>
> The key difference should be
> - pinctrl can uncondtional switch state.
> - mux frame have to use pair mux_control_(de)select() to switch state.
>
> So, I think just need a hook in pinctrl system to call mux_control_deselect()
> when switch state and release resource.

The problem is that this becomes essentially a revert of:
commit 2243a87d90b42eb38bc281957df3e57c712b5e56
"pinctrl: avoid duplicated calling enable_pinmux_setting for a pin"
from 2014.

.set_mux() used to be called .enable() and when .disable() was
deleted in this commit, only .enable() remained and that was later
renamed to .set_mux().

By essentially adding back the .disable() callback under a new
name, you risk to re-introduce the problem solved by this
committ.

So you need to analyse that committ log a bit, reference it
and explain why you are *not* re-introducing this problem by
adding back the callback.

Yours,
Linus Walleij