[PATCH 1/2] ALSA: hda: tas2781: Fix missing setup at runtime PM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



tas2781_runtime_suspend() clears the playback_started flag, hence it
leads to inconsistent state after runtime suspend is triggered, as if
the device hasn't been opened yet.  Also, the counterpart,
alc2781_runtime_resume() doesn't call tasdevice_tuning_switch(), and
this also causes the inconsistency.

This patch corrects the superfluous flag clearance and the missing
call.

Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver")
Link: https://bugzilla.suse.com/show_bug.cgi?id=1230132
Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
---
 sound/pci/hda/tas2781_hda_i2c.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c
index 370d847517f9..6d173b721fd0 100644
--- a/sound/pci/hda/tas2781_hda_i2c.c
+++ b/sound/pci/hda/tas2781_hda_i2c.c
@@ -864,10 +864,8 @@ static int tas2781_runtime_suspend(struct device *dev)
 	/* The driver powers up the amplifiers at module load time.
 	 * Stop the playback if it's unused.
 	 */
-	if (tas_hda->priv->playback_started) {
+	if (tas_hda->priv->playback_started)
 		tasdevice_tuning_switch(tas_hda->priv, 1);
-		tas_hda->priv->playback_started = false;
-	}
 
 	mutex_unlock(&tas_hda->priv->codec_lock);
 
@@ -889,6 +887,9 @@ static int tas2781_runtime_resume(struct device *dev)
 	 */
 	tasdevice_apply_calibration(tas_hda->priv);
 
+	if (tas_hda->priv->playback_started)
+		tasdevice_tuning_switch(tas_hda->priv, 0);
+
 	mutex_unlock(&tas_hda->priv->codec_lock);
 
 	return 0;
-- 
2.43.0





[Index of Archives]     [Pulseaudio]     [Linux Audio Users]     [ALSA Devel]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux