ASoC: SOF: Intel: hda-mlink: add helper to return sublink count
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tue, 4 Apr 2023 10:41:19 +0000 (13:41 +0300)
committerMark Brown <broonie@kernel.org>
Thu, 6 Apr 2023 15:45:42 +0000 (16:45 +0100)
This is needed for SoundWire integration.

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-11-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/hda-mlink.h
sound/soc/sof/intel/hda-mlink.c

index c47008a603d048acc60af659f01800819e9bd168..d7f65cb6e17552d26fc3c45fe0273abef932631b 100644 (file)
@@ -13,6 +13,8 @@ struct hdac_bus;
 int hda_bus_ml_init(struct hdac_bus *bus);
 void hda_bus_ml_free(struct hdac_bus *bus);
 
+int hdac_bus_eml_get_count(struct hdac_bus *bus, bool alt, int elid);
+
 int hdac_bus_eml_power_up(struct hdac_bus *bus, bool alt, int elid, int sublink);
 int hdac_bus_eml_power_up_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink);
 
@@ -34,6 +36,9 @@ hda_bus_ml_init(struct hdac_bus *bus) { return 0; }
 
 static inline void hda_bus_ml_free(struct hdac_bus *bus) { }
 
+static inline int
+hdac_bus_eml_get_count(struct hdac_bus *bus, bool alt, int elid) { return 0; }
+
 static inline int
 hdac_bus_eml_power_up(struct hdac_bus *bus, bool alt, int elid, int sublink)
 {
index 5045c10bed7622ed8ea83ad5f0e043070c2bf0be..02743c342f28562281ee0af6725a2fd13f30a6f7 100644 (file)
@@ -328,6 +328,18 @@ find_ext2_link(struct hdac_bus *bus, bool alt, int elid)
        return NULL;
 }
 
+int hdac_bus_eml_get_count(struct hdac_bus *bus, bool alt, int elid)
+{
+       struct hdac_ext2_link *h2link;
+
+       h2link = find_ext2_link(bus, alt, elid);
+       if (!h2link)
+               return 0;
+
+       return h2link->slcount;
+}
+EXPORT_SYMBOL_NS(hdac_bus_eml_get_count, SND_SOC_SOF_HDA_MLINK);
+
 static int hdac_bus_eml_power_up_base(struct hdac_bus *bus, bool alt, int elid, int sublink,
                                      bool eml_lock)
 {