From: Maud Spierings <maud_spierings@hotmail.com>
To: srinivas.kandagatla@linaro.org
Cc: andersson@kernel.org, broonie@kernel.org, conor+dt@kernel.org,
devicetree@vger.kernel.org, dmitry.baryshkov@oss.qualcomm.com,
ivprusov@salutedevices.com, johan+linaro@kernel.org,
konradybcio@kernel.org, krzk+dt@kernel.org, lgirdwood@gmail.com,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-sound@vger.kernel.org, luca.ceresoli@bootlin.com,
paulha@opensource.cirrus.com, peda@axentia.se, perex@perex.cz,
robh@kernel.org, tiwai@suse.com, zhoubinbin@loongson.cn
Subject: Re: [PATCH v2 2/5] mux: gpio: add optional regulator support
Date: Thu, 20 Mar 2025 13:16:12 +0100 [thread overview]
Message-ID: <AM7P189MB1009C401F0C8B95496DB183EE3D82@AM7P189MB1009.EURP189.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20250320115633.4248-3-srinivas.kandagatla@linaro.org>
> From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>
> 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@linaro.org>
> ---
> drivers/mux/gpio.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/mux/gpio.c b/drivers/mux/gpio.c
> index cc5f2c1861d4..12cd9b5c32fb 100644
> --- a/drivers/mux/gpio.c
> +++ b/drivers/mux/gpio.c
> @@ -15,6 +15,7 @@
> #include <linux/mux/driver.h>
> #include <linux/platform_device.h>
> #include <linux/property.h>
> +#include <linux/regulator/consumer.h>
>
> struct mux_gpio {
> struct gpio_descs *gpios;
> @@ -82,6 +83,13 @@ 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) {
> + if (ret != -EPROBE_DEFER)
> + dev_err(dev, "Couldn't retrieve/enable gpio mux supply\n");
> + return ret;
> + }
This seems like a good place to use return dev_err_probe()
> +
> ret = devm_mux_chip_register(dev, mux_chip);
> if (ret < 0)
> return ret;
> --
> 2.39.5
Kind regards,
Maud
next prev parent reply other threads:[~2025-03-20 12:16 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-20 11:56 [PATCH v2 0/5] ASoC: wcd938x: enable t14s audio headset srinivas.kandagatla
2025-03-20 11:56 ` [PATCH v2 1/5] dt-bindings: mux: add optional regulator binding to gpio mux srinivas.kandagatla
2025-03-21 9:28 ` Krzysztof Kozlowski
2025-03-20 11:56 ` [PATCH v2 2/5] mux: gpio: add optional regulator support srinivas.kandagatla
2025-03-20 12:16 ` Maud Spierings [this message]
2025-03-21 9:27 ` Krzysztof Kozlowski
2025-03-20 11:56 ` [PATCH v2 3/5] ASoC: dt-bindings: wcd93xx: add bindings for audio mux controlling hp srinivas.kandagatla
2025-03-21 9:29 ` Krzysztof Kozlowski
2025-03-21 12:29 ` Srinivas Kandagatla
2025-03-21 22:00 ` Rob Herring
2025-03-20 11:56 ` [PATCH v2 4/5] ASoC: codecs: wcd938x: add mux control support for hp audio mux srinivas.kandagatla
2025-03-20 14:03 ` Dmitry Baryshkov
2025-03-21 12:35 ` Srinivas Kandagatla
2025-03-21 13:16 ` Dmitry Baryshkov
2025-03-21 13:26 ` Srinivas Kandagatla
2025-03-21 16:34 ` Dmitry Baryshkov
2025-03-21 14:14 ` Srinivas Kandagatla
2025-03-21 17:16 ` Dmitry Baryshkov
2025-03-20 15:02 ` Christopher Obbard
2025-03-20 11:56 ` [PATCH v2 5/5] arm64: dts: qcom: x1e78100-t14s: Enable audio headset support srinivas.kandagatla
2025-03-20 13:58 ` Dmitry Baryshkov
2025-03-20 14:59 ` Christopher Obbard
2025-03-21 9:30 ` Krzysztof Kozlowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AM7P189MB1009C401F0C8B95496DB183EE3D82@AM7P189MB1009.EURP189.PROD.OUTLOOK.COM \
--to=maud_spierings@hotmail.com \
--cc=andersson@kernel.org \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=ivprusov@salutedevices.com \
--cc=johan+linaro@kernel.org \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=luca.ceresoli@bootlin.com \
--cc=paulha@opensource.cirrus.com \
--cc=peda@axentia.se \
--cc=perex@perex.cz \
--cc=robh@kernel.org \
--cc=srinivas.kandagatla@linaro.org \
--cc=tiwai@suse.com \
--cc=zhoubinbin@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®