diff options
Diffstat (limited to 'sound/soc/soc-core.c')
| -rw-r--r-- | sound/soc/soc-core.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index bdc1d74eb7b0..4e53d87e881d 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
| @@ -662,6 +662,8 @@ int snd_soc_suspend(struct device *dev) | |||
| 662 | codec->cache_sync = 1; | 662 | codec->cache_sync = 1; |
| 663 | if (codec->using_regmap) | 663 | if (codec->using_regmap) |
| 664 | regcache_mark_dirty(codec->control_data); | 664 | regcache_mark_dirty(codec->control_data); |
| 665 | /* deactivate pins to sleep state */ | ||
| 666 | pinctrl_pm_select_sleep_state(codec->dev); | ||
| 665 | break; | 667 | break; |
| 666 | default: | 668 | default: |
| 667 | dev_dbg(codec->dev, | 669 | dev_dbg(codec->dev, |
| @@ -679,6 +681,9 @@ int snd_soc_suspend(struct device *dev) | |||
| 679 | 681 | ||
| 680 | if (cpu_dai->driver->suspend && cpu_dai->driver->ac97_control) | 682 | if (cpu_dai->driver->suspend && cpu_dai->driver->ac97_control) |
| 681 | cpu_dai->driver->suspend(cpu_dai); | 683 | cpu_dai->driver->suspend(cpu_dai); |
| 684 | |||
| 685 | /* deactivate pins to sleep state */ | ||
| 686 | pinctrl_pm_select_sleep_state(cpu_dai->dev); | ||
| 682 | } | 687 | } |
| 683 | 688 | ||
| 684 | if (card->suspend_post) | 689 | if (card->suspend_post) |
| @@ -807,6 +812,16 @@ int snd_soc_resume(struct device *dev) | |||
| 807 | if (list_empty(&card->codec_dev_list)) | 812 | if (list_empty(&card->codec_dev_list)) |
| 808 | return 0; | 813 | return 0; |
| 809 | 814 | ||
| 815 | /* activate pins from sleep state */ | ||
| 816 | for (i = 0; i < card->num_rtd; i++) { | ||
| 817 | struct snd_soc_dai *cpu_dai = card->rtd[i].cpu_dai; | ||
| 818 | struct snd_soc_dai *codec_dai = card->rtd[i].codec_dai; | ||
| 819 | if (cpu_dai->active) | ||
| 820 | pinctrl_pm_select_default_state(cpu_dai->dev); | ||
| 821 | if (codec_dai->active) | ||
| 822 | pinctrl_pm_select_default_state(codec_dai->dev); | ||
| 823 | } | ||
| 824 | |||
| 810 | /* AC97 devices might have other drivers hanging off them so | 825 | /* AC97 devices might have other drivers hanging off them so |
| 811 | * need to resume immediately. Other drivers don't have that | 826 | * need to resume immediately. Other drivers don't have that |
| 812 | * problem and may take a substantial amount of time to resume | 827 | * problem and may take a substantial amount of time to resume |
| @@ -1929,6 +1944,14 @@ int snd_soc_poweroff(struct device *dev) | |||
| 1929 | 1944 | ||
| 1930 | snd_soc_dapm_shutdown(card); | 1945 | snd_soc_dapm_shutdown(card); |
| 1931 | 1946 | ||
| 1947 | /* deactivate pins to sleep state */ | ||
| 1948 | for (i = 0; i < card->num_rtd; i++) { | ||
| 1949 | struct snd_soc_dai *cpu_dai = card->rtd[i].cpu_dai; | ||
| 1950 | struct snd_soc_dai *codec_dai = card->rtd[i].codec_dai; | ||
| 1951 | pinctrl_pm_select_sleep_state(codec_dai->dev); | ||
| 1952 | pinctrl_pm_select_sleep_state(cpu_dai->dev); | ||
| 1953 | } | ||
| 1954 | |||
| 1932 | return 0; | 1955 | return 0; |
| 1933 | } | 1956 | } |
| 1934 | EXPORT_SYMBOL_GPL(snd_soc_poweroff); | 1957 | EXPORT_SYMBOL_GPL(snd_soc_poweroff); |
| @@ -3767,6 +3790,16 @@ int snd_soc_register_card(struct snd_soc_card *card) | |||
| 3767 | if (ret != 0) | 3790 | if (ret != 0) |
| 3768 | soc_cleanup_card_debugfs(card); | 3791 | soc_cleanup_card_debugfs(card); |
| 3769 | 3792 | ||
| 3793 | /* deactivate pins to sleep state */ | ||
| 3794 | for (i = 0; i < card->num_rtd; i++) { | ||
| 3795 | struct snd_soc_dai *cpu_dai = card->rtd[i].cpu_dai; | ||
| 3796 | struct snd_soc_dai *codec_dai = card->rtd[i].codec_dai; | ||
| 3797 | if (!codec_dai->active) | ||
| 3798 | pinctrl_pm_select_sleep_state(codec_dai->dev); | ||
| 3799 | if (!cpu_dai->active) | ||
| 3800 | pinctrl_pm_select_sleep_state(cpu_dai->dev); | ||
| 3801 | } | ||
| 3802 | |||
| 3770 | return ret; | 3803 | return ret; |
| 3771 | } | 3804 | } |
| 3772 | EXPORT_SYMBOL_GPL(snd_soc_register_card); | 3805 | EXPORT_SYMBOL_GPL(snd_soc_register_card); |
