summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2023-07-31 16:32:37 -0500
committerMark Brown <broonie@kernel.org>2023-07-31 23:24:00 +0100
commit799d9933ba47d9b679637fa17454ed81ac353f52 (patch)
tree4f3fbd5da9fd75a146aab5faf80d253b0e8b187c
parent169e154b8f338e022f09536cfca7eb4f38aa80a4 (diff)
ASoC: SOF: Intel: start simplify the signature of link_slaves_found()
Start removing Intel-specific arguments to make that function usable by other SOC vendors. 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> Link: https://lore.kernel.org/r/20230731213242.434594-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/sof/intel/hda.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index 64bebe1a72bb..6d9fafb58581 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -1433,13 +1433,11 @@ static void hda_generic_machine_select(struct snd_sof_dev *sdev,
SDW_MFG_ID_MASK | SDW_PART_ID_MASK))
/* Check if all Slaves defined on the link can be found */
-static bool link_slaves_found(struct snd_sof_dev *sdev,
+static bool link_slaves_found(struct device *dev,
const struct snd_soc_acpi_link_adr *link,
- struct sdw_intel_ctx *sdw)
+ struct sdw_intel_slave_id *ids,
+ int num_slaves)
{
- struct hdac_bus *bus = sof_to_bus(sdev);
- struct sdw_intel_slave_id *ids = sdw->ids;
- int num_slaves = sdw->num_slaves;
unsigned int part_id, link_id, unique_id, mfg_id, version;
int i, j, k;
@@ -1487,19 +1485,16 @@ static bool link_slaves_found(struct snd_sof_dev *sdev,
unique_id = SDW_UNIQUE_ID(adr);
if (reported_part_count == 1 ||
ids[j].id.unique_id == unique_id) {
- dev_dbg(bus->dev, "found %x at link %d\n",
- part_id, link_id);
+ dev_dbg(dev, "found %x at link %d\n", part_id, link_id);
break;
}
} else {
- dev_dbg(bus->dev, "part %x reported %d expected %d on link %d, skipping\n",
+ dev_dbg(dev, "part %x reported %d expected %d on link %d, skipping\n",
part_id, reported_part_count, expected_part_count, link_id);
}
}
if (j == num_slaves) {
- dev_dbg(bus->dev,
- "Slave %x not found\n",
- part_id);
+ dev_dbg(dev, "Slave %x not found\n", part_id);
return false;
}
}
@@ -1549,7 +1544,7 @@ static struct snd_soc_acpi_mach *hda_sdw_machine_select(struct snd_sof_dev *sdev
* Try next machine if any expected Slaves
* are not found on this link.
*/
- if (!link_slaves_found(sdev, link, hdev->sdw))
+ if (!link_slaves_found(sdev->dev, link, hdev->sdw->ids, hdev->sdw->num_slaves))
break;
}
/* Found if all Slaves are checked */