Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6c3cf81 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela
Browse files

[ALSA] ac97 - Suppress the reset of audio-codec from modem-codec at resume



On codec chips with both audio and modem functions (e.g. Conexant one),
performing AC97_RESET resets the whole registers.  When both audio and
modem drivers are resumed at the same time, the modem one often is
resumed after the audio, and it results in the reset of audio registers
(ALSA bug#3333).
This patch fixes such a problem.  Since the modem codec basically
doesn't need AC97_RESET, skip this initialization unless specified
as audio.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent 776e184e
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -2496,7 +2496,10 @@ void snd_ac97_resume(struct snd_ac97 *ac97)


	snd_ac97_write(ac97, AC97_POWERDOWN, 0);
	snd_ac97_write(ac97, AC97_POWERDOWN, 0);
	if (! (ac97->flags & AC97_DEFAULT_POWER_OFF)) {
	if (! (ac97->flags & AC97_DEFAULT_POWER_OFF)) {
		if (!(ac97->scaps & AC97_SCAP_SKIP_AUDIO))
			snd_ac97_write(ac97, AC97_RESET, 0);
			snd_ac97_write(ac97, AC97_RESET, 0);
		else if (!(ac97->scaps & AC97_SCAP_SKIP_MODEM))
			snd_ac97_write(ac97, AC97_EXTENDED_MID, 0);
		udelay(100);
		udelay(100);
		snd_ac97_write(ac97, AC97_POWERDOWN, 0);
		snd_ac97_write(ac97, AC97_POWERDOWN, 0);
	}
	}