Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193459
b: refs/heads/master
c: 3efab7d
h: refs/heads/master
i:
  193457: ed4ff0a
  193455: 831b5ba
v: v3
  • Loading branch information
Mark Brown committed May 10, 2010
1 parent 322d06b commit 34aaf99
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 452a5fd679f8a6f215df71c41487ad4b2c7774db
refs/heads/master: 3efab7dcc0f4d0087f73ff975eaa2fddc02ffc69
3 changes: 3 additions & 0 deletions trunk/include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,9 @@ struct snd_soc_dai_link {
/* codec/machine specific init - e.g. add machine controls */
int (*init)(struct snd_soc_codec *codec);

/* Keep DAI active over suspend */
unsigned int ignore_suspend:1;

/* Symmetry requirements */
unsigned int symmetric_rates:1;

Expand Down
38 changes: 37 additions & 1 deletion trunk/sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -893,19 +893,31 @@ static int soc_suspend(struct device *dev)
/* mute any active DAC's */
for (i = 0; i < card->num_links; i++) {
struct snd_soc_dai *dai = card->dai_link[i].codec_dai;

if (card->dai_link[i].ignore_suspend)
continue;

if (dai->ops->digital_mute && dai->playback.active)
dai->ops->digital_mute(dai, 1);
}

/* suspend all pcms */
for (i = 0; i < card->num_links; i++)
for (i = 0; i < card->num_links; i++) {
if (card->dai_link[i].ignore_suspend)
continue;

snd_pcm_suspend_all(card->dai_link[i].pcm);
}

if (card->suspend_pre)
card->suspend_pre(pdev, PMSG_SUSPEND);

for (i = 0; i < card->num_links; i++) {
struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;

if (card->dai_link[i].ignore_suspend)
continue;

if (cpu_dai->suspend && !cpu_dai->ac97_control)
cpu_dai->suspend(cpu_dai);
if (platform->suspend)
Expand All @@ -918,6 +930,10 @@ static int soc_suspend(struct device *dev)

for (i = 0; i < codec->num_dai; i++) {
char *stream = codec->dai[i].playback.stream_name;

if (card->dai_link[i].ignore_suspend)
continue;

if (stream != NULL)
snd_soc_dapm_stream_event(codec, stream,
SND_SOC_DAPM_STREAM_SUSPEND);
Expand All @@ -943,6 +959,10 @@ static int soc_suspend(struct device *dev)

for (i = 0; i < card->num_links; i++) {
struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;

if (card->dai_link[i].ignore_suspend)
continue;

if (cpu_dai->suspend && cpu_dai->ac97_control)
cpu_dai->suspend(cpu_dai);
}
Expand Down Expand Up @@ -982,6 +1002,10 @@ static void soc_resume_deferred(struct work_struct *work)

for (i = 0; i < card->num_links; i++) {
struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;

if (card->dai_link[i].ignore_suspend)
continue;

if (cpu_dai->resume && cpu_dai->ac97_control)
cpu_dai->resume(cpu_dai);
}
Expand All @@ -1004,6 +1028,10 @@ static void soc_resume_deferred(struct work_struct *work)

for (i = 0; i < codec->num_dai; i++) {
char *stream = codec->dai[i].playback.stream_name;

if (card->dai_link[i].ignore_suspend)
continue;

if (stream != NULL)
snd_soc_dapm_stream_event(codec, stream,
SND_SOC_DAPM_STREAM_RESUME);
Expand All @@ -1016,12 +1044,20 @@ static void soc_resume_deferred(struct work_struct *work)
/* unmute any active DACs */
for (i = 0; i < card->num_links; i++) {
struct snd_soc_dai *dai = card->dai_link[i].codec_dai;

if (card->dai_link[i].ignore_suspend)
continue;

if (dai->ops->digital_mute && dai->playback.active)
dai->ops->digital_mute(dai, 0);
}

for (i = 0; i < card->num_links; i++) {
struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;

if (card->dai_link[i].ignore_suspend)
continue;

if (cpu_dai->resume && !cpu_dai->ac97_control)
cpu_dai->resume(cpu_dai);
if (platform->resume)
Expand Down

0 comments on commit 34aaf99

Please sign in to comment.