summaryrefslogtreecommitdiff
path: root/sound/soc/intel
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2023-07-31 16:42:53 -0500
committerMark Brown <broonie@kernel.org>2023-07-31 23:22:39 +0100
commit009582008182bc0a2956d245fd0362e036f31dfe (patch)
treed2fba29ab1ecbc8b3accc3a8427fe22ce989a14e /sound/soc/intel
parent656dd91a3a1ca27a02d9a79d1720b2ca40d272cf (diff)
ASoC: intel: sof_sdw: Allow direct specification of CODEC name
Add support for MFD based CODEC drivers, by allowing the CODEC name to not be the SoundWire device directly. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20230731214257.444605-20-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel')
-rw-r--r--sound/soc/intel/boards/sof_sdw.c6
-rw-r--r--sound/soc/intel/boards/sof_sdw_common.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c
index 846ba8e1515c..e6faed2b99b2 100644
--- a/sound/soc/intel/boards/sof_sdw.c
+++ b/sound/soc/intel/boards/sof_sdw.c
@@ -1174,7 +1174,11 @@ static int create_codec_dai_name(struct device *dev,
class_id = SDW_CLASS_ID(adr);
comp_index = i - adr_index + offset;
- if (is_unique_device(adr_link, sdw_version, mfg_id, part_id,
+ if (codec_info_list[codec_index].codec_name) {
+ codec[comp_index].name =
+ devm_kstrdup(dev, codec_info_list[codec_index].codec_name,
+ GFP_KERNEL);
+ } else if (is_unique_device(adr_link, sdw_version, mfg_id, part_id,
class_id, i)) {
codec_str = "sdw:%01x:%04x:%04x:%02x";
codec[comp_index].name =
diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h
index 37402170d5f9..fe234b98eb64 100644
--- a/sound/soc/intel/boards/sof_sdw_common.h
+++ b/sound/soc/intel/boards/sof_sdw_common.h
@@ -80,6 +80,7 @@ struct sof_sdw_dai_info {
struct sof_sdw_codec_info {
const int part_id;
const int version_id;
+ const char *codec_name;
int amp_num;
const u8 acpi_id[ACPI_ID_LEN];
const bool ignore_pch_dmic;