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

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

[ALSA] Fix AC97 power-saving mode



Fix the bug in AC97 power-saving mode that the power isn't turned on
when power_save is set to 1 via sysfs during the power off state.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent dbedca39
Loading
Loading
Loading
Loading
+2 −6
Original line number Original line Diff line number Diff line
@@ -570,7 +570,6 @@ int snd_ac97_put_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value
			ac97->power_up &= ~(1 << (reg>>1));
			ac97->power_up &= ~(1 << (reg>>1));
		else
		else
			ac97->power_up |= 1 << (reg>>1);
			ac97->power_up |= 1 << (reg>>1);
		if (power_save)
		update_power_regs(ac97);
		update_power_regs(ac97);
	}
	}
#endif
#endif
@@ -2337,10 +2336,7 @@ int snd_ac97_update_power(struct snd_ac97 *ac97, int reg, int powerup)
		}
		}
	}
	}


	if (! power_save)
	if (power_save && !powerup && ac97->power_workq)
		return 0;

	if (! powerup && ac97->power_workq)
		/* adjust power-down bits after two seconds delay
		/* adjust power-down bits after two seconds delay
		 * (for avoiding loud click noises for many (OSS) apps
		 * (for avoiding loud click noises for many (OSS) apps
		 *  that open/close frequently)
		 *  that open/close frequently)