[alsa-devel] [PATCH 5/5] ALSA: hda - Make device D3 during runtime suspend

Takashi Iwai tiwai at suse.de
Tue Nov 26 09:29:13 CET 2013


We can make the device D3 for saving more power during the runtime
suspend.  Meanwhile, I observed that Haswell HDMI codecs gets
corrupted ELD bytes when woken up from runtime suspend with D3.
As a quick workaround, exclude these chips from D3.

Signed-off-by: Takashi Iwai <tiwai at suse.de>
---
 sound/pci/hda/hda_intel.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index b001aa6da3bc..c0b2c9079607 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2997,6 +2997,13 @@ static int azx_runtime_suspend(struct device *dev)
 	if (!chip->bus->avoid_link_reset)
 		azx_enter_link_reset(chip);
 	azx_clear_irq_pending(chip);
+
+	/* Haswell HDMI/DP shows the broken ELD read after runtime PM */
+	if (chip->driver_type != AZX_DRIVER_HDMI) {
+		pci_save_state(chip->pci);
+		pci_set_power_state(chip->pci, PCI_D3hot);
+	}
+
 	if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)
 		hda_display_power(false);
 	return 0;
@@ -3019,6 +3026,11 @@ static int azx_runtime_resume(struct device *dev)
 	if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)
 		hda_display_power(true);
 
+	if (chip->driver_type != AZX_DRIVER_HDMI) {
+		pci_set_power_state(chip->pci, PCI_D0);
+		pci_restore_state(chip->pci);
+	}
+
 	/* Read STATESTS before controller reset */
 	status = azx_readw(chip, STATESTS);
 
-- 
1.8.4.3



More information about the Alsa-devel mailing list