alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [alsa-devel] [PATCH] ASoC: wm5100: add missed regulator_bulk_disable
@ 2019-12-06  7:53 Chuhong Yuan
  2019-12-06 10:34 ` Charles Keepax
  0 siblings, 1 reply; 2+ messages in thread
From: Chuhong Yuan @ 2019-12-06  7:53 UTC (permalink / raw)
  Cc: alsa-devel, patches, Chuhong Yuan, Takashi Iwai, Liam Girdwood,
	Mark Brown, linux-kernel

The driver forgets to call regulator_bulk_disable() in remove like that
in probe failure.
Add the missed call to fix it.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
 sound/soc/codecs/wm5100.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/wm5100.c b/sound/soc/codecs/wm5100.c
index 91cc63c5a51f..d985b2061169 100644
--- a/sound/soc/codecs/wm5100.c
+++ b/sound/soc/codecs/wm5100.c
@@ -2653,6 +2653,8 @@ static int wm5100_i2c_remove(struct i2c_client *i2c)
 		gpio_set_value_cansleep(wm5100->pdata.ldo_ena, 0);
 		gpio_free(wm5100->pdata.ldo_ena);
 	}
+	regulator_bulk_disable(ARRAY_SIZE(wm5100->core_supplies),
+			       wm5100->core_supplies);
 
 	return 0;
 }
-- 
2.24.0

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [alsa-devel] [PATCH] ASoC: wm5100: add missed regulator_bulk_disable
  2019-12-06  7:53 [alsa-devel] [PATCH] ASoC: wm5100: add missed regulator_bulk_disable Chuhong Yuan
@ 2019-12-06 10:34 ` Charles Keepax
  0 siblings, 0 replies; 2+ messages in thread
From: Charles Keepax @ 2019-12-06 10:34 UTC (permalink / raw)
  To: Chuhong Yuan
  Cc: alsa-devel, patches, Takashi Iwai, Liam Girdwood, Mark Brown,
	linux-kernel

On Fri, Dec 06, 2019 at 03:53:00PM +0800, Chuhong Yuan wrote:
> The driver forgets to call regulator_bulk_disable() in remove like that
> in probe failure.
> Add the missed call to fix it.
> 
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---
>  sound/soc/codecs/wm5100.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/sound/soc/codecs/wm5100.c b/sound/soc/codecs/wm5100.c
> index 91cc63c5a51f..d985b2061169 100644
> --- a/sound/soc/codecs/wm5100.c
> +++ b/sound/soc/codecs/wm5100.c
> @@ -2653,6 +2653,8 @@ static int wm5100_i2c_remove(struct i2c_client *i2c)
>  		gpio_set_value_cansleep(wm5100->pdata.ldo_ena, 0);
>  		gpio_free(wm5100->pdata.ldo_ena);
>  	}
> +	regulator_bulk_disable(ARRAY_SIZE(wm5100->core_supplies),
> +			       wm5100->core_supplies);
>  

This is a bit trickier than this since these regulators are being
controlled by PM runtime, and it doesn't necessarily leave things
in an enabled state when it is disabled.

Thanks,
Charles
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-06 10:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-06  7:53 [alsa-devel] [PATCH] ASoC: wm5100: add missed regulator_bulk_disable Chuhong Yuan
2019-12-06 10:34 ` Charles Keepax

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).