diff mbox series

[03/15] ASoC: cs42l42: Remove power if the driver is being removed

Message ID 20210302170454.39679-4-tanureal@opensource.cirrus.com (mailing list archive)
State Superseded
Headers show
Series Report jack and button detection + Capture Support | expand

Commit Message

Lucas Tanure March 2, 2021, 5:04 p.m. UTC
Ensure the power supplies are turned off when removing the driver

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
---
 sound/soc/codecs/cs42l42.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Mark Brown March 2, 2021, 5:12 p.m. UTC | #1
On Tue, Mar 02, 2021 at 05:04:42PM +0000, Lucas Tanure wrote:

>  	/* Hold down reset */
>  	gpiod_set_value_cansleep(cs42l42->reset_gpio, 0);
>  
> +	regulator_bulk_disable(ARRAY_SIZE(cs42l42->supplies), cs42l42->supplies);

Are you sure the device is always runtime resumed on remove?
diff mbox series

Patch

diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c
index 2a25a30f842b1..00e303c711ddc 100644
--- a/sound/soc/codecs/cs42l42.c
+++ b/sound/soc/codecs/cs42l42.c
@@ -1852,6 +1852,8 @@  static int cs42l42_i2c_remove(struct i2c_client *i2c_client)
 	/* Hold down reset */
 	gpiod_set_value_cansleep(cs42l42->reset_gpio, 0);
 
+	regulator_bulk_disable(ARRAY_SIZE(cs42l42->supplies), cs42l42->supplies);
+
 	return 0;
 }