Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 16066
b: refs/heads/master
c: 11d3824
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed Jan 3, 2006
1 parent 5f1a1cf commit 3ebfad5
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: 3fcf7d2cd8e0ebce10e4bf89da175ff9bd6aa2da
refs/heads/master: 11d3824ad7d6240d7ce44bdf1d9e81e62a903f72
5 changes: 5 additions & 0 deletions trunk/include/sound/ak4531_codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,9 @@ struct snd_ak4531 {
int snd_ak4531_mixer(struct snd_card *card, struct snd_ak4531 *_ak4531,
struct snd_ak4531 **rak4531);

#ifdef CONFIG_PM
void snd_ak4531_suspend(struct snd_ak4531 *ak4531);
void snd_ak4531_resume(struct snd_ak4531 *ak4531);
#endif

#endif /* __SOUND_AK4531_CODEC_H */
36 changes: 35 additions & 1 deletion trunk/sound/pci/ac97/ak4531_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ int snd_ak4531_mixer(struct snd_card *card, struct snd_ak4531 *_ak4531,
ak4531->write(ak4531, AK4531_RESET, 0x03); /* no RST, PD */
udelay(100);
ak4531->write(ak4531, AK4531_CLOCK, 0x00); /* CODEC ADC and CODEC DAC use {LR,B}CLK2 and run off LRCLK2 PLL */
for (idx = 0; idx < 0x19; idx++) {
for (idx = 0; idx <= 0x19; idx++) {
if (idx == AK4531_RESET || idx == AK4531_CLOCK)
continue;
ak4531->write(ak4531, idx, ak4531->regs[idx] = snd_ak4531_initial_map[idx]); /* recording source is mixer */
Expand All @@ -395,6 +395,36 @@ int snd_ak4531_mixer(struct snd_card *card, struct snd_ak4531 *_ak4531,
return 0;
}

/*
* power management
*/
#ifdef CONFIG_PM
void snd_ak4531_suspend(struct snd_ak4531 *ak4531)
{
/* mute */
ak4531->write(ak4531, AK4531_LMASTER, 0x9f);
ak4531->write(ak4531, AK4531_RMASTER, 0x9f);
/* powerdown */
ak4531->write(ak4531, AK4531_RESET, 0x01);
}

void snd_ak4531_resume(struct snd_ak4531 *ak4531)
{
int idx;

/* initialize */
ak4531->write(ak4531, AK4531_RESET, 0x03);
udelay(100);
ak4531->write(ak4531, AK4531_CLOCK, 0x00);
/* restore mixer registers */
for (idx = 0; idx <= 0x19; idx++) {
if (idx == AK4531_RESET || idx == AK4531_CLOCK)
continue;
ak4531->write(ak4531, idx, ak4531->regs[idx]);
}
}
#endif

/*
*/
Expand All @@ -420,6 +450,10 @@ static void snd_ak4531_proc_init(struct snd_card *card, struct snd_ak4531 *ak453
}

EXPORT_SYMBOL(snd_ak4531_mixer);
#ifdef CONFIG_PM
EXPORT_SYMBOL(snd_ak4531_suspend);
EXPORT_SYMBOL(snd_ak4531_resume);
#endif

/*
* INIT part
Expand Down

0 comments on commit 3ebfad5

Please sign in to comment.