Re: [PATCH v15 6/6] mux: add NXP MC33978/MC34978 AMUX driver
From: Alvin Šipraga
Date: Fri Jul 10 2026 - 08:59:22 EST
On Fri, Jul 10, 2026 at 12:13:55PM +0200, Oleksij Rempel wrote:
> Add a mux-control driver for the 24-to-1 analog multiplexer (AMUX)
> embedded in the NXP MC33978/MC34978 Multiple Switch Detection
> Interface (MSDI) devices.
>
> Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
Reviewed-by: Alvin Šipraga <alvin.sipraga@xxxxxxxxxx>
One small comment below.
[...]
> +static int mc33978_mux_set(struct mux_control *mux, int state)
> +{
> + struct mux_chip *mux_chip = mux->chip;
> + struct mc33978_mux_priv *priv = mux_chip_priv(mux_chip);
> + int ret;
> +
> + if (state < 0 || state >= MC33978_NUM_AMUX_CH)
> + return -EINVAL;
> +
> + ret = regmap_update_bits(priv->map, MC33978_REG_AMUX_CTRL,
> + MC33978_AMUX_CTRL_MASK, state);
> + if (ret)
> + dev_err(priv->dev, "failed to set AMUX channel %d: %d\n",
> + state, ret);
Especially for iio, I can imagine a consumer might keep polling even if
the mux .set returns an error. So maybe ratelimit this print?
> +
> + return ret;
> +}
> +
> +static const struct mux_control_ops mc33978_mux_ops = {
> + .set = mc33978_mux_set,
> +};