Skip to content

Commit 741e917

Browse files
committed
Disable regulators for sound codec, as they prevent suspend
1 parent 4fb6095 commit 741e917

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sound/soc/sunxi/sunxi_codec.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2040,13 +2040,15 @@ static int codec_suspend(struct snd_soc_codec *codec)
20402040
audio_gpio_iodisable(spk_gpio.gpio);
20412041
}
20422042

2043+
#ifdef SUSPEND_REGULATORS
20432044
if (sunxi_internal_codec->vol_supply.cpvdd){
20442045
regulator_disable(sunxi_internal_codec->vol_supply.cpvdd);
20452046
}
20462047

20472048
if (sunxi_internal_codec->vol_supply.avcc) {
20482049
regulator_disable(sunxi_internal_codec->vol_supply.avcc);
20492050
}
2051+
#endif
20502052

20512053
pr_debug("[audio codec]:suspend end..\n");
20522054

@@ -2059,6 +2061,8 @@ static int codec_resume(struct snd_soc_codec *codec)
20592061
struct sunxi_codec *sunxi_internal_codec = snd_soc_codec_get_drvdata(codec);
20602062

20612063
pr_debug("[audio codec]:resume start\n");
2064+
2065+
#ifdef SUSPEND_REGULATORS
20622066
if (sunxi_internal_codec->vol_supply.cpvdd){
20632067
ret = regulator_enable(sunxi_internal_codec->vol_supply.cpvdd);
20642068
if (ret) {
@@ -2072,6 +2076,7 @@ static int codec_resume(struct snd_soc_codec *codec)
20722076
pr_err("[%s]: avcc:regulator_enable() failed!\n",__func__);
20732077
}
20742078
}
2079+
#endif
20752080

20762081
codec_init(sunxi_internal_codec);
20772082
if (spk_gpio.cfg) {

0 commit comments

Comments
 (0)