Re: [PATCH v2 2/2] ASoC: codecs: wsa883x: Handle shared reset GPIO for WSA883x speakers
From: Krzysztof Kozlowski
Date: Mon Jul 21 2025 - 04:23:35 EST
On Fri, Jul 18, 2025 at 04:16:28PM +0530, Mohammad Rafi Shaik wrote:
> On some Qualcomm platforms such as QCS6490-RB3Gen2, the multiple
> WSA8830/WSA8835 speakers share a common reset (shutdown) GPIO.
> To handle such cases, use the reset controller framework along
> with the "reset-gpio" driver.
>
> Register devm action to safely disable the regulator on device removal
> to prevents a potential release warning from _regulator_put().
It is not possible to remove the device - suppress bind attrs. How did
you trigger that?
>
> Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@xxxxxxxxxxxxxxxx>
> ---
> sound/soc/codecs/wsa883x.c | 93 +++++++++++++++++++++++++++++---------
> 1 file changed, 71 insertions(+), 22 deletions(-)
...
> static int wsa883x_probe(struct sdw_slave *pdev,
> const struct sdw_device_id *id)
> {
> @@ -1566,13 +1615,18 @@ static int wsa883x_probe(struct sdw_slave *pdev,
> if (ret)
> return dev_err_probe(dev, ret, "Failed to enable vdd regulator\n");
>
> - wsa883x->sd_n = devm_gpiod_get_optional(dev, "powerdown",
> - GPIOD_FLAGS_BIT_NONEXCLUSIVE | GPIOD_OUT_HIGH);
> - if (IS_ERR(wsa883x->sd_n)) {
> - ret = dev_err_probe(dev, PTR_ERR(wsa883x->sd_n),
> - "Shutdown Control GPIO not found\n");
> - goto err;
> - }
> + ret = wsa883x_get_reset(dev, wsa883x);
> + if (ret)
> + return ret;
> +
> + /*
> + * Register devm action to safely disable the regulator on device removal.
> + * This prevents a potential release warning from _regulator_put().
> + */
> + ret = devm_add_action_or_reset(dev, wsa883x_regulator_disable,
> + wsa883x);
If removal is possible (but then explain in commit msg how), then this
should be separate commit with fixes and cc-stable, because you are
fixing actual bug - lack of regulator release on unbind.
Best regards,
Krzysztof