Re: [PATCH v6 2/6] mux: gpio: add optional regulator support
From: Johan Hovold
Date: Wed Apr 02 2025 - 04:05:26 EST
On Thu, Mar 27, 2025 at 10:06:29AM +0000, Srinivas Kandagatla wrote:
> From: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx>
>
> Some of the external muxes needs powering up using a regulator.
> This is the case with Lenovo T14s laptop which has a external audio mux
> to handle US/EURO headsets.
>
> Add support to the driver to handle this optional regulator.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx>
> Tested-by: Christopher Obbard <christopher.obbard@xxxxxxxxxx>
> @@ -82,6 +83,10 @@ static int mux_gpio_probe(struct platform_device *pdev)
> mux_chip->mux->idle_state = idle_state;
> }
>
> + ret = devm_regulator_get_enable_optional(dev, "mux");
> + if (ret && ret != -ENODEV)
> + return dev_err_probe(dev, ret, "Couldn't retrieve/enable gpio mux supply\n");
nit: "failed to get/enable mux supply" may be more consistent with the
other (non-capitalised error) messages and avoids repeating "gpio mux"
which will be added by driver core.
> +
> ret = devm_mux_chip_register(dev, mux_chip);
> if (ret < 0)
> return ret;
Either way:
Reviewed-by: Johan Hovold <johan+linaro@xxxxxxxxxx>
Tested-by: Johan Hovold <johan+linaro@xxxxxxxxxx>