Skip to contentSkip to conversation

ASoC: Intel: Power down links before turning off display audio power

PATCH Superseded Pierre-Louis Bossart 1 participant 2 messages Nov 9, 2018

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: Intel: Power down links before turning off display audio power

On certain platforms, Display HDMI HDA codec was not going to sleep state after the use when links are powered down after turning off the display power. As per the HW recommendation, links are powered down before turning off the display power to ensure that the codec goes to sleep state.

This patch was updated from an earlier version submitted upstream [1] which conflicted with the changes merged for HDaudio codec support with the Intel DSP.

[1] https://patchwork.kernel.org/patch/10540213/

---
 sound/soc/codecs/hdac_hdmi.c  | 13 +++++++------
 sound/soc/intel/skylake/skl.c | 12 ++++++------
 2 files changed, 13 insertions(+), 12 deletions(-)
sound/soc/codecs/hdac_hdmi.c +7 -6
index 4e9854889a95..e0fe682cea04 100644
@@ -2187,11 +2187,6 @@ static int hdac_hdmi_runtime_suspend(struct device *dev)
 	 */
 	snd_hdac_codec_read(hdev, hdev->afg, 0,	AC_VERB_SET_POWER_STATE,
 							AC_PWRST_D3);
-	err = snd_hdac_display_power(bus, false);
-	if (err < 0) {
-		dev_err(dev, "Cannot turn on display power on i915\n");
-		return err;
-	}
 
 	hlink = snd_hdac_ext_bus_get_link(bus, dev_name(dev));
 	if (!hlink) {
@@ -2201,7 +2196,13 @@ static int hdac_hdmi_runtime_suspend(struct device *dev)
 
 	snd_hdac_ext_bus_link_put(bus, hlink);
 
-	return 0;
+	err = snd_hdac_display_power(bus, false);
+	if (err < 0) {
+		dev_err(dev, "Cannot turn off display power on i915\n");
+		return err;
+	}
+
+	return err;
 }
 
 static int hdac_hdmi_runtime_resume(struct device *dev)
sound/soc/intel/skylake/skl.c +6 -6
index 29225623b4b4..1586c97d9450 100644
@@ -815,6 +815,12 @@ static void skl_probe_work(struct work_struct *work)
 		}
 	}
 
+	/*
+	 * we are done probing so decrement link counts
+	 */
+	list_for_each_entry(hlink, &bus->hlink_list, list)
+		snd_hdac_ext_bus_link_put(bus, hlink);
+
 	if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)) {
 		err = snd_hdac_display_power(bus, false);
 		if (err < 0) {
@@ -824,12 +830,6 @@ static void skl_probe_work(struct work_struct *work)
 		}
 	}
 
-	/*
-	 * we are done probing so decrement link counts
-	 */
-	list_for_each_entry(hlink, &bus->hlink_list, list)
-		snd_hdac_ext_bus_link_put(bus, hlink);
-
 	/* configure PM */
 	pm_runtime_put_noidle(bus->dev);
 	pm_runtime_allow(bus->dev);
Signature · 1 line
2.17.1
#1 lore raw

sound/soc/codecs/hdac_hdmi.c static int hdac_hdmi_runtime_suspend(struct device *dev) · line 2205

Quoted 10 lines
sound/soc/codecs/hdac_hdmi.c +7 -1
-	return 0;
+	err = snd_hdac_display_power(bus, false);
+	if (err < 0) {
+		dev_err(dev, "Cannot turn off display power on i915\n");
+		return err;
+	}
+
+	return err;

oops, no need for these two returns. this was a bad copy/paste that wasn't detected in the reviews.

please ignore this one, will send a v2 shortly.