Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions sound/soc/sof/intel/hda-dsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,8 @@ int hda_dsp_resume(struct snd_sof_dev *sdev)
int ret;

/* turn display power on */
if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)) {
if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI) &&
sdev->display_audio) {
ret = snd_hdac_display_power(bus, true);
if (ret < 0) {
dev_err(bus->dev, "Cannot turn on display power on i915 after resume\n");
Expand Down Expand Up @@ -416,7 +417,8 @@ int hda_dsp_suspend(struct snd_sof_dev *sdev, int state)
}

/* turn display power off */
if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)) {
if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI) &&
sdev->display_audio) {
ret = snd_hdac_display_power(bus, false);
if (ret < 0) {
dev_err(bus->dev, "Cannot turn OFF display power on i915 during suspend\n");
Expand Down
14 changes: 11 additions & 3 deletions sound/soc/sof/intel/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,15 +451,22 @@ static int hda_init_caps(struct snd_sof_dev *sdev)
if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)) {
ret = hda_codec_i915_init(sdev);
if (ret < 0) {
sdev->display_audio = 0;
dev_err(&pci->dev, "no HDMI audio devices found\n");
return ret;
} else {
sdev->display_audio = 1;
}
}

ret = hda_dsp_ctrl_init_chip(sdev, true);
if (ret < 0) {
dev_err(bus->dev, "Init chip failed with ret: %d\n", ret);
if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI))
/*
* If display_audio is false, we should not turn off display
* power here as it is never turned on by audio driver.
*/
if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI) &&
sdev->display_audio)
snd_hdac_display_power(bus, false);
return ret;
}
Expand All @@ -476,7 +483,8 @@ static int hda_init_caps(struct snd_sof_dev *sdev)
/* create codec instances */
hda_codec_probe_bus(sdev);

if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)) {
if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI) &&
sdev->display_audio) {
ret = snd_hdac_display_power(bus, false);
if (ret < 0) {
dev_err(bus->dev, "Cannot turn off display power on i915\n");
Expand Down
3 changes: 3 additions & 0 deletions sound/soc/sof/sof-priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,9 @@ struct snd_sof_dev {
u32 restore_kcontrols; /* restore kcontrols upon resume */
u32 first_boot;

/* display audio */
int display_audio; /* HDMI/DP audio is used or not */

void *private; /* core does not touch this */
};

Expand Down