aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/soc-core.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 2bdf9a4ac2b4..c612900c80ff 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -637,7 +637,7 @@ int snd_soc_suspend(struct device *dev)
637 list_for_each_entry(codec, &card->codec_dev_list, card_list) { 637 list_for_each_entry(codec, &card->codec_dev_list, card_list) {
638 /* If there are paths active then the CODEC will be held with 638 /* If there are paths active then the CODEC will be held with
639 * bias _ON and should not be suspended. */ 639 * bias _ON and should not be suspended. */
640 if (!codec->suspended && codec->driver->suspend) { 640 if (!codec->suspended) {
641 switch (codec->dapm.bias_level) { 641 switch (codec->dapm.bias_level) {
642 case SND_SOC_BIAS_STANDBY: 642 case SND_SOC_BIAS_STANDBY:
643 /* 643 /*
@@ -651,8 +651,10 @@ int snd_soc_suspend(struct device *dev)
651 "ASoC: idle_bias_off CODEC on over suspend\n"); 651 "ASoC: idle_bias_off CODEC on over suspend\n");
652 break; 652 break;
653 } 653 }
654
654 case SND_SOC_BIAS_OFF: 655 case SND_SOC_BIAS_OFF:
655 codec->driver->suspend(codec); 656 if (codec->driver->suspend)
657 codec->driver->suspend(codec);
656 codec->suspended = 1; 658 codec->suspended = 1;
657 codec->cache_sync = 1; 659 codec->cache_sync = 1;
658 if (codec->component.regmap) 660 if (codec->component.regmap)
@@ -726,11 +728,12 @@ static void soc_resume_deferred(struct work_struct *work)
726 * left with bias OFF or STANDBY and suspended so we must now 728 * left with bias OFF or STANDBY and suspended so we must now
727 * resume. Otherwise the suspend was suppressed. 729 * resume. Otherwise the suspend was suppressed.
728 */ 730 */
729 if (codec->driver->resume && codec->suspended) { 731 if (codec->suspended) {
730 switch (codec->dapm.bias_level) { 732 switch (codec->dapm.bias_level) {
731 case SND_SOC_BIAS_STANDBY: 733 case SND_SOC_BIAS_STANDBY:
732 case SND_SOC_BIAS_OFF: 734 case SND_SOC_BIAS_OFF:
733 codec->driver->resume(codec); 735 if (codec->driver->resume)
736 codec->driver->resume(codec);
734 codec->suspended = 0; 737 codec->suspended = 0;
735 break; 738 break;
736 default: 739 default: