From 2c07dbff32d8e2f19c69225c47cae737689a71ec Mon Sep 17 00:00:00 2001 From: Shuai Li Date: Fri, 11 Jan 2019 12:53:44 +0800 Subject: [PATCH] audio: fix no audio after resume of ad82584f [1/1] PD#SWPL-4090 Problem: No audio after suspend and resume. Suspend won't save the mute value, and after resume, it could not be restored. Solution: Add a mute val to save when suspend, and after resume, restore the mute value. Verify: Verified by QA. Change-Id: Ie24bb11f5c565048391846a66b5d12bab1d55666 Signed-off-by: Shuai Li --- sound/soc/codecs/amlogic/ad82584f.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/codecs/amlogic/ad82584f.c b/sound/soc/codecs/amlogic/ad82584f.c index 8ad27a8ae816..88fea3497960 100644 --- a/sound/soc/codecs/amlogic/ad82584f.c +++ b/sound/soc/codecs/amlogic/ad82584f.c @@ -598,6 +598,7 @@ struct ad82584f_priv { unsigned char Ch1_vol; unsigned char Ch2_vol; unsigned char master_vol; + unsigned char mute_val; #ifdef CONFIG_HAS_EARLYSUSPEND struct early_suspend early_suspend; @@ -860,6 +861,7 @@ static int ad82584f_suspend(struct snd_soc_codec *codec) ad82584f->Ch1_vol = snd_soc_read(codec, C1VOL); ad82584f->Ch2_vol = snd_soc_read(codec, C2VOL); ad82584f->master_vol = snd_soc_read(codec, MVOL); + ad82584f->mute_val = snd_soc_read(codec, MUTE); ad82584f_set_bias_level(codec, SND_SOC_BIAS_OFF); @@ -877,6 +879,7 @@ static int ad82584f_resume(struct snd_soc_codec *codec) snd_soc_write(codec, C1VOL, ad82584f->Ch1_vol); snd_soc_write(codec, C2VOL, ad82584f->Ch2_vol); snd_soc_write(codec, MVOL, ad82584f->master_vol); + snd_soc_write(codec, MUTE, ad82584f->mute_val); ad82584f_set_bias_level(codec, SND_SOC_BIAS_STANDBY);