Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 120383
b: refs/heads/master
c: b035ce0
h: refs/heads/master
i:
  120381: fd4db46
  120379: a4fd2b4
  120375: 264023d
  120367: e5e3dab
  120351: 6d61efe
  120319: e3a4434
v: v3
  • Loading branch information
Jaya Kumar authored and Takashi Iwai committed Dec 10, 2008
1 parent bf96c9c commit e33a536
Show file tree
Hide file tree
Showing 4 changed files with 16 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: 0bed7b292d68f82316bfb8cd521e16c867689efe
refs/heads/master: b035ce0f26812292d067fbe2fc9e9d88d5dfcdb4
3 changes: 2 additions & 1 deletion trunk/sound/pci/cs5535audio/cs5535audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ static int __devinit snd_cs5535audio_mixer(struct cs5535audio *cs5535au)
return err;

memset(&ac97, 0, sizeof(ac97));
ac97.scaps = AC97_SCAP_AUDIO|AC97_SCAP_SKIP_MODEM;
ac97.scaps = AC97_SCAP_AUDIO | AC97_SCAP_SKIP_MODEM
| AC97_SCAP_POWER_SAVE;
ac97.private_data = cs5535au;
ac97.pci = cs5535au->pci;

Expand Down
1 change: 1 addition & 0 deletions trunk/sound/pci/cs5535audio/cs5535audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ struct cs5535audio_dma {
unsigned int buf_addr, buf_bytes;
unsigned int period_bytes, periods;
u32 saved_prd;
int pcm_open_flag;
};

struct cs5535audio {
Expand Down
12 changes: 12 additions & 0 deletions trunk/sound/pci/cs5535audio/cs5535audio_pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ static int snd_cs5535audio_hw_params(struct snd_pcm_substream *substream,
err = cs5535audio_build_dma_packets(cs5535au, dma, substream,
params_periods(hw_params),
params_period_bytes(hw_params));
if (!err)
dma->pcm_open_flag = 1;

return err;
}

Expand All @@ -268,6 +271,15 @@ static int snd_cs5535audio_hw_free(struct snd_pcm_substream *substream)
struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream);
struct cs5535audio_dma *dma = substream->runtime->private_data;

if (dma->pcm_open_flag) {
if (substream == cs5535au->playback_substream)
snd_ac97_update_power(cs5535au->ac97,
AC97_PCM_FRONT_DAC_RATE, 0);
else
snd_ac97_update_power(cs5535au->ac97,
AC97_PCM_LR_ADC_RATE, 0);
dma->pcm_open_flag = 0;
}
cs5535audio_clear_dma_packets(cs5535au, dma, substream);
return snd_pcm_lib_free_pages(substream);
}
Expand Down

0 comments on commit e33a536

Please sign in to comment.