Skip to content

Commit d4d1af0

Browse files
committed
ASoC: SOF: Intel: implement runtime idle for CNL
Implement runtime idle for CNL devices using similar runtime PM idle logic as the Intel AZX HDA driver. If any HDA codecs are powered when runtime suspend request comes, return -EBUSY. By doing this, strict ordering is enforced between HDA codec and the HDA controller. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
1 parent 828d1ba commit d4d1af0

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

sound/soc/sof/intel/cnl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ const struct snd_sof_dsp_ops sof_cnl_ops = {
249249
.resume = hda_dsp_resume,
250250
.runtime_suspend = hda_dsp_runtime_suspend,
251251
.runtime_resume = hda_dsp_runtime_resume,
252+
.runtime_idle = hda_dsp_runtime_idle,
252253
.set_hw_params_upon_resume = hda_dsp_set_hw_params_upon_resume,
253254
};
254255
EXPORT_SYMBOL(sof_cnl_ops);

sound/soc/sof/intel/hda-dsp.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,19 @@ int hda_dsp_runtime_resume(struct snd_sof_dev *sdev)
433433
return hda_resume(sdev);
434434
}
435435

436+
int hda_dsp_runtime_idle(struct snd_sof_dev *sdev)
437+
{
438+
struct hdac_bus *hbus = sof_to_bus(sdev);
439+
440+
if (hbus->codec_powered) {
441+
dev_dbg(sdev->dev, "some codecs still powered (%08X), not idle\n",
442+
(unsigned int)hbus->codec_powered);
443+
return -EBUSY;
444+
}
445+
446+
return 0;
447+
}
448+
436449
int hda_dsp_runtime_suspend(struct snd_sof_dev *sdev, int state)
437450
{
438451
/* stop hda controller and power dsp off */

0 commit comments

Comments
 (0)