summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/intel/hda-mlink.c
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2022-10-27 21:35:36 +0200
committerMark Brown <broonie@kernel.org>2022-10-28 14:04:57 +0200
commitf402a974aa0ae2b9abcccf49d5ac7c093e86a073 (patch)
tree8514adbc7db2d71704afd2dbbaf83bd0fe54f267 /sound/soc/sof/intel/hda-mlink.c
parentASoC: SOF: Intel: clarify bus_init and bus_exit sequences (diff)
downloadlinux-f402a974aa0ae2b9abcccf49d5ac7c093e86a073.tar.xz
linux-f402a974aa0ae2b9abcccf49d5ac7c093e86a073.zip
ASoC: SOF: Intel: hda-mlink: add helpers to suspend/resume links
No functionality change, just move the code in hda-mlink. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20221027193540.259520-18-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/intel/hda-mlink.c')
-rw-r--r--sound/soc/sof/intel/hda-mlink.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/sound/soc/sof/intel/hda-mlink.c b/sound/soc/sof/intel/hda-mlink.c
index b5f922603187..2cdee03e4a47 100644
--- a/sound/soc/sof/intel/hda-mlink.c
+++ b/sound/soc/sof/intel/hda-mlink.c
@@ -51,4 +51,25 @@ void hda_bus_ml_reset_losidv(struct hdac_bus *bus)
writel(0, hlink->ml_addr + AZX_REG_ML_LOSIDV);
}
+int hda_bus_ml_resume(struct hdac_bus *bus)
+{
+ struct hdac_ext_link *hlink;
+ int ret;
+
+ /* power up links that were active before suspend */
+ list_for_each_entry(hlink, &bus->hlink_list, list) {
+ if (hlink->ref_count) {
+ ret = snd_hdac_ext_bus_link_power_up(hlink);
+ if (ret < 0)
+ return ret;
+ }
+ }
+ return 0;
+}
+
+int hda_bus_ml_suspend(struct hdac_bus *bus)
+{
+ return snd_hdac_ext_bus_link_power_down_all(bus);
+}
+
#endif