Skip to content
Merged
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
15 changes: 12 additions & 3 deletions sound/soc/sof/intel/hda-ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <linux/module.h>
#include <sound/hdaudio_ext.h>
#include <sound/hda_register.h>
#include <sound/hda_component.h>
#include "../ops.h"
#include "hda.h"

Expand Down Expand Up @@ -193,14 +194,17 @@ int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev, bool full_reset)
if (bus->chip_init)
return 0;

#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)
snd_hdac_set_codec_wakeup(bus, true);
#endif
hda_dsp_ctrl_misc_clock_gating(sdev, false);

if (full_reset) {
/* reset HDA controller */
ret = hda_dsp_ctrl_link_reset(sdev, true);
if (ret < 0) {
dev_err(sdev->dev, "error: failed to reset HDA controller\n");
return ret;
goto err;
}

usleep_range(500, 1000);
Expand All @@ -209,7 +213,7 @@ int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev, bool full_reset)
ret = hda_dsp_ctrl_link_reset(sdev, false);
if (ret < 0) {
dev_err(sdev->dev, "error: failed to exit HDA controller reset\n");
return ret;
goto err;
}

usleep_range(1000, 1200);
Expand All @@ -219,7 +223,8 @@ int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev, bool full_reset)
/* check to see if controller is ready */
if (!snd_hdac_chip_readb(bus, GCTL)) {
dev_dbg(bus->dev, "controller not ready!\n");
return -EBUSY;
ret = -EBUSY;
goto err;
Comment thread
plbossart marked this conversation as resolved.
}

/* Accept unsolicited responses */
Expand Down Expand Up @@ -285,7 +290,11 @@ int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev, bool full_reset)

bus->chip_init = true;

err:
hda_dsp_ctrl_misc_clock_gating(sdev, true);
#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)
Comment thread
kv2019i marked this conversation as resolved.
snd_hdac_set_codec_wakeup(bus, false);
#endif
Comment thread
plbossart marked this conversation as resolved.

return ret;
}
Expand Down