]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ASoC: SOF: Intel: hda-mlink: special-case HDaudio regular links
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tue, 4 Apr 2023 10:41:16 +0000 (13:41 +0300)
committerMark Brown <broonie@kernel.org>
Thu, 6 Apr 2023 15:45:39 +0000 (16:45 +0100)
For backwards compatibility, HDaudio/iDISP links are powered-on when
exiting reset, and the existing driver forces them to be powered-off
when entering S0ix. In addition, the get/put helpers are invoked
directly by the ASoC codec drivers, which a historical layering
violation.

Extended links are powered-on by software only, during the probe and
DAI startup phases. This calls for a different handling of the
'regular' and 'extended' audio links.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230404104127.5629-8-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/intel/hda-mlink.c

index e6b20182f0991480ac9fad26f8c26cca0bc5fe35..8a66c0a67589222d31c1b4d3ce4c0d015e909430 100644 (file)
@@ -255,8 +255,12 @@ void hda_bus_ml_put_all(struct hdac_bus *bus)
 {
        struct hdac_ext_link *hlink;
 
-       list_for_each_entry(hlink, &bus->hlink_list, list)
-               snd_hdac_ext_bus_link_put(bus, hlink);
+       list_for_each_entry(hlink, &bus->hlink_list, list) {
+               struct hdac_ext2_link *h2link = hdac_ext_link_to_ext2(hlink);
+
+               if (!h2link->alt)
+                       snd_hdac_ext_bus_link_put(bus, hlink);
+       }
 }
 EXPORT_SYMBOL_NS(hda_bus_ml_put_all, SND_SOC_SOF_HDA_MLINK);
 
@@ -277,7 +281,9 @@ int hda_bus_ml_resume(struct hdac_bus *bus)
 
        /* power up links that were active before suspend */
        list_for_each_entry(hlink, &bus->hlink_list, list) {
-               if (hlink->ref_count) {
+               struct hdac_ext2_link *h2link = hdac_ext_link_to_ext2(hlink);
+
+               if (!h2link->alt && hlink->ref_count) {
                        ret = snd_hdac_ext_bus_link_power_up(hlink);
                        if (ret < 0)
                                return ret;
@@ -289,7 +295,19 @@ EXPORT_SYMBOL_NS(hda_bus_ml_resume, SND_SOC_SOF_HDA_MLINK);
 
 int hda_bus_ml_suspend(struct hdac_bus *bus)
 {
-       return snd_hdac_ext_bus_link_power_down_all(bus);
+       struct hdac_ext_link *hlink;
+       int ret;
+
+       list_for_each_entry(hlink, &bus->hlink_list, list) {
+               struct hdac_ext2_link *h2link = hdac_ext_link_to_ext2(hlink);
+
+               if (!h2link->alt) {
+                       ret = snd_hdac_ext_bus_link_power_down(hlink);
+                       if (ret < 0)
+                               return ret;
+               }
+       }
+       return 0;
 }
 EXPORT_SYMBOL_NS(hda_bus_ml_suspend, SND_SOC_SOF_HDA_MLINK);